diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java index e523f0f71..8cc1bf8cc 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java @@ -61,7 +61,6 @@ import com.velocitypowered.proxy.protocol.util.PluginMessageUtil; import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; -import java.io.IOException; import java.net.InetSocketAddress; import java.util.concurrent.CompletableFuture; import net.kyori.adventure.key.Key; @@ -377,8 +376,8 @@ public class ConfigSessionHandler implements MinecraftSessionHandler { @Override public void disconnected() { - resultFuture.completeExceptionally( - new IOException("Unexpectedly disconnected from remote server")); + resultFuture.complete(ConnectionRequestResults.forDisconnect( + ConnectionMessages.INTERNAL_SERVER_CONNECTION_ERROR, serverConn.getServer())); } @Override @@ -415,4 +414,4 @@ public class ConfigSessionHandler implements MinecraftSessionHandler { public enum State { START, NEGOTIATING, PLUGIN_MESSAGE_INTERRUPT, RESOURCE_PACK_INTERRUPT, COMPLETE } -} \ No newline at end of file +} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java index e713769a6..cfcd8f5e0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java @@ -38,7 +38,6 @@ import com.velocitypowered.proxy.protocol.packet.DisconnectPacket; import com.velocitypowered.proxy.protocol.packet.JoinGamePacket; import com.velocitypowered.proxy.protocol.packet.KeepAlivePacket; import com.velocitypowered.proxy.protocol.packet.PluginMessagePacket; -import java.io.IOException; import java.util.concurrent.CompletableFuture; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -213,7 +212,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler { @Override public void disconnected() { - resultFuture - .completeExceptionally(new IOException("Unexpectedly disconnected from remote server")); + resultFuture.complete(ConnectionRequestResults.forDisconnect( + ConnectionMessages.INTERNAL_SERVER_CONNECTION_ERROR, serverConn.getServer())); } }