From 7b5616d2a29c2282192ec0ea834b0afb2268631e Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Mon, 13 Jun 2022 18:11:41 -0700 Subject: [PATCH] Block Sort Pet Hotbar, Add Hook Safety - Add exception handling to update hooks to further mitigate crashes - Block "Sort Pet Hotbar" General Actions, as they can be triggered in invalid cases - Bump to version 0.2.4 --- .../Strategies/GeneralActionStrategy.cs | 2 ++ FFXIVPlugin/Game/SigHelper.cs | 12 ++++++++++-- FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj | 2 +- SDPlugin/package.json | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/FFXIVPlugin/ActionExecutor/Strategies/GeneralActionStrategy.cs b/FFXIVPlugin/ActionExecutor/Strategies/GeneralActionStrategy.cs index 19311bc..ac40f0c 100644 --- a/FFXIVPlugin/ActionExecutor/Strategies/GeneralActionStrategy.cs +++ b/FFXIVPlugin/ActionExecutor/Strategies/GeneralActionStrategy.cs @@ -38,6 +38,8 @@ private IEnumerable GetIllegalActionIDs() { var illegalActions = new List { 13, // Advanced Materia Melding - automatically injected on use of Materia Melding + 29, // Sort Pet Hotbar (Normal) - contextual + 30, // Sort Pet Hotbar (Cross) - contextual }; foreach (var action in ActionSheet) { diff --git a/FFXIVPlugin/Game/SigHelper.cs b/FFXIVPlugin/Game/SigHelper.cs index d145bb4..2e3813a 100644 --- a/FFXIVPlugin/Game/SigHelper.cs +++ b/FFXIVPlugin/Game/SigHelper.cs @@ -116,7 +116,11 @@ private IntPtr DetourGearsetSave(IntPtr a1, IntPtr a2) { PluginLog.Debug("Gearset update!"); var tmp = this.RGM_WriteFileHook!.Original(a1, a2); - XIVDeckWSServer.Instance?.BroadcastMessage(new WSStateUpdateMessage("GearSet")); + try { + XIVDeckWSServer.Instance?.BroadcastMessage(new WSStateUpdateMessage("GearSet")); + } catch (Exception ex) { + PluginLog.Error(ex, "Gearset update notification on hook failed"); + } return tmp; } @@ -125,7 +129,11 @@ private IntPtr DetourMacroUpdate(IntPtr a1, IntPtr macroPage, IntPtr macroSlot) PluginLog.Debug("Macro update!"); var tmp = this.MacroUpdateHook!.Original(a1, macroPage, macroSlot); - XIVDeckWSServer.Instance?.BroadcastMessage(new WSStateUpdateMessage("Macro")); + try { + XIVDeckWSServer.Instance?.BroadcastMessage(new WSStateUpdateMessage("Macro")); + } catch (Exception ex) { + PluginLog.Error(ex, "Macro update notification on hook failed"); + } return tmp; } diff --git a/FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj b/FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj index d40ffbb..9eeca67 100644 --- a/FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj +++ b/FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj @@ -3,7 +3,7 @@ XIVDeck Game Plugin Kaz Wolfe Blacksite Technologies - 0.2.3 + 0.2.4 XIVDeck.FFXIVPlugin diff --git a/SDPlugin/package.json b/SDPlugin/package.json index c5a2954..a462e31 100644 --- a/SDPlugin/package.json +++ b/SDPlugin/package.json @@ -1,6 +1,6 @@ { "name": "@kazwolfe/xivdeck-sdplugin", - "version": "0.2.3", + "version": "0.2.4", "private": true, "scripts": { "build-release": "webpack --mode production",