File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
proxy/src/main/java/com/velocitypowered/proxy/connection Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
8484 private static final Logger logger = LogManager .getLogger (MinecraftConnection .class );
8585
8686 private final Channel channel ;
87+ public boolean pendingConfigurationSwitch = false ;
8788 private SocketAddress remoteAddress ;
8889 private StateRegistry state ;
8990 private Map <StateRegistry , MinecraftSessionHandler > sessionHandlers ;
Original file line number Diff line number Diff line change 7272import com .velocitypowered .proxy .protocol .packet .title .GenericTitlePacket ;
7373import com .velocitypowered .proxy .protocol .util .PluginMessageUtil ;
7474import com .velocitypowered .proxy .util .CharacterUtil ;
75+ import com .velocitypowered .proxy .util .except .QuietRuntimeException ;
7576import io .netty .buffer .ByteBuf ;
7677import io .netty .buffer .ByteBufUtil ;
7778import io .netty .buffer .Unpooled ;
@@ -392,6 +393,9 @@ public boolean handle(ResourcePackResponsePacket packet) {
392393
393394 @ Override
394395 public boolean handle (FinishedUpdatePacket packet ) {
396+ if (!player .getConnection ().pendingConfigurationSwitch ) {
397+ throw new QuietRuntimeException ("Not expecting reconfiguration" );
398+ }
395399 // Complete client switch
396400 player .getConnection ().setActiveSessionHandler (StateRegistry .CONFIG );
397401 VelocityServerConnection serverConnection = player .getConnectedServer ();
Original file line number Diff line number Diff line change @@ -1318,6 +1318,7 @@ public void switchToConfigState() {
13181318 connection.write(BundleDelimiterPacket.INSTANCE);
13191319 }
13201320 connection.write(StartUpdatePacket.INSTANCE);
1321+ connection.pendingConfigurationSwitch = true;
13211322 connection.getChannel().pipeline().get(MinecraftEncoder.class).setState(StateRegistry.CONFIG);
13221323 // Make sure we don't send any play packets to the player after update start
13231324 connection.addPlayPacketQueueHandler();
You can’t perform that action at this time.
0 commit comments