mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Admin Verb Datums MkIII | Now with functional command bar (#82511)
This commit is contained in:
@@ -153,6 +153,15 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
to_chat(src, "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Only 10 bucks for 3 months! <a href=\"https://secure.byond.com/membership\">Click Here to find out more</a>.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/client/proc/is_localhost()
|
||||
var/static/localhost_addresses = list(
|
||||
"127.0.0.1",
|
||||
"::1",
|
||||
null,
|
||||
)
|
||||
return address in localhost_addresses
|
||||
|
||||
/*
|
||||
* Call back proc that should be checked in all paths where a client can send messages
|
||||
*
|
||||
@@ -250,27 +259,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
GLOB.ahelp_tickets.ClientLogin(src)
|
||||
GLOB.interviews.client_login(src)
|
||||
GLOB.requests.client_login(src)
|
||||
var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins.
|
||||
//Admin Authorisation
|
||||
var/datum/admins/admin_datum = GLOB.admin_datums[ckey]
|
||||
if (!isnull(admin_datum))
|
||||
admin_datum.associate(src)
|
||||
connecting_admin = TRUE
|
||||
else if(GLOB.deadmins[ckey])
|
||||
add_verb(src, /client/proc/readmin)
|
||||
connecting_admin = TRUE
|
||||
if(CONFIG_GET(flag/autoadmin))
|
||||
if(!GLOB.admin_datums[ckey])
|
||||
var/list/autoadmin_ranks = ranks_from_rank_name(CONFIG_GET(string/autoadmin_rank))
|
||||
if (autoadmin_ranks.len == 0)
|
||||
to_chat(GLOB.admins, "Autoadmin rank not found")
|
||||
else
|
||||
new /datum/admins(autoadmin_ranks, ckey)
|
||||
if(CONFIG_GET(flag/enable_localhost_rank) && !connecting_admin)
|
||||
var/localhost_addresses = list("127.0.0.1", "::1")
|
||||
if(isnull(address) || (address in localhost_addresses))
|
||||
var/datum/admin_rank/localhost_rank = new("!localhost!", R_EVERYTHING, R_DBRANKS, R_EVERYTHING) //+EVERYTHING -DBRANKS *EVERYTHING
|
||||
new /datum/admins(list(localhost_rank), ckey, 1, 1)
|
||||
//preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum)
|
||||
prefs = GLOB.preferences_datums[ckey]
|
||||
if(prefs)
|
||||
@@ -343,6 +331,29 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
|
||||
|
||||
. = ..() //calls mob.Login()
|
||||
|
||||
// Admin Verbs need the client's mob to exist. Must be after ..()
|
||||
var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins.
|
||||
//Admin Authorisation
|
||||
var/datum/admins/admin_datum = GLOB.admin_datums[ckey]
|
||||
if (!isnull(admin_datum))
|
||||
admin_datum.associate(src)
|
||||
connecting_admin = TRUE
|
||||
else if(GLOB.deadmins[ckey])
|
||||
add_verb(src, /client/proc/readmin)
|
||||
connecting_admin = TRUE
|
||||
if(CONFIG_GET(flag/autoadmin))
|
||||
if(!GLOB.admin_datums[ckey])
|
||||
var/list/autoadmin_ranks = ranks_from_rank_name(CONFIG_GET(string/autoadmin_rank))
|
||||
if (autoadmin_ranks.len == 0)
|
||||
to_chat(world, "Autoadmin rank not found")
|
||||
else
|
||||
new /datum/admins(autoadmin_ranks, ckey)
|
||||
|
||||
if(CONFIG_GET(flag/enable_localhost_rank) && !connecting_admin && is_localhost())
|
||||
var/datum/admin_rank/localhost_rank = new("!localhost!", R_EVERYTHING, R_DBRANKS, R_EVERYTHING) //+EVERYTHING -DBRANKS *EVERYTHING
|
||||
new /datum/admins(list(localhost_rank), ckey, 1, 1)
|
||||
|
||||
if (length(GLOB.stickybanadminexemptions))
|
||||
GLOB.stickybanadminexemptions -= ckey
|
||||
if (!length(GLOB.stickybanadminexemptions))
|
||||
@@ -1175,13 +1186,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
/// Attempts to make the client orbit the given object, for administrative purposes.
|
||||
/// If they are not an observer, will try to aghost them.
|
||||
/client/proc/admin_follow(atom/movable/target)
|
||||
var/can_ghost = TRUE
|
||||
|
||||
if (!isobserver(mob))
|
||||
can_ghost = admin_ghost()
|
||||
|
||||
if(!can_ghost)
|
||||
return FALSE
|
||||
if(!isobserver(mob))
|
||||
SSadmin_verbs.dynamic_invoke_verb(src, /datum/admin_verb/admin_ghost)
|
||||
if(!isobserver(mob))
|
||||
return
|
||||
|
||||
var/mob/dead/observer/observer = mob
|
||||
observer.ManualFollow(target)
|
||||
|
||||
@@ -139,33 +139,28 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
|
||||
set category = "Server"
|
||||
if(IsAdminAdvancedProcCall())
|
||||
return
|
||||
var/newColor = input(src, "Please select the new player OOC color.", "OOC color") as color|null
|
||||
|
||||
ADMIN_VERB(set_ooc_color, R_FUN, "Set Player OOC Color", "Modifies the global OOC color.", ADMIN_CATEGORY_SERVER)
|
||||
var/newColor = input(user, "Please select the new player OOC color.", "OOC color") as color|null
|
||||
if(isnull(newColor))
|
||||
return
|
||||
if(!check_rights(R_FUN))
|
||||
message_admins("[usr.key] has attempted to use the Set Player OOC Color verb!")
|
||||
log_admin("[key_name(usr)] tried to set player ooc color without authorization.")
|
||||
return
|
||||
var/new_color = sanitize_color(newColor)
|
||||
message_admins("[key_name_admin(usr)] has set the players' ooc color to [new_color].")
|
||||
log_admin("[key_name_admin(usr)] has set the player ooc color to [new_color].")
|
||||
message_admins("[key_name_admin(user)] has set the players' ooc color to [new_color].")
|
||||
log_admin("[key_name_admin(user)] has set the player ooc color to [new_color].")
|
||||
GLOB.OOC_COLOR = new_color
|
||||
|
||||
|
||||
/client/proc/reset_ooc()
|
||||
set name = "Reset Player OOC Color"
|
||||
set desc = "Returns player OOC Color to default"
|
||||
set category = "Server"
|
||||
if(IsAdminAdvancedProcCall())
|
||||
return
|
||||
if(tgui_alert(usr, "Are you sure you want to reset the OOC color of all players?", "Reset Player OOC Color", list("Yes", "No")) != "Yes")
|
||||
|
||||
ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC color to default.", ADMIN_CATEGORY_SERVER)
|
||||
if(tgui_alert(user, "Are you sure you want to reset the OOC color of all players?", "Reset Player OOC Color", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
if(!check_rights(R_FUN))
|
||||
message_admins("[usr.key] has attempted to use the Reset Player OOC Color verb!")
|
||||
log_admin("[key_name(usr)] tried to reset player ooc color without authorization.")
|
||||
return
|
||||
message_admins("[key_name_admin(usr)] has reset the players' ooc color.")
|
||||
log_admin("[key_name_admin(usr)] has reset player ooc color.")
|
||||
message_admins("[key_name_admin(user)] has reset the players' ooc color.")
|
||||
log_admin("[key_name_admin(user)] has reset player ooc color.")
|
||||
GLOB.OOC_COLOR = null
|
||||
|
||||
//Checks admin notice
|
||||
|
||||
Reference in New Issue
Block a user