alias hud "qc_cmd_cl hud ${* ?}" // Commands regarding/controlling the HUD system
alias localprint "qc_cmd_cl localprint ${* ?}" // Create your own centerprint sent to yourself
//alias mv_download "qc_cmd_cl mv_download ${* ?}" // Retrieve mapshot picture from the server
-alias sendcvar "qc_cmd_cl sendcvar ${* ?}" // Send a cvar to the server (like weaponpriority)
+alias sendcvar "qc_cmd_cl sendcvar ${* ?}" // Send a cvar to the server (like cl_weaponpriority)
alias weapon_find "qc_cmd_cl weapon_find ${* ?}" // Show spawn locations of a weapon
alias exit "quit"
alias scoreboard_columns_help "qc_cmd_cl hud scoreboard_columns_help"
alias scoreboard_columns_set "qc_cmd_cl hud scoreboard_columns_set ${* ?}"
-// changes a cvar and reports it to the server (for the client to notify the server about changes)
-alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
-
// ========================================================
// cmd (client-to-server command) - server/command/cmd.qc
case CMD_REQUEST_USAGE:
{
LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
- LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.");
+ LOG_INFO(" Where 'cvar' is the cvar to send to the server.");
return;
}
}
CLIENT_COMMAND(hud, "Commands regarding/controlling the HUD system") { LocalCommand_hud(request, arguments); }
CLIENT_COMMAND(localprint, "Create your own centerprint sent to yourself") { LocalCommand_localprint(request, arguments); }
CLIENT_COMMAND(mv_download, "Retrieve mapshot picture from the server") { LocalCommand_mv_download(request, arguments); }
-CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
+CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like cl_weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
void LocalCommand_macro_help()
{
REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
-.int cvar_value;
-void ReplicateVars(bool would_destroy)
-{
- if (!would_destroy)
- FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
- string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
- // NOTE: REPLICATE_SIMPLE can return;
- REPLICATE_SIMPLE(it.cvar_value, cvarname);
- });
-}
-
float bgmtime;
string weaponorder_byimpulse;
lasthud = hud;
- // 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
-
ReplicateVars(false);
if (ReplicateVars_NOT_SENDING())
ReplicateVars_DELAY(0.8 + random() * 0.4); // no need to check cvars every frame
LOG_SEVERE("Notification initialization failed! Read above and fix the errors!");
}
+#ifdef CSQC
+.int cvar_value;
+void ReplicateVars(bool would_destroy)
+{
+ if (!would_destroy)
+ FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
+ string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
+ // NOTE: REPLICATE_SIMPLE can return;
+ REPLICATE_SIMPLE(it.cvar_value, cvarname);
+ });
+}
+#endif
+
#include "all.inc"
#define REPLICATE_7(fld, type, var, func, check, update, destroy) \
void ReplicateVars(bool would_destroy) \
{ \
- if (would_destroy > 0) { destroy } \
+ if (would_destroy) { destroy } \
else if (ReplicateVars_NOT_SENDING() && check) \
{ \
localcmd(strcat("cl_cmd sendcvar ", var, "\n")); \
// if you want to reset your client to defaults, it's probably a better idea to delete (parts of) config.cfg and restart
-// changes a cvar and reports it to the server (for the menu to notify the
-// server about changes)
+// changes a cvar and reports it to the server (for the client to notify the server about changes)
+// DEPRECATED, cvars can be set in the client code to be sent automatically (using REPLICATE)
alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
seta cl_firststart "" "how many times the client has been run"
alias _gl_flashblend_update_11 "gl_flashblend 0"
alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_showsurfaces"
-set cl_handicap 1 "multiplies damage received and divides damage dealt NOTE: reconnect or use 'sendcvar cl_handicap' to update the choice."
+set cl_handicap 1 "multiplies damage received and divides damage dealt"
-seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice."
+seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such"
seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway."