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

Function NetworkSyncCommandQueue

src/network/network_command.cpp:245–251  ·  view source on GitHub ↗

* Sync our local command queue to the command queue of the given * socket. This is needed for the case where we receive a command * before saving the game for a joining client, but without the * execution of those commands. Not syncing those commands means * that the client will never get them and as such will be in a * desynced state from the time it started with joining. * @param cs The cl

Source from the content-addressed store, hash-verified

243 * @param cs The client to sync the queue to.
244 */
245void NetworkSyncCommandQueue(NetworkClientSocket *cs)
246{
247 for (auto &p : _local_execution_queue) {
248 CommandPacket &c = cs->outgoing_queue.emplace_back(p);
249 c.callback = nullptr;
250 }
251}
252
253/**
254 * Execute all commands on the local command queue that ought to be executed this frame.

Callers 1

SendMapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected