Minor Update

- Refactor the Player.gd

- Attempt to fix joining the available room, via Room ID
This commit is contained in:
2025-12-03 21:51:23 +08:00
parent a97a8e68f6
commit dce55c2fe6
5 changed files with 118 additions and 840 deletions
+10 -4
View File
@@ -86,8 +86,11 @@ func _process(delta):
func _on_host_pressed():
$NetworkPanel/NetworkInfo/NetworkSideDisplay.text = "Server (Creating Match...)"
$Menu.visible = false
NakamaManager.connect_to_nakama_async()
await NakamaManager.connected_to_nakama
var success = await NakamaManager.connect_to_nakama_async()
if not success:
$NetworkPanel/NetworkInfo/NetworkSideDisplay.text = "Connection Failed"
$Menu.visible = true
return
NakamaManager.host_game()
func _on_join_pressed():
@@ -98,8 +101,11 @@ func _on_join_pressed():
$NetworkPanel/NetworkInfo/NetworkSideDisplay.text = "Client (Joining...)"
$Menu.visible = false
NakamaManager.connect_to_nakama_async()
await NakamaManager.connected_to_nakama
var success = await NakamaManager.connect_to_nakama_async()
if not success:
$NetworkPanel/NetworkInfo/NetworkSideDisplay.text = "Connection Failed"
$Menu.visible = true
return
NakamaManager.join_game(match_id)
func _on_match_joined(match_id: String):