We can now get pings!
This commit is contained in:
parent
45c848a4fd
commit
8a96555cc7
@ -187,11 +187,11 @@ public class BungeeCord extends ProxyServer
|
||||
for ( ListenerInfo info : config.getListeners() )
|
||||
{
|
||||
Channel server = new ServerBootstrap()
|
||||
.channel( NioServerSocketChannel.class)
|
||||
.channel( NioServerSocketChannel.class )
|
||||
.childAttr( PipelineUtils.LISTENER, info )
|
||||
.childHandler( PipelineUtils.SERVER_CHILD )
|
||||
.group( eventLoops )
|
||||
.localAddress( info.getHost() )
|
||||
.attr( PipelineUtils.LISTENER, info)
|
||||
.bind().channel();
|
||||
listeners.add( server );
|
||||
|
||||
|
@ -60,6 +60,7 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter<ByteBuf>
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
|
||||
{
|
||||
super.exceptionCaught( ctx, cause );
|
||||
if ( ctx.channel().isActive() )
|
||||
{
|
||||
ctx.close();
|
||||
|
@ -27,7 +27,10 @@ public class PacketDecoder extends ReplayingDecoder<ByteBuf>
|
||||
@Override
|
||||
protected ByteBuf decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception
|
||||
{
|
||||
int startIndex = in.readerIndex();
|
||||
PacketReader.readPacket( in, protocol );
|
||||
return in.copy();
|
||||
ByteBuf readPacket = in.copy( startIndex, in.readerIndex() - startIndex );
|
||||
System.out.println( readPacket );
|
||||
return readPacket;
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public abstract class DefinedPacket implements ByteBuf
|
||||
|
||||
public static DefinedPacket packet(ByteBuf buf)
|
||||
{
|
||||
int id = buf.getUnsignedShort( 0 );
|
||||
short id = buf.getUnsignedByte( 0 );
|
||||
Class<? extends DefinedPacket> clazz = classes[id];
|
||||
DefinedPacket ret = null;
|
||||
if ( clazz != null )
|
||||
|
Loading…
Reference in New Issue
Block a user