Client API remoting stuff

This commit is contained in:
Sardelka9515
2023-02-12 22:06:57 +08:00
parent fb654f0e56
commit ac07edfe68
34 changed files with 764 additions and 212 deletions

View File

@ -107,12 +107,12 @@ namespace RageCoop.Client
Settings settings;
try
{
settings = JsonConvert.DeserializeObject<Settings>(File.ReadAllText(path));
settings = JsonDeserialize<Settings>(File.ReadAllText(path));
}
catch (Exception ex)
{
Main.Logger?.Error(ex);
File.WriteAllText(path, JsonConvert.SerializeObject(settings = new Settings(), Formatting.Indented));
File.WriteAllText(path, JsonSerialize(settings = new Settings()));
}
return settings;
@ -126,7 +126,7 @@ namespace RageCoop.Client
settings = settings ?? Main.Settings;
Directory.CreateDirectory(Directory.GetParent(path).FullName);
File.WriteAllText(path, JsonConvert.SerializeObject(settings, Formatting.Indented));
File.WriteAllText(path, JsonSerialize(settings));
return true;
}
catch (Exception ex)