| 215 | } |
| 216 | |
| 217 | void 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 | |
| 238 | void NetworkServer::sendChatMessages() |
| 239 | { |
nothing calls this directly
no test coverage detected