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

Function resetserver

source/src/server.cpp:2318–2348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2316}
2317
2318void resetserver(const char *newname, int newmode, int newtime)
2319{
2320 if(m_demo) enddemoplayback();
2321 else enddemorecord();
2322
2323 sg->free(); // for now: clean out old servergame states
2324 sg->curmap = NULL;
2325
2326 sg->smode = newmode;
2327 copystring(sg->smapname, newname);
2328 sg->srvgamesalt = (rnd(0x1000000)*((servmillis%4200)+1)) ^ rnd(0x1000000);
2329
2330 sg->minremain = newtime > 0 ? newtime : defaultgamelimit(newmode);
2331 sg->gamemillis = 0;
2332 sg->gamelimit = sg->minremain * 60000;
2333 sg->arenaround = sg->arenaroundstartmillis = 0;
2334
2335 sg->interm = sg->nextsendscore = 0;
2336 sg->lastfillup = servmillis;
2337 sg->sents.shrink(0);
2338 if(sg->mastermode == MM_PRIVATE)
2339 {
2340 loopv(savedscores) savedscores[i].valid = false;
2341 }
2342 else savedscores.shrink(0);
2343 ctfreset();
2344
2345 sg->sispaused = false;
2346 sg->nextmapname[0] = '\0';
2347 sg->forceintermission = false;
2348}
2349
2350void startdemoplayback(const char *newname)
2351{

Callers 3

startdemoplaybackFunction · 0.85
startgameFunction · 0.85
resetserverifemptyFunction · 0.85

Calls 8

enddemoplaybackFunction · 0.85
enddemorecordFunction · 0.85
copystringFunction · 0.85
defaultgamelimitFunction · 0.85
ctfresetFunction · 0.85
freeMethod · 0.80
shrinkMethod · 0.80
loopvFunction · 0.70

Tested by

no test coverage detected