mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Cross server comms update. (#48850)
* Makes cross server config easier to manage and lets you send messages to specific stations. * No need for fancy copy
This commit is contained in:
@@ -584,19 +584,26 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
msg2 = replacetext(replacetext(msg2, "\proper", ""), "\improper", "")
|
||||
world.TgsTargetedChatBroadcast("[msg] | [msg2]", TRUE)
|
||||
|
||||
/proc/send2otherserver(source,msg,type = "Ahelp")
|
||||
//
|
||||
/proc/send2otherserver(source,msg,type = "Ahelp",target_servers)
|
||||
var/comms_key = CONFIG_GET(string/comms_key)
|
||||
if(!comms_key)
|
||||
return
|
||||
|
||||
var/our_id = CONFIG_GET(string/cross_comms_name)
|
||||
var/list/message = list()
|
||||
message["message_sender"] = source
|
||||
message["message"] = msg
|
||||
message["source"] = "([CONFIG_GET(string/cross_comms_name)])"
|
||||
message["source"] = "([our_id])"
|
||||
message["key"] = comms_key
|
||||
message += type
|
||||
|
||||
var/list/servers = CONFIG_GET(keyed_list/cross_server)
|
||||
for(var/I in servers)
|
||||
if(I == our_id) //No sending to ourselves
|
||||
continue
|
||||
if(target_servers && !(I in target_servers))
|
||||
continue
|
||||
world.Export("[servers[I]]?[list2params(message)]")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user