Adds property sorting for json output (#266)

This commit is contained in:
Kamron Batman 2020-09-26 22:38:50 -07:00 committed by GitHub
parent ddc58ec707
commit 12e935e4f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 228 additions and 130 deletions

View file

@ -138,17 +138,6 @@ namespace Server
Save();
}
public static T GetMetadata<T>(string key) where T : class
{
m_Settings.metadata.TryGetValue(key, out var value);
return value as T;
}
public static void SetMetadata(string key, object value)
{
m_Settings.metadata[key] = value;
}
// If mock is enabled we skip the console readline.
public static void Load(bool mocked = false)
{
@ -291,14 +280,14 @@ namespace Server
internal class ServerSettings
{
[JsonPropertyName("dataDirectories")] public List<string> dataDirectories { get; set; } = new List<string>();
[JsonPropertyName("dataDirectories")]
public List<string> dataDirectories { get; set; } = new List<string>();
[JsonPropertyName("listeners")] public List<IPEndPoint> listeners { get; set; } = new List<IPEndPoint>();
[JsonPropertyName("listeners")]
public List<IPEndPoint> listeners { get; set; } = new List<IPEndPoint>();
[JsonPropertyName("settings")]
public Dictionary<string, string> settings { get; set; } = new Dictionary<string, string>();
[JsonExtensionData] public Dictionary<string, object> metadata { get; set; } = new Dictionary<string, object>();
public SortedDictionary<string, string> settings { get; set; } = new SortedDictionary<string, string>();
}
}
}