You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server_disconnected signal emits on client when authenticating is failed, and I think this is not correct, because connected_to_server doesn't emit.
Steps to reproduce
Set authenticate callback which rejects clients with multiplayer.multiplayer_peer.disconnect_peer(<peer>) (if clients gets rejected with timeout, this also works).
On one game instance, create server.
On other game instance, try to connect.
Observe both peer_authentication_failed and server_disconnected emitted on client.
Maybe something like this would be enough? (Untested! Needs someone who's more familiar with the multiplayer code to have another look, and decide if this is considered a bug or not.)
diff --git a/modules/multiplayer/scene_multiplayer.cpp b/modules/multiplayer/scene_multiplayer.cpp
index 99aba680cc..0488d302e3 100644
--- a/modules/multiplayer/scene_multiplayer.cpp+++ b/modules/multiplayer/scene_multiplayer.cpp@@ -57,7 +57,7 @@ void SceneMultiplayer::_update_status() {
if (status == MultiplayerPeer::CONNECTION_DISCONNECTED) {
if (last_connection_status == MultiplayerPeer::CONNECTION_CONNECTING) {
emit_signal(SNAME("connection_failed"));
- } else {+ } else if (!pending_peers.has(get_unique_id())) {
emit_signal(SNAME("server_disconnected"));
}
clear();
Tested versions
System information
Godot v4.3.rc2 - Ubuntu 24.04 LTS 24.04 - X11 - GLES3 (Compatibility) - Mesa Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)
Issue description
server_disconnected
signal emits on client when authenticating is failed, and I think this is not correct, becauseconnected_to_server
doesn't emit.Steps to reproduce
multiplayer.multiplayer_peer.disconnect_peer(<peer>)
(if clients gets rejected with timeout, this also works).peer_authentication_failed
andserver_disconnected
emitted on client.Minimal reproduction project (MRP)
mrp.zip
peer_authentication_failed
andserver_disconnected
emitted on client (visible in console).The text was updated successfully, but these errors were encountered: