3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Remove redundant obsolete connection-checking code.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-10-15 17:06:37 -04:00
Ursprung 8eb7ecba83
Commit 8ec273050b

Datei anzeigen

@ -93,7 +93,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
serverConn.getPlayer().sendLegacyForgeHandshakeResetPacket(); 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; return false;
} }
@ -126,26 +126,11 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
@Override @Override
public void handleGeneric(MinecraftPacket packet) { 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); serverConn.getPlayer().getConnection().write(packet);
} }
@Override @Override
public void handleUnknown(ByteBuf buf) { 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()); serverConn.getPlayer().getConnection().write(buf.retain());
} }