Do not print an exception if a client closed before switching to config state
This commit is contained in:
@@ -1287,6 +1287,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player,
|
|||||||
public void switchToConfigState() {
|
public void switchToConfigState() {
|
||||||
server.getEventManager().fire(new PlayerEnterConfigurationEvent(this, getConnectionInFlightOrConnectedServer()))
|
server.getEventManager().fire(new PlayerEnterConfigurationEvent(this, getConnectionInFlightOrConnectedServer()))
|
||||||
.completeOnTimeout(null, 5, TimeUnit.SECONDS).thenRunAsync(() -> {
|
.completeOnTimeout(null, 5, TimeUnit.SECONDS).thenRunAsync(() -> {
|
||||||
|
// if the connection was closed earlier, there is a risk that the player is no longer connected
|
||||||
|
if (!connection.getChannel().isActive()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (bundleHandler.isInBundleSession()) {
|
if (bundleHandler.isInBundleSession()) {
|
||||||
bundleHandler.toggleBundleSession();
|
bundleHandler.toggleBundleSession();
|
||||||
connection.write(BundleDelimiterPacket.INSTANCE);
|
connection.write(BundleDelimiterPacket.INSTANCE);
|
||||||
|
Reference in New Issue
Block a user