marzent / IINACT

A Dalamud plugin to run the FFXIV_ACT_Plugin in an ACT-like enviroment with a heavily modified port of Overlay Plugin
https://www.iinact.com
GNU General Public License v3.0
169 stars 39 forks source link

Add WebSocket alternative IPC Subscription API #48

Closed joshua-software-dev closed 1 year ago

joshua-software-dev commented 1 year ago

This needs review, but it does work correctly in my limited testing with my LMeter fork:

https://github.com/joshua-software-dev/LMeter

As posted in the discord, the flow is basically:

1) LMeter sends IPC request to "IINACT.Server.Listening" to ensure its installed and available
2) when unsuccessful, it gives up until manually prompted to check again
3) when successful, LMeter sends IPC request to "IINACT.Server.SubscribeToCombatEvents", passing a string of "LMeter.CombatEventReader"
4) IINACT adds a IPC subscriber to the server like it was a normal WebSocket request
5) Whenever the WebSocket would send a response to a subscriber, an event is also fired, causing IINACT to send an IPC request to the string sent earlier by LMeter: "LMeter.CombatEventReader". This request would contain a string that is the JSON pulse normally sent by the WebSocket.
6) LMeter parses the JSON response, like it had just been woken up from a WebSocket message

Let me know if any changes should be made.