Afk fixup (#412)
This commit is contained in:
committed by
TalkingCactus
parent
f510bf2a03
commit
2373e2e485
@@ -66,7 +66,9 @@
|
||||
var/respawn = 1
|
||||
var/guest_jobban = 1
|
||||
var/usewhitelist = 0
|
||||
var/kick_inactive = 0 //force disconnect for inactive players
|
||||
var/inactivity_period = 3000 //time in ds until a player is considered inactive
|
||||
var/afk_period = 6000 //time in ds until a player is considered afk and kickable
|
||||
var/kick_inactive = FALSE //force disconnect for inactive players
|
||||
var/load_jobs_from_txt = 0
|
||||
var/automute_on = 0 //enables automuting/spam prevention
|
||||
var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on.
|
||||
@@ -408,10 +410,12 @@
|
||||
usewhitelist = TRUE
|
||||
if("allow_metadata")
|
||||
allow_Metadata = 1
|
||||
if("inactivity_period")
|
||||
inactivity_period = text2num(value) * 10 //documented as seconds in config.txt
|
||||
if("afk_period")
|
||||
afk_period = text2num(value) * 10 // ^^^
|
||||
if("kick_inactive")
|
||||
if(value < 1)
|
||||
value = INACTIVITY_KICK
|
||||
kick_inactive = value
|
||||
kick_inactive = TRUE
|
||||
if("load_jobs_from_txt")
|
||||
load_jobs_from_txt = 1
|
||||
if("forbid_singulo_possession")
|
||||
|
||||
@@ -10,12 +10,13 @@ SUBSYSTEM_DEF(server_maint)
|
||||
|
||||
/datum/controller/subsystem/server_maint/fire()
|
||||
//handle kicking inactive players
|
||||
if(config.kick_inactive > 0)
|
||||
if(config.kick_inactive)
|
||||
for(var/client/C in GLOB.clients)
|
||||
if(C.is_afk(INACTIVITY_KICK))
|
||||
if(!istype(C.mob, /mob/dead))
|
||||
if(C.is_afk(config.afk_period))
|
||||
var/cmob = C.mob
|
||||
if(!(istype(cmob, /mob/dead/observer) || (istype(cmob, /mob/dead) && C.holder)))
|
||||
log_access("AFK: [key_name(C)]")
|
||||
to_chat(C, "<span class='danger'>You have been inactive for more than 10 minutes and have been disconnected.</span>")
|
||||
to_chat(C, "<span class='danger'>You have been inactive for more than [config.afk_period / 600] minutes and have been disconnected.</span>")
|
||||
qdel(C)
|
||||
|
||||
if(config.sql_enabled)
|
||||
|
||||
Reference in New Issue
Block a user