aboutsummaryrefslogtreecommitdiff
path: root/xP/public
diff options
context:
space:
mode:
Diffstat (limited to 'xP/public')
-rw-r--r--xP/public/xP.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 95ee879..a9fc96c 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -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}))