Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
If we failed to unregister, don't fire the disconnect event
Dieser Commit ist enthalten in:
Ursprung
3023a90295
Commit
5822cc31d8
@ -291,9 +291,10 @@ public class VelocityServer implements ProxyServer {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unregisterConnection(ConnectedPlayer connection) {
|
public boolean unregisterConnection(ConnectedPlayer connection) {
|
||||||
connectionsByName.remove(connection.getUsername().toLowerCase(Locale.US), connection);
|
boolean name = connectionsByName.remove(connection.getUsername().toLowerCase(Locale.US), connection);
|
||||||
connectionsByUuid.remove(connection.getUniqueId(), connection);
|
boolean uuid = connectionsByUuid.remove(connection.getUniqueId(), connection);
|
||||||
|
return name && uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -432,9 +432,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
if (connectedServer != null) {
|
if (connectedServer != null) {
|
||||||
connectedServer.disconnect();
|
connectedServer.disconnect();
|
||||||
}
|
}
|
||||||
server.unregisterConnection(this);
|
if (server.unregisterConnection(this)) {
|
||||||
server.getEventManager().fireAndForget(new DisconnectEvent(this));
|
server.getEventManager().fireAndForget(new DisconnectEvent(this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren