Skip to content

Commit 970525d

Browse files
Ccomp5950ZomgPonies
authored andcommitted
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
1 parent db136cc commit 970525d

File tree

13 files changed

+353
-43
lines changed

13 files changed

+353
-43
lines changed

Diff for: code/__HELPERS/type2type.dm

+1
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ proc/tg_list2text(list/list, glue=",")
304304
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
305305
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
306306
if(rights & R_MOD) . += "[seperator]+MODERATOR"
307+
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
307308
return .
308309

309310
/proc/ui_style2icon(ui_style)

Diff for: code/controllers/configuration.dm

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
var/respawn = 0
5555
var/guest_jobban = 1
5656
var/usewhitelist = 0
57+
var/mods_are_mentors = 0
5758
var/kick_inactive = 0 //force disconnect for inactive players
5859
var/load_jobs_from_txt = 0
5960
var/ToRban = 0
@@ -248,6 +249,9 @@
248249
if ("log_hrefs")
249250
config.log_hrefs = 1
250251

252+
if ("mentors")
253+
config.mods_are_mentors = 1
254+
251255
if("allow_admin_ooccolor")
252256
config.allow_admin_ooccolor = 1
253257

Diff for: code/game/verbs/who.dm

+14-34
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
var/msg = "<b>Current Players:</b>\n"
77

8+
89
var/list/Lines = list()
910

1011
if(holder)
@@ -47,11 +48,12 @@
4748
set name = "Adminwho"
4849

4950
var/msg = ""
51+
var/modmsg = ""
5052
var/num_mods_online = 0
5153
var/num_admins_online = 0
5254
if(holder)
5355
for(var/client/C in admins)
54-
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
56+
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
5557
msg += "\t[C] is a [C.holder.rank]"
5658

5759
if(C.holder.fakekey)
@@ -69,34 +71,9 @@
6971
msg += "\n"
7072

7173
num_admins_online++
72-
else
73-
num_mods_online++
74-
else
75-
for(var/client/C in admins)
76-
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
77-
if(!C.holder.fakekey)
78-
msg += "\t[C] is a [C.holder.rank]\n"
79-
num_admins_online++
80-
else
81-
num_mods_online++
8274

83-
msg = "<b>Current Admins ([num_admins_online]):</b>\n" + msg
84-
msg += "<b>There are also [num_mods_online] moderators online.</b> To view online moderators, type 'modwho'\n"
85-
src << msg
86-
87-
/client/verb/modwho()
88-
set category = "Admin"
89-
set name = "Modwho"
90-
91-
var/msg = ""
92-
var/num_admins_online = 0
93-
var/num_mods_online = 0
94-
if(holder)
95-
for(var/client/C in admins)
96-
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
97-
num_admins_online++
98-
else
99-
msg += "\t[C] is a [C.holder.rank]"
75+
else if(R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
76+
modmsg += "\t[C] is a [C.holder.rank]"
10077

10178
if(isobserver(C.mob))
10279
msg += " - Observing"
@@ -111,11 +88,14 @@
11188
num_mods_online++
11289
else
11390
for(var/client/C in admins)
114-
if(R_ADMIN & C.holder.rights || !(R_MOD & C.holder.rights))
115-
num_admins_online++
116-
else
117-
msg += "\t[C] is a [C.holder.rank]\n"
11891

119-
msg = "<b>Current Moderators ([num_mods_online]):</b>\n" + msg
120-
msg += "<b>There are also [num_admins_online] admins online.</b> To view online admins, type 'adminwho'\n"
92+
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
93+
if(!C.holder.fakekey)
94+
msg += "\t[C] is a [C.holder.rank]\n"
95+
num_admins_online++
96+
else if (R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
97+
modmsg += "\t[C] is a [C.holder.rank]\n"
98+
num_mods_online++
99+
100+
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
121101
src << msg

Diff for: code/modules/admin/admin_ranks.dm

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
4141
if("sound","sounds") rights |= R_SOUNDS
4242
if("spawn","create") rights |= R_SPAWN
4343
if("mod") rights |= R_MOD
44+
if("mentor") rights |= R_MENTOR
4445

4546
admin_ranks[rank] = rights
4647
previous_rights = rights
@@ -52,6 +53,9 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
5253
testing(msg)
5354
#endif
5455

56+
/hook/startup/proc/loadAdmins()
57+
load_admins()
58+
return 1
5559

5660
/proc/load_admins()
5761
//clear the datums references

Diff for: code/modules/admin/admin_verbs.dm

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
22
var/list/admin_verbs_default = list(
3-
/datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
3+
// /datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
44
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
55
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
66
/client/proc/hide_verbs, /*hides all our adminverbs*/
77
/client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/
88
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
9-
/client/proc/check_antagonists /*shows all antags*/
9+
/client/proc/check_antagonists, /*shows all antags*/
10+
/client/proc/cmd_mentor_check_new_players
1011
// /client/proc/deadchat /*toggles deadchat on/off*/
1112
)
1213
var/list/admin_verbs_admin = list(
@@ -232,6 +233,18 @@ var/list/admin_verbs_mod = list(
232233
/datum/admins/proc/show_player_info,
233234
/client/proc/player_panel_new
234235
)
236+
237+
var/list/admin_verbs_mentor = list(
238+
/client/proc/cmd_admin_pm_context,
239+
/client/proc/cmd_admin_pm_panel,
240+
/datum/admins/proc/PlayerNotes,
241+
/client/proc/admin_ghost,
242+
/client/proc/cmd_mod_say,
243+
/datum/admins/proc/show_player_info,
244+
/client/proc/dsay,
245+
/client/proc/cmd_admin_subtle_message
246+
)
247+
235248
/client/proc/add_admin_verbs()
236249
if(holder)
237250
verbs += admin_verbs_default
@@ -248,6 +261,7 @@ var/list/admin_verbs_mod = list(
248261
if(holder.rights & R_SOUNDS) verbs += admin_verbs_sounds
249262
if(holder.rights & R_SPAWN) verbs += admin_verbs_spawn
250263
if(holder.rights & R_MOD) verbs += admin_verbs_mod
264+
if(holder.rights & R_MENTOR) verbs += admin_verbs_mentor
251265

252266
/client/proc/remove_admin_verbs()
253267
verbs.Remove(

Diff for: code/modules/admin/verbs/adminhelp.dm

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
1818
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
1919
return
2020

21+
adminhelped = 1 //Determines if they get the message to reply by clicking the name.
22+
2123
/**src.verbs -= /client/verb/adminhelp
2224
2325
spawn(1200)
@@ -31,6 +33,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
3133
if(!msg) return
3234
var/original_msg = msg
3335

36+
37+
3438
//explode the input msg into a list
3539
var/list/msglist = text2list(msg, " ")
3640

Diff for: code/modules/admin/verbs/adminpm.dm

+5-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
var/recieve_message = ""
9595

9696
if(holder && !C.holder)
97-
recieve_message = "<font color='[recieve_color]' size='4'><b>-- Administrator private message --</b></font>\n"
97+
recieve_message = "<font color='[recieve_color]' size='3'><b>-- Click the [recieve_pm_type]'s name to reply --</b></font>\n"
98+
if(C.adminhelped)
99+
C << recieve_message
100+
C.adminhelped = 0
98101

99102
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
100103
if(config.popup_admin_pm)
@@ -180,5 +183,5 @@
180183
//check client/X is an admin and isn't the sender or recipient
181184
if(X == C || X == src)
182185
continue
183-
if(X.key!=key && X.key!=C.key && (X.holder.rights & R_ADMIN) || (X.holder.rights & R_MOD) )
186+
if(X.key!=key && X.key!=C.key && (X.holder.rights & R_ADMIN) || (X.holder.rights & (R_MOD|R_MENTOR)) )
184187
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]-&gt;[key_name(C, X, 0)]:</B> \blue [msg]</font>" //inform X

Diff for: code/modules/admin/verbs/randomverbs.dm

+31
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,37 @@
6565
message_admins("\blue \bold SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] : [msg]", 1)
6666
feedback_add_details("admin_verb","SMS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
6767

68+
/client/proc/cmd_mentor_check_new_players() //Allows mentors / admins to determine who the newer players are.
69+
set category = "Admin"
70+
set name = "Check new Players"
71+
if(!holder)
72+
src << "Only staff members may use this command."
73+
74+
var/age = alert(src, "Age check", "Show accounts yonger then _____ days","7", "30" , "All")
75+
76+
if(age == "All")
77+
age = 9999999
78+
else
79+
age = text2num(age)
80+
81+
var/missing_ages = 0
82+
var/msg = ""
83+
for(var/client/C in clients)
84+
if(C.player_age == "Requires database")
85+
missing_ages = 1
86+
continue
87+
if(C.player_age < age)
88+
msg += "[key_name_admin(C)]: account is [C.player_age] days old<br>"
89+
90+
if(missing_ages)
91+
src << "Some accounts did not have proper ages set in their clients. This function requires database to be present"
92+
93+
if(msg != "")
94+
src << browse(msg, "window=Player_age_check")
95+
else
96+
src << "No matches for that age range found."
97+
98+
6899
/client/proc/cmd_admin_world_narrate() // Allows administrators to fluff events a little easier -- TLE
69100
set category = "Special Verbs"
70101
set name = "Global Narrate"

Diff for: code/modules/client/client defines.dm

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
var/area = null
1919
var/time_died_as_mouse = null //when the client last died as a mouse
2020

21+
var/adminhelped = 0
2122

2223
///////////////
2324
//SOUND STUFF//

Diff for: code/setup.dm

+2-1
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,9 @@ var/list/TAGGERLOCATIONS = list("Disposals",
657657
#define R_SOUNDS 2048
658658
#define R_SPAWN 4096
659659
#define R_MOD 8192
660+
#define R_MENTOR 16384
660661

661-
#define R_MAXPERMISSION 8192 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
662+
#define R_MAXPERMISSION 16384 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
662663

663664
#define R_HOST 65535
664665

Diff for: code/world.dm

+5-2
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,12 @@
262262
if (copytext(line, 1, 2) == ";")
263263
continue
264264

265-
var/rights = admin_ranks["Moderator"]
265+
var/title = "Moderator"
266+
if(config.mods_are_mentors) title = "Mentor"
267+
var/rights = admin_ranks[title]
268+
266269
var/ckey = copytext(line, 1, length(line)+1)
267-
var/datum/admins/D = new /datum/admins("Moderator", rights, ckey)
270+
var/datum/admins/D = new /datum/admins(title, rights, ckey)
268271
D.associate(directory[ckey])
269272

270273
/world/proc/update_status()

0 commit comments

Comments
 (0)