Exemplo n.º 1
0
        public static ChatBlockList Parse(StrongString serverStringValue)
        {
            ChatBlockList blockList;

            StrongString[] myStrings =
                serverStringValue.Split(CharSeparator);
            blockList = new ChatBlockList(myStrings);
            return(blockList);
        }
Exemplo n.º 2
0
        public static async Task <DataBaseDataChangedInfo> CreateNewConfiguration(ChatChannels channel)
        {
            ChatConfiguration configuration = new ChatConfiguration(channel)
            {
                Status     = ChatChannelStatus.FreeForAll,
                ItemPrice  = "notSet",
                MinimumLvl = 0,
                BanList    = ChatBlockList.GenerateBlankChatBlockList(),
            };

            configuration.SetLimitationTime();
            return(await ThereIsServer.Actions.CreateFile(ThereIsServer.ServersInfo.MyServers[BasicDataBaseNum + (int)channel],
                                                          DataBaseLocation, new DataBaseCreation("Created By SAO_Game",
                                                                                                 QString.Parse(configuration.GetForServer(), false))));
        }
Exemplo n.º 3
0
        //-------------------------------------------------
        #region static Methods Region
        private static ChatConfiguration Parse(StrongString serverValue, ChatChannels channels)
        {
            ChatConfiguration configuration;

            StrongString[] myTStrings = serverValue.Split(OutCharSeparator);
            StrongString[] myStrings  = myTStrings[ConfigurationPosition].Split(InCharSeparator);
            configuration = new ChatConfiguration(channels)
            {
                Status     = (ChatChannelStatus)myStrings[0].ToUInt16(),
                ItemPrice  = myStrings[1].GetValue(),
                MinimumLvl = myStrings[2].ToUInt16(),
                BanList    = ChatBlockList.Parse(myTStrings[BanListPosition]),
            };
            StrongString[] banTime = myTStrings[BanTimePosition].Split(InCharSeparator);
            configuration.SetLimitationTime(banTime);
            return(configuration);
        }
Exemplo n.º 4
0
        public static async Task <DataBaseDataChangedInfo> CreateNewConfiguration(ChatChannels channel)
        {
            ChatConfiguration configuration = new ChatConfiguration(channel)
            {
                Status     = ChatChannelStatus.FreeForAll,
                ItemPrice  = "notSet",
                MinimumLvl = 0,
                BanList    = ChatBlockList.GenerateBlankChatBlockList(),
            };

            configuration.SetLimitationTime();
            //---------------------------------------------
            var _s   = ThereIsServer.ServersInfo.ServerManager.Get_Channel_Server(channel);
            var _req = new DataBaseCreation(MESSAGE, QString.Parse(configuration.GetForServer()));

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

            //---------------------------------------------
        }
Exemplo n.º 5
0
        public async Task <bool> ReloadChatConfiguration()
        {
            var existingFile =
                await ThereIsServer.Actions.GetAllContentsByRef(
                    ThereIsServer.ServersInfo.MyServers[BasicDataBaseNum + (int)TheChannel],
                    DataBaseLocation);

            if (existingFile.IsDeadCallBack || ThereIsServer.ServerSettings.HasConnectionClosed)
            {
                NoInternetConnectionSandBox.PrepareConnectionClosedSandBox();
                return(false); // don't set ServerSettings.IsWaitingForServerChecking = false;
            }
            StrongString[] myTStrings = existingFile.Decode().Split(OutCharSeparator);
            StrongString[] myStrings  = myTStrings[ConfigurationPosition].Split(InCharSeparator);
            StrongString[] banTime    = myTStrings[BanTimePosition].Split(InCharSeparator);
            Status     = (ChatChannelStatus)myStrings[0].ToInt32();
            ItemPrice  = myStrings[1].GetValue();
            MinimumLvl = myStrings[2].ToUInt16();
            BanList    = ChatBlockList.Parse(myTStrings[BanListPosition]);
            SetLimitationTime(banTime);
            return(true);
        }