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
+3
View File
@@ -187,3 +187,6 @@
var/list/block_parry_hinted = list()
/// moused over objects, currently capped at 7. this is awful, and should be replaced with a component to track it using signals for parrying at some point.
var/list/moused_over_objects = list()
/// AFK tracking
var/last_activity = 0
+7 -1
View File
@@ -83,6 +83,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
return
last_activity = world.time
//Logs all hrefs
log_href("[src] (usr:[usr]\[[COORD(usr)]\]) : [hsrc ? "[hsrc] " : ""][href]")
@@ -222,6 +224,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
///////////
/client/New(TopicData)
last_activity = world.time
world.SetConfig("APP/admin", ckey, "role=admin")
var/tdata = TopicData //save this for later use
TopicData = null //Prevent calls to client.Topic from connect
@@ -578,9 +581,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
//If we aren't an admin, and the flag is set
if(CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey] && !(ckey in GLOB.bunker_passthrough))
var/living_recs = CONFIG_GET(number/panic_bunker_living)
var/vpn_living_recs = CONFIG_GET(number/panic_bunker_living_vpn)
//Relies on pref existing, but this proc is only called after that occurs, so we're fine.
var/minutes = get_exp_living(pure_numeric = TRUE)
if(minutes <= living_recs) // && !CONFIG_GET(flag/panic_bunker_interview)
if((minutes <= living_recs) || (IsVPN() && (minutes < vpn_living_recs)))
var/reject_message = "Failed Login: [key] - Account attempting to connect during panic bunker, but they do not have the required living time [minutes]/[living_recs]"
log_access(reject_message)
message_admins("<span class='adminnotice'>[reject_message]</span>")
@@ -850,6 +854,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
/client/Click(atom/object, atom/location, control, params, ignore_spam = FALSE, extra_info)
if(last_click > world.time - world.tick_lag)
return
last_activity = world.time
last_click = world.time
var/ab = FALSE
var/list/L = params2list(params)
@@ -922,6 +927,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
//checks if a client is afk
//3000 frames = 5 minutes
/client/proc/is_afk(duration = CONFIG_GET(number/inactivity_period))
var/inactivity = world.time - last_activity
if(inactivity > duration)
return inactivity
return FALSE
+3
View File
@@ -0,0 +1,3 @@
/client/proc/IsVPN()
var/datum/ipintel/res = get_ip_intel(address)
return res.intel >= CONFIG_GET(number/ipintel_rating_bad)
+1 -1
View File
@@ -15,6 +15,6 @@
var/indelay = stripped_input(usr, "Enter the tooltip delay in milliseconds (default: 500)", "Enter tooltip delay", "", 10)
indelay = text2num(indelay)
if(usr)//is this what you mean?
prefs.tip_delay = indelay
prefs.tip_delay = max(indelay, 0.01)
prefs.save_preferences()
to_chat(usr, "<span class='danger'>Tooltip delay set to [indelay] milliseconds.</span>")