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

Function loggamestatus

source/src/server.cpp:4408–4462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4406}
4407
4408void loggamestatus(const char *reason)
4409{
4410 int fragscore[2] = {0, 0}, flagscore[2] = {0, 0}, pnum[2] = {0, 0};
4411 string text;
4412 formatstring(text)("%d minutes remaining", sg->minremain);
4413 mlog(ACLOG_INFO, "");
4414 mlog(ACLOG_INFO, "Game status: %s on %s, %s, %s, %d clients%c %s",
4415 modestr(gamemode), sg->smapname, reason ? reason : text, mmfullname(sg->mastermode), totalclients, sg->custom_servdesc ? ',' : '\0', sg->servdesc_current);
4416 if(!scl.loggamestatus) return;
4417 mlog(ACLOG_INFO, "cn name %s%s frag death %sping role host", m_teammode ? "team " : "", m_flags_ ? "flag " : "", m_teammode ? "tk " : "");
4418 loopv(clients)
4419 {
4420 client &c = *clients[i];
4421 if(c.type == ST_EMPTY || !c.name[0]) continue;
4422 formatstring(text)("%2d %-16s ", c.clientnum, c.name); // cn name
4423 if(m_teammode) concatformatstring(text, "%-4s ", team_string(c.team, true)); // teamname (abbreviated)
4424 if(m_flags_) concatformatstring(text, "%4d ", c.state.flagscore); // flag
4425 concatformatstring(text, "%4d %5d", c.state.frags, c.state.deaths); // frag death
4426 if(m_teammode) concatformatstring(text, " %2d", c.state.teamkills); // tk
4427 mlog(ACLOG_INFO, "%s%5d %s %s", text, c.ping, c.role == CR_ADMIN ? "admin " : "normal", c.hostname);
4428 if(c.team != TEAM_SPECT)
4429 {
4430 int t = team_base(c.team);
4431 flagscore[t] += c.state.flagscore;
4432 fragscore[t] += c.state.frags;
4433 pnum[t] += 1;
4434 }
4435 }
4436 if(sg->mastermode == MM_MATCH)
4437 {
4438 loopv(savedscores)
4439 {
4440 savedscore &sc = savedscores[i];
4441 if(sc.valid)
4442 {
4443 if(m_teammode) formatstring(text)("%-4s ", team_string(sc.team, true));
4444 else text[0] = '\0';
4445 if(m_flags_) concatformatstring(text, "%4d ", sc.flagscore);
4446 mlog(ACLOG_INFO, " %-16s %s%4d %5d%s - disconnected", sc.name, text, sc.frags, sc.deaths, m_teammode ? " -" : "");
4447 if(sc.team != TEAM_SPECT)
4448 {
4449 int t = team_base(sc.team);
4450 flagscore[t] += sc.flagscore;
4451 fragscore[t] += sc.frags;
4452 pnum[t] += 1;
4453 }
4454 }
4455 }
4456 }
4457 if(m_teammode)
4458 {
4459 loopi(2) mlog(ACLOG_INFO, "Team %4s:%3d players,%5d frags%c%5d flags", team_string(i), pnum[i], fragscore[i], m_flags_ ? ',' : '\0', flagscore[i]);
4460 }
4461 mlog(ACLOG_INFO, "");
4462}
4463
4464static unsigned char chokelog[MAXCLIENTS + 1] = { 0 };
4465

Callers 1

serversliceFunction · 0.85

Calls 5

mlogFunction · 0.85
modestrFunction · 0.85
mmfullnameFunction · 0.85
team_stringFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected