Reorder checks to prevent malformed packets throwing errors
This commit is contained in:
parent
eaf99cf4a6
commit
340d82812a
@ -266,12 +266,12 @@ public class ServerConnector extends PacketHandler
|
|||||||
@Override
|
@Override
|
||||||
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
|
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
|
||||||
{
|
{
|
||||||
if ( pluginMessage.equals( PacketConstants.I_AM_BUNGEE) )
|
if ( pluginMessage.equals( PacketConstants.I_AM_BUNGEE ) )
|
||||||
{
|
{
|
||||||
throw new IllegalStateException( "May not connect to another BungeCord!" );
|
throw new IllegalStateException( "May not connect to another BungeCord!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( pluginMessage.getData()[0] & 0xFF ) == 0 && pluginMessage.getTag().equals( "FML" ) )
|
if ( pluginMessage.getTag().equals( "FML" ) && ( pluginMessage.getData()[0] & 0xFF ) == 0 )
|
||||||
{
|
{
|
||||||
ByteArrayDataInput in = ByteStreams.newDataInput( pluginMessage.getData() );
|
ByteArrayDataInput in = ByteStreams.newDataInput( pluginMessage.getData() );
|
||||||
in.readUnsignedByte();
|
in.readUnsignedByte();
|
||||||
|
@ -111,7 +111,7 @@ public class UpstreamBridge extends PacketHandler
|
|||||||
throw new CancelSendSignal();
|
throw new CancelSendSignal();
|
||||||
}
|
}
|
||||||
// Hack around Forge race conditions
|
// Hack around Forge race conditions
|
||||||
if ( ( pluginMessage.getData()[0] & 0xFF ) == 1 && pluginMessage.getTag().equals( "FML" ) )
|
if ( pluginMessage.getTag().equals( "FML" ) && ( pluginMessage.getData()[0] & 0xFF ) == 1 )
|
||||||
{
|
{
|
||||||
throw new CancelSendSignal();
|
throw new CancelSendSignal();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user