IINACT icon indicating copy to clipboard operation
IINACT copied to clipboard

JObject lose string value when using IPC to subscribe events & receive data

Open PatchouliTC opened this issue 1 year ago • 1 comments

After I read overlayplugin source code,I try to use IPC to subscribe receive data form overlayplugin; I follow source code, after I call CreateSubscriber(name),I make Svc.PluginInterface.GetIpcSubscriber<JObject, bool>($"IINACT.IpcProvider.{name}") and then send payload to subscribe "CombatData" code like that:

var commandSender = Svc.PluginInterface.GetIpcSubscriber<JObject, bool>($"IINACT.IpcProvider.{Name}");
var payload = JObject.FromObject(new
{
    call = "subscribe",
    events = new string[]{"CombatData"},
    data = new string[]{"CombatData"},
});
commandSender.InvokeAction(payload);
//receive ignore it

but then i saw logs happend nullreference exception; so i add some log print into mycode and iinact-overlayplugin-DataReceived(JObject data), and i find this: this is what i prepare send to data looks like: image and this is what logs print that DataReceived(JObject data) data looks like: bd8c14e4e7933dd070c6c4f8d670dfef It seems that dalamoud IPC will list information if use JObject,all string data are miss; and then I changed overlayplugin IPCHandler,all JObject change to string,and every thing works fine instantly: image

so I think maybe should change JObject to string like SocketHandler did?(serialize&deserialize to string)

PatchouliTC avatar Oct 14 '24 17:10 PatchouliTC

This used to work for sure, I'll try to see how it did fail...

marzent avatar Nov 26 '24 07:11 marzent