add check for ws.user again
This commit is contained in:
parent
a9c2289d4f
commit
d3e6010e07
|
@ -66,8 +66,8 @@ class SocketClient extends EventEmitter {
|
||||||
this.readyState = WebSocket.CLOSING;
|
this.readyState = WebSocket.CLOSING;
|
||||||
this.ws.close();
|
this.ws.close();
|
||||||
}
|
}
|
||||||
if (now - 43000 > this.timeLastSent) {
|
if (now - 23000 > this.timeLastSent) {
|
||||||
// make sure we send something at least all 45s
|
// make sure we send something at least all 25s
|
||||||
this.sendWhenReady(Ping.dehydrate());
|
this.sendWhenReady(Ping.dehydrate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -368,7 +368,9 @@ class SocketServer {
|
||||||
let client = it.next();
|
let client = it.next();
|
||||||
while (!client.done) {
|
while (!client.done) {
|
||||||
const ws = client.value;
|
const ws = client.value;
|
||||||
if (ws.readyState === WebSocket.OPEN) {
|
if (ws.readyState === WebSocket.OPEN
|
||||||
|
&& ws.user
|
||||||
|
) {
|
||||||
const canvasId = ws.canvasId || 0;
|
const canvasId = ws.canvasId || 0;
|
||||||
const { ip } = ws.user;
|
const { ip } = ws.user;
|
||||||
// only count unique IPs per canvas
|
// only count unique IPs per canvas
|
||||||
|
|
Loading…
Reference in New Issue
Block a user