forked from ppfun/pixelplanet
little inconsistencies
This commit is contained in:
parent
c7a87fbaa7
commit
2437b44db7
|
@ -28,6 +28,7 @@
|
||||||
"function-call-argument-newline":"off",
|
"function-call-argument-newline":"off",
|
||||||
"max-len": [1, 80, 2, {"ignoreComments": true}],
|
"max-len": [1, 80, 2, {"ignoreComments": true}],
|
||||||
"no-bitwise": 0,
|
"no-bitwise": 0,
|
||||||
|
"no-restricted-syntax": 0,
|
||||||
"no-plusplus" : "off",
|
"no-plusplus" : "off",
|
||||||
"no-param-reassign": "off",
|
"no-param-reassign": "off",
|
||||||
"no-mixed-operators":"off",
|
"no-mixed-operators":"off",
|
||||||
|
|
|
@ -329,9 +329,9 @@ class SocketServer {
|
||||||
killAllWsByUerIp(ip) {
|
killAllWsByUerIp(ip) {
|
||||||
let amount = ipCounter.get(ip);
|
let amount = ipCounter.get(ip);
|
||||||
if (!amount) return 0;
|
if (!amount) return 0;
|
||||||
// eslint-disable-next-line
|
|
||||||
for (const [chunkid, clients] of this.CHUNK_CLIENTS.entries()) {
|
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) {
|
if (clients.length !== newClients.length) {
|
||||||
this.CHUNK_CLIENTS.set(chunkid, newClients);
|
this.CHUNK_CLIENTS.set(chunkid, newClients);
|
||||||
}
|
}
|
||||||
|
@ -650,11 +650,13 @@ class SocketServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAllChunks(ws) {
|
deleteAllChunks(ws) {
|
||||||
if (!ws.chunkCnt) return;
|
if (!ws.chunkCnt) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ws.user.id === 1) {
|
if (ws.user.id === 1) {
|
||||||
console.log('DEBUG delete all chunk for hf');
|
console.log('DEBUG delete all chunk for hf');
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line
|
|
||||||
for (const client of this.CHUNK_CLIENTS.values()) {
|
for (const client of this.CHUNK_CLIENTS.values()) {
|
||||||
const pos = client.indexOf(ws);
|
const pos = client.indexOf(ws);
|
||||||
if (~pos) {
|
if (~pos) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user