mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
SQL definitions added. Small fixes
This commit is contained in:
@@ -15,36 +15,39 @@ SUBSYSTEM_DEF(afk)
|
||||
/datum/controller/subsystem/afk/fire()
|
||||
var/list/toRemove = list()
|
||||
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
|
||||
if(H.client == null || !H.client.prefs.afk_watch || !H.mind) // Only players and players with the AFK watch enabled
|
||||
if(!H.ckey) // Useless non ckey creatures
|
||||
continue
|
||||
|
||||
var/turf/T = get_turf(H)
|
||||
|
||||
if(H.stat || H.restrained() || !H.job || !is_station_level(T.z) || H.mind.special_role) // No dead, unconcious, restrained, people without jobs, people on other Z levels than the station or antags
|
||||
if(afk_players[H.client])
|
||||
toRemove += H.client
|
||||
var/turf/T
|
||||
// Only players and players with the AFK watch enabled
|
||||
// No dead, unconcious, restrained, people without jobs, people on other Z levels than the station or antags
|
||||
if(H.client == null || !H.client.prefs.afk_watch || !H.mind || \
|
||||
H.stat || H.restrained() || !H.job || H.mind.special_role || \
|
||||
!is_station_level((T = get_turf(H)).z)) // Assign the turf as last. Small optimization
|
||||
if(afk_players[H.ckey])
|
||||
toRemove += H.ckey
|
||||
continue
|
||||
|
||||
var/mins_afk = round(H.client.inactivity / 600)
|
||||
if(mins_afk < config.warn_afk_minimum)
|
||||
if(afk_players[H.client])
|
||||
toRemove += H.client
|
||||
if(afk_players[H.ckey])
|
||||
toRemove += H.ckey
|
||||
continue
|
||||
|
||||
if(!afk_players[H.client])
|
||||
afk_players[H.client] = AFK_WARNED
|
||||
if(!afk_players[H.ckey])
|
||||
afk_players[H.ckey] = AFK_WARNED
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes. You will be cryod after [config.auto_cryo_afk] total minutes and fully despawned after [config.auto_despawn_afk] total minutes. Please move or click in game if you want to avoid being despawned.</span>")
|
||||
else
|
||||
var/area/A = T.loc // Turfs loc is the area
|
||||
if(afk_players[H.client] == AFK_WARNED)
|
||||
if(afk_players[H.ckey] == AFK_WARNED)
|
||||
if(mins_afk >= config.auto_cryo_afk && A.can_get_auto_cryod)
|
||||
if(A.fast_despawn)
|
||||
toRemove += H.client
|
||||
toRemove += H.ckey
|
||||
warn(H, "<span class='danger'>You are have been despawned after being AFK for [mins_afk] minutes. You have been despawned instantly due to you being in a secure area.</span>")
|
||||
msg_admins(H, mins_afk, T, "forcefully despawned", "AFK in a fast despawn area")
|
||||
force_cryo_human(H)
|
||||
else if(cryo_ssd(H))
|
||||
afk_players[H.client] = AFK_CRYOD
|
||||
afk_players[H.ckey] = AFK_CRYOD
|
||||
msg_admins(H, mins_afk, T, "put into cryostorage")
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes and have been moved to cryostorage. After being AFK for [config.auto_despawn_afk] total minutes you will be fully despawned. Please eject yourself (right click, eject) out of the cryostorage if you want to avoid being despawned.</span>")
|
||||
|
||||
@@ -52,7 +55,7 @@ SUBSYSTEM_DEF(afk)
|
||||
var/obj/machinery/cryopod/P = H.loc
|
||||
msg_admins(H, mins_afk, T, "forcefully despawned")
|
||||
warn(H, "<span class='danger'>You are have been despawned after being AFK for [mins_afk] minutes.</span>")
|
||||
toRemove += H.client
|
||||
toRemove += H.ckey
|
||||
P.despawn_occupant()
|
||||
|
||||
removeFromWatchList(toRemove)
|
||||
|
||||
Reference in New Issue
Block a user