forked from ppfun/pixelplanet
update ws
remove useless console.log from socketserver
This commit is contained in:
parent
bb47924d92
commit
73f67261b6
949
package-lock.json
generated
949
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
|
@ -42,7 +42,7 @@
|
||||||
"express-limiter": "^1.6.0",
|
"express-limiter": "^1.6.0",
|
||||||
"express-session": "^1.17.2",
|
"express-session": "^1.17.2",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"http-proxy-agent": "^4.0.1",
|
"http-proxy-agent": "^5.0.0",
|
||||||
"image-q": "^3.0.5",
|
"image-q": "^3.0.5",
|
||||||
"isomorphic-fetch": "^3.0.0",
|
"isomorphic-fetch": "^3.0.0",
|
||||||
"js-file-download": "^0.4.12",
|
"js-file-download": "^0.4.12",
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
"redux-thunk": "^2.4.1",
|
"redux-thunk": "^2.4.1",
|
||||||
"sequelize": "^6.12.4",
|
"sequelize": "^6.12.5",
|
||||||
"sharp": "^0.29.3",
|
"sharp": "^0.29.3",
|
||||||
"startaudiocontext": "^1.2.1",
|
"startaudiocontext": "^1.2.1",
|
||||||
"three": "^0.136.0",
|
"three": "^0.136.0",
|
||||||
|
@ -82,24 +82,24 @@
|
||||||
"url-search-params-polyfill": "^8.1.1",
|
"url-search-params-polyfill": "^8.1.1",
|
||||||
"winston": "^3.3.3",
|
"winston": "^3.3.3",
|
||||||
"winston-daily-rotate-file": "^4.5.5",
|
"winston-daily-rotate-file": "^4.5.5",
|
||||||
"ws": "^7.5.3"
|
"ws": "^8.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.16.7",
|
"@babel/cli": "^7.16.7",
|
||||||
"@babel/core": "^7.16.7",
|
"@babel/core": "^7.16.7",
|
||||||
|
"@babel/eslint-parser": "^7.16.5",
|
||||||
"@babel/node": "^7.16.7",
|
"@babel/node": "^7.16.7",
|
||||||
"@babel/plugin-transform-flow-strip-types": "^7.16.7",
|
|
||||||
"@babel/plugin-proposal-throw-expressions": "^7.16.7",
|
"@babel/plugin-proposal-throw-expressions": "^7.16.7",
|
||||||
|
"@babel/plugin-transform-flow-strip-types": "^7.16.7",
|
||||||
"@babel/plugin-transform-react-constant-elements": "^7.16.7",
|
"@babel/plugin-transform-react-constant-elements": "^7.16.7",
|
||||||
"@babel/plugin-transform-react-inline-elements": "^7.16.7",
|
"@babel/plugin-transform-react-inline-elements": "^7.16.7",
|
||||||
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
|
||||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
||||||
"@babel/preset-env": "^7.16.7",
|
"@babel/preset-env": "^7.16.7",
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"assets-webpack-plugin": "^7.1.1",
|
"assets-webpack-plugin": "^7.1.1",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
|
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
|
||||||
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||||
"babel-plugin-ttag": "^1.7.30",
|
"babel-plugin-ttag": "^1.7.30",
|
||||||
"@babel/eslint-parser": "^7.16.5",
|
|
||||||
"clean-css": "^5.2.2",
|
"clean-css": "^5.2.2",
|
||||||
"copy-webpack-plugin": "^10.2.0",
|
"copy-webpack-plugin": "^10.2.0",
|
||||||
"css-loader": "^6.5.1",
|
"css-loader": "^6.5.1",
|
||||||
|
|
|
@ -96,11 +96,12 @@ class SocketServer {
|
||||||
this.deleteAllChunks(ws);
|
this.deleteAllChunks(ws);
|
||||||
});
|
});
|
||||||
|
|
||||||
ws.on('message', (message) => {
|
ws.on('message', (data, isBinary) => {
|
||||||
if (typeof message === 'string') {
|
if (isBinary) {
|
||||||
this.onTextMessage(message, ws);
|
this.onBinaryMessage(data, ws);
|
||||||
} else {
|
} else {
|
||||||
this.onBinaryMessage(message, ws);
|
const message = data.toString();
|
||||||
|
this.onTextMessage(message, ws);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -320,7 +321,6 @@ class SocketServer {
|
||||||
}
|
}
|
||||||
client = it.next();
|
client = it.next();
|
||||||
}
|
}
|
||||||
console.log(online);
|
|
||||||
socketEvents.broadcastOnlineCounter(online);
|
socketEvents.broadcastOnlineCounter(online);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user