Closed PinoEire closed 3 months ago
@PinoEire, can you please specify if the issues are compilation or runtime? Which version of websocket-sharp are you removing to resolve the conflict?
This issue resolution could be helpful: https://github.com/magicblock-labs/Solana.Unity-SDK/issues/148#issuecomment-1646606832 (for the Multiplay package), but I haven't tried it with Fusion.
If you have a minimal repository to reproduce the issue, I can help investigate.
@GabrielePicco I did try that solution, which is the one that removes the build errors (naturally) but it also causes other SDK (Fusion and Unity NGO) to try using your version, which is somehow different and ar runtime the game in the browser issues the error:
Invoking error handler due to TypeError: instance.ws is undefined _WebSocketClose@https://...
Apparently there is no way around because I can't find a way to remove your version of websocket-sharp without breaking the build and your version is breaking the WebGL multiplayer.
@GabrielePicco You can easily reproduce this using the Fusion 2 Asteroid Sample.
The root of the issue is that there is no great way to do dependency management in Unity, as far as I know. The SDK uses a version that is apparently different from the one used in Fusion and NGO.
As far as I know, WebSocket Sharp does not work on WebGL.
The solution adopted in the SDK is to use a wrapper: https://github.com/magicblock-labs/NativeWebSocket which uses NativeWebSocket when building for WebGL and websocket-sharp when building for other platforms.
I'm not entirely sure which version of websocket-sharp Fusion and NGO use or where they use it. Can you please provide a minimal repo to reproduce this issue? That would help in investigating a potential solution.
OK @GabrielePicco I'll make available the Fusion 2 Asteroids sample in the form of a GitHub repo with Solana SDK imported.
Hi @GabrielePicco, sorry for the late post, but I've been busy solving this issue. It comes out that Solana SDK is only transversely responsible for the problem, adding to the WebGL network buffer so that adding the SDK makes the problem stick out sooner, but it's not your fault.
The problem is the number of Network Objects in the scene, which Unity Transport (and Fusion) cannot cope with in WebGL. For some reason. Sorry for pointing at you 😅
Glad you found the cause!
@PinoEire, it's been a while. Would you mind updating your review on the Unity Asset Store?
@PinoEire, it's been a while. Would you mind updating your review on the Unity Asset Store?
Sorry, I totally forgot that! It is done 😊.
Describe the bug Adding this SDK to a working WebGL multiplayer game breaks it because of the version of websocket-sharp shipped with it.
To Reproduce Add this to a working WebGL multiplayer game built with Unity Netcode for GameObjects or Fusion 2.
Expected behaviour One would expect the game to keep working.
Screenshots screenshots to help explain the problem.
Desktop (please complete the following information):