Reduce unnecessary logs from packetLogger

This commit is contained in:
Him188 2022-06-14 11:22:04 +01:00
parent a4e7fda416
commit 2dcff0cf45
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375
2 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,9 @@ internal class PacketCodecImpl : PacketCodec {
if (PacketLogger.isEnabled) {
val extraData = readBytes(readInt() - 4)
PacketLogger.verbose { "(sso/inner)extraData = ${extraData.toUHexString()}" }
if (extraData.isNotEmpty()) {
PacketLogger.verbose { "(sso/inner)extraData = ${extraData.toUHexString()}" }
}
} else {
discardExact(readInt() - 4)
}

View File

@ -110,7 +110,6 @@ internal open class NettyNetworkHandler(
private inner class OutgoingPacketEncoder : MessageToByteEncoder<OutgoingPacket>(OutgoingPacket::class.java) {
override fun encode(ctx: ChannelHandlerContext, msg: OutgoingPacket, out: ByteBuf) {
packetLogger.debug { "encode: ${msg.displayName}" }
out.writeBytes(msg.delegate)
}
}
@ -187,7 +186,6 @@ internal open class NettyNetworkHandler(
fun send(raw: RawIncomingPacket) {
launch {
packetLogger.debug { "Packet Handling Processor: receive packet ${raw.commandName}" }
val result = packetCodec.processBody(context.bot, raw)
if (result == null) {
collectUnknownPacket(raw)