MCPcopy Create free account
hub / github.com/assaultcube/AC / updatemasterserver

Function updatemasterserver

source/src/serverms.cpp:167–176  ·  view source on GitHub ↗

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!

Source from the content-addressed store, hash-verified

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!
167static 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
178ENetSocket pongsock = ENET_SOCKET_NULL, lansock = ENET_SOCKET_NULL;
179extern int getpongflags(enet_uint32 ip);

Callers 1

servermsFunction · 0.85

Calls 2

filtertextFunction · 0.85
requestmasterfFunction · 0.85

Tested by

no test coverage detected