From 74ee7164800691d39777a7486fab70e59ad250c8 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 17 Nov 2018 17:25:49 -0500 Subject: [PATCH] Revert "If we failed to unregister, don't fire the disconnect event" This reverts commit 5822cc31d8dbb1dd4af41c200690956308f66c91. --- .../java/com/velocitypowered/proxy/VelocityServer.java | 7 +++---- .../proxy/connection/client/ConnectedPlayer.java | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index e0f250f9a..52a850e53 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -291,10 +291,9 @@ public class VelocityServer implements ProxyServer { return true; } - public boolean unregisterConnection(ConnectedPlayer connection) { - boolean name = connectionsByName.remove(connection.getUsername().toLowerCase(Locale.US), connection); - boolean uuid = connectionsByUuid.remove(connection.getUniqueId(), connection); - return name && uuid; + public void unregisterConnection(ConnectedPlayer connection) { + connectionsByName.remove(connection.getUsername().toLowerCase(Locale.US), connection); + connectionsByUuid.remove(connection.getUniqueId(), connection); } @Override diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index d76070057..e06cdacfa 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -432,9 +432,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { if (connectedServer != null) { connectedServer.disconnect(); } - if (server.unregisterConnection(this)) { - server.getEventManager().fireAndForget(new DisconnectEvent(this)); - } + server.unregisterConnection(this); + server.getEventManager().fireAndForget(new DisconnectEvent(this)); } @Override