mirror of
https://github.com/minescope/mineping.git
synced 2024-12-25 18:25:46 +00:00
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}
|
||||
* @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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user