summaryrefslogtreecommitdiff
path: root/src/fpsgame/extinfo.h
diff options
context:
space:
mode:
authorxolatile2025-08-04 18:17:30 +0200
committerxolatile2025-08-04 18:17:30 +0200
commita89dca11cf475e0bd1399cf5d5c5135d00495ec3 (patch)
tree4d551a7f4193bc89a0b8560e955f4f874101b388 /src/fpsgame/extinfo.h
parent9d533fa4d82935a083ff93a09aed95baea9fbfd4 (diff)
downloadxolatile-badassbug-a89dca11cf475e0bd1399cf5d5c5135d00495ec3.tar.xz
xolatile-badassbug-a89dca11cf475e0bd1399cf5d5c5135d00495ec3.tar.zst
Minor changes...
Diffstat (limited to 'src/fpsgame/extinfo.h')
-rw-r--r--src/fpsgame/extinfo.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/fpsgame/extinfo.h b/src/fpsgame/extinfo.h
index 0e747e7..b1f4119 100644
--- a/src/fpsgame/extinfo.h
+++ b/src/fpsgame/extinfo.h
@@ -16,7 +16,7 @@
B: 0 EXT_PLAYERSTATS cn #a client number or -1 for all players#
C: 0 EXT_TEAMSCORE
- Server:
+ Server:
--------
A: 0 EXT_UPTIME EXT_ACK EXT_VERSION uptime #in seconds#
B: 0 EXT_PLAYERSTATS cn #send by client# EXT_ACK EXT_VERSION 0 or 1 #error, if cn was > -1 and client does not exist# ...
@@ -58,8 +58,7 @@
{
sendstring(team, p);
putint(p, score);
- if(!smode || !smode->extinfoteam(team, p))
- putint(p,-1); //no bases follow
+ putint(p,-1); //no bases follow
}
void extinfoteams(ucharbuf &p)
@@ -70,14 +69,13 @@
if(!m_teammode) return;
vector<teamscore> scores;
- if(smode && smode->hidefrags()) smode->getteamscores(scores);
loopv(clients)
{
clientinfo *ci = clients[i];
if(ci->state.state!=CS_SPECTATOR && ci->team[0] && scores.htfind(ci->team) < 0)
{
- if(smode && smode->hidefrags()) scores.add(teamscore(ci->team, 0));
- else { teaminfo *ti = teaminfos.access(ci->team); scores.add(teamscore(ci->team, ti ? ti->frags : 0)); }
+ teaminfo *ti = teaminfos.access(ci->team);
+ scores.add(teamscore(ci->team, ti ? ti->frags : 0));
}
}
loopv(scores) extinfoteamscore(p, scores[i].team, scores[i].score);
@@ -85,7 +83,7 @@
void extserverinforeply(ucharbuf &req, ucharbuf &p)
{
- int extcmd = getint(req); // extended commands
+ int extcmd = getint(req); // extended commands
//Build a new packet
putint(p, EXT_ACK); //send ack
@@ -102,7 +100,7 @@
case EXT_PLAYERSTATS:
{
int cn = getint(req); //a special player, -1 for all
-
+
clientinfo *ci = NULL;
if(cn >= 0)
{
@@ -116,13 +114,13 @@
}
putint(p, EXT_NO_ERROR); //so far no error can happen anymore
-
+
ucharbuf q = p; //remember buffer position
putint(q, EXT_PLAYERSTATS_RESP_IDS); //send player ids following
if(ci) putint(q, ci->clientnum);
else loopv(clients) putint(q, clients[i]->clientnum);
sendserverinforeply(q);
-
+
if(ci) extinfoplayer(p, ci);
else loopv(clients) extinfoplayer(p, clients[i]);
return;