feat: update vfx

This commit is contained in:
2026-06-18 14:04:06 +08:00
parent 5354d8b30f
commit 78f071b728
18 changed files with 704 additions and 62 deletions
+14 -4
View File
@@ -187,11 +187,21 @@ func host_game(room_meta: Dictionary = {}):
if not bridge:
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)
# Guard against re-entry: create_match() rejects any state other than
# DISCONNECTED. A double-click on the mode button (or a retry after a stalled
# attempt) can re-enter here while a prior create_match() is still JOINING.
if bridge.match_state == NakamaMultiplayerBridge.MatchState.CONNECTED:
print("[NakamaManager] Already hosting a match; ignoring duplicate host request.")
return
if bridge.match_state != NakamaMultiplayerBridge.MatchState.DISCONNECTED:
# Stranded mid-join (e.g. previous attempt never resolved). Reset so the
# bridge is idle before we try again.
print("[NakamaManager] Bridge busy (%s); resetting before hosting." % NakamaMultiplayerBridge.MatchState.keys()[bridge.match_state])
await bridge.leave()
print("Hosting match via Nakama Bridge...")
await bridge.create_match()
# 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)