1
0
Fork 0
forked from fte/fteqw

Spike fixed so that MVDSV does not kick us for userinfo spamming.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2656 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Molgrum 2007-09-10 22:12:13 +00:00
parent 0c6e751778
commit f099ce3e58

View file

@ -674,18 +674,22 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force)
#ifndef SERVERONLY #ifndef SERVERONLY
if (var->flags & CVAR_USERINFO) if (var->flags & CVAR_USERINFO)
{ {
Info_SetValueForKey (cls.userinfo, var->name, value, MAX_INFO_STRING); char *old = Info_ValueForKey(cls.userinfo, var->name);
if (cls.state >= ca_connected) if (strcmp(old, value)) //only spam the server if it actually changed
{ { //this helps with config execs
Info_SetValueForKey (cls.userinfo, var->name, value, MAX_INFO_STRING);
if (cls.state >= ca_connected)
{
#ifdef Q2CLIENT #ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2 || cls.protocol == CP_QUAKE3) //q2 just resends the lot. Kinda bad... if (cls.protocol == CP_QUAKE2 || cls.protocol == CP_QUAKE3) //q2 just resends the lot. Kinda bad...
{ {
cls.resendinfo = true; cls.resendinfo = true;
} }
else else
#endif #endif
{ {
CL_SendClientCommand(true, "setinfo \"%s\" \"%s\"\n", var->name, value); CL_SendClientCommand(true, "setinfo \"%s\" \"%s\"\n", var->name, value);
}
} }
} }
} }