internal static string GetKnownPath(string enumName) { string res = ""; try { if (enumName.ToLower() == "workdir") { res = ConfigParser.GetConfig().workDir; } else { KnownFolder knownFolder = (KnownFolder)Enum.Parse(typeof(KnownFolder), enumName, true); res = GetPath(knownFolder); } } #if DEBUG catch (Exception e) #else catch (Exception) #endif { #if DEBUG Logger.GetLogger().Error("GetKnownPath of " + enumName + " failed: " + e); #endif } finally { } return(res); }
internal int Activate() { if (!Parsed) { ParseProducts(); } int pkgStartedCount = 0; List <ProductSettings> productsSettings = ConfigParser.GetConfig().GetProductsSettings(); foreach (KeyValuePair <string, InstallationPackage> pkg in _packageDictionary) { if ((pkg.Value.InstallationState >= InstallationPackage.State.Init && pkg.Value.InstallationState < InstallationPackage.State.DownloadStart) || pkg.Value.InstallationState == InstallationPackage.State.Error) { ProductSettings prodSettings = productsSettings.FirstOrDefault(prod => prod.Name == pkg.Key); if (!string.IsNullOrEmpty(prodSettings.Name)) { pkg.Value.SetDownloadInfo(prodSettings); pkg.Value.SetExtractInfo(prodSettings); string extraParams = ConfigParser.GetConfig().GetConfigValue("EXTRA_PARAMS"); prodSettings.RunParams += string.IsNullOrEmpty(extraParams) ? string.Empty : " " + extraParams; pkg.Value.SetRunInfo(prodSettings); pkgStartedCount += pkg.Value.Activate() ? 1 : 0; } } } Activated = true; return(pkgStartedCount); }
public static void CleanWorkDir() { lock (ConfigParser.GetConfig().workDir) { if (Directory.Exists(ConfigParser.GetConfig().workDir)) { DeleteDirectory(ConfigParser.GetConfig().workDir); } } }
public static void Main(string[] args) { var configParser = new ConfigParser(_logger, FileLocations.Feeds, FileLocations.Config); var config = configParser.GetConfig(); var rssWebhookEntities = configParser.GetFeeds(); Client = new Client(_logger); RssAnalyzer = new RssFeedAnalyzer(rssWebhookEntities, Client); Task.Run(async() => await Run(config)); Console.ReadKey(); }
internal virtual int ParseProducts() { if (Activated) { #if DEBUG Logger.GetLogger().Warning($"can't parse after activation"); #endif return(0); } productLayoutManager.OnLayoutShown += SetPackageStateToDisplayed; SetProductsSettings(ConfigParser.GetConfig().GetProductsSettings()); Parsed = true; return(_packageDictionary.Count()); }
public ProductLayout4(ControlsLayout controlsLayout) { InitializeComponent(); Color FontColor = ConfigParser.GetConfig().GetColorValue("//Main/FormDesign/FontColor"); if (FontColor != null) { txtDisclaimer.ForeColor = FontColor; txtTitle.ForeColor = FontColor; txtDescription.ForeColor = FontColor; } controlsLayout.SetLayout(pnlLayout.Controls); Dock = DockStyle.Fill; }
public OptLayout(Panel layout, int blinkMax) { pnlLayout = layout; optIn = pnlLayout.Controls.Find("txtOptIn", true).FirstOrDefault() as CheckBox; smOptInY = pnlLayout.Controls.Find("txtSmOptInY", true).FirstOrDefault() as RadioButton; smOptInN = pnlLayout.Controls.Find("txtSmOptInN", true).FirstOrDefault() as RadioButton; smOptInText = pnlLayout.Controls.Find("txtSmOptIn", true).FirstOrDefault() as RichTextBoxEx; smOptInBg = pnlLayout.Controls.Find("imgSmOpInBg", true).FirstOrDefault() as PictureBoxEx; txtTitle = pnlLayout.Controls.Find("txtTitle", true).FirstOrDefault() as RichTextBoxEx; darkenProductOverlay = pnlLayout.Controls.Find("pnlDarkenOverlay", true).FirstOrDefault() as Panel; darkenProductOverlay.Size = pnlLayout.Size; imgDarkenOverlay = new PictureBox { Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right, Location = pnlLayout.Location, Name = "imgDarkenOverlay", Size = pnlLayout.Size, TabStop = false, Visible = false }; pnlLayout.Controls.Add(imgDarkenOverlay); string opt = ConfigParser.GetConfig().GetStringValue("//RemoteConfiguration/FlowSettings/OptType", OptType.IN); if (opt == OptType.SMART && (smOptInText == null || string.IsNullOrEmpty(smOptInText.Text))) // Fallback if the remote config not relevant { opt = OptType.IN; } if (opt == OptType.IN) { optIn.Visible = true; } else if (opt == OptType.SMART) { smOptInY.Visible = true; smOptInN.Visible = true; } this.opt = opt; this.blinkMax = blinkMax; InitTimer(); }
private void LoadForm(Form nextForm) { if (nextForm != null) { #if DEBUG Logger.GetLogger().Info("Loading FormName " + nextForm.Name); #endif frmParent.PerformSafely(() => { currentForm = nextForm; currentForm.TopLevel = false; currentForm.AutoScroll = true; currentForm.Dock = DockStyle.Fill; frmParent.pnlContent.Controls.Clear(); frmParent.pnlContent.Controls.Add(currentForm); currentForm.Show(); currentForm.Activate(); }); ConfigParser.GetConfig().SessionData[SessionDataConsts.CURRENT_FORM] = currentForm.Name; OnLoadForm?.Invoke(currentForm.Name); } }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } AccessLevel tempAccessLevel; Type[] tempTypeArray; double tempDouble; bool tempBool; int tempInt; try { TokenType = Type.GetType("Server.Items.Daat99Tokens"); TokenCheckType = Type.GetType("Server.Items.TokenCheck"); } catch (Exception exc) { Console.WriteLine("Error attempting to load token classes {0}...", exc.Message); } foreach (Element child in element.ChildElements) { if (child.TagName == "MessageHue" && child.GetIntValue(out tempInt)) { MessageHue = tempInt; } else if (child.TagName == "DaysForConfirmation" && child.GetIntValue(out tempInt)) { DaysForConfirmation = tempInt; } else if (child.TagName == "MaxReserveMultiplier" && child.GetDoubleValue(out tempDouble)) { MaxReserveMultiplier = tempDouble; } else if (child.TagName == "BlackHue" && child.GetIntValue(out tempInt)) { BlackHue = tempInt; } else if (child.TagName == "AllowPetsAuction" && child.GetBoolValue(out tempBool)) { AllowPetsAuction = tempBool; } else if (child.TagName == "AuctionAdminAcessLevel" && child.GetAccessLevelValue(out tempAccessLevel)) { AuctionAdminAcessLevel = tempAccessLevel; } else if (child.TagName == "ClilocLocation" && null != child.Text) { ClilocLocation = child.Text; } else if (child.TagName == "EnableLogging" && child.GetBoolValue(out tempBool)) { EnableLogging = tempBool; } else if (child.TagName == "LateBidExtention" && child.GetDoubleValue(out tempDouble)) { LateBidExtention = TimeSpan.FromMinutes(tempDouble); } else if (child.TagName == "CostOfAuction" && child.GetDoubleValue(out tempDouble)) { CostOfAuction = tempDouble; } else if (child.TagName == "ForbiddenTypes" && child.GetArray(out tempTypeArray)) { ForbiddenTypes = tempTypeArray; } else if (child.TagName == "InterestHour" && child.GetIntValue(out tempInt)) { InterestHour = tempInt; } else if (child.TagName == "GoldInterestRate" && child.GetDoubleValue(out tempDouble)) { GoldInterestRate = tempDouble; } else if (child.TagName == "TokensInterestRate" && child.GetDoubleValue(out tempDouble)) { TokensInterestRate = tempDouble; } else if (child.TagName == "EnableTokens" && child.GetBoolValue(out tempBool)) { EnableTokens = tempBool; } } }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } double tempDouble; bool tempBool; int tempInt; Type[] tempTypeArray; foreach (Element child in element.ChildElements) { if (child.TagName == "PetAsStatuette" && child.GetBoolValue(out tempBool)) { PetAsStatuette = tempBool; } else if (child.TagName == "AllowLocking" && child.GetBoolValue(out tempBool)) { AllowLocking = tempBool; } else if (child.TagName == "ShowPetDetails" && child.GetBoolValue(out tempBool)) { ShowPetDetails = tempBool; } else if (child.TagName == "ShrunkenWeight" && child.GetDoubleValue(out tempDouble)) { ShrunkenWeight = tempDouble; } else if (child.TagName == "BlessedLeash" && child.GetBoolValue(out tempBool)) { BlessedLeash = tempBool; } else if (child.TagName == "LootStatus" && null != child.Text && "" != child.Text) { if ("BlessStatus.All" == child.Text) { LootStatus = BlessStatus.All; } else if ("BlessStatus.BondedOnly" == child.Text) { LootStatus = BlessStatus.BondedOnly; } else if ("BlessStatus.None" == child.Text) { LootStatus = BlessStatus.None; } } else if (child.TagName == "TamingRequired" && child.GetIntValue(out tempInt)) { TamingRequired = tempInt; } else if (child.TagName == "ShrinkCharges" && child.GetIntValue(out tempInt)) { ShrinkCharges = tempInt; } else if (child.TagName == "PackAnimals" && child.GetArray(out tempTypeArray)) { PackAnimals = tempTypeArray; } } }
internal void SetProductsSettings(List <ProductSettings> productsSettings) { int maxOptionalProducts = ConfigParser.GetConfig().GetIntValue("//RemoteConfiguration/FlowSettings/MaxProducts", int.MaxValue); maxOptionalProducts = maxOptionalProducts == -1 ? int.MaxValue : maxOptionalProducts; int optionalProducts = 0; _maxConfirmedPackages = ConfigParser.GetConfig().GetIntValue("//RemoteConfiguration/FlowSettings/MaxAcceptedProducts", int.MaxValue); _maxConfirmedPackages = _maxConfirmedPackages == -1 ? int.MaxValue : _maxConfirmedPackages; _pkgConfirmedCounter = 0; foreach (ProductSettings prodSettings in productsSettings) { if (_packageDictionary.ContainsKey(prodSettings.Name)) { continue; } if (prodSettings.IsOptional && optionalProducts >= maxOptionalProducts) { #if DEBUG Logger.GetLogger().Info($"[{prodSettings.Name}] product will not be shown since the limit of optional products to show is: {maxOptionalProducts}"); #endif continue; } InstallationPackage pkg = CreatePackage(prodSettings); pkg.InstallationState = InstallationPackage.State.CheckStart; if (prodSettings.PreInstall.RequirementList != null && prodSettings.PreInstall.RequirementsList != null) { RequirementHandlers reqHandlers = new RequirementHandlers(); #if DEBUG Logger.GetLogger().Info($"[{prodSettings.Name}] Checking requirements for product:"); #endif ProductSettings tmpProdSettings = prodSettings; bool res = false; if (tmpProdSettings.Exclusive && optionalProducts > 0) { string dictionaryString = "{"; foreach (KeyValuePair <string, InstallationPackage> keyValues in _packageDictionary) { if (keyValues.Value.isOptional) { dictionaryString += keyValues.Key + ", "; } } dictionaryString = dictionaryString.TrimEnd(',', ' ') + "}"; #if DEBUG Logger.GetLogger().Info($"Exclusive {dictionaryString} <Equal> [] => False"); #endif tmpProdSettings.PreInstall.UnfulfilledRequirementType = "Exclusive"; tmpProdSettings.PreInstall.UnfulfilledRequirementDelta = dictionaryString; } else if (!string.IsNullOrEmpty(_passedExclusive)) { #if DEBUG Logger.GetLogger().Info($"Exclusive ({_passedExclusive}) <Exists> [] => False"); #endif tmpProdSettings.PreInstall.UnfulfilledRequirementType = "Exclusive"; tmpProdSettings.PreInstall.UnfulfilledRequirementDelta = $"Exclusive product {_passedExclusive} already passed"; } else if (productClasses.Contains(tmpProdSettings.Class)) { #if DEBUG Logger.GetLogger().Info($"Class ({tmpProdSettings.Class}) <Exists> [{string.Join(", ", productClasses)}] => False"); #endif tmpProdSettings.PreInstall.UnfulfilledRequirementType = "Class"; tmpProdSettings.PreInstall.UnfulfilledRequirementDelta = $"product of class {_passedExclusive} already passed"; } else { res = reqHandlers.HandlersResult(ref tmpProdSettings.PreInstall); } if (!res) { ConfigParser.GetConfig().SetProductSettingsXml(tmpProdSettings, "StaticData/PreInstall/UnfulfilledRequirement/Type", tmpProdSettings.PreInstall.UnfulfilledRequirementType); ConfigParser.GetConfig().SetProductSettingsXml(tmpProdSettings, "StaticData/PreInstall/UnfulfilledRequirement/Delta", tmpProdSettings.PreInstall.UnfulfilledRequirementDelta); pkg.ProdSettings = tmpProdSettings; pkg.InstallationState = InstallationPackage.State.Discard; continue; } } // if we got here, all requirements passed pkg.InstallationState = InstallationPackage.State.CheckPassed; if (!string.IsNullOrEmpty(prodSettings.Class)) { productClasses.Add(prodSettings.Class); } if (prodSettings.IsOptional) { optionalProducts++; } if (prodSettings.Exclusive) { _passedExclusive = prodSettings.Name; } _packageDictionary.Add(pkg.Name, pkg); pkg.HandleProgress = HandleProgressUpdate; productLayoutManager.AddProductSettings(prodSettings); } productLayoutManager.WaitForProductsSettingsControlsResources(ConfigParser.GetConfig().GetIntValue("//Config/" + ConfigConsts.REMOTE_LAYOUTS_RESOURCES_MAX_GRACETIME_MS, 0)); }
internal void Run(string runName, string runParam = "") { _runnerThread = new Thread(() => { lock (terminationLock) { try { try { Process p = null; #if DEBUG Logger.GetLogger().Info($"Running {runName} {runParam}"); #endif if (_installationPackage.RunWithBits && !FileUtils.IsRunnableFile(runName, false)) { #if DEBUG Logger.GetLogger().Info($"{runName} sets to run with BITS but it's not an executable file. BITS is not going to be used"); #endif _installationPackage.RunWithBits = false; } if (_installationPackage.RunWithBits) { BitsEnabled = true; } else { p = new Process(); p.StartInfo.FileName = runName; p.StartInfo.Arguments = runParam; p.StartInfo.UseShellExecute = !FileUtils.IsExeFileExtension(runName); } if (Path.GetExtension(runName).ToLower() == ".msi") { int msiTimeout = _installationPackage.msiTimeout; if (!WaitForMsi(runName, msiTimeout)) { throw new Win32Exception(ERROR_INSTALL_ALREADY_RUNNING); } } _installationPackage.HandleRunStart(); _processRunTime = Stopwatch.StartNew(); Process[] preRunningProcesses = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(runName)); int preRunningProcessesCount = preRunningProcesses.Length; foreach (Process preProcess in preRunningProcesses) { preProcess.EnableRaisingEvents = true; preProcess.Exited += new EventHandler(delegate(object sender, EventArgs e) { preRunningProcessesCount--; }); } //release the JobTransferred lock if (_installationPackage.onRunWithBits.Set() && BitsEnabled) { Process[] processByName = new Process[] { }; Stopwatch timer = new Stopwatch(); timer.Start(); do { processByName = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(runName)); Thread.Sleep(100); } while (processByName.Length <= preRunningProcessesCount && timer.Elapsed.TotalSeconds < 10); timer.Stop(); if (processByName.Length > preRunningProcessesCount) { foreach (Process candidate in processByName) { if (preRunningProcesses.All(current => current.Id != candidate.Id) && candidate.ProcessName != candidate.Parent()?.ProcessName) { p = candidate; break; } } } } if (p != null) { p.EnableRaisingEvents = true; p.Exited += (object sender, EventArgs e) => { if (sender is Process process) { _installationPackage.runExitCode = process.ExitCode; ConfigParser.GetConfig().SetProductSettingsXml(_installationPackage.ProdSettings, "StaticData/CustomData/RunData/ExitCode", process.ExitCode.ToString()); if (_processRunTime != null) { ConfigParser.GetConfig().SetProductSettingsXml (_installationPackage.ProdSettings, "StaticData/CustomData/RunData/RunTimeMS", _processRunTime.ElapsedMilliseconds.ToString()); } if (_installationPackage.WaitForIt) { _installationPackage.HandleRunEnd(); } } }; if (!BitsEnabled) { p.Start(); } } else { throw new Exception($"Process not found: {Path.GetFileName(runName)}"); } } catch (Win32Exception ex) { _installationPackage.runErrorCode = ex.NativeErrorCode; throw; } finally { BitsEnabled = false; } } catch (Exception ex) { _installationPackage.ErrorMessage = $"Running {runName} {runParam} - {ex.Message}"; _installationPackage.OnInstallFailed(ErrorConsts.ERR_RUN_GENERAL, _installationPackage.ErrorMessage); } if (!_installationPackage.WaitForIt) { _installationPackage.HandleRunEnd(); } } }); _runnerThread.Start(); }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } AccessLevel tempAccessLevel; bool tempBool; int tempInt; double tempDouble; Point3D tempPoint3D; Map tempMap; foreach (Element child in element.ChildElements) { if (child.TagName == "JailImmuneLevel" && child.GetAccessLevelValue(out tempAccessLevel)) { JailImmuneLevel = tempAccessLevel; } else if (child.TagName == "JailWordsEnabled" && child.GetBoolValue(out tempBool)) { JailWordsEnabled = tempBool; } else if (child.TagName == "UsesRemaining" && child.GetIntValue(out tempInt)) { UsesRemaining = tempInt; } else if (child.TagName == "FineAmount" && child.GetIntValue(out tempInt)) { FineAmount = tempInt; } else if (child.TagName == "RobeTitle" && null != child.Text) { RobeTitle = child.Text; } else if (child.TagName == "RobeHue" && child.GetIntValue(out tempInt)) { RobeHue = tempInt; } else if (child.TagName == "RockHue" && child.GetIntValue(out tempInt)) { RockHue = tempInt; } else if (child.TagName == "WhatToMine" && null != child.Text) { WhatToMine = child.Text; } else if (child.TagName == "HammerDifficulty" && child.GetIntValue(out tempInt)) { HammerDifficulty = tempInt; } else if (child.TagName == "JailLocation" && child.GetPoint3DValue(out tempPoint3D)) { JailLocation = tempPoint3D; } else if (child.TagName == "JailMap" && child.GetMapValue(out tempMap)) { JailMap = tempMap; } else if (child.TagName == "FreeLocation" && child.GetPoint3DValue(out tempPoint3D)) { FreeLocation = tempPoint3D; } else if (child.TagName == "FreeMap" && child.GetMapValue(out tempMap)) { FreeMap = tempMap; } else if (child.TagName == "FreeMurdererLocation" && child.GetPoint3DValue(out tempPoint3D)) { FreeMurdererLocation = tempPoint3D; } else if (child.TagName == "FreeMurdererMap" && child.GetMapValue(out tempMap)) { FreeMurdererMap = tempMap; } else if (child.TagName == "JailRockName" && null != child.Text) { JailRockName = child.Text; } else if (child.TagName == "JailWordFile" && null != child.Text) { JailWordFile = child.Text; } else if (child.TagName == "JailRockWeight" && child.GetDoubleValue(out tempDouble)) { JailRockWeight = tempDouble; } } }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } double tempDouble; bool tempBool; int tempInt; bool[] tempBoolArray; int[] tempIntArray; foreach (Element child in element.ChildElements) { if (child.TagName == "ArtifactCraftable" && child.GetBoolValue(out tempBool)) { ArtifactCraftable = tempBool; } else if (child.TagName == "BraceletsRingsOnly" && child.GetBoolValue(out tempBool)) { BraceletsRingsOnly = tempBool; } else if (child.TagName == "MaxPropsAllowed" && child.GetIntValue(out tempInt)) { MaxPropsAllowed = tempInt; } else if (child.TagName == "ScPenaltyChance" && child.GetDoubleValue(out tempDouble)) { ScPenaltyChance = tempDouble; } else if (child.TagName == "ExplodeChance" && child.GetDoubleValue(out tempDouble)) { ExplodeChance = tempDouble; } else if (child.TagName == "DestroyChance" && child.GetDoubleValue(out tempDouble)) { DestroyChance = tempDouble; } else if (child.TagName == "ExplodeMinDmg" && child.GetIntValue(out tempInt)) { ExplodeMinDmg = tempInt; } else if (child.TagName == "ExplodeMaxDmg" && child.GetIntValue(out tempInt)) { ExplodeMaxDmg = tempInt; } else if (child.TagName == "CraftersMarkChance" && child.GetDoubleValue(out tempDouble)) { CraftersMarkChance = tempDouble; } else if (child.TagName == "UseCharges" && child.GetBoolValue(out tempBool)) { UseCharges = tempBool; } else if (child.TagName == "GuardianOfTheMagicsBookChance" && child.GetDoubleValue(out tempDouble)) { GuardianOfTheMagicsBookChance = tempDouble; } else if (child.TagName == "GuardianOfTheMagicsJewelChance" && child.GetDoubleValue(out tempDouble)) { GuardianOfTheMagicsJewelChance = tempDouble; } else if (child.TagName == "MinimumInscription" && child.GetIntValue(out tempInt)) { MinimumInscription = tempInt; } else if (child.TagName == "MinimumAlchemy" && child.GetIntValue(out tempInt)) { MinimumAlchemy = tempInt; } else if (child.TagName == "MaximumSkillValue" && child.GetIntValue(out tempInt)) { MaximumSkillValue = tempInt; } else if (child.TagName == "MinimumIntensity" && child.GetIntValue(out tempInt)) { MinimumIntensity = tempInt; } else if (child.TagName == "MaximumIntensity" && child.GetIntValue(out tempInt)) { MaximumIntensity = tempInt; } else if (child.TagName == "CraftEnabled" && child.GetArray(LastAosCraftID + 1, out tempBoolArray)) { CraftEnabled = tempBoolArray; } else if (child.TagName == "MagicJewelRequirements" && child.GetArray(LastAosCraftID + 1, out tempIntArray)) { MagicJewelRequirements = tempIntArray; } } }
public FontManager() { pfc = new PrivateFontCollection(); fontFamilyCash = new Dictionary <string, FontFamily>(); tempFontsFolder = Path.Combine(ConfigParser.GetConfig().workDir, "Fonts"); }
protected void UpdateDownloadTime(long durationMS) => ConfigParser.GetConfig().SetProductSettingsXml(installationPackage.ProdSettings, "StaticData/CustomData/DownloadData/DownloadTimeMS", durationMS.ToString());
public void SetUserSelectedLocale(string locale) { ConfigParser.GetConfig().SetUserSelectedLocale(locale); RefreshForms(); }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } bool tempBool; int tempInt; Type[] tempTypeArray; Type tempType; foreach (Element child in element.ChildElements) { if (child.TagName == "LootArtifacts" && child.GetBoolValue(out tempBool)) { LootArtifacts = tempBool; } else if (child.TagName == "EnableGrab" && child.GetBoolValue(out tempBool)) { EnableGrab = tempBool; } else if (child.TagName == "EnableClaim" && child.GetBoolValue(out tempBool)) { EnableClaim = tempBool; } else if (child.TagName == "LootPlayers" && child.GetBoolValue(out tempBool)) { LootPlayers = tempBool; } else if (child.TagName == "GrabRadius" && child.GetIntValue(out tempInt)) { GrabRadius = tempInt; } else if (child.TagName == "ClaimRadius" && child.GetIntValue(out tempInt)) { ClaimRadius = tempInt; } else if (child.TagName == "CompetitiveGrabRadius" && child.GetIntValue(out tempInt)) { CompetitiveGrabRadius = tempInt; } else if (child.TagName == "CompetitiveClaimRadius" && child.GetIntValue(out tempInt)) { CompetitiveClaimRadius = tempInt; } else if (child.TagName == "FreelyLootableFame" && child.GetIntValue(out tempInt)) { FreelyLootableFame = tempInt; } else if (child.TagName == "GoldBagType" && child.GetTypeValue(out tempType)) { GoldBagType = tempType; } else if (child.TagName == "SilverBagType" && child.GetTypeValue(out tempType)) { SilverBagType = tempType; } else if (child.TagName == "LootBagType" && child.GetTypeValue(out tempType)) { LootBagType = tempType; } else if (child.TagName == "AggregateSilver" && child.GetBoolValue(out tempBool)) { AggregateSilver = tempBool; } else if (child.TagName == "TypesToLoot" && child.GetArray(out tempTypeArray)) { TypesToLoot = tempTypeArray; } else if (child.TagName == "GoldBagBlessed" && child.GetBoolValue(out tempBool)) { GoldBagBlessed = tempBool; } else if (child.TagName == "SilverBagBlessed" && child.GetBoolValue(out tempBool)) { SilverBagBlessed = tempBool; } else if (child.TagName == "LootBagBlessed" && child.GetBoolValue(out tempBool)) { LootBagBlessed = tempBool; } } }
public static void Initialize() { Element element = ConfigParser.GetConfig(kConfigFile, kConfigName); if (null == element || element.ChildElements.Count <= 0) { return; } bool tempBool; int tempInt; string[] tempStringArray; foreach (Element child in element.ChildElements) { if (child.TagName == "SafeForSeconds" && child.GetIntValue(out tempInt)) { SafeForSeconds = tempInt; } else if (child.TagName == "MessageHue" && child.GetIntValue(out tempInt)) { MessageHue = tempInt; } else if (child.TagName == "ResStoneHue" && child.GetIntValue(out tempInt)) { ResStoneHue = tempInt; } else if (child.TagName == "PetResStoneHue" && child.GetIntValue(out tempInt)) { PetResStoneHue = tempInt; } else if (child.TagName == "AllowSelfRes" && child.GetBoolValue(out tempBool)) { AllowSelfRes = tempBool; } else if (child.TagName == "UseSelfResStone" && child.GetBoolValue(out tempBool)) { UseSelfResStone = tempBool; } else if (child.TagName == "AllowPetRes" && child.GetBoolValue(out tempBool)) { AllowPetRes = tempBool; } else if (child.TagName == "UsePetResStone" && child.GetBoolValue(out tempBool)) { UsePetResStone = tempBool; } else if (child.TagName == "FullStatsOnRes" && child.GetBoolValue(out tempBool)) { FullStatsOnRes = tempBool; } else if (child.TagName == "RandomDeathCry" && child.GetBoolValue(out tempBool)) { RandomDeathCry = tempBool; } else if (child.TagName == "AllowCorpseRetrieval" && child.GetBoolValue(out tempBool)) { AllowCorpseRetrieval = tempBool; } else if (child.TagName == "CorpseRetrievalAmount" && child.GetIntValue(out tempInt)) { CorpseRetrievalAmount = tempInt; } else if (child.TagName == "DeathCrys" && child.GetArray(out tempStringArray)) { DeathCrys = tempStringArray; } } }