Exemple #1
0
        public static async Task <bool> Delete(SAO_Kingdoms _kingdom_)
        {
            var  _s = ThereIsServer.ServersInfo.ServerManager.Get_Kingdom_Server(_kingdom_);
            var  _target = KingdomInfo_LOC;
            bool _del1 = false, _del2, _del3;

            if (await ThereIsServer.Actions.Exists(_s, _target))
            {
                var _existing = await ThereIsServer.Actions.GetAllContentsByRef(_s, _target);

                var _req = new DataBaseDeleteRequest(MESSAGE, _existing.Sha.GetStrong());
                _del1 = await ThereIsServer.Actions.DeleteData(_s, _target, _req);
            }
            _del2 = await KingdomRankings.DeleteRankings(_kingdom_);

            _del3 = await KingdomThrone.DeleteThrone(_kingdom_);

            return(_del1 && _del2 && _del3);
        }
Exemple #2
0
        public static async Task <KingdomInfo> GetKingdomInfo(SAO_Kingdoms _kingdom_)
        {
            KingdomInfo kingdomInfo = new KingdomInfo(_kingdom_)
            {
                Index = (uint)_kingdom_,
            };
            //---------------------------------------------
            var _s        = ThereIsServer.ServersInfo.ServerManager.Get_Kingdom_Server(kingdomInfo.Provider);
            var _target   = KingdomInfo_LOC;
            var _existing = await ThereIsServer.Actions.GetAllContentsByRef(_s, _target);

            //---------------------------------------------
            if (_existing.IsDeadCallBack || ThereIsServer.ServerSettings.HasConnectionClosed)
            {
                NoInternetConnectionSandBox.PrepareConnectionClosedSandBox();
                return(null); // don't set ServerSettings.IsWaitingForServerChecking = false;
            }
            kingdomInfo.SetParams(_existing.Decode());
            kingdomInfo.Rankings = await KingdomRankings.GetKingdomRankings(kingdomInfo);

            kingdomInfo.Throne = await KingdomThrone.GetKingdomThrone(kingdomInfo);

            return(kingdomInfo);
        }