fix(network): prevent null multiplayer peer crashes offline/teardown and fix Nakama RPC session validation

This commit is contained in:
2026-07-10 17:36:26 +08:00
parent 2b4c9d9dcb
commit b30709de3d
84 changed files with 5291 additions and 982 deletions
+6
View File
@@ -93,8 +93,14 @@ func api_rpc_async(rpc_id: String, payload: String = "{}") -> Dictionary:
var retries := 0
while retries <= MAX_RETRIES:
if not nakama_backend or not nakama_backend.client or not nakama_backend.session:
return { "success": false, "error": ErrorCode.UNAUTHORIZED, "message": "Not authenticated" }
var result = await nakama_backend.client.rpc_async(nakama_backend.session, rpc_id, payload)
if result == null:
return { "success": false, "error": ErrorCode.INTERNAL_ERROR, "message": "RPC call returned null" }
# NakamaAPI.ApiRpc has is_exception()
if result.is_exception():
var ex = result.get_exception()