public static void Save() { Log.WriteDebug("Local Config", "Saving..."); var current = new LocalConfigJson { CellID = CellID, Sentry = Sentry, SentryFileName = SentryFileName, CDNAuthTokens = CDNAuthTokens, }; var json = JsonConvert.SerializeObject(current, GetSettings()); File.WriteAllText(GetPath(), json); }
public static void Save() { Log.WriteDebug("Local Config", "Saving..."); var current = new LocalConfigJson { CellID = CellID, Sentry = Sentry, SentryFileName = SentryFileName, CDNAuthTokens = CDNAuthTokens, }; string json; lock (CDNAuthTokens) { json = JsonConvert.SerializeObject(current, JsonFormatted); } File.WriteAllText(GetPath(), json); }
public static void Load() { if (File.Exists(ConfigPath)) { Current = JsonConvert.DeserializeObject <LocalConfigJson>(File.ReadAllText(ConfigPath)); var time = DateTime.Now; foreach (var token in Current.CDNAuthTokens) { if (time > token.Value.Expiration) { Current.CDNAuthTokens.TryRemove(token.Key, out _); Log.WriteInfo("Local Config", $"Removing expired token for depot {token.Key}"); } } } Log.WriteInfo("Local Config", $"There are {Current.FreeLicensesToRequest.Count} free licenses to request"); Save(); }
public static void Save() { Log.WriteDebug("Local Config", "Saving..."); var current = new LocalConfigJson { ServerList = CMClient.Servers.GetAllEndPoints(), CellID = CellID, Sentry = Sentry, SentryFileName = SentryFileName, }; var json = JsonConvert.SerializeObject(current, GetSettings()); File.WriteAllText(GetPath(), json); }