-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Your Godot version:
v4.5.beta1.mono.official [46c495ca2]
Issue description:
The documentation for peer_connected
and peer_disconnected
is inconsistent. They both receive signals when the server (peer ID of 1) connects or disconnects, but it's only mentioned on peer_connected
. Assuming a disconnect signal would be received because a connect signal is received may be efficient, but I did not make that assumption at first, hence this issue.
Here's a simple code example that just shows the signal connections. (This example does not show the other aspects of setting up networking)
func _ready() -> void:
multiplayer.peer_connected.connect(_on_peer_connected)
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
func _on_peer_connected(id: int) -> void:
print("Peer connected: ", id)
func _on_peer_disconnected(id: int) -> void:
print("Peer disconnected: ", id)
Here is a screenshot of my client logs after starting the server, connecting a client, and stopping the server.

URL to the documentation page (if already existing):
MultiplayerAPI#peer_disconnected