adds pipelining to cross-server comm messages (#52447)

* adds pipelining to cross-server comm messages

One server blocking at the network level should not delay the other servers getting their message.

* Update adminhelp.dm

oh fun.

* try 3?

* Fuck it, string proc refs!

* Update adminhelp.dm

* Update adminhelp.dm
This commit is contained in:
Kyle Spier-Swenson
2020-07-26 10:38:16 -07:00
committed by SkyratBot
parent 8bc4b5cc6e
commit ddb27d7140
+19 -5
View File
@@ -573,10 +573,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
send2adminchat(source,final)
send2otherserver(source,final)
//
/// Sends a message to other servers.
/proc/send2otherserver(source,msg,type = "Ahelp",target_servers)
var/comms_key = CONFIG_GET(string/comms_key)
if(!comms_key)
if(!CONFIG_GET(string/comms_key))
debug_world_log("Server cross-comms message not sent for lack of configured key")
return
var/our_id = CONFIG_GET(string/cross_comms_name)
@@ -584,7 +584,6 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
message["message_sender"] = source
message["message"] = msg
message["source"] = "([our_id])"
message["key"] = comms_key
message += type
var/list/servers = CONFIG_GET(keyed_list/cross_server)
@@ -593,8 +592,23 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
continue
if(target_servers && !(I in target_servers))
continue
world.Export("[servers[I]]?[list2params(message)]")
world.send_cross_comms(I, message)
/// Sends a message to a given cross comms server by name (by name for security).
/world/proc/send_cross_comms(server_name, list/message, auth = TRUE)
set waitfor = FALSE
if (auth)
var/comms_key = CONFIG_GET(string/comms_key)
if(!comms_key)
debug_world_log("Server cross-comms message not sent for lack of configured key")
return
message["key"] = comms_key
var/list/servers = CONFIG_GET(keyed_list/cross_server)
var/server_url = servers[server_name]
if (!server_url)
CRASH("Invalid cross comms config: [server_name]")
world.Export("[server_url]?[list2params(message)]")
/proc/tgsadminwho()
var/list/message = list("Admins: ")