Feature: [Network] Optionally send NewGRF names with NewGRFs in GameInfo

Before 8a2da49 the NewGRF names were synchronized using UDP packets, however
those have been removed. With this a new version of the GameInfo packet is
introduced that allows to specify the type of serialisation happens for
NewGRFs. Either only the GRF ID and checksum, or those two plus the name of
the NewGRF.
On this request for local servers will send the NewGRFs names.
The Game Coordinator will get the names on the first registration, and after
that only the GRF ID and checksum.
This commit is contained in:
rubidium42
2021-07-18 13:42:01 +02:00
committed by rubidium42
parent 5dd524139f
commit 3eaa470632
4 changed files with 89 additions and 22 deletions

View File

@@ -410,13 +410,14 @@ void ClientNetworkCoordinatorSocketHandler::Register()
void ClientNetworkCoordinatorSocketHandler::SendServerUpdate()
{
Debug(net, 6, "Sending server update to Game Coordinator");
this->next_update = std::chrono::steady_clock::now() + NETWORK_COORDINATOR_DELAY_BETWEEN_UPDATES;
Packet *p = new Packet(PACKET_COORDINATOR_SERVER_UPDATE, TCP_MTU);
p->Send_uint8(NETWORK_COORDINATOR_VERSION);
SerializeNetworkGameInfo(p, GetCurrentNetworkServerGameInfo());
SerializeNetworkGameInfo(p, GetCurrentNetworkServerGameInfo(), this->next_update.time_since_epoch() != std::chrono::nanoseconds::zero());
this->SendPacket(p);
this->next_update = std::chrono::steady_clock::now() + NETWORK_COORDINATOR_DELAY_BETWEEN_UPDATES;
}
/**