feat: update nakama, and patch, checkpoint for restore 2.3.1
This commit is contained in:
@@ -40,7 +40,8 @@ func _try_restore_session() -> void:
|
||||
|
||||
var file := FileAccess.open_encrypted_with_pass(SESSION_FILE, FileAccess.READ, ENCRYPTION_KEY)
|
||||
if not file:
|
||||
print("[AuthManager] Could not open session file")
|
||||
print("[AuthManager] Could not open session file. Corrupt or wrong key. Deleting.")
|
||||
DirAccess.remove_absolute(SESSION_FILE)
|
||||
return
|
||||
|
||||
var session_data = file.get_var()
|
||||
|
||||
@@ -184,10 +184,8 @@ func host_game(room_meta: Dictionary = {}):
|
||||
printerr("Cannot host: Bridge not initialized")
|
||||
return
|
||||
print("Hosting match via Nakama Bridge...")
|
||||
var result = await bridge.create_match()
|
||||
if result and result.is_exception():
|
||||
emit_signal("match_join_error", result.get_exception().message)
|
||||
return
|
||||
await bridge.create_match()
|
||||
# Errors are emitted via bridge's match_join_error signal
|
||||
# Store room metadata in Nakama storage so other players can see it in listings
|
||||
if session and current_match_id and room_meta.size() > 0:
|
||||
var meta_json = JSON.stringify(room_meta)
|
||||
@@ -213,10 +211,13 @@ func join_game(match_id: String):
|
||||
# Wait a bit for cleanup
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
|
||||
if not bridge:
|
||||
printerr("Cannot join: Bridge became null while waiting")
|
||||
return
|
||||
|
||||
print("Joining match: ", match_id)
|
||||
var result = await bridge.join_match(match_id)
|
||||
if result and result.is_exception():
|
||||
emit_signal("match_join_error", result.get_exception().message)
|
||||
await bridge.join_match(match_id)
|
||||
# Errors are emitted via bridge's match_join_error signal
|
||||
|
||||
# --- Callbacks ---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user