public void RemovePlayer(Guid id) { PlayerHandler player = Players[id]; UsernameDatabase.Save(player.username, player); ChunkManager.Get.RemovePlayer(player); Destroy(player.gameObject); Players.Remove(id); }
private void OnApplicationQuit() { foreach (var player in Players.Values) { UsernameDatabase.Save(player.username, player); } UsernameDatabase.Save(); GameData data = new GameData(); data.ServerTick = ServerTick; GameData.Save(data); }