Mare 0.9 (#65)
* add jwt expiry * start of 0.9 api impl * some stuff idk * some more impl * some cleanup * remove grouppair, add configuration, rework some pair drawing stuff * do some stuff * rework some ui * I don't even know anymore * add cancellationtoken * token bla * ui fixes etc * probably individual adding/removing now working fully as expected * add working report popup * I guess it's more syncshell shit or so * popup shit idk * work out most of the syncshell bullshit I guess * delete some old crap * are we actually getting closer to the end * update pair info stuff * more fixes/adjustments, idk * refactor some things * some rework * some more cleanup * cleanup * make menu buttons w i d e * better icon text buttons * add all syncshell folder and ordering fixes --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
@@ -1,74 +1,16 @@
|
||||
using Dalamud.Plugin;
|
||||
using MareSynchronos.MareConfiguration.Configurations;
|
||||
using MareSynchronos.MareConfiguration.Configurations.Obsolete;
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration;
|
||||
#pragma warning disable CS0618 // ignore Obsolete tag, the point of this migrator is to migrate obsolete configs to new ones
|
||||
#pragma warning disable CS0612 // ignore Obsolete tag, the point of this migrator is to migrate obsolete configs to new ones
|
||||
|
||||
public class ConfigurationMigrator : IHostedService
|
||||
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, DalamudPluginInterface pi) : IHostedService
|
||||
{
|
||||
private readonly ILogger<ConfigurationMigrator> _logger;
|
||||
private readonly DalamudPluginInterface _pi;
|
||||
|
||||
public ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, DalamudPluginInterface pi)
|
||||
{
|
||||
_logger = logger;
|
||||
_pi = pi;
|
||||
}
|
||||
|
||||
public void Migrate()
|
||||
{
|
||||
if (_pi.GetPluginConfig() is Configurations.Obsolete.Configuration oldConfig)
|
||||
{
|
||||
_logger.LogInformation("Migrating Configuration from old config style to 1");
|
||||
|
||||
var config = oldConfig.ToMareConfig(_logger);
|
||||
File.Move(_pi.ConfigFile.FullName, _pi.ConfigFile.FullName + ".old", overwrite: true);
|
||||
MigrateMareConfigV0ToV1(config);
|
||||
}
|
||||
|
||||
if (File.Exists(ConfigurationPath(MareConfigService.ConfigName)))
|
||||
{
|
||||
try
|
||||
{
|
||||
var mareConfig = JsonConvert.DeserializeObject<MareConfigV0>(File.ReadAllText(ConfigurationPath(MareConfigService.ConfigName)))!;
|
||||
|
||||
if (mareConfig.Version == 0)
|
||||
{
|
||||
MigrateMareConfigV0ToV1(mareConfig);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to migrate, skipping");
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists(ConfigurationPath(ServerConfigService.ConfigName)))
|
||||
{
|
||||
try
|
||||
{
|
||||
var content = File.ReadAllText(ConfigurationPath(ServerConfigService.ConfigName));
|
||||
if (!content.Contains("\"Version\": 1"))
|
||||
{
|
||||
var serverConfig = JsonConvert.DeserializeObject<ServerConfigV0>(content);
|
||||
|
||||
if (serverConfig != null && serverConfig.Version == 0)
|
||||
{
|
||||
MigrateServerConfigV0toV1(serverConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex,"Failed to migrate ServerConfig");
|
||||
}
|
||||
}
|
||||
// currently nothing to migrate
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
@@ -87,74 +29,5 @@ public class ConfigurationMigrator : IHostedService
|
||||
File.WriteAllText(path, JsonConvert.SerializeObject(config, Formatting.Indented));
|
||||
}
|
||||
|
||||
private string ConfigurationPath(string configName) => Path.Combine(_pi.ConfigDirectory.FullName, configName);
|
||||
|
||||
private void MigrateMareConfigV0ToV1(MareConfigV0 mareConfigV0)
|
||||
{
|
||||
_logger.LogInformation("Migrating Configuration from version 0 to 1");
|
||||
if (File.Exists(ConfigurationPath(MareConfigService.ConfigName)))
|
||||
File.Copy(ConfigurationPath(MareConfigService.ConfigName), ConfigurationPath(MareConfigService.ConfigName) + ".migrated." + mareConfigV0.Version + ".bak", overwrite: true);
|
||||
|
||||
MareConfig mareConfigV1 = mareConfigV0.ToV1();
|
||||
|
||||
var serverConfig = new ServerConfig()
|
||||
{
|
||||
ServerStorage = mareConfigV0.ServerStorage.Select(p => p.Value.ToV1()).ToList()
|
||||
};
|
||||
serverConfig.CurrentServer = Array.IndexOf(serverConfig.ServerStorage.Select(s => s.ServerUri).ToArray(), mareConfigV0.CurrentServer);
|
||||
var transientConfig = new TransientConfig()
|
||||
{
|
||||
PlayerPersistentTransientCache = mareConfigV0.PlayerPersistentTransientCache
|
||||
};
|
||||
var tagConfig = new ServerTagConfig()
|
||||
{
|
||||
ServerTagStorage = mareConfigV0.ServerStorage.ToDictionary(p => p.Key, p => new ServerTagStorage()
|
||||
{
|
||||
UidServerPairedUserTags = p.Value.UidServerPairedUserTags.ToDictionary(p => p.Key, p => p.Value.ToList(), StringComparer.Ordinal),
|
||||
OpenPairTags = p.Value.OpenPairTags.ToHashSet(StringComparer.Ordinal),
|
||||
ServerAvailablePairTags = p.Value.ServerAvailablePairTags.ToHashSet(StringComparer.Ordinal)
|
||||
}, StringComparer.Ordinal)
|
||||
};
|
||||
var notesConfig = new UidNotesConfig()
|
||||
{
|
||||
ServerNotes = mareConfigV0.ServerStorage.ToDictionary(p => p.Key, p => new ServerNotesStorage()
|
||||
{
|
||||
GidServerComments = p.Value.GidServerComments,
|
||||
UidServerComments = p.Value.UidServerComments
|
||||
}, StringComparer.Ordinal)
|
||||
};
|
||||
|
||||
SaveConfig(mareConfigV1, ConfigurationPath(MareConfigService.ConfigName));
|
||||
SaveConfig(serverConfig, ConfigurationPath(ServerConfigService.ConfigName));
|
||||
SaveConfig(transientConfig, ConfigurationPath(TransientConfigService.ConfigName));
|
||||
SaveConfig(tagConfig, ConfigurationPath(ServerTagConfigService.ConfigName));
|
||||
SaveConfig(notesConfig, ConfigurationPath(NotesConfigService.ConfigName));
|
||||
}
|
||||
|
||||
private void MigrateServerConfigV0toV1(ServerConfigV0 serverConfigV0)
|
||||
{
|
||||
_logger.LogInformation("Migration Server Configuration from version 0 to 1");
|
||||
if (File.Exists(ConfigurationPath(ServerConfigService.ConfigName)))
|
||||
File.Copy(ConfigurationPath(ServerConfigService.ConfigName), ConfigurationPath(ServerConfigService.ConfigName) + ".migrated." + serverConfigV0.Version + ".bak", overwrite: true);
|
||||
|
||||
ServerConfig migrated = new();
|
||||
|
||||
var currentServer = serverConfigV0.CurrentServer;
|
||||
var currentServerIdx = Array.IndexOf(serverConfigV0.ServerStorage.Keys.ToArray(), currentServer);
|
||||
|
||||
if (currentServerIdx == -1) currentServerIdx = 0;
|
||||
|
||||
migrated.CurrentServer = currentServerIdx;
|
||||
migrated.ServerStorage = new();
|
||||
|
||||
foreach (var server in serverConfigV0.ServerStorage)
|
||||
{
|
||||
migrated.ServerStorage.Add(server.Value);
|
||||
}
|
||||
|
||||
SaveConfig(migrated, ConfigurationPath(ServerConfigService.ConfigName));
|
||||
}
|
||||
private string ConfigurationPath(string configName) => Path.Combine(pi.ConfigDirectory.FullName, configName);
|
||||
}
|
||||
|
||||
#pragma warning restore CS0612 // ignore Obsolete tag, the point of this migrator is to migrate obsolete configs to new ones
|
||||
#pragma warning restore CS0618 // ignore Obsolete tag, the point of this migrator is to migrate obsolete configs to new ones
|
||||
@@ -14,8 +14,8 @@ public abstract class ConfigurationServiceBase<T> : IDisposable where T : IMareC
|
||||
{
|
||||
ConfigurationDirectory = configurationDirectory;
|
||||
|
||||
Task.Run(CheckForConfigUpdatesInternal, _periodicCheckCts.Token);
|
||||
Task.Run(CheckForDirtyConfigInternal, _periodicCheckCts.Token);
|
||||
_ = Task.Run(CheckForConfigUpdatesInternal, _periodicCheckCts.Token);
|
||||
_ = Task.Run(CheckForDirtyConfigInternal, _periodicCheckCts.Token);
|
||||
|
||||
_currentConfigInternal = LazyConfig();
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ public class MareConfig : IMareConfiguration
|
||||
public bool AcceptedAgreement { get; set; } = false;
|
||||
public string CacheFolder { get; set; } = string.Empty;
|
||||
public bool DisableOptionalPluginWarnings { get; set; } = false;
|
||||
public bool EnableRightClickMenus { get; set; } = true;
|
||||
public bool EnableDtrEntry { get; set; } = false;
|
||||
public bool EnableRightClickMenus { get; set; } = true;
|
||||
public NotificationLocation ErrorNotification { get; set; } = NotificationLocation.Both;
|
||||
public string ExportFolder { get; set; } = string.Empty;
|
||||
public bool FileScanPaused { get; set; } = false;
|
||||
@@ -22,15 +22,14 @@ public class MareConfig : IMareConfiguration
|
||||
public bool OpenGposeImportOnGposeStart { get; set; } = false;
|
||||
public bool OpenPopupOnAdd { get; set; } = true;
|
||||
public int ParallelDownloads { get; set; } = 10;
|
||||
public bool UseCompactor { get; set; } = false;
|
||||
public bool PreferNotesOverNamesForVisible { get; set; } = false;
|
||||
public float ProfileDelay { get; set; } = 1.5f;
|
||||
public bool ProfilePopoutRight { get; set; } = false;
|
||||
public bool ProfilesAllowNsfw { get; set; } = false;
|
||||
public bool ProfilesShow { get; set; } = true;
|
||||
public bool ReverseUserSort { get; set; } = false;
|
||||
public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false;
|
||||
public bool PreferNotesOverNamesForVisible { get; set; } = false;
|
||||
public bool ShowOfflineUsersSeparately { get; set; } = true;
|
||||
public bool GroupUpSyncshells { get; set; } = true;
|
||||
public bool ShowOnlineNotifications { get; set; } = false;
|
||||
public bool ShowOnlineNotificationsOnlyForIndividualPairs { get; set; } = true;
|
||||
public bool ShowOnlineNotificationsOnlyForNamedPairs { get; set; } = false;
|
||||
@@ -44,6 +43,7 @@ public class MareConfig : IMareConfiguration
|
||||
public bool TransferBarsShowText { get; set; } = true;
|
||||
public int TransferBarsWidth { get; set; } = 250;
|
||||
public bool UseAlternativeFileUpload { get; set; } = false;
|
||||
public bool UseCompactor { get; set; } = false;
|
||||
public int Version { get; set; } = 1;
|
||||
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
using Dalamud.Configuration;
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
using MareSynchronos.MareConfiguration.Models.Obsolete;
|
||||
using MareSynchronos.WebAPI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration.Configurations.Obsolete;
|
||||
|
||||
[Serializable]
|
||||
[Obsolete("Deprecated, use MareConfig")]
|
||||
public class Configuration : IPluginConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 6;
|
||||
public Dictionary<string, ServerStorageV0> ServerStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ ApiController.MainServiceUri, new ServerStorageV0() { ServerName = ApiController.MainServer, ServerUri = ApiController.MainServiceUri } },
|
||||
};
|
||||
public bool AcceptedAgreement { get; set; } = false;
|
||||
public string CacheFolder { get; set; } = string.Empty;
|
||||
public double MaxLocalCacheInGiB { get; set; } = 20;
|
||||
public bool ReverseUserSort { get; set; } = false;
|
||||
public int TimeSpanBetweenScansInSeconds { get; set; } = 30;
|
||||
public bool FileScanPaused { get; set; } = false;
|
||||
public bool InitialScanComplete { get; set; } = false;
|
||||
public bool FullPause { get; set; } = false;
|
||||
public bool HideInfoMessages { get; set; } = false;
|
||||
public bool DisableOptionalPluginWarnings { get; set; } = false;
|
||||
public bool OpenGposeImportOnGposeStart { get; set; } = false;
|
||||
public bool ShowTransferWindow { get; set; } = true;
|
||||
public bool OpenPopupOnAdd { get; set; } = true;
|
||||
public string CurrentServer { get; set; } = string.Empty;
|
||||
|
||||
private string _apiUri = string.Empty;
|
||||
public string ApiUri
|
||||
{
|
||||
get => string.IsNullOrEmpty(_apiUri) ? ApiController.MainServiceUri : _apiUri;
|
||||
set => _apiUri = value;
|
||||
}
|
||||
public Dictionary<string, string> ClientSecret { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, string> CustomServerList { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, Dictionary<string, string>> UidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, Dictionary<string, string>> GidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
/// <summary>
|
||||
/// Each paired user can have multiple tags. Each tag will create a category, and the user will
|
||||
/// be displayed into that category.
|
||||
/// The dictionary first maps a server URL to a dictionary, and that
|
||||
/// dictionary maps the OtherUID of the <see cref="ClientPairDto"/> to a list of tags.
|
||||
/// </summary>
|
||||
public Dictionary<string, Dictionary<string, List<string>>> UidServerPairedUserTags { get; set; } = new(StringComparer.Ordinal);
|
||||
/// <summary>
|
||||
/// A dictionary that maps a server URL to the tags the user has added for that server.
|
||||
/// </summary>
|
||||
public Dictionary<string, HashSet<string>> ServerAvailablePairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public HashSet<string> OpenPairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
|
||||
public MareConfigV0 ToMareConfig(ILogger logger)
|
||||
{
|
||||
|
||||
MareConfigV0 newConfig = new();
|
||||
logger.LogInformation("Migrating Config to MareConfig");
|
||||
|
||||
newConfig.AcceptedAgreement = AcceptedAgreement;
|
||||
newConfig.CacheFolder = CacheFolder;
|
||||
newConfig.MaxLocalCacheInGiB = MaxLocalCacheInGiB;
|
||||
newConfig.ReverseUserSort = ReverseUserSort;
|
||||
newConfig.TimeSpanBetweenScansInSeconds = TimeSpanBetweenScansInSeconds;
|
||||
newConfig.FileScanPaused = FileScanPaused;
|
||||
newConfig.InitialScanComplete = InitialScanComplete;
|
||||
newConfig.DisableOptionalPluginWarnings = DisableOptionalPluginWarnings;
|
||||
newConfig.OpenGposeImportOnGposeStart = OpenGposeImportOnGposeStart;
|
||||
newConfig.ShowTransferWindow = ShowTransferWindow;
|
||||
newConfig.OpenPopupOnAdd = OpenPopupOnAdd;
|
||||
newConfig.CurrentServer = ApiUri;
|
||||
|
||||
// create all server storage based on current clientsecret
|
||||
foreach (var secret in ClientSecret)
|
||||
{
|
||||
logger.LogDebug("Migrating {key}", secret.Key);
|
||||
var apiuri = secret.Key;
|
||||
var secretkey = secret.Value;
|
||||
ServerStorageV0 toAdd = new();
|
||||
if (string.Equals(apiuri, ApiController.MainServiceUri, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
toAdd.ServerUri = ApiController.MainServiceUri;
|
||||
toAdd.ServerName = ApiController.MainServer;
|
||||
}
|
||||
else
|
||||
{
|
||||
toAdd.ServerUri = apiuri;
|
||||
if (!CustomServerList.TryGetValue(apiuri, out var serverName)) serverName = apiuri;
|
||||
toAdd.ServerName = serverName;
|
||||
}
|
||||
|
||||
toAdd.SecretKeys[0] = new SecretKey()
|
||||
{
|
||||
FriendlyName = "Auto Migrated Secret Key (" + DateTime.Now.ToString("yyyy-MM-dd") + ")",
|
||||
Key = secretkey,
|
||||
};
|
||||
|
||||
if (GidServerComments.TryGetValue(apiuri, out var gids))
|
||||
{
|
||||
toAdd.GidServerComments = gids;
|
||||
}
|
||||
if (UidServerComments.TryGetValue(apiuri, out var uids))
|
||||
{
|
||||
toAdd.UidServerComments = uids;
|
||||
}
|
||||
if (UidServerPairedUserTags.TryGetValue(apiuri, out var uidtag))
|
||||
{
|
||||
toAdd.UidServerPairedUserTags = uidtag;
|
||||
}
|
||||
if (ServerAvailablePairTags.TryGetValue(apiuri, out var servertag))
|
||||
{
|
||||
toAdd.ServerAvailablePairTags = servertag;
|
||||
}
|
||||
toAdd.OpenPairTags = OpenPairTags;
|
||||
toAdd.FullPause = FullPause;
|
||||
|
||||
newConfig.ServerStorage[apiuri] = toAdd;
|
||||
}
|
||||
|
||||
return newConfig;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
using MareSynchronos.MareConfiguration.Models.Obsolete;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration.Configurations.Obsolete;
|
||||
|
||||
[Serializable]
|
||||
[Obsolete("Deprecated, use MareConfig")]
|
||||
public class MareConfigV0 : IMareConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 0;
|
||||
public Dictionary<string, ServerStorageV0> ServerStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public Dictionary<string, HashSet<string>> PlayerPersistentTransientCache { get; set; } = new(StringComparer.Ordinal);
|
||||
public bool AcceptedAgreement { get; set; } = false;
|
||||
public string CacheFolder { get; set; } = string.Empty;
|
||||
public double MaxLocalCacheInGiB { get; set; } = 20;
|
||||
public bool ReverseUserSort { get; set; } = false;
|
||||
public int TimeSpanBetweenScansInSeconds { get; set; } = 30;
|
||||
public bool FileScanPaused { get; set; } = false;
|
||||
public bool InitialScanComplete { get; set; } = false;
|
||||
public bool DisableOptionalPluginWarnings { get; set; } = false;
|
||||
public bool OpenGposeImportOnGposeStart { get; set; } = false;
|
||||
public bool ShowTransferWindow { get; set; } = true;
|
||||
public bool OpenPopupOnAdd { get; set; } = true;
|
||||
public string CurrentServer { get; set; } = string.Empty;
|
||||
public bool ShowOnlineNotifications { get; set; } = false;
|
||||
public bool ShowOnlineNotificationsOnlyForIndividualPairs { get; set; } = true;
|
||||
public bool ShowOnlineNotificationsOnlyForNamedPairs { get; set; } = false;
|
||||
public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false;
|
||||
public NotificationLocation InfoNotification { get; set; } = NotificationLocation.Toast;
|
||||
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
||||
public NotificationLocation ErrorNotification { get; set; } = NotificationLocation.Both;
|
||||
|
||||
public MareConfig ToV1()
|
||||
{
|
||||
return new MareConfig()
|
||||
{
|
||||
AcceptedAgreement = this.AcceptedAgreement,
|
||||
CacheFolder = this.CacheFolder,
|
||||
MaxLocalCacheInGiB = this.MaxLocalCacheInGiB,
|
||||
ReverseUserSort = this.ReverseUserSort,
|
||||
TimeSpanBetweenScansInSeconds = this.TimeSpanBetweenScansInSeconds,
|
||||
FileScanPaused = this.FileScanPaused,
|
||||
InitialScanComplete = this.InitialScanComplete,
|
||||
DisableOptionalPluginWarnings = this.DisableOptionalPluginWarnings,
|
||||
OpenGposeImportOnGposeStart = this.OpenGposeImportOnGposeStart,
|
||||
ShowTransferWindow = this.ShowTransferWindow,
|
||||
OpenPopupOnAdd = this.OpenPopupOnAdd,
|
||||
ShowOnlineNotifications = this.ShowOnlineNotifications,
|
||||
ShowOnlineNotificationsOnlyForIndividualPairs = this.ShowOnlineNotificationsOnlyForIndividualPairs,
|
||||
ShowCharacterNameInsteadOfNotesForVisible = this.ShowCharacterNameInsteadOfNotesForVisible,
|
||||
ShowOnlineNotificationsOnlyForNamedPairs = this.ShowOnlineNotificationsOnlyForNamedPairs,
|
||||
ErrorNotification = this.ErrorNotification,
|
||||
InfoNotification = this.InfoNotification,
|
||||
WarningNotification = this.WarningNotification,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using MareSynchronos.MareConfiguration.Models;
|
||||
using MareSynchronos.WebAPI;
|
||||
|
||||
namespace MareSynchronos.MareConfiguration.Configurations.Obsolete;
|
||||
|
||||
[Serializable]
|
||||
[Obsolete("Replaced with ServerConfig")]
|
||||
public class ServerConfigV0 : IMareConfiguration
|
||||
{
|
||||
public string CurrentServer { get; set; } = string.Empty;
|
||||
|
||||
public Dictionary<string, ServerStorage> ServerStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ ApiController.MainServiceUri, new ServerStorage() { ServerName = ApiController.MainServer, ServerUri = ApiController.MainServiceUri } },
|
||||
};
|
||||
|
||||
public int Version { get; set; } = 0;
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace MareSynchronos.MareConfiguration.Configurations;
|
||||
|
||||
public class ServerTagConfig : IMareConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 0;
|
||||
public Dictionary<string, ServerTagStorage> ServerTagStorage { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
public int Version { get; set; } = 0;
|
||||
}
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
public class TransientConfig : IMareConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 0;
|
||||
|
||||
public Dictionary<string, HashSet<string>> PlayerPersistentTransientCache { get; set; } = new(StringComparer.Ordinal);
|
||||
|
||||
public int Version { get; set; } = 0;
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace MareSynchronos.MareConfiguration.Configurations;
|
||||
|
||||
public class UidNotesConfig : IMareConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 0;
|
||||
public Dictionary<string, ServerNotesStorage> ServerNotes { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
public int Version { get; set; } = 0;
|
||||
}
|
||||
@@ -6,4 +6,4 @@ public record Authentication
|
||||
public string CharacterName { get; set; } = string.Empty;
|
||||
public uint WorldId { get; set; } = 0;
|
||||
public int SecretKeyIdx { get; set; } = -1;
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,16 @@
|
||||
[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 { get; set; } = 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 List<Authentication> Authentications { get; set; } = [];
|
||||
public bool FullPause { get; set; } = false;
|
||||
public Dictionary<string, string> GidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
public HashSet<string> OpenPairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<int, SecretKey> SecretKeys { get; set; } = [];
|
||||
public HashSet<string> ServerAvailablePairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
public string ServerUri { get; set; } = string.Empty;
|
||||
public Dictionary<string, string> UidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, List<string>> UidServerPairedUserTags { get; set; } = new(StringComparer.Ordinal);
|
||||
|
||||
public ServerStorage ToV1()
|
||||
{
|
||||
@@ -21,9 +21,9 @@ public class ServerStorageV0
|
||||
{
|
||||
ServerUri = ServerUri,
|
||||
ServerName = ServerName,
|
||||
Authentications = Authentications.ToList(),
|
||||
Authentications = [.. Authentications],
|
||||
FullPause = FullPause,
|
||||
SecretKeys = SecretKeys.ToDictionary(p => p.Key, p => p.Value)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@
|
||||
[Serializable]
|
||||
public class SecretKey
|
||||
{
|
||||
public string Key { get; set; } = string.Empty;
|
||||
public string FriendlyName { get; set; } = string.Empty;
|
||||
}
|
||||
public string Key { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
public class ServerNotesStorage
|
||||
{
|
||||
public Dictionary<string, string> UidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, string> GidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
public Dictionary<string, string> UidServerComments { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
[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 List<Authentication> Authentications { get; set; } = [];
|
||||
public bool FullPause { get; set; } = false;
|
||||
}
|
||||
public Dictionary<int, SecretKey> SecretKeys { get; set; } = [];
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
public string ServerUri { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
[Serializable]
|
||||
public class ServerTagStorage
|
||||
{
|
||||
public Dictionary<string, List<string>> UidServerPairedUserTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public HashSet<string> ServerAvailablePairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public HashSet<string> OpenPairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
public HashSet<string> ServerAvailablePairTags { get; set; } = new(StringComparer.Ordinal);
|
||||
public Dictionary<string, List<string>> UidServerPairedUserTags { get; set; } = new(StringComparer.Ordinal);
|
||||
}
|
||||
Reference in New Issue
Block a user