diff --git a/code/datums/memory/key_memories.dm b/code/datums/memory/key_memories.dm index d777df72e38..48d4b0326e2 100644 --- a/code/datums/memory/key_memories.dm +++ b/code/datums/memory/key_memories.dm @@ -213,3 +213,26 @@ "[protagonist_name] being arrested by security for [crimes].", "[protagonist_name] committing the crimes of [crimes].", ) + +/datum/memory/key/message_server_key + var/decrypt_key + +/datum/memory/key/message_server_key/New( + datum/mind/memorizer_mind, + atom/protagonist, + atom/deuteragonist, + atom/antagonist, + decrypt_key, +) + src.decrypt_key = decrypt_key + return ..() + +/datum/memory/key/message_server_key/get_names() + return list("The daily message server key is [decrypt_key]. Keep it a secret from the clown.") + +/datum/memory/key/message_server_key/get_starts() + return list( + "A sticky note attached to a monitor with [decrypt_key] written on it.", + "Poly the parrot screaming \"[decrypt_key]!\" over and over again.", + "[protagonist_name] spilling coffee over the message monitor while typing [decrypt_key].", + ) diff --git a/code/game/machinery/telecomms/machines/message_server.dm b/code/game/machinery/telecomms/machines/message_server.dm index 6faad6f5eab..946a0a8d6ad 100644 --- a/code/game/machinery/telecomms/machines/message_server.dm +++ b/code/game/machinery/telecomms/machines/message_server.dm @@ -101,9 +101,6 @@ /obj/machinery/telecomms/message_server/Initialize(mapload) . = ..() - if (!decryptkey) - decryptkey = generate_key() - if (calibrating) calibrating += world.time say("Calibrating... Estimated wait time: [rand(3, 9)] minutes.") @@ -122,17 +119,6 @@ if(calibrating) . += span_warning("It's still calibrating.") -/** - * Handles generating a key for the message server, returning it. Doesn't assign - * it in this proc, you have to do so yourself. - */ -/obj/machinery/telecomms/message_server/proc/generate_key() - var/generated_key - generated_key += pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le") - generated_key += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai") - generated_key += pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "0") - return generated_key - /obj/machinery/telecomms/message_server/process() . = ..() if(calibrating && calibrating <= world.time) @@ -172,9 +158,24 @@ id = "Messaging Server" network = "tcommsat" autolinkers = list("messaging") - decryptkey = null //random calibrating = 0 +GLOBAL_VAR(preset_station_message_server_key) + +/obj/machinery/telecomms/message_server/preset/Initialize(mapload) + . = ..() + // Just in case there are multiple preset messageservers somehow once the CE arrives, + // we want those on the station to share the same preset default decrypt key shown in his memories. + var/is_on_station = is_station_level(z) + if(is_on_station && GLOB.preset_station_message_server_key) + decryptkey = GLOB.preset_station_message_server_key + return + //Generate a random password for the message server + decryptkey = pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le") + decryptkey += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai") + decryptkey += "[rand(0, 9)]" + if(is_on_station) + GLOB.preset_station_message_server_key = decryptkey // Root messaging signal datum /datum/signal/subspace/messaging diff --git a/code/modules/jobs/job_types/chief_engineer.dm b/code/modules/jobs/job_types/chief_engineer.dm index cee7b7ca7eb..fcb26731ca1 100644 --- a/code/modules/jobs/job_types/chief_engineer.dm +++ b/code/modules/jobs/job_types/chief_engineer.dm @@ -48,6 +48,10 @@ voice_of_god_power = 1.4 //Command staff has authority +/datum/job/chief_engineer/after_spawn(mob/living/spawned, client/player_client) + . = ..() + spawned.add_mob_memory(/datum/memory/key/message_server_key, decrypt_key = GLOB.preset_station_message_server_key) + /datum/job/chief_engineer/get_captaincy_announcement(mob/living/captain) return "Due to staffing shortages, newly promoted Acting Captain [captain.real_name] on deck!"