MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SendServerUpdate

Method SendServerUpdate

src/network/network_coordinator.cpp:488–500  ·  view source on GitHub ↗

* Send an update of our server status to the Game Coordinator. */

Source from the content-addressed store, hash-verified

486 * Send an update of our server status to the Game Coordinator.
487 */
488void ClientNetworkCoordinatorSocketHandler::SendServerUpdate()
489{
490 Debug(net, 6, "Sending server update to Game Coordinator");
491
492 auto p = std::make_unique<Packet>(this, PACKET_COORDINATOR_SERVER_UPDATE, TCP_MTU);
493 p->Send_uint8(NETWORK_COORDINATOR_VERSION);
494 SerializeNetworkGameInfo(*p, GetCurrentNetworkServerGameInfo(), this->next_update.time_since_epoch() != std::chrono::nanoseconds::zero());
495
496 Debug(net, 9, "Coordinator::SendServerUpdate()");
497 this->SendPacket(std::move(p));
498
499 this->next_update = std::chrono::steady_clock::now() + NETWORK_COORDINATOR_DELAY_BETWEEN_UPDATES;
500}
501
502/**
503 * Request a listing of all public servers.

Callers 1

SendReceiveMethod · 0.95

Calls 4

SerializeNetworkGameInfoFunction · 0.85
nowClass · 0.85
Send_uint8Method · 0.45
SendPacketMethod · 0.45

Tested by

no test coverage detected