Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rooms are being disposed / or websocket being closed without warning #1

Open
stats opened this issue Dec 19, 2019 · 4 comments
Open
Assignees
Labels
bug Something isn't working client An issue effecting the unity client server An issue effecting the server

Comments

@stats
Copy link
Owner

stats commented Dec 19, 2019

An issue exists where a WebSocket connection will be lost and the game room will be closed.

Not sure why the WebSocket is being lost.

It is suspected that it has something to do with the websocket ping/pong. Some debugging code will need to be added to either Colyseus-Unity3d or to the Colyseus server to figure out if it is the client or server which is closing the connection.

@stats stats added bug Something isn't working server An issue effecting the server client An issue effecting the unity client labels Dec 19, 2019
@stats
Copy link
Owner Author

stats commented Feb 10, 2020

After refactoring and updating Colyseus to 12.0 this issues does not appear to be happening any more.

@stats stats closed this as completed Feb 10, 2020
@stats stats reopened this Mar 4, 2020
@stats
Copy link
Owner Author

stats commented Mar 4, 2020

This issue is still occurring.

The potential fix for this is as follows.

If a client does not willingly disconnect (i.e. loses the websocket)

  • Keep the room and all objects processing for 5 to 10 seconds (i.e. delay clearing the player object and disposing of the room for 5 to 10 seconds.)
  • Have the client attempt to immediately try and reconnect back to the room where the connection was lost.

@stats stats self-assigned this Mar 4, 2020
@stats
Copy link
Owner Author

stats commented Mar 4, 2020

Added code to the server to allow a reconnection for 5 seconds if a connection was lost without being consented.

@stats
Copy link
Owner Author

stats commented Mar 11, 2020

The reconnect appears to work. There were some visual entities added to the screen on reconnect. Changed the client to use uuid instead of ship objects when creating or removing items. More testing is needed to verify this fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client An issue effecting the unity client server An issue effecting the server
Projects
None yet
Development

No branches or pull requests

1 participant