From 8ec273050bae19e87567ea4da1bccf0e9046cea3 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 15 Oct 2018 17:06:37 -0400 Subject: [PATCH] Remove redundant obsolete connection-checking code. --- .../backend/BackendPlaySessionHandler.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java index 12fcd6665..a427cb524 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java @@ -93,7 +93,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { serverConn.getPlayer().sendLegacyForgeHandshakeResetPacket(); } - // Always forward these messages during login. Don't pass it onto the handleGeneric below. + // Always forward these messages during login. return false; } @@ -126,26 +126,11 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { @Override public void handleGeneric(MinecraftPacket packet) { - if (!serverConn.getPlayer().isActive()) { - // Connection was left open accidentally. Close it so as to avoid "You logged in from another location" - // errors. - serverConn.disconnect(); - return; - } - - // Just forward the packet on. We don't have anything to handle at this time. serverConn.getPlayer().getConnection().write(packet); } @Override public void handleUnknown(ByteBuf buf) { - if (!serverConn.getPlayer().isActive()) { - // Connection was left open accidentally. Close it so as to avoid "You logged in from another location" - // errors. - serverConn.disconnect(); - return; - } - serverConn.getPlayer().getConnection().write(buf.retain()); }