diff --git a/monkestation/code/controllers/subsystem/plexora.dm b/monkestation/code/controllers/subsystem/plexora.dm index 3068facc39dd..a9a06c052ae8 100644 --- a/monkestation/code/controllers/subsystem/plexora.dm +++ b/monkestation/code/controllers/subsystem/plexora.dm @@ -73,6 +73,11 @@ SUBSYSTEM_DEF(plexora) http_root = config["ip"] http_port = config["port"] + default_headers = list( + "Content-Type" = "application/json", + "Authorization" = AUTH_HEADER, + ) + // Do a ping test to check if Plexora is actually running if (!is_plexora_alive()) stack_trace("SSplexora is enabled BUT plexora is not alive or running! SS has not been aborted, subsequent fires will take place.") @@ -81,10 +86,6 @@ SUBSYSTEM_DEF(plexora) RegisterSignal(SSticker, COMSIG_TICKER_ROUND_STARTING, PROC_REF(roundstarted)) - default_headers = list( - "Content-Type" = "application/json", - "Authorization" = AUTH_HEADER, - ) return SS_INIT_SUCCESS /datum/controller/subsystem/plexora/Recover() @@ -109,6 +110,7 @@ SUBSYSTEM_DEF(plexora) var/datum/http_response/response = request.into_response() if (response.errored) plexora_is_alive = FALSE + log_admin("Failed to check if Plexora is alive! She probably isn't. Check config on both sides") CRASH("Failed to check if Plexora is alive! She probably isn't. Check config on both sides") else var/list/json_body = json_decode(response.body) @@ -209,7 +211,7 @@ SUBSYSTEM_DEF(plexora) "id" = id ) - var/datum/http_request/request = new(RUSTG_HTTP_METHOD_GET, "http://[http_root]:[http_port]/byondserver_alive", json_encode(body)) + var/datum/http_request/request = new(RUSTG_HTTP_METHOD_GET, "http://[http_root]:[http_port]/byondserver_alive", json_encode(body), default_headers) request.begin_async() UNTIL_OR_TIMEOUT(request.is_complete(), 5 SECONDS) var/datum/http_response/response = request.into_response()