From d0f661f1fc8c9c841436641412b5a11acf2c1842 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 14 Jun 2024 22:04:13 +0100 Subject: [PATCH 1/6] X114-Phase 1 --- code/game/machinery/ARES/debug_data.dm | 244 +++++++++++++++++++++++++ code/game/machinery/ARES/debug_pda.dm | 71 +++++++ colonialmarines.dme | 1 + 3 files changed, 316 insertions(+) create mode 100644 code/game/machinery/ARES/debug_data.dm diff --git a/code/game/machinery/ARES/debug_data.dm b/code/game/machinery/ARES/debug_data.dm new file mode 100644 index 000000000000..dc145d4960a8 --- /dev/null +++ b/code/game/machinery/ARES/debug_data.dm @@ -0,0 +1,244 @@ +/obj/item/device/ai_tech_pda/ui_data(mob/user) + if(!link.interface) + to_chat(user, SPAN_WARNING("ARES ADMIN DATA LINK FAILED")) + return FALSE + var/list/data = list() + + data["is_pda"] = TRUE + data["admin_login"] = "[logged_in], AI Service Technician" + data["admin_access_log"] = access_list + + data["current_menu"] = current_menu + data["last_page"] = last_menu + + data["logged_in"] = link.interface.last_login + data["sudo"] = link.interface.sudo_holder ? TRUE : FALSE + + data["access_text"] = "[link.interface.sudo_holder ? "(SUDO)," : ""] access level [link.interface.authentication], [link.interface.ares_auth_to_text(link.interface.authentication)]." + data["access_level"] = link.interface.authentication + + data["alert_level"] = GLOB.security_level + data["evac_status"] = SShijack.evac_status + data["worldtime"] = world.time + + data["access_log"] = datacore.interface_access_list + data["apollo_log"] = datacore.apollo_log + + data["deleted_conversation"] = deleted_1to1 + + data["distresstime"] = datacore.ares_distress_cooldown + data["distresstimelock"] = DISTRESS_TIME_LOCK + data["quarterstime"] = datacore.ares_quarters_cooldown + data["mission_failed"] = SSticker.mode.is_in_endgame + data["nuketimelock"] = NUCLEAR_TIME_LOCK + data["nuke_available"] = datacore.nuke_available + + data["printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown) + + var/list/logged_announcements = list() + for(var/datum/ares_record/announcement/broadcast as anything in datacore.records_announcement) + var/list/current_broadcast = list() + current_broadcast["time"] = broadcast.time + current_broadcast["title"] = broadcast.title + current_broadcast["details"] = broadcast.details + current_broadcast["ref"] = "\ref[broadcast]" + logged_announcements += list(current_broadcast) + data["records_announcement"] = logged_announcements + + var/list/logged_alerts = list() + for(var/datum/ares_record/security/security_alert as anything in datacore.records_security) + var/list/current_alert = list() + current_alert["time"] = security_alert.time + current_alert["title"] = security_alert.title + current_alert["details"] = security_alert.details + current_alert["ref"] = "\ref[security_alert]" + logged_alerts += list(current_alert) + data["records_security"] = logged_alerts + + var/list/logged_flights = list() + for(var/datum/ares_record/flight/flight_log as anything in datacore.records_flight) + var/list/current_flight = list() + current_flight["time"] = flight_log.time + current_flight["title"] = flight_log.title + current_flight["details"] = flight_log.details + current_flight["user"] = flight_log.user + current_flight["ref"] = "\ref[flight_log]" + logged_flights += list(current_flight) + data["records_flight"] = logged_flights + + var/list/logged_bioscans = list() + for(var/datum/ares_record/bioscan/scan as anything in datacore.records_bioscan) + var/list/current_scan = list() + current_scan["time"] = scan.time + current_scan["title"] = scan.title + current_scan["details"] = scan.details + current_scan["ref"] = "\ref[scan]" + logged_bioscans += list(current_scan) + data["records_bioscan"] = logged_bioscans + + var/list/logged_bombs = list() + for(var/datum/ares_record/bombardment/bomb as anything in datacore.records_bombardment) + var/list/current_bomb = list() + current_bomb["time"] = bomb.time + current_bomb["title"] = bomb.title + current_bomb["details"] = bomb.details + current_bomb["user"] = bomb.user + current_bomb["ref"] = "\ref[bomb]" + logged_bombs += list(current_bomb) + data["records_bombardment"] = logged_bombs + + var/list/logged_deletes = list() + for(var/datum/ares_record/deletion/deleted as anything in datacore.records_deletion) + if(!istype(deleted)) + continue + var/list/current_delete = list() + current_delete["time"] = deleted.time + current_delete["title"] = deleted.title + current_delete["details"] = deleted.details + current_delete["user"] = deleted.user + current_delete["ref"] = "\ref[deleted]" + logged_deletes += list(current_delete) + data["records_deletion"] = logged_deletes + + var/list/logged_discussions = list() + for(var/datum/ares_record/deleted_talk/deleted_convo as anything in datacore.records_deletion) + if(!istype(deleted_convo)) + continue + var/list/deleted_disc = list() + deleted_disc["time"] = deleted_convo.time + deleted_disc["title"] = deleted_convo.title + deleted_disc["ref"] = "\ref[deleted_convo]" + logged_discussions += list(deleted_disc) + data["deleted_discussions"] = logged_discussions + + var/list/logged_orders = list() + for(var/datum/ares_record/requisition_log/req_order as anything in datacore.records_asrs) + if(!istype(req_order)) + continue + var/list/current_order = list() + current_order["time"] = req_order.time + current_order["details"] = req_order.details + current_order["title"] = req_order.title + current_order["user"] = req_order.user + current_order["ref"] = "\ref[req_order]" + logged_orders += list(current_order) + data["records_requisition"] = logged_orders + + var/list/logged_techs = list() + for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech) + var/list/current_tech = list() + current_tech["time"] = tech_unlock.time + current_tech["details"] = tech_unlock.details + current_tech["user"] = tech_unlock.user + current_tech["tier_changer"] = tech_unlock.is_tier + current_tech["ref"] = "\ref[tech_unlock]" + logged_techs += list(current_tech) + data["records_tech"] = logged_techs + + var/list/logged_convos = list() + var/list/active_convo = list() + var/active_ref + for(var/datum/ares_record/talk_log/log as anything in datacore.records_talking) + if(!istype(log)) + continue + if(log.user == link.interface.last_login) + active_convo = log.conversation + active_ref = "\ref[log]" + + var/list/current_convo = list() + current_convo["user"] = log.user + current_convo["ref"] = "\ref[log]" + current_convo["conversation"] = log.conversation + logged_convos += list(current_convo) + + data["active_convo"] = active_convo + data["active_ref"] = active_ref + data["conversations"] = logged_convos + + var/list/logged_maintenance = list() + for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) + if(!istype(maint_ticket)) + continue + var/lock_status = TICKET_OPEN + switch(maint_ticket.ticket_status) + if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) + lock_status = TICKET_CLOSED + + var/list/current_maint = list() + current_maint["id"] = maint_ticket.ticket_id + current_maint["time"] = maint_ticket.ticket_time + current_maint["priority_status"] = maint_ticket.ticket_priority + current_maint["category"] = maint_ticket.ticket_name + current_maint["details"] = maint_ticket.ticket_details + current_maint["status"] = maint_ticket.ticket_status + current_maint["submitter"] = maint_ticket.ticket_submitter + current_maint["assignee"] = maint_ticket.ticket_assignee + current_maint["lock_status"] = lock_status + current_maint["ref"] = "\ref[maint_ticket]" + logged_maintenance += list(current_maint) + data["maintenance_tickets"] = logged_maintenance + + var/list/logged_access = list() + var/list/requesting_access = list() + for(var/datum/ares_ticket/access/access_ticket as anything in link.tickets_access) + var/lock_status = TICKET_OPEN + switch(access_ticket.ticket_status) + if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) + lock_status = TICKET_CLOSED + + var/list/current_ticket = list() + current_ticket["id"] = access_ticket.ticket_id + current_ticket["time"] = access_ticket.ticket_time + current_ticket["priority_status"] = access_ticket.ticket_priority + current_ticket["title"] = access_ticket.ticket_name + current_ticket["details"] = access_ticket.ticket_details + current_ticket["status"] = access_ticket.ticket_status + current_ticket["submitter"] = access_ticket.ticket_submitter + current_ticket["assignee"] = access_ticket.ticket_assignee + current_ticket["lock_status"] = lock_status + current_ticket["ref"] = "\ref[access_ticket]" + logged_access += list(current_ticket) + + if(lock_status == TICKET_OPEN) + requesting_access += access_ticket.ticket_name + data["access_tickets"] = logged_access + + data["notify_sounds"] = notify_sounds + + return data + + + +/obj/item/device/ai_tech_pda/proc/get_ares_access(obj/item/card/id/card) + if(ACCESS_ARES_DEBUG in card.access) + return APOLLO_ACCESS_DEBUG + switch(card.assignment) + if(JOB_WORKING_JOE) + return APOLLO_ACCESS_JOE + if(JOB_CHIEF_ENGINEER, JOB_SYNTH, JOB_CO) + return APOLLO_ACCESS_AUTHED + if(ACCESS_MARINE_AI in card.access) + return APOLLO_ACCESS_AUTHED + if(ACCESS_MARINE_AI_TEMP in card.access) + return APOLLO_ACCESS_TEMP + if((ACCESS_MARINE_SENIOR in card.access ) || (ACCESS_MARINE_ENGINEERING in card.access) || (ACCESS_WY_GENERAL in card.access)) + return APOLLO_ACCESS_REPORTER + else + return APOLLO_ACCESS_REQUEST + +/obj/item/device/ai_tech_pda/proc/ares_auth_to_text(access_level) + switch(access_level) + if(APOLLO_ACCESS_LOGOUT)//0 + return "Logged Out" + if(APOLLO_ACCESS_REQUEST)//1 + return "Unauthorized Personnel" + if(APOLLO_ACCESS_REPORTER)//2 + return "Validated Incident Reporter" + if(APOLLO_ACCESS_TEMP)//3 + return "Authorized Visitor" + if(APOLLO_ACCESS_AUTHED)//4 + return "Certified Personnel" + if(APOLLO_ACCESS_JOE)//5 + return "Working Joe" + if(APOLLO_ACCESS_DEBUG)//6 + return "AI Service Technician" diff --git a/code/game/machinery/ARES/debug_pda.dm b/code/game/machinery/ARES/debug_pda.dm index 3298af5732e9..8099d226e420 100644 --- a/code/game/machinery/ARES/debug_pda.dm +++ b/code/game/machinery/ARES/debug_pda.dm @@ -22,6 +22,10 @@ var/list/access_list = list() var/list/deleted_1to1 = list() + /// Notification sound + var/notify_sounds = TRUE + COOLDOWN_DECLARE(printer_cooldown) + /obj/item/device/ai_tech_pda/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) return FALSE @@ -78,6 +82,7 @@ ui = new(user, src, "AresAdmin", name) ui.open() +/* /obj/item/device/ai_tech_pda/ui_data(mob/user) if(!link.interface) to_chat(user, SPAN_WARNING("ARES ADMIN DATA LINK FAILED")) @@ -282,6 +287,7 @@ data["faction_options"] = link.faction_options return data +*/ /obj/item/device/ai_tech_pda/ui_close(mob/user) . = ..() @@ -759,6 +765,71 @@ to_chat(user, SPAN_WARNING("Sentry IFF settings updated!")) return TRUE + if("print_req") + playsound = FALSE + if(!COOLDOWN_FINISHED(src, printer_cooldown)) + playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) + return FALSE + if(!length(datacore.records_asrs)) + to_chat(user, SPAN_WARNING("There are no records to print!")) + playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) + return FALSE + COOLDOWN_START(src, printer_cooldown, 20 SECONDS) + playsound(src, 'sound/machines/fax.ogg', 15, 1) + sleep(3.4 SECONDS) + var/contents = {" +
\ +
\ +

A.S.R.S.

\ +

Automatic Storage Retrieval System

\ +

Audit Log

\ +

+ Printed By: [logged_in]
+ Print Time: [worldtime2text()]
+
+
+ + + + + + + + + + + "} + + for(var/datum/ares_record/requisition_log/req_order as anything in datacore.records_asrs) + + contents += {" + + + + + + + "} + + contents += "
TimeUserSourceOrder
[req_order.time][req_order.user][req_order.title][req_order.details]
" + + var/obj/item/paper/log = new(loc) + log.name = "ASRS Audit Log" + log.info += contents + log.icon_state = "paper_uscm_words" + visible_message(SPAN_NOTICE("[src] prints out a paper.")) + if(playsound) var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg') playsound(src, sound, 15, TRUE) diff --git a/colonialmarines.dme b/colonialmarines.dme index 68f89e3c0c90..beede4bb56fc 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -893,6 +893,7 @@ #include "code\game\machinery\ARES\ARES_procs.dm" #include "code\game\machinery\ARES\ARES_records.dm" #include "code\game\machinery\ARES\ARES_step_triggers.dm" +#include "code\game\machinery\ARES\debug_data.dm" #include "code\game\machinery\ARES\debug_pda.dm" #include "code\game\machinery\atmoalter\canister.dm" #include "code\game\machinery\atmoalter\meter.dm" From f7fa677f91f1ebfa5df9332337f6bc13b614f0f2 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 14 Jun 2024 22:31:11 +0100 Subject: [PATCH 2/6] X114-Phase 2 --- code/game/machinery/ARES/ARES_procs.dm | 8 ++++++ code/game/machinery/ARES/debug_pda.dm | 40 +++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 019fd4978bed..67eee9df56d1 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -46,10 +46,18 @@ GLOBAL_LIST_INIT(maintenance_categories, list( var/list/faction_options = list(FACTION_MARINE, FACTION_WY, "USCM-WY", FACTION_ARES) var/list/core_sentries = list() + var/code_apollo = 1 + var/code_interface = 1 + var/code_debug = 1 + /datum/ares_link/New() admin_interface = new datacore = GLOB.ares_datacore + code_apollo = "[pick(GLOB.alphabet_uppercase)][rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]" + code_interface = "[pick(GLOB.alphabet_uppercase)][rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]" + code_debug = "X[rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]" + /datum/ares_link/Destroy() qdel(admin_interface) for(var/obj/structure/machinery/ares/link in linked_systems) diff --git a/code/game/machinery/ARES/debug_pda.dm b/code/game/machinery/ARES/debug_pda.dm index 8099d226e420..123db04a1096 100644 --- a/code/game/machinery/ARES/debug_pda.dm +++ b/code/game/machinery/ARES/debug_pda.dm @@ -25,6 +25,7 @@ /// Notification sound var/notify_sounds = TRUE COOLDOWN_DECLARE(printer_cooldown) + var/access_code = 0 /obj/item/device/ai_tech_pda/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -48,6 +49,33 @@ link = null datacore = null +/obj/item/device/ai_tech_pda/proc/enter_code() + if(access_code) + to_chat(usr, SPAN_WARNING("An access code has already been entered!")) + playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) + return FALSE + var/mob/living/carbon/user = usr + playsound(src, 'sound/machines/terminal_prompt.ogg', 15, TRUE) + var/new_access_code = tgui_input_text(user, "Please enter a data access code.", "Access Code", "00000", 7, timeout = 20 SECONDS) + if(!new_access_code) + to_chat(usr, SPAN_WARNING("Error: No input detected!")) + playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) + return FALSE + access_code = new_access_code + +/obj/item/device/ai_tech_pda/proc/clear_code() + var/mob/living/carbon/human/user + if(ishuman(usr)) + user = usr + else + return FALSE + var/obj/item/card/id/card = user.wear_id + if(!card || !card.check_biometrics(user)) + to_chat(user, SPAN_WARNING("You require an authenticated ID card to access this device!")) + playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) + return FALSE + access_code = 0 + /obj/item/device/ai_tech_pda/Destroy() delink() return ..() @@ -78,8 +106,18 @@ to_chat(user, SPAN_WARNING("ARES DATA LINK FAILED")) return FALSE ui = SStgui.try_update_ui(user, src, ui) + var/set_ui = "AresAccessCode" + if(access_code == GLOB.ares_link.code_apollo) + set_ui = "WorkingJoe" + else if(access_code == GLOB.ares_link.code_interface) + set_ui = "AresInterface" + else if(access_code == GLOB.ares_link.code_debug) + set_ui = "AresAdmin" + else + access_code = 0 + playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) if(!ui) - ui = new(user, src, "AresAdmin", name) + ui = new(user, src, set_ui, name) ui.open() /* From 410bba0ad12af6bcfc0b7634f53ab0bd8107852c Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 15 Jun 2024 15:51:48 +0100 Subject: [PATCH 3/6] X114-Phase 3 --- code/game/machinery/ARES/debug_data.dm | 13 ++++++++++++- code/game/machinery/ARES/debug_pda.dm | 21 ++++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/ARES/debug_data.dm b/code/game/machinery/ARES/debug_data.dm index dc145d4960a8..8fb5c6980cee 100644 --- a/code/game/machinery/ARES/debug_data.dm +++ b/code/game/machinery/ARES/debug_data.dm @@ -14,7 +14,15 @@ data["logged_in"] = link.interface.last_login data["sudo"] = link.interface.sudo_holder ? TRUE : FALSE - data["access_text"] = "[link.interface.sudo_holder ? "(SUDO)," : ""] access level [link.interface.authentication], [link.interface.ares_auth_to_text(link.interface.authentication)]." + + var/admin_remote_access_text = "[link.interface.sudo_holder ? "(SUDO)," : ""] access level [link.interface.authentication], [link.interface.ares_auth_to_text(link.interface.authentication)]." + if(set_ui = "AresAdmin") + data["access_text"] = admin_remote_access_text + else if(set_ui = "WorkingJoe") + data["access_text"] = " access level [authentication], [ares_auth_to_text(authentication)]." + else if(set_ui = "AresInterface") + data["access_text"] = " access level [authentication], [ares_auth_to_text(authentication)]." + data["access_level"] = link.interface.authentication data["alert_level"] = GLOB.security_level @@ -204,6 +212,9 @@ data["access_tickets"] = logged_access data["notify_sounds"] = notify_sounds + data["security_vents"] = link.get_ares_vents() + data["sentry_setting"] = link.faction_label + data["faction_options"] = link.faction_options return data diff --git a/code/game/machinery/ARES/debug_pda.dm b/code/game/machinery/ARES/debug_pda.dm index 123db04a1096..962e8738aaa0 100644 --- a/code/game/machinery/ARES/debug_pda.dm +++ b/code/game/machinery/ARES/debug_pda.dm @@ -26,6 +26,7 @@ var/notify_sounds = TRUE COOLDOWN_DECLARE(printer_cooldown) var/access_code = 0 + var/set_ui = "AresAccessCode" /obj/item/device/ai_tech_pda/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -49,7 +50,12 @@ link = null datacore = null -/obj/item/device/ai_tech_pda/proc/enter_code() +/obj/item/device/ai_tech_pda/verb/enter_code() + set name = "Enter Access Code" + set desc = "Enter an access code. Duh." + set category = "Object.AIDT" + set src in usr + if(access_code) to_chat(usr, SPAN_WARNING("An access code has already been entered!")) playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) @@ -63,12 +69,22 @@ return FALSE access_code = new_access_code -/obj/item/device/ai_tech_pda/proc/clear_code() +/obj/item/device/ai_tech_pda/verb/clear_code() + set name = "Clear Access Code" + set desc = "Take a guess." + set category = "Object.AIDT" + set src in usr + var/mob/living/carbon/human/user if(ishuman(usr)) user = usr else return FALSE + + if(!access_code) + to_chat(user, SPAN_WARNING("You can't clear an already cleared code...")) + return FALSE + var/obj/item/card/id/card = user.wear_id if(!card || !card.check_biometrics(user)) to_chat(user, SPAN_WARNING("You require an authenticated ID card to access this device!")) @@ -106,7 +122,6 @@ to_chat(user, SPAN_WARNING("ARES DATA LINK FAILED")) return FALSE ui = SStgui.try_update_ui(user, src, ui) - var/set_ui = "AresAccessCode" if(access_code == GLOB.ares_link.code_apollo) set_ui = "WorkingJoe" else if(access_code == GLOB.ares_link.code_interface) From dcc5e4609d9fee977f2b30ef97f7d58c8a45c2f2 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 17 Jun 2024 20:25:38 +0100 Subject: [PATCH 4/6] X114-Phase 4 --- code/game/machinery/ARES/debug_data.dm | 75 +++++++++++++++++---- code/game/machinery/ARES/debug_pda.dm | 91 +++++++++++++++++++++++--- 2 files changed, 146 insertions(+), 20 deletions(-) diff --git a/code/game/machinery/ARES/debug_data.dm b/code/game/machinery/ARES/debug_data.dm index 8fb5c6980cee..eaab382e14e8 100644 --- a/code/game/machinery/ARES/debug_data.dm +++ b/code/game/machinery/ARES/debug_data.dm @@ -11,20 +11,21 @@ data["current_menu"] = current_menu data["last_page"] = last_menu - data["logged_in"] = link.interface.last_login - data["sudo"] = link.interface.sudo_holder ? TRUE : FALSE - + data["logged_in"] = logged_in + data["access_level"] = authentication + data["sudo"] = FALSE var/admin_remote_access_text = "[link.interface.sudo_holder ? "(SUDO)," : ""] access level [link.interface.authentication], [link.interface.ares_auth_to_text(link.interface.authentication)]." - if(set_ui = "AresAdmin") + if(set_ui == "AresAdmin") data["access_text"] = admin_remote_access_text - else if(set_ui = "WorkingJoe") - data["access_text"] = " access level [authentication], [ares_auth_to_text(authentication)]." - else if(set_ui = "AresInterface") + data["logged_in"] = link.interface.last_login + data["access_level"] = link.interface.authentication + data["sudo"] = link.interface.sudo_holder ? TRUE : FALSE + else if(set_ui == "WorkingJoe") + data["access_text"] = " access level [authentication], [apollo_auth_to_text(authentication)]." + else if(set_ui == "AresInterface") data["access_text"] = " access level [authentication], [ares_auth_to_text(authentication)]." - data["access_level"] = link.interface.authentication - data["alert_level"] = GLOB.security_level data["evac_status"] = SShijack.evac_status data["worldtime"] = world.time @@ -220,7 +221,7 @@ -/obj/item/device/ai_tech_pda/proc/get_ares_access(obj/item/card/id/card) +/obj/item/device/ai_tech_pda/proc/get_apollo_access(obj/item/card/id/card) if(ACCESS_ARES_DEBUG in card.access) return APOLLO_ACCESS_DEBUG switch(card.assignment) @@ -237,7 +238,7 @@ else return APOLLO_ACCESS_REQUEST -/obj/item/device/ai_tech_pda/proc/ares_auth_to_text(access_level) +/obj/item/device/ai_tech_pda/proc/apollo_auth_to_text(access_level) switch(access_level) if(APOLLO_ACCESS_LOGOUT)//0 return "Logged Out" @@ -253,3 +254,55 @@ return "Working Joe" if(APOLLO_ACCESS_DEBUG)//6 return "AI Service Technician" + +/obj/item/device/ai_tech_pda/proc/get_ares_access(obj/item/card/id/card) + if(ACCESS_ARES_DEBUG in card.access) + return ARES_ACCESS_DEBUG + switch(card.assignment) + if(JOB_WORKING_JOE) + return ARES_ACCESS_JOE + if(JOB_CHIEF_ENGINEER) + return ARES_ACCESS_CE + if(JOB_SYNTH) + return ARES_ACCESS_SYNTH + if(card.paygrade in GLOB.wy_highcom_paygrades) + return ARES_ACCESS_WY_COMMAND + if(card.paygrade in GLOB.uscm_highcom_paygrades) + return ARES_ACCESS_HIGH + if(card.paygrade in GLOB.co_paygrades) + return ARES_ACCESS_CO + if(ACCESS_MARINE_SENIOR in card.access) + return ARES_ACCESS_SENIOR + if(ACCESS_WY_GENERAL in card.access) + return ARES_ACCESS_CORPORATE + if(ACCESS_MARINE_COMMAND in card.access) + return ARES_ACCESS_COMMAND + else + return ARES_ACCESS_BASIC + +/obj/item/device/ai_tech_pda/proc/ares_auth_to_text(access_level) + switch(access_level) + if(ARES_ACCESS_LOGOUT) + return "Logged Out" + if(ARES_ACCESS_BASIC) + return "Authorized" + if(ARES_ACCESS_COMMAND) + return "[MAIN_SHIP_NAME] Command" + if(ARES_ACCESS_JOE) + return "Working Joe" + if(ARES_ACCESS_CORPORATE) + return "Weyland-Yutani" + if(ARES_ACCESS_SENIOR) + return "[MAIN_SHIP_NAME] Senior Command" + if(ARES_ACCESS_CE) + return "Chief Engineer" + if(ARES_ACCESS_SYNTH) + return "USCM Synthetic" + if(ARES_ACCESS_CO) + return "[MAIN_SHIP_NAME] Commanding Officer" + if(ARES_ACCESS_HIGH) + return "USCM High Command" + if(ARES_ACCESS_WY_COMMAND) + return "Weyland-Yutani Directorate" + if(ARES_ACCESS_DEBUG) + return "AI Service Technician" diff --git a/code/game/machinery/ARES/debug_pda.dm b/code/game/machinery/ARES/debug_pda.dm index 962e8738aaa0..7aa167d22a3d 100644 --- a/code/game/machinery/ARES/debug_pda.dm +++ b/code/game/machinery/ARES/debug_pda.dm @@ -344,11 +344,12 @@ /obj/item/device/ai_tech_pda/ui_close(mob/user) . = ..() - current_menu = "login" - last_menu = "off" - if(logged_in) + if(set_ui == "AresAdmin") access_list += "[logged_in] logged out at [worldtime2text()]." logged_in = null + authentication = 0 + current_menu = "login" + last_menu = "off" update_icon() /obj/item/device/ai_tech_pda/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) @@ -358,6 +359,9 @@ var/mob/living/carbon/human/user = ui.user var/playsound = TRUE + if(set_ui == "AresAdmin" && !check_security(user)) + return FALSE + switch(action) if("go_back") if(!last_menu) @@ -367,16 +371,34 @@ last_menu = temp_holder if("login") - var/obj/item/card/id/card = user.wear_id - if(!card || !card.check_biometrics(user)) + var/failed = FALSE + var/obj/item/card/id/idcard = user.get_active_hand() + if(!istype(idcard)) + if(user.wear_id) + idcard = user.wear_id + if(!istype(idcard)) + failed = TRUE + if(!idcard.check_biometrics(user)) + failed = TRUE + if(failed) to_chat(user, SPAN_WARNING("You require an authenticated ID card to access this device!")) playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) return FALSE - logged_in = user.real_name - access_list += "[logged_in] at [worldtime2text()]." - current_menu = "main" + + switch(set_ui) + if("AresInterface", "AresAdmin") + authentication = get_ares_access(idcard) + if("WorkingJoe") + authentication = get_apollo_access(idcard) + + if(authentication) + logged_in = idcard.registered_name + access_list += "[logged_in] at [worldtime2text()]." + current_menu = "main" if("sudo") + if(!check_security(user) || set_ui == "AresAdmin") + return FALSE var/new_user = tgui_input_text(user, "Enter Sudo Username", "Sudo User", encode = FALSE) if(new_user) if(new_user == link.interface.sudo_holder) @@ -392,6 +414,8 @@ datacore.interface_access_list += "[link.interface.last_login] at [worldtime2text()], Sudo Access." return TRUE if("sudo_logout") + if(!check_security(user)) + return FALSE datacore.interface_access_list += "[link.interface.last_login] at [worldtime2text()], Sudo Logout." link.interface.last_login = link.interface.sudo_holder link.interface.sudo_holder = null @@ -479,10 +503,14 @@ datacore.records_talking -= conversation if("fake_message_ares") + if(!check_security(user)) + return FALSE var/message = tgui_input_text(user, "What do you wish to say to ARES?", "ARES Message", encode = FALSE) if(message) link.interface.message_ares(message, user, params["active_convo"], TRUE) if("ares_reply") + if(!check_security(user)) + return FALSE var/message = tgui_input_text(user, "What do you wish to reply with?", "ARES Response", encode = FALSE) if(message) link.interface.response_from_ares(message, params["active_convo"]) @@ -522,6 +550,8 @@ return claim if("auth_access") + if(!check_security(user)) + return FALSE playsound = FALSE var/datum/ares_ticket/access/access_ticket = locate(params["ticket"]) if(!access_ticket) @@ -626,6 +656,8 @@ return TRUE if("delete_record") + if(!check_security(user)) + return FALSE playsound = FALSE var/datum/ares_record/record = locate(params["record"]) if(record.record_name == ARES_RECORD_DELETED) @@ -667,6 +699,8 @@ playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) if("general_quarters") + if(!check_security(user)) + return FALSE if(!COOLDOWN_FINISHED(datacore, ares_quarters_cooldown)) to_chat(user, SPAN_WARNING("It has not been long enough since the last General Quarters call!")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) @@ -681,6 +715,8 @@ . = TRUE if("evacuation_start") + if(!check_security(user)) + return FALSE if(GLOB.security_level < SEC_LEVEL_RED) to_chat(user, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures.")) playsound(src, 'sound/machines/buzz-two.ogg', 15, 1) @@ -702,6 +738,8 @@ . = TRUE if("distress") + if(!check_security(user)) + return FALSE if(!SSticker.mode) return FALSE //Not a game mode? if(world.time < DISTRESS_TIME_LOCK) @@ -730,6 +768,8 @@ return TRUE if("nuclearbomb") + if(!check_security(user)) + return FALSE if(!SSticker.mode) return FALSE //Not a game mode? if(world.time < NUCLEAR_TIME_LOCK) @@ -760,6 +800,8 @@ return TRUE if("bioscan") + if(!check_security(user)) + return FALSE if(!SSticker.mode) return FALSE //Not a game mode? if(world.time < FORCE_SCAN_LOCK) @@ -778,6 +820,8 @@ return TRUE if("trigger_vent") + if(!check_security(user)) + return FALSE playsound = FALSE var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"]) if(!istype(sec_vent) || sec_vent.welded) @@ -797,6 +841,8 @@ log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.") if("security_lockdown") + if(!check_security(user)) + return FALSE if(!COOLDOWN_FINISHED(datacore, aicore_lockdown)) to_chat(user, SPAN_BOLDWARNING("AI Core Lockdown procedures are on cooldown! They will be ready in [COOLDOWN_SECONDSLEFT(datacore, aicore_lockdown)] seconds!")) return FALSE @@ -804,6 +850,8 @@ return TRUE if("update_sentries") + if(!check_security(user)) + return FALSE playsound = FALSE var/new_iff = params["chosen_iff"] if(!new_iff) @@ -877,7 +925,8 @@ contents += "
" - var/obj/item/paper/log = new(loc) + var/location = get_turf(loc) + var/obj/item/paper/log = new(location) log.name = "ASRS Audit Log" log.info += contents log.icon_state = "paper_uscm_words" @@ -886,3 +935,27 @@ if(playsound) var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg') playsound(src, sound, 15, TRUE) + +/obj/item/device/ai_tech_pda/proc/check_security(mob/living/carbon/human/user) + if(user.real_name != logged_in) + playsound(src, 'sound/machines/lockdownalarm.ogg', 15, TRUE) + audible_message(SPAN_ALERTWARNING("[src] blares a security alarm.")) + + current_menu = "login" + last_menu = "off" + logged_in = null + authentication = 0 + access_code = 0 + + if(set_ui == "AresAdmin") + set_ui = "AresAccessCode" + + var/message1 = "ATTENTION! CORE SECURITY ALERT! UNAUTHORIZED USE OF DIAGNOSTIC TABLET DETECTED!" + var/message2 = "ASSOCIATED FINGERPRINT: [user.real_name]. ASSOCIATED LOCATION: [get_area_name(user)]." + + ares_apollo_talk(message1) + ares_apollo_talk(message2) + ai_silent_announcement(message1, ":p") + ai_silent_announcement(message2, ":p") + return FALSE + return TRUE From b420ca9509f933a86b42844c4c4444c8d4eefc58 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 17 Jun 2024 20:31:45 +0100 Subject: [PATCH 5/6] Undo tank compat --- code/__DEFINES/mode.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 984dd812bc3b..12ed70c8831d 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -129,7 +129,7 @@ GLOBAL_LIST_INIT(ROLES_CIC, list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO)) GLOBAL_LIST_INIT(ROLES_AUXIL_SUPPORT, list(JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT)) GLOBAL_LIST_INIT(ROLES_MISC, list(JOB_SYNTH, JOB_WORKING_JOE, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH)) GLOBAL_LIST_INIT(ROLES_POLICE, list(JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE)) -GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH)) +GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_AI_TECH)) GLOBAL_LIST_INIT(ROLES_REQUISITION, list(JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION)) GLOBAL_LIST_INIT(ROLES_MEDICAL, list(JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_WO_CMO, JOB_WO_RESEARCHER, JOB_WO_DOCTOR)) GLOBAL_LIST_INIT(ROLES_MARINES, list(JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE)) @@ -138,7 +138,7 @@ GLOBAL_LIST_INIT(ROLES_WO, list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON, //Groundside roles GLOBAL_LIST_INIT(ROLES_XENO, list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH)) -GLOBAL_LIST_INIT(ROLES_WHITELISTED, list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR, JOB_AI_TECH)) +GLOBAL_LIST_INIT(ROLES_WHITELISTED, list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR)) GLOBAL_LIST_INIT(ROLES_SPECIAL, list(JOB_SURVIVOR)) GLOBAL_LIST_INIT(ROLES_USCM, ROLES_CIC + GLOB.ROLES_POLICE + GLOB.ROLES_AUXIL_SUPPORT + GLOB.ROLES_MISC + GLOB.ROLES_ENGINEERING + GLOB.ROLES_REQUISITION + GLOB.ROLES_MEDICAL + GLOB.ROLES_MARINES - ROLES_WO) From 31cb2151e3e7975de8db290ccc47a94935d18eba Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 17 Jun 2024 21:13:33 +0100 Subject: [PATCH 6/6] X114-Phase 5 --- code/game/jobs/job/special/uscm.dm | 4 +- code/game/machinery/ARES/debug_pda.dm | 29 ++++++- code/modules/gear_presets/uscm_event.dm | 1 + .../tgui/interfaces/AresAccessCode.jsx | 75 +++++++++++++++++++ 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/AresAccessCode.jsx diff --git a/code/game/jobs/job/special/uscm.dm b/code/game/jobs/job/special/uscm.dm index 8c519ce54f07..f3b97b7a52e4 100644 --- a/code/game/jobs/job/special/uscm.dm +++ b/code/game/jobs/job/special/uscm.dm @@ -24,7 +24,7 @@ supervisors = "the acting commanding officer" total_positions = 1 spawn_positions = 1 - flags_startup_parameters = ROLE_WHITELISTED + flags_startup_parameters = ROLE_WHITELISTED|ROLE_ADD_TO_DEFAULT gear_preset = /datum/equipment_preset/uscm_event/ai_tech // job option @@ -47,7 +47,7 @@ return FALSE /datum/job/special/uscm/ai_tech/generate_entry_message() - entry_message_body = "You are a [corporate ? FACTION_WY : FACTION_MARINE] AI Service Technician temporarily assigned to the [MAIN_SHIP_NAME]. Your goal is to ensure the onboard AI, [MAIN_AI_SYSTEM], is operating effectively. Your job involves heavy roleplay and requires you to behave like [corporate ? "a senior corporate representative, remaining in character at all times.
As a Weyland Yutani Technician you have access to the Corporate Office aboard the USS Almayer. Although you should cooperate with the onboard Liaison, you are not their subordinate nor they yours. You should help The Company interests where applicable but do not abuse your access to the AI Systems." : "an officer and to stay in character at all times. You are required to adhere to and obey Marine Law. Failure to do so may result in punitive action against you. Godspeed."]" + entry_message_body = "You are a [corporate ? FACTION_WY : FACTION_MARINE] AI Service Technician temporarily assigned to the [MAIN_SHIP_NAME]. Your goal is to ensure the onboard AI, [MAIN_AI_SYSTEM], is operating effectively. Your job involves heavy roleplay and requires you to behave like [corporate ? "a senior corporate representative, remaining in character at all times.
As a Weyland Yutani Technician you have access to the Corporate Office aboard the USS Almayer. Although you should cooperate with the onboard Liaison, you are not their subordinate nor they yours. You should help The Company interests where applicable but do not abuse your access to the AI Systems." : "an officer and to stay in character at all times. You are required to adhere to and obey Marine Law. Failure to do so may result in punitive action against you. Godspeed.\n\nThe access code for APOLLO Interface is [GLOB.ares_link.code_apollo].\nThe access code for ARES Interface is [GLOB.ares_link.code_interface]."]" return ..() /obj/effect/landmark/start/aist diff --git a/code/game/machinery/ARES/debug_pda.dm b/code/game/machinery/ARES/debug_pda.dm index 7aa167d22a3d..c69bfa0deef7 100644 --- a/code/game/machinery/ARES/debug_pda.dm +++ b/code/game/machinery/ARES/debug_pda.dm @@ -68,6 +68,8 @@ playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) return FALSE access_code = new_access_code + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 15, TRUE) + to_chat(usr, SPAN_HELPFUL("New access code detected. Please reload your device.")) /obj/item/device/ai_tech_pda/verb/clear_code() set name = "Clear Access Code" @@ -91,6 +93,8 @@ playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) return FALSE access_code = 0 + last_menu = "off" + current_menu = "login" /obj/item/device/ai_tech_pda/Destroy() delink() @@ -130,7 +134,7 @@ set_ui = "AresAdmin" else access_code = 0 - playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE) + set_ui = "AresAccessCode" if(!ui) ui = new(user, src, set_ui, name) ui.open() @@ -932,6 +936,29 @@ log.icon_state = "paper_uscm_words" visible_message(SPAN_NOTICE("[src] prints out a paper.")) + if("enter_code") + enter_code() + return + + if("page_logins") + last_menu = current_menu + current_menu = "login_records" + if("page_request") + last_menu = current_menu + current_menu = "access_requests" + if("page_report") + last_menu = current_menu + current_menu = "maint_reports" + if("page_tickets") + last_menu = current_menu + current_menu = "access_tickets" + if("page_maintenance") + last_menu = current_menu + current_menu = "maint_claim" + if("page_core_gas") + last_menu = current_menu + current_menu = "core_security_gas" + if(playsound) var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg') playsound(src, sound, 15, TRUE) diff --git a/code/modules/gear_presets/uscm_event.dm b/code/modules/gear_presets/uscm_event.dm index a0f4c5ebc3ee..aa5f274f3d43 100644 --- a/code/modules/gear_presets/uscm_event.dm +++ b/code/modules/gear_presets/uscm_event.dm @@ -494,6 +494,7 @@ ) /datum/equipment_preset/uscm_event/ai_tech/load_vanity(mob/living/carbon/human/new_human) + new_human.mind.store_memory("ARES Interface Code: [GLOB.ares_link.code_interface]
APOLLO Interface Code: [GLOB.ares_link.code_apollo]") return /datum/equipment_preset/uscm_event/ai_tech/load_gear(mob/living/carbon/human/new_human) diff --git a/tgui/packages/tgui/interfaces/AresAccessCode.jsx b/tgui/packages/tgui/interfaces/AresAccessCode.jsx new file mode 100644 index 000000000000..47d56f07359b --- /dev/null +++ b/tgui/packages/tgui/interfaces/AresAccessCode.jsx @@ -0,0 +1,75 @@ +import { useBackend } from '../backend'; +import { Box, Button, Flex } from '../components'; +import { Window } from '../layouts'; + +const PAGES = { + login: () => Login, + main: () => MainMenu, + announcements: () => AnnouncementLogs, + bioscans: () => BioscanLogs, + bombardments: () => BombardmentLogs, + apollo: () => ApolloLog, + access_log: () => AccessLogs, + delete_log: () => DeletionLogs, + flight_log: () => FlightLogs, + talking: () => ARESTalk, + deleted_talks: () => DeletedTalks, + read_deleted: () => ReadingTalks, + security: () => Security, + requisitions: () => Requisitions, + emergency: () => Emergency, + tech_log: () => TechLogs, + core_security: () => CoreSec, +}; + +export const AresAccessCode = (props) => { + const { data } = useBackend(); + const { current_menu, sudo } = data; + const PageComponent = PAGES[current_menu](); + + let themecolor = 'crtyellow'; + + return ( + + + + + + ); +}; + +const Login = (props) => { + const { act } = useBackend(); + + return ( + + AIDT Access Interface + + WY-DOS Executive + + Version 11 + Copyright © 2182, Weyland Yutani Corp. + + + + ); +};