| [C.key]"
if(C.holder && C.holder.fakekey)
diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm
index b952a37c53..1856329f47 100644
--- a/code/modules/client/verbs/ooc.dm
+++ b/code/modules/client/verbs/ooc.dm
@@ -51,13 +51,13 @@
if(holder && !holder.fakekey)
ooc_style = "elevated"
- if(holder.rights & R_EVENT) //Retired Admins
+ if(check_rights(R_EVENT)) //Retired Admins
ooc_style = "event_manager"
- if(holder.rights & R_ADMIN && !(holder.rights & R_BAN)) //Game Masters
+ if(check_rights(R_ADMIN) && !(check_rights(R_BAN))) //Game Masters
ooc_style = "moderator"
- if(holder.rights & R_DEBUG && !(holder.rights & R_BAN)) //Developers
+ if(check_rights(R_SERVER) && !(check_rights(R_BAN))) //Developers
ooc_style = "developer"
- if(holder.rights & R_ADMIN && holder.rights & R_BAN) //Admins
+ if(check_rights(R_ADMIN) && check_rights(R_BAN)) //Admins
ooc_style = "admin"
msg = GLOB.is_valid_url.Replace(msg,span_linkify("$1"))
@@ -74,7 +74,7 @@
else
display_name = holder.fakekey
var/pref_color = prefs.read_preference(/datum/preference/color/ooc_color)
- if(holder && !holder.fakekey && (holder.rights & R_ADMIN|R_FUN|R_EVENT) && CONFIG_GET(flag/allow_admin_ooccolor) && pref_color != "#010000") // keeping this for the badmins
+ if(holder && !holder.fakekey && (check_rights(R_ADMIN|R_FUN|R_EVENT)) && CONFIG_GET(flag/allow_admin_ooccolor) && pref_color != "#010000") // keeping this for the badmins
to_chat(target, span_ooc("" + create_text_tag("ooc", "OOC:", target) + " [display_name]: [span_message(msg)]"))
else
to_chat(target, span_ooc("" + create_text_tag("ooc", "OOC:", target) + " [display_name]: " + span_message(msg)) + "")
@@ -163,7 +163,7 @@
// Admins with RLOOC displayed who weren't already in
for(var/client/admin in GLOB.admins)
if(!(admin in receivers) && admin.prefs?.read_preference(/datum/preference/toggle/holder/show_rlooc))
- if(check_rights(R_ADMIN|R_SERVER, FALSE, admin)) //Stop rLOOC showing for retired staff //CHOMPEdit, admins should see LOOC
+ if(check_rights_for(admin, R_ADMIN|R_SERVER)) //Stop rLOOC showing for retired staff //CHOMPEdit, admins should see LOOC
r_receivers |= admin
msg = GLOB.is_valid_url.Replace(msg,span_linkify("$1"))
diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm
index 098d43240a..4ba5054bf2 100644
--- a/code/modules/client/verbs/who.dm
+++ b/code/modules/client/verbs/who.dm
@@ -73,19 +73,19 @@
if(C.holder.fakekey && !check_rights_for(src, R_ADMIN|R_MOD)) // Only admins and mods can see stealthmins
continue
// VOREStation Edit End
- if(check_rights(R_BAN, FALSE, C)) // admins //VOREStation Edit
+ if(check_rights_for(C, R_BAN)) // admins //VOREStation Edit
num_admins_online++
- else if(check_rights(R_ADMIN, FALSE, C) && !check_rights(R_SERVER, FALSE, C)) // mods //VOREStation Edit: Game masters
+ else if(check_rights_for(C, R_ADMIN) && !check_rights_for(C, R_SERVER)) // mods //VOREStation Edit: Game masters
category = R_MOD
num_mods_online++
- else if(check_rights(R_SERVER, FALSE, C)) // developers
+ else if(check_rights_for(C, R_SERVER)) // developers
category = R_SERVER
num_devs_online++
- else if(check_rights(R_STEALTH, FALSE, C)) // event managers //VOREStation Edit: Retired Staff
+ else if(check_rights_for(C, R_STEALTH)) // event managers //VOREStation Edit: Retired Staff
category = R_EVENT
num_event_managers_online++
- temp += "\t[C] is a [C.holder.rank]"
+ temp += "\t[C] is a [C.holder.rank_names()]"
if(holder)
if(C.holder.fakekey)
temp += " " + span_italics("(as [C.holder.fakekey])")
diff --git a/code/modules/mentor/mentor.dm b/code/modules/mentor/mentor.dm
index 0db6a4ca0e..5b6d28c104 100644
--- a/code/modules/mentor/mentor.dm
+++ b/code/modules/mentor/mentor.dm
@@ -55,7 +55,7 @@ var/list/mentor_verbs_default = list(
if(!target)
return
var/client/C = targets[target]
- if(has_mentor_powers(C) || C.deadmin_holder) // If an admin is deadminned you could mentor them and that will cause fuckery if they readmin
+ if(has_mentor_powers(C) || GLOB.deadmins[C.ckey]) // If an admin is deadminned you could mentor them and that will cause fuckery if they readmin
to_chat(src, span_admin_pm_warning("Error: They already have mentor powers."))
return
var/datum/mentor/M = new /datum/mentor(C.ckey)
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 176c847093..4b98167c93 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -148,7 +148,7 @@
visualnet = ghostnet
/mob/observer/dead/proc/checkStatic()
- return !(check_rights(R_ADMIN|R_FUN|R_EVENT|R_SERVER, 0, src) || (client && client.buildmode) || isbelly(loc))
+ return !(check_rights_for(src.client, R_ADMIN|R_FUN|R_EVENT|R_SERVER) || (client && client.buildmode) || isbelly(loc))
/mob/observer/dead/Moved(atom/old_loc, direction, forced)
. = ..()
@@ -260,7 +260,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
announce_ghost_joinleave(ghostize(1))
else
var/response
- if(check_rights(R_ADMIN|R_SERVER|R_MOD,FALSE,src)) //No need to sanity check for client and holder here as that is part of check_rights
+ if(check_rights_for(src.client, R_ADMIN|R_SERVER|R_MOD)) //No need to sanity check for client and holder here as that is part of check_rights
response = tgui_alert(src, "You have the ability to Admin-Ghost. The regular Ghost verb will announce your presence to dead chat. Both variants will allow you to return to your body using 'aghost'.\n\nWhat do you wish to do?", "Are you sure you want to ghost?", list("Admin Ghost", "Ghost", "Stay in body"))
if(response == "Admin Ghost")
if(!src.client)
@@ -613,7 +613,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 0
/mob/observer/dead/check_holy(var/turf/T)
- if(check_rights(R_ADMIN|R_FUN|R_EVENT, 0, src))
+ if(check_rights_for(src.client, R_ADMIN|R_FUN|R_EVENT))
return 0
return (T && T.holy) && (is_manifest || (mind in cult.current_antagonists))
@@ -923,7 +923,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 1
/mob/observer/dead/proc/can_admin_interact()
- return check_rights(R_ADMIN|R_EVENT, 0, src)
+ return check_rights_for(src.client, R_ADMIN|R_EVENT|R_DEBUG)
/mob/observer/dead/verb/toggle_ghostsee()
set name = "Toggle Ghost Vision"
diff --git a/code/modules/mob/living/carbon/alien/diona/progression.dm b/code/modules/mob/living/carbon/alien/diona/progression.dm
index 45a33d4ebb..f701fd1992 100644
--- a/code/modules/mob/living/carbon/alien/diona/progression.dm
+++ b/code/modules/mob/living/carbon/alien/diona/progression.dm
@@ -6,7 +6,7 @@
/mob/living/carbon/alien/diona/confirm_evolution()
- if(!is_alien_whitelisted(src, GLOB.all_species[SPECIES_DIONA]))
+ if(!is_alien_whitelisted(src.client, GLOB.all_species[SPECIES_DIONA]))
tgui_alert(src, "You are currently not whitelisted to play as a full diona.")
return null
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
index fcd6781b63..085f72501b 100644
--- a/code/modules/mob/living/carbon/human/appearance.dm
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -180,14 +180,14 @@
for(var/current_species_name in GLOB.all_species)
var/datum/species/current_species = GLOB.all_species[current_species_name]
- if(check_whitelist && CONFIG_GET(flag/usealienwhitelist) && !check_rights(R_ADMIN|R_EVENT, 0, src)) //If we're using the whitelist, make sure to check it!
+ if(check_whitelist && CONFIG_GET(flag/usealienwhitelist) && !check_rights_for(src.client, R_ADMIN|R_EVENT)) //If we're using the whitelist, make sure to check it!
if(!(current_species.spawn_flags & SPECIES_CAN_JOIN))
continue
if(whitelist.len && !(current_species_name in whitelist))
continue
if(blacklist.len && (current_species_name in blacklist))
continue
- if((current_species.spawn_flags & SPECIES_IS_WHITELISTED) && !is_alien_whitelisted(src, current_species))
+ if((current_species.spawn_flags & SPECIES_IS_WHITELISTED) && !is_alien_whitelisted(src.client, current_species))
continue
valid_species += current_species_name
diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm
index 29d26eefd6..495868918f 100644
--- a/code/modules/mob/login.dm
+++ b/code/modules/mob/login.dm
@@ -87,3 +87,4 @@
client.images += cloaked_selfimage
client.init_verbs()
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)
+ SEND_SIGNAL(client, COMSIG_CLIENT_MOB_LOGIN, src)
diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm
index 45b7ad1999..5dfd925d32 100644
--- a/code/modules/mob/logout.dm
+++ b/code/modules/mob/logout.dm
@@ -5,9 +5,9 @@
update_client_z(null)
log_access_out(src)
unset_machine()
- if(admin_datums[src.ckey])
+ if(GLOB.admin_datums[src.ckey])
message_admins("Staff logout: [key_name(src)]") // CHOMPEdit: Admin logout notice displays no matter what//Edit2: STAFF
- if(ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.
+ if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.
var/admins_number = GLOB.admins.len
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 5dd4c3488a..aede5c9d0a 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -467,7 +467,7 @@
set category = "OOC.Game"
var/is_admin = 0
- if(client.holder && (client.holder.rights & R_ADMIN|R_EVENT))
+ if(check_rights_for(client, R_ADMIN|R_EVENT))
is_admin = 1
else if(stat != DEAD || isnewplayer(src))
to_chat(src, span_filter_notice("[span_blue("You must be observing to use this!")]"))
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 107ecd582f..40b1496dce 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -83,7 +83,7 @@
/proc/is_admin(var/mob/user)
- return check_rights(R_ADMIN|R_EVENT, 0, user) != 0
+ return check_rights_for(user.client, R_ADMIN|R_EVENT) != 0
/**
* Moved into its own file as part of port from CHOMP.
@@ -406,7 +406,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
return // Can't talk in deadchat if you can't see it.
for(var/mob/M in player_list)
- if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
+ if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || (M.client.holder && check_rights_for(M.client, R_NONE) && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
var/follow
var/lname
if(M.forbid_seeing_deadchat && !M.client.holder)
@@ -436,7 +436,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
/proc/say_dead_object(var/message, var/obj/subject = null)
for(var/mob/M in player_list)
- if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
+ if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || (M.client.holder && check_rights_for(M.client, R_NONE) && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
var/follow
var/lname = "Game Master"
if(M.forbid_seeing_deadchat && !M.client.holder)
diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm
index c78a11c9ee..fa5c6f17c7 100644
--- a/code/modules/mob/new_player/new_player.dm
+++ b/code/modules/mob/new_player/new_player.dm
@@ -621,7 +621,7 @@
if(chosen_species && use_species_name)
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
- if(is_alien_whitelisted(chosen_species))
+ if(is_alien_whitelisted(src.client, chosen_species))
new_character = new(T, use_species_name)
if(!new_character)
@@ -697,9 +697,6 @@
src << browse(null, "window=News") //closes news window
panel.close()
-/mob/new_player/proc/has_admin_rights()
- return check_rights(R_ADMIN, 0, src)
-
/mob/new_player/get_species()
var/datum/species/chosen_species
if(client.prefs.species)
@@ -708,7 +705,7 @@
if(!chosen_species)
return SPECIES_HUMAN
- if(is_alien_whitelisted(chosen_species))
+ if(is_alien_whitelisted(src.client, chosen_species))
return chosen_species.name
return SPECIES_HUMAN
diff --git a/code/modules/mob/new_player/new_player_vr.dm b/code/modules/mob/new_player/new_player_vr.dm
index 09dd133ab0..c24b351c62 100644
--- a/code/modules/mob/new_player/new_player_vr.dm
+++ b/code/modules/mob/new_player/new_player_vr.dm
@@ -27,7 +27,7 @@
to_chat(src,span_warning("You have not set your scale yet. Do this on the VORE tab in character setup."))
//Can they play?
- if(!is_alien_whitelisted(src,GLOB.all_species[client?.prefs?.species]) && !check_rights(R_ADMIN, 0))
+ if(!is_alien_whitelisted(src.client,GLOB.all_species[client?.prefs?.species]) && !check_rights(R_ADMIN, 0))
pass = FALSE
to_chat(src,span_warning("You are not allowed to spawn in as this species."))
diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm
index 6e073bc25f..0c8c11a5a2 100644
--- a/code/modules/mob/new_player/poll.dm
+++ b/code/modules/mob/new_player/poll.dm
@@ -398,7 +398,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
- adminrank = usr.client.holder.rank
+ adminrank = usr.client.holder.rank_names()
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]')")
@@ -448,7 +448,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
- adminrank = usr.client.holder.rank
+ adminrank = usr.client.holder.rank_names()
replytext = replacetext(replytext, "%BR%", "")
@@ -520,7 +520,7 @@
var/adminrank = "Player"
if(usr && usr.client && usr.client.holder)
- adminrank = usr.client.holder.rank
+ adminrank = usr.client.holder.rank_names()
var/datum/db_query/insert_query = SSdbcore.NewQuery("INSERT INTO erro_poll_vote (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[usr.ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm
index 334ecfd8d8..9e9e56156f 100644
--- a/code/modules/modular_computers/computers/modular_computer/interaction.dm
+++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm
@@ -100,7 +100,7 @@
/obj/item/modular_computer/attack_ghost(var/mob/observer/dead/user)
if(enabled)
tgui_interact(user)
- else if(check_rights(R_ADMIN|R_EVENT, 0, user))
+ else if(check_rights_for(user.client, R_ADMIN|R_EVENT|R_DEBUG))
var/response = tgui_alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", list("Yes", "No"))
if(response == "Yes")
turn_on(user)
diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm
index 9d0edc3991..9619d2728d 100644
--- a/code/modules/modular_computers/file_system/program.dm
+++ b/code/modules/modular_computers/file_system/program.dm
@@ -109,7 +109,7 @@
return 1
// Admin override - allows operation of any computer as aghosted admin, as if you had any required access.
- if(isobserver(user) && check_rights(R_ADMIN|R_EVENT, 0, user))
+ if(isobserver(user) && check_rights_for(user.client, R_ADMIN|R_EVENT|R_DEBUG))
return 1
if(!istype(user))
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index 2b11acdf5c..683a073abf 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -425,7 +425,7 @@ Extracted to its own procedure for easier logic handling with paper bundles.
msg = span_notice(msg)
for(var/client/C in GLOB.admins)
- if(check_rights((R_ADMIN|R_MOD|R_EVENT),0,C))
+ if(check_rights_for(C, (R_ADMIN|R_MOD|R_EVENT)))
to_chat(C,msg)
C << 'sound/machines/printer.ogg'
sender.client << 'sound/machines/printer.ogg' //CHOMPEdit - The pain must be felt
diff --git a/code/modules/resleeving/autoresleever.dm b/code/modules/resleeving/autoresleever.dm
index f23b84c9fd..d7be416618 100644
--- a/code/modules/resleeving/autoresleever.dm
+++ b/code/modules/resleeving/autoresleever.dm
@@ -75,7 +75,7 @@
var/client/ghost_client = ghost.client
- if(!is_alien_whitelisted(ghost, GLOB.all_species[ghost_client?.prefs?.species]) && !check_rights(R_ADMIN, 0)) // Prevents a ghost ghosting in on a slot and spawning via a resleever with race they're not whitelisted for, getting around normal join restrictions.
+ if(!is_alien_whitelisted(ghost.client, GLOB.all_species[ghost_client?.prefs?.species]) && !check_rights(R_ADMIN, 0)) // Prevents a ghost ghosting in on a slot and spawning via a resleever with race they're not whitelisted for, getting around normal join restrictions.
to_chat(ghost, span_warning("You are not whitelisted to spawn as this species!"))
return
diff --git a/code/modules/tgs/v5/chat_commands.dm b/code/modules/tgs/v5/chat_commands.dm
index 697235ae53..b0769257a4 100644
--- a/code/modules/tgs/v5/chat_commands.dm
+++ b/code/modules/tgs/v5/chat_commands.dm
@@ -63,13 +63,13 @@
else
keymsg += " (Ingame)"
- if(R_ADMIN & C.holder.rights && R_BAN & C.holder.rights) // R_ADMIN and R_BAN apparently an admin makes
+ if(check_rights_for(C, R_ADMIN) && check_rights_for(C, R_BAN)) // R_ADMIN and R_BAN apparently an admin makes
admin_keys += keymsg
- else if(R_ADMIN & C.holder.rights && !(R_SERVER & C.holder.rights)) // R_ADMIN but not R_SERVER makes a moderator
+ else if(check_rights_for(C, R_ADMIN) && !(check_rights_for(C, R_SERVER))) // R_ADMIN but not R_SERVER makes a moderator
mod_keys += keymsg
- else if(R_SERVER & C.holder.rights) // R_SERVER makes a dev
+ else if(check_rights_for(C, R_SERVER)) // R_SERVER makes a dev
dev_keys += keymsg
else // No R_ADMIN&&R_BAN, R_ADMIN!R_BAN, R_SERVER, must be a GM or something
diff --git a/code/modules/tgui/modules/admin/player_notes.dm b/code/modules/tgui/modules/admin/player_notes.dm
index 5730eb56d6..ebc69925c4 100644
--- a/code/modules/tgui/modules/admin/player_notes.dm
+++ b/code/modules/tgui/modules/admin/player_notes.dm
@@ -48,7 +48,7 @@
current_filter = filter
/datum/tgui_module/player_notes/proc/open_legacy()
- var/datum/admins/A = admin_datums[usr.ckey]
+ var/datum/admins/A = GLOB.admin_datums[usr.ckey]
A.PlayerNotesLegacy()
/datum/tgui_module/player_notes/tgui_state(mob/user)
@@ -113,7 +113,7 @@
if(..())
return TRUE
- var/datum/admins/A = admin_datums[usr.ckey]
+ var/datum/admins/A = GLOB.admin_datums[usr.ckey]
A.show_player_info_legacy(key)
/datum/tgui_module/player_notes_info/tgui_act(action, params, datum/tgui/ui)
diff --git a/code/modules/tgui/modules/late_choices.dm b/code/modules/tgui/modules/late_choices.dm
index e693f0c4f4..67df7c3b4a 100644
--- a/code/modules/tgui/modules/late_choices.dm
+++ b/code/modules/tgui/modules/late_choices.dm
@@ -131,7 +131,7 @@
return
var/datum/species/S = GLOB.all_species[new_user.client.prefs.species]
- if(!is_alien_whitelisted(new_user, S))
+ if(!is_alien_whitelisted(new_user.client, S))
tgui_alert(new_user, "You are currently not whitelisted to play [new_user.client.prefs.species].")
return 0
diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm
index ab80a41bd5..28c217326b 100644
--- a/code/modules/tgui/states.dm
+++ b/code/modules/tgui/states.dm
@@ -24,7 +24,7 @@
if(isobserver(user))
// Admins can always interact.
- if(check_rights(R_ADMIN|R_EVENT, 0, src))
+ if(check_rights_for(user.client, R_ADMIN|R_EVENT|R_DEBUG))
. = max(., STATUS_INTERACTIVE)
// Regular ghosts can always at least view if in range.
diff --git a/code/modules/tgui/states/admin.dm b/code/modules/tgui/states/admin.dm
index bfa877bc09..28c395f078 100644
--- a/code/modules/tgui/states/admin.dm
+++ b/code/modules/tgui/states/admin.dm
@@ -12,6 +12,6 @@
GLOBAL_DATUM_INIT(tgui_admin_state, /datum/tgui_state/admin_state, new)
/datum/tgui_state/admin_state/can_use_topic(src_object, mob/user)
- if(check_rights_for(user.client, R_ADMIN|R_EVENT))
+ if(check_rights_for(user.client, R_ADMIN|R_EVENT|R_DEBUG))
return STATUS_INTERACTIVE
return STATUS_CLOSE
diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm
index 2fe058f3e0..5b16728e25 100644
--- a/code/modules/tgui/states/default.dm
+++ b/code/modules/tgui/states/default.dm
@@ -79,6 +79,6 @@ GLOBAL_DATUM_INIT(tgui_default_state, /datum/tgui_state/default, new)
return ..()
/mob/observer/dead/default_can_use_tgui_topic()
- if(check_rights(R_ADMIN|R_EVENT, 0, src))
+ if(check_rights_for(src.client, R_ADMIN|R_EVENT|R_DEBUG))
return STATUS_INTERACTIVE // Admins are more equal
return STATUS_UPDATE // Ghosts can view updates
diff --git a/code/modules/tgui/states/observer.dm b/code/modules/tgui/states/observer.dm
index f20bb1b71f..79e6f51b6b 100644
--- a/code/modules/tgui/states/observer.dm
+++ b/code/modules/tgui/states/observer.dm
@@ -14,6 +14,6 @@ GLOBAL_DATUM_INIT(tgui_observer_state, /datum/tgui_state/observer_state, new)
/datum/tgui_state/observer_state/can_use_topic(src_object, mob/user)
if(isobserver(user))
return STATUS_INTERACTIVE
- if(check_rights(R_ADMIN|R_EVENT, 0, src))
+ if(check_rights_for(user.client, R_ADMIN|R_EVENT))
return STATUS_INTERACTIVE
return STATUS_CLOSE
diff --git a/code/modules/vote/vote_datum.dm b/code/modules/vote/vote_datum.dm
index ebdaf6e596..61cf7156f4 100644
--- a/code/modules/vote/vote_datum.dm
+++ b/code/modules/vote/vote_datum.dm
@@ -169,7 +169,7 @@
data["question"] = question
data["choices"] = choices
- if(show_counts || check_rights(R_ADMIN, FALSE, user))
+ if(show_counts || check_rights_for(user.client, R_ADMIN))
data["show_counts"] = TRUE
var/list/counts = list()
diff --git a/code/modules/whitelist/whitelist.dm b/code/modules/whitelist/whitelist.dm
index 1352c5b976..772872eb3e 100644
--- a/code/modules/whitelist/whitelist.dm
+++ b/code/modules/whitelist/whitelist.dm
@@ -97,4 +97,4 @@
/proc/whitelist_overrides(mob/M)
- return !CONFIG_GET(flag/usealienwhitelist) || check_rights(R_ADMIN|R_EVENT, 0, M) // CHOMPEdit
+ return !CONFIG_GET(flag/usealienwhitelist) || check_rights_for(M.client, R_ADMIN|R_EVENT) // CHOMPEdit
diff --git a/config/example/admin_ranks.txt b/config/example/admin_ranks.txt
index 817da0b541..5255f7b3f6 100644
--- a/config/example/admin_ranks.txt
+++ b/config/example/admin_ranks.txt
@@ -1,46 +1,89 @@
-########################################################################################
-# ADMIN RANK DEFINES #
-# The format of this is very simple. Rank name goes first. #
-# Rank is CASE-SENSITIVE, all punctuation will be stripped so spaces don't matter. #
-# Each rank is then followed by keywords with the prefix "+". #
-# These keywords represent groups of verbs and abilities which are given to that rank. #
-# +@ (or +prev) is a special shorthand which adds all the rights of the rank above it. #
-# Ranks with no keywords will just be given the most basic verbs and abilities ~Carn #
-########################################################################################
-# PLEASE NOTE: depending on config options, some abilities will be unavailable regardless if you have permission to use them!
-# ALSO NOTE: this is a WorkInProgress at the moment. Most of this is just arbitrarily thrown in whatever group because LoadsaWork2Do+LittleTime.
-# I'll be doing more moving around as feedback comes in. So be sure to check the notes after updates.
+#Admin Rank format is as follows:
+#
+#Name = Game Admin
+#Include = @ ADMIN BAN SOUND
+#Exclude = FUN
+#Edit =
+#
+#Name will match anything after '=' and must be identical to an admin's rank in admins.txt to be linked but otherwise has no formatting restrictions.
+#A rank's permissions are defined with keywords that control access to groups of verbs and abilities, they are case-sensitive and separated by a space with no prefix.
+#To define no permissions for a type, leave it empty.
+#There are three types of permissions:
+#Include will give a keyword to a rank.
+#Exclude removes a keyword and takes precedence over Include.
+#Edit will allow an admin to edit these permissions on other ranks or change an admin's rank to another if they can edit all the permissions it has.
+#Edit is only used when SQL-based admin loading is enabled.
+#If SQL-based admin loading is enabled, ranks and their keywords listed here will be loaded first and override any with the same name loaded from the database.
+#
+#The following are valid permission keywords:
+#ADMIN = general admin tools, verbs etc.
+#FUN = events, other event-orientated actions. Access to the fun secrets in the secrets panel.
+#BAN = the ability to ban and unban.
+#STEALTH = the ability to stealthmin (make yourself appear with a fake name to everyone but other admins).
+#POSSESS = the ability to possess objects.
+#REJUVINATE = the ability to heal, respawn, modify damage and use godmode
+#BUILDMODE = the ability to use buildmode.
+#SERVER = the ability to restart the server, change the game mode or force a round to start/end.
+#DEBUG = debug tools used for diagnosing and fixing problems. It's useful to give this to coders so they can investigate problems on a live server.
+#VAREDIT = everyone may view viewvars/debugvars/whatever you call it. This keyword allows you to actually EDIT those variables.
+#PERMISSIONS = allows you to promote and/or demote people.
+#SOUNDS = allows you to upload and play SOUND.
+#SPAWN = mob transformations, spawning of most atoms including mobs (high-risk atoms, e.g. blackholes, will require the +FUN flag too).
+#EVENT = a group of verbs that make it possible to run an event, or other badminnery.
+#EVERYTHING = Simply gives you everything without having to type every flag.
+#@ = special keyword for the current permission type that adds all the keywords that the preceding rank has of the same type.
-# KEYWORDS:
-# +ADMIN = general admin tools, verbs etc
-# +FUN = events, other event-orientated actions. Access to the fun secrets in the secrets panel.
-# +BAN = the ability to ban, jobban and fullban
-# +STEALTH = the ability to stealthmin (make yourself appear with a fake name to everyone but other admins
-# +POSSESS = the ability to possess objects
-# +REJUV (or +REJUVINATE) = the ability to heal, respawn, modify damage and use godmode
-# +BUILD (or +BUILDMODE) = the ability to use buildmode
-# +SERVER = higher-risk admin verbs and abilities, such as those which affect the server configuration.
-# +DEBUG = debug tools used for diagnosing and fixing problems. It's useful to give this to coders so they can investigate problems on a live server.
-# +VAREDIT = everyone may view viewvars/debugvars/whatever you call it. This keyword allows you to actually EDIT those variables.
-# +RIGHTS (or +PERMISSIONS) = allows you to promote and/or demote people.
-# +SOUND (or +SOUNDS) = allows you to upload and play sounds
-# +SPAWN (or +CREATE) = mob transformations, spawning of most atoms including mobs (high-risk atoms, e.g. blackholes, will require the +FUN flag too)
-# +EVENT = a group of verbs that make it possible to run an event, or other badminnery.
-# +EVERYTHING (or +HOST or +ALL) = Simply gives you everything without having to type every flag
+Name = Admin Observer
+Include =
+Exclude =
+Edit =
-Admin Observer
-Moderator +MOD
-Mentor +MENTOR
+Name = Moderator
+Include = MOD
+Exclude =
+Edit =
-Admin Candidate +ADMIN
-Trial Admin +@ +STEALTH +SPAWN +REJUV +VAREDIT +BAN +FUN
-Admin +@ +POSSESS +BUILDMODE +SERVER
-Admin Supervisor +@ +SOUNDS +DEBUG +PERMISSIONS
-Game Master +ADMIN +FUN +POSSESS +REJUV +BUILD +SERVER +DEBUG +VAREDIT +SOUND +SPAWN
-Head Admin +EVERYTHING
-Retired Admin +ADMIN +STEALTH
+Name = Admin Candidate
+Include = ADMIN
+Exclude =
+Edit =
-Host +EVERYTHING
+Name = Trial Admin
+Include = @ SPAWN REJUVINATE VAREDIT BAN
+Exclude =
+Edit =
-Developer +DEBUG +VAREDIT +SERVER +SPAWN +REJUV +POSSESS +BUILDMODE
-Dev Mod +@ +MOD
+Name = Badmin
+Include = @ POSSESS BUILDMODE SERVER FUN
+Exclude =
+Edit =
+
+Name = Game Admin
+Include = @ STEALTH SOUNDS DEBUG PERMISSIONS
+Exclude =
+Edit =
+
+Name = Game Master
+Include = EVERYTHING
+Exclude =
+Edit = EVERYTHING
+
+Name = Head Admin
+Include = EVERYTHING
+Exclude =
+Edit = EVERYTHING
+
+Name = Retired Admin
+Include = ADMIN STEALTH
+Exclude =
+Edit =
+
+Name = Host
+Include = EVERYTHING
+Exclude =
+Edit = EVERYTHING
+
+Name = Developer
+Include = DEBUG VAREDIT SERVER SPAWN REJUVINATE POSSESS BUILDMODE
+Exclude =
+Edit =
diff --git a/config/example/admins.txt b/config/example/admins.txt
index 810fc79320..84f7aa36e6 100644
--- a/config/example/admins.txt
+++ b/config/example/admins.txt
@@ -1,8 +1,11 @@
-######################################################################
-# Basically, ckey goes first. Rank goes after the "-" #
-# Case is not important for ckey. #
-# Case IS important for the rank. However punctuation/spaces are not #
-# Ranks can be anything defined in admin_ranks.txt ~Carn #
-######################################################################
+###############################################################################################
+# Basically, ckey goes first. Rank goes after the "=" #
+# Case is not important for ckey. #
+# Case IS important for the rank. #
+# All punctuation (spaces etc) EXCEPT '-', '_' and '@' will be stripped from rank names. #
+# Ranks can be anything defined in admin_ranks.txt #
+# NOTE: if the rank-name cannot be found in admin_ranks.txt, they will not be adminned! ~Carn #
+# NOTE: syntax was changed to allow hyphenation of ranknames, since spaces are stripped. #
+###############################################################################################
-# not_a_user - Admin
\ No newline at end of file
+# not_a_user = Admin
diff --git a/config/example/config.txt b/config/example/config.txt
index 7e3e0a87b7..624730ff4c 100644
--- a/config/example/config.txt
+++ b/config/example/config.txt
@@ -17,9 +17,21 @@ $include sqlite.txt
## Server name: This appears at the top of the screen in-game. In this case it will read "tgstation: station_name" where station_name is the randomly generated name of the station for the round. Remove the # infront of SERVERNAME and replace 'tgstation' with the name of your choice
# SERVERNAME spacestation13
-## Add a # infront of this if you want to use the SQL based admin system, the legacy system uses admins.txt. You need to set up your database to use the SQL based system.
+## Comment this out if you want to use the SQL based admin system, the legacy system uses admins.txt.
+## You need to set up your database to use the SQL based system.
+## This flag is automatically enabled if SQL_ENABLED isn't
ADMIN_LEGACY_SYSTEM
+##Uncomment this to stop any admins loaded by the legacy system from having their rank edited by the permissions panel
+#PROTECT_LEGACY_ADMINS
+
+##Uncomment this to stop any ranks loaded by the legacy system from having their flags edited by the permissions panel
+#PROTECT_LEGACY_RANKS
+
+##Uncomment this to have admin ranks only loaded from the legacy admin_ranks.txt
+##If enabled, each time admins are loaded ranks the database will be updated with the current ranks and their flags
+#LOAD_LEGACY_RANKS_ONLY
+
## Add a # infront of this if you want to use the SQL based banning system. The legacy systems use the files in the data folder. You need to set up your database to use the SQL based system.
BAN_LEGACY_SYSTEM
@@ -596,3 +608,6 @@ JUKEBOX_TRACK_FILES config/jukebox.json
# The endpoint for the chat to fetch the chatlogs from (for example, the last 2500 messages on init for the history)
# REQUIRES chatlog_database_backend to be enabled
#CHATLOG_DATABASE_API_ENDPOINT https://example.com
+
+## Uncomment to block granting profiling privileges to users with R_DEBUG, for performance purposes
+#FORBID_ADMIN_PROFILING
diff --git a/html/panels.css b/html/admin/panels.css
similarity index 79%
rename from html/panels.css
rename to html/admin/panels.css
index ac44cf5487..22373ee0ca 100644
--- a/html/panels.css
+++ b/html/admin/panels.css
@@ -1,10 +1,10 @@
body {padding:0px;margin:0px;}
#top {position:fixed;top:5px;left:10%;width:80%;text-align:center;background-color:#fff;border:2px solid #ccc;}
-#main {position:relative;top:50px;left:3%;width:96%;text-align:center;z-index:0;}
+#main {position:relative;top:10px;left:3%;width:96%;text-align:center;z-index:0;}
#searchable {table-layout:fixed;width:100%;text-align:center;"#f4f4f4";}
tr.norm {background-color:#f4f4f4;}
tr.title {background-color:#ccc;}
tr.alt {background-color:#e7e7e7;}
.small {font-size:80%;}
-a {text-decoration:none;color:#a0a;}
+a {text-decoration:none;}
a:hover {color:#d3d;}
diff --git a/html/search.js b/html/admin/search.js
similarity index 91%
rename from html/search.js
rename to html/admin/search.js
index ded0b92844..639a3729fe 100644
--- a/html/search.js
+++ b/html/admin/search.js
@@ -23,11 +23,11 @@ function updateSearch(){
}
if(found == 0) row.style.display='none';
else{
- row.style.display='block';
+ row.style.display='table-row'; /* DON'T make tables with block property */
row.className = alt_style;
if(alt_style == 'alt') alt_style = 'norm';
else alt_style = 'alt';
}
}catch(err) { }
}
-}
\ No newline at end of file
+}
diff --git a/icons/ui/common/padlock.png b/icons/ui/common/padlock.png
new file mode 100644
index 0000000000..719a12e9c9
Binary files /dev/null and b/icons/ui/common/padlock.png differ
diff --git a/modular_chomp/code/modules/tickets/tickets.dm b/modular_chomp/code/modules/tickets/tickets.dm
index 55793a87f2..477158af60 100644
--- a/modular_chomp/code/modules/tickets/tickets.dm
+++ b/modular_chomp/code/modules/tickets/tickets.dm
@@ -701,7 +701,7 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
. = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list())
for(var/client/X in GLOB.admins)
.["total"] += X
- if(requiredflags != 0 && !check_rights(rights_required = requiredflags, show_msg = FALSE, C = X))
+ if(requiredflags != 0 && !check_rights(X, requiredflags))
.["noflags"] += X
else if(X.is_afk())
.["afk"] += X
diff --git a/tools/admin_rank_bitflag_calculator.py b/tools/admin_rank_bitflag_calculator.py
new file mode 100644
index 0000000000..758031cfd0
--- /dev/null
+++ b/tools/admin_rank_bitflag_calculator.py
@@ -0,0 +1,66 @@
+import tkinter as tk
+from tkinter import ttk
+
+bitflags = {
+ "R_BUILDMODE": 1<<0,
+ "R_ADMIN": 1<<1,
+ "R_BAN": 1<<2,
+ "R_FUN": 1<<3,
+ "R_SERVER": 1<<4,
+ "R_DEBUG": 1<<5,
+ "R_POSSESS": 1<<6,
+ "R_PERMISSIONS": 1<<7,
+ "R_STEALTH": 1<<8,
+ "R_REJUVINATE": 1<<9,
+ "R_VAREDIT": 1<<10,
+ "R_SOUNDS": 1<<11,
+ "R_SPAWN": 1<<12,
+ "R_MOD": 1<<13,
+ "R_EVENT": 1<<14,
+ "R_HOST": 1<<15,
+ "-------------": 0,
+ "EVERYTHING": (1<<16)-1
+}
+
+class BitflagCalculator:
+ def __init__(self, master):
+ self.master = master
+ master.title("Bitflag Calculator")
+ master.geometry("300x625")
+
+ self.checkboxes = {}
+ self.vars = {}
+
+ for i, (flag, value) in enumerate(bitflags.items()):
+ var = tk.IntVar()
+ cb = ttk.Checkbutton(master, text=flag, variable=var, command=self.update_result)
+ cb.grid(row=i, column=0, sticky="w", padx=10, pady=2)
+ self.checkboxes[flag] = cb
+ self.vars[flag] = var
+
+ self.result_label = ttk.Label(master, text="Result: 0")
+ self.result_label.grid(row=len(bitflags), column=0, pady=10)
+
+ self.copy_button = ttk.Button(master, text="Copy Result", command=self.copy_result)
+ self.copy_button.grid(row=len(bitflags)+1, column=0, pady=5)
+
+ self.clear_button = ttk.Button(master, text="Clear All", command=self.clear_all)
+ self.clear_button.grid(row=len(bitflags)+2, column=0, pady=5)
+
+ def update_result(self):
+ result = sum(value for flag, value in bitflags.items() if self.vars[flag].get())
+ self.result_label.config(text=f"Result: {result}")
+
+ def copy_result(self):
+ result = sum(value for flag, value in bitflags.items() if self.vars[flag].get())
+ self.master.clipboard_clear()
+ self.master.clipboard_append(str(result))
+
+ def clear_all(self):
+ for var in self.vars.values():
+ var.set(0)
+ self.update_result()
+
+root = tk.Tk()
+calculator = BitflagCalculator(root)
+root.mainloop()
diff --git a/vorestation.dme b/vorestation.dme
index 6c34d77289..801faf0cb9 100644
--- a/vorestation.dme
+++ b/vorestation.dme
@@ -21,6 +21,7 @@
#include "code\names.dm"
#include "code\world.dm"
#include "code\__defines\__globals.dm"
+#include "code\__defines\_bitfields.dm"
#include "code\__defines\_click.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\_fruits.dm"
@@ -35,6 +36,7 @@
#include "code\__defines\action.dm"
#include "code\__defines\admin.dm"
#include "code\__defines\admin_ch.dm"
+#include "code\__defines\admin_verb.dm"
#include "code\__defines\admin_vr.dm"
#include "code\__defines\airlock_control.dm"
#include "code\__defines\ammunition.dm"
@@ -185,6 +187,7 @@
#include "code\__defines\dcs\helpers.dm"
#include "code\__defines\dcs\signals.dm"
#include "code\__defines\dcs\signals_ch.dm"
+#include "code\__defines\dcs\signals\signals_client.dm"
#include "code\__defines\dcs\signals\signals_subsystem.dm"
#include "code\__defines\dcs\signals\signals_mobs\signals_mob_main.dm"
#include "code\__defines\dcs\signals\signals_turf.dm"
@@ -210,6 +213,7 @@
#include "code\_helpers\_global_objects.dm"
#include "code\_helpers\_global_objects_vr.dm"
#include "code\_helpers\_lists.dm"
+#include "code\_helpers\admin.dm"
#include "code\_helpers\announcements.dm"
#include "code\_helpers\atmospherics.dm"
#include "code\_helpers\atom_movables.dm"
@@ -1966,8 +1970,6 @@
#include "code\modules\admin\admin_tools.dm"
#include "code\modules\admin\admin_verb_lists_vr.dm"
#include "code\modules\admin\admin_verbs.dm"
-#include "code\modules\admin\admin_verbs_vr.dm"
-#include "code\modules\admin\admin_vr.dm"
#include "code\modules\admin\banjob.dm"
#include "code\modules\admin\ckey_vr.dm"
#include "code\modules\admin\create_mob.dm"
@@ -1980,6 +1982,7 @@
#include "code\modules\admin\modify_robot.dm"
#include "code\modules\admin\NewBan.dm"
#include "code\modules\admin\news.dm"
+#include "code\modules\admin\permissionedit.dm"
#include "code\modules\admin\persistence.dm"
#include "code\modules\admin\player_effects.dm"
#include "code\modules\admin\player_notes.dm"
@@ -1988,7 +1991,6 @@
#include "code\modules\admin\ToRban.dm"
#include "code\modules\admin\callproc\callproc.dm"
#include "code\modules\admin\DB ban\functions.dm"
-#include "code\modules\admin\permissionverbs\permissionedit.dm"
#include "code\modules\admin\secrets\admin_secrets\admin_logs.dm"
#include "code\modules\admin\secrets\admin_secrets\alter_narsie.dm"
#include "code\modules\admin\secrets\admin_secrets\bombing_list.dm"
@@ -2026,6 +2028,7 @@
#include "code\modules\admin\secrets\random_events\gravity.dm"
#include "code\modules\admin\secrets\random_events\trigger_cordical_borer_infestation.dm"
#include "code\modules\admin\secrets\random_events\trigger_xenomorph_infestation.dm"
+#include "code\modules\admin\verb_datums\_admin_verb_datum.dm"
#include "code\modules\admin\verbs\admin_ch.dm"
#include "code\modules\admin\verbs\adminjump.dm"
#include "code\modules\admin\verbs\adminpm.dm"
@@ -2061,6 +2064,7 @@
#include "code\modules\admin\verbs\randomverbs_vr.dm"
#include "code\modules\admin\verbs\resize.dm"
#include "code\modules\admin\verbs\smite.dm"
+#include "code\modules\admin\verbs\special_verbs.dm"
#include "code\modules\admin\verbs\striketeam.dm"
#include "code\modules\admin\verbs\tripAI.dm"
#include "code\modules\admin\verbs\SDQL2\SDQL_2.dm"
@@ -2124,10 +2128,12 @@
#include "code\modules\asset_cache\assets\browser.dm"
#include "code\modules\asset_cache\assets\circuits.dm"
#include "code\modules\asset_cache\assets\cloning.dm"
+#include "code\modules\asset_cache\assets\common.dm"
#include "code\modules\asset_cache\assets\fontawesome.dm"
#include "code\modules\asset_cache\assets\icon_ref_map.dm"
#include "code\modules\asset_cache\assets\jquery.dm"
#include "code\modules\asset_cache\assets\ntos.dm"
+#include "code\modules\asset_cache\assets\permissions.dm"
#include "code\modules\asset_cache\assets\preferences.dm"
#include "code\modules\asset_cache\assets\tgfont.dm"
#include "code\modules\asset_cache\assets\tgui.dm"
|