From 6d6bc5fcbcf4ca523847249fbfcad95e0c4d1e53 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sun, 4 Mar 2018 22:41:44 -0800 Subject: [PATCH] Halves server file access cooldowns (#36139) * Lets me actually browse logs properly * admins get to spam harder --- code/__HELPERS/files.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index f515668dfb8..7f0b5a3c071 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -35,6 +35,7 @@ return path #define FTPDELAY 200 //200 tick delay to discourage spam +#define ADMIN_FTPDELAY_MODIFIER 0.5 //Admins get to spam files faster since we ~trust~ them! /* This proc is a failsafe to prevent spamming of file requests. It is just a timer that only permits a download every [FTPDELAY] ticks. This can be changed by modifying FTPDELAY's value above. @@ -45,9 +46,13 @@ if(time_to_wait > 0) to_chat(src, "Error: file_spam_check(): Spam. Please wait [DisplayTimeText(time_to_wait)].") return 1 - GLOB.fileaccess_timer = world.time + FTPDELAY + var/delay = FTPDELAY + if(holder) + delay *= ADMIN_FTPDELAY_MODIFIER + GLOB.fileaccess_timer = world.time + delay return 0 #undef FTPDELAY +#undef ADMIN_FTPDELAY_MODIFIER /proc/pathwalk(path) var/list/jobs = list(path)