Fix/Feature: (re)introduce NewGRF names for (unknown) NewGRFs #9449
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: this is currently only deployed on staging. Use
OTTD_COORDINATOR_CS="coordinator.openttd.org:4976" OTTD_STUN_CS="stun.staging.openttd.org:4975"
to test this PR.Motivation / Problem
With the removal of the UDP packets in lieu of the Game Coordinator listing, the ability to get the names for unknown NewGRFs for a server was lost.
Description
Introduce a new version for the Game Info packet that allows to specify the way the NewGRFs are serialized. This could be only GRF ID + MD5 checksum, GRF ID + MD5 checksum + name, or an index into a lookup table (more details later). For clients requesting information from a server, the names of the NewGRFs will automatically be sent.
Updates of a game server to the Game Coordinator will not send the names, except for the first registration of that game.
A new version of the Game Coordinator protocol was added so the Game Coordinator can provide a lookup table for the NewGRF ID + MD5 checksum + name for the NewGRFs in the listing. Upon further requests for the listing, in the same connection with the Game Coordinator, only minimal updates for the lookup table need to be sent.
Assuming about 500 unique NewGRFs used by all the servers combined, and 3000 server-NewGRF combinations this will save about 25 kB for the initial listing and 45 kB for subsequent listings.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.