diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index 0b196bd100..f574f65ffe 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -53,7 +53,13 @@ if(holder.rights & R_ADMIN) C << "OOC: [key][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]" //todo: other adminranks OOC + if(holder.rights & R_MOD) + C << "OOC: [key][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]" + else + C << "OOC: [holder.fakekey ? holder.fakekey : src.key]: [msg]" + else + C << "OOC: [src.key]: [msg]" var/global/normal_ooc_colour = "#002eb8" /client/proc/set_ooc(newColor as color) diff --git a/code/global.dm b/code/global.dm index a182c4383a..3471ba018b 100644 --- a/code/global.dm +++ b/code/global.dm @@ -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 diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index 091274814c..115fafba82 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -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 diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 6989f4045a..3919e4df07 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -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" diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm index 5eac96e731..dd0f69b8f3 100644 --- a/code/modules/admin/player_notes.dm +++ b/code/modules/admin/player_notes.dm @@ -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) @@ -80,4 +80,75 @@ datum/admins/proc/notes_gethtml(var/ckey) notesfile.dir.Remove(ckey) return -#undef NOTESFILE \ No newline at end of file +#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 diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 52e077f5ee..5fc393ac5f 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -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 @@ -2414,4 +2414,33 @@ else if(href_list["ac_set_signature"]) src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", "")) - src.access_news_network() \ No newline at end of file + 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 \ No newline at end of file diff --git a/code/world.dm b/code/world.dm index f3865d7aaf..44e173a7cb 100644 --- a/code/world.dm +++ b/code/world.dm @@ -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 = ""