- Change Loporrit Branding to CLUBPENGUIN
- Update submodules - Update to latest Penumbra API
This commit is contained in:
@@ -109,7 +109,7 @@ public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcC
|
||||
if (!apiAvailable && !_shownGlamourerUnavailable)
|
||||
{
|
||||
_shownGlamourerUnavailable = true;
|
||||
_mareMediator.Publish(new NotificationMessage("Glamourer inactive", "Your Glamourer installation is not active or out of date. Update Glamourer to continue to use Loporrit. If you just updated Glamourer, ignore this message.",
|
||||
_mareMediator.Publish(new NotificationMessage("Glamourer inactive", "Your Glamourer installation is not active or out of date. Update Glamourer to continue to use Club Penguin Sync. If you just updated Glamourer, ignore this message.",
|
||||
NotificationType.Error));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
using Penumbra.Api.IpcSubscribers;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace MareSynchronos.Interop.Ipc;
|
||||
|
||||
@@ -91,9 +92,9 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
|
||||
Mediator.SubscribeKeyed<PluginChangeMessage>(this, "Penumbra", (msg) =>
|
||||
{
|
||||
_pluginLoaded = msg.IsLoaded;
|
||||
_pluginVersion = msg.Version;
|
||||
CheckAPI();
|
||||
_pluginLoaded = msg.IsLoaded;
|
||||
_pluginVersion = msg.Version;
|
||||
CheckAPI();
|
||||
});
|
||||
|
||||
CheckAPI();
|
||||
@@ -114,7 +115,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
bool penumbraAvailable = false;
|
||||
try
|
||||
{
|
||||
penumbraAvailable = _pluginLoaded && _pluginVersion >= new Version(1, 0, 1, 0);
|
||||
penumbraAvailable = _pluginLoaded && _pluginVersion >= new Version(1, 5, 1, 0);
|
||||
try
|
||||
{
|
||||
penumbraAvailable &= _penumbraEnabled.Invoke();
|
||||
@@ -136,7 +137,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
{
|
||||
_shownPenumbraUnavailable = true;
|
||||
_mareMediator.Publish(new NotificationMessage("Penumbra inactive",
|
||||
"Your Penumbra installation is not active or out of date. Update Penumbra and/or the Enable Mods setting in Penumbra to continue to use Loporrit. If you just updated Penumbra, ignore this message.",
|
||||
"Your Penumbra installation is not active or out of date. Update Penumbra and/or the Enable Mods setting in Penumbra to continue to use Club Penguin Sync. If you just updated Penumbra, ignore this message.",
|
||||
NotificationType.Error));
|
||||
}
|
||||
}
|
||||
@@ -219,14 +220,29 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private static Random rng = new();
|
||||
|
||||
public async Task<Guid> CreateTemporaryCollectionAsync(ILogger logger, string uid)
|
||||
{
|
||||
if (!APIAvailable) return Guid.Empty;
|
||||
|
||||
var identity = "ClubPenguin";
|
||||
|
||||
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||
{
|
||||
var collName = "Loporrit_" + uid;
|
||||
var collId = _penumbraCreateNamedTemporaryCollection.Invoke(collName);
|
||||
var collName = identity + "_" + uid;
|
||||
var ec = _penumbraCreateNamedTemporaryCollection.Invoke(identity, collName, out var collId);
|
||||
if (ec == PenumbraApiEc.InvalidCredentials)
|
||||
{
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
var tmp = Guid.NewGuid().ToString().Replace("-", "").Substring(0, 8 + rng.Next() % 6);
|
||||
logger.LogWarning("Identity = {identity}", identity);
|
||||
ec = _penumbraCreateNamedTemporaryCollection.Invoke(tmp, collName, out collId);
|
||||
if (ec != PenumbraApiEc.InvalidCredentials)
|
||||
break;
|
||||
}
|
||||
}
|
||||
logger.LogTrace("Creating Temp Collection {collName}, GUID: {collId}", collName, collId);
|
||||
return collId;
|
||||
|
||||
|
||||
@@ -69,11 +69,11 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
||||
public Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogDebug("Starting IpcProvider Service");
|
||||
_loadFileProvider = _pi.GetIpcProvider<string, IGameObject, bool>("LoporritSync.LoadMcdf");
|
||||
_loadFileProvider = _pi.GetIpcProvider<string, IGameObject, bool>("ClubPenguinSync.LoadMcdf");
|
||||
_loadFileProvider.RegisterFunc(LoadMcdf);
|
||||
_loadFileAsyncProvider = _pi.GetIpcProvider<string, IGameObject, Task<bool>>("LoporritSync.LoadMcdfAsync");
|
||||
_loadFileAsyncProvider = _pi.GetIpcProvider<string, IGameObject, Task<bool>>("ClubPenguinSync.LoadMcdfAsync");
|
||||
_loadFileAsyncProvider.RegisterFunc(LoadMcdfAsync);
|
||||
_handledGameAddresses = _pi.GetIpcProvider<List<nint>>("LoporritSync.GetHandledAddresses");
|
||||
_handledGameAddresses = _pi.GetIpcProvider<List<nint>>("ClubPenguinSync.GetHandledAddresses");
|
||||
_handledGameAddresses.RegisterFunc(GetHandledAddresses);
|
||||
|
||||
_loadFileProviderMare = _pi.GetIpcProvider<string, IGameObject, bool>("MareSynchronos.LoadMcdf");
|
||||
|
||||
Reference in New Issue
Block a user