Skip to content

Commit

Permalink
Add cl_allow_uploads
Browse files Browse the repository at this point in the history
With cl_allow_uploads, you can toggle whether the server is allowed to
upload files from your quake directory to the server.
  • Loading branch information
osm committed Dec 31, 2024
1 parent 41852d4 commit c04f608
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions help_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,21 @@
"group-id": "9",
"type": "string"
},
"cl_allow_uploads": {
"default": "0",
"group-id": "9",
"type": "boolean",
"values": [
{
"description": "Don't allow uploads.",
"name": "0"
},
{
"description": "Allow uploads.",
"name": "1"
}
]
},
"cl_anglespeedkey": {
"default": "1.5",
"desc": "This variable sets multiplier by which your \"cl_yawspeed\" (how fast you turn) is multiplied when running (+speed).",
Expand Down
6 changes: 6 additions & 0 deletions src/cl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,13 @@ void CL_StartFileUpload (void)
{
char *name;
int i;
extern cvar_t cl_allow_uploads;

if (!cl_allow_uploads.integer)
{
Com_Printf ("This command has been disabled for security reasons. Set cl_allow_uploads to 1 if you want to enable uploads.\n");
return;
}

if (cls.state < ca_onserver)
{
Expand Down
2 changes: 2 additions & 0 deletions src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ cvar_t cl_remote_capabilities = {"cl_remote_capabilities", REMOTE_CAPABILITIES,
hashtable_t *rc_hash;

cvar_t cl_allow_downloads = {"cl_allow_downloads", "bsp,lmp,loc,mdl,mvd,pcx,spr,wad,wav"};
cvar_t cl_allow_uploads = {"cl_allow_uploads", "0"};

cbuf_t cbuf_main;
cbuf_t cbuf_svc;
Expand Down Expand Up @@ -2496,6 +2497,7 @@ void Cmd_Init (void)
Cvar_Register(&cl_warnexec);
Cvar_Register(&cl_remote_capabilities);
Cvar_Register(&cl_allow_downloads);
Cvar_Register(&cl_allow_uploads);

Cmd_AddCommand ("macrolist", Cmd_MacroList_f);
qsort(msgtrigger_commands,
Expand Down

0 comments on commit c04f608

Please sign in to comment.