mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
- rename CL_UpdateUserinfo to CL_ParseUpdateUserInfo for uniformness
- rework svc_updateuserinfo/CL_ParseUpdateUserInfo like everything else
This commit is contained in:
parent
5e4ea0b316
commit
634c2c6acf
3 changed files with 28 additions and 9 deletions
|
@ -40,6 +40,13 @@ typedef struct net_svc_print_s
|
|||
const char *message;
|
||||
} 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
|
||||
{
|
||||
short size;
|
||||
|
@ -63,6 +70,8 @@ typedef struct net_svc_modellist_s
|
|||
} net_svc_modellist_t;
|
||||
|
||||
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_Soundlist_Parse (net_svc_soundlist_t *soundlist, msg_t *message);
|
||||
void NET_SVC_Modellist_Parse (net_svc_modellist_t *modellist, msg_t *message);
|
||||
|
|
|
@ -997,22 +997,23 @@ CL_ProcessUserInfo (int slot, player_info_t *player)
|
|||
}
|
||||
|
||||
void
|
||||
CL_UpdateUserinfo (void)
|
||||
CL_ParseUpdateUserInfo (void)
|
||||
{
|
||||
int slot;
|
||||
player_info_t *player;
|
||||
net_svc_updateuserinfo_t updateuserinfo;
|
||||
|
||||
slot = MSG_ReadByte (net_message);
|
||||
if (slot >= MAX_CLIENTS)
|
||||
NET_SVC_UpdateUserInfo_Parse (&updateuserinfo, net_message);
|
||||
|
||||
if (updateuserinfo.slot >= MAX_CLIENTS)
|
||||
Host_EndGame
|
||||
("CL_ParseServerMessage: svc_updateuserinfo > MAX_SCOREBOARD");
|
||||
|
||||
player = &cl.players[slot];
|
||||
player->userid = MSG_ReadLong (net_message);
|
||||
strncpy (player->userinfo, MSG_ReadString (net_message),
|
||||
player = &cl.players[updateuserinfo.slot];
|
||||
player->userid = updateuserinfo.userid;
|
||||
strncpy (player->userinfo, updateuserinfo.userinfo,
|
||||
sizeof (player->userinfo) - 1);
|
||||
|
||||
CL_ProcessUserInfo (slot, player);
|
||||
CL_ProcessUserInfo (updateuserinfo.slot, player);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1345,7 +1346,7 @@ CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_updateuserinfo:
|
||||
CL_UpdateUserinfo ();
|
||||
CL_ParseUpdateUserInfo ();
|
||||
break;
|
||||
|
||||
case svc_setinfo:
|
||||
|
|
|
@ -56,6 +56,15 @@ NET_SVC_Print_Parse (net_svc_print_t *print, msg_t *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
|
||||
NET_SVC_Download_Parse (net_svc_download_t *download, msg_t *message)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue