示例#1
0
        public virtual void Cross(IScenePresence agent, bool isFlying, GridRegion crossingRegion)
        {
            Vector3 newposition = new Vector3(agent.AbsolutePosition.X, agent.AbsolutePosition.Y, agent.AbsolutePosition.Z);;

            CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;

            d.BeginInvoke(agent, newposition, crossingRegion, isFlying, CrossAgentToNewRegionCompleted, d);
        }
示例#2
0
        protected void CrossAgentToNewRegionCompleted(IAsyncResult iar)
        {
            CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
            IScenePresence agent = icon.EndInvoke(iar);

            // If the cross was successful, this agent is a child agent
            // Otherwise, put them back in the scene
            if (!agent.IsChildAgent)
            {
                bool m_flying = ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
                agent.AddToPhysicalScene(m_flying, false);
            }

            // In any case
            agent.NotInTransit();

            //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
        }