[MIRROR] fucks with upload limit (#628)

* 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.

* fucks with upload limit

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
This commit is contained in:
SkyratBot
2020-09-04 00:11:19 +01:00
committed by GitHub
co-authored by Kyle Spier-Swenson
parent 0d82d82c9c
commit 2695a4f54f
+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