Merge branch 'master' into tgui-alerts-and-what-not

This commit is contained in:
SandPoot
2021-10-11 20:41:56 -03:00
committed by GitHub
25 changed files with 121 additions and 70 deletions
@@ -1,6 +1,12 @@
/datum/config_entry/flag/panic_bunker // prevents people the server hasn't seen before from connecting
/datum/config_entry/number/panic_bunker_living // living time in minutes that a player needs to pass the panic bunker
/datum/config_entry/number/panic_bunker_living // living time in minutes that a player needs to pass the panic bunker. they pass **if they are above this amount**
config_entry_value = 0 // default: <= 0 meaning any playtime works. -1 to disable criteria.
integer = TRUE
/datum/config_entry/number/panic_bunker_living_vpn
config_entry_value = 0 // default: <= 0 meaning anytime works. -1 to disable criteria.
integer = TRUE
/datum/config_entry/string/panic_bunker_message
config_entry_value = "Sorry but the server is currently not accepting connections from never before seen players."
+4 -4
View File
@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(fail2topic)
while(i <= length(rate_limiting))
var/ip = rate_limiting[i]
var/last_attempt = rate_limiting[ip]
if(world.time - last_attempt > rate_limit)
if(REALTIMEOFDAY - last_attempt > rate_limit)
rate_limiting -= ip
fail_counts -= ip
else //if we remove that, and the next element is in its place. check that instead of incrementing.
@@ -58,12 +58,12 @@ SUBSYSTEM_DEF(fail2topic)
if (active_bans[ip])
return TRUE
rate_limiting[ip] = world.time
rate_limiting[ip] = REALTIMEOFDAY
if (isnull(last_attempt))
return FALSE
if (world.time - last_attempt > rate_limit)
if (REALTIMEOFDAY - last_attempt > rate_limit)
fail_counts -= ip
return FALSE
else
@@ -83,7 +83,7 @@ SUBSYSTEM_DEF(fail2topic)
if (!enabled)
return
active_bans[ip] = world.time
active_bans[ip] = REALTIMEOFDAY
fail_counts -= ip
rate_limiting -= ip