Пример #1
0
        private void ExitWorld()
        {
            log.InfoFormat("Player.ExitWorld(): {0}  object state = {1}", GetComponent <PlayerCharacterObject>().login, (bool)nebulaObject);
            //reset target when exiting world
            mTarget.Clear();

            var worldExited = new WorldExited {
                WorldName = ((MmoWorld)this.World).Name
            };

            this.Dispose();

            // set initial handler
            ((MmoPeer)this.Peer).SetCurrentOperationHandler((MmoPeer)this.Peer);

            var eventData = new EventData((byte)EventCode.WorldExited, worldExited);

            UpdateCharacterOnMaster();


            //var loader = GetComponent<PlayerLoaderObject>();
            //if(loader != null) {
            //    loader.Save(true);
            //}
            // use item channel to ensure that this event arrives in correct order with move/subscribe events
            this.Peer.SendEvent(eventData, new SendParameters {
                ChannelId = Settings.ItemEventChannel
            });

            //CL.Out(LogFilter.PLAYER, "ExitWorld() Player {0} from world {1}".f(name, ((MmoWorld)this.World).Name));
        }
Пример #2
0
        private void ExitWorld(MmoActor actor)
        {
            //reset target when exiting world
            actor.GetComponent <PlayerTarget>().Clear();
            actor.GetComponent <PlayerLoaderObject>().Save(true);

            var worldExited = new WorldExited {
                WorldName = ((MmoWorld)actor.World).Name
            };

            actor.nebulaObject.SetInvisibility(false);
            actor.Dispose();

            // set initial handler
            ((MmoPeer)actor.Peer).SetCurrentOperationHandler((MmoPeer)actor.Peer);

            var eventData = new EventData((byte)EventCode.WorldExited, worldExited);

            actor.UpdateCharacterOnMaster();



            // use item channel to ensure that this event arrives in correct order with move/subscribe events
            actor.Peer.SendEvent(eventData, new SendParameters {
                ChannelId = Settings.ItemEventChannel
            });

            CL.Out(LogFilter.PLAYER, "ExitWorld() Player {0} from world {1}".f(actor.name, ((MmoWorld)actor.World).Name));
        }
        private void ExitWorld()
        {
            var worldExited = new WorldExited {
                WorldName = ((World)this.World).Name
            };

            this.Dispose();

            // set initial handler
            ((MmoPeer)this.Peer).SetInitialOperationhandler();

            var eventData = new EventData((byte)EventCode.WorldExited, worldExited);

            // use item channel to ensure that this event arrives in correct order with move/subscribe events
            this.Peer.SendEvent(eventData, new SendParameters {
                ChannelId = Settings.ItemEventChannel
            });
        }