From d1edd13cc3e02f79893c696f60ed2a8be435abf4 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 6 Jun 2022 14:44:09 -0600 Subject: [PATCH] Update counter on join/part --- static/repeaters.mjs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/static/repeaters.mjs b/static/repeaters.mjs index 39504ae..fbb7a10 100644 --- a/static/repeaters.mjs +++ b/static/repeaters.mjs @@ -73,7 +73,7 @@ export class Vail { msg = JSON.parse(jmsg) } catch (err) { - console.error(jmsg) + console.error(err, jmsg) return } let stats = { @@ -82,13 +82,10 @@ export class Vail { clients: msg.Clients, connected: this.connected, } - if (typeof(msg) == "string") { - console.error(msg) - return - } // XXX: Why is this happening? if (msg.Timestamp == 0) { + console.debug("Got timestamp=0", msg) return } @@ -107,10 +104,8 @@ export class Vail { // Packets with 0 length tell us what time the server thinks it is, // and how many clients are connected if (msg.Duration.length == 0) { - if (this.clockOffset == 0) { - this.clockOffset = now - msg.Timestamp - this.rx(0, 0, stats) - } + this.clockOffset = now - msg.Timestamp + this.rx(0, 0, stats) return }