mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 15:11:32 +00:00
Fix resetting timestamps
This commit is contained in:
parent
ca93c05eee
commit
79c10f7084
1 changed files with 1 additions and 2 deletions
|
|
@ -49,9 +49,8 @@ class StreamDispatcher extends Writable {
|
|||
this.sendPacket(packet);
|
||||
const next = FRAME_LENGTH + (this.startTime + (this._sdata.count * FRAME_LENGTH) - Date.now());
|
||||
setTimeout(done.bind(this), next);
|
||||
// Do overflow checks here!
|
||||
if (this._sdata.sequence === (2 ** 16) - 1) this._sdata.sequence = -1;
|
||||
if (this._sdata.timestamp === (2 ** 32) - 1) this._sdata.timestamp = -1;
|
||||
if (this._sdata.timestamp === (2 ** 32) - 1) this._sdata.timestamp = -960;
|
||||
this._sdata.sequence++;
|
||||
this._sdata.timestamp += 960;
|
||||
this._sdata.count++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue