forked from Hri7566/mpp-server-dev2
This commit is contained in:
parent
e45582efea
commit
95d2567145
File diff suppressed because it is too large
Load Diff
|
@ -31,6 +31,7 @@
|
|||
"level": "^7.0.0",
|
||||
"mongoose": "^5.12.7",
|
||||
"node-json-color-stringify": "^1.1.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"ws": "^7.2.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ module.exports = (cl) => {
|
|||
|
||||
cl.on("ch", msg => {
|
||||
if (typeof(msg.set) !== 'object') msg.set = {};
|
||||
console.log(msg);
|
||||
|
||||
if (typeof(msg._id) == "string") {
|
||||
if (msg._id.length > 512) return;
|
||||
|
@ -67,13 +66,13 @@ module.exports = (cl) => {
|
|||
});
|
||||
|
||||
cl.on("m", (msg, admin) => {
|
||||
if (!cl.hasOwnProperty('room')) return;
|
||||
if (!cl.hasOwnProperty('channel')) return;
|
||||
if (!cl.quotas.cursor.attempt() && !admin) return;
|
||||
if (!(cl.channel && cl.participantId)) return;
|
||||
if (!msg.hasOwnProperty("x")) msg.x = null;
|
||||
if (!msg.hasOwnProperty("y")) msg.y = null;
|
||||
if (parseInt(msg.x) == NaN) msg.x = null;
|
||||
if (parseInt(msg.y) == NaN) msg.y = null;
|
||||
if (isNaN(parseFloat(msg.x))) msg.x = null;
|
||||
if (isNaN(parseFloat(msg.y))) msg.y = null;
|
||||
cl.channel.emit("m", cl, msg.x, msg.y);
|
||||
});
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Server extends EventEmitter {
|
|||
|
||||
this.logger = new Logger("Server");
|
||||
|
||||
if (config.ssl == true) {
|
||||
if (config.ssl == "true") {
|
||||
this.https_server = https.createServer({
|
||||
key: fs.readFileSync('ssl/privkey.pem', 'utf8'),
|
||||
cert: fs.readFileSync('ssl/cert.pem'),
|
||||
|
|
Loading…
Reference in New Issue