READY - Rust HTTP Stuff (#28997)

* WIP AND BROKEN - Rust HTTP Stuff

* this mostly works

* TM ready???

* Build Rust library

* handle failed requests properly

* Build Rust library

* Build Rust library

* Remove TM stuff

---------

Co-authored-by: Chuga <98280110+chuga-git@users.noreply.github.com>
Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
This commit is contained in:
AffectedArc07
2025-06-06 16:51:05 +00:00
committed by GitHub
co-authored by Chuga paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
parent 772aa6d21a
commit 11d527c819
26 changed files with 509 additions and 103 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
return
var/datum/callback/cb = CALLBACK(src, TYPE_PROC_REF(/datum/admins, ccbdb_lookup_callback), usr, ckey)
SShttp.create_async_request(RUSTG_HTTP_METHOD_GET, "[GLOB.configuration.url.centcom_ban_db_url][ckey]", proc_callback=cb)
SShttp.create_async_request(RUSTLIBS_HTTP_METHOD_GET, "[GLOB.configuration.url.centcom_ban_db_url][ckey]", proc_callback=cb)
/**
* CCBDB Lookup Callback
+1 -1
View File
@@ -158,7 +158,7 @@ GLOBAL_LIST_EMPTY(sounds_cache)
// Send the request off
var/datum/http_request/media_poll_request = new()
// The fact we are using GET with a body offends me
media_poll_request.prepare(RUSTG_HTTP_METHOD_GET, GLOB.configuration.system.ytdlp_url, json_encode(request_body))
media_poll_request.prepare(RUSTLIBS_HTTP_METHOD_GET, GLOB.configuration.system.ytdlp_url, json_encode(request_body))
// Start it off and wait
media_poll_request.begin_async()
UNTIL(media_poll_request.is_complete())
+3 -3
View File
@@ -6,7 +6,7 @@
// Client does not have 2FA enabled. Set it up.
if(prefs._2fa_status == _2FA_DISABLED)
// Get us an auth token
var/datum/http_response/qrcr = MakeAPICall(RUSTG_HTTP_METHOD_GET, "2fa/generate_qr?ckey=[ckey]")
var/datum/http_response/qrcr = MakeAPICall(RUSTLIBS_HTTP_METHOD_GET, "2fa/generate_qr?ckey=[ckey]")
// If this fails, shits gone bad
if(qrcr.errored)
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [qrcr.error]")
@@ -33,7 +33,7 @@
B.close()
return
var/datum/http_response/vr = MakeAPICall(RUSTG_HTTP_METHOD_GET, "2fa/validate_code?ckey=[ckey]&code=[entered_code]")
var/datum/http_response/vr = MakeAPICall(RUSTLIBS_HTTP_METHOD_GET, "2fa/validate_code?ckey=[ckey]&code=[entered_code]")
// If this fails, shits gone bad
if(vr.errored)
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [vr.error]")
@@ -86,7 +86,7 @@
alert(usr, "2FA deactivation aborted!")
return
var/datum/http_response/vr = MakeAPICall(RUSTG_HTTP_METHOD_GET, "2fa/validate_code?ckey=[ckey]&code=[entered_code]")
var/datum/http_response/vr = MakeAPICall(RUSTLIBS_HTTP_METHOD_GET, "2fa/validate_code?ckey=[ckey]&code=[entered_code]")
// If this fails, shits gone bad
if(vr.errored)
alert(usr, "Something has gone VERY wrong ingame. Please inform the server host.\nError details: [vr.error]")