Files
2026-08-24 22:20:36 +02:00

22 lines
629 B
JavaScript

/*
@Packet name leaderboardPosition
@Packet identifier 62
@Description
@Data pId
@Structure -
*/
module.exports = function (data) {
const packetLength = 1 + + 1 + 7 * (2 + 2);
const buffer = new ArrayBuffer(packetLength);
const view = new DataView(buffer);
view.setUint8(0, 62);
view.setUint8(1, packetLength);
for (let i = 0; i < 7; i++) {
view.setUint16(2 + i * 4, data[i].selfPosition);
view.setUint16(2 + i * 4 + 2, data[i].totalPositionsLength);
};
return buffer;
};