| 368 | } |
| 369 | |
| 370 | void NetworkClient::runGameCommandsForTick(uint32_t tick) |
| 371 | { |
| 372 | if (_status != NetworkClientStatus::connected) |
| 373 | { |
| 374 | return; |
| 375 | } |
| 376 | |
| 377 | // Execute all following commands if previously received |
| 378 | while (!_receivedGameCommands.empty()) |
| 379 | { |
| 380 | auto& nextPacket = _receivedGameCommands.front(); |
| 381 | if (nextPacket.index == _localGameCommandIndex + 1 && nextPacket.tick == tick) |
| 382 | { |
| 383 | _localGameCommandIndex++; |
| 384 | GameCommands::doCommandForReal(static_cast<GameCommands::GameCommand>(nextPacket.regs.esi), nextPacket.company, nextPacket.regs); |
| 385 | _receivedGameCommands.pop_front(); |
| 386 | } |
| 387 | else |
| 388 | { |
| 389 | break; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | updateLocalTick(); |
| 394 | } |
| 395 | |
| 396 | void NetworkClient::initStatus(std::string_view text) |
| 397 | { |
no test coverage detected