Skip to content

Commit

Permalink
Switch Penumbra IPC to use Interface Path
Browse files Browse the repository at this point in the history
  • Loading branch information
KazWolfe committed Mar 11, 2023
1 parent 28f35ea commit 19c6385
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions FFXIVPlugin/IPC/Subscribers/PenumbraIPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class PenumbraIPC : IPluginIpcClient {
public int Version { get; private set; } = -1;

private ICallGateSubscriber<(int BreakingVersion, int Version)>? _penumbraApiVersionsSubscriber;
private ICallGateSubscriber<string, string>? _penumbraResolveDefaultSubscriber;
private ICallGateSubscriber<string, string>? _penumbraResolveInterfaceSubscriber;

private readonly ICallGateSubscriber<object?> _penumbraRegisteredSubscriber;

Expand All @@ -39,7 +39,7 @@ public void Dispose() {

// explicitly reset to null so that any future calls fail gracefully
this._penumbraApiVersionsSubscriber = null;
this._penumbraResolveDefaultSubscriber = null;
this._penumbraResolveInterfaceSubscriber = null;

this.Enabled = false;

Expand All @@ -53,7 +53,7 @@ private void _initializeIpc() {
}

this._penumbraApiVersionsSubscriber = Injections.PluginInterface.GetIpcSubscriber<(int, int)>("Penumbra.ApiVersions");
this._penumbraResolveDefaultSubscriber = Injections.PluginInterface.GetIpcSubscriber<string, string>("Penumbra.ResolveDefaultPath");
this._penumbraResolveInterfaceSubscriber = Injections.PluginInterface.GetIpcSubscriber<string, string>("Penumbra.ResolveInterfacePath");

try {
(var breakingVersion, this.Version) = this._penumbraApiVersionsSubscriber.InvokeFunc();
Expand All @@ -67,12 +67,12 @@ private void _initializeIpc() {
}

public string ResolvePenumbraPath(string path) {
if (!this.Enabled || this._penumbraResolveDefaultSubscriber == null) return path;
if (!this.Enabled || this._penumbraResolveInterfaceSubscriber == null) return path;

try {
return this._penumbraResolveDefaultSubscriber.InvokeFunc(path);
return this._penumbraResolveInterfaceSubscriber.InvokeFunc(path);
} catch (IpcNotReadyError) {
PluginLog.Debug("Got a NotReadyError trying to call ResolveDefaultPath. Falling back to normal path");
PluginLog.Debug("Got a NotReadyError trying to call ResolveInterfacePath. Falling back to normal path");
return path;
} catch (Exception ex) {
PluginLog.Error(ex, "Failed to invoke Penumbra IPC, disabling!");
Expand Down
2 changes: 1 addition & 1 deletion FFXIVPlugin/Resources/Localization/UIStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion FFXIVPlugin/Resources/Localization/UIStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<comment>"Illegal commands" in this case mean commands that normally cannot be sent to the game and may cause damage or harm if proper care is not taken.</comment>
</data>
<data name="SettingsWindow_EnablePenumbraIPC" xml:space="preserve">
<value>Use Penumbra Icons</value>
<value>Enable Penumbra Integration</value>
<comment>Setting to enable integration with another app named Penumbra.</comment>
</data>
<data name="SettingsWindow_EnablePenumbraIPC_Help" xml:space="preserve">
Expand Down

0 comments on commit 19c6385

Please sign in to comment.