mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
fix(多人游戏): 修复多人游戏启动权限问题
将startMultiplayerGame的RPC权限从"authority"改为"any_peer",并添加本地调用 确保所有客户端都能正确触发游戏开始
This commit is contained in:
@@ -51,7 +51,7 @@ func rebuildAllPlayers(playerNames: Array[String]):
|
||||
i.queue_free()
|
||||
for i in playerNames:
|
||||
addPlayerName(i)
|
||||
@rpc("authority")
|
||||
@rpc("any_peer")
|
||||
func startMultiplayerGame():
|
||||
if multiplayer.is_server():
|
||||
for i in getPlayerNames():
|
||||
@@ -81,6 +81,7 @@ func _ready():
|
||||
startMultiplayerBtn.pressed.connect(
|
||||
func():
|
||||
startMultiplayerGame.rpc()
|
||||
startMultiplayerGame()
|
||||
)
|
||||
maxPlayerInput.text_changed.connect(
|
||||
func(text):
|
||||
|
||||
Reference in New Issue
Block a user