Ejemplo n.º 1
0
        public Config()
        {
            //	Get the path to the settings folder.
            ConfigFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\PunishedPineapple\\WaymarkLibrarian\\";

            //	Create the children.
            ProgramSettings  = new ProgramConfig(ConfigFolderPath + "Options.cfg");
            GameDataSettings = new GameDataConfig(ConfigFolderPath + "GameData.cfg");
            ZoneInfoSettings = new ZoneInfo(ConfigFolderPath + "ZoneDictionary.dat");

            //	Check for updates if it is time to do so.
            if ((DateTimeOffset.UtcNow - ProgramSettings.LastUpdateCheck > TimeSpan.FromDays(ProgramSettings.UpdateCheckFrequency_Days)) ||
                (DateTimeOffset.UtcNow - ProgramSettings.LastConfigUpdateCheck > TimeSpan.FromDays(ProgramSettings.UpdateCheckFrequency_Days) && VersionInfoHelper.Parse(FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location)) == ProgramSettings.LastProgramUpdateVersionSeen))
            {
                CheckForUpdates();
                GameDataSettings.Reload();
                ZoneInfoSettings.Reload();
            }

            //	The alias file lives one directory up since we may want to share it with other programs.
            CharacterAliasSettings = new CharacterAliasConfig(Directory.GetParent(ConfigFolderPath).Parent.FullName + "\\CharacterAliases.cfg");
        }