Skip to content

Commit

Permalink
Block Sort Pet Hotbar, Add Hook Safety
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
KazWolfe committed Jun 14, 2022
1 parent af3ab65 commit 7b5616d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ private IEnumerable<uint> GetIllegalActionIDs() {

var illegalActions = new List<uint> {
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) {
Expand Down
12 changes: 10 additions & 2 deletions FFXIVPlugin/Game/SigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion FFXIVPlugin/XIVDeck.FFXIVPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Product>XIVDeck Game Plugin</Product>
<Authors>Kaz Wolfe</Authors>
<Company>Blacksite Technologies</Company>
<Version>0.2.3</Version>
<Version>0.2.4</Version>

<AssemblyName>XIVDeck.FFXIVPlugin</AssemblyName>

Expand Down
2 changes: 1 addition & 1 deletion SDPlugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kazwolfe/xivdeck-sdplugin",
"version": "0.2.3",
"version": "0.2.4",
"private": true,
"scripts": {
"build-release": "webpack --mode production",
Expand Down

0 comments on commit 7b5616d

Please sign in to comment.