Migrates SSinstancing to Redis from world.Export() (#17679)

This commit is contained in:
AffectedArc07
2022-05-03 04:29:56 +01:00
committed by GitHub
parent d5e5d9e62b
commit 7bc1bee63a
10 changed files with 136 additions and 93 deletions
+7 -7
View File
@@ -2,6 +2,8 @@
// Like asay but global between instances!
// *Insert changeling hivemind :g joke here*
// TODO - May as well fold this into regular asay. We already have it global enough with the discord integration.
// Same with msay
/client/proc/gsay(msg as text)
set name = "gsay"
set hidden = TRUE
@@ -10,18 +12,16 @@
if(!msg)
return
// Sanitize it all
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
// To whoever says "Why dont you just topic the full message with formatting"
// This lets us use this in other apps, like a discord bot, without HTML parsing
// It also removes a way to put whatever HTML we want in the chat window
var/built_topic = "gsay&msg=[url_encode(msg)]&usr=[url_encode(usr.ckey)]&src=[url_encode(GLOB.configuration.system.instance_id)]"
var/datum/server_command/gsay/GS = SSinstancing.registered_commands["gsay"]
GS.custom_dispatch(usr.ckey, msg)
// Send to peers
SSinstancing.topic_all_peers(built_topic)
// Send to online admins
for(var/client/C in GLOB.admins)
if(R_ADMIN & C.holder.rights)
if(C.holder.rights & R_ADMIN)
to_chat(C, "<span class='admin_channel'>GSAY: [usr.ckey]@[GLOB.configuration.system.instance_id]: [msg]</span>")
SSblackbox.record_feedback("tally", "admin_verb", 1, "gsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!