* 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
| 243 | * @param cs The client to sync the queue to. |
| 244 | */ |
| 245 | void 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. |