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 PacketFDEncryptionRequest request;
|
||||||
private List<PacketFAPluginMessage> loginMessages = new ArrayList<>();
|
private List<PacketFAPluginMessage> loginMessages = new ArrayList<>();
|
||||||
private State thisState = State.HANDSHAKE;
|
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
|
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" );
|
Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" );
|
||||||
this.handshake = handshake;
|
this.handshake = handshake;
|
||||||
|
stream.write( forgeMods );
|
||||||
request = EncryptionUtil.encryptRequest();
|
request = EncryptionUtil.encryptRequest();
|
||||||
stream.write( request );
|
stream.write( request );
|
||||||
thisState = State.ENCRYPT;
|
thisState = State.ENCRYPT;
|
||||||
@ -166,6 +171,7 @@ public class InitialHandler extends PacketHandler implements Runnable, PendingCo
|
|||||||
{
|
{
|
||||||
byte[] buf = stream.readPacket();
|
byte[] buf = stream.readPacket();
|
||||||
DefinedPacket packet = DefinedPacket.packet( buf );
|
DefinedPacket packet = DefinedPacket.packet( buf );
|
||||||
|
System.out.println( packet );
|
||||||
packet.handle( this );
|
packet.handle( this );
|
||||||
}
|
}
|
||||||
} catch ( Exception ex )
|
} catch ( Exception ex )
|
||||||
|
@ -55,18 +55,30 @@ public class ServerConnection extends GenericConnection implements Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream.write( handshake );
|
stream.write( handshake );
|
||||||
|
stream.write( PacketCDClientStatus.CLIENT_LOGIN );
|
||||||
|
stream.readPacket();
|
||||||
|
|
||||||
|
byte[] loginResponse = null;
|
||||||
|
loop:
|
||||||
|
while ( true )
|
||||||
|
{
|
||||||
|
loginResponse = stream.readPacket();
|
||||||
|
int id = Util.getId( loginResponse );
|
||||||
|
switch ( id )
|
||||||
|
{
|
||||||
|
case 0x01:
|
||||||
|
break loop;
|
||||||
|
case 0xFA:
|
||||||
for ( PacketFAPluginMessage message : user.loginMessages )
|
for ( PacketFAPluginMessage message : user.loginMessages )
|
||||||
{
|
{
|
||||||
stream.write( message );
|
stream.write( message );
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
stream.write( PacketCDClientStatus.CLIENT_LOGIN );
|
case 0xFF:
|
||||||
stream.readPacket();
|
|
||||||
|
|
||||||
byte[] loginResponse = stream.readPacket();
|
|
||||||
if ( Util.getId( loginResponse ) == 0xFF )
|
|
||||||
{
|
|
||||||
throw new KickException( "[Kicked] " + new PacketFFKick( loginResponse ).message );
|
throw new KickException( "[Kicked] " + new PacketFFKick( loginResponse ).message );
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException( "Unknown login packet " + Util.hex( id ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Packet1Login login = new Packet1Login( loginResponse );
|
Packet1Login login = new Packet1Login( loginResponse );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user