protected async override void OnDestroy()
        {
            // Save immediately
#if UNITY_STANDALONE && !CLIENT_BUILD
            if (IsServer)
            {
                foreach (BasePlayerCharacterEntity playerCharacter in ServerUserHandlers.GetPlayerCharacters())
                {
                    if (playerCharacter == null)
                    {
                        continue;
                    }
                    await DbServiceClient.UpdateCharacterAsync(new UpdateCharacterReq()
                    {
                        CharacterData = playerCharacter.CloneTo(new PlayerCharacterData())
                    });
                }
                string mapName = CurrentMapInfo.Id;
                foreach (BuildingEntity buildingEntity in ServerBuildingHandlers.GetBuildings())
                {
                    if (buildingEntity == null)
                    {
                        continue;
                    }
                    await DbServiceClient.UpdateBuildingAsync(new UpdateBuildingReq()
                    {
                        MapName      = mapName,
                        BuildingData = buildingEntity.CloneTo(new BuildingSaveData())
                    });
                }
            }
#endif
            base.OnDestroy();
        }
        private async UniTask SaveCharacterRoutine(PlayerCharacterData playerCharacterData, string userId)
        {
            if (playerCharacterData != null && !savingCharacters.Contains(playerCharacterData.Id))
            {
                savingCharacters.Add(playerCharacterData.Id);
                // Update character
                await DbServiceClient.UpdateCharacterAsync(new UpdateCharacterReq()
                {
                    CharacterData = playerCharacterData.ToByteString()
                });

                savingCharacters.Remove(playerCharacterData.Id);
                if (LogInfo)
                {
                    Logging.Log(LogTag, "Character [" + playerCharacterData.Id + "] Saved");
                }
            }
        }
        private async UniTask SaveCharacterRoutine(PlayerCharacterData playerCharacterData, List <CharacterBuff> summonBuffs)
        {
            if (playerCharacterData != null && !savingCharacters.Contains(playerCharacterData.Id))
            {
                savingCharacters.Add(playerCharacterData.Id);
                // Update character
                await DbServiceClient.UpdateCharacterAsync(new UpdateCharacterReq()
                {
                    CharacterData = playerCharacterData,
                });

                await DbServiceClient.SetSummonBuffsAsync(new SetSummonBuffsReq()
                {
                    CharacterId = playerCharacterData.Id,
                    SummonBuffs = summonBuffs,
                });

                savingCharacters.Remove(playerCharacterData.Id);
                if (LogInfo)
                {
                    Logging.Log(LogTag, "Character [" + playerCharacterData.Id + "] Saved");
                }
            }
        }