Closed AlexFHer closed 3 years ago
@alexelfandi - Thanks for pointing this out, as SignalR hubs can accept arrays as their message argument.
However, in the plugin, we are just passing strings as the messages between JavaScript and the compiled WebAssembly game code using emcripten.
We are somewhat limited in the data we can pass, as there has to be conversion using a pointer in the emscripten heap. According to the docs, there is support for simple numeric types, strings, and arrays of primitives (but not arrays of strings): https://docs.unity3d.com/530/Documentation/Manual/webgl-interactingwithbrowserscripting.html
Here is the line in the .jslib file where we accept the message pointer and covert to it to a string using the 'Pointer_stringify' function: https://github.com/evanlindsey/Unity-WebGL-SignalR/blob/991ff277c82a798a954bba3a05a384c9976ea536/Unity/Assets/Plugins/SignalR/SignalRLib.jslib#L40
Hi, your project actually worked for me, but, I need to send an array at the invoke method when the webgl is active and it does not work, for example.
i send: ["asd;asd", "asd3;asdffdd"]
and what the inspector says i'm sending symbols on the hub arguments