Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: some admin tweaks part 2 #6401

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/gamemode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define GAMEMODE_IS_REVOLUTION (SSticker && istype(SSticker.mode, /datum/game_mode/revolution))
#define GAMEMODE_IS_WIZARD (SSticker && istype(SSticker.mode, /datum/game_mode/wizard))
#define GAMEMODE_IS_RAGIN_MAGES (SSticker && istype(SSticker.mode, /datum/game_mode/wizard/raginmages))
#define GAMEMODE_IS_METEOR (SSticker && istype(SSticker.mode, /datum/game_mode/meteor))

// special roles
// Distinct from the ROLE_X defines because some antags have multiple special roles but only one ban type
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@

#define is_internal_organ(A) istype(A, /obj/item/organ/internal)

#define is_organ(A) istype((A), /obj/item/organ)

GLOBAL_LIST_INIT(pointed_types, typecacheof(list(
/obj/item/pen,
/obj/item/screwdriver,
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
#define LOGIN_TYPE_ROBOT 3
#define LOGIN_TYPE_ADMIN 4

#define NUKE_STATUS_INTACT 0
#define NUKE_CORE_MISSING 1
#define NUKE_MISSING 2

// Bitflags for a machine's preferences on when it should start processing. For use with machinery's `processing_flags` var.
/// Indicates the machine will automatically start processing right after it's `Initialize()` is ran.
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,5 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NO_VOCAL_CORDS "no_vocal_cords"

#define TRAIT_BLOB_ZOMBIFIED "blob_zombified"

#define TRAIT_BEING_OFFERED "offered"
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,5 @@
#define WET_TRAIT "wet"

#define BLOB_ZOMBIE_TRAIT "blob_zombie_trait"

#define ADMIN_OFFER_TRAIT "admin_offer"
3 changes: 3 additions & 0 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@
text = replacetext(text, "\[/i\]", "</I>")
text = replacetext(text, "\[u\]", "<U>")
text = replacetext(text, "\[/u\]", "</U>")
if(check_rights(R_EVENT))
text = replacetext(text, "\[signfont\]", "<font face=\"[signfont]\"><i>")
text = replacetext(text, "\[/signfont\]", "</i></font>")
if(sign)
text = replacetext(text, "\[sign\]", "<font face=\"[signfont]\"><i>[user ? user.real_name : "Anonymous"]</i></font>")
if(fields)
Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,8 @@ GLOBAL_LIST_INIT(modulo_angle_to_dir, list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,
else
return /datum
return text2path(copytext(string_type, 1, last_slash))

/proc/text2bool(input)
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
if(input == "true")
return TRUE
return FALSE //
1 change: 1 addition & 0 deletions code/_globalvars/game_modes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ GLOBAL_LIST(antag_paradise_weights)
/// Weights for all special antags in ANTAG-PARADISE gamemode.
GLOBAL_LIST(antag_paradise_special_weights)

GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space
1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_ACID_PROTECTED" = TRAIT_ACID_PROTECTED,
"TRAIT_AI_UNTRACKABLE" = TRAIT_AI_UNTRACKABLE,
"TRAIT_BADASS" = TRAIT_BADASS,
"TRAIT_BEING_OFFERED" = TRAIT_BEING_OFFERED,
"TRAIT_BLIND" = TRAIT_BLIND,
"TRAIT_BLOB_ALLY" = TRAIT_BLOB_ALLY,
"TRAIT_BLOODCRAWL" = TRAIT_BLOODCRAWL,
Expand Down
7 changes: 7 additions & 0 deletions code/controllers/globals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
return ..()

/datum/controller/global_vars/can_vv_get(var_name)
var/static/list/protected_vars = list(
"asays", "admin_log", "logging", "open_logging_views"
)

if(!check_rights(R_ADMIN, FALSE, src) && (var_name in protected_vars))
return FALSE

if(gvars_datum_protected_varlist[var_name])
return FALSE
return ..()
Expand Down
8 changes: 8 additions & 0 deletions code/controllers/subsystem/tickets/tickets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -620,5 +620,13 @@ UI STUFF
else
message_staff("<span class='admin_channel'>[usr.client] / ([usr]) снят с тикета [ticket_name] номер [index]</span>", TICKET_STAFF_MESSAGE_ADMIN_CHANNEL)

/datum/controller/subsystem/tickets/can_vv_get(var_name)
var/static/list/protected_vars = list(
"allTickets"
)
if(!check_rights(R_ADMIN, FALSE, src) && (var_name in protected_vars))
return FALSE
return TRUE

#undef TICKET_STAFF_MESSAGE_ADMIN_CHANNEL
#undef TICKET_STAFF_MESSAGE_PREFIX
15 changes: 15 additions & 0 deletions code/datums/datumvars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
/datum/proc/can_vv_get(var_name)
return TRUE

/mob/can_vv_get(var_name)
var/static/list/protected_vars = list(
"lastKnownIP", "computer_id", "attack_log_old"
)
if(!check_rights(R_ADMIN, FALSE, src) && (var_name in protected_vars))
return FALSE
return TRUE

/client/can_vv_get(var_name)
var/static/list/protected_vars = list(
"address", "chatOutput", "computer_id", "connection", "jbh", "pm_tracker", "related_accounts_cid", "related_accounts_ip", "watchlisted"
)
if(!check_rights(R_ADMIN, FALSE, mob) && (var_name in protected_vars))
return FALSE
return TRUE

/// Called when a var is edited with the new value to change to
/datum/proc/vv_edit_var(var_name, var_value)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emote/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
* * user - The user of the emote.
* * text - The text of the emote.
*/
/datum/emote/proc/runechat_emote(mob/user, text)
/proc/runechat_emote(atom/user, text)
var/list/can_see = get_mobs_in_view(1, user) //Allows silicon & mmi mobs carried around to see the emotes of the person carrying them around.
can_see |= viewers(user, null)
for(var/mob/viewer in can_see)
Expand Down
27 changes: 27 additions & 0 deletions code/datums/outfits/outfit_admin.dm
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@
if(special_icon)
I.icon_state = special_icon

/datum/outfit/admin/observer
name = "Observer"

uniform = /obj/item/clothing/under/color/random
back = /obj/item/storage/backpack/satchel
shoes = /obj/item/clothing/shoes/black
box = /obj/item/storage/box/survival
backpack_contents = list(
/obj/item/implanter/dust = 1
)

/datum/outfit/admin/observer/plasmaman
name = "Observer (Plasma)"

uniform = /obj/item/clothing/under/plasmaman
head = /obj/item/clothing/head/helmet/space/plasmaman
mask = /obj/item/clothing/mask/breath
belt = /obj/item/tank/internals/plasmaman/belt/full
box = /obj/item/storage/box/survival_plasmaman

/datum/outfit/admin/observer/vox
name = "Observer (Vox)"

mask = /obj/item/clothing/mask/breath/vox
belt = /obj/item/tank/internals/emergency_oxygen/double/vox
box = /obj/item/storage/box/survival_vox

/datum/outfit/admin/syndicate
name = "Syndicate Agent"

Expand Down
Loading
Loading