MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / runGameCommandsForTick

Method runGameCommandsForTick

src/OpenLoco/src/Network/NetworkClient.cpp:370–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void 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
396void NetworkClient::initStatus(std::string_view text)
397{

Callers 1

processGameCommandsFunction · 0.80

Calls 2

doCommandForRealFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected