Locks some really gamebreaking verbs to Maints (#17633)

This commit is contained in:
AffectedArc07
2022-04-22 00:27:54 +01:00
committed by GitHub
parent 135fb1802f
commit 469168517a
15 changed files with 27 additions and 57 deletions
+1
View File
@@ -35,6 +35,7 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
if("mentor") rights |= R_MENTOR
if("proccall") rights |= R_PROCCALL
if("viewruntimes") rights |= R_VIEWRUNTIMES
if("maintainer") rights |= R_MAINTAINER
GLOB.admin_ranks[rankname] = rights
previous_rights = rights
+10 -4
View File
@@ -88,7 +88,6 @@ GLOBAL_LIST_INIT(admin_verbs_event, list(
/client/proc/cmd_admin_dress,
/client/proc/cmd_admin_gib_self,
/client/proc/drop_bomb,
/client/proc/cinematic,
/client/proc/one_click_antag,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
@@ -145,7 +144,6 @@ GLOBAL_LIST_INIT(admin_verbs_server, list(
))
GLOBAL_LIST_INIT(admin_verbs_debug, list(
/client/proc/cmd_admin_list_open_jobs,
/client/proc/Debug2,
/client/proc/cmd_debug_make_powernets,
/client/proc/debug_controller,
/client/proc/cmd_debug_mob_lists,
@@ -156,11 +154,9 @@ GLOBAL_LIST_INIT(admin_verbs_debug, list(
/client/proc/toggledebuglogs,
/client/proc/cmd_display_del_log,
/client/proc/cmd_display_del_log_simple,
/client/proc/debugNatureMapGenerator,
/client/proc/check_bomb_impacts,
/client/proc/test_movable_UI,
/client/proc/test_snap_UI,
/client/proc/cinematic,
/proc/machine_upgrade,
/client/proc/map_template_load,
/client/proc/map_template_upload,
@@ -225,6 +221,14 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
/client/proc/resolveAllAdminTickets,
/client/proc/resolveAllMentorTickets
))
// In this list are verbs that should ONLY be executed by maintainers, aka people who know how badly this will break the server
// If you are adding something here, you MUST justify it
GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
/client/proc/ticklag, // This adjusts the server tick rate and is VERY easy to hard lockup the server with
/client/proc/debugNatureMapGenerator, // This lags like hell, and is very easy to nuke half the server with
/client/proc/vv_by_ref, // This allows you to lookup **ANYTHING** in the server memory by spamming refs. Locked for security.
/client/proc/cinematic, // This will break everyone's screens in the round. Dont use this for adminbus.
))
/client/proc/on_holder_add()
if(chatOutput && chatOutput.loaded)
@@ -270,6 +274,8 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list(
verbs += GLOB.admin_verbs_mentor
if(holder.rights & R_PROCCALL)
verbs += GLOB.admin_verbs_proccall
if(holder.rights & R_MAINTAINER)
verbs += GLOB.admin_verbs_maintainer
if(holder.rights & R_VIEWRUNTIMES)
verbs += /client/proc/view_runtimes
verbs += /client/proc/cmd_display_del_log
+4
View File
@@ -5,6 +5,10 @@
set hidden = 1
if(!SSticker)
return
if(!check_rights(R_MAINTAINER))
return
switch(cinematic)
if("explosion")
var/parameter = input(src, "station_missed = ?", "Enter Parameter", 0) as num
-19
View File
@@ -1,22 +1,3 @@
/client/proc/Debug2()
set category = "Debug"
set name = "Debug-Game"
if(!check_rights(R_DEBUG))
return
if(GLOB.debug2)
GLOB.debug2 = 0
message_admins("[key_name_admin(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
GLOB.debug2 = 1
message_admins("[key_name_admin(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Debug Game") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/* 21st Sept 2010
Updated by Skie -- Still not perfect but better!
Stuff you can't do:
+2 -1
View File
@@ -125,7 +125,8 @@
set category = "Debug"
// It's gated by "Debug Verbs", so might as well gate it to the debug permission
if(!check_rights(R_DEBUG))
// AA: This seems harmless but is **incredibly** powerful and dangerous. Maints only.
if(!check_rights(R_MAINTAINER))
return
var/refstring = clean_input("Which reference?","Ref")
+1 -1
View File
@@ -543,7 +543,7 @@ GLOBAL_PROTECT(VVmaint_only)
if(prompt != "Continue")
return FALSE
if(param_var_name in GLOB.VVmaint_only)
if(!is_maintainer(usr))
if(!check_rights(R_MAINTAINER))
alert(usr, "Editing this variable is restricted to Maintainers only.", "Error", "Ok")
return FALSE
+1 -1
View File
@@ -5,7 +5,7 @@
set name = "Set Ticklag"
set desc = "Sets a new tick lag. Recommend you don't mess with this too much! Stable, time-tested ticklag value is 0.9"
if(!check_rights(R_DEBUG)) return
if(!check_rights(R_MAINTAINER)) return
var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null
//I've used ticks of 2 before to help with serious singulo lags
@@ -9,7 +9,6 @@ GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list(
/client/proc/count_objects_all,
/client/proc/cmd_assume_direct_control,
/client/proc/startSinglo,
/client/proc/ticklag,
/client/proc/cmd_admin_grantfullaccess,
/client/proc/cmd_admin_areatest,
/client/proc/cmd_admin_rejuvenate,
@@ -17,7 +16,6 @@ GLOBAL_LIST_INIT(admin_verbs_show_debug_verbs, list(
/client/proc/forceEvent,
/client/proc/admin_redo_space_transitions,
/client/proc/make_turf_space_map,
/client/proc/vv_by_ref
))
// Would be nice to make this a permanent admin pref so we don't need to click it each time