コード例 #1
0
        public void RemovePlayer(Guid id)
        {
            PlayerHandler player = Players[id];

            UsernameDatabase.Save(player.username, player);
            ChunkManager.Get.RemovePlayer(player);

            Destroy(player.gameObject);
            Players.Remove(id);
        }
コード例 #2
0
        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);
        }