mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
[READY]Sends the names of online admins when sending IRC alerts about no admins active. (#23712)
* Update adminhelp.dm * Update world.dm * Update ticker.dm * should work.
This commit is contained in:
@@ -210,7 +210,8 @@ var/datum/subsystem/ticker/ticker
|
||||
qdel(S)
|
||||
|
||||
var/list/adm = get_admin_counts()
|
||||
if(!adm["present"])
|
||||
var/list/allmins = adm["present"]
|
||||
if(!allmins.len)
|
||||
send2irc("Server", "Round just started with no active admins online!")
|
||||
|
||||
/datum/subsystem/ticker/proc/station_explosion_detonation(atom/bomb)
|
||||
@@ -327,7 +328,7 @@ var/datum/subsystem/ticker/ticker
|
||||
bombloc = bomb.z
|
||||
else if(!station_missed)
|
||||
bombloc = ZLEVEL_STATION
|
||||
|
||||
|
||||
if(mode)
|
||||
mode.explosion_in_progress = 0
|
||||
world << "<B>The station was destoyed by the nuclear blast!</B>"
|
||||
|
||||
@@ -131,27 +131,32 @@
|
||||
return
|
||||
|
||||
/proc/get_admin_counts(requiredflags = R_BAN)
|
||||
. = list("total" = 0, "noflags" = 0, "afk" = 0, "stealth" = 0, "present" = 0)
|
||||
. = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list())
|
||||
for(var/client/X in admins)
|
||||
.["total"]++
|
||||
.["total"] += X
|
||||
if(requiredflags != 0 && !check_rights_for(X, requiredflags))
|
||||
.["noflags"]++
|
||||
.["noflags"] += X
|
||||
else if(X.is_afk())
|
||||
.["afk"]++
|
||||
.["afk"] += X
|
||||
else if(X.holder.fakekey)
|
||||
.["stealth"]++
|
||||
.["stealth"] += X
|
||||
else
|
||||
.["present"]++
|
||||
.["present"] += X
|
||||
|
||||
/proc/send2irc_adminless_only(source, msg, requiredflags = R_BAN)
|
||||
var/list/adm = get_admin_counts(requiredflags)
|
||||
. = adm["present"]
|
||||
var/list/activemins = adm["present"]
|
||||
. = activemins.len
|
||||
if(. <= 0)
|
||||
var/final = ""
|
||||
if(!adm["afk"] && !adm["stealth"] && !adm["noflags"])
|
||||
var/list/afkmins = adm["afk"]
|
||||
var/list/stealthmins = adm["stealth"]
|
||||
var/list/powerlessmins = adm["noflags"]
|
||||
var/list/allmins = adm["total"]
|
||||
if(!afkmins.len && !stealthmins.len && !powerlessmins.len)
|
||||
final = "[msg] - No admins online"
|
||||
else
|
||||
final = "[msg] - All admins AFK ([adm["afk"]]/[adm["total"]]), stealthminned ([adm["stealth"]]/[adm["total"]]), or lack[rights2text(requiredflags, " ")] ([adm["noflags"]]/[adm["total"]])"
|
||||
final = "[msg] - All admins stealthed\[[english_list(stealthmins)]\], AFK\[[english_list(afkmins)]\], or lacks +BAN\[[english_list(powerlessmins)]\]! Total: [allmins.len] "
|
||||
send2irc(source,final)
|
||||
send2otherserver(source,final)
|
||||
|
||||
|
||||
+5
-2
@@ -97,7 +97,8 @@ var/last_irc_status = 0
|
||||
if(world.time - last_irc_status < IRC_STATUS_THROTTLE)
|
||||
return
|
||||
var/list/adm = get_admin_counts()
|
||||
var/status = "Admins: [adm["total"]] (Active: [adm["present"]] AFK: [adm["afk"]] Stealth: [adm["stealth"]] Skipped: [adm["noflags"]]). "
|
||||
var/list/allmins = adm["total"]
|
||||
var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). "
|
||||
status += "Players: [clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [ticker.mode.name]."
|
||||
send2irc("Status", status)
|
||||
last_irc_status = world.time
|
||||
@@ -117,7 +118,9 @@ var/last_irc_status = 0
|
||||
s["revision_date"] = revdata.date
|
||||
|
||||
var/list/adm = get_admin_counts()
|
||||
s["admins"] = adm["present"] + adm["afk"] //equivalent to the info gotten from adminwho
|
||||
var/list/presentmins = adm["present"]
|
||||
var/list/afkmins = adm["afk"]
|
||||
s["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho
|
||||
s["gamestate"] = 1
|
||||
if(ticker)
|
||||
s["gamestate"] = ticker.current_state
|
||||
|
||||
Reference in New Issue
Block a user