public void Construct(PathGenericTuple <ModConfig> mod) { _modTuple = mod; string path = GithubConfig.GetFilePath(GetModDirectory(mod)); _githubConfig = GithubConfig.FromPath(path); _githubUserConfig = GithubUserConfig.FromPath(path); }
public bool IsCompatible(PathGenericTuple <ModConfig> mod) { try { if (Task.Run(AssertGithubOK).Result) { string path = GithubConfig.GetFilePath(GetModDirectory(mod)); if (File.Exists(path) && AllowedMods.Contains(mod.Object)) { return(true); } } } catch (Exception) { } return(false); }
static GithubLatestUpdateResolver() { try { GithubClient = new GitHubClient(new ProductHeaderValue("Reloaded-II")); // Get list of mods allowed to be updated this time around. var allMods = ModConfig.GetAllMods(); var allModsWithConfigs = allMods.Where(x => File.Exists(GithubConfig.GetFilePath(GetModDirectory(x)))); MakeTimestampsIfNotExist(allModsWithConfigs); var orderedModsWithConfigs = allModsWithConfigs.OrderBy(x => GithubUserConfig.FromPath(GithubUserConfig.GetFilePath(GetModDirectory(x))).LastCheckTimestamp); var allowedMods = orderedModsWithConfigs.Take(UnregisteredRateLimit).Select(x => x.Object); AllowedMods = new HashSet <ModConfig>(allowedMods); } catch (Exception) { Debugger.Break(); } }