7d5496e959
81 namespace declarations and 100 using directives converted via sed, plus two FQN-aliases (ChatTwoPartyFinderPayload in PayloadHandler.cs and ModifierFlag in KeybindManager.cs) updated. Critical: Language.Designer.cs and HellionStrings.Designer.cs ResourceManager string arguments updated synchronously — these are runtime reflection lookups not caught by the C# compiler. Two intentional ChatTwo references remain: the legacy migration path 'ChatTwo.json' in Plugin.cs (still points to upstream Chat 2's config file by design) and the InternalsVisibleTo declaration in AssemblyInfo.cs (handled in the upcoming repo-folder rename task). The local alias names 'ChatTwoPartyFinderPayload' and 'ChatTwoConflictDetector' are preserved as local symbols; only their target namespaces and references changed.
55 lines
1.7 KiB
C#
Executable File
55 lines
1.7 KiB
C#
Executable File
using Dalamud.Game.Text.SeStringHandling;
|
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
using Dalamud.Plugin.Ipc;
|
|
|
|
namespace HellionChat;
|
|
|
|
internal sealed class IpcManager : IDisposable
|
|
{
|
|
private ICallGateProvider<string> RegisterGate { get; }
|
|
private ICallGateProvider<string, object?> UnregisterGate { get; }
|
|
private ICallGateProvider<object?> AvailableGate { get; }
|
|
private ICallGateProvider<string, PlayerPayload?, ulong, Payload?, SeString?, SeString?, object?> InvokeGate { get; }
|
|
|
|
internal List<string> Registered { get; } = [];
|
|
|
|
public IpcManager()
|
|
{
|
|
RegisterGate = Plugin.Interface.GetIpcProvider<string>("HellionChat.Register");
|
|
RegisterGate.RegisterFunc(Register);
|
|
|
|
AvailableGate = Plugin.Interface.GetIpcProvider<object?>("HellionChat.Available");
|
|
|
|
UnregisterGate = Plugin.Interface.GetIpcProvider<string, object?>("HellionChat.Unregister");
|
|
UnregisterGate.RegisterAction(Unregister);
|
|
|
|
InvokeGate = Plugin.Interface.GetIpcProvider<string, PlayerPayload?, ulong, Payload?, SeString?, SeString?, object?>("HellionChat.Invoke");
|
|
|
|
AvailableGate.SendMessage();
|
|
}
|
|
|
|
internal void Invoke(string id, PlayerPayload? sender, ulong contentId, Payload? payload, SeString? senderString, SeString? content)
|
|
{
|
|
InvokeGate.SendMessage(id, sender, contentId, payload, senderString, content);
|
|
}
|
|
|
|
private string Register()
|
|
{
|
|
var id = Guid.NewGuid().ToString();
|
|
Registered.Add(id);
|
|
return id;
|
|
}
|
|
|
|
private void Unregister(string id)
|
|
{
|
|
Registered.Remove(id);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
UnregisterGate.UnregisterFunc();
|
|
RegisterGate.UnregisterFunc();
|
|
Registered.Clear();
|
|
}
|
|
}
|