diff --git a/code/controllers/admin.dm b/code/controllers/admin.dm index d96b362847c..21883d142b1 100644 --- a/code/controllers/admin.dm +++ b/code/controllers/admin.dm @@ -71,7 +71,8 @@ ADMIN_VERB(debug_controller, R_DEBUG, "Debug Controller", "Debug the various per if (!istype(controller)) return - SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/debug_variables, controller) + + user.debug_variables(controller) BLACKBOX_LOG_ADMIN_VERB("Debug Controller") message_admins("Admin [key_name_admin(user)] is debugging the [controller] controller.") diff --git a/code/controllers/master.dm b/code/controllers/master.dm index d42826cd6ae..c093678ec73 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -224,11 +224,18 @@ ADMIN_VERB(cmd_controller_view_ui, R_SERVER|R_DEBUG, "Controller Overview", "Vie return TRUE if("view_variables") + if(!check_rights_for(ui.user.client, R_DEBUG)) + message_admins( + "[key_name(ui.user)] tried to view master controller variables while having improper rights, \ + this is potentially a malicious exploit and worth noting." + ) + var/datum/controller/subsystem/subsystem = locate(params["ref"]) in subsystems if(isnull(subsystem)) to_chat(ui.user, span_warning("Failed to locate subsystem.")) return - SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/debug_variables, subsystem) + + ui.user.client.debug_variables(subsystem) return TRUE /datum/controller/master/proc/check_and_perform_fast_update() diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 2fd8ca26993..c0abfcd88cc 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -570,7 +570,7 @@ ADMIN_VERB(debug_plane_masters, R_DEBUG, "Edit/Debug Planes", "Edit and visualiz holder.plane_debug.ui_interact(mob) ADMIN_VERB(debug_huds, R_DEBUG, "Debug HUDs", "Debug the data or antag HUDs.", ADMIN_CATEGORY_DEBUG, i as num) - SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/debug_variables, GLOB.huds[i]) + user.debug_variables(GLOB.huds[i]) ADMIN_VERB(jump_to_ruin, R_DEBUG, "Jump to Ruin", "Displays a list of all placed ruins to teleport to.", ADMIN_CATEGORY_DEBUG) var/list/names = list() diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 42e006a620a..72185b93f35 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -1,14 +1,11 @@ #define ICON_STATE_CHECKED 1 /// this dmi is checked. We don't check this one anymore. #define ICON_STATE_NULL 2 /// this dmi has null-named icon_state, allowing it to show a sprite on vv editor. -ADMIN_VERB_AND_CONTEXT_MENU(debug_variables, R_NONE, "View Variables", "View the variables of a datum.", ADMIN_CATEGORY_DEBUG, datum/thing in world) +ADMIN_VERB_ONLY_CONTEXT_MENU(debug_variables, R_NONE, "View Variables", datum/thing in world) user.debug_variables(thing) // This is kept as a separate proc because admins are able to show VV to non-admins -/client/proc/debug_variables(datum/thing in world) - set category = "Debug" - set name = "View Variables" - //set src in world +/client/proc/debug_variables(datum/thing) var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round. if(!usr.client || !usr.client.holder) //This is usr because admins can call the proc on other clients, even if they're not admins, to show them VVs.