diff --git a/lib/packets/packet.js b/lib/packets/packet.js index b9e7755bd4..d4cd24e81d 100644 --- a/lib/packets/packet.js +++ b/lib/packets/packet.js @@ -832,11 +832,10 @@ class Packet { if (n === null) { return this.writeInt8(0xfb); } - // TODO: check that n is out of int precision this.writeInt8(0xfe); - this.buffer.writeUInt32LE(n, this.offset); + this.buffer.writeUInt32LE(n & 0xffffffff, this.offset); this.offset += 4; - this.buffer.writeUInt32LE(n >> 32, this.offset); + this.buffer.writeUInt32LE(Math.floor(n / 0x100000000), this.offset); this.offset += 4; return this.offset; }