Beispiel #1
0
        /// <summary>
        /// Called by the transit manager when this avatar has entered a new transit stage
        /// </summary>
        /// <param name="stage"></param>
        public async Task TransitStateChange(AvatarTransit.TransitStage stage, IEnumerable <uint> rideOnPrimIds)
        {
            if (stage == AvatarTransit.TransitStage.SendBegin)
            {
                Physics.Manager.PhysicsActor pa = ScenePresence.PhysicsActor;

                if (pa != null)
                {
                    ScenePresence.PhysicsActor.Suspend();
                }

                if (_capsControl != null)
                {
                    _capsControl.PauseTraffic();
                }
                await _udpCircuit.PauseUpdatesAndFlush();
            }
            else if (stage == AvatarTransit.TransitStage.SendCompletedSuccess || stage == AvatarTransit.TransitStage.SendError)
            {
                if (_capsControl != null)
                {
                    _capsControl.ResumeTraffic();
                }
                if (stage == AvatarTransit.TransitStage.SendCompletedSuccess)
                {
                    _udpCircuit.ResumeUpdates(rideOnPrimIds);
                }
                else
                {
                    _udpCircuit.ResumeUpdates(null);    // don't kill object update if not leaving region
                }
                if (stage == AvatarTransit.TransitStage.SendError)
                {
                    Physics.Manager.PhysicsActor pa = ScenePresence.PhysicsActor;

                    if (pa != null)
                    {
                        pa.Resume(false, null);
                    }
                }
            }
        }