Improve admin idlekick capability/awareness

This commit is contained in:
Arokha Sieyes
2018-02-04 01:00:25 -05:00
parent 6f8d35a2b3
commit 13bfcf6bd3
5 changed files with 101 additions and 7 deletions

View File

@@ -7,8 +7,30 @@
for(last_object in clients)
var/client/C = last_object
if(C.is_afk(config.kick_inactive MINUTES))
if(!istype(C.mob, /mob/observer/dead))
log_access("AFK: [key_name(C)]")
C << "<SPAN CLASS='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</SPAN>"
del(C) // Don't qdel, cannot override finalize_qdel behaviour for clients.
if(!istype(C.mob, /mob/observer/dead) && !istype(C.mob, /mob/new_player))
to_chat(C,"<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
var/information
if(ishuman(C.mob))
var/job
var/mob/living/carbon/human/H = C.mob
var/datum/data/record/R = find_general_record("name", H.real_name)
if(R)
job = R.fields["real_rank"]
if(!job && H.mind)
job = H.mind.assigned_role
if(!job && H.job)
job = H.job
if(job)
information = " while [job]."
else if(issilicon(C.mob))
information = " while a silicon."
var/adminlinks
adminlinks = " (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[C.mob.x];Y=[C.mob.y];Z=[C.mob.z]'>JMP</a>|<A HREF='?_src_=holder;cryoplayer=\ref[C.mob]'>CRYO</a>)"
log_and_message_admins("being kicked for AFK[information][adminlinks]", C.mob)
qdel(C)
SCHECK