summaryrefslogtreecommitdiff
path: root/modules/enet
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-10-31 14:18:22 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-11-02 15:17:23 +0100
commit33dda2e68a40888a7fd41e9a8d421873d9dc7fde (patch)
tree513953b159b1c95c751b67d33c53aae6d2d57ca1 /modules/enet
parent9773803e4eb5f986750eb4daa726b25bb41e96e8 (diff)
[MP] Remove connection state signals from MultiplayerPeer.
Now handled directly by the MultiplayerAPI implementation.
Diffstat (limited to 'modules/enet')
-rw-r--r--modules/enet/enet_multiplayer_peer.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/modules/enet/enet_multiplayer_peer.cpp b/modules/enet/enet_multiplayer_peer.cpp
index 31ae643b59..43c512ae16 100644
--- a/modules/enet/enet_multiplayer_peer.cpp
+++ b/modules/enet/enet_multiplayer_peer.cpp
@@ -159,10 +159,7 @@ void ENetMultiplayerPeer::_disconnect_inactive_peers() {
if (hosts.has(P)) {
hosts.erase(P);
}
- if (active_mode == MODE_CLIENT) {
- ERR_CONTINUE(P != TARGET_PEER_SERVER);
- emit_signal(SNAME("server_disconnected"));
- }
+ ERR_CONTINUE(active_mode == MODE_CLIENT && P != TARGET_PEER_SERVER);
emit_signal(SNAME("peer_disconnected"), P);
}
}
@@ -186,14 +183,10 @@ void ENetMultiplayerPeer::poll() {
if (ret == ENetConnection::EVENT_CONNECT) {
connection_status = CONNECTION_CONNECTED;
emit_signal(SNAME("peer_connected"), 1);
- emit_signal(SNAME("connection_succeeded"));
} else if (ret == ENetConnection::EVENT_DISCONNECT) {
if (connection_status == CONNECTION_CONNECTED) {
// Client just disconnected from server.
- emit_signal(SNAME("server_disconnected"));
emit_signal(SNAME("peer_disconnected"), 1);
- } else {
- emit_signal(SNAME("connection_failed"));
}
close();
} else if (ret == ENetConnection::EVENT_RECEIVE) {