colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 102 forks source link

`room.Send()` should throw an error if the send failed, rather than returning silently #154

Open rnd256 opened 3 years ago

endel commented 3 years ago

Hi @rnd256, thanks for reporting as always.

Forgive my ignorance but in which situation would room.Send() fail? I can only think of operating on a disconnected WebSocket, if that's what you're referring to we should make it throw an error indeed!

rnd256 commented 3 years ago

Hi @endel, thanks for the fast response as always :)

That's exactly what I'm referring to! Here are the two spots where I think an issue could occur:

tonygiang commented 3 years ago

+1

I don't know if a disconnection detected by the Colyseus client will always be detected by the server, but having a confirmation that a disconnection did happen client-side will help with problem diagnosis greatly, and identify such cases.