예제 #1
0
        public static async Task <bool> DeleteRankings(SAO_Kingdoms _kingdom_)
        {
            var _b1 = await PowerRankings.DeletePowerRankings(_kingdom_);

            var _b2 = await LevelRankings.DeleteLevelRankings(_kingdom_);

            return(_b1 && _b2);
        }
예제 #2
0
        public IServerProvider <QString, DataBaseClient> Get_Kingdom_Server(SAO_Kingdoms _kingdom_)
        {
            if (_kingdom_ == SAO_Kingdoms.NotSet)
            {
                return(ServerInfo.GetInvalid());
            }
            var _index = (int)_kingdom_ - 1;

            return(_kingdoms_servers[_index]);
        }
예제 #3
0
        //-------------------------------------------------
        public static async Task <DataBaseDataChangedInfo> CreateKingdomInfo(SAO_Kingdoms index)
        {
            KingdomInfo kingdomInfo = new KingdomInfo(index)
            {
                Index        = (uint)index,
                KingdomName  = index.ToString(),
                KingsPower   = Unit.GetBasicUnit(),
                KingdomLevel = 0,
            };

            return
                (await ThereIsServer.Actions.CreateFile(ThereIsServer.ServersInfo.MyServers[(uint)index],
                                                        KingdomInfoFileName, new DataBaseCreation("Created By SAO_Game",
                                                                                                  QString.Parse(kingdomInfo.GetForServer(), false))));
        }
예제 #4
0
        public static async Task <bool> DeleteLevelRankings(SAO_Kingdoms _kingdom_)
        {
            var _s      = ThereIsServer.ServersInfo.ServerManager.Get_Kingdom_Server(_kingdom_);
            var _target = LevelRankings_LOC;

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

                var _req = new DataBaseDeleteRequest(MESSAGE, existing.Sha.GetStrong());
                var _del = await ThereIsServer.Actions.DeleteData(_s, _target, _req);

                return(_del);
            }
            return(true);
        }
예제 #5
0
        //-------------------------------------------------
        #region static Method's Region
        public static async Task <DataBaseDataChangedInfo> CreateKingdomInfo(SAO_Kingdoms index)
        {
            KingdomInfo kingdomInfo = new KingdomInfo(index)
            {
                Index        = (uint)index,
                KingdomName  = index.ToString(),
                KingsPower   = Unit.GetBasicUnit(),
                KingdomLevel = 0,
            };
            //---------------------------------------------
            var _s      = ThereIsServer.ServersInfo.ServerManager.Get_Kingdom_Server(index);
            var _target = KingdomInfo_LOC;
            var _req    = new DataBaseCreation(MESSAGE, QString.Parse(kingdomInfo.GetForServer()));

            return(await ThereIsServer.Actions.CreateData(_s, _target, _req));

            //---------------------------------------------
        }
예제 #6
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);
        }
예제 #7
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);
        }
예제 #8
0
 //-------------------------------------------------
 #region Constructor's Region
 private KingdomInfo(SAO_Kingdoms provider)
 {
     Provider = provider;
 }
예제 #9
0
 public static async Task <KingdomInfo> GetKingdomInfo(SAO_Kingdoms index)
 {
     return(await GetKingdomInfo((uint)index));
 }
예제 #10
0
 public void SetPlayerKingdom(SAO_Kingdoms playerKingdom)
 {
     PlayerKingdom = playerKingdom;
 }