little inconsistencies

This commit is contained in:
HF 2023-03-18 14:32:33 +01:00
parent c7a87fbaa7
commit 2437b44db7
2 changed files with 7 additions and 4 deletions

View File

@ -28,6 +28,7 @@
"function-call-argument-newline":"off",
"max-len": [1, 80, 2, {"ignoreComments": true}],
"no-bitwise": 0,
"no-restricted-syntax": 0,
"no-plusplus" : "off",
"no-param-reassign": "off",
"no-mixed-operators":"off",

View File

@ -329,9 +329,9 @@ class SocketServer {
killAllWsByUerIp(ip) {
let amount = ipCounter.get(ip);
if (!amount) return 0;
// eslint-disable-next-line
for (const [chunkid, clients] of this.CHUNK_CLIENTS.entries()) {
const newClients = clients.filter((ws) => ws.user.ip === ip);
const newClients = clients.filter((ws) => ws.user.ip !== ip);
if (clients.length !== newClients.length) {
this.CHUNK_CLIENTS.set(chunkid, newClients);
}
@ -650,11 +650,13 @@ class SocketServer {
}
deleteAllChunks(ws) {
if (!ws.chunkCnt) return;
if (!ws.chunkCnt) {
return;
}
if (ws.user.id === 1) {
console.log('DEBUG delete all chunk for hf');
}
// eslint-disable-next-line
for (const client of this.CHUNK_CLIENTS.values()) {
const pos = client.indexOf(ws);
if (~pos) {