Skip to content

Commit 12f05a0

Browse files
authored
fix: more plexora things i forgot to fix earlier (Monkestation#4897)
1 parent 4ca4323 commit 12f05a0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

monkestation/code/controllers/subsystem/plexora.dm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ SUBSYSTEM_DEF(plexora)
7373
http_root = config["ip"]
7474
http_port = config["port"]
7575

76+
default_headers = list(
77+
"Content-Type" = "application/json",
78+
"Authorization" = AUTH_HEADER,
79+
)
80+
7681
// Do a ping test to check if Plexora is actually running
7782
if (!is_plexora_alive())
7883
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)
8186

8287
RegisterSignal(SSticker, COMSIG_TICKER_ROUND_STARTING, PROC_REF(roundstarted))
8388

84-
default_headers = list(
85-
"Content-Type" = "application/json",
86-
"Authorization" = AUTH_HEADER,
87-
)
8889
return SS_INIT_SUCCESS
8990

9091
/datum/controller/subsystem/plexora/Recover()
@@ -109,6 +110,7 @@ SUBSYSTEM_DEF(plexora)
109110
var/datum/http_response/response = request.into_response()
110111
if (response.errored)
111112
plexora_is_alive = FALSE
113+
log_admin("Failed to check if Plexora is alive! She probably isn't. Check config on both sides")
112114
CRASH("Failed to check if Plexora is alive! She probably isn't. Check config on both sides")
113115
else
114116
var/list/json_body = json_decode(response.body)
@@ -209,7 +211,7 @@ SUBSYSTEM_DEF(plexora)
209211
"id" = id
210212
)
211213

212-
var/datum/http_request/request = new(RUSTG_HTTP_METHOD_GET, "http://[http_root]:[http_port]/byondserver_alive", json_encode(body))
214+
var/datum/http_request/request = new(RUSTG_HTTP_METHOD_GET, "http://[http_root]:[http_port]/byondserver_alive", json_encode(body), default_headers)
213215
request.begin_async()
214216
UNTIL_OR_TIMEOUT(request.is_complete(), 5 SECONDS)
215217
var/datum/http_response/response = request.into_response()

0 commit comments

Comments
 (0)