Archived
0

debug info

This commit is contained in:
2018-04-19 09:08:27 +03:00
parent d618a1f594
commit e31a83670e
3 changed files with 5 additions and 2 deletions

View File

@@ -30,6 +30,9 @@ public class PacketDecoder extends ByteToMessageDecoder {
packet.readSelf(netStream); packet.readSelf(netStream);
out.add(packet); out.add(packet);
log.debug("{}: {}", packet.getClass().getSimpleName(), packet.toString());
} else {
log.debug("Unknown packet");
} }
if (in.readableBytes() > 0) if (in.readableBytes() > 0)

View File

@@ -32,8 +32,6 @@ public class PacketHandler extends SimpleChannelInboundHandler<CSPacket> {
@Override @Override
protected void channelRead0(ChannelHandlerContext ctx, CSPacket packet) throws Exception { protected void channelRead0(ChannelHandlerContext ctx, CSPacket packet) throws Exception {
log.debug("{}: {}", packet.getClass().getSimpleName(), packet.toString());
Optional<Method> optionalMethod = Arrays.stream(this.getClass().getDeclaredMethods()) Optional<Method> optionalMethod = Arrays.stream(this.getClass().getDeclaredMethods())
.filter(method -> method.getName().equals("on" + packet.getClass().getSimpleName()) .filter(method -> method.getName().equals("on" + packet.getClass().getSimpleName())
&& method.getParameterCount() == 2 && method.getParameterCount() == 2

View File

@@ -4,9 +4,11 @@
*/ */
package mc.core.network.proto_125.packets; package mc.core.network.proto_125.packets;
import lombok.ToString;
import mc.core.network.CSPacket; import mc.core.network.CSPacket;
import mc.core.network.NetStream; import mc.core.network.NetStream;
@ToString
public class PingPacket implements CSPacket { public class PingPacket implements CSPacket {
@Override @Override
public void readSelf(NetStream netStream) { public void readSelf(NetStream netStream) {