forked from ppfun/pixelplanet
little inconsistencies
This commit is contained in:
parent
c7a87fbaa7
commit
2437b44db7
|
@ -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",
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue