{
cl.parsingtextmode = CL_PARSETEXTMODE_PING;
cl.parsingtextplayerindex = 0;
- return !sb_showscores;
+ return !cl.parsingtextexpectingpingforscores;
}
if (!strncmp(text, "host: ", 9))
{
+ cl.parsingtextexpectingpingforscores = false;
cl.parsingtextmode = CL_PARSETEXTMODE_STATUS;
cl.parsingtextplayerindex = 0;
return true;
if (cl.parsingtextmode == CL_PARSETEXTMODE_PING)
{
// if anything goes wrong, we'll assume this is not a ping report
+ qboolean expected = cl.parsingtextexpectingpingforscores;
+ cl.parsingtextexpectingpingforscores = false;
cl.parsingtextmode = CL_PARSETEXTMODE_NONE;
t = text;
while (*t == ' ')
{
// we parsed a valid ping entry, so expect another to follow
cl.parsingtextmode = CL_PARSETEXTMODE_PING;
+ cl.parsingtextexpectingpingforscores = expected;
}
- return !sb_showscores;
+ return !expected;
}
}
}
// keep track of svc_print parsing state (analyzes ping reports and status reports)
cl_parsingtextmode_t parsingtextmode;
int parsingtextplayerindex;
+ // set by scoreboard code when sending ping command, this causes the next ping results to be hidden
+ // (which could eat the wrong ping report if the player issues one
+ // manually, but they would still see a ping report, just a later one
+ // caused by the scoreboard code rather than the one they intentionally
+ // issued)
+ qboolean parsingtextexpectingpingforscores;
// entity database stuff
// latest received entity frame numbers
else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6 || cls.protocol == PROTOCOL_DARKPLACES7)
{
// these servers usually lack the pings command and so a less efficient "ping" command must be sent, which on modern DP servers will also reply with a pingplreport command after the ping listing
+ cl.parsingtextexpectingpingforscores = true; // hide the output of the next ping report
MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
MSG_WriteString(&cls.netcon->message, "ping");
}