Change network termination instructions (#9087)

Changes network termination instructions to avoid issues involving unexpected network errors (https://github.com/godotengine/godot/issues/77723)
This commit is contained in:
Booblesnoot42
2025-04-14 20:03:23 -04:00
committed by GitHub
parent 309c3c08ed
commit 4f4b6810c6

View File

@@ -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()