mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Return of Moderator II
Added MOD permissions that cover moderator verbs without admin ones. Ported our notes system. Fixed OOC not displayed for peasants.
This commit is contained in:
@@ -53,7 +53,13 @@
|
||||
if(holder.rights & R_ADMIN)
|
||||
C << "<font color=[config.allow_admin_ooccolor ? holder.ooccolor :"#b82e00" ]><b><span class='prefix'>OOC:</span> <EM>[key][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>"
|
||||
//todo: other adminranks OOC
|
||||
if(holder.rights & R_MOD)
|
||||
C << "<font color=#184880><b><span class='prefix'>OOC:</span> <EM>[key][holder.fakekey ? "/([holder.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>"
|
||||
|
||||
else
|
||||
C << "<font color='[normal_ooc_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[holder.fakekey ? holder.fakekey : src.key]:</EM> <span class='message'>[msg]</span></span></font>"
|
||||
else
|
||||
C << "<font color='[normal_ooc_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key]:</EM> <span class='message'>[msg]</span></span></font>"
|
||||
var/global/normal_ooc_colour = "#002eb8"
|
||||
|
||||
/client/proc/set_ooc(newColor as color)
|
||||
|
||||
@@ -248,8 +248,9 @@ var/custom_event_msg = null
|
||||
#define R_VAREDIT 1024
|
||||
#define R_SOUNDS 2048
|
||||
#define R_SPAWN 4096
|
||||
#define R_MOD 8192
|
||||
|
||||
#define R_MAXPERMISSION 4096 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
|
||||
#define R_MAXPERMISSION 8192 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
|
||||
|
||||
#define R_HOST 65535
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
|
||||
if("everything","host","all") rights |= R_HOST
|
||||
if("sound","sounds") rights |= R_SOUNDS
|
||||
if("spawn","create") rights |= R_SPAWN
|
||||
if("mod") rights |= R_MOD
|
||||
|
||||
admin_ranks[rank] = rights
|
||||
previous_rights = rights
|
||||
|
||||
@@ -208,7 +208,22 @@ var/list/admin_verbs_hideable = list(
|
||||
/proc/possess,
|
||||
/proc/release
|
||||
)
|
||||
|
||||
var/list/admin_verbs_mod = list(
|
||||
/client/proc/check_antagonists, /*shows all antags*/
|
||||
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
|
||||
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
|
||||
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game.*/
|
||||
/client/proc/playernotes,
|
||||
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
|
||||
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
|
||||
/client/proc/hide_verbs, /*hides all our adminverbs*/
|
||||
/client/proc/hide_verbs,
|
||||
/client/proc/mod_panel,
|
||||
/client/proc/cmd_mod_say,
|
||||
/datum/admins/proc/show_player_info
|
||||
//client/proc/Report,
|
||||
//client/proc/display_admin_reports
|
||||
)
|
||||
/client/proc/add_admin_verbs()
|
||||
if(holder)
|
||||
verbs += admin_verbs_default
|
||||
@@ -224,6 +239,7 @@ var/list/admin_verbs_hideable = list(
|
||||
if(holder.rights & R_REJUVINATE) verbs += admin_verbs_rejuv
|
||||
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_default; verbs += admin_verbs_mod
|
||||
|
||||
/client/proc/remove_admin_verbs()
|
||||
verbs.Remove(
|
||||
@@ -718,7 +734,6 @@ var/list/admin_verbs_hideable = list(
|
||||
M.update_body()
|
||||
M.check_dna(M)
|
||||
*/
|
||||
|
||||
/client/proc/playernotes()
|
||||
set name = "Show Player Info"
|
||||
set category = "Admin"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//This stuff was originally intended to be integrated into the ban-system I was working on
|
||||
//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
|
||||
//enjoy ~Carn
|
||||
|
||||
/*
|
||||
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
|
||||
|
||||
datum/admins/proc/notes_show(var/ckey)
|
||||
@@ -81,3 +81,74 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
return
|
||||
|
||||
#undef NOTESFILE
|
||||
*/
|
||||
|
||||
//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
|
||||
|
||||
/proc/notes_add(var/key, var/note, var/mob/usr)
|
||||
if (!key || !note)
|
||||
return
|
||||
|
||||
//Loading list of notes for this key
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos) infos = list()
|
||||
|
||||
//Overly complex timestamp creation
|
||||
var/modifyer = "th"
|
||||
switch(time2text(world.timeofday, "DD"))
|
||||
if("01","21","31")
|
||||
modifyer = "st"
|
||||
if("02","22",)
|
||||
modifyer = "nd"
|
||||
if("03","23")
|
||||
modifyer = "rd"
|
||||
var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
|
||||
if(copytext(day_string,1,2) == "0")
|
||||
day_string = copytext(day_string,2)
|
||||
var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
|
||||
var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
|
||||
|
||||
var/datum/player_info/P = new
|
||||
if (usr)
|
||||
P.author = usr.key
|
||||
P.rank = usr.client.holder.rank
|
||||
else
|
||||
P.author = "Adminbot"
|
||||
P.rank = "Friendly Robot"
|
||||
P.content = note
|
||||
P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
|
||||
|
||||
infos += P
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
|
||||
log_admin("[key_name(usr)] has edited [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
//Updating list of keys with notes on them
|
||||
var/savefile/note_list = new("data/player_notes.sav")
|
||||
var/list/note_keys
|
||||
note_list >> note_keys
|
||||
if(!note_keys) note_keys = list()
|
||||
if(!note_keys.Find(key)) note_keys += key
|
||||
note_list << note_keys
|
||||
del note_list
|
||||
|
||||
|
||||
/proc/notes_del(var/key, var/index)
|
||||
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
|
||||
var/list/infos
|
||||
info >> infos
|
||||
if(!infos || infos.len < index) return
|
||||
|
||||
var/datum/player_info/item = infos[index]
|
||||
infos.Remove(item)
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
del info
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
|
||||
//M.client = null
|
||||
del(M.client)
|
||||
|
||||
/*
|
||||
//Player Notes
|
||||
else if(href_list["notes"])
|
||||
var/ckey = href_list["ckey"]
|
||||
@@ -704,7 +704,7 @@
|
||||
if("remove")
|
||||
notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"]))
|
||||
notes_show(ckey)
|
||||
|
||||
*/
|
||||
else if(href_list["removejobban"])
|
||||
if(!check_rights(R_BAN)) return
|
||||
|
||||
@@ -2415,3 +2415,32 @@
|
||||
else if(href_list["ac_set_signature"])
|
||||
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
|
||||
src.access_news_network()
|
||||
|
||||
// player info stuff
|
||||
|
||||
if(href_list["add_player_info"])
|
||||
var/key = href_list["add_player_info"]
|
||||
var/add = input("Add Player Info") as null|text
|
||||
if(!add) return
|
||||
|
||||
notes_add(key,add,usr)
|
||||
show_player_info(key)
|
||||
|
||||
if(href_list["remove_player_info"])
|
||||
var/key = href_list["remove_player_info"]
|
||||
var/index = text2num(href_list["remove_index"])
|
||||
|
||||
notes_del(key, index)
|
||||
show_player_info(key)
|
||||
|
||||
if(href_list["notes"])
|
||||
var/ckey = href_list["ckey"]
|
||||
if(!ckey)
|
||||
var/mob/M = locate(href_list["mob"])
|
||||
if(ismob(M))
|
||||
ckey = M.ckey
|
||||
|
||||
switch(href_list["notes"])
|
||||
if("show")
|
||||
show_player_info(ckey)
|
||||
return
|
||||
@@ -84,6 +84,7 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")]
|
||||
|
||||
href_logfile = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")] hrefs.html")
|
||||
|
||||
load_mods()
|
||||
jobban_loadbanfile()
|
||||
jobban_updatelegacybans()
|
||||
LoadBans()
|
||||
@@ -207,6 +208,27 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")]
|
||||
// apply some settings from config..
|
||||
abandon_allowed = config.respawn
|
||||
|
||||
/world/proc/load_mods()
|
||||
diary << "Loading mods. Legacy: [config.admin_legacy_system]"
|
||||
if(config.admin_legacy_system)
|
||||
var/text = file2text("config/moderators.txt")
|
||||
if (!text)
|
||||
diary << "Failed to load config/mods.txt\n"
|
||||
else
|
||||
var/list/lines = text2list(text, "\n")
|
||||
for(var/line in lines)
|
||||
diary << "Line: [line]"
|
||||
if (!line)
|
||||
continue
|
||||
|
||||
if (copytext(line, 1, 2) == ";")
|
||||
continue
|
||||
|
||||
var/rights = admin_ranks["Moderator"]
|
||||
var/ckey = copytext(line, 1, length(line)+1)
|
||||
diary << "Here comes moderator [ckey], he has rights for [rights]"
|
||||
var/datum/admins/D = new /datum/admins("Moderator", rights, ckey)
|
||||
D.associate(directory[ckey])
|
||||
|
||||
/world/proc/update_status()
|
||||
var/s = ""
|
||||
|
||||
Reference in New Issue
Block a user