Adds Mentors.

Adds a config option MENTORS which sets the variable config.mods_are_mentors
Adds a rights level of R_MENTOR which gets msay, private message, aghost, notes, and a new proc for checking for new players (requires database support).

If the confic option for mentors is set then

	the ckeys listed in moderators.txt file will instead be set as mentors, you can still make moderators by adding them in admins.txt

	staffwho will show Mentors instead of Moderators as the heading above the listing of non-admins.

Also:  Players now get a message gently reminding them to click the name of the staff member to reply instead of ahelping over and over.

Conflicts:
	code/controllers/configuration.dm
	code/game/verbs/who.dm
	code/modules/admin/admin_ranks.dm
	config-example/config.txt
This commit is contained in:
Ccomp5950
2014-05-04 21:37:37 -04:00
committed by ZomgPonies
parent db136cc457
commit 970525d065
13 changed files with 353 additions and 43 deletions
+1
View File
@@ -304,6 +304,7 @@ proc/tg_list2text(list/list, glue=",")
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
if(rights & R_MOD) . += "[seperator]+MODERATOR"
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
return .
/proc/ui_style2icon(ui_style)
+4
View File
@@ -54,6 +54,7 @@
var/respawn = 0
var/guest_jobban = 1
var/usewhitelist = 0
var/mods_are_mentors = 0
var/kick_inactive = 0 //force disconnect for inactive players
var/load_jobs_from_txt = 0
var/ToRban = 0
@@ -248,6 +249,9 @@
if ("log_hrefs")
config.log_hrefs = 1
if ("mentors")
config.mods_are_mentors = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
+14 -34
View File
@@ -5,6 +5,7 @@
var/msg = "<b>Current Players:</b>\n"
var/list/Lines = list()
if(holder)
@@ -47,11 +48,12 @@
set name = "Adminwho"
var/msg = ""
var/modmsg = ""
var/num_mods_online = 0
var/num_admins_online = 0
if(holder)
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
msg += "\t[C] is a [C.holder.rank]"
if(C.holder.fakekey)
@@ -69,34 +71,9 @@
msg += "\n"
num_admins_online++
else
num_mods_online++
else
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
if(!C.holder.fakekey)
msg += "\t[C] is a [C.holder.rank]\n"
num_admins_online++
else
num_mods_online++
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg
msg += "<b>There are also [num_mods_online] moderators online.</b> To view online moderators, type 'modwho'\n"
src << msg
/client/verb/modwho()
set category = "Admin"
set name = "Modwho"
var/msg = ""
var/num_admins_online = 0
var/num_mods_online = 0
if(holder)
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
num_admins_online++
else
msg += "\t[C] is a [C.holder.rank]"
else if(R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
modmsg += "\t[C] is a [C.holder.rank]"
if(isobserver(C.mob))
msg += " - Observing"
@@ -111,11 +88,14 @@
num_mods_online++
else
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
num_admins_online++
else
msg += "\t[C] is a [C.holder.rank]\n"
msg = "<b>Current Moderators ([num_mods_online]):</b>\n" + msg
msg += "<b>There are also [num_admins_online] admins online.</b> To view online admins, type 'adminwho'\n"
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
if(!C.holder.fakekey)
msg += "\t[C] is a [C.holder.rank]\n"
num_admins_online++
else if (R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
modmsg += "\t[C] is a [C.holder.rank]\n"
num_mods_online++
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg + "\n<b> Current [config.mods_are_mentors ? "Mentors" : "Moderators"]([num_mods_online]):</b>\n" + modmsg
src << msg
+4
View File
@@ -41,6 +41,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
if("sound","sounds") rights |= R_SOUNDS
if("spawn","create") rights |= R_SPAWN
if("mod") rights |= R_MOD
if("mentor") rights |= R_MENTOR
admin_ranks[rank] = rights
previous_rights = rights
@@ -52,6 +53,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
testing(msg)
#endif
/hook/startup/proc/loadAdmins()
load_admins()
return 1
/proc/load_admins()
//clear the datums references
+16 -2
View File
@@ -1,12 +1,13 @@
//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(
/datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
// /datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
/client/proc/check_antagonists /*shows all antags*/
/client/proc/check_antagonists, /*shows all antags*/
/client/proc/cmd_mentor_check_new_players
// /client/proc/deadchat /*toggles deadchat on/off*/
)
var/list/admin_verbs_admin = list(
@@ -232,6 +233,18 @@ var/list/admin_verbs_mod = list(
/datum/admins/proc/show_player_info,
/client/proc/player_panel_new
)
var/list/admin_verbs_mentor = list(
/client/proc/cmd_admin_pm_context,
/client/proc/cmd_admin_pm_panel,
/datum/admins/proc/PlayerNotes,
/client/proc/admin_ghost,
/client/proc/cmd_mod_say,
/datum/admins/proc/show_player_info,
/client/proc/dsay,
/client/proc/cmd_admin_subtle_message
)
/client/proc/add_admin_verbs()
if(holder)
verbs += admin_verbs_default
@@ -248,6 +261,7 @@ var/list/admin_verbs_mod = list(
if(holder.rights & R_SOUNDS) verbs += admin_verbs_sounds
if(holder.rights & R_SPAWN) verbs += admin_verbs_spawn
if(holder.rights & R_MOD) verbs += admin_verbs_mod
if(holder.rights & R_MENTOR) verbs += admin_verbs_mentor
/client/proc/remove_admin_verbs()
verbs.Remove(
+4
View File
@@ -18,6 +18,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
return
adminhelped = 1 //Determines if they get the message to reply by clicking the name.
/**src.verbs -= /client/verb/adminhelp
spawn(1200)
@@ -31,6 +33,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
if(!msg) return
var/original_msg = msg
//explode the input msg into a list
var/list/msglist = text2list(msg, " ")
+5 -2
View File
@@ -94,7 +94,10 @@
var/recieve_message = ""
if(holder && !C.holder)
recieve_message = "<font color='[recieve_color]' size='4'><b>-- Administrator private message --</b></font>\n"
recieve_message = "<font color='[recieve_color]' size='3'><b>-- Click the [recieve_pm_type]'s name to reply --</b></font>\n"
if(C.adminhelped)
C << recieve_message
C.adminhelped = 0
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
if(config.popup_admin_pm)
@@ -180,5 +183,5 @@
//check client/X is an admin and isn't the sender or recipient
if(X == C || X == src)
continue
if(X.key!=key && X.key!=C.key && (X.holder.rights & R_ADMIN) || (X.holder.rights & R_MOD) )
if(X.key!=key && X.key!=C.key && (X.holder.rights & R_ADMIN) || (X.holder.rights & (R_MOD|R_MENTOR)) )
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]-&gt;[key_name(C, X, 0)]:</B> \blue [msg]</font>" //inform X
+31
View File
@@ -65,6 +65,37 @@
message_admins("\blue \bold SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] : [msg]", 1)
feedback_add_details("admin_verb","SMS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_mentor_check_new_players() //Allows mentors / admins to determine who the newer players are.
set category = "Admin"
set name = "Check new Players"
if(!holder)
src << "Only staff members may use this command."
var/age = alert(src, "Age check", "Show accounts yonger then _____ days","7", "30" , "All")
if(age == "All")
age = 9999999
else
age = text2num(age)
var/missing_ages = 0
var/msg = ""
for(var/client/C in clients)
if(C.player_age == "Requires database")
missing_ages = 1
continue
if(C.player_age < age)
msg += "[key_name_admin(C)]: account is [C.player_age] days old<br>"
if(missing_ages)
src << "Some accounts did not have proper ages set in their clients. This function requires database to be present"
if(msg != "")
src << browse(msg, "window=Player_age_check")
else
src << "No matches for that age range found."
/client/proc/cmd_admin_world_narrate() // Allows administrators to fluff events a little easier -- TLE
set category = "Special Verbs"
set name = "Global Narrate"
+1
View File
@@ -18,6 +18,7 @@
var/area = null
var/time_died_as_mouse = null //when the client last died as a mouse
var/adminhelped = 0
///////////////
//SOUND STUFF//
+2 -1
View File
@@ -657,8 +657,9 @@ var/list/TAGGERLOCATIONS = list("Disposals",
#define R_SOUNDS 2048
#define R_SPAWN 4096
#define R_MOD 8192
#define R_MENTOR 16384
#define R_MAXPERMISSION 8192 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
#define R_MAXPERMISSION 16384 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
#define R_HOST 65535
+5 -2
View File
@@ -262,9 +262,12 @@
if (copytext(line, 1, 2) == ";")
continue
var/rights = admin_ranks["Moderator"]
var/title = "Moderator"
if(config.mods_are_mentors) title = "Mentor"
var/rights = admin_ranks[title]
var/ckey = copytext(line, 1, length(line)+1)
var/datum/admins/D = new /datum/admins("Moderator", rights, ckey)
var/datum/admins/D = new /datum/admins(title, rights, ckey)
D.associate(directory[ckey])
/world/proc/update_status()