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

Rework the network code that handles the connection to the server #3640

Open
Monsterovich opened this issue Feb 16, 2024 · 0 comments
Open
Labels

Comments

@Monsterovich
Copy link
Contributor

Monsterovich commented Feb 16, 2024

When connecting to the server probably some players have already noticed that sometimes the game can completely freeze, and then unfreeze after the timeout has been hit.

This is because when connecting to the server, the game expects a response packet but doesn't always get it right away, blocking the entire game loop including rendering. The way it's done now is completely wrong because of possible blocking, we need to do an asynchronous design. The response to the packet should be received via event loop, if the packet is received, then handle the corresponding connection event, thus implementing a deferred event invoke.

https://github.com/Warzone2100/warzone2100/blob/master/lib/netplay/netplay.cpp#L5008

The connection operation should be redesigned with an appropriate interface, preferably displaying an abort dialog.

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

No branches or pull requests

1 participant