- rename CL_UpdateUserinfo to CL_ParseUpdateUserInfo for uniformness

- rework svc_updateuserinfo/CL_ParseUpdateUserInfo like everything
  else
This commit is contained in:
Adam Olsen 2001-10-18 07:01:40 +00:00
parent 5e4ea0b316
commit 634c2c6acf
3 changed files with 28 additions and 9 deletions

View file

@ -40,6 +40,13 @@ typedef struct net_svc_print_s
const char *message; const char *message;
} net_svc_print_t; } net_svc_print_t;
typedef struct net_svc_updateuserinfo_s
{
byte slot;
int userid;
const char *userinfo;
} net_svc_updateuserinfo_t;
typedef struct net_svc_download_s typedef struct net_svc_download_s
{ {
short size; short size;
@ -63,6 +70,8 @@ typedef struct net_svc_modellist_s
} net_svc_modellist_t; } net_svc_modellist_t;
void NET_SVC_Print_Parse (net_svc_print_t *print, msg_t *message); void NET_SVC_Print_Parse (net_svc_print_t *print, msg_t *message);
void NET_SVC_UpdateUserInfo_Parse (net_svc_updateuserinfo_t *updateuserinfo,
msg_t *message);
void NET_SVC_Download_Parse (net_svc_download_t *download, msg_t *message); void NET_SVC_Download_Parse (net_svc_download_t *download, msg_t *message);
void NET_SVC_Soundlist_Parse (net_svc_soundlist_t *soundlist, msg_t *message); void NET_SVC_Soundlist_Parse (net_svc_soundlist_t *soundlist, msg_t *message);
void NET_SVC_Modellist_Parse (net_svc_modellist_t *modellist, msg_t *message); void NET_SVC_Modellist_Parse (net_svc_modellist_t *modellist, msg_t *message);

View file

@ -997,22 +997,23 @@ CL_ProcessUserInfo (int slot, player_info_t *player)
} }
void void
CL_UpdateUserinfo (void) CL_ParseUpdateUserInfo (void)
{ {
int slot;
player_info_t *player; player_info_t *player;
net_svc_updateuserinfo_t updateuserinfo;
slot = MSG_ReadByte (net_message); NET_SVC_UpdateUserInfo_Parse (&updateuserinfo, net_message);
if (slot >= MAX_CLIENTS)
if (updateuserinfo.slot >= MAX_CLIENTS)
Host_EndGame Host_EndGame
("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD"); ("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD");
player = &cl.players[slot]; player = &cl.players[updateuserinfo.slot];
player->userid = MSG_ReadLong (net_message); player->userid = updateuserinfo.userid;
strncpy (player->userinfo, MSG_ReadString (net_message), strncpy (player->userinfo, updateuserinfo.userinfo,
sizeof (player->userinfo) - 1); sizeof (player->userinfo) - 1);
CL_ProcessUserInfo (slot, player); CL_ProcessUserInfo (updateuserinfo.slot, player);
} }
void void
@ -1345,7 +1346,7 @@ CL_ParseServerMessage (void)
break; break;
case svc_updateuserinfo: case svc_updateuserinfo:
CL_UpdateUserinfo (); CL_ParseUpdateUserInfo ();
break; break;
case svc_setinfo: case svc_setinfo:

View file

@ -56,6 +56,15 @@ NET_SVC_Print_Parse (net_svc_print_t *print, msg_t *message)
print->message = MSG_ReadString (message); print->message = MSG_ReadString (message);
} }
void
NET_SVC_UpdateUserInfo_Parse (net_svc_updateuserinfo_t *updateuserinfo,
msg_t *message)
{
updateuserinfo->slot = MSG_ReadByte (message);
updateuserinfo->userid = MSG_ReadLong (message);
updateuserinfo->userinfo = MSG_ReadString (message);
}
void void
NET_SVC_Download_Parse (net_svc_download_t *download, msg_t *message) NET_SVC_Download_Parse (net_svc_download_t *download, msg_t *message)
{ {