diff --git a/Pal.Client/Configuration/ConfigurationManager.cs b/Pal.Client/Configuration/ConfigurationManager.cs index 8e6ed9d..c4dfc7f 100644 --- a/Pal.Client/Configuration/ConfigurationManager.cs +++ b/Pal.Client/Configuration/ConfigurationManager.cs @@ -87,7 +87,9 @@ internal sealed class ConfigurationManager dbContext.Imports.Add(new ImportHistory { Id = importHistory.Id, - RemoteUrl = importHistory.RemoteUrl?.Replace(".μ.tv", ".liza.sh"), + RemoteUrl = importHistory.RemoteUrl + ?.Replace(".μ.tv", ".liza.sh") + .Replace("pal.liza.sh", "connect.palacepal.com"), ExportedAt = importHistory.ExportedAt, ImportedAt = importHistory.ImportedAt }); @@ -98,6 +100,17 @@ internal sealed class ConfigurationManager File.Move(_pluginInterface.ConfigFile.FullName, _pluginInterface.ConfigFile.FullName + ".old", true); } + + IPalacePalConfiguration? currentConfig = Load(); + IAccountConfiguration? legacyAccount = currentConfig?.FindAccount("https://pal.liza.sh"); + if (currentConfig != null && legacyAccount != null) + { + IAccountConfiguration newAccount = currentConfig.CreateAccount("https://connect.palacepal.com", legacyAccount.AccountId); + newAccount.CachedRoles = legacyAccount.CachedRoles; + + currentConfig.RemoveAccount(legacyAccount.Server); + Save(currentConfig, false); + } } private ConfigurationV7 MigrateToV7(ConfigurationV1 v1) @@ -141,7 +154,9 @@ internal sealed class ConfigurationManager if (string.IsNullOrEmpty(accountId)) continue; - string serverName = server.Replace(".μ.tv", ".liza.sh"); + string serverName = server + .Replace(".μ.tv", ".liza.sh") + .Replace("pal.liza.sh", "connect.palacepal.com"); IAccountConfiguration newAccount = v7.CreateAccount(serverName, accountId); newAccount.CachedRoles = oldAccount.CachedRoles.ToList(); } diff --git a/Pal.Client/Net/RemoteApi.cs b/Pal.Client/Net/RemoteApi.cs index f5cf15d..d0bd53a 100644 --- a/Pal.Client/Net/RemoteApi.cs +++ b/Pal.Client/Net/RemoteApi.cs @@ -13,7 +13,7 @@ internal sealed partial class RemoteApi : IDisposable #if DEBUG public const string RemoteUrl = "http://localhost:5415"; #else - public const string RemoteUrl = "https://pal.liza.sh"; + public const string RemoteUrl = "https://connect.palacepal.com"; #endif private readonly string _userAgent = $"{typeof(RemoteApi).Assembly.GetName().Name?.Replace(" ", "")}/{typeof(RemoteApi).Assembly.GetName().Version?.ToString(2)}";