Fix global RPC data parsing in BackendService

- Resolved massive bug where api_rpc_async returned raw payload strings instead of the parsed 'data' Dictionary expected by every system (Gacha, Mail, Leaderboard, Admin Panel, etc.)
- Restored Admin Panel's _rpc helper to use the standard result.get('data') format now that BackendService correctly supplies it.
This commit is contained in:
2026-06-22 17:45:58 +08:00
parent 396507ef4f
commit 948a99cf90
2 changed files with 11 additions and 10 deletions
+1 -9
View File
@@ -301,15 +301,7 @@ func _rpc(rpc_name: String, payload: Dictionary) -> Dictionary:
var err: String = str(result.get("message", "Unknown error"))
_set_status(err, CLR_STATUS_ERR)
return {"error": err}
var payload_str: String = result.get("payload", "{}")
if payload_str.is_empty():
payload_str = "{}"
var parsed = JSON.parse_string(payload_str)
if typeof(parsed) == TYPE_DICTIONARY:
return parsed
return {}
return result.get("data", {})
func _set_status(msg: String, color: Color = CLR_DIM) -> void:
status_label.text = msg