Exemplo n.º 1
0
        public void OnPlayerLeaveGame(INetworkConnection sender, Packet gmsg)
        {
            PacketGenericMessage msg = gmsg as PacketGenericMessage;
            GameServerGame       g   = ServerUser.CurrentCharacter.GetCurrentGame();

            if (g != null)
            {
                g.RemovePlayer(ServerUser.CurrentCharacter, "left the game.", true);
                g.RemoveObserver(ServerUser.CurrentCharacter);
            }
        }
Exemplo n.º 2
0
        protected override void OnSocketKilled(string msg)
        {
            if (ServerUser != null && ServerUser.CurrentCharacter != null)
            {
                GameServerGame gsg = ServerUser.CurrentCharacter.GetCurrentGame();
                if (gsg != null)
                {
                    gsg.RemovePlayer(ServerUser.CurrentCharacter, "Disconnected.", true);
                    gsg.RemoveObserver(ServerUser.CurrentCharacter);
                }

                CharacterCache.UncacheCharacter(ServerUser.CurrentCharacter.ID);
            }

            base.OnSocketKilled(msg);
            DB.Instance.Server_Register(MyServer.ServerUserID, MyServer.ServerAddress, MyServer.ListenOnPort, DateTime.UtcNow, "content", ConnectionManager.PaddedConnectionCount, MyServer.MaxConnections);
        }