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:
@@ -121,9 +121,18 @@ func api_rpc_async(rpc_id: String, payload: String = "{}") -> Dictionary:
|
||||
}
|
||||
|
||||
# Success
|
||||
var payload_str: String = result.payload if result.payload != null else "{}"
|
||||
if payload_str.is_empty():
|
||||
payload_str = "{}"
|
||||
|
||||
var parsed_data = JSON.parse_string(payload_str)
|
||||
if parsed_data == null:
|
||||
parsed_data = {}
|
||||
|
||||
return {
|
||||
"success": true,
|
||||
"payload": result.payload
|
||||
"payload": payload_str,
|
||||
"data": parsed_data
|
||||
}
|
||||
|
||||
return { "success": false, "error": ErrorCode.NETWORK_ERROR, "message": "Max retries exceeded" }
|
||||
|
||||
Reference in New Issue
Block a user