Having some issue with channel.onDisconnect() #149
-
Currently working on a multiplayer game (go figure), and for while wasn't having issues with disconnects so not sure if a recent update change things. Setup:
The basic flow I've implemented is:
My issue at the moment is with the user.onDisconnect() event on the server. When I have multiple users connected, and then disconnect one by closing the browser tab, the server io seems to die as evidenced by the connected clients channel.onDisconnect() event firing. The expected behavior is when the server user.onDisconnect() is fired (which it does), it would then send a 'removePlayer' event to the remaining connections (which does not occur, never seen by the other users). So to summarize, users can connect to the server and play (so server and clients do communicate) but when a user disconnects, the server io instance dies(?) and stop communicating. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
There was a recent update/fix in onDisconnect(). Can you please open a new issue a provide a small sample project? I will have a closer look in mid January. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue when I use the express server as https for the game. Everything works fine but if a player disconnects everyone gets disconnected. It does not happen when using just a local server without express. |
Beta Was this translation helpful? Give feedback.
-
I apologize, I'm pretty sure I had it set up wrong. It works now, at least with the latest code and I think 2.1.0 as well. |
Beta Was this translation helpful? Give feedback.
There was a recent update/fix in onDisconnect().
Can you please open a new issue a provide a small sample project?
I will have a closer look in mid January.