@Override public void handle(LoginSuccess loginSuccess) throws Exception { Preconditions.checkState( thisState == State.LOGIN_SUCCESS, "Not expecting LOGIN_SUCCESS" ); ch.setProtocol( Protocol.GAME ); thisState = State.LOGIN; // Only reset the Forge client when: // 1) The user is switching servers (so has a current server) // 2) The handshake is complete // 3) The user is currently on a modded server (if we are on a vanilla server, // we may be heading for another vanilla server, so we don't need to reset.) // // user.getServer() gets the user's CURRENT server, not the one we are trying // to connect to. // // We will reset the connection later if the current server is vanilla, and // we need to switch to a modded connection. However, we always need to reset the // connection when we have a modded server regardless of where we go - doing it // here makes sense. if ( user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete() && user.getServer().isForgeServer() ) { user.getForgeClientHandler().resetHandshake(); } throw CancelSendSignal.INSTANCE; }
if ( con.getServer() != null && !con.getServer().isForgeServer() && pluginMessage.getData().length > Short.MAX_VALUE )
@Override public void handle(LoginSuccess loginSuccess) throws Exception { Preconditions.checkState( thisState == State.LOGIN_SUCCESS, "Not expecting LOGIN_SUCCESS" ); ch.setProtocol( Protocol.GAME ); thisState = State.LOGIN; // Only reset the Forge client when: // 1) The user is switching servers (so has a current server) // 2) The handshake is complete // 3) The user is currently on a modded server (if we are on a vanilla server, // we may be heading for another vanilla server, so we don't need to reset.) // // user.getServer() gets the user's CURRENT server, not the one we are trying // to connect to. // // We will reset the connection later if the current server is vanilla, and // we need to switch to a modded connection. However, we always need to reset the // connection when we have a modded server regardless of where we go - doing it // here makes sense. if ( user.getServer() != null && user.getForgeClientHandler().isHandshakeComplete() && user.getServer().isForgeServer() ) { user.getForgeClientHandler().resetHandshake(); } throw CancelSendSignal.INSTANCE; }
if ( con.getServer() != null && !con.getServer().isForgeServer() && pluginMessage.getData().length > Short.MAX_VALUE )