All my work on 1.7 so far. Pinging doesnt work, but everything else is near functional. Gotta figure out wtf is happening.
This commit is contained in:
parent
b8c9330bd6
commit
e0ebf1af21
@ -20,7 +20,7 @@ public class MinecraftDecoder extends ByteToMessageDecoder
|
|||||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
|
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
|
||||||
{
|
{
|
||||||
Protocol.ProtocolDirection prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT;
|
Protocol.ProtocolDirection prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT;
|
||||||
ByteBuf copy = in.copy();
|
ByteBuf copy = in.copy(); // TODO
|
||||||
|
|
||||||
int packetId = DefinedPacket.readVarInt( in );
|
int packetId = DefinedPacket.readVarInt( in );
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class MinecraftDecoder extends ByteToMessageDecoder
|
|||||||
if ( in.readableBytes() != 0 )
|
if ( in.readableBytes() != 0 )
|
||||||
{
|
{
|
||||||
System.out.println( in.toString( Charsets.UTF_8 ) );
|
System.out.println( in.toString( Charsets.UTF_8 ) );
|
||||||
throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot );
|
// throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
|
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
|
||||||
ch.addBefore( PipelineUtils.DECRYPT_HANDLER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) );
|
ch.addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) );
|
||||||
} catch ( GeneralSecurityException ex )
|
} catch ( GeneralSecurityException ex )
|
||||||
{
|
{
|
||||||
disconnect( "Cipher error: " + Util.exception( ex ) );
|
disconnect( "Cipher error: " + Util.exception( ex ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user