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.ws.close();
|
||||
}
|
||||
if (now - 43000 > this.timeLastSent) {
|
||||
// make sure we send something at least all 45s
|
||||
if (now - 23000 > this.timeLastSent) {
|
||||
// make sure we send something at least all 25s
|
||||
this.sendWhenReady(Ping.dehydrate());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -368,7 +368,9 @@ class SocketServer {
|
|||
let client = it.next();
|
||||
while (!client.done) {
|
||||
const ws = client.value;
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
if (ws.readyState === WebSocket.OPEN
|
||||
&& ws.user
|
||||
) {
|
||||
const canvasId = ws.canvasId || 0;
|
||||
const { ip } = ws.user;
|
||||
// only count unique IPs per canvas
|
||||
|
|
Loading…
Reference in New Issue
Block a user