mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Forge support is now working - however an unidentified mod is breaking it due to the use of packet 80. All I can tell is this mod is present in FTB lite.
This commit is contained in:
parent
bef2818537
commit
9b1f1d9a50
@ -44,6 +44,10 @@ public class InitialHandler extends PacketHandler implements Runnable, PendingCo
|
||||
private PacketFDEncryptionRequest request;
|
||||
private List<PacketFAPluginMessage> loginMessages = new ArrayList<>();
|
||||
private State thisState = State.HANDSHAKE;
|
||||
private static final PacketFAPluginMessage forgeMods = new PacketFAPluginMessage( "FML", new byte[]
|
||||
{
|
||||
0, 0, 0, 0, 0, 2
|
||||
} );
|
||||
|
||||
public InitialHandler(Socket socket, ListenerInfo info) throws IOException
|
||||
{
|
||||
@ -106,6 +110,7 @@ public class InitialHandler extends PacketHandler implements Runnable, PendingCo
|
||||
{
|
||||
Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" );
|
||||
this.handshake = handshake;
|
||||
stream.write( forgeMods );
|
||||
request = EncryptionUtil.encryptRequest();
|
||||
stream.write( request );
|
||||
thisState = State.ENCRYPT;
|
||||
@ -166,6 +171,7 @@ public class InitialHandler extends PacketHandler implements Runnable, PendingCo
|
||||
{
|
||||
byte[] buf = stream.readPacket();
|
||||
DefinedPacket packet = DefinedPacket.packet( buf );
|
||||
System.out.println( packet );
|
||||
packet.handle( this );
|
||||
}
|
||||
} catch ( Exception ex )
|
||||
|
@ -55,18 +55,30 @@ public class ServerConnection extends GenericConnection implements Server
|
||||
}
|
||||
|
||||
stream.write( handshake );
|
||||
for ( PacketFAPluginMessage message : user.loginMessages )
|
||||
{
|
||||
stream.write( message );
|
||||
}
|
||||
|
||||
stream.write( PacketCDClientStatus.CLIENT_LOGIN );
|
||||
stream.readPacket();
|
||||
|
||||
byte[] loginResponse = stream.readPacket();
|
||||
if ( Util.getId( loginResponse ) == 0xFF )
|
||||
byte[] loginResponse = null;
|
||||
loop:
|
||||
while ( true )
|
||||
{
|
||||
throw new KickException( "[Kicked] " + new PacketFFKick( loginResponse ).message );
|
||||
loginResponse = stream.readPacket();
|
||||
int id = Util.getId( loginResponse );
|
||||
switch ( id )
|
||||
{
|
||||
case 0x01:
|
||||
break loop;
|
||||
case 0xFA:
|
||||
for ( PacketFAPluginMessage message : user.loginMessages )
|
||||
{
|
||||
stream.write( message );
|
||||
}
|
||||
break;
|
||||
case 0xFF:
|
||||
throw new KickException( "[Kicked] " + new PacketFFKick( loginResponse ).message );
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unknown login packet " + Util.hex( id ) );
|
||||
}
|
||||
}
|
||||
Packet1Login login = new Packet1Login( loginResponse );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user