Stop server from requesting cvar values to the client on connection as it's no longer...
authorterencehill <piuntn@gmail.com>
Mon, 19 Aug 2019 22:07:08 +0000 (00:07 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 19 Aug 2019 22:07:08 +0000 (00:07 +0200)
qcsrc/client/view.qc
qcsrc/common/state.qc
qcsrc/server/command/cmd.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh

index ac4d13a..203fbcc 100644 (file)
@@ -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())
index 2a1168e..24c0b7c 100644 (file)
@@ -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);
index 1395986..911012a 100644 (file)
@@ -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;
                        }
index 522840e..854e397 100644 (file)
@@ -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));
 
index cd09b1d..1ca6290 100644 (file)
@@ -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) \