- Change Loporrit Branding to CLUBPENGUIN

- Update submodules
- Update to latest Penumbra API
This commit is contained in:
2025-08-26 21:42:00 +01:00
committed by Rawrington
parent bef5b1be34
commit b41532d5af
38 changed files with 176 additions and 146 deletions

View File

@@ -207,7 +207,7 @@ public class ChatService : DisposableMediatorSubscriberBase
}
}
_chatGui.PrintError($"[LoporritSync] Syncshell number #{shellNumber} not found");
_chatGui.PrintError($"[ClubPenguinSync] Syncshell number #{shellNumber} not found");
}
public void SendChatShell(int shellNumber, byte[] chatBytes)
@@ -236,6 +236,6 @@ public class ChatService : DisposableMediatorSubscriberBase
}
}
_chatGui.PrintError($"[LoporritSync] Syncshell number #{shellNumber} not found");
_chatGui.PrintError($"[ClubPenguinSync] Syncshell number #{shellNumber} not found");
}
}

View File

@@ -15,7 +15,7 @@ namespace MareSynchronos.Services;
public sealed class CommandManagerService : IDisposable
{
private const string _commandName = "/sync";
private const string _commandName2 = "/loporrit";
private const string _commandName2 = "/clubpenguin";
private const string _ssCommandPrefix = "/ss";
@@ -42,11 +42,11 @@ public sealed class CommandManagerService : IDisposable
_mareConfigService = mareConfigService;
_commandManager.AddHandler(_commandName, new CommandInfo(OnCommand)
{
HelpMessage = "Opens the Loporrit UI"
HelpMessage = "Opens the Club Penguin Sync UI"
});
_commandManager.AddHandler(_commandName2, new CommandInfo(OnCommand)
{
HelpMessage = "Opens the Loporrit UI"
HelpMessage = "Opens the Club Penguin Sync UI"
});
// Lazy registration of all possible /ss# commands which tbf is what the game does for linkshells anyway
@@ -86,7 +86,7 @@ public sealed class CommandManagerService : IDisposable
{
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
{
_mediator.Publish(new NotificationMessage("Loporrit disconnecting", "Cannot use /toggle while Loporrit is still disconnecting",
_mediator.Publish(new NotificationMessage("Club Penguin Sync disconnecting", "Cannot use /toggle while Club Penguin Sync is still disconnecting",
NotificationType.Error));
}

View File

@@ -468,9 +468,9 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
{
_logger.LogInformation("Starting DalamudUtilService");
#pragma warning disable S2696 // Instance members should not write to "static" fields
LoporritSync.Plugin.Self.RealOnFrameworkUpdate = this.FrameworkOnUpdate;
ClubPenguinSync.Plugin.Self.RealOnFrameworkUpdate = this.FrameworkOnUpdate;
#pragma warning restore S2696
_framework.Update += LoporritSync.Plugin.Self.OnFrameworkUpdate;
_framework.Update += ClubPenguinSync.Plugin.Self.OnFrameworkUpdate;
if (IsLoggedIn)
{
_classJobId = _clientState.LocalPlayer!.ClassJob.RowId;
@@ -485,7 +485,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
_logger.LogTrace("Stopping {type}", GetType());
Mediator.UnsubscribeAll(this);
_framework.Update -= LoporritSync.Plugin.Self.OnFrameworkUpdate;
_framework.Update -= ClubPenguinSync.Plugin.Self.OnFrameworkUpdate;
return Task.CompletedTask;
}

View File

@@ -20,9 +20,9 @@ public sealed class NoSnapService : IHostedService, IMediatorSubscriber
private readonly IDalamudPluginInterface _pluginInterface;
private readonly Dictionary<string, bool> _listOfPlugins = new(StringComparer.Ordinal)
{
["Snapper"] = false,
["Snappy"] = false,
["Meddle.Plugin"] = false,
["QQSnapper"] = false,
["QQSnappy"] = false,
["QQMeddle.Plugin"] = false,
};
private static readonly HashSet<int> _gposers = new();
private static readonly HashSet<string> _gposersNamed = new(StringComparer.Ordinal);

View File

@@ -41,19 +41,19 @@ public class NotificationService : DisposableMediatorSubscriberBase, IHostedServ
private void PrintErrorChat(string? message)
{
SeStringBuilder se = new SeStringBuilder().AddText("[LoporritSync] Error: " + message);
SeStringBuilder se = new SeStringBuilder().AddText("[ClubPenguinSync] Error: " + message);
_chatGui.PrintError(se.BuiltString);
}
private void PrintInfoChat(string? message)
{
SeStringBuilder se = new SeStringBuilder().AddText("[LoporritSync] Info: ").AddItalics(message ?? string.Empty);
SeStringBuilder se = new SeStringBuilder().AddText("[ClubPenguinSync] Info: ").AddItalics(message ?? string.Empty);
_chatGui.Print(se.BuiltString);
}
private void PrintWarnChat(string? message)
{
SeStringBuilder se = new SeStringBuilder().AddText("[LoporritSync] ").AddUiForeground("Warning: " + (message ?? string.Empty), 31).AddUiForegroundOff();
SeStringBuilder se = new SeStringBuilder().AddText("[ClubPenguinSync] ").AddUiForeground("Warning: " + (message ?? string.Empty), 31).AddUiForegroundOff();
_chatGui.Print(se.BuiltString);
}

View File

@@ -14,12 +14,12 @@ public sealed class RemoteConfigurationService
{
private readonly static Dictionary<string, string> ConfigPublicKeys = new(StringComparer.Ordinal)
{
{ "4D6633E0", "GWRoAiXP9lcn9/34wGgziYcqQH8f6zWtZrRyp66Ekso=" },
{ "3PC5J4C4", "rhUOaY2Y7doUY0GDmOEgM5CoyzxLqCjOpsdO6O+rTjE=" },
};
private readonly static string[] ConfigSources = [
"https://plugin.lop-sync.com/config/config.json",
"https://plugin.lop-sync.net/config/config.json",
"https://clubpenguin.drgn.rocks/config.json",
"https://clubpenguin.drgn.rocks/config.json",
];
private readonly ILogger<RemoteConfigurationService> _logger;
@@ -172,6 +172,12 @@ public sealed class RemoteConfigurationService
byte[] pub = Convert.FromBase64String(pubKey);
return Ed25519.Verify(sig, msg, pub);
}
private static byte[] SignForMe(string message, ulong ts, byte[] privKey)
{
byte[] msg = [.. BitConverter.GetBytes(ts), .. Encoding.UTF8.GetBytes(message)];
return Ed25519.Sign(msg, privKey);
}
private void LoadConfig(JsonObject jsonDoc)
{
@@ -185,6 +191,7 @@ public sealed class RemoteConfigurationService
var signatures = jsonDoc["sig"]!.AsObject();
var configString = jsonDoc["config"]!.GetValue<string>();
bool verified = signatures.Any(sig =>
ConfigPublicKeys.TryGetValue(sig.Key, out var pubKey) &&
VerifySignature(configString, ts, sig.Value!.GetValue<string>(), pubKey));

View File

@@ -500,13 +500,13 @@ public class ServerConfigurationManager
for (int i = 0; i < _configService.Current.ServerStorage.Count; ++i)
{
var x = _configService.Current.ServerStorage[i];
if (x.ServerUri.Equals(ApiController.LoporritServiceUri, StringComparison.OrdinalIgnoreCase))
if (x.ServerUri.Equals(ApiController.ClubPenguinServiceUri, StringComparison.OrdinalIgnoreCase))
lopExists = true;
}
if (!lopExists)
{
_logger.LogDebug("Re-adding missing server {uri}", ApiController.LoporritServiceUri);
_configService.Current.ServerStorage.Insert(0, new ServerStorage() { ServerUri = ApiController.LoporritServiceUri, ServerName = ApiController.LoporritServer });
_logger.LogDebug("Re-adding missing server {uri}", ApiController.ClubPenguinServiceUri);
_configService.Current.ServerStorage.Insert(0, new ServerStorage() { ServerUri = ApiController.ClubPenguinServiceUri, ServerName = ApiController.ClubPenguinServer });
if (_configService.Current.CurrentServer >= 0)
_configService.Current.CurrentServer++;
}