debug info
This commit is contained in:
@@ -30,6 +30,9 @@ public class PacketDecoder extends ByteToMessageDecoder {
|
||||
packet.readSelf(netStream);
|
||||
|
||||
out.add(packet);
|
||||
log.debug("{}: {}", packet.getClass().getSimpleName(), packet.toString());
|
||||
} else {
|
||||
log.debug("Unknown packet");
|
||||
}
|
||||
|
||||
if (in.readableBytes() > 0)
|
||||
|
||||
@@ -32,8 +32,6 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, CSPacket packet) throws Exception {
|
||||
log.debug("{}: {}", packet.getClass().getSimpleName(), packet.toString());
|
||||
|
||||
Optional<Method> optionalMethod = Arrays.stream(this.getClass().getDeclaredMethods())
|
||||
.filter(method -> method.getName().equals("on" + packet.getClass().getSimpleName())
|
||||
&& method.getParameterCount() == 2
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
*/
|
||||
package mc.core.network.proto_125.packets;
|
||||
|
||||
import lombok.ToString;
|
||||
import mc.core.network.CSPacket;
|
||||
import mc.core.network.NetStream;
|
||||
|
||||
@ToString
|
||||
public class PingPacket implements CSPacket {
|
||||
@Override
|
||||
public void readSelf(NetStream netStream) {
|
||||
|
||||
Reference in New Issue
Block a user