| 4394 | } |
| 4395 | |
| 4396 | void sendworldstate() |
| 4397 | { |
| 4398 | static enet_uint32 lastsend = 0; |
| 4399 | if(clients.empty()) return; |
| 4400 | enet_uint32 curtime = enet_time_get()-lastsend; |
| 4401 | if(curtime<40) return; |
| 4402 | bool flush = buildworldstate(); |
| 4403 | lastsend += curtime - (curtime%40); |
| 4404 | if(flush) enet_host_flush(serverhost); |
| 4405 | if(demorecord) sg->recordpackets = true; // enable after 'old' worldstate is sent |
| 4406 | } |
| 4407 | |
| 4408 | void loggamestatus(const char *reason) |
| 4409 | { |
no test coverage detected