From 2695a4f54fae82e0cae791dfe5bb2c362947c6cd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 4 Sep 2020 01:11:19 +0200 Subject: [PATCH] [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 --- code/modules/client/client_procs.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 923882a4f14..01651974701 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -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, "Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT_ADMIN/1024]KiB.") + return FALSE + else if(filelength > UPLOAD_LIMIT) to_chat(src, "Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.") return FALSE return TRUE