From: terencehill Date: Mon, 19 Aug 2019 22:07:08 +0000 (+0200) Subject: Stop server from requesting cvar values to the client on connection as it's no longer... X-Git-Tag: xonotic-v0.8.5~1371^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=e3a7dfba0184b44f3b9e38ce8cb9cfa91fb83722 Stop server from requesting cvar values to the client on connection as it's no longer necessary --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ac4d13a6e9..203fbcc76c 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1565,7 +1565,6 @@ void CSQC_UpdateView(entity this, float w, float h) // TODO maybe don't send cvar values until the menu is open // TODO remove CheckSendCvars from menu code (it seems broken anyway) // TODO remove references to sendcvar from cvar descriptions - // TODO stop server from requesting cvar values to the client on connection as it's no longer necessary ReplicateVars(false); if (ReplicateVars_NOT_SENDING()) diff --git a/qcsrc/common/state.qc b/qcsrc/common/state.qc index 2a1168eae0..24c0b7c6f4 100644 --- a/qcsrc/common/state.qc +++ b/qcsrc/common/state.qc @@ -38,8 +38,6 @@ void ClientState_attach(entity this) { this._cs = NEW(ClientState, this); - GetCvars(this, CS(this), 0); // get other cvars from player - // TODO: fold all of these into ClientState DecodeLevelParms(this); diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 1395986b97..911012a856 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -328,7 +328,7 @@ void ClientCommand_physics(entity caller, int request, int argc) if (Physics_Valid(command) || command == "default") { - stuffcmd(caller, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n")); + stuffcmd(caller, strcat("\nseta cl_physics ", command, "\n")); sprint(caller, strcat("^2Physics set successfully changed to ^3", command, "\n")); return; } diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 522840e763..854e39781f 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -429,6 +429,9 @@ void GetCvars(entity this, entity store, int f) { string s = string_null; + if (f == 0) + LOG_INFO("Warning: requesting cvar values is deprecated. Client should send them automatically using REPLICATE.\n"); + if (f > 0) s = strcat1(argv(f)); diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index cd09b1defd..1ca629078e 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -306,6 +306,7 @@ MUTATOR_HOOKABLE(PlayerPreThink, EV_PlayerPreThink); MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys); /** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */ +// NOTE: requesting cvar values (get_cvars_f 0) is deprecated #define EV_GetCvars(i, o) \ /**/ i(float, get_cvars_f) \ /**/ i(string, get_cvars_s) \