Tweak file upload limits (#53371)

halfed it for players, more than doubled it for admins. (mainly for map 
templates, admins playing 2mb sound files using this will be punted 
into the cafeteria)

Could use with being more refined, per-extention, maybe have sound have 
a seperate check since thats a function of size*players, and the rest 
of this is not.
This commit is contained in:
Kyle Spier-Swenson
2020-09-02 17:49:40 -07:00
committed by GitHub
parent 5b9b4c759d
commit f0b02b1abd
+7 -2
View File
@@ -1,7 +1,8 @@
////////////
//SECURITY//
////////////
#define UPLOAD_LIMIT 1048576 //Restricts client uploads to the server to 1MB //Could probably do with being lower.
#define UPLOAD_LIMIT 524288 //Restricts client uploads to the server to 0.5MB
#define UPLOAD_LIMIT_ADMIN 2621440 //Restricts admin client uploads to the server to 2.5MB
GLOBAL_LIST_INIT(blacklisted_builds, list(
"1407" = "bug preventing client display overrides from working leads to clients being able to see things/mobs they shouldn't be able to see",
@@ -180,7 +181,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
/client/AllowUpload(filename, filelength)
if(filelength > UPLOAD_LIMIT)
if (holder)
if(filelength > UPLOAD_LIMIT_ADMIN)
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT_ADMIN/1024]KiB.</font>")
return FALSE
else if(filelength > UPLOAD_LIMIT)
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>")
return FALSE
return TRUE