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

Method SendSync

src/network/network_server.cpp:639–652  ·  view source on GitHub ↗

Request the client to sync. */

Source from the content-addressed store, hash-verified

637
638/** Request the client to sync. */
639NetworkRecvStatus ServerNetworkGameSocketHandler::SendSync()
640{
641 Debug(net, 9, "client[{}] SendSync(), frame_counter={}, sync_seed_1={}", this->client_id, _frame_counter, _sync_seed_1);
642
643 auto p = std::make_unique<Packet>(this, PACKET_SERVER_SYNC);
644 p->Send_uint32(_frame_counter);
645 p->Send_uint32(_sync_seed_1);
646
647#ifdef NETWORK_SEND_DOUBLE_SEED
648 p->Send_uint32(_sync_seed_2);
649#endif
650 this->SendPacket(std::move(p));
651 return NETWORK_RECV_STATUS_OKAY;
652}
653
654/**
655 * Send a command to the client to execute.

Callers 2

Receive_CLIENT_MAP_OKMethod · 0.95
NetworkServer_TickFunction · 0.80

Calls 2

Send_uint32Method · 0.80
SendPacketMethod · 0.45

Tested by

no test coverage detected