mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 16:51:08 +00:00
- convert svc_setinfo, bla bla, you know hte drill
This commit is contained in:
parent
634c2c6acf
commit
d2fe052d59
3 changed files with 30 additions and 16 deletions
|
@ -47,6 +47,13 @@ typedef struct net_svc_updateuserinfo_s
|
||||||
const char *userinfo;
|
const char *userinfo;
|
||||||
} net_svc_updateuserinfo_t;
|
} net_svc_updateuserinfo_t;
|
||||||
|
|
||||||
|
typedef struct net_svc_setinfo_s
|
||||||
|
{
|
||||||
|
byte slot;
|
||||||
|
const char *key;
|
||||||
|
const char *value;
|
||||||
|
} net_svc_setinfo_t;
|
||||||
|
|
||||||
typedef struct net_svc_download_s
|
typedef struct net_svc_download_s
|
||||||
{
|
{
|
||||||
short size;
|
short size;
|
||||||
|
@ -72,6 +79,7 @@ typedef struct net_svc_modellist_s
|
||||||
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,
|
void NET_SVC_UpdateUserInfo_Parse (net_svc_updateuserinfo_t *updateuserinfo,
|
||||||
msg_t *message);
|
msg_t *message);
|
||||||
|
void NET_SVC_SetInfo_Parse (net_svc_setinfo_t *setinfo, 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);
|
||||||
|
|
|
@ -1019,28 +1019,26 @@ CL_ParseUpdateUserInfo (void)
|
||||||
void
|
void
|
||||||
CL_SetInfo (void)
|
CL_SetInfo (void)
|
||||||
{
|
{
|
||||||
char key[MAX_MSGLEN], value[MAX_MSGLEN];
|
int flags;
|
||||||
int slot;
|
player_info_t *player;
|
||||||
player_info_t *player;
|
net_svc_setinfo_t setinfo;
|
||||||
|
|
||||||
slot = MSG_ReadByte (net_message);
|
NET_SVC_SetInfo_Parse (&setinfo, net_message);
|
||||||
if (slot >= MAX_CLIENTS)
|
|
||||||
|
if (setinfo.slot >= MAX_CLIENTS)
|
||||||
Host_EndGame ("CL_ParseServerMessage: svc_setinfo > MAX_SCOREBOARD");
|
Host_EndGame ("CL_ParseServerMessage: svc_setinfo > MAX_SCOREBOARD");
|
||||||
|
|
||||||
player = &cl.players[slot];
|
player = &cl.players[setinfo.slot];
|
||||||
|
|
||||||
strncpy (key, MSG_ReadString (net_message), sizeof (key) - 1);
|
Con_DPrintf ("SETINFO %s: %s=%s\n", player->name, setinfo.key,
|
||||||
key[sizeof (key) - 1] = 0;
|
setinfo.value);
|
||||||
strncpy (value, MSG_ReadString (net_message), sizeof (value) - 1);
|
|
||||||
key[sizeof (value) - 1] = 0;
|
|
||||||
|
|
||||||
Con_DPrintf ("SETINFO %s: %s=%s\n", player->name, key, value);
|
flags = !strequal (setinfo.key, "name");
|
||||||
|
flags |= strequal (setinfo.key, "team") << 1;
|
||||||
|
Info_SetValueForKey (player->userinfo, setinfo.key, setinfo.value,
|
||||||
|
MAX_INFO_STRING, flags);
|
||||||
|
|
||||||
Info_SetValueForKey (player->userinfo, key, value, MAX_INFO_STRING,
|
CL_ProcessUserInfo (setinfo.slot, player);
|
||||||
(!strequal (key, "name"))
|
|
||||||
| (strequal (key, "team") << 1));
|
|
||||||
|
|
||||||
CL_ProcessUserInfo (slot, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -65,6 +65,14 @@ NET_SVC_UpdateUserInfo_Parse (net_svc_updateuserinfo_t *updateuserinfo,
|
||||||
updateuserinfo->userinfo = MSG_ReadString (message);
|
updateuserinfo->userinfo = MSG_ReadString (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NET_SVC_SetInfo_Parse (net_svc_setinfo_t *setinfo, msg_t *message)
|
||||||
|
{
|
||||||
|
setinfo->slot = MSG_ReadByte (message);
|
||||||
|
setinfo->key = MSG_ReadString (message);
|
||||||
|
setinfo->value = 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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue