mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Enables admin verb subsystem (#11014)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9536cb8b7d
commit
a8d6c3487c
150
code/controllers/subsystems/admin_verbs.dm
Normal file
150
code/controllers/subsystems/admin_verbs.dm
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
GENERAL_PROTECT_DATUM(/datum/controller/subsystem/admin_verbs)
|
||||||
|
|
||||||
|
SUBSYSTEM_DEF(admin_verbs)
|
||||||
|
name = "Admin Verbs"
|
||||||
|
flags = SS_NO_FIRE
|
||||||
|
//init_stage = INITSTAGE_EARLY
|
||||||
|
/// A list of all admin verbs indexed by their type.
|
||||||
|
var/list/datum/admin_verb/admin_verbs_by_type = list()
|
||||||
|
/// A list of all admin verbs indexed by their visibility flag.
|
||||||
|
var/list/list/datum/admin_verb/admin_verbs_by_visibility_flag = list()
|
||||||
|
/// A map of all assosciated admins and their visibility flags.
|
||||||
|
var/list/admin_visibility_flags = list()
|
||||||
|
/// A list of all admins that are pending initialization of this SS.
|
||||||
|
var/list/admins_pending_subsytem_init = list()
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/Initialize()
|
||||||
|
setup_verb_list()
|
||||||
|
process_pending_admins()
|
||||||
|
return SS_INIT_SUCCESS
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/Recover()
|
||||||
|
admin_verbs_by_type = SSadmin_verbs.admin_verbs_by_type
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/stat_entry(msg)
|
||||||
|
return "[..()] | V: [length(admin_verbs_by_type)]"
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/process_pending_admins()
|
||||||
|
var/list/pending_admins = admins_pending_subsytem_init
|
||||||
|
admins_pending_subsytem_init = null
|
||||||
|
for(var/admin_ckey in pending_admins)
|
||||||
|
assosciate_admin(GLOB.directory[admin_ckey])
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/setup_verb_list()
|
||||||
|
if(length(admin_verbs_by_type))
|
||||||
|
CRASH("Attempting to setup admin verbs twice!")
|
||||||
|
for(var/datum/admin_verb/verb_type as anything in subtypesof(/datum/admin_verb))
|
||||||
|
var/datum/admin_verb/verb_singleton = new verb_type
|
||||||
|
if(!verb_singleton.__avd_check_should_exist())
|
||||||
|
qdel(verb_singleton, force = TRUE)
|
||||||
|
continue
|
||||||
|
|
||||||
|
admin_verbs_by_type[verb_type] = verb_singleton
|
||||||
|
if(verb_singleton.visibility_flag)
|
||||||
|
if(!(verb_singleton.visibility_flag in admin_verbs_by_visibility_flag))
|
||||||
|
admin_verbs_by_visibility_flag[verb_singleton.visibility_flag] = list()
|
||||||
|
admin_verbs_by_visibility_flag[verb_singleton.visibility_flag] |= list(verb_singleton)
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/get_valid_verbs_for_admin(client/admin)
|
||||||
|
if(isnull(admin.holder))
|
||||||
|
CRASH("Why are we checking a non-admin for their valid... ahem... admin verbs?")
|
||||||
|
|
||||||
|
var/list/has_permission = list()
|
||||||
|
for(var/permission_flag in GLOB.bitflags)
|
||||||
|
if(admin.holder.check_for_rights(permission_flag))
|
||||||
|
has_permission["[permission_flag]"] = TRUE
|
||||||
|
|
||||||
|
var/list/valid_verbs = list()
|
||||||
|
for(var/datum/admin_verb/verb_type as anything in admin_verbs_by_type)
|
||||||
|
var/datum/admin_verb/verb_singleton = admin_verbs_by_type[verb_type]
|
||||||
|
if(!verify_visibility(admin, verb_singleton))
|
||||||
|
continue
|
||||||
|
|
||||||
|
var/verb_permissions = verb_singleton.permissions
|
||||||
|
if(verb_permissions == R_NONE)
|
||||||
|
valid_verbs |= list(verb_singleton)
|
||||||
|
else for(var/permission_flag in bitfield_to_list(verb_permissions))
|
||||||
|
if(!has_permission["[permission_flag]"])
|
||||||
|
continue
|
||||||
|
valid_verbs |= list(verb_singleton)
|
||||||
|
|
||||||
|
return valid_verbs
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/verify_visibility(client/admin, datum/admin_verb/verb_singleton)
|
||||||
|
var/needed_flag = verb_singleton.visibility_flag
|
||||||
|
return !needed_flag || (needed_flag in admin_visibility_flags[admin.ckey])
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/update_visibility_flag(client/admin, flag, state)
|
||||||
|
if(state)
|
||||||
|
admin_visibility_flags[admin.ckey] |= list(flag)
|
||||||
|
assosciate_admin(admin)
|
||||||
|
return
|
||||||
|
|
||||||
|
admin_visibility_flags[admin.ckey] -= list(flag)
|
||||||
|
// they lost the flag, iterate over verbs with that flag and yoink em
|
||||||
|
for(var/datum/admin_verb/verb_singleton as anything in admin_verbs_by_visibility_flag[flag])
|
||||||
|
verb_singleton.unassign_from_client(admin)
|
||||||
|
admin.init_verbs()
|
||||||
|
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/dynamic_invoke_verb(client/admin, datum/admin_verb/verb_type, ...)
|
||||||
|
if(IsAdminAdvancedProcCall())
|
||||||
|
message_admins("PERMISSION ELEVATION: [key_name_admin(admin)] attempted to dynamically invoke admin verb '[verb_type]'.")
|
||||||
|
return
|
||||||
|
|
||||||
|
if(ismob(admin))
|
||||||
|
var/mob/mob = admin
|
||||||
|
admin = mob.client
|
||||||
|
|
||||||
|
if(!ispath(verb_type, /datum/admin_verb) || verb_type == /datum/admin_verb)
|
||||||
|
CRASH("Attempted to dynamically invoke admin verb with invalid typepath '[verb_type]'.")
|
||||||
|
if(isnull(admin.holder))
|
||||||
|
CRASH("Attempted to dynamically invoke admin verb '[verb_type]' with a non-admin.")
|
||||||
|
|
||||||
|
var/list/verb_args = args.Copy()
|
||||||
|
verb_args.Cut(2, 3)
|
||||||
|
var/datum/admin_verb/verb_singleton = admin_verbs_by_type[verb_type] // this cannot be typed because we need to use `:`
|
||||||
|
if(isnull(verb_singleton))
|
||||||
|
CRASH("Attempted to dynamically invoke admin verb '[verb_type]' that doesn't exist.")
|
||||||
|
|
||||||
|
if(!admin.holder.check_for_rights(verb_singleton.permissions))
|
||||||
|
to_chat(admin, span_adminnotice("You lack the permissions to do this."))
|
||||||
|
return
|
||||||
|
|
||||||
|
var/old_usr = usr
|
||||||
|
usr = admin.mob
|
||||||
|
// THE MACRO ENSURES THIS EXISTS. IF IT EVER DOESNT EXIST SOMEONE DIDNT USE THE DAMN MACRO!
|
||||||
|
verb_singleton.__avd_do_verb(arglist(verb_args))
|
||||||
|
usr = old_usr
|
||||||
|
//SSblackbox.record_feedback("tally", "dynamic_admin_verb_invocation", 1, "[verb_type]")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assosciates and/or resyncs an admin with their accessible admin verbs.
|
||||||
|
*/
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/assosciate_admin(client/admin)
|
||||||
|
if(IsAdminAdvancedProcCall())
|
||||||
|
return
|
||||||
|
|
||||||
|
if(!isnull(admins_pending_subsytem_init)) // if the list exists we are still initializing
|
||||||
|
to_chat(admin, span_large(span_green("Admin Verbs are still initializing. Please wait and you will be automatically assigned your verbs when it is complete.")))
|
||||||
|
admins_pending_subsytem_init |= list(admin.ckey)
|
||||||
|
return
|
||||||
|
|
||||||
|
// refresh their verbs
|
||||||
|
admin_visibility_flags[admin.ckey] ||= list()
|
||||||
|
for(var/datum/admin_verb/verb_singleton as anything in get_valid_verbs_for_admin(admin))
|
||||||
|
verb_singleton.assign_to_client(admin)
|
||||||
|
admin.init_verbs()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unassosciates an admin from their admin verbs.
|
||||||
|
* Goes over all admin verbs because we don't know which ones are assigned to the admin's mob without a bunch of extra bookkeeping.
|
||||||
|
* This might be a performance issue in the future if we have a lot of admin verbs.
|
||||||
|
*/
|
||||||
|
/datum/controller/subsystem/admin_verbs/proc/deassosciate_admin(client/admin)
|
||||||
|
if(IsAdminAdvancedProcCall())
|
||||||
|
return
|
||||||
|
|
||||||
|
UnregisterSignal(admin, COMSIG_CLIENT_MOB_LOGIN)
|
||||||
|
for(var/datum/admin_verb/verb_type as anything in admin_verbs_by_type)
|
||||||
|
admin_verbs_by_type[verb_type].unassign_from_client(admin)
|
||||||
|
admin_visibility_flags -= list(admin.ckey)
|
||||||
@@ -3,7 +3,6 @@ var/list/admin_verbs_default = list(
|
|||||||
// /datum/admins/proc/show_player_panel, //shows an interface for individual players, with various links (links require additional flags, //VOREStation Remove,
|
// /datum/admins/proc/show_player_panel, //shows an interface for individual players, with various links (links require additional flags, //VOREStation Remove,
|
||||||
// /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, //VOREStation Remove,
|
// /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, //VOREStation Remove,
|
||||||
// /client/proc/player_panel, //VOREStation Remove,
|
// /client/proc/player_panel, //VOREStation Remove,
|
||||||
/client/proc/deadmin, //destroys our own admin datum so we can play as a regular player,
|
|
||||||
/client/proc/cmd_admin_say, //VOREStation Add,
|
/client/proc/cmd_admin_say, //VOREStation Add,
|
||||||
/client/proc/cmd_mod_say, //VOREStation Add,
|
/client/proc/cmd_mod_say, //VOREStation Add,
|
||||||
/client/proc/cmd_event_say, //VOREStation Add,
|
/client/proc/cmd_event_say, //VOREStation Add,
|
||||||
@@ -84,7 +83,6 @@ var/list/admin_verbs_admin = list(
|
|||||||
/datum/admins/proc/toggleoocdead, //toggles ooc on/off for everyone who is dead,
|
/datum/admins/proc/toggleoocdead, //toggles ooc on/off for everyone who is dead,
|
||||||
/datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub.,
|
/datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub.,
|
||||||
/datum/admins/proc/toggledsay, //toggles dsay on/off for everyone,
|
/datum/admins/proc/toggledsay, //toggles dsay on/off for everyone,
|
||||||
/client/proc/game_panel, //game panel, allows to change game-mode etc,
|
|
||||||
/client/proc/cmd_admin_say, //admin-only ooc chat,
|
/client/proc/cmd_admin_say, //admin-only ooc chat,
|
||||||
/client/proc/cmd_mod_say,
|
/client/proc/cmd_mod_say,
|
||||||
/client/proc/cmd_event_say,
|
/client/proc/cmd_event_say,
|
||||||
@@ -122,21 +120,14 @@ var/list/admin_verbs_admin = list(
|
|||||||
/datum/admins/proc/view_feedback,
|
/datum/admins/proc/view_feedback,
|
||||||
/client/proc/make_mentor,
|
/client/proc/make_mentor,
|
||||||
/client/proc/unmake_mentor,
|
/client/proc/unmake_mentor,
|
||||||
/client/proc/removetickets,
|
|
||||||
/client/proc/delbook,
|
/client/proc/delbook,
|
||||||
/client/proc/toggle_spawning_with_recolour,
|
/client/proc/toggle_spawning_with_recolour,
|
||||||
/client/proc/modify_shift_end,
|
|
||||||
/client/proc/start_vote,
|
/client/proc/start_vote,
|
||||||
/client/proc/hide_motion_tracker_feedback,
|
/client/proc/hide_motion_tracker_feedback,
|
||||||
/client/proc/reload_jobwhitelist, //ChompADD
|
/client/proc/reload_jobwhitelist, //ChompADD
|
||||||
/client/proc/reload_alienwhitelist //ChompADD
|
/client/proc/reload_alienwhitelist //ChompADD
|
||||||
)
|
)
|
||||||
|
|
||||||
var/list/admin_verbs_ban = list(
|
|
||||||
/client/proc/unban_panel,
|
|
||||||
/client/proc/jobbans
|
|
||||||
)
|
|
||||||
|
|
||||||
var/list/admin_verbs_sounds = list(
|
var/list/admin_verbs_sounds = list(
|
||||||
/client/proc/play_local_sound,
|
/client/proc/play_local_sound,
|
||||||
/client/proc/play_sound,
|
/client/proc/play_sound,
|
||||||
@@ -317,7 +308,6 @@ var/list/admin_verbs_rejuv = list(
|
|||||||
|
|
||||||
//verbs which can be hidden - needs work
|
//verbs which can be hidden - needs work
|
||||||
var/list/admin_verbs_hideable = list(
|
var/list/admin_verbs_hideable = list(
|
||||||
/client/proc/deadmin,
|
|
||||||
// /client/proc/deadchat,
|
// /client/proc/deadchat,
|
||||||
/datum/admins/proc/show_traitor_panel,
|
/datum/admins/proc/show_traitor_panel,
|
||||||
/datum/admins/proc/toggleenter,
|
/datum/admins/proc/toggleenter,
|
||||||
@@ -415,7 +405,6 @@ var/list/admin_verbs_mod = list(
|
|||||||
/datum/admins/proc/show_player_panel,
|
/datum/admins/proc/show_player_panel,
|
||||||
/client/proc/check_antagonists,
|
/client/proc/check_antagonists,
|
||||||
/client/proc/aooc,
|
/client/proc/aooc,
|
||||||
/client/proc/jobbans,
|
|
||||||
/client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head',
|
/client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head',
|
||||||
/datum/admins/proc/paralyze_mob,
|
/datum/admins/proc/paralyze_mob,
|
||||||
/client/proc/cmd_admin_direct_narrate,
|
/client/proc/cmd_admin_direct_narrate,
|
||||||
@@ -538,7 +527,6 @@ var/list/admin_verbs_event_manager = list(
|
|||||||
/client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others,
|
/client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others,
|
||||||
/client/proc/dsay, //talk in deadchat using our ckey/fakekey,
|
/client/proc/dsay, //talk in deadchat using our ckey/fakekey,
|
||||||
/client/proc/secrets,
|
/client/proc/secrets,
|
||||||
/client/proc/game_panel, //game panel, allows to change game-mode etc,
|
|
||||||
/client/proc/cmd_mod_say,
|
/client/proc/cmd_mod_say,
|
||||||
/client/proc/cmd_event_say,
|
/client/proc/cmd_event_say,
|
||||||
/datum/admins/proc/show_player_info,
|
/datum/admins/proc/show_player_info,
|
||||||
@@ -575,7 +563,6 @@ var/list/admin_verbs_event_manager = list(
|
|||||||
/client/proc/toggle_random_events,
|
/client/proc/toggle_random_events,
|
||||||
/client/proc/modify_server_news,
|
/client/proc/modify_server_news,
|
||||||
/client/proc/toggle_spawning_with_recolour,
|
/client/proc/toggle_spawning_with_recolour,
|
||||||
/client/proc/modify_shift_end,
|
|
||||||
/client/proc/start_vote,
|
/client/proc/start_vote,
|
||||||
/client/proc/AdminCreateVirus,
|
/client/proc/AdminCreateVirus,
|
||||||
/client/proc/ReleaseVirus,
|
/client/proc/ReleaseVirus,
|
||||||
@@ -589,45 +576,3 @@ var/list/admin_verbs_event_manager = list(
|
|||||||
/client/proc/reload_jobwhitelist, //ChompADD
|
/client/proc/reload_jobwhitelist, //ChompADD
|
||||||
/client/proc/reload_alienwhitelist //ChompADD
|
/client/proc/reload_alienwhitelist //ChompADD
|
||||||
)
|
)
|
||||||
|
|
||||||
/client/proc/add_admin_verbs()
|
|
||||||
if(holder)
|
|
||||||
var/rights = holder.rank_flags()
|
|
||||||
add_verb(src, admin_verbs_default)
|
|
||||||
if(rights & R_BUILDMODE) add_verb(src, /client/proc/togglebuildmodeself)
|
|
||||||
if(rights & R_ADMIN) add_verb(src, admin_verbs_admin)
|
|
||||||
if(rights & R_BAN) add_verb(src, admin_verbs_ban)
|
|
||||||
if(rights & R_FUN) add_verb(src, admin_verbs_fun)
|
|
||||||
if(rights & R_SERVER) add_verb(src, admin_verbs_server)
|
|
||||||
if(rights & R_DEBUG)
|
|
||||||
add_verb(src, admin_verbs_debug)
|
|
||||||
if(CONFIG_GET(flag/debugparanoid) && !(rights & R_ADMIN))
|
|
||||||
remove_verb(src, admin_verbs_paranoid_debug) //Right now it's just callproc but we can easily add others later on.
|
|
||||||
if(rights & R_POSSESS) add_verb(src, admin_verbs_possess)
|
|
||||||
if(rights & R_PERMISSIONS) add_verb(src, admin_verbs_permissions)
|
|
||||||
if(rights & R_STEALTH) add_verb(src, /client/proc/stealth)
|
|
||||||
if(rights & R_REJUVINATE) add_verb(src, admin_verbs_rejuv)
|
|
||||||
if(rights & R_SOUNDS) add_verb(src, admin_verbs_sounds)
|
|
||||||
if(rights & R_SPAWN) add_verb(src, admin_verbs_spawn)
|
|
||||||
if(rights & R_MOD) add_verb(src, admin_verbs_mod)
|
|
||||||
if(rights & R_EVENT) add_verb(src, admin_verbs_event_manager)
|
|
||||||
|
|
||||||
//CHOMPEdit Begin
|
|
||||||
/client/proc/remove_admin_verbs()
|
|
||||||
remove_verb(src, list(
|
|
||||||
admin_verbs_default,
|
|
||||||
/client/proc/togglebuildmodeself,
|
|
||||||
admin_verbs_admin,
|
|
||||||
admin_verbs_ban,
|
|
||||||
admin_verbs_fun,
|
|
||||||
admin_verbs_server,
|
|
||||||
admin_verbs_debug,
|
|
||||||
admin_verbs_possess,
|
|
||||||
admin_verbs_permissions,
|
|
||||||
/client/proc/stealth,
|
|
||||||
admin_verbs_rejuv,
|
|
||||||
admin_verbs_sounds,
|
|
||||||
admin_verbs_spawn,
|
|
||||||
debug_verbs
|
|
||||||
))
|
|
||||||
//CHOMPEdit End
|
|
||||||
|
|||||||
@@ -1,3 +1,49 @@
|
|||||||
|
/client/proc/add_admin_verbs()
|
||||||
|
// OLD ADMIN VERB SYSTEM
|
||||||
|
if(holder)
|
||||||
|
var/rights = holder.rank_flags()
|
||||||
|
add_verb(src, admin_verbs_default)
|
||||||
|
if(rights & R_BUILDMODE) add_verb(src, /client/proc/togglebuildmodeself)
|
||||||
|
if(rights & R_ADMIN) add_verb(src, admin_verbs_admin)
|
||||||
|
if(rights & R_FUN) add_verb(src, admin_verbs_fun)
|
||||||
|
if(rights & R_SERVER) add_verb(src, admin_verbs_server)
|
||||||
|
if(rights & R_DEBUG)
|
||||||
|
add_verb(src, admin_verbs_debug)
|
||||||
|
if(CONFIG_GET(flag/debugparanoid) && !(rights & R_ADMIN))
|
||||||
|
remove_verb(src, admin_verbs_paranoid_debug) //Right now it's just callproc but we can easily add others later on.
|
||||||
|
if(rights & R_POSSESS) add_verb(src, admin_verbs_possess)
|
||||||
|
if(rights & R_PERMISSIONS) add_verb(src, admin_verbs_permissions)
|
||||||
|
if(rights & R_STEALTH) add_verb(src, /client/proc/stealth)
|
||||||
|
if(rights & R_REJUVINATE) add_verb(src, admin_verbs_rejuv)
|
||||||
|
if(rights & R_SOUNDS) add_verb(src, admin_verbs_sounds)
|
||||||
|
if(rights & R_SPAWN) add_verb(src, admin_verbs_spawn)
|
||||||
|
if(rights & R_MOD) add_verb(src, admin_verbs_mod)
|
||||||
|
if(rights & R_EVENT) add_verb(src, admin_verbs_event_manager)
|
||||||
|
|
||||||
|
// NEW ADMIN VERBS SYSTEM
|
||||||
|
SSadmin_verbs.assosciate_admin(src)
|
||||||
|
|
||||||
|
/client/proc/remove_admin_verbs()
|
||||||
|
// OLD ADMIN VERB SYSTEM
|
||||||
|
remove_verb(src, list(
|
||||||
|
admin_verbs_default,
|
||||||
|
/client/proc/togglebuildmodeself,
|
||||||
|
admin_verbs_admin,
|
||||||
|
admin_verbs_fun,
|
||||||
|
admin_verbs_server,
|
||||||
|
admin_verbs_debug,
|
||||||
|
admin_verbs_possess,
|
||||||
|
admin_verbs_permissions,
|
||||||
|
/client/proc/stealth,
|
||||||
|
admin_verbs_rejuv,
|
||||||
|
admin_verbs_sounds,
|
||||||
|
admin_verbs_spawn,
|
||||||
|
debug_verbs
|
||||||
|
))
|
||||||
|
|
||||||
|
// NEW ADMIN VERBS SYSTEM
|
||||||
|
SSadmin_verbs.deassosciate_admin(src)
|
||||||
|
|
||||||
/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs
|
/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs
|
||||||
set name = "Adminverbs - Hide Most"
|
set name = "Adminverbs - Hide Most"
|
||||||
set category = "Admin.Misc"
|
set category = "Admin.Misc"
|
||||||
@@ -127,35 +173,23 @@
|
|||||||
feedback_add_details("admin_verb","CHA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","CHA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
return
|
return
|
||||||
|
|
||||||
/client/proc/jobbans()
|
ADMIN_VERB(jobbans, R_BAN, "Display Job bans", "View job bans here.", "Admin.Investigate")
|
||||||
set name = "Display Job bans"
|
if(CONFIG_GET(flag/ban_legacy_system))
|
||||||
set category = "Admin.Investigate"
|
user.holder.Jobbans()
|
||||||
if(holder)
|
else
|
||||||
if(CONFIG_GET(flag/ban_legacy_system))
|
user.holder.DB_ban_panel()
|
||||||
holder.Jobbans()
|
|
||||||
else
|
|
||||||
holder.DB_ban_panel()
|
|
||||||
feedback_add_details("admin_verb","VJB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","VJB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
return
|
|
||||||
|
|
||||||
/client/proc/unban_panel()
|
ADMIN_VERB(unban_panel, R_BAN, "Unbanning Panel", "Unban players here.", ADMIN_CATEGORY_GAME)
|
||||||
set name = "Unban Panel"
|
if(CONFIG_GET(flag/ban_legacy_system))
|
||||||
set category = "Admin.Game"
|
user.holder.unbanpanel()
|
||||||
if(holder)
|
else
|
||||||
if(CONFIG_GET(flag/ban_legacy_system))
|
user.holder.DB_ban_panel()
|
||||||
holder.unbanpanel()
|
|
||||||
else
|
|
||||||
holder.DB_ban_panel()
|
|
||||||
feedback_add_details("admin_verb","UBP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","UBP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
return
|
|
||||||
|
|
||||||
/client/proc/game_panel()
|
ADMIN_VERB(game_panel, R_ADMIN, "Game Panel", "Look at the state of the game.", ADMIN_CATEGORY_GAME)
|
||||||
set name = "Game Panel"
|
user.holder.Game()
|
||||||
set category = "Admin.Game"
|
|
||||||
if(holder)
|
|
||||||
holder.Game()
|
|
||||||
feedback_add_details("admin_verb","GP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","GP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
return
|
|
||||||
|
|
||||||
/client/proc/secrets()
|
/client/proc/secrets()
|
||||||
set name = "Secrets"
|
set name = "Secrets"
|
||||||
@@ -341,20 +375,16 @@
|
|||||||
log_admin("[key_name(usr)] used 'kill air'.")
|
log_admin("[key_name(usr)] used 'kill air'.")
|
||||||
message_admins(span_blue("[key_name_admin(usr)] used 'kill air'."), 1)
|
message_admins(span_blue("[key_name_admin(usr)] used 'kill air'."), 1)
|
||||||
|
|
||||||
/client/proc/deadmin()
|
ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY_MAIN)
|
||||||
set name = "DeAdmin"
|
user.holder.deactivate()
|
||||||
set category = "Admin.Misc"
|
|
||||||
set desc = "Shed your admin powers."
|
|
||||||
|
|
||||||
src.holder.deactivate()
|
|
||||||
to_chat(src, span_interface("You are now a normal player."))
|
to_chat(src, span_interface("You are now a normal player."))
|
||||||
log_admin("[key_name(src)] deadminned themselves.")
|
log_admin("[key_name(src)] deadminned themselves.")
|
||||||
message_admins("[key_name_admin(src)] deadminned themselves.")
|
message_admins("[key_name_admin(src)] deadminned themselves.")
|
||||||
//BLACKBOX_LOG_ADMIN_VERB("Deadmin")
|
//BLACKBOX_LOG_ADMIN_VERB("Deadmin")
|
||||||
feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
if(isobserver(mob))
|
if(isobserver(user.mob))
|
||||||
var/mob/observer/dead/our_mob = mob
|
var/mob/observer/dead/our_mob = user.mob
|
||||||
our_mob.visualnet?.removeVisibility(our_mob, src)
|
our_mob.visualnet?.removeVisibility(our_mob, src)
|
||||||
|
|
||||||
/client/proc/toggle_log_hrefs()
|
/client/proc/toggle_log_hrefs()
|
||||||
@@ -634,24 +664,17 @@
|
|||||||
if(tgui_alert(usr, "\The [orbiter] will orbit around [center]. Is this okay?", "Confirm Orbit", list("Yes", "No")) == "Yes")
|
if(tgui_alert(usr, "\The [orbiter] will orbit around [center]. Is this okay?", "Confirm Orbit", list("Yes", "No")) == "Yes")
|
||||||
orbiter.orbit(center, distance, clock, speed, segments)
|
orbiter.orbit(center, distance, clock, speed, segments)
|
||||||
|
|
||||||
/client/proc/removetickets()
|
ADMIN_VERB(removetickets, R_ADMIN, "Security Tickets", "Allows one to remove tickets from the global list.", "Admin.Investigate")
|
||||||
set name = "Security Tickets"
|
|
||||||
set category = "Admin.Investigate"
|
|
||||||
set desc = "Allows one to remove tickets from the global list."
|
|
||||||
|
|
||||||
if(!check_rights(R_ADMIN))
|
|
||||||
return
|
|
||||||
|
|
||||||
if(GLOB.security_printer_tickets.len >= 1)
|
if(GLOB.security_printer_tickets.len >= 1)
|
||||||
var/input = tgui_input_list(usr, "Which message?", "Security Tickets", GLOB.security_printer_tickets)
|
var/input = tgui_input_list(user, "Which message?", "Security Tickets", GLOB.security_printer_tickets)
|
||||||
if(!input)
|
if(!input)
|
||||||
return
|
return
|
||||||
if(tgui_alert(usr, "Do you want to remove the following message from the global list? \"[input]\"", "Remove Ticket", list("Yes", "No")) == "Yes")
|
if(tgui_alert(user, "Do you want to remove the following message from the global list? \"[input]\"", "Remove Ticket", list("Yes", "No")) == "Yes")
|
||||||
GLOB.security_printer_tickets -= input
|
GLOB.security_printer_tickets -= input
|
||||||
log_and_message_admins("removed a security ticket from the global list: \"[input]\"", usr)
|
log_and_message_admins("removed a security ticket from the global list: \"[input]\"", user)
|
||||||
|
|
||||||
else
|
else
|
||||||
tgui_alert_async(usr, "The ticket list is empty.","Empty")
|
tgui_alert_async(user, "The ticket list is empty.","Empty")
|
||||||
|
|
||||||
/client/proc/delbook()
|
/client/proc/delbook()
|
||||||
set name = "Delete Book"
|
set name = "Delete Book"
|
||||||
@@ -718,12 +741,5 @@
|
|||||||
CONFIG_SET(flag/allow_simple_mob_recolor, !CONFIG_GET(flag/allow_simple_mob_recolor))
|
CONFIG_SET(flag/allow_simple_mob_recolor, !CONFIG_GET(flag/allow_simple_mob_recolor))
|
||||||
to_chat(usr, "You have [CONFIG_GET(flag/allow_simple_mob_recolor) ? "enabled" : "disabled"] newly spawned simple mobs to spawn with the recolour verb")
|
to_chat(usr, "You have [CONFIG_GET(flag/allow_simple_mob_recolor) ? "enabled" : "disabled"] newly spawned simple mobs to spawn with the recolour verb")
|
||||||
|
|
||||||
/client/proc/modify_shift_end()
|
ADMIN_VERB(modify_shift_end, (R_ADMIN|R_EVENT|R_SERVER), "Modify Shift End", "Modifies the hard shift end time.", "Server.Game")
|
||||||
set name = "Modify Shift End"
|
transfer_controller.modify_hard_end(user)
|
||||||
set desc = "Modifies the hard shift end time."
|
|
||||||
set category = "Server.Game"
|
|
||||||
|
|
||||||
if(!check_rights_for(src, R_ADMIN|R_EVENT|R_SERVER))
|
|
||||||
return
|
|
||||||
|
|
||||||
transfer_controller.modify_hard_end(src)
|
|
||||||
|
|||||||
@@ -393,6 +393,7 @@
|
|||||||
#include "code\controllers\configuration\entries\resources.dm"
|
#include "code\controllers\configuration\entries\resources.dm"
|
||||||
#include "code\controllers\configuration\entries\vorestation.dm"
|
#include "code\controllers\configuration\entries\vorestation.dm"
|
||||||
#include "code\controllers\observer_listener\atom\observer.dm"
|
#include "code\controllers\observer_listener\atom\observer.dm"
|
||||||
|
#include "code\controllers\subsystems\admin_verbs.dm"
|
||||||
#include "code\controllers\subsystems\ai.dm"
|
#include "code\controllers\subsystems\ai.dm"
|
||||||
#include "code\controllers\subsystems\aifast.dm"
|
#include "code\controllers\subsystems\aifast.dm"
|
||||||
#include "code\controllers\subsystems\air.dm"
|
#include "code\controllers\subsystems\air.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user