From 9de0f3567dff2c0abc587fe5c7470f04dfca3fff Mon Sep 17 00:00:00 2001 From: Jordie0608 Date: Thu, 3 Sep 2015 20:38:36 +1000 Subject: [PATCH 1/4] config announce admin login/out --- code/controllers/configuration.dm | 7 +++++++ code/modules/admin/admin.dm | 24 +++++++++--------------- code/modules/mob/logout.dm | 3 +-- config/config.txt | 8 +++++++- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index ff6f803f5f0..623225d68c3 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -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) @@ -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]'" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index b4142a70058..abe9be3cea6 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -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]") \ No newline at end of file diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 1892a98a99a..9afd2e30144 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -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!",\ diff --git a/config/config.txt b/config/config.txt index 6f12881387b..c1bed2e1a60 100644 --- a/config/config.txt +++ b/config/config.txt @@ -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 \ No newline at end of file +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 \ No newline at end of file From 4e4324d9ceef3c9a3a8ee1bc0bc1e016f3f0aae9 Mon Sep 17 00:00:00 2001 From: Jordie0608 Date: Thu, 3 Sep 2015 20:44:39 +1000 Subject: [PATCH 2/4] whoops --- code/modules/admin/admin.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index abe9be3cea6..4ab09484427 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -813,10 +813,10 @@ var/global/floorIsLava = 0 /client/proc/adminGreet(logout) if(ticker && ticker.current_state == GAME_STATE_PLAYING && config && config.announce_admin_login) var/string - if(logout) + if(logout && config && config.announce_admin_logout) string = pick( "Admin logout: [key_name(src)]") - else + else if(!logout && config && config.announce_admin_login) string = pick( "Admin login: [key_name(src)]") message_admins("[string]") \ No newline at end of file From 00123edb188165140bf17865092f09036ed6c2c2 Mon Sep 17 00:00:00 2001 From: Jordie0608 Date: Thu, 3 Sep 2015 20:45:24 +1000 Subject: [PATCH 3/4] double whoops --- code/modules/admin/admin.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 4ab09484427..926468875eb 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -811,7 +811,7 @@ var/global/floorIsLava = 0 return 1 /client/proc/adminGreet(logout) - if(ticker && ticker.current_state == GAME_STATE_PLAYING && config && config.announce_admin_login) + if(ticker && ticker.current_state == GAME_STATE_PLAYING) var/string if(logout && config && config.announce_admin_logout) string = pick( From b7754d5ed7c18d0dd303b47f6d6a23147899a089 Mon Sep 17 00:00:00 2001 From: Jordie0608 Date: Fri, 4 Sep 2015 21:49:09 +1000 Subject: [PATCH 4/4] announce login message as a config --- code/__DEFINES/preferences.dm | 3 ++- code/controllers/configuration.dm | 2 +- code/modules/admin/admin.dm | 5 +++-- code/modules/admin/admin_verbs.dm | 1 + code/modules/client/client procs.dm | 1 + code/modules/client/preferences.dm | 6 ++++-- code/modules/client/preferences_toggles.dm | 10 ++++++++++ code/modules/mob/logout.dm | 1 - 8 files changed, 22 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index bb05efc975a..65084617ba1 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -10,6 +10,7 @@ #define SOUND_INSTRUMENTS 128 #define SOUND_SHIP_AMBIENCE 256 #define SOUND_PRAYERS 512 +#define ANNOUNCE_LOGIN 1024 #define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|MEMBER_PUBLIC|INTENT_STYLE|MIDROUND_ANTAG|SOUND_INSTRUMENTS|SOUND_SHIP_AMBIENCE|SOUND_PRAYERS) @@ -43,4 +44,4 @@ #define BE_GANG 4096 #define BE_SHADOWLING 8192 #define BE_ABDUCTOR 16384 -#define BE_REVENANT 32768 +#define BE_REVENANT 32768 diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 623225d68c3..cb111d7c063 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -165,7 +165,7 @@ 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_logout = 0 var/announce_admin_login = 0 /datum/configuration/New() diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 926468875eb..2eb84777f6e 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -816,7 +816,8 @@ var/global/floorIsLava = 0 if(logout && config && config.announce_admin_logout) string = pick( "Admin logout: [key_name(src)]") - else if(!logout && config && config.announce_admin_login) + else if(!logout && config && config.announce_admin_login && (prefs.toggles & ANNOUNCE_LOGIN)) string = pick( "Admin login: [key_name(src)]") - message_admins("[string]") \ No newline at end of file + if(string) + message_admins("[string]") \ No newline at end of file diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 249cd05528b..82e0c143345 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,6 +1,7 @@ //admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless var/list/admin_verbs_default = list( /client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/ + /client/proc/toggleannouncelogin, /*toggles if an admin's login is announced during a round*/ /client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/ /client/proc/cmd_admin_say, /*admin-only ooc chat*/ /client/proc/hide_verbs, /*hides all our adminverbs*/ diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 865906b154c..5ecd635021b 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -184,6 +184,7 @@ var/next_external_rsc = 0 ////////////// /client/Del() if(holder) + adminGreet(1) holder.owner = null admins -= src directory -= ckey diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index d0119b29ec5..3c11398621f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -345,8 +345,8 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set if(user.client) if(user.client.holder) - dat += "Adminhelp Sound: " - dat += "[(toggles & SOUND_ADMINHELP)?"On":"Off"]
" + dat += "Adminhelp Sound: [(toggles & SOUND_ADMINHELP)?"On":"Off"]
" + dat += "Announce Login: [(toggles & ANNOUNCE_LOGIN)?"On":"Off"]
" if(unlock_content || check_rights_for(user.client, R_ADMIN)) dat += "OOC:     Change
" @@ -955,6 +955,8 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set if("hear_adminhelps") toggles ^= SOUND_ADMINHELP + if("announce_login") + toggles ^= ANNOUNCE_LOGIN if("ui") switch(UI_style) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 99218130f57..7a44e73a182 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -64,6 +64,16 @@ usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive." feedback_add_details("admin_verb","AHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/proc/toggleannouncelogin() + set name = "Do/Don't Announce Login" + set category = "Preferences" + set desc = "Toggle if you want an announcement to admins when you login during a round" + if(!holder) return + prefs.toggles ^= ANNOUNCE_LOGIN + prefs.save_preferences() + usr << "You will [(prefs.toggles & ANNOUNCE_LOGIN) ? "now" : "no longer"] have an announcement to other admins when you login." + feedback_add_details("admin_verb","TAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /client/proc/deadchat() set name = "Show/Hide Deadchat" set category = "Preferences" diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 9afd2e30144..4c7da6069be 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -5,7 +5,6 @@ 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 - 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!",\