public static GroupNameCheckResult _CheckGroupName(string name) { Regex regex = new Regex(FeatureMatrix.GetString("GuildNamingRule"), RegexOptions.Compiled); Regex regex2 = new Regex("^[a-zA-Z0-9_]*$", RegexOptions.Compiled); bool flag = regex2.IsMatch(name); if ((flag && name.Length > FeatureMatrix.GetInteger("GuildNamingRuleMaxBytes")) || (!flag && name.Length > FeatureMatrix.GetInteger("GuildNamingRuleMaxBytes") / 2)) { return(GroupNameCheckResult.NotMatchedNamingRuleMaxBytes); } if (!regex.IsMatch(name)) { return(GroupNameCheckResult.NotMatchedNamingRule); } int integer = FeatureMatrix.GetInteger("NamingRuleRepeatingCharCheckCount"); if (integer > 0) { string text = string.Empty; foreach (char c in name) { if (!string.IsNullOrEmpty(text) && text[text.Length - 1] != c) { text = string.Empty; } text += c; if (text.Length > integer) { return(GroupNameCheckResult.RepeatedCharacters); } } } return(GroupNameCheckResult.Succeed); }
public bool AddQueue() { DSWaitingSystem dswaitingSystem = this.service.DSWaitingSystem; if (dswaitingSystem != null) { string argString = base.Operation.GetArgString(0, ""); if (argString == "reset") { string @string = FeatureMatrix.GetString("DSQuestSetting"); using (IEnumerator <string> enumerator = (from q in @string.Split(new char[] { ',' }) where q != "" select q).GetEnumerator()) { while (enumerator.MoveNext()) { string text = enumerator.Current; dswaitingSystem.AddWaitingQueue(text.Trim(), -1, true); } return(true); } } int argInt = base.Operation.GetArgInt(1, -1); dswaitingSystem.AddWaitingQueue(argString, argInt, true); } else { DSService.RequestDSBossOperation(base.Operation); } return(true); }
public static bool IsAllServiceReady() { bool flag = Settings.Default.ignoreDSServiceReady; if (!flag) { string text = FeatureMatrix.GetString("DSQuestSetting") ?? ""; if (text.Length == 0 || AdminClientService.Instance.DSServiceIDs().Length > 0) { flag = true; } } return(AdminClientService.Instance.FrontendServiceIDs().Length > 0 && AdminClientService.Instance.MicroPlayServiceIDs().Length > 0 && AdminClientService.Instance.CharacterServiceIDs().Length > 0 && AdminClientService.Instance.ItemServiceIDs().Length > 0 && AdminClientService.Instance.StoryServiceIDs().Length > 0 && AdminClientService.Instance.QuestOwnershipServiceIDs().Length > 0 && flag); }
public static int GetDSProcessCount() { string text = FeatureMatrix.GetString("DSProcessCount").ToUpper(); if (text == "" || text == null) { return(0); } if (text.Contains('C')) { int num = text.IndexOf('C'); string str = text.Substring(0, num); string str2 = (text.Length > num) ? text.Substring(num + 1) : ""; return(DSService.ToInt(str, 1) * DSService.GetCoreCount() + DSService.ToInt(str2, 0)); } return(DSService.ToInt(text, 1)); }
public DSStorage() { this.GiantRaidProcessFormula = FeatureMatrix.GetString("DSGiantRaidProcessCount"); this.NormalRaidProcessFormula = FeatureMatrix.GetString("DSNormalRaidProcessCount"); this.PvpProcessFormula = FeatureMatrix.GetString("DSPvpProcessCount"); this.GiantRaidMachineCount = new int?(ServiceCoreSettings.Default.DSGiantRaidMachineCount); this.NormalRaidMachineCount = new int?(ServiceCoreSettings.Default.DSNormalRaidMachineCount); this.PvpMachineCount = new int?(ServiceCoreSettings.Default.DSPvpMachineCount); this.DevMachineCount = new int?(ServiceCoreSettings.Default.DSDevMachineCount); this.IsolateNormalRaidMachineCount = new int?(ServiceCoreSettings.Default.DSIsolateNormalRaidMachineCount); this.DSTypeForLeftOvers = new List <DSType>(); if (this.GiantRaidMachineCount == -1) { this.DSTypeForLeftOvers.Add(DSType.GiantRaid); } if (this.NormalRaidMachineCount == -1) { this.DSTypeForLeftOvers.Add(DSType.NormalRaid); } if (this.PvpMachineCount == -1) { this.DSTypeForLeftOvers.Add(DSType.Pvp); } if (this.DevMachineCount == -1) { this.DSTypeForLeftOvers.Add(DSType.Dev_All); } this.IsolateNormalQuest = new List <string>(); string[] array = ServiceCoreSettings.Default.DSIsolateNormalQuest.Split(new char[] { ',', ';' }); foreach (string input in array) { string item = Regex.Replace(input, "\\s", ""); this.IsolateNormalQuest.Add(item); } this.DSMachineCount = new Dictionary <DSType, int>(); this.PvpDSMap = new Dictionary <int, DSInfo>(); this.DSMap = new Dictionary <int, DSInfo>(); this.DSShipMap = new Dictionary <int, DSShip>(); }
public static int ReCheckCount(int idStart, int count) { if (!FeatureMatrix.IsEnable("DSNormalRaid") || idStart < ServiceCoreSettings.Default.DSGiantCount || ServiceCoreSettings.Default.DSGiantCount < 0) { return(count); } string text = FeatureMatrix.GetString("DSNormalCount").ToUpper(); if (text == "" || text == null) { return(0); } if (text.Contains("P")) { int num = text.IndexOf('P'); string str = text.Substring(0, num); string str2 = (text.Length > num) ? text.Substring(num + 1) : ""; return(DSService.ToInt(str, 1) * count + DSService.ToInt(str2, 0)); } return(DSService.ToInt(text, 1)); }