From ba5b55286f92562ac2be771d0d1342f4732c498c Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Wed, 11 Jul 2012 18:01:41 +0000 Subject: [PATCH] - The IRC bot will now send a message to IRC when the only admin logs out of the server (so long as the game is running, so this does not happen in pregame, the setting up process or after the game finished) - The IRC bot will now also send a message to IRC whenever a round starts with no admins online. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4039 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/gamemodes/gameticker.dm | 7 +++++++ code/modules/mob/logout.dm | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 63ac8ea565b..7858a671363 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -124,6 +124,13 @@ var/global/datum/controller/gameticker/ticker start_events() //handles random events and space dust. + var/admins_number = 0 + for(var/client/C) + if(C.holder) + admins_number++ + if(admins_number == 0) + send2irc("Server", "Round just started with no admins online!") + spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE //Start master_controller.process() diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index b58ae225fb7..138487cdf67 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,8 +1,15 @@ /mob/Logout() log_access("Logout: [key_name(src)]") if (admins[src.ckey]) - message_admins("Admin logout: [key_name(src)]") + if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. + var/admins_number = 0 + for(var/client/C) + if(C.holder) + admins_number++ + message_admins("Admin logout: [key_name(src)]") + if(admins_number == 1) //Since this admin has not logged out yet, they are still counted, if the number of admins is 1 it means that after this one logs out, it will be 0. + send2irc("Server", "I have no admins online!") ..() return 1 \ No newline at end of file