file limits

because we don't need even more lag
This commit is contained in:
BongaTheProto
2022-06-30 17:23:03 -05:00
parent 1b404f973a
commit 63e9e61921
3 changed files with 23 additions and 5 deletions

View File

@@ -225,11 +225,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(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>")
if(filelength > CONFIG_GET(number/upload_limit_admin))
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [CONFIG_GET(number/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>")
else if(filelength > CONFIG_GET(number/upload_limit))
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [CONFIG_GET(number/upload_limit)/1024]KiB.</font>")
return FALSE
return TRUE
@@ -933,7 +933,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
add_verb(src, /client/proc/self_playtime)
#undef UPLOAD_LIMIT
//#undef UPLOAD_LIMIT //SPLURT EDIT
//checks if a client is afk
//3000 frames = 5 minutes

View File

@@ -2,3 +2,11 @@
## Minimum amount of votes the Continue option needs over Transfer in order for it to win ##
## Defaults to 1 ##
#MIN_CONTINUE_VOTES 1
# User upload limit #
## Max size player uploads can have. Default is 0.5 MB
#@UPLOAD_LIMIT 524288
# Admin upload limit #
## Max size admin uploads can have. Default is 5.0 MB
#@UPLOAD_LIMIT_ADMIN 5242880

View File

@@ -1,3 +1,13 @@
/datum/config_entry/number/min_continue_votes
config_entry_value = 1
min_val = 1
/datum/config_entry/number/upload_limit
protection = CONFIG_ENTRY_LOCKED
integer = FALSE
config_entry_value = UPLOAD_LIMIT
/datum/config_entry/number/upload_limit_admin
protection = CONFIG_ENTRY_LOCKED
integer = FALSE
config_entry_value = UPLOAD_LIMIT_ADMIN