private ProcessLogout ( Player player ) : void | ||
player | Player | |
Результат | void |
// Remove player from the list, and notify remaining players public void UnregisterPlayer(Player player) { if (player == null) { log.Log("World.UnregisterPlayer: Trying to unregister a non-existent (null) player.", LogType.Debug); return; } lock ( playerListLock ) { if (players[player.id] == player) { log.Log("{0} left the server.", LogType.UserActivity, player.name); db.ProcessLogout(player); db.Save(); players[player.id] = null; playerCount--; SendToAll(PacketWriter.MakeRemoveEntity(player.id), null); SendToAll(PacketWriter.MakeMessage(Color.Sys + player.name + " left the server."), null); UpdatePlayerList(); } else { log.Log("World.UnregisterPlayer: Trying to unregister a non-existent (unknown id) player.", LogType.Warning); } } }