send alive signal to masterserver after 40 minutes of uptime and if currently in intermission (so theoretically <= 1 hour) TODO?: implement a thread to drop this "only in intermission" business, we'll need it once AUTH gets active!
| 165 | // send alive signal to masterserver after 40 minutes of uptime and if currently in intermission (so theoretically <= 1 hour) |
| 166 | // TODO?: implement a thread to drop this "only in intermission" business, we'll need it once AUTH gets active! |
| 167 | static inline void updatemasterserver(int millis, int port, int _interm) |
| 168 | { |
| 169 | if(!lastupdatemaster || ((millis-lastupdatemaster)>40*60*1000 && (_interm || !totalclients))) |
| 170 | { |
| 171 | string servdesc; extern string servpubkey; |
| 172 | filtertext(servdesc, scl.servdesc_full[0] ? scl.servdesc_full : "noname", FTXT__GLOBALNAME, 20); |
| 173 | if(mastername[0]) requestmasterf("regserv %d %s-%s %d\n", port, servdesc, scl.ssk ? servpubkey : "nokey", AC_VERSION); |
| 174 | lastupdatemaster = millis + 1; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | ENetSocket pongsock = ENET_SOCKET_NULL, lansock = ENET_SOCKET_NULL; |
| 179 | extern int getpongflags(enet_uint32 ip); |
no test coverage detected