Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Unregister of MasterServer happens per IP, instead of per session_key #7829
Version of OpenTTD
Since protocol v2
When closing a server, send only a single packet to unregister the server.
For every IP the server was listening on, an unregister packet is send.
Steps to reproduce
Start and stop a server. Look at the network traffic (set debug of 'net' to 9).
In earlier version of OpenTTD, every IP resulted in a new server entry on the server listing. Of course we didn't want that, and with the creation of protocol v2 this was solved. But here a mix of old and new code stayed together. Unregistering is done per IP, but when registering you get assigned a session_key, which is unique to your server (no matter how many IPs). Every IP you register with the same session_key, is added together. So there no longer is any need to unregister every IP. Just the session_key, once.
Together with #7828, a better approach might be to create a protocol v3, and fix these issues.