From 8aa0daa5c1a0e098842a0872cf7068c259c931a2 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sun, 21 Jan 2024 02:36:20 +0000 Subject: [PATCH] notifications --- .../machinery/ARES/ARES_interface_apollo.dm | 40 +++++++++++++++++- code/game/machinery/ARES/apollo_pda.dm | 28 ++++++++++++ code/game/objects/items/cards_ids.dm | 2 +- sound/machines/pda_ping.ogg | Bin 0 -> 6747 bytes 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 sound/machines/pda_ping.ogg diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index 56283417ae05..720267728287 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -18,6 +18,9 @@ /// The last person to login. var/last_login + /// Notification sound + var/notify_sounds = TRUE + /obj/structure/machinery/computer/working_joe/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -34,6 +37,16 @@ link_systems(override = FALSE) . = ..() +/obj/structure/machinery/computer/working_joe/proc/notify() + if(notify_sounds) + playsound(src, 'sound/machines/pda_ping.ogg', 25, 0) + +/obj/structure/machinery/computer/working_joe/proc/send_notifcation() + for(var/obj/structure/machinery/computer/working_joe/ticketer as anything in link.ticket_computers) + if(ticketer == src) + continue + ticketer.notify() + /obj/structure/machinery/computer/working_joe/proc/delink() if(link) link.ticket_computers -= src @@ -223,6 +236,8 @@ link.tickets_maintenance += maint_ticket if(priority_report) ares_apollo_talk("Priority Maintenance Report: [maint_type] - ID [maint_ticket.ticket_id]. Seek and resolve.") + else + send_notifcation() log_game("ARES: Maintenance Ticket '\ref[maint_ticket]' created by [key_name(operator)] as [last_login] with Category '[maint_type]' and Details of '[details]'.") return TRUE return FALSE @@ -261,6 +276,8 @@ ticket.ticket_status = TICKET_CANCELLED if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been cancelled.") + else + send_notifcation() return TRUE if("mark_ticket") @@ -280,6 +297,8 @@ return FALSE if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been [choice] by [last_login].") + else + send_notifcation() to_chat(usr, SPAN_NOTICE("[ticket.ticket_type] [ticket.ticket_id] marked as [choice].")) return TRUE @@ -387,17 +406,26 @@ access_ticket.ticket_status = TICKET_REJECTED to_chat(usr, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected.")) ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].") + for(var/obj/item/card/id/identification in link.waiting_ids) + if(!istype(identification)) + continue + if(identification.registered_gid != access_ticket.user_id_num) + continue + var/mob/living/carbon/human/id_owner = identification.registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access rejected.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE if(playsound) playsound(src, "keyboard_alt", 15, 1) -/obj/item/card/id/proc/handle_ares_access(logged_in, mob/user) +/obj/item/card/id/proc/handle_ares_access(logged_in = MAIN_AI_SYSTEM, mob/user) var/operator = key_name(user) var/datum/ares_link/link = GLOB.ares_link if(logged_in == MAIN_AI_SYSTEM) if(!user) - operator = "[MAIN_AI_SYSTEM] (Sensor Trip)" + operator = "[MAIN_AI_SYSTEM] (Automated)" else operator = "[user.ckey]/([MAIN_AI_SYSTEM])" if(ACCESS_MARINE_AI_TEMP in access) @@ -405,10 +433,18 @@ link.active_ids -= src modification_log += "Temporary AI access revoked by [operator]" to_chat(user, SPAN_NOTICE("Access revoked from [registered_name].")) + var/mob/living/carbon/human/id_owner = registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access revoked.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) else access += ACCESS_MARINE_AI_TEMP modification_log += "Temporary AI access granted by [operator]" to_chat(user, SPAN_NOTICE("Access granted to [registered_name].")) link.waiting_ids -= src link.active_ids += src + var/mob/living/carbon/human/id_owner = registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_HELPFUL("AI visitation access granted.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index 8df3faf79260..2c3222987d81 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -19,6 +19,9 @@ /// The last person to login. var/last_login + /// Notification sound + var/notify_sounds = TRUE + /obj/item/device/working_joe_pda/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) @@ -35,6 +38,16 @@ link_systems(override = FALSE) . = ..() +/obj/item/device/working_joe_pda/proc/notify() + if(notify_sounds) + playsound(src, 'sound/machines/pda_ping.ogg', 25, 0) + +/obj/item/device/working_joe_pda/proc/send_notifcation() + for(var/obj/item/device/working_joe_pda/ticketer as anything in link.ticket_computers) + if(ticketer == src) + continue + ticketer.notify() + /obj/item/device/working_joe_pda/proc/delink() if(link) link.ticket_computers -= src @@ -248,6 +261,8 @@ link.tickets_maintenance += maint_ticket if(priority_report) ares_apollo_talk("Priority Maintenance Report: [maint_type] - ID [maint_ticket.ticket_id]. Seek and resolve.") + else + send_notifcation() log_game("ARES: Maintenance Ticket '\ref[maint_ticket]' created by [key_name(operator)] as [last_login] with Category '[maint_type]' and Details of '[details]'.") return TRUE return FALSE @@ -286,6 +301,8 @@ ticket.ticket_status = TICKET_CANCELLED if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been cancelled.") + else + send_notifcation() return TRUE if("mark_ticket") @@ -305,6 +322,8 @@ return FALSE if(ticket.ticket_priority) ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been [choice] by [last_login].") + else + send_notifcation() to_chat(usr, SPAN_NOTICE("[ticket.ticket_type] [ticket.ticket_id] marked as [choice].")) return TRUE @@ -412,6 +431,15 @@ access_ticket.ticket_status = TICKET_REJECTED to_chat(usr, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected.")) ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].") + for(var/obj/item/card/id/identification in link.waiting_ids) + if(!istype(identification)) + continue + if(identification.registered_gid != access_ticket.user_id_num) + continue + var/mob/living/carbon/human/id_owner = identification.registered_ref?.resolve() + if(id_owner) + to_chat(id_owner, SPAN_WARNING("AI visitation access rejected.")) + playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0) return TRUE if(playsound) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 5f58a3b1d292..a33d51a929eb 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -67,7 +67,7 @@ /// The name registered_name on the card var/registered_name = "Unknown" - var/registered_ref = null + var/datum/weakref/registered_ref = null var/registered_gid = 0 flags_equip_slot = SLOT_ID diff --git a/sound/machines/pda_ping.ogg b/sound/machines/pda_ping.ogg new file mode 100644 index 0000000000000000000000000000000000000000..2f3135bc3c2253504541b76f57b4b64c3e8fc569 GIT binary patch literal 6747 zcmeHLdpML^+h5O&$>f{{L$b%IOd;b;Qw=6D$~1R-*v57&wAFn56`;qd+zmH%P}y} z8KA)T5>se>so=Kw*(q>I*F?8KpWg&<21EB@(ygG>%@Y+}W!kiIv=r0RRD5NN01b z)Fzedo*uv|Shc@cE3bIXr8-teopxv4ShKE>-3EZIPPpH8<3xpg{s3TiX{DB!rjNLD zxZ4Xvla5_R0X6_4kWOMtEzbUUQ+|Bsb;uz!1zaPKkR)RXX<$Pv&0^RP%W{2FiLJ`fU8GjR5ea>M zVWxw5dnw1kyhEcToe@H;$2r^8zLNK=svpRYzG6Z2OCz=5|Ep0KngK3YW{IMI2K>Mz zoKR>K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