mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
SSD Auto-kick/free job script
This commit is contained in:
@@ -434,6 +434,8 @@ proc/display_roundstart_logout_report()
|
||||
if(L.stat)
|
||||
if(L.suiciding) //Suicider
|
||||
msg += "<b>[L.name]</b> ([L.ckey]), the [L.job] (<font color='red'><b>Suicide</b></font>)\n"
|
||||
job_master.FreeRole(L.job)
|
||||
message_admins("<b>[L.name]</b> ([L.ckey]), the [L.job] has been freed due to (<font color='#ffcc00'><b>Early Round Suicide</b></font>)\n")
|
||||
continue //Disconnected client
|
||||
if(L.stat == UNCONSCIOUS)
|
||||
msg += "<b>[L.name]</b> ([L.ckey]), the [L.job] (Dying)\n"
|
||||
@@ -458,6 +460,8 @@ proc/display_roundstart_logout_report()
|
||||
continue //Lolwhat
|
||||
else
|
||||
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (<font color='red'><b>Ghosted</b></font>)\n"
|
||||
job_master.FreeRole(L.job)
|
||||
message_admins("<b>[L.name]</b> ([L.ckey]), the [L.job] has been freed due to (<font color='#ffcc00'><b>Early Round Ghosted While Alive</b></font>)\n")
|
||||
continue //Ghosted while alive
|
||||
|
||||
|
||||
|
||||
@@ -183,6 +183,31 @@
|
||||
del(C)
|
||||
#undef INACTIVITY_KICK
|
||||
|
||||
#define DISCONNECTED_DELETE 3000 //5 minutes in ticks (approx)
|
||||
/world/proc/KickDisconnectedClients()
|
||||
spawn(-1)
|
||||
set background = 1
|
||||
while(1)
|
||||
sleep(DISCONNECTED_DELETE)
|
||||
for(var/mob/living/L in mob_list)
|
||||
if(iscarbon(L) && !ismonkey(L) && !isslime(L))
|
||||
var/mob/living/carbon/C = L
|
||||
if(!C.client && C.stat != DEAD && C.brain_op_stage!=4.0)
|
||||
sleep(600)
|
||||
if(!C.client && C.stat != DEAD && C.brain_op_stage!=4.0)
|
||||
job_master.FreeRole(C.job)
|
||||
message_admins("<b>[C.name]</b> ([C.ckey]), the [C.job] has been freed due to (<font color='#ffcc00'><b>Client disconnect for 5 minutes</b></font>)\n")
|
||||
for(var/obj/item/W in C)
|
||||
C.drop_from_inventory(W)
|
||||
del(C)
|
||||
else if(!C.key && C.stat != DEAD && C.brain_op_stage!=4.0)
|
||||
job_master.FreeRole(C.job)
|
||||
message_admins("<b>[C.name]</b> ([C.ckey]), the [C.job] has been freed due to (<font color='#ffcc00'><b>Client quit BYOND</b></font>)\n")
|
||||
for(var/obj/item/W in C)
|
||||
C.drop_from_inventory(W)
|
||||
del(C)
|
||||
#undef DISCONNECTED_DELETE
|
||||
|
||||
|
||||
/world/proc/load_mode()
|
||||
var/list/Lines = file2list("data/mode.txt")
|
||||
|
||||
Reference in New Issue
Block a user