mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Correctly parse the name of the players returned by the serverstatus command
This commit is contained in:
parent
872b3f5d70
commit
79643d963e
1 changed files with 5 additions and 7 deletions
|
@ -4053,7 +4053,7 @@ CL_ServerStatusResponse
|
|||
void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
|
||||
const char *s;
|
||||
char info[MAX_INFO_STRING];
|
||||
int i, l, score, ping;
|
||||
int i, l, ping;
|
||||
int len;
|
||||
serverStatus_t *serverStatus;
|
||||
|
||||
|
@ -4107,7 +4107,7 @@ void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
|
|||
|
||||
if (serverStatus->print) {
|
||||
Com_Printf("\nPlayers:\n");
|
||||
Com_Printf("num: score: ping: name:\n");
|
||||
Com_Printf("num: ping: name:\n");
|
||||
}
|
||||
for (i = 0, s = MSG_ReadStringLine( msg ); *s; s = MSG_ReadStringLine( msg ), i++) {
|
||||
|
||||
|
@ -4115,16 +4115,14 @@ void CL_ServerStatusResponse( netadr_t from, msg_t *msg ) {
|
|||
Com_sprintf(&serverStatus->string[len], sizeof(serverStatus->string)-len, "\\%s", s);
|
||||
|
||||
if (serverStatus->print) {
|
||||
score = ping = 0;
|
||||
sscanf(s, "%d %d", &score, &ping);
|
||||
ping = 0;
|
||||
sscanf(s, "%d", &ping);
|
||||
s = strchr(s, ' ');
|
||||
if (s)
|
||||
s = strchr(s+1, ' ');
|
||||
if (s)
|
||||
s++;
|
||||
else
|
||||
s = "unknown";
|
||||
Com_Printf("%-2d %-3d %-3d %s\n", i, score, ping, s );
|
||||
Com_Printf("%-2d %-3d %s\n", i, ping, s );
|
||||
}
|
||||
}
|
||||
len = strlen(serverStatus->string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue