diff --git a/tools/robot/clientnet.js b/tools/robot/clientnet.js index 02300a25..ed1e1d16 100644 --- a/tools/robot/clientnet.js +++ b/tools/robot/clientnet.js @@ -94,11 +94,12 @@ class ClientNet { async onParsePacket() { let offset = 0; - while (this.recvBuf.length > offset + 12) { + while (this.recvBuf.length >= offset + 12) { const msgSize = this.recvBuf.readUInt16LE(offset + 0); const msgId = this.recvBuf.readUInt16LE(offset + 2); const seqId = this.recvBuf.readUInt32LE(offset + 4); const magicCode = this.recvBuf.readUInt16LE(offset + 8); + //console.log('onParsePacket', msgSize, msgId, seqId, magicCode); if (this.recvBuf.length >= offset + 12 + msgSize) { await this.processMsg(msgId, this.recvBuf.slice