Message Monitor

This commit is contained in:
SabreML
2021-08-28 21:05:59 +01:00
parent fcb52e077c
commit 06ec133374
2 changed files with 21 additions and 10 deletions
+17 -8
View File
@@ -34,6 +34,23 @@
light_color = LIGHT_COLOR_DARKGREEN
/obj/machinery/computer/message_monitor/Initialize()
..()
return INITIALIZE_HINT_LATELOAD // Give the message server time to initialize
/obj/machinery/computer/message_monitor/LateInitialize()
//Is the server isn't linked to a server, and there's a server available, default it to the first one in the list.
if(!linkedServer)
if(length(GLOB.message_servers))
linkedServer = GLOB.message_servers[1]
RegisterSignal(linkedServer, COMSIG_PARENT_QDELETING, .proc/unlink_server)
/obj/machinery/computer/message_monitor/proc/unlink_server()
linkedServer = null
/obj/machinery/computer/message_monitor/Destroy()
customrecepient = null
return ..()
/obj/machinery/computer/message_monitor/screwdriver_act(mob/user, obj/item/I)
if(emag) //Stops people from just unscrewing the monitor and putting it back to get the console working again.
@@ -71,14 +88,6 @@
..()
/obj/machinery/computer/message_monitor/Initialize()
..()
//Is the server isn't linked to a server, and there's a server available, default it to the first one in the list.
if(!linkedServer)
if(GLOB.message_servers && GLOB.message_servers.len > 0)
linkedServer = GLOB.message_servers[1]
return
/obj/machinery/computer/message_monitor/attack_hand(mob/user as mob)
if(..())
return
+4 -2
View File
@@ -60,14 +60,16 @@ GLOBAL_LIST_EMPTY(message_servers)
var/active = TRUE
var/decryptkey = "password"
/obj/machinery/message_server/New()
/obj/machinery/message_server/Initialize(mapload)
. = ..()
GLOB.message_servers += src
decryptkey = GenerateKey()
send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.")
..()
/obj/machinery/message_server/Destroy()
GLOB.message_servers -= src
QDEL_LIST(pda_msgs)
QDEL_LIST(rc_msgs)
return ..()
/obj/machinery/message_server/process()