From f099ce3e58ea9f826f4f65f65c006c0063f98f61 Mon Sep 17 00:00:00 2001 From: Molgrum Date: Mon, 10 Sep 2007 22:12:13 +0000 Subject: [PATCH] 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 --- engine/common/cvar.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/engine/common/cvar.c b/engine/common/cvar.c index 912e7046a..639af8db1 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -674,18 +674,22 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force) #ifndef SERVERONLY if (var->flags & CVAR_USERINFO) { - Info_SetValueForKey (cls.userinfo, var->name, value, MAX_INFO_STRING); - if (cls.state >= ca_connected) - { + char *old = Info_ValueForKey(cls.userinfo, var->name); + 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 - if (cls.protocol == CP_QUAKE2 || cls.protocol == CP_QUAKE3) //q2 just resends the lot. Kinda bad... - { - cls.resendinfo = true; - } - else + if (cls.protocol == CP_QUAKE2 || cls.protocol == CP_QUAKE3) //q2 just resends the lot. Kinda bad... + { + cls.resendinfo = true; + } + else #endif - { - CL_SendClientCommand(true, "setinfo \"%s\" \"%s\"\n", var->name, value); + { + CL_SendClientCommand(true, "setinfo \"%s\" \"%s\"\n", var->name, value); + } } } }