private void DeSerialisationFixes(StreamingContext context) { // Our context is our KSP install. KSP ksp = (KSP)context.Context; registry_version = LATEST_REGISTRY_VERSION; factorioAuthData = ksp?.tryGetFactorioAuthData(); }
public FactorioAuthData tryGetFactorioAuthData() { try { return(FactorioAuthData.parseConfig(gamedatadir)); } catch (Exception) { return(null); } }
public static Registry Empty(FactorioAuthData factorioAuthData = null) { return(new Registry( new Dictionary <string, InstalledModule>(), new Dictionary <string, AutodetectedModule>(), new Dictionary <string, AvailableModule>(), new Dictionary <string, string>(), new SortedDictionary <string, Repository>(), factorioAuthData )); }
public Registry( Dictionary <string, InstalledModule> installed_modules, Dictionary <string, AutodetectedModule> installed_preexisting_modules, Dictionary <string, AvailableModule> available_modules, Dictionary <string, string> installed_files, SortedDictionary <string, Repository> repositories, FactorioAuthData factorioAuthData ) { // Is there a better way of writing constructors than this? Srsly? this.installed_modules = installed_modules; this.installed_preexisting_modules = installed_preexisting_modules; this.available_modules = available_modules; this.installed_files = installed_files; this.repositories = repositories; this.factorioAuthData = factorioAuthData; registry_version = LATEST_REGISTRY_VERSION; }
/// <summary> /// Returns a perfectly boring NetAsyncModulesDownloader. /// </summary> public NetAsyncModulesDownloader(IUser user, FactorioAuthData factorioAuthData = null) { modules = new List <CfanModule>(); downloader = new NetAsyncDownloader(user); this.factorioAuthData = factorioAuthData; }
public string getFactorioAuthDataPath() { return(FactorioAuthData.getConfigPath(gamedatadir)); }
public FactorioAuthData getFactorioAuthData() { return(FactorioAuthData.parseConfig(gamedatadir)); }