X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=host.c;h=268c1467ee2ba715baa6e62c900da2ec411b353b;hb=0b5e8b49f3ed65b746481dc175d67daf0c48a830;hp=72b588eb39e3dc1e4d48c5930e3edc9a70ee2574;hpb=3d84db99ed9d8234809d237512f44cfa6d7ce1a0;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index 72b588eb..268c1467 100644 --- a/host.c +++ b/host.c @@ -23,12 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "libcurl.h" -#include "cdaudio.h" -#include "cl_video.h" -#include "progsvm.h" -#include "csprogs.h" -#include "sv_demo.h" -#include "snd_main.h" #include "taskqueue.h" #include "utf8lib.h" @@ -173,6 +167,21 @@ static void Host_Framerate_c(cvar_t *var) Cvar_SetValueQuick(var, 0); } +// TODO: Find a better home for this. +static void SendCvar_f(cmd_state_t *cmd) +{ + if(cmd->source == src_local && host.hook.SV_SendCvar) + { + host.hook.SV_SendCvar(cmd); + return; + } + if(cmd->source == src_client && host.hook.CL_SendCvar) + { + host.hook.CL_SendCvar(cmd); + return; + } +} + /* ======================= Host_InitLocal @@ -188,6 +197,7 @@ static void Host_InitLocal (void) Cmd_AddCommand(CF_SHARED, "version", Host_Version_f, "print engine version"); Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)"); Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs"); + Cmd_AddCommand(CF_SHARED, "sendcvar", SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC"); Cvar_RegisterVariable (&cl_maxphysicsframesperserverframe); Cvar_RegisterVariable (&host_framerate); Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);