mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
totally zap a client slot when the server sends an svc_updateuserinfo with
a blank info string as the only way this should ever happen is when the server is dropping the relevant client so our client might as well drop it too.
This commit is contained in:
parent
f1ea286a44
commit
2c1173aadf
1 changed files with 14 additions and 6 deletions
|
@ -976,8 +976,10 @@ CL_ProcessUserInfo (int slot, player_info_t *player)
|
|||
void
|
||||
CL_UpdateUserinfo (void)
|
||||
{
|
||||
int slot;
|
||||
int slot;
|
||||
player_info_t *player;
|
||||
int uid;
|
||||
const char *info;
|
||||
|
||||
slot = MSG_ReadByte (net_message);
|
||||
if (slot >= MAX_CLIENTS)
|
||||
|
@ -985,13 +987,19 @@ CL_UpdateUserinfo (void)
|
|||
("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD");
|
||||
|
||||
player = &cl.players[slot];
|
||||
player->userid = MSG_ReadLong (net_message);
|
||||
if (player->userinfo)
|
||||
Info_Destroy (player->userinfo);
|
||||
player->userinfo = Info_ParseString (MSG_ReadString (net_message),
|
||||
MAX_INFO_STRING);
|
||||
|
||||
CL_ProcessUserInfo (slot, player);
|
||||
uid = MSG_ReadLong (net_message);
|
||||
info = MSG_ReadString (net_message);
|
||||
if (*info) {
|
||||
// a totally empty userinfo string should not be possible
|
||||
player->userid = uid;
|
||||
player->userinfo = Info_ParseString (info, MAX_INFO_STRING);
|
||||
CL_ProcessUserInfo (slot, player);
|
||||
} else {
|
||||
// the server dropped the client
|
||||
memset (player, 0, sizeof (*player));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue