mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 10:03:45 +00:00
Access Decryption, fixes nanoword
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
var/running = FALSE
|
||||
var/progress = 0
|
||||
var/target_progress = 300
|
||||
var/datum/access/target_access = null
|
||||
|
||||
/datum/computer_file/program/access_decrypter/kill_program(var/forced)
|
||||
reset()
|
||||
@@ -40,12 +41,12 @@
|
||||
progress += CPU.max_idle_programs
|
||||
if(progress >= target_progress)
|
||||
reset()
|
||||
var/datum/access/A = get_access_by_id(pick(get_all_station_access()))
|
||||
RFID.stored_card.access |= A.id
|
||||
RFID.stored_card.access |= target_access.id
|
||||
if(ntnet_global.intrusion_detection_enabled)
|
||||
ntnet_global.add_log("IDS WARNING - Unauthorised access to primary keycode database from device: [computer.network_card.get_network_tag()] - downloaded access codes for: [A.desc].")
|
||||
ntnet_global.add_log("IDS WARNING - Unauthorised access to primary keycode database from device: [computer.network_card.get_network_tag()] - downloaded access codes for: [target_access.desc].")
|
||||
ntnet_global.intrusion_detection_alarm = 1
|
||||
message = "Successfully decrypted and saved operational key codes. Downloaded access codes for: [A.desc]"
|
||||
message = "Successfully decrypted and saved operational key codes. Downloaded access codes for: [target_access.desc]"
|
||||
target_access = null
|
||||
|
||||
/datum/computer_file/program/access_decrypter/Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -56,6 +57,8 @@
|
||||
if(href_list["PRG_execute"])
|
||||
if(running)
|
||||
return 1
|
||||
if(text2num(href_list["allowed"]))
|
||||
return 1
|
||||
var/obj/item/weapon/computer_hardware/processor_unit/CPU = computer.processor_unit
|
||||
var/obj/item/weapon/computer_hardware/card_slot/RFID = computer.card_slot
|
||||
if(!istype(CPU) || !CPU.check_functionality() || !istype(RFID) || !RFID.check_functionality())
|
||||
@@ -65,6 +68,7 @@
|
||||
message = "RFID card is not present in the device. Operation aborted."
|
||||
return
|
||||
running = TRUE
|
||||
target_access = get_access_by_id(text2num(href_list["PRG_execute"]))
|
||||
if(ntnet_global.intrusion_detection_enabled)
|
||||
ntnet_global.add_log("IDS WARNING - Unauthorised access attempt to primary keycode database from device: [computer.network_card.get_network_tag()]")
|
||||
ntnet_global.intrusion_detection_alarm = 1
|
||||
@@ -72,8 +76,9 @@
|
||||
|
||||
/datum/nano_module/program/access_decrypter
|
||||
name = "NTNet Access Decrypter"
|
||||
var/list/restricted_access_codes = list(access_hop, access_network) // access codes that are not hackable due to balance reasons
|
||||
|
||||
/datum/nano_module/program/access_decrypter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.default_state)
|
||||
/datum/nano_module/program/access_decrypter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
if(!ntnet_global)
|
||||
return
|
||||
var/datum/computer_file/program/access_decrypter/PRG = program
|
||||
@@ -97,8 +102,25 @@
|
||||
string = "[string][prob(percentage)]"
|
||||
strings.Add(string)
|
||||
data["dos_strings"] = strings
|
||||
else if(program.computer.card_slot && program.computer.card_slot.stored_card)
|
||||
var/obj/item/weapon/card/id/id_card = program.computer.card_slot.stored_card
|
||||
var/list/regions = list()
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
var/list/accesses = list()
|
||||
for(var/access in get_region_accesses(i))
|
||||
if (get_access_desc(access))
|
||||
accesses.Add(list(list(
|
||||
"desc" = replacetext(get_access_desc(access), " ", " "),
|
||||
"ref" = access,
|
||||
"allowed" = (access in id_card.access) ? 1 : 0,
|
||||
"blocked" = (access in restricted_access_codes) ? 1 : 0)))
|
||||
|
||||
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
regions.Add(list(list(
|
||||
"name" = get_region_accesses_name(i),
|
||||
"accesses" = accesses)))
|
||||
data["regions"] = regions
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "access_decrypter.tmpl", "NTNet Access Decrypter", 550, 400, state = state)
|
||||
ui.auto_update_layout = 1
|
||||
|
||||
@@ -96,9 +96,8 @@
|
||||
\[row\] - New table row.
|
||||
\[cell\] - New table cell.
|
||||
\[logo\] - Inserts NT logo image.
|
||||
\[bluelogo\] - Inserts blue NT logo image.
|
||||
\[solcrest\] - Inserts SCG crest image.
|
||||
\[terraseal\] - Inserts TCC seal"}
|
||||
\[redlogo\] - Inserts red NT logo image.
|
||||
\[sglogo\] - Inserts Solgov insignia image."}
|
||||
|
||||
to_chat(usr, help)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user