I think this is instance communication

This commit is contained in:
AffectedArc07
2021-09-20 23:50:51 +01:00
parent 9c14b6b732
commit 890e7e5ce5
16 changed files with 163 additions and 127 deletions
@@ -3,12 +3,5 @@
requires_commskey = TRUE
/datum/world_topic_handler/instance_announce/execute(list/input, key_valid)
var/msg = input["msg"]
if(input["repoll"]) // Repoll peers
UNTIL(!SSinstancing.check_running) // If we are running, wait
SSinstancing.check_peers(TRUE) // Manually check, with FORCE
UNTIL(!SSinstancing.check_running) // Wait for completion
// Now that we repolled, we can tell the playerbase
to_chat(world, "<center><span class='boldannounce'><big>Attention</big></span></center><hr>[msg]<hr>")
to_chat(world, "<center><span class='boldannounce'><big>Attention</big></span></center><hr>[input["msg"]]<hr>")
SEND_SOUND(world, sound('sound/misc/notice2.ogg')) // Same as captains priority announce
@@ -1,12 +0,0 @@
/datum/world_topic_handler/server_discovery
topic_key = "server_discovery"
requires_commskey = TRUE
/datum/world_topic_handler/server_discovery/execute(list/input, key_valid)
// We need to send the stuff to make a /datum/peer_server on the other side
var/list/server_data = list()
server_data["external_ip"] = world.internet_address
server_data["server_id"] = GLOB.configuration.instancing.server_id
server_data["server_name"] = GLOB.configuration.general.server_name
server_data["playercount"] = length(GLOB.clients)
return json_encode(server_data)