rework access field access

This commit is contained in:
Kashargul
2024-09-11 20:59:57 +02:00
parent 115276e90d
commit dc8c545f65
20 changed files with 39 additions and 40 deletions
+3 -3
View File
@@ -59,7 +59,7 @@
if(!istype(id_card))
return ..()
if(!scan && (access_change_ids in id_card.access) && (user.unEquip(id_card) || (id_card.loc == user && istype(user,/mob/living/silicon/robot)))) //Grippers. Again. ~Mechoid
if(!scan && (access_change_ids in id_card.GetAccess()) && (user.unEquip(id_card) || (id_card.loc == user && istype(user,/mob/living/silicon/robot)))) //Grippers. Again. ~Mechoid
user.drop_item()
id_card.forceMove(src)
scan = id_card
@@ -129,7 +129,7 @@
all_centcom_access.Add(list(list(
"desc" = replacetext(get_centcom_access_desc(access), " ", " "),
"ref" = access,
"allowed" = (access in modify.access) ? 1 : 0)))
"allowed" = (access in modify.GetAccess()) ? 1 : 0)))
else if(modify)
for(var/i in ACCESS_REGION_SECURITY to ACCESS_REGION_SUPPLY)
var/list/accesses = list()
@@ -138,7 +138,7 @@
accesses.Add(list(list(
"desc" = replacetext(get_access_desc(access), " ", " "),
"ref" = access,
"allowed" = (access in modify.access) ? 1 : 0)))
"allowed" = (access in modify.GetAccess()) ? 1 : 0)))
regions.Add(list(list(
"name" = get_region_accesses_name(i),
+4 -4
View File
@@ -165,9 +165,9 @@
var/list/area_list = list()
data["access"] = null
if(giver && giver.access)
data["access"] = giver.access
for (var/A in giver.access)
if(giver && giver.GetAccess())
data["access"] = giver.GetAccess()
for (var/A in giver.GetAccess())
if(A in accesses)
area_list.Add(list(list("area" = A, "area_name" = get_access_desc(A), "on" = 1)))
else
@@ -212,7 +212,7 @@
if(A in accesses)
accesses.Remove(A)
else
if(A in giver.access) //Let's make sure the ID card actually has the access.
if(A in giver.GetAccess()) //Let's make sure the ID card actually has the access.
accesses.Add(A)
else
to_chat(usr, "<span class='warning'>Invalid selection, please consult technical support if there are any issues.</span>")
@@ -123,7 +123,7 @@
for(var/i = 1; i <= 7; i++)
accesses += "<td style='width:14%' valign='top'>"
for(var/A in get_region_accesses(i))
if(A in writer.access)
if(A in writer.GetAccess())
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", "&nbsp")]</font>") + " "
else
accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", "&nbsp")) + " "
@@ -189,7 +189,7 @@
// These are here partly in order to be overwritten by the centcom card computer code
/datum/file/program/card_comp/proc/authenticate()
if(access_change_ids in reader.access)
if(access_change_ids in reader.GetAccess())
return 1
if(istype(usr,/mob/living/silicon/ai))
return 1
@@ -335,13 +335,13 @@
/datum/file/program/card_comp/centcom/accessblock()
var/accesses = "<h5>[using_map.boss_name]:</h5>"
for(var/A in get_all_centcom_access())
if(A in writer.access)
if(A in writer.GetAccess())
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", "&nbsp")]</font>") + " "
else
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", "&nbsp")) + " "
return accesses
/datum/file/program/card_comp/centcom/authenticate()
if(access_cent_captain in reader.access)
if(access_cent_captain in reader.GetAccess())
return 1
return 0
@@ -131,7 +131,7 @@
id = R.idcard
// Nothing
if(!id || !id.access)
if(!id || !id.GetAccess())
return list()
// Has engineer access, can put any access
+4 -4
View File
@@ -2137,15 +2137,15 @@
if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
if(!istype(I) || !I.access) //not ID or no access
if(!istype(I) || !I.GetAccess()) //not ID or no access
return 0
if(access_list==src.operation_req_access)
for(var/req in access_list)
if(!(req in I.access)) //doesn't have this access
if(!(req in I.GetAccess())) //doesn't have this access
return 0
else if(access_list==src.internals_req_access)
for(var/req in access_list)
if(req in I.access)
if(req in I.GetAccess())
return 1
return 1
@@ -2379,7 +2379,7 @@
for(var/a in operation_req_access)
output += "[get_access_desc(a)] - <a href='?src=\ref[src];del_req_access=[a];user=\ref[user];id_card=\ref[id_card]'>Delete</a><br>"
output += "<hr><h1>Following keycodes were detected on portable device:</h1>"
for(var/a in id_card.access)
for(var/a in id_card.GetAccess())
if(a in operation_req_access) continue
var/a_name = get_access_desc(a)
if(!a_name) continue //there's some strange access without a name
@@ -39,7 +39,7 @@
/obj/item/device/holowarrant/attackby(obj/item/weapon/W, mob/user)
if(active)
var/obj/item/weapon/card/id/I = W.GetIdCard()
if(access_hos in I.access) // VOREStation edit
if(access_hos in I.GetAccess()) // VOREStation edit
var/choice = tgui_alert(user, "Would you like to authorize this warrant?","Warrant authorization",list("Yes","No"))
if(choice == "Yes")
active.fields["auth"] = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
@@ -355,7 +355,7 @@
/obj/item/weapon/card/id/event/attackby(obj/item/I as obj, var/mob/user)
if(istype(I, /obj/item/weapon/card/id) && !accessset)
var/obj/item/weapon/card/id/O = I
access |= O.access
access |= O.GetAccess()
desc = I.desc
rank = O.rank
to_chat(user, "<span class='notice'>You copy the access from \the [I] to \the [src].</span>")
@@ -29,7 +29,7 @@
if(!proximity) return
if(istype(O, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = O
src.access |= I.access
src.access |= I.GetAccess()
if(player_is_antag(user.mind) || registered_user == user)
to_chat(user, "<span class='notice'>The microscanner activates as you pass it over the ID, copying its access.</span>")
+4 -4
View File
@@ -345,9 +345,9 @@
continue
target.module_reset(FALSE)
if(MODIFIY_ROBOT_TOGGLE_STATION_ACCESS)
if(target?.idcard?.access)
if(target?.idcard?.GetAccess())
var/obj/item/weapon/card/id/synthetic/card = target.idcard
if(access_synth in card.access)
if(access_synth in card.GetAccess())
card.access -= get_all_station_access()
card.access -= access_synth
to_chat(usr, "<span class='danger'>You revoke station access from [target].</span>")
@@ -356,9 +356,9 @@
card.access |= access_synth
to_chat(usr, "<span class='danger'>You grant station access to [target].</span>")
if(MODIFIY_ROBOT_TOGGLE_CENT_ACCESS)
if(target?.idcard?.access)
if(target?.idcard?.GetAccess())
var/obj/item/weapon/card/id/synthetic/card = target.idcard
if(access_cent_specops in card.access)
if(access_cent_specops in card.GetAccess())
card.access -= get_all_centcom_access()
to_chat(usr, "<span class='danger'>You revoke central access from [target].</span>")
else
@@ -114,7 +114,7 @@
var/found = FALSE
for(var/access in valid_access)
if(access in id_card.access || emagged)
if(access in id_card.GetAccess() || emagged)
to_chat(user, "You imprint your ID details onto the badge.")
set_name(user.real_name)
found = TRUE
+2 -2
View File
@@ -524,8 +524,8 @@
ooc_notes_likes = AI.ooc_notes_likes
ooc_notes_dislikes = AI.ooc_notes_dislikes
to_chat(src, span_notice("You feel a tingle in your circuits as your systems interface with \the [initial(src.name)]."))
if(AI.idcard.access)
botcard.access |= AI.idcard.access
if(AI.idcard.GetAccess())
botcard.access |= AI.idcard.GetAccess()
/mob/living/bot/proc/ejectpai(mob/user)
if(paicard)
+1 -1
View File
@@ -501,7 +501,7 @@
if (idaccessible == 1)
switch(tgui_alert(user, "Do you wish to add access to [src] or remove access from [src]?","Access Modify",list("Add Access","Remove Access", "Cancel")))
if("Add Access")
idcard.access |= ID.access
idcard.access |= ID.GetAccess()
to_chat(user, "<span class='notice'>You add the access from the [W] to [src].</span>")
to_chat(src, "<span class='notice'>\The [user] swipes the [W] over you. You copy the access codes.</span>")
if(radio)
@@ -121,7 +121,7 @@
to_chat(user, "<span class='notice'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>")
return 0
if(access_to_check in I.access)
if(access_to_check in I.GetAccess())
return 1
else if(loud)
to_chat(user, "<span class='notice'>\The [computer] flashes an \"Access Denied\" warning.</span>")
@@ -100,7 +100,7 @@
accesses.Add(list(list(
"desc" = replacetext(get_access_desc(access), " ", "&nbsp;"),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0
"allowed" = (access in id_card.GetAccess()) ? 1 : 0
)))
regions.Add(list(list(
@@ -109,4 +109,4 @@
)))
data["regions"] = regions
return data
return data
@@ -67,7 +67,7 @@
// High security - can only be operated when the user has an ID with access on them.
var/obj/item/weapon/card/id/I = usr.GetIdCard()
if(!istype(I) || !(access_network in I.access))
if(!istype(I) || !(access_network in I.GetAccess()))
return TRUE
switch(action)
@@ -73,7 +73,7 @@ var/warrant_uid = 0
// which also use RFID scanning to allow or disallow access to some functions. Anyone can view warrants, editing requires ID. This also prevents situations where you show a tablet
// to someone who is to be arrested, which allows them to change the stuff there.
var/obj/item/weapon/card/id/I = usr.GetIdCard()
if(!istype(I) || !I.registered_name || !(access_security in I.access))
if(!istype(I) || !I.registered_name || !(access_security in I.GetAccess()))
to_chat(usr, "Authentication error: Unable to locate ID with appropriate access to allow this operation.")
return
@@ -136,7 +136,7 @@ var/warrant_uid = 0
if("editwarrantauth")
. = TRUE
if(!(access_hos in I.access)) // VOREStation edit begin
if(!(access_hos in I.GetAccess())) // VOREStation edit begin
to_chat(usr, "<span class='warning'>You don't have the access to do this!</span>")
return // VOREStation edit end
activewarrant.fields["auth"] = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
+1 -1
View File
@@ -40,7 +40,7 @@
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access))
if((access_captain in C.GetAccess()) || (access_security in C.GetAccess()) || (access_engine in C.GetAccess()))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
updateDialog()
+1 -1
View File
@@ -60,7 +60,7 @@
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = W
if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access))
if((access_captain in C.GetAccess()) || (access_security in C.GetAccess()) || (access_engine in C.GetAccess()))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
updateDialog()
+1 -1
View File
@@ -56,7 +56,7 @@ Code is pretty much ripped verbatim from nano modules, but with un-needed stuff
if(!I)
return 0
if(access in I.access)
if(access in I.GetAccess())
return 1
return 0
@@ -70,7 +70,7 @@
all_centcom_access.Add(list(list(
"desc" = replacetext(get_centcom_access_desc(access), " ", "&nbsp;"),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
"allowed" = (access in id_card.GetAccess()) ? 1 : 0)))
data["all_centcom_access"] = all_centcom_access
else
for(var/i in ACCESS_REGION_SECURITY to ACCESS_REGION_SUPPLY)
@@ -80,7 +80,7 @@
accesses.Add(list(list(
"desc" = replacetext(get_access_desc(access), " ", "&nbsp;"),
"ref" = access,
"allowed" = (access in id_card.access) ? 1 : 0)))
"allowed" = (access in id_card.GetAccess()) ? 1 : 0)))
regions.Add(list(list(
"name" = get_region_accesses_name(i),
@@ -143,7 +143,7 @@
"}
var/known_access_rights = get_access_ids(ACCESS_TYPE_STATION|ACCESS_TYPE_CENTCOM)
for(var/A in id_card.access)
for(var/A in id_card.GetAccess())
if(A in known_access_rights)
contents += " [get_access_desc(A)]"
@@ -231,4 +231,3 @@
if(id_card)
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")