mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user