internal void UpdateKnownAuroraVersionsFromMirrors(IList <string> mirrors) { var allKnownVersions = new List <AuroraVersion>(AuroraVersions); foreach (var mirror in mirrors) { Log.Debug($"Retrieving version information from {mirror} if available"); var mirrorKnownVersions = new List <AuroraVersion>(); var versionsUrl = Path.Combine(mirror, "aurora_versions.ini"); using (var client = new WebClient()) { try { var response = client.DownloadString(versionsUrl); mirrorKnownVersions.AddRange(ModConfigurationReader.AuroraVersionsFromString(response)); } catch (Exception e) { Log.Error($"Didn't find an Aurora version listing at {versionsUrl}", e); } } foreach (var version in mirrorKnownVersions) { if (!allKnownVersions.Any(existing => version.Checksum == existing.Checksum)) { allKnownVersions.Add(version); } } } AuroraVersions.AddRange(allKnownVersions); UpdateCache(); }
internal void UpdateKnownVersionsFromCache() { Log.Debug($"Loading Aurora versions from {Path.Combine(Program.AuroraLoaderExecutableDirectory, "aurora_versions.ini")}"); try { var rawFileContents = File.ReadAllText(Path.Combine(Program.AuroraLoaderExecutableDirectory, "aurora_versions.ini")); AuroraVersions.AddRange(ModConfigurationReader.AuroraVersionsFromString(rawFileContents).ToList()); } catch (Exception e) { Log.Error($"Failed to parse version data from {_configuration["aurora_known_versions_relative_filepath"]}", e); } }