Skip to content

Commit

Permalink
[MIRROR] Removes some code soul (IF YOU ARE COPY PASTING THIS...), …
Browse files Browse the repository at this point in the history
…replaces it with a macro [MDB IGNORE] (#848)

* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro (#79935)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2023
1 parent bf32122 commit 085e65f
Show file tree
Hide file tree
Showing 37 changed files with 144 additions and 140 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,7 @@ GLOBAL_VAR_INIT(ghost_role_flags, ALL)
#define INTERVIEW_DENIED "interview_denied"
/// State when an interview has had no action on it yet
#define INTERVIEW_PENDING "interview_pending"

/// Used in logging uses of admin verbs (and sometimes some non-admin or debug verbs) to the blackbox
/// Only pass it a string key, the verb being used.
#define BLACKBOX_LOG_ADMIN_VERB(the_verb) SSblackbox.record_feedback("tally", "admin_verb", 1, the_verb)
6 changes: 3 additions & 3 deletions code/controllers/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick)
switch(controller)
if("Master")
Recreate_MC()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Master Controller")
BLACKBOX_LOG_ADMIN_VERB("Restart Master Controller")
if("Failsafe")
new /datum/controller/failsafe()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller")
BLACKBOX_LOG_ADMIN_VERB("Restart Failsafe Controller")

message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")

Expand Down Expand Up @@ -87,5 +87,5 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick)
return
debug_variables(controller)

SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller")
BLACKBOX_LOG_ADMIN_VERB("Debug Controller")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
8 changes: 4 additions & 4 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
A.flags_1 |= ADMIN_SPAWNED_1

log_admin("[key_name(usr)] spawned [amount] x [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Atom") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Spawn Atom")

/datum/admins/proc/podspawn_atom(object as text)
set category = "Debug"
Expand All @@ -103,7 +103,7 @@
A.flags_1 |= ADMIN_SPAWNED_1

log_admin("[key_name(usr)] pod-spawned [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Podspawn Atom") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Podspawn Atom")

/datum/admins/proc/spawn_cargo(object as text)
set category = "Debug"
Expand All @@ -121,7 +121,7 @@
S.generate(get_turf(usr))

log_admin("[key_name(usr)] spawned cargo pack [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Cargo") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Spawn Cargo")

/datum/admins/proc/dynamic_mode_options(mob/user)
var/dat = {"
Expand Down Expand Up @@ -304,7 +304,7 @@

message_admins(span_adminnotice("[key_name_admin(usr)] has put [frommob.key] in control of [tomob.name]."))
log_admin("[key_name(usr)] stuffed [frommob.key] into [tomob.name].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Ghost Drag Control")
BLACKBOX_LOG_ADMIN_VERB("Ghost Drag Control")

tomob.key = frommob.key
tomob.client?.init_verbs()
Expand Down
56 changes: 28 additions & 28 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
add_verb(src, /client/proc/show_verbs)

to_chat(src, span_interface("Almost all of your adminverbs have been hidden."), confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Hide All Adminverbs") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Hide All Adminverbs")
return

/client/proc/show_verbs()
Expand All @@ -355,7 +355,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
add_admin_verbs()

to_chat(src, span_interface("All of your adminverbs are now visible."), confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Adminverbs") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Show Adminverbs")



Expand All @@ -376,7 +376,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
message_admins("[key_name_admin(usr)] re-entered corpse")
ghost.can_reenter_corpse = 1 //force re-entering even when otherwise not possible
ghost.reenter_corpse()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin Reenter") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Admin Reenter")
else if(isnewplayer(mob))
to_chat(src, "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.</font>", confidential = TRUE)
return FALSE
Expand All @@ -389,7 +389,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
init_verbs()
if(body && !body.key)
body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus
SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin Ghost") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Admin Ghost")

/client/proc/invisimin()
set name = "Invisimin"
Expand All @@ -416,86 +416,86 @@ GLOBAL_PROTECT(admin_verbs_poll)
log_admin("[key_name(usr)] checked antagonists.") //for tsar~
if(!isobserver(usr) && SSticker.HasRoundStarted())
message_admins("[key_name_admin(usr)] checked antagonists.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Antagonists") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Check Antagonists")

/client/proc/list_bombers()
set name = "List Bombers"
set category = "Admin.Game"
if(!holder)
return
holder.list_bombers()
SSblackbox.record_feedback("tally", "admin_verb", 1, "List Bombers") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("List Bombers")

/client/proc/list_signalers()
set name = "List Signalers"
set category = "Admin.Game"
if(!holder)
return
holder.list_signalers()
SSblackbox.record_feedback("tally", "admin_verb", 1, "List Signalers") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("List Signalers")

/client/proc/list_law_changes()
set name = "List Law Changes"
set category = "Debug"
if(!holder)
return
holder.list_law_changes()
SSblackbox.record_feedback("tally", "admin_verb", 1, "List Law Changes") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("List Law Changes")

/client/proc/show_manifest()
set name = "Show Manifest"
set category = "Debug"
if(!holder)
return
holder.show_manifest()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Manifest") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Show Manifest")

/client/proc/list_dna()
set name = "List DNA"
set category = "Debug"
if(!holder)
return
holder.list_dna()
SSblackbox.record_feedback("tally", "admin_verb", 1, "List DNA") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("List DNA")

/client/proc/list_fingerprints()
set name = "List Fingerprints"
set category = "Debug"
if(!holder)
return
holder.list_fingerprints()
SSblackbox.record_feedback("tally", "admin_verb", 1, "List Fingerprints") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("List Fingerprints")

/client/proc/ban_panel()
set name = "Banning Panel"
set category = "Admin"
if(!check_rights(R_BAN))
return
holder.ban_panel()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Banning Panel") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Banning Panel")

/client/proc/unban_panel()
set name = "Unbanning Panel"
set category = "Admin"
if(!check_rights(R_BAN))
return
holder.unban_panel()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Unbanning Panel") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Unbanning Panel")

/client/proc/game_panel()
set name = "Game Panel"
set category = "Admin.Game"
if(holder)
holder.Game()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Game Panel") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Game Panel")

/client/proc/poll_panel()
set name = "Server Poll Management"
set category = "Admin"
if(!check_rights(R_POLL))
return
holder.poll_list_panel()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Server Poll Management") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Server Poll Management")

/// Returns this client's stealthed ckey
/client/proc/getStealthKey()
Expand Down Expand Up @@ -541,7 +541,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
else
enable_stealth_mode()

SSblackbox.record_feedback("tally", "admin_verb", 1, "Stealth Mode") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Stealth Mode")

#define STEALTH_MODE_TRAIT "stealth_mode"

Expand Down Expand Up @@ -624,7 +624,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
explosion(epicenter, devastation_range = range_devastation, heavy_impact_range = range_heavy, light_impact_range = range_light, flash_range = range_flash, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob)
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Bomb") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Drop Bomb")

/client/proc/drop_dynex_bomb()
set category = "Admin.Fun"
Expand All @@ -637,7 +637,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
dyn_explosion(epicenter, ex_power)
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Dynamic Bomb") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Drop Dynamic Bomb")

/client/proc/get_dynex_range()
set category = "Debug"
Expand Down Expand Up @@ -775,7 +775,7 @@ GLOBAL_PROTECT(admin_verbs_poll)

message_admins("[key_name_admin(usr)] added mob ability [ability_type] to mob [ability_recipient].")
log_admin("[key_name(usr)] added mob ability [ability_type] to mob [ability_recipient].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Add Mob Ability") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Add Mob Ability")

/client/proc/remove_mob_action(mob/removal_target in GLOB.mob_list)
set category = "Admin.Fun"
Expand All @@ -799,7 +799,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
qdel(to_remove)
log_admin("[key_name(usr)] removed the ability [chosen_ability] from [key_name(removal_target)].")
message_admins("[key_name_admin(usr)] removed the ability [chosen_ability] from [key_name_admin(removal_target)].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Remove Mob Ability") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Remove Mob Ability")

/client/proc/give_spell(mob/spell_recipient in GLOB.mob_list)
set category = "Admin.Fun"
Expand Down Expand Up @@ -837,7 +837,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
to_chat(usr, span_warning("The intended spell recipient no longer exists."))
return

SSblackbox.record_feedback("tally", "admin_verb", 1, "Give Spell") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Give Spell")
log_admin("[key_name(usr)] gave [key_name(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].")
message_admins("[key_name_admin(usr)] gave [key_name_admin(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].")

Expand Down Expand Up @@ -874,7 +874,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
qdel(to_remove)
log_admin("[key_name(usr)] removed the spell [chosen_spell] from [key_name(removal_target)].")
message_admins("[key_name_admin(usr)] removed the spell [chosen_spell] from [key_name_admin(removal_target)].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Remove Spell") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Remove Spell")

/client/proc/give_disease(mob/living/T in GLOB.mob_living_list)
set category = "Admin.Fun"
Expand All @@ -887,7 +887,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
if(!D)
return
T.ForceContractDisease(new D, FALSE, TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Give Disease") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Give Disease")
log_admin("[key_name(usr)] gave [key_name(T)] the disease [D].")
message_admins(span_adminnotice("[key_name_admin(usr)] gave [key_name_admin(T)] the disease [D]."))

Expand All @@ -901,15 +901,15 @@ GLOBAL_PROTECT(admin_verbs_poll)
O.say(message, sanitize = FALSE)
log_admin("[key_name(usr)] made [O] at [AREACOORD(O)] say \"[message]\"")
message_admins(span_adminnotice("[key_name_admin(usr)] made [O] at [AREACOORD(O)]. say \"[message]\""))
SSblackbox.record_feedback("tally", "admin_verb", 1, "Object Say") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Object Say")
/client/proc/togglebuildmodeself()
set name = "Toggle Build Mode Self"
set category = "Admin.Events"
if (!(holder.rank_flags() & R_BUILD))
return
if(src.mob)
togglebuildmode(src.mob)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Build Mode") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Toggle Build Mode")

/client/proc/check_ai_laws()
set name = "Check AI Laws"
Expand Down Expand Up @@ -957,7 +957,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
to_chat(src, span_interface("You are now a normal player."))
log_admin("[src] deadminned themselves.")
message_admins("[src] deadminned themselves.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Deadmin")
BLACKBOX_LOG_ADMIN_VERB("Deadmin")

/client/proc/readmin()
set name = "Readmin"
Expand All @@ -982,7 +982,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
to_chat(src, span_interface("You are now an admin."), confidential = TRUE)
message_admins("[src] re-adminned themselves.")
log_admin("[src] re-adminned themselves.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Readmin")
BLACKBOX_LOG_ADMIN_VERB("Readmin")

/client/proc/populate_world(amount = 50)
set name = "Populate World"
Expand Down Expand Up @@ -1182,7 +1182,7 @@ GLOBAL_PROTECT(admin_verbs_poll)
if(!holder.library_manager)
holder.library_manager = new()
holder.library_manager.ui_interact(usr)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Library Management") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Library Management")

/client/proc/create_mob_worm()
set category = "Admin.Fun"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/adminmenu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
set category = "Admin.Game"
if(usr.client.holder)
usr.client.holder.player_panel_new()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Player Panel New") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Player Panel New")
4 changes: 2 additions & 2 deletions code/modules/admin/callproc/callproc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ GLOBAL_PROTECT(AdminProcCallHandler)
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") //Proccall announce removed.
returnval = WrapAdminProcCall(GLOBAL_PROC, procname, lst) // Pass the lst as an argument list to the proc
SSblackbox.record_feedback("tally", "admin_verb", 1, "Advanced ProcCall") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Advanced ProcCall")
if(get_retval)
get_retval += returnval
. = get_callproc_returnval(returnval, procname)
Expand Down Expand Up @@ -255,7 +255,7 @@ GLOBAL_PROTECT(LastAdminCalledProc)
var/msg = "[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]."
message_admins(msg)
admin_ticket_log(A, msg)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Atom ProcCall") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Atom ProcCall")

var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc
. = get_callproc_returnval(returnval,procname)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/admin/verbs/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

message_admins("[key_name_admin(usr)] sent a tip of the round.")
log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Tip")
BLACKBOX_LOG_ADMIN_VERB("Show Tip")

/datum/admins/proc/announce()
set category = "Admin"
Expand All @@ -39,7 +39,7 @@
message = adminscrub(message,500)
to_chat(world, "[span_adminnotice("<b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>")]\n \t [message]", confidential = TRUE)
log_admin("Announce: [key_name(usr)] : [message]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Announce") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Announce")

/datum/admins/proc/unprison(mob/M in GLOB.mob_list)
set category = "Admin"
Expand All @@ -50,7 +50,7 @@
log_admin("[key_name(usr)] has unprisoned [key_name(M)]")
else
tgui_alert(usr,"[M.name] is not prisoned.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Unprison") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Unprison")

/client/proc/cmd_admin_check_player_exp() //Allows admins to determine who the newer players are.
set category = "Admin"
Expand Down Expand Up @@ -183,7 +183,7 @@
var/msg = "[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] drop everything!"
message_admins(msg)
admin_ticket_log(M, msg)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Drop Everything") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
BLACKBOX_LOG_ADMIN_VERB("Drop Everything")

/proc/cmd_admin_mute(whom, mute_type, automute = 0)
if(!whom)
Expand Down
Loading

0 comments on commit 085e65f

Please sign in to comment.