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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user