Update counter on join/part

This commit is contained in:
Neale Pickett 2022-06-06 14:44:09 -06:00
parent 51f89b6762
commit d1edd13cc3
1 changed files with 4 additions and 9 deletions

View File

@ -73,7 +73,7 @@ export class Vail {
msg = JSON.parse(jmsg) msg = JSON.parse(jmsg)
} }
catch (err) { catch (err) {
console.error(jmsg) console.error(err, jmsg)
return return
} }
let stats = { let stats = {
@ -82,13 +82,10 @@ export class Vail {
clients: msg.Clients, clients: msg.Clients,
connected: this.connected, connected: this.connected,
} }
if (typeof(msg) == "string") {
console.error(msg)
return
}
// XXX: Why is this happening? // XXX: Why is this happening?
if (msg.Timestamp == 0) { if (msg.Timestamp == 0) {
console.debug("Got timestamp=0", msg)
return return
} }
@ -107,10 +104,8 @@ export class Vail {
// Packets with 0 length tell us what time the server thinks it is, // Packets with 0 length tell us what time the server thinks it is,
// and how many clients are connected // and how many clients are connected
if (msg.Duration.length == 0) { if (msg.Duration.length == 0) {
if (this.clockOffset == 0) {
this.clockOffset = now - msg.Timestamp this.clockOffset = now - msg.Timestamp
this.rx(0, 0, stats) this.rx(0, 0, stats)
}
return return
} }