diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm index 5337c7a6..c1db4960 100644 --- a/code/game/machinery/telecomms/computers/logbrowser.dm +++ b/code/game/machinery/telecomms/computers/logbrowser.dm @@ -86,7 +86,7 @@ else if(isobj(mobtype)) race = "Machinery" - else if(ispath(mobtype, )) + else if(ispath(mobtype, /mob/living/simple_animal)) race = "Domestic Animal" else diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index a5293500..4b1d10f6 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -1,464 +1,464 @@ -/* - The monitoring computer for the messaging server. - Lets you read PDA and request console messages. -*/ - -#define LINKED_SERVER_NONRESPONSIVE (!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) - -// The monitor itself. -/obj/machinery/computer/message_monitor - name = "message monitor console" - desc = "Used to monitor the crew's PDA messages, as well as request console messages." - icon_screen = "comm_logs" - circuit = /obj/item/circuitboard/computer/message_monitor - //Server linked to. - var/obj/machinery/telecomms/message_server/linkedServer = null - //Sparks effect - For emag - var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread - //Messages - Saves me time if I want to change something. - var/noserver = "ALERT: No server detected." - var/incorrectkey = "ALERT: Incorrect decryption key!" - var/defaultmsg = "Welcome. Please select an option." - var/rebootmsg = "%$&(�: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" - //Computer properties - var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message - var/hacking = FALSE // Is it being hacked into by the AI/Cyborg - var/message = "System bootup complete. Please select an option." // The message that shows on the main menu. - var/auth = FALSE // Are they authenticated? - var/optioncount = 7 - // Custom Message Properties - var/customsender = "System Administrator" - var/obj/item/pda/customrecepient = null - var/customjob = "Admin" - var/custommessage = "This is a test, please ignore." - - light_color = LIGHT_COLOR_GREEN - -/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params) - if(istype(O, /obj/item/screwdriver) && (obj_flags & EMAGGED)) - //Stops people from just unscrewing the monitor and putting it back to get the console working again. - to_chat(user, "It is too hot to mess with!") - else - return ..() - -/obj/machinery/computer/message_monitor/emag_act(mob/user) - if(obj_flags & EMAGGED) - return - if(!isnull(linkedServer)) - obj_flags |= EMAGGED - screen = 2 - spark_system.set_up(5, 0, src) - spark_system.start() - var/obj/item/paper/monitorkey/MK = new(loc, linkedServer) - // Will help make emagging the console not so easy to get away with. - MK.info += "

�%@%(*$%&(�&?*(%&�/{}" - var/time = 100 * length(linkedServer.decryptkey) - addtimer(CALLBACK(src, .proc/UnmagConsole), time) - message = rebootmsg - else - to_chat(user, "A no server error appears on the screen.") - -/obj/machinery/computer/message_monitor/New() - . = ..() - GLOB.telecomms_list += src - -/obj/machinery/computer/message_monitor/Initialize() - ..() - return INITIALIZE_HINT_LATELOAD - -/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) - for(var/obj/machinery/telecomms/message_server/S in GLOB.telecomms_list) - linkedServer = S - break - -/obj/machinery/computer/message_monitor/Destroy() - GLOB.telecomms_list -= src - . = ..() - -/obj/machinery/computer/message_monitor/ui_interact(mob/living/user) - . = ..() - //If the computer is being hacked or is emagged, display the reboot message. - if(hacking || (obj_flags & EMAGGED)) - message = rebootmsg - var/dat = "
" - - if(auth) - dat += "

\[Authenticated\] /" - dat += " Server Power: [linkedServer && linkedServer.toggled ? "\[On\]":"\[Off\]"]

" - else - dat += "

\[Unauthenticated\] /" - dat += " Server Power: [linkedServer && linkedServer.toggled ? "\[On\]":"\[Off\]"]

" - - if(hacking || (obj_flags & EMAGGED)) - screen = 2 - else if(!auth || LINKED_SERVER_NONRESPONSIVE) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - screen = 0 - - switch(screen) - //Main menu - if(0) - // = TAB - var/i = 0 - dat += "
[++i]. Link To A Server
" - if(auth) - if(LINKED_SERVER_NONRESPONSIVE) - dat += "
ERROR: Server not found!
" - else - dat += "
[++i]. View Message Logs
" - dat += "
[++i]. View Request Console Logs
" - dat += "
[++i]. Clear Message Logs
" - dat += "
[++i]. Clear Request Console Logs
" - dat += "
[++i]. Set Custom Key
" - dat += "
[++i]. Send Admin Message
" - else - for(var/n = ++i; n <= optioncount; n++) - dat += "
[n]. ---------------
" - var/mob/living/silicon/S = usr - if(istype(S) && S.hack_software) - //Malf/Traitor AIs can bruteforce into the system to gain the Key. - dat += "
*&@#. Bruteforce Key
" - else - dat += "
" - - //Bottom message - if(!auth) - dat += "

Please authenticate with the server in order to show additional options." - else - dat += "

Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties." - - //Message Logs - if(1) - var/index = 0 - dat += "
Back - Refresh

" - dat += "" - for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs) - index++ - if(index > 3000) - break - // Del - Sender - Recepient - Message - // X - Al Green - Your Mom - WHAT UP!? - dat += "" - dat += "
XSenderRecipientMessage
X
[pda.sender][pda.recipient][pda.message][pda.picture ? " (Photo)":""]
" - //Hacking screen. - if(2) - if(isAI(user) || iscyborg(user)) - dat += "Brute-forcing for server key.
It will take 20 seconds for every character that the password has." - dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time." - else - //It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever. - dat += {"01000010011100100111010101110100011001010010110
- 10110011001101111011100100110001101101001011011100110011
- 10010000001100110011011110111001000100000011100110110010
- 10111001001110110011001010111001000100000011010110110010
- 10111100100101110001000000100100101110100001000000111011
- 10110100101101100011011000010000001110100011000010110101
- 10110010100100000001100100011000000100000011100110110010
- 10110001101101111011011100110010001110011001000000110011
- 00110111101110010001000000110010101110110011001010111001
- 00111100100100000011000110110100001100001011100100110000
- 10110001101110100011001010111001000100000011101000110100
- 00110000101110100001000000111010001101000011001010010000
- 00111000001100001011100110111001101110111011011110111001
- 00110010000100000011010000110000101110011001011100010000
- 00100100101101110001000000111010001101000011001010010000
- 00110110101100101011000010110111001110100011010010110110
- 10110010100101100001000000111010001101000011010010111001
- 10010000001100011011011110110111001110011011011110110110
- 00110010100100000011000110110000101101110001000000111001
- 00110010101110110011001010110000101101100001000000111100
- 10110111101110101011100100010000001110100011100100111010
- 10110010100100000011010010110111001110100011001010110111
- 00111010001101001011011110110111001110011001000000110100
- 10110011000100000011110010110111101110101001000000110110
- 00110010101110100001000000111001101101111011011010110010
- 10110111101101110011001010010000001100001011000110110001
- 10110010101110011011100110010000001101001011101000010111
- 00010000001001101011000010110101101100101001000000111001
- 10111010101110010011001010010000001101110011011110010000
- 00110100001110101011011010110000101101110011100110010000
- 00110010101101110011101000110010101110010001000000111010
- 00110100001100101001000000111001001101111011011110110110
- 10010000001100100011101010111001001101001011011100110011
- 10010000001110100011010000110000101110100001000000111010
- 001101001011011010110010100101110"} - - //Fake messages - if(3) - dat += "
Back - Reset

" - - dat += {" - - - - "} - //Sender - Sender's Job - Recepient - Message - //Al Green- Your Dad - Your Mom - WHAT UP!? - - dat += {" - - - "} - dat += "
SenderSender's JobRecipientMessage
[customsender][customjob][customrecepient ? customrecepient.owner : "NONE"][custommessage]

Send" - - //Request Console Logs - if(4) - - var/index = 0 - /* data_rc_msg - X - 5% - var/rec_dpt = "Unspecified" //name of the person - 15% - var/send_dpt = "Unspecified" //name of the sender- 15% - var/message = "Blank" //transferred message - 300px - var/stamp = "Unstamped" - 15% - var/id_auth = "Unauthenticated" - 15% - var/priority = "Normal" - 10% - */ - dat += "
Back - Refresh

" - dat += {" - "} - for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs) - index++ - if(index > 3000) - break - // Del - Sender - Recepient - Message - // X - Al Green - Your Mom - WHAT UP!? - dat += {" - "} - dat += "
XSending Dep.Receiving Dep.MessageStampID Auth.Priority.
X
[rc.send_dpt][rc.rec_dpt][rc.message][rc.stamp][rc.id_auth][rc.priority]
" - - message = defaultmsg - var/datum/browser/popup = new(user, "hologram_console", name, 700, 700) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) - popup.open() - -/obj/machinery/computer/message_monitor/proc/BruteForce(mob/user) - if(isnull(linkedServer)) - to_chat(user, "Could not complete brute-force: Linked Server Disconnected!") - else - var/currentKey = linkedServer.decryptkey - to_chat(user, "Brute-force completed! The key is '[currentKey]'.") - hacking = FALSE - screen = 0 // Return the screen back to normal - -/obj/machinery/computer/message_monitor/proc/UnmagConsole() - obj_flags &= ~EMAGGED - -/obj/machinery/computer/message_monitor/proc/ResetMessage() - customsender = "System Administrator" - customrecepient = null - custommessage = "This is a test, please ignore." - customjob = "Admin" - -/obj/machinery/computer/message_monitor/Topic(href, href_list) - if(..()) - return - - if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr)) - //Authenticate - if (href_list["auth"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - auth = FALSE - screen = 0 - else - var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null) - if(dkey && dkey != "") - if(linkedServer.decryptkey == dkey) - auth = TRUE - else - message = incorrectkey - - //Turn the server on/off. - if (href_list["active"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - linkedServer.toggled = !linkedServer.toggled - //Find a server - if (href_list["find"]) - var/list/message_servers = list() - for (var/obj/machinery/telecomms/message_server/M in GLOB.telecomms_list) - message_servers += M - - if(message_servers.len > 1) - linkedServer = input(usr, "Please select a server.", "Select a server.", null) as null|anything in message_servers - message = "NOTICE: Server selected." - else if(message_servers.len > 0) - linkedServer = message_servers[1] - message = "NOTICE: Only Single Server Detected - Server selected." - else - message = noserver - - //View the logs - KEY REQUIRED - if (href_list["view_logs"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - screen = 1 - - //Clears the logs - KEY REQUIRED - if (href_list["clear_logs"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - linkedServer.pda_msgs = list() - message = "NOTICE: Logs cleared." - //Clears the request console logs - KEY REQUIRED - if (href_list["clear_requests"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - linkedServer.rc_msgs = list() - message = "NOTICE: Logs cleared." - //Change the password - KEY REQUIRED - if (href_list["pass"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - var/dkey = stripped_input(usr, "Please enter the decryption key.") - if(dkey && dkey != "") - if(linkedServer.decryptkey == dkey) - var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):")) - if(length(newkey) <= 3) - message = "NOTICE: Decryption key too short!" - else if(length(newkey) > 16) - message = "NOTICE: Decryption key too long!" - else if(newkey && newkey != "") - linkedServer.decryptkey = newkey - message = "NOTICE: Decryption key set." - else - message = incorrectkey - - //Hack the Console to get the password - if (href_list["hack"]) - var/mob/living/silicon/S = usr - if(istype(S) && S.hack_software) - hacking = TRUE - screen = 2 - //Time it takes to bruteforce is dependant on the password length. - spawn(100*length(linkedServer.decryptkey)) - if(src && linkedServer && usr) - BruteForce(usr) - //Delete the log. - if (href_list["delete_logs"]) - //Are they on the view logs screen? - if(screen == 1) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else //if(istype(href_list["delete_logs"], /datum/data_pda_msg)) - linkedServer.pda_msgs -= locate(href_list["delete_logs"]) - message = "NOTICE: Log Deleted!" - //Delete the request console log. - if (href_list["delete_requests"]) - //Are they on the view logs screen? - if(screen == 4) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else //if(istype(href_list["delete_logs"], /datum/data_pda_msg)) - linkedServer.rc_msgs -= locate(href_list["delete_requests"]) - message = "NOTICE: Log Deleted!" - //Create a custom message - if (href_list["msg"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - screen = 3 - //Fake messaging selection - KEY REQUIRED - if (href_list["select"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - screen = 0 - else - switch(href_list["select"]) - - //Reset - if("Reset") - ResetMessage() - - //Select Your Name - if("Sender") - customsender = stripped_input(usr, "Please enter the sender's name.") || customsender - - //Select Receiver - if("Recepient") - //Get out list of viable PDAs - var/list/obj/item/pda/sendPDAs = get_viewable_pdas() - if(GLOB.PDAs && GLOB.PDAs.len > 0) - customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs) - else - customrecepient = null - - //Enter custom job - if("RecJob") - customjob = stripped_input(usr, "Please enter the sender's job.") || customjob - - //Enter message - if("Message") - custommessage = stripped_input(usr, "Please enter your message.") || custommessage - - //Send message - if("Send") - if(isnull(customsender) || customsender == "") - customsender = "UNKNOWN" - - if(isnull(customrecepient)) - message = "NOTICE: No recepient selected!" - return attack_hand(usr) - - if(isnull(custommessage) || custommessage == "") - message = "NOTICE: No message entered!" - return attack_hand(usr) - - var/datum/signal/subspace/pda/signal = new(src, list( - "name" = "[customsender]", - "job" = "[customjob]", - "message" = custommessage, - "emoji_message" = emoji_parse(custommessage), - "targets" = list("[customrecepient.owner] ([customrecepient.ownjob])") - )) - // this will log the signal and transmit it to the target - linkedServer.receive_information(signal, null) - usr.log_message("(PDA: [name]) sent \"[custommessage]\" to [signal.format_target()]", LOG_PDA) - - - //Request Console Logs - KEY REQUIRED - if(href_list["view_requests"]) - if(LINKED_SERVER_NONRESPONSIVE) - message = noserver - else if(auth) - screen = 4 - - if (href_list["back"]) - screen = 0 - - return attack_hand(usr) - -#undef LINKED_SERVER_NONRESPONSIVE - -/obj/item/paper/monitorkey - name = "monitor decryption key" - -/obj/item/paper/monitorkey/Initialize(mapload, obj/machinery/telecomms/message_server/server) - ..() - if (server) - print(server) - return INITIALIZE_HINT_NORMAL - else - return INITIALIZE_HINT_LATELOAD - -/obj/item/paper/monitorkey/proc/print(obj/machinery/telecomms/message_server/server) - info = "

Daily Key Reset


The new message monitor key is '[server.decryptkey]'.
Please keep this a secret and away from the clown.
If necessary, change the password to a more secure one." - info_links = info - add_overlay("paper_words") - -/obj/item/paper/monitorkey/LateInitialize() - for (var/obj/machinery/telecomms/message_server/server in GLOB.telecomms_list) - if (server.decryptkey) - print(server) - break +/* + The monitoring computer for the messaging server. + Lets you read PDA and request console messages. +*/ + +#define LINKED_SERVER_NONRESPONSIVE (!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) + +// The monitor itself. +/obj/machinery/computer/message_monitor + name = "message monitor console" + desc = "Used to monitor the crew's PDA messages, as well as request console messages." + icon_screen = "comm_logs" + circuit = /obj/item/circuitboard/computer/message_monitor + //Server linked to. + var/obj/machinery/telecomms/message_server/linkedServer = null + //Sparks effect - For emag + var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread + //Messages - Saves me time if I want to change something. + var/noserver = "ALERT: No server detected." + var/incorrectkey = "ALERT: Incorrect decryption key!" + var/defaultmsg = "Welcome. Please select an option." + var/rebootmsg = "%$&(�: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" + //Computer properties + var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message + var/hacking = FALSE // Is it being hacked into by the AI/Cyborg + var/message = "System bootup complete. Please select an option." // The message that shows on the main menu. + var/auth = FALSE // Are they authenticated? + var/optioncount = 7 + // Custom Message Properties + var/customsender = "System Administrator" + var/obj/item/pda/customrecepient = null + var/customjob = "Admin" + var/custommessage = "This is a test, please ignore." + + light_color = LIGHT_COLOR_GREEN + +/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params) + if(istype(O, /obj/item/screwdriver) && (obj_flags & EMAGGED)) + //Stops people from just unscrewing the monitor and putting it back to get the console working again. + to_chat(user, "It is too hot to mess with!") + else + return ..() + +/obj/machinery/computer/message_monitor/emag_act(mob/user) + if(obj_flags & EMAGGED) + return + if(!isnull(linkedServer)) + obj_flags |= EMAGGED + screen = 2 + spark_system.set_up(5, 0, src) + spark_system.start() + var/obj/item/paper/monitorkey/MK = new(loc, linkedServer) + // Will help make emagging the console not so easy to get away with. + MK.info += "

�%@%(*$%&(�&?*(%&�/{}" + var/time = 100 * length(linkedServer.decryptkey) + addtimer(CALLBACK(src, .proc/UnmagConsole), time) + message = rebootmsg + else + to_chat(user, "A no server error appears on the screen.") + +/obj/machinery/computer/message_monitor/New() + . = ..() + GLOB.telecomms_list += src + +/obj/machinery/computer/message_monitor/Initialize() + ..() + return INITIALIZE_HINT_LATELOAD + +/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) + for(var/obj/machinery/telecomms/message_server/S in GLOB.telecomms_list) + linkedServer = S + break + +/obj/machinery/computer/message_monitor/Destroy() + GLOB.telecomms_list -= src + . = ..() + +/obj/machinery/computer/message_monitor/ui_interact(mob/living/user) + . = ..() + //If the computer is being hacked or is emagged, display the reboot message. + if(hacking || (obj_flags & EMAGGED)) + message = rebootmsg + var/dat = "
" + + if(auth) + dat += "

\[Authenticated\] /" + dat += " Server Power: [linkedServer && linkedServer.toggled ? "\[On\]":"\[Off\]"]

" + else + dat += "

\[Unauthenticated\] /" + dat += " Server Power: [linkedServer && linkedServer.toggled ? "\[On\]":"\[Off\]"]

" + + if(hacking || (obj_flags & EMAGGED)) + screen = 2 + else if(!auth || LINKED_SERVER_NONRESPONSIVE) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + screen = 0 + + switch(screen) + //Main menu + if(0) + // = TAB + var/i = 0 + dat += "
[++i]. Link To A Server
" + if(auth) + if(LINKED_SERVER_NONRESPONSIVE) + dat += "
ERROR: Server not found!
" + else + dat += "
[++i]. View Message Logs
" + dat += "
[++i]. View Request Console Logs
" + dat += "
[++i]. Clear Message Logs
" + dat += "
[++i]. Clear Request Console Logs
" + dat += "
[++i]. Set Custom Key
" + dat += "
[++i]. Send Admin Message
" + else + for(var/n = ++i; n <= optioncount; n++) + dat += "
[n]. ---------------
" + var/mob/living/silicon/S = usr + if(istype(S) && S.hack_software) + //Malf/Traitor AIs can bruteforce into the system to gain the Key. + dat += "
*&@#. Bruteforce Key
" + else + dat += "
" + + //Bottom message + if(!auth) + dat += "

Please authenticate with the server in order to show additional options." + else + dat += "

Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties." + + //Message Logs + if(1) + var/index = 0 + dat += "
Back - Refresh

" + dat += "" + for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs) + index++ + if(index > 3000) + break + // Del - Sender - Recepient - Message + // X - Al Green - Your Mom - WHAT UP!? + dat += "" + dat += "
XSenderRecipientMessage
X
[pda.sender][pda.recipient][pda.message][pda.picture ? " (Photo)":""]
" + //Hacking screen. + if(2) + if(isAI(user) || iscyborg(user)) + dat += "Brute-forcing for server key.
It will take 20 seconds for every character that the password has." + dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time." + else + //It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever. + dat += {"01000010011100100111010101110100011001010010110
+ 10110011001101111011100100110001101101001011011100110011
+ 10010000001100110011011110111001000100000011100110110010
+ 10111001001110110011001010111001000100000011010110110010
+ 10111100100101110001000000100100101110100001000000111011
+ 10110100101101100011011000010000001110100011000010110101
+ 10110010100100000001100100011000000100000011100110110010
+ 10110001101101111011011100110010001110011001000000110011
+ 00110111101110010001000000110010101110110011001010111001
+ 00111100100100000011000110110100001100001011100100110000
+ 10110001101110100011001010111001000100000011101000110100
+ 00110000101110100001000000111010001101000011001010010000
+ 00111000001100001011100110111001101110111011011110111001
+ 00110010000100000011010000110000101110011001011100010000
+ 00100100101101110001000000111010001101000011001010010000
+ 00110110101100101011000010110111001110100011010010110110
+ 10110010100101100001000000111010001101000011010010111001
+ 10010000001100011011011110110111001110011011011110110110
+ 00110010100100000011000110110000101101110001000000111001
+ 00110010101110110011001010110000101101100001000000111100
+ 10110111101110101011100100010000001110100011100100111010
+ 10110010100100000011010010110111001110100011001010110111
+ 00111010001101001011011110110111001110011001000000110100
+ 10110011000100000011110010110111101110101001000000110110
+ 00110010101110100001000000111001101101111011011010110010
+ 10110111101101110011001010010000001100001011000110110001
+ 10110010101110011011100110010000001101001011101000010111
+ 00010000001001101011000010110101101100101001000000111001
+ 10111010101110010011001010010000001101110011011110010000
+ 00110100001110101011011010110000101101110011100110010000
+ 00110010101101110011101000110010101110010001000000111010
+ 00110100001100101001000000111001001101111011011110110110
+ 10010000001100100011101010111001001101001011011100110011
+ 10010000001110100011010000110000101110100001000000111010
+ 001101001011011010110010100101110"} + + //Fake messages + if(3) + dat += "
Back - Reset

" + + dat += {" + + + + "} + //Sender - Sender's Job - Recepient - Message + //Al Green- Your Dad - Your Mom - WHAT UP!? + + dat += {" + + + "} + dat += "
SenderSender's JobRecipientMessage
[customsender][customjob][customrecepient ? customrecepient.owner : "NONE"][custommessage]

Send" + + //Request Console Logs + if(4) + + var/index = 0 + /* data_rc_msg + X - 5% + var/rec_dpt = "Unspecified" //name of the person - 15% + var/send_dpt = "Unspecified" //name of the sender- 15% + var/message = "Blank" //transferred message - 300px + var/stamp = "Unstamped" - 15% + var/id_auth = "Unauthenticated" - 15% + var/priority = "Normal" - 10% + */ + dat += "
Back - Refresh

" + dat += {" + "} + for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs) + index++ + if(index > 3000) + break + // Del - Sender - Recepient - Message + // X - Al Green - Your Mom - WHAT UP!? + dat += {" + "} + dat += "
XSending Dep.Receiving Dep.MessageStampID Auth.Priority.
X
[rc.send_dpt][rc.rec_dpt][rc.message][rc.stamp][rc.id_auth][rc.priority]
" + + message = defaultmsg + var/datum/browser/popup = new(user, "hologram_console", name, 700, 700) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) + popup.open() + +/obj/machinery/computer/message_monitor/proc/BruteForce(mob/user) + if(isnull(linkedServer)) + to_chat(user, "Could not complete brute-force: Linked Server Disconnected!") + else + var/currentKey = linkedServer.decryptkey + to_chat(user, "Brute-force completed! The key is '[currentKey]'.") + hacking = FALSE + screen = 0 // Return the screen back to normal + +/obj/machinery/computer/message_monitor/proc/UnmagConsole() + obj_flags &= ~EMAGGED + +/obj/machinery/computer/message_monitor/proc/ResetMessage() + customsender = "System Administrator" + customrecepient = null + custommessage = "This is a test, please ignore." + customjob = "Admin" + +/obj/machinery/computer/message_monitor/Topic(href, href_list) + if(..()) + return + + if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr)) + //Authenticate + if (href_list["auth"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + auth = FALSE + screen = 0 + else + var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null) + if(dkey && dkey != "") + if(linkedServer.decryptkey == dkey) + auth = TRUE + else + message = incorrectkey + + //Turn the server on/off. + if (href_list["active"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + linkedServer.toggled = !linkedServer.toggled + //Find a server + if (href_list["find"]) + var/list/message_servers = list() + for (var/obj/machinery/telecomms/message_server/M in GLOB.telecomms_list) + message_servers += M + + if(message_servers.len > 1) + linkedServer = input(usr, "Please select a server.", "Select a server.", null) as null|anything in message_servers + message = "NOTICE: Server selected." + else if(message_servers.len > 0) + linkedServer = message_servers[1] + message = "NOTICE: Only Single Server Detected - Server selected." + else + message = noserver + + //View the logs - KEY REQUIRED + if (href_list["view_logs"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + screen = 1 + + //Clears the logs - KEY REQUIRED + if (href_list["clear_logs"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + linkedServer.pda_msgs = list() + message = "NOTICE: Logs cleared." + //Clears the request console logs - KEY REQUIRED + if (href_list["clear_requests"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + linkedServer.rc_msgs = list() + message = "NOTICE: Logs cleared." + //Change the password - KEY REQUIRED + if (href_list["pass"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + var/dkey = stripped_input(usr, "Please enter the decryption key.") + if(dkey && dkey != "") + if(linkedServer.decryptkey == dkey) + var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):")) + if(length(newkey) <= 3) + message = "NOTICE: Decryption key too short!" + else if(length(newkey) > 16) + message = "NOTICE: Decryption key too long!" + else if(newkey && newkey != "") + linkedServer.decryptkey = newkey + message = "NOTICE: Decryption key set." + else + message = incorrectkey + + //Hack the Console to get the password + if (href_list["hack"]) + var/mob/living/silicon/S = usr + if(istype(S) && S.hack_software) + hacking = TRUE + screen = 2 + //Time it takes to bruteforce is dependant on the password length. + spawn(100*length(linkedServer.decryptkey)) + if(src && linkedServer && usr) + BruteForce(usr) + //Delete the log. + if (href_list["delete_logs"]) + //Are they on the view logs screen? + if(screen == 1) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else //if(istype(href_list["delete_logs"], /datum/data_pda_msg)) + linkedServer.pda_msgs -= locate(href_list["delete_logs"]) + message = "NOTICE: Log Deleted!" + //Delete the request console log. + if (href_list["delete_requests"]) + //Are they on the view logs screen? + if(screen == 4) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else //if(istype(href_list["delete_logs"], /datum/data_pda_msg)) + linkedServer.rc_msgs -= locate(href_list["delete_requests"]) + message = "NOTICE: Log Deleted!" + //Create a custom message + if (href_list["msg"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + screen = 3 + //Fake messaging selection - KEY REQUIRED + if (href_list["select"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + screen = 0 + else + switch(href_list["select"]) + + //Reset + if("Reset") + ResetMessage() + + //Select Your Name + if("Sender") + customsender = stripped_input(usr, "Please enter the sender's name.") || customsender + + //Select Receiver + if("Recepient") + //Get out list of viable PDAs + var/list/obj/item/pda/sendPDAs = get_viewable_pdas() + if(GLOB.PDAs && GLOB.PDAs.len > 0) + customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs) + else + customrecepient = null + + //Enter custom job + if("RecJob") + customjob = stripped_input(usr, "Please enter the sender's job.") || customjob + + //Enter message + if("Message") + custommessage = stripped_input(usr, "Please enter your message.") || custommessage + + //Send message + if("Send") + if(isnull(customsender) || customsender == "") + customsender = "UNKNOWN" + + if(isnull(customrecepient)) + message = "NOTICE: No recepient selected!" + return attack_hand(usr) + + if(isnull(custommessage) || custommessage == "") + message = "NOTICE: No message entered!" + return attack_hand(usr) + + var/datum/signal/subspace/pda/signal = new(src, list( + "name" = "[customsender]", + "job" = "[customjob]", + "message" = custommessage, + "emoji_message" = emoji_parse(custommessage), + "targets" = list("[customrecepient.owner] ([customrecepient.ownjob])") + )) + // this will log the signal and transmit it to the target + linkedServer.receive_information(signal, null) + usr.log_message("(PDA: [name] | [usr.real_name]) sent \"[custommessage]\" to [signal.format_target()]", LOG_PDA) + + + //Request Console Logs - KEY REQUIRED + if(href_list["view_requests"]) + if(LINKED_SERVER_NONRESPONSIVE) + message = noserver + else if(auth) + screen = 4 + + if (href_list["back"]) + screen = 0 + + return attack_hand(usr) + +#undef LINKED_SERVER_NONRESPONSIVE + +/obj/item/paper/monitorkey + name = "monitor decryption key" + +/obj/item/paper/monitorkey/Initialize(mapload, obj/machinery/telecomms/message_server/server) + ..() + if (server) + print(server) + return INITIALIZE_HINT_NORMAL + else + return INITIALIZE_HINT_LATELOAD + +/obj/item/paper/monitorkey/proc/print(obj/machinery/telecomms/message_server/server) + info = "

Daily Key Reset


The new message monitor key is '[server.decryptkey]'.
Please keep this a secret and away from the clown.
If necessary, change the password to a more secure one." + info_links = info + add_overlay("paper_words") + +/obj/item/paper/monitorkey/LateInitialize() + for (var/obj/machinery/telecomms/message_server/server in GLOB.telecomms_list) + if (server.decryptkey) + print(server) + break diff --git a/code/game/machinery/telecomms/machines/bus.dm b/code/game/machinery/telecomms/machines/bus.dm index 259333e9..51bbc04e 100644 --- a/code/game/machinery/telecomms/machines/bus.dm +++ b/code/game/machinery/telecomms/machines/bus.dm @@ -32,7 +32,7 @@ return // Try sending it! - var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster, /obj/machinery/telecomms/bus) + var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster) for(var/send in try_send) if(relay_information(signal, send)) diff --git a/code/game/machinery/telecomms/machines/hub.dm b/code/game/machinery/telecomms/machines/hub.dm index b23c4436..e7e37887 100644 --- a/code/game/machinery/telecomms/machines/hub.dm +++ b/code/game/machinery/telecomms/machines/hub.dm @@ -39,5 +39,5 @@ network = "tcommsat" autolinkers = list("hub", "relay", "s_relay", "m_relay", "r_relay", "h_relay", "science", "medical", "supply", "service", "common", "command", "engineering", "security", - "receiverA", "receiverB", "broadcasterA", "broadcasterB") + "receiverA", "receiverB", "broadcasterA", "broadcasterB", "autorelay") diff --git a/code/game/machinery/telecomms/machines/relay.dm b/code/game/machinery/telecomms/machines/relay.dm index 9e671627..65f70a4f 100644 --- a/code/game/machinery/telecomms/machines/relay.dm +++ b/code/game/machinery/telecomms/machines/relay.dm @@ -49,6 +49,11 @@ /obj/machinery/telecomms/relay/preset network = "tcommsat" +/obj/machinery/telecomms/relay/Initialize(mapload) + . = ..() + if(autolinkers.len) //We want lateloaded presets to autolink (lateloaded aways/ruins/shuttles) + return INITIALIZE_HINT_LATELOAD + /obj/machinery/telecomms/relay/preset/station id = "Station Relay" autolinkers = list("s_relay") @@ -74,3 +79,8 @@ icon = 'icons/obj/clockwork_objects.dmi' hide = TRUE autolinkers = list("h_relay") + +//Generic preset relay +/obj/machinery/telecomms/relay/preset/auto + hide = TRUE + autolinkers = list("autorelay") diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index db250193..b82b3071 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -1,151 +1,152 @@ - -/* - Hello, friends, this is Doohl from sexylands. You may be wondering what this - monstrous code file is. Sit down, boys and girls, while I tell you the tale. - - - The telecom machines were designed to be compatible with any radio - signals, provided they use subspace transmission. Currently they are only used for - headsets, but they can eventually be outfitted for real COMPUTER networks. This - is just a skeleton, ladies and gentlemen. - - Look at radio.dm for the prequel to this code. -*/ - -GLOBAL_LIST_EMPTY(telecomms_list) - -/obj/machinery/telecomms - icon = 'icons/obj/machines/telecomms.dmi' - critical_machine = TRUE - var/list/links = list() // list of machines this machine is linked to - var/traffic = 0 // value increases as traffic increases - var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed) - var/list/autolinkers = list() // list of text/number values to link with - var/id = "NULL" // identification string - var/network = "NULL" // the network of the machinery - - var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all - - var/on = TRUE - var/toggled = TRUE // Is it toggled on - var/long_range_link = FALSE // Can you link it across Z levels or on the otherside of the map? (Relay & Hub) - var/hide = FALSE // Is it a hidden machine? - - -/obj/machinery/telecomms/proc/relay_information(datum/signal/subspace/signal, filter, copysig, amount = 20) - // relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending - - if(!on) - return - var/send_count = 0 - - // Apply some lag based on traffic rates - var/netlag = round(traffic / 50) - if(netlag > signal.data["slow"]) - signal.data["slow"] = netlag - - // Loop through all linked machines and send the signal or copy. - for(var/obj/machinery/telecomms/machine in links) - if(filter && !istype( machine, filter )) - continue - if(!machine.on) - continue - if(amount && send_count >= amount) - break - if(z != machine.loc.z && !long_range_link && !machine.long_range_link) - continue - - send_count++ - if(machine.is_freq_listening(signal)) - machine.traffic++ - - if(copysig) - machine.receive_information(signal.copy(), src) - else - machine.receive_information(signal, src) - - if(send_count > 0 && is_freq_listening(signal)) - traffic++ - - return send_count - -/obj/machinery/telecomms/proc/relay_direct_information(datum/signal/signal, obj/machinery/telecomms/machine) - // send signal directly to a machine - machine.receive_information(signal, src) - -/obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) - // receive information from linked machinery - -/obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal) - // return TRUE if found, FALSE if not found - return signal && (!freq_listening.len || (signal.frequency in freq_listening)) - -/obj/machinery/telecomms/Initialize(mapload) - . = ..() - GLOB.telecomms_list += src - if(mapload && autolinkers.len) - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/telecomms/LateInitialize() - ..() - for(var/obj/machinery/telecomms/T in (long_range_link ? GLOB.telecomms_list : urange(20, src, 1))) - add_link(T) - -/obj/machinery/telecomms/Destroy() - GLOB.telecomms_list -= src - for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list) - comm.links -= src - links = list() - return ..() - -// Used in auto linking -/obj/machinery/telecomms/proc/add_link(obj/machinery/telecomms/T) - var/turf/position = get_turf(src) - var/turf/T_position = get_turf(T) - if((position.z == T_position.z) || (long_range_link && T.long_range_link)) - if(src != T) - for(var/x in autolinkers) - if(x in T.autolinkers) - links |= T - -/obj/machinery/telecomms/update_icon() - if(on) - if(panel_open) - icon_state = "[initial(icon_state)]_o" - else - icon_state = initial(icon_state) - else - if(panel_open) - icon_state = "[initial(icon_state)]_o_off" - else - icon_state = "[initial(icon_state)]_off" - -/obj/machinery/telecomms/proc/update_power() - - if(toggled) - if(stat & (BROKEN|NOPOWER|EMPED)) // if powered, on. if not powered, off. if too damaged, off - on = FALSE - else - on = TRUE - else - on = FALSE - -/obj/machinery/telecomms/process() - update_power() - - // Update the icon - update_icon() - - if(traffic > 0) - traffic -= netspeed - -/obj/machinery/telecomms/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_SELF) - return - if(prob(100/severity)) - if(!(stat & EMPED)) - stat |= EMPED - var/duration = (300 * 10)/severity - spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot. - stat &= ~EMPED + +/* + Hello, friends, this is Doohl from sexylands. You may be wondering what this + monstrous code file is. Sit down, boys and girls, while I tell you the tale. + + + The telecom machines were designed to be compatible with any radio + signals, provided they use subspace transmission. Currently they are only used for + headsets, but they can eventually be outfitted for real COMPUTER networks. This + is just a skeleton, ladies and gentlemen. + + Look at radio.dm for the prequel to this code. +*/ + +GLOBAL_LIST_EMPTY(telecomms_list) + +/obj/machinery/telecomms + icon = 'icons/obj/machines/telecomms.dmi' + critical_machine = TRUE + var/list/links = list() // list of machines this machine is linked to + var/traffic = 0 // value increases as traffic increases + var/netspeed = 5 // how much traffic to lose per tick (50 gigabytes/second * netspeed) + var/list/autolinkers = list() // list of text/number values to link with + var/id = "NULL" // identification string + var/network = "NULL" // the network of the machinery + + var/list/freq_listening = list() // list of frequencies to tune into: if none, will listen to all + + var/on = TRUE + var/toggled = TRUE // Is it toggled on + var/long_range_link = FALSE // Can you link it across Z levels or on the otherside of the map? (Relay & Hub) + var/hide = FALSE // Is it a hidden machine? + + +/obj/machinery/telecomms/proc/relay_information(datum/signal/subspace/signal, filter, copysig, amount = 20) + // relay signal to all linked machinery that are of type [filter]. If signal has been sent [amount] times, stop sending + + if(!on) + return + var/send_count = 0 + + // Apply some lag based on traffic rates + var/netlag = round(traffic / 50) + if(netlag > signal.data["slow"]) + signal.data["slow"] = netlag + + // Loop through all linked machines and send the signal or copy. + for(var/obj/machinery/telecomms/machine in links) + if(filter && !istype( machine, filter )) + continue + if(!machine.on) + continue + if(amount && send_count >= amount) + break + if(z != machine.loc.z && !long_range_link && !machine.long_range_link) + continue + + send_count++ + if(machine.is_freq_listening(signal)) + machine.traffic++ + + if(copysig) + machine.receive_information(signal.copy(), src) + else + machine.receive_information(signal, src) + + if(send_count > 0 && is_freq_listening(signal)) + traffic++ + + return send_count + +/obj/machinery/telecomms/proc/relay_direct_information(datum/signal/signal, obj/machinery/telecomms/machine) + // send signal directly to a machine + machine.receive_information(signal, src) + +/obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) + // receive information from linked machinery + +/obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal) + // return TRUE if found, FALSE if not found + return signal && (!freq_listening.len || (signal.frequency in freq_listening)) + +/obj/machinery/telecomms/Initialize(mapload) + . = ..() + GLOB.telecomms_list += src + if(mapload && autolinkers.len) + return INITIALIZE_HINT_LATELOAD + +/obj/machinery/telecomms/LateInitialize() + ..() + for(var/obj/machinery/telecomms/T in (long_range_link ? GLOB.telecomms_list : urange(20, src, 1))) + add_link(T) + +/obj/machinery/telecomms/Destroy() + GLOB.telecomms_list -= src + for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list) + comm.links -= src + links = list() + return ..() + +// Used in auto linking +/obj/machinery/telecomms/proc/add_link(obj/machinery/telecomms/T) + var/turf/position = get_turf(src) + var/turf/T_position = get_turf(T) + if((position.z == T_position.z) || (long_range_link && T.long_range_link)) + if(src != T) + for(var/x in autolinkers) + if(x in T.autolinkers) + links |= T + T.links |= src + +/obj/machinery/telecomms/update_icon() + if(on) + if(panel_open) + icon_state = "[initial(icon_state)]_o" + else + icon_state = initial(icon_state) + else + if(panel_open) + icon_state = "[initial(icon_state)]_o_off" + else + icon_state = "[initial(icon_state)]_off" + +/obj/machinery/telecomms/proc/update_power() + + if(toggled) + if(stat & (BROKEN|NOPOWER|EMPED)) // if powered, on. if not powered, off. if too damaged, off + on = FALSE + else + on = TRUE + else + on = FALSE + +/obj/machinery/telecomms/process() + update_power() + + // Update the icon + update_icon() + + if(traffic > 0) + traffic -= netspeed + +/obj/machinery/telecomms/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + if(prob(100/severity)) + if(!(stat & EMPED)) + stat |= EMPED + var/duration = (300 * 10)/severity + spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot. + stat &= ~EMPED