docs: some clarifications in createUnconnectedPingFrame
This commit is contained in:
parent
fa4c34d896
commit
0b0bed4e71
|
@ -16,12 +16,12 @@ const START_TIME = new Date().getTime();
|
||||||
* @returns {Buffer}
|
* @returns {Buffer}
|
||||||
* @see {@link https://wiki.vg/Raknet_Protocol#Unconnected_Ping}
|
* @see {@link https://wiki.vg/Raknet_Protocol#Unconnected_Ping}
|
||||||
*/
|
*/
|
||||||
const createUnconnectedPingFrame = (pingId) => {
|
const createUnconnectedPingFrame = (timestamp) => {
|
||||||
const buffer = Buffer.alloc(33);
|
const buffer = Buffer.alloc(33);
|
||||||
buffer.writeUInt8(0x01, 0);
|
buffer.writeUInt8(0x01, 0); // Packet ID
|
||||||
buffer.writeBigInt64LE(BigInt(pingId), 1);
|
buffer.writeBigInt64LE(BigInt(timestamp), 1); // Timestamp
|
||||||
Buffer.from(MAGIC, "hex").copy(buffer, 9);
|
Buffer.from(MAGIC, "hex").copy(buffer, 9); // OFFLINE_MESSAGE_DATA_ID (Magic)
|
||||||
buffer.writeBigInt64LE(BigInt(0), 25);
|
buffer.writeBigInt64LE(BigInt(0), 25); // Client GUID
|
||||||
return buffer;
|
return buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue