mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 16:30:43 +00:00
forward port the client info string filtering from 0.3 and remove info.h from
a couple of c files that no longer need it.
This commit is contained in:
parent
8c026417d8
commit
74e9f89e8c
8 changed files with 63 additions and 18 deletions
|
@ -155,6 +155,24 @@ void SV_AcceptClient (netadr_t adr, int userid, char *userinfo);
|
|||
void Master_Shutdown (void);
|
||||
|
||||
|
||||
const char *client_info_filters[] = { // Info keys needed by client
|
||||
"name",
|
||||
"topcolor",
|
||||
"bottomcolor",
|
||||
"rate",
|
||||
"msg",
|
||||
"skin",
|
||||
"team",
|
||||
"noaim",
|
||||
"pmodel",
|
||||
"emodel",
|
||||
"spectator",
|
||||
"*spectator",
|
||||
"*ver",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
qboolean
|
||||
ServerPaused (void)
|
||||
{
|
||||
|
@ -349,7 +367,7 @@ SV_FullClientUpdate (client_t *client, sizebuf_t *buf)
|
|||
MSG_WriteFloat (buf, realtime - client->connection_started);
|
||||
|
||||
strncpy (info, client->userinfo, sizeof (info));
|
||||
Info_RemovePrefixedKeys (info, '_'); // server passwords, etc
|
||||
Info_RemovePrefixedKeys (info, '_', client_info_filters); // server passwords, etc
|
||||
|
||||
MSG_WriteByte (buf, svc_updateuserinfo);
|
||||
MSG_WriteByte (buf, i);
|
||||
|
|
|
@ -1353,11 +1353,15 @@ PF_setinfokey (progs_t *pr)
|
|||
Info_SetValueForKey (svs.clients[e1 - 1].userinfo, key, value,
|
||||
MAX_INFO_STRING, !sv_highchars->int_val);
|
||||
SV_ExtractFromUserinfo (&svs.clients[e1 - 1]);
|
||||
MSG_WriteByte (&sv.reliable_datagram, svc_setinfo);
|
||||
MSG_WriteByte (&sv.reliable_datagram, e1 - 1);
|
||||
MSG_WriteString (&sv.reliable_datagram, key);
|
||||
MSG_WriteString (&sv.reliable_datagram,
|
||||
Info_ValueForKey (svs.clients[e1 - 1].userinfo, key));
|
||||
|
||||
if (Info_FilterForKey (Cmd_Argv (1), client_info_filters)) {
|
||||
MSG_WriteByte (&sv.reliable_datagram, svc_setinfo);
|
||||
MSG_WriteByte (&sv.reliable_datagram, e1 - 1);
|
||||
MSG_WriteString (&sv.reliable_datagram, key);
|
||||
MSG_WriteString (&sv.reliable_datagram,
|
||||
Info_ValueForKey (svs.clients[e1 - 1].userinfo,
|
||||
key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1148,11 +1148,14 @@ SV_SetInfo_f (void)
|
|||
// process any changed values
|
||||
SV_ExtractFromUserinfo (host_client);
|
||||
|
||||
MSG_WriteByte (&sv.reliable_datagram, svc_setinfo);
|
||||
MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
|
||||
MSG_WriteString (&sv.reliable_datagram, Cmd_Argv (1));
|
||||
MSG_WriteString (&sv.reliable_datagram,
|
||||
Info_ValueForKey (host_client->userinfo, Cmd_Argv (1)));
|
||||
if (Info_FilterForKey (Cmd_Argv (1), client_info_filters)) {
|
||||
MSG_WriteByte (&sv.reliable_datagram, svc_setinfo);
|
||||
MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
|
||||
MSG_WriteString (&sv.reliable_datagram, Cmd_Argv (1));
|
||||
MSG_WriteString (&sv.reliable_datagram,
|
||||
Info_ValueForKey (host_client->userinfo,
|
||||
Cmd_Argv (1)));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue