From c3d9cc70685a9b615be63d768f276aaf546dae0c Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Sat, 25 Feb 2023 13:22:29 -0500 Subject: [PATCH] Fix docs on multiplayer peer signals. NetworkedMultiplayerPeerENet emits peer_connected and peer_disconnected on both the client and the server: https://github.com/godotengine/godot/blob/6fed1ffa313c6760fa88b368ae580378daaef0f0/modules/enet/networked_multiplayer_enet.cpp#L268 When trying to implement `NetworkedMultiplayerCustom`, I followed the documentation and only emitted this signal on the server. I ended up getting errors like: ``` Invalid packet received. Unabled to find requested cached node ``` While I didn't check other peer implementations, it seems that emitting on both the client and server is required. I copied the wording from the `master` branch documentation. Here's some output from a test program with all the signals connected: ``` 1948301815 got multiplayer.network_peer_connected from 1 1948301815 got peer.peer_connected from 1 1948301815 got multiplayer.connected_to_server 1948301815 got peer.connection_succeeded 1413532890 got multiplayer.network_peer_connected from 1 1413532890 got peer.peer_connected from 1 1413532890 got multiplayer.connected_to_server 1413532890 got peer.connection_succeeded 1 got multiplayer.network_peer_connected from 1413532890 1 got peer.peer_connected from 1413532890 1 got multiplayer.network_peer_connected from 1948301815 1 got peer.peer_connected from 1948301815 1413532890 got multiplayer.network_peer_connected from 1948301815 1413532890 got peer.peer_connected from 1948301815 1948301815 got multiplayer.network_peer_connected from 1413532890 1948301815 got peer.peer_connected from 1413532890 1 got multiplayer.network_peer_disconnected from 1948301815 1 got peer.peer_disconnected from 1948301815 1413532890 got multiplayer.network_peer_disconnected from 1948301815 1413532890 got peer.peer_disconnected from 1948301815 1 got multiplayer.network_peer_disconnected from 1413532890 1 got peer.peer_disconnected from 1413532890 ``` --- doc/classes/NetworkedMultiplayerPeer.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml index 80e2bee2893..8069ff0f28f 100644 --- a/doc/classes/NetworkedMultiplayerPeer.xml +++ b/doc/classes/NetworkedMultiplayerPeer.xml @@ -67,13 +67,13 @@ - Emitted by the server when a client connects. + Emitted when a remote peer connects. - Emitted by the server when a client disconnects. + Emitted when a remote peer has disconnected.