xP: fix command sequence number generation
This commit is contained in:
parent
9eaf78f823
commit
c06894b291
|
@ -110,8 +110,9 @@ class RelayRpc extends EventTarget {
|
|||
if (typeof params !== 'object')
|
||||
throw "Method parameters must be an object"
|
||||
|
||||
// Left shifts in Javascript convert to a 32-bit signed number.
|
||||
let seq = ++this.commandSeq
|
||||
if (seq >= 1 << 32)
|
||||
if ((seq << 0) != seq)
|
||||
seq = this.commandSeq = 0
|
||||
|
||||
this.ws.send(JSON.stringify({commandSeq: seq, data: params}))
|
||||
|
|
Loading…
Reference in New Issue