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

Function extinfo_teamscorebuf

source/src/server.cpp:4822–4844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4820}
4821
4822void extinfo_teamscorebuf(ucharbuf &p)
4823{
4824 putint(p, m_teammode ? EXT_ERROR_NONE : EXT_ERROR);
4825 putint(p, gamemode);
4826 putint(p, sg->minremain);
4827 if(!m_teammode) return;
4828
4829 int teamsizes[TEAM_NUM] = { 0 }, fragscores[TEAM_NUM] = { 0 }, flagscores[TEAM_NUM] = { 0 };
4830 loopv(clients) if(clients[i]->type!=ST_EMPTY && team_isvalid(clients[i]->team))
4831 {
4832 teamsizes[clients[i]->team] += 1;
4833 fragscores[clients[i]->team] += clients[i]->state.frags;
4834 flagscores[clients[i]->team] += clients[i]->state.flagscore;
4835 }
4836
4837 loopi(TEAM_NUM) if(teamsizes[i])
4838 {
4839 sendstring(team_string(i), p); // team name
4840 putint(p, fragscores[i]); // add fragscore per team
4841 putint(p, m_flags_ ? flagscores[i] : -1); // add flagscore per team
4842 putint(p, -1); // ?
4843 }
4844}
4845
4846
4847#ifndef STANDALONE

Callers 1

servermsFunction · 0.85

Calls 5

putintFunction · 0.85
sendstringFunction · 0.85
team_stringFunction · 0.85
loopvFunction · 0.70
loopiFunction · 0.70

Tested by

no test coverage detected