diff --git a/lib/bedrock.js b/lib/bedrock.js index 212b199..97cffea 100644 --- a/lib/bedrock.js +++ b/lib/bedrock.js @@ -16,12 +16,12 @@ const START_TIME = new Date().getTime(); * @returns {Buffer} * @see {@link https://wiki.vg/Raknet_Protocol#Unconnected_Ping} */ -const createUnconnectedPingFrame = (pingId) => { +const createUnconnectedPingFrame = (timestamp) => { const buffer = Buffer.alloc(33); - buffer.writeUInt8(0x01, 0); - buffer.writeBigInt64LE(BigInt(pingId), 1); - Buffer.from(MAGIC, "hex").copy(buffer, 9); - buffer.writeBigInt64LE(BigInt(0), 25); + buffer.writeUInt8(0x01, 0); // Packet ID + buffer.writeBigInt64LE(BigInt(timestamp), 1); // Timestamp + Buffer.from(MAGIC, "hex").copy(buffer, 9); // OFFLINE_MESSAGE_DATA_ID (Magic) + buffer.writeBigInt64LE(BigInt(0), 25); // Client GUID return buffer; };