feat(client): net primitives — DmResponse, NarrateResult, DmTransport, ProxyConfig

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 09:54:03 -05:00
parent b4d22f5c5f
commit 18a18820fe
10 changed files with 126 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
class_name DmResponse
extends RefCounted
## The raw outcome of one HTTP attempt, independent of any game meaning.
## `status` is 0 when the transport never reached the server; `body` is the
## parsed JSON dict, or null when the body was absent or not JSON.
var status: int
var body # Variant: parsed JSON (Dictionary) or null
var transport_ok: bool
var error: String
func _init(p_status := 0, p_body = null, p_transport_ok := false, p_error := "") -> void:
status = p_status
body = p_body
transport_ok = p_transport_ok
error = p_error
static func ok(p_status: int, p_body) -> DmResponse:
return DmResponse.new(p_status, p_body, true, "")
static func failed(p_error: String) -> DmResponse:
return DmResponse.new(0, null, false, p_error)