public override void Close(string reason) { if (m_account != null) { Account = null; } if (m_character != null) { LoginServer.LeaveWorld(this); LoginServer.RemoveCharacter(this); } Console.WriteLine(this + " closed: " + reason); base.Close(reason); }
static void OnPlayerLeaveWorld(WorldConnection connection, WORLDMSG msgID, BinReader data) { LoginClient client = LoginServer.GetLoginClientByCharacterID(data.ReadUInt32()); if (client == null) { return; } if (client.IsLoggingOut) { LoginServer.RemoveCharacter(client); BinWriter pkg = LoginClient.NewPacket(SMSG.LOGOUT_COMPLETE); client.Send(pkg); client.IsLoggingOut = false; client.WorldConnection = null; } else if (client.IsChangingMap) { } else { client.Close("Kicked from worldserver."); } }