diff --git a/Dalamud/Game/Agent/AgentEvent.cs b/Dalamud/Game/Agent/AgentEvent.cs index 2a3002daa..e9c9a1b85 100644 --- a/Dalamud/Game/Agent/AgentEvent.cs +++ b/Dalamud/Game/Agent/AgentEvent.cs @@ -18,12 +18,12 @@ public enum AgentEvent /// /// An event that is fired before the agent processes its Filtered Receive Event Function. /// - PreReceiveFilteredEvent, + PreReceiveEventWithResult, /// /// An event that is fired after the agent has processed its Filtered Receive Event Function. /// - PostReceiveFilteredEvent, + PostReceiveEventWithResult, /// /// An event that is fired before the agent processes its Show Function. diff --git a/Dalamud/Game/Agent/AgentVirtualTable.cs b/Dalamud/Game/Agent/AgentVirtualTable.cs index 8649c1397..2fffe5c7a 100644 --- a/Dalamud/Game/Agent/AgentVirtualTable.cs +++ b/Dalamud/Game/Agent/AgentVirtualTable.cs @@ -44,7 +44,7 @@ internal unsafe class AgentVirtualTable : IDisposable // Pinned Function Delegates, as these functions get assigned to an unmanaged virtual table, // the CLR needs to know they are in use, or it will invalidate them causing random crashing. private readonly AgentInterface.Delegates.ReceiveEvent receiveEventFunction; - private readonly AgentInterface.Delegates.ReceiveEvent2 filteredReceiveEventFunction; + private readonly AgentInterface.Delegates.ReceiveEvent2 receiveEventWithResultFunction; private readonly AgentInterface.Delegates.Show showFunction; private readonly AgentInterface.Delegates.Hide hideFunction; private readonly AgentInterface.Delegates.Update updateFunction; @@ -78,7 +78,7 @@ internal unsafe class AgentVirtualTable : IDisposable // Pin each of our listener functions this.receiveEventFunction = this.OnAgentReceiveEvent; - this.filteredReceiveEventFunction = this.OnAgentFilteredReceiveEvent; + this.receiveEventWithResultFunction = this.OnAgentReceiveEventWithResult; this.showFunction = this.OnAgentShow; this.hideFunction = this.OnAgentHide; this.updateFunction = this.OnAgentUpdate; @@ -88,7 +88,7 @@ internal unsafe class AgentVirtualTable : IDisposable // Overwrite specific virtual table entries this.ModifiedVirtualTable->ReceiveEvent = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.receiveEventFunction); - this.ModifiedVirtualTable->ReceiveEvent2 = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.filteredReceiveEventFunction); + this.ModifiedVirtualTable->ReceiveEvent2 = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.receiveEventWithResultFunction); this.ModifiedVirtualTable->Show = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.showFunction); this.ModifiedVirtualTable->Hide = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.hideFunction); this.ModifiedVirtualTable->Update = (delegate* unmanaged)Marshal.GetFunctionPointerForDelegate(this.updateFunction); @@ -156,7 +156,7 @@ internal unsafe class AgentVirtualTable : IDisposable return result; } - private AtkValue* OnAgentFilteredReceiveEvent(AgentInterface* thisPtr, AtkValue* returnValue, AtkValue* values, uint valueCount, ulong eventKind) + private AtkValue* OnAgentReceiveEventWithResult(AgentInterface* thisPtr, AtkValue* returnValue, AtkValue* values, uint valueCount, ulong eventKind) { AtkValue* result = null; @@ -171,7 +171,7 @@ internal unsafe class AgentVirtualTable : IDisposable this.filteredReceiveEventArgs.ValueCount = valueCount; this.filteredReceiveEventArgs.EventKind = eventKind; - this.lifecycleService.InvokeListenersSafely(AgentEvent.PreReceiveFilteredEvent, this.filteredReceiveEventArgs); + this.lifecycleService.InvokeListenersSafely(AgentEvent.PreReceiveEventWithResult, this.filteredReceiveEventArgs); returnValue = (AtkValue*)this.filteredReceiveEventArgs.ReturnValue; values = (AtkValue*)this.filteredReceiveEventArgs.AtkValues; @@ -187,11 +187,11 @@ internal unsafe class AgentVirtualTable : IDisposable Log.Error(e, "Caught exception when calling original Agent FilteredReceiveEvent. This may be a bug in the game or another plugin hooking this method."); } - this.lifecycleService.InvokeListenersSafely(AgentEvent.PostReceiveFilteredEvent, this.filteredReceiveEventArgs); + this.lifecycleService.InvokeListenersSafely(AgentEvent.PostReceiveEventWithResult, this.filteredReceiveEventArgs); } catch (Exception e) { - Log.Error(e, "Caught exception from Dalamud when attempting to process OnAgentFilteredReceiveEvent."); + Log.Error(e, "Caught exception from Dalamud when attempting to process OnAgentReceiveEventWithResult."); } return result;