configuration rework

This commit is contained in:
rootdarkarchon
2023-02-04 15:53:23 +01:00
parent f389bed4e1
commit 7c97d1994c
50 changed files with 722 additions and 275 deletions

View File

@@ -0,0 +1,29 @@
namespace MareSynchronos.MareConfiguration.Models;
[Serializable]
[Obsolete("Deprecated, use ServerStorage")]
public class ServerStorageV0
{
public string ServerUri { get; set; } = string.Empty;
public string ServerName { get; set; } = string.Empty;
public List<Authentication> Authentications { get; set; } = new();
public Dictionary<string, string> UidServerComments { get; set; } = new(StringComparer.Ordinal);
public Dictionary<string, string> GidServerComments { get; set; } = new(StringComparer.Ordinal);
public Dictionary<string, List<string>> UidServerPairedUserTags = new(StringComparer.Ordinal);
public HashSet<string> ServerAvailablePairTags { get; set; } = new(StringComparer.Ordinal);
public HashSet<string> OpenPairTags { get; set; } = new(StringComparer.Ordinal);
public Dictionary<int, SecretKey> SecretKeys { get; set; } = new();
public bool FullPause { get; set; } = false;
public ServerStorage ToV1()
{
return new ServerStorage()
{
ServerUri = this.ServerUri,
ServerName = this.ServerName,
Authentications = this.Authentications.ToList(),
FullPause = this.FullPause,
SecretKeys = this.SecretKeys.ToDictionary(p => p.Key, p => p.Value)
};
}
}