Colyseus disconnect
breakerh opened this issue · 2 comments
breakerh commented
Maybe i didn't look good enough. But there is a reconnect function but how can i 'check' or test i lost connection with the game server? For example due to bad internet?
Thanks in advance!
endel commented
Hi @breakerh, to be able to use the "reconnect" on the client-side, you need to also call .allowReconnect()
during onLeave()
in the server, as described here: https://docs.colyseus.io/server/room/#allowreconnection-client-seconds
You need to cache locally the sessionId
and roomId
to try to reconnect to a previously established connection
breakerh commented
Oh wow thanks!
Turns out I didn't look good enough haha.