OpenTTD / OpenTTD

OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe
https://www.openttd.org/
Other
6.02k stars 843 forks source link

Fix: ensure revision mismatch also considers random debugging status #12673

Open rubidium42 opened 2 weeks ago

rubidium42 commented 2 weeks ago

Motivation / Problem

Few days of someone in the chat complaining that clients get kicked off after a while. This was caused because random debugging was enabled on the server, and as such rarely the right token would be sent back by the client, causing it to get kicked off due to seemingly getting lagged.

Description

Inject "dbg_seed-" or "dbg_sync-" into the network revision string, and check this before checking the hash. This way you'll get a client mismatch, instead of some weird behaviour.

With this running the server/client with debug level of at least 3 will show the revision string, and it becomes clear they mismatch. The extra tokens could be found quite easily, and the user should get the idea that what is being done isn't fully compatible.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.