浏览代码

Fix the "Example lobby implementation" section of the High-level multiplayer tutorial

Correct both the GDScript and C# code examples in the "Example lobby implementation" section of the Networking/High-level multiplayer tutorial.
Mateus Elias 7 月之前
父节点
当前提交
d0e6217c12
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      tutorials/networking/high_level_multiplayer.rst

+ 2 - 0
tutorials/networking/high_level_multiplayer.rst

@@ -415,6 +415,7 @@ have loaded the game scene.
 
     func remove_multiplayer_peer():
         multiplayer.multiplayer_peer = null
+        players.clear()
 
 
     # When the server decides to start the game from a UI scene,
@@ -550,6 +551,7 @@ have loaded the game scene.
         private void RemoveMultiplayerPeer()
         {
             Multiplayer.MultiplayerPeer = null;
+            _players.Clear();
         }
 
         // When the server decides to start the game from a UI scene,