From: havoc Date: Wed, 11 Jan 2006 14:41:42 +0000 (+0000) Subject: added sendcvar patch from [515] X-Git-Tag: xonotic-v0.1.0preview~4397 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c0f6b7906efa6a11c0a771e3a5c5548684fbdcf0;p=xonotic%2Fdarkplaces.git added sendcvar patch from [515] git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5896 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index be312bf8..e0fbfe06 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -1872,6 +1872,35 @@ void Host_Stopdemo_f (void) Host_ShutdownServer (false); } +void Host_SendCvar_f (void) +{ + int i; + cvar_t *c; + client_t *old; + + if(Cmd_Argc() != 2) + return; + if(!(c = Cvar_FindVar(Cmd_Argv(1)))) + return; + if (cls.state != ca_dedicated) + Cmd_ForwardStringToServer(va("sentcvar %s %s\n", c->name, c->string)); + if(!sv.active)// || !SV_ParseClientCommandQC) + return; + + old = host_client; + if (cls.state != ca_dedicated) + i = 1; + else + i = 0; + for(;iname)); + } + host_client = old; +} + static void MaxPlayers_f(void) { int n; @@ -1977,6 +2006,8 @@ void Host_InitCommands (void) Cmd_AddCommand ("begin", Host_Begin_f); Cmd_AddCommand ("maxplayers", MaxPlayers_f); + Cmd_AddCommand ("sendcvar", Host_SendCvar_f); // By [515] + Cvar_RegisterVariable(&sv_cheats); }