Skip to content

Commit

Permalink
config announce admin login/out
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordie0608 committed Sep 3, 2015
1 parent 0efc54e commit 9de0f35
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
7 changes: 7 additions & 0 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@

var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database

var/announce_admin_logout = 1
var/announce_admin_login = 0

/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for(var/T in L)
Expand Down Expand Up @@ -347,6 +350,10 @@
world.log = newlog
if("autoconvert_notes")
config.autoconvert_notes = 1
if("announce_admin_logout")
config.announce_admin_logout = 1
if("announce_admin_login")
config.announce_admin_login = 1
else
diary << "Unknown setting in configuration: '[name]'"

Expand Down
24 changes: 9 additions & 15 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -810,19 +810,13 @@ var/global/floorIsLava = 0

return 1

/client/proc/adminGreet()
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
var/string = pick(
"I welcome you to the server [key]!",
"Happy to see you [key]!",
"Ah, [key] logged, say hello!",
"The server welcomes you [key]!",
"Exceptional! [key] joined us, what an honour!",
"Another amazing day, because [key] logged, say hi!",
"Did anyone see? [key] logged, welcome!",
"Monday to sunday, the server warmly welcomes you [key]!",
"It's a pleasure to see you [key], greetings!",
"Not a bad day if [key] joins, welcome, welcome!",
"Surely it's nice to see you [key], have a heartly welcome!")
//I really do
/client/proc/adminGreet(logout)
if(ticker && ticker.current_state == GAME_STATE_PLAYING && config && config.announce_admin_login)
var/string
if(logout)
string = pick(
"Admin logout: [key_name(src)]")
else
string = pick(
"Admin login: [key_name(src)]")
message_admins("[string]")
3 changes: 1 addition & 2 deletions code/modules/mob/logout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
if(admin_datums[src.ckey])
if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.
var/admins_number = admins.len

message_admins("Admin logout: [key_name(src)]")
client.adminGreet(1)
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
var/cheesy_message = pick( list( \
"I have no admins online!",\
Expand Down
8 changes: 7 additions & 1 deletion config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,10 @@ NOTIFY_NEW_PLAYER_AGE 0
#LOG_RUNTIMES

##Comment this out if you've used the mass conversion sql proc for notes or want to stop converting notes
AUTOCONVERT_NOTES
AUTOCONVERT_NOTES

##Comment this out to stop admin messages sent anytime an admin disconnects from a round in play, you can edit the messages in admin.dm
ANNOUNCE_ADMIN_LOGOUT

##Uncomment to have an admin message sent anytime an admin connects to a round in play, you can edit the messages in admin.dm
#ANNOUNCE_ADMIN_LOGIN

0 comments on commit 9de0f35

Please sign in to comment.