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:
Bill Currie 2002-02-13 17:52:53 +00:00
parent f1ea286a44
commit 2c1173aadf

View file

@ -976,8 +976,10 @@ CL_ProcessUserInfo (int slot, player_info_t *player)
void void
CL_UpdateUserinfo (void) CL_UpdateUserinfo (void)
{ {
int slot; int slot;
player_info_t *player; player_info_t *player;
int uid;
const char *info;
slot = MSG_ReadByte (net_message); slot = MSG_ReadByte (net_message);
if (slot >= MAX_CLIENTS) if (slot >= MAX_CLIENTS)
@ -985,13 +987,19 @@ CL_UpdateUserinfo (void)
("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD"); ("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD");
player = &cl.players[slot]; player = &cl.players[slot];
player->userid = MSG_ReadLong (net_message);
if (player->userinfo) if (player->userinfo)
Info_Destroy (player->userinfo); Info_Destroy (player->userinfo);
player->userinfo = Info_ParseString (MSG_ReadString (net_message), uid = MSG_ReadLong (net_message);
MAX_INFO_STRING); info = MSG_ReadString (net_message);
if (*info) {
CL_ProcessUserInfo (slot, player); // 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 void