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

Method sendPings

src/OpenLoco/src/Network/NetworkServer.cpp:217–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void NetworkServer::sendPings()
218{
219 auto now = Platform::getTime();
220 if (now - _lastPing > kPingInterval)
221 {
222 _lastPing = now;
223
224 auto& gameState = getGameState();
225
226 PingPacket packet;
227 packet.gameCommandIndex = _gameCommandIndex;
228 packet.tick = gameState.scenarioTicks;
229 packet.srand0 = gameState.rng.srand_0();
230 packet.srand1 = gameState.rng.srand_1();
231 for (auto& client : _clients)
232 {
233 client->connection->sendPacket(packet);
234 }
235 }
236}
237
238void NetworkServer::sendChatMessages()
239{

Callers

nothing calls this directly

Calls 4

srand_0Method · 0.80
srand_1Method · 0.80
getTimeFunction · 0.50
sendPacketMethod · 0.45

Tested by

no test coverage detected