فهرست منبع

Change network termination instructions (#9087)

Changes network termination instructions to avoid issues involving unexpected network errors (https://github.com/godotengine/godot/issues/77723)
Booblesnoot42 4 ماه پیش
والد
کامیت
4f4b6810c6
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      tutorials/networking/high_level_multiplayer.rst

+ 4 - 4
tutorials/networking/high_level_multiplayer.rst

@@ -153,7 +153,7 @@ To terminate networking:
 .. tabs::
  .. code-tab:: gdscript GDScript
 
-    multiplayer.multiplayer_peer = null
+    multiplayer.multiplayer_peer = OfflineMultiplayerPeer.new()
 
  .. code-tab:: csharp
 
@@ -416,7 +416,7 @@ have loaded the game scene.
 
 
     func remove_multiplayer_peer():
-        multiplayer.multiplayer_peer = null
+        multiplayer.multiplayer_peer = OfflineMultiplayerPeer.new()
         players.clear()
 
 
@@ -462,11 +462,11 @@ have loaded the game scene.
 
 
     func _on_connected_fail():
-        multiplayer.multiplayer_peer = null
+        remove_multiplayer_peer()
 
 
     func _on_server_disconnected():
-        multiplayer.multiplayer_peer = null
+        remove_multiplayer_peer()
         players.clear()
         server_disconnected.emit()