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

Method runGameCommands

src/OpenLoco/src/Network/NetworkServer.cpp:331–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void NetworkServer::runGameCommands()
332{
333 auto& gameState = getGameState();
334 auto tick = gameState.scenarioTicks;
335
336 // Execute all following commands if previously received
337 while (!_gameCommands.empty())
338 {
339 auto& gc = _gameCommands.front();
340
341 [[maybe_unused]] auto result = GameCommands::doCommandForReal(static_cast<GameCommands::GameCommand>(gc.regs.esi), gc.company, gc.regs);
342
343 // TODO We can't do this, we have to send a dummy command to the clients
344 // otherwise we skip a game command index
345 // if (result != 0x80000000)
346 // {
347 sendGameCommand(gc.index, tick, gc.company, gc.regs);
348 // }
349
350 _gameCommands.pop();
351 }
352}

Callers 1

processGameCommandsFunction · 0.80

Calls 3

doCommandForRealFunction · 0.85
popMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected