debug info
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user