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

Added a timeout for peers who lost their connection during the game. #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GodFuper
Copy link
Contributor

No description provided.

@Brutus5000 Brutus5000 self-requested a review January 7, 2025 11:46
@Brutus5000
Copy link
Member

I am struggling to understand the use case being solved and the difference of calling onConnectionLost and this new module.

onConnectionLost tries to recover the peer and as far as I know only the lobby server decides if the player left the game and we should stop try to reconnect. I am not sure what happens if the ice adapter decides to close the peer but the lobby server doesn't know about it.

@GodFuper
Copy link
Contributor Author

This module see that if the connection could not be established after N seconds, then you should not try further, since the player was probably already thrown out in lobby anyway.

This is one of the solutions so as not to make an endless reconnect to players who have crashed game or logged out of the game.

@GodFuper
Copy link
Contributor Author

By the way, what do you think about the idea to replace while(true) Sleep(1000) with a scheduler that will be called every second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants