#3523, #3534: Fix kicking players with error

This commit is contained in:
DartCZ 2023-09-28 06:55:00 +10:00 committed by md_5
parent 1c42c34081
commit 86e079a4b1
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -136,6 +136,11 @@ public class UpstreamBridge extends PacketHandler
{ {
if ( con.getServer() != null ) if ( con.getServer() != null )
{ {
if ( con.getServer().getCh().isClosed() )
{
return;
}
Protocol serverEncode = con.getServer().getCh().getEncodeProtocol(); Protocol serverEncode = con.getServer().getCh().getEncodeProtocol();
// #3527: May still have old packets from client in game state when switching server to configuration state - discard those // #3527: May still have old packets from client in game state when switching server to configuration state - discard those
if ( packet.protocol != serverEncode ) if ( packet.protocol != serverEncode )