mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #4538 from VOREStation/upstream-merge-5726
[MIRROR] Refactors Sun and Inactivity processes to subsystems, and a few globa lvariables to be managed
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
/datum/controller/process/sun/setup()
|
||||
name = "sun"
|
||||
schedule_interval = 20 // every second
|
||||
sun = new
|
||||
|
||||
/datum/controller/process/sun/doWork()
|
||||
sun.calc_position()
|
||||
@@ -1,11 +1,12 @@
|
||||
/datum/controller/process/inactivity/setup()
|
||||
name = "inactivity"
|
||||
schedule_interval = 600 // Once every minute (approx.)
|
||||
SUBSYSTEM_DEF(inactivity)
|
||||
name = "AFK Kick"
|
||||
wait = 600
|
||||
flags = SS_BACKGROUND | SS_NO_TICK_CHECK
|
||||
|
||||
/datum/controller/process/inactivity/doWork()
|
||||
/datum/controller/subsystem/inactivity/fire()
|
||||
if(config.kick_inactive)
|
||||
for(last_object in clients)
|
||||
var/client/C = last_object
|
||||
for(var/i in clients)
|
||||
var/client/C = i
|
||||
if(C.is_afk(config.kick_inactive MINUTES) && !C.holder) // VOREStation Edit - Allow admins to idle
|
||||
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
|
||||
@@ -33,4 +34,3 @@
|
||||
log_and_message_admins("being kicked for AFK[information][adminlinks]", C.mob)
|
||||
|
||||
qdel(C)
|
||||
SCHECK
|
||||
7
code/controllers/subsystems/sun.dm
Normal file
7
code/controllers/subsystems/sun.dm
Normal file
@@ -0,0 +1,7 @@
|
||||
SUBSYSTEM_DEF(sun)
|
||||
name = "Sun"
|
||||
wait = 600
|
||||
var/static/datum/sun/sun = new
|
||||
|
||||
/datum/controller/subsystem/sun/fire()
|
||||
sun.calc_position()
|
||||
@@ -85,9 +85,6 @@
|
||||
if("Jobs")
|
||||
debug_variables(job_master)
|
||||
feedback_add_details("admin_verb","DJobs")
|
||||
if("Sun")
|
||||
debug_variables(sun)
|
||||
feedback_add_details("admin_verb","DSun")
|
||||
if("Radio")
|
||||
debug_variables(radio_controller)
|
||||
feedback_add_details("admin_verb","DRadio")
|
||||
|
||||
Reference in New Issue
Block a user