configuration rework
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public record Authentication
|
||||
{
|
||||
public string CharacterName { get; set; } = string.Empty;
|
||||
public uint WorldId { get; set; } = 0;
|
||||
public int SecretKeyIdx { get; set; } = -1;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
public enum NotificationLocation
|
||||
{
|
||||
Nowhere,
|
||||
Chat,
|
||||
Toast,
|
||||
Both
|
||||
}
|
||||
@@ -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)
|
||||
};
|
||||
}
|
||||
}
|
||||
8
MareSynchronos/MareConfiguration/Models/SecretKey.cs
Normal file
8
MareSynchronos/MareConfiguration/Models/SecretKey.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class SecretKey
|
||||
{
|
||||
public string Key { get; set; } = string.Empty;
|
||||
public string FriendlyName { get; set; } = string.Empty;
|
||||
}
|
||||
11
MareSynchronos/MareConfiguration/Models/ServerStorage.cs
Normal file
11
MareSynchronos/MareConfiguration/Models/ServerStorage.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class ServerStorage
|
||||
{
|
||||
public string ServerUri { get; set; } = string.Empty;
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
public List<Authentication> Authentications { get; set; } = new();
|
||||
public Dictionary<int, SecretKey> SecretKeys { get; set; } = new();
|
||||
public bool FullPause { get; set; } = false;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
[Serializable]
|
||||
public class ServerTagStorage
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace MareSynchronos.MareConfiguration.Models;
|
||||
|
||||
public class ServerNotesStorage
|
||||
{
|
||||
public Dictionary<string, string> UidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, string> GidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
Reference in New Issue
Block a user