From e3a7dfba0184b44f3b9e38ce8cb9cfa91fb83722 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 20 Aug 2019 00:07:08 +0200 Subject: [PATCH] Stop server from requesting cvar values to the client on connection as it's no longer necessary --- qcsrc/client/view.qc | 1 - qcsrc/common/state.qc | 2 -- qcsrc/server/command/cmd.qc | 2 +- qcsrc/server/miscfunctions.qc | 3 +++ qcsrc/server/mutators/events.qh | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ac4d13a6e..203fbcc76 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 2a1168eae..24c0b7c6f 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 1395986b9..911012a85 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 522840e76..854e39781 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 cd09b1def..1ca629078 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) \ -- 2.39.2