forked from Hri7566/mpp-server-dev2
implement remove crown, fix crown bugs
This commit is contained in:
parent
9aeba87af1
commit
0d6cf645cf
|
@ -22,6 +22,6 @@ module.exports = Object.seal({
|
||||||
visible: true
|
visible: true
|
||||||
},
|
},
|
||||||
|
|
||||||
hostDevFiles: false,
|
hostDevFiles: true,
|
||||||
enableMPPCloneBot: true
|
enableMPPCloneBot: false
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 91ff8343d35176eb8bcfb4c51396871a7ddac5b6
|
|
@ -364,9 +364,11 @@ class Channel extends EventEmitter {
|
||||||
this.crown = new Crown(id, prsn.user._id);
|
this.crown = new Crown(id, prsn.user._id);
|
||||||
this.crowndropped = false;
|
this.crowndropped = false;
|
||||||
} else {
|
} else {
|
||||||
|
if (this.crown) {
|
||||||
this.crown = new Crown(id, this.crown.userId);
|
this.crown = new Crown(id, this.crown.userId);
|
||||||
this.crowndropped = true;
|
this.crowndropped = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.updateCh();
|
this.updateCh();
|
||||||
}
|
}
|
||||||
|
@ -449,6 +451,7 @@ class Channel extends EventEmitter {
|
||||||
this.adminChat("pong");
|
this.adminChat("pong");
|
||||||
break;
|
break;
|
||||||
case "!setcolor":
|
case "!setcolor":
|
||||||
|
case "!color":
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
this.adminChat("You do not have permission to use this command.");
|
this.adminChat("You do not have permission to use this command.");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -97,7 +97,9 @@ module.exports = (cl) => {
|
||||||
//console.log((Date.now() - cl.channel.crown.time))
|
//console.log((Date.now() - cl.channel.crown.time))
|
||||||
//console.log(!(cl.channel.crown.userId != cl.user._id), !((Date.now() - cl.channel.crown.time) > 15000));
|
//console.log(!(cl.channel.crown.userId != cl.user._id), !((Date.now() - cl.channel.crown.time) > 15000));
|
||||||
|
|
||||||
|
if (!cl.channel.crown && !admin) {
|
||||||
if (!(cl.channel.crown.userId == cl.user._id) && !((Date.now() - cl.channel.crown.time) > 15000)) return;
|
if (!(cl.channel.crown.userId == cl.user._id) && !((Date.now() - cl.channel.crown.time) > 15000)) return;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.hasOwnProperty("id")) {
|
if (msg.hasOwnProperty("id")) {
|
||||||
// console.log(cl.channel.crown)
|
// console.log(cl.channel.crown)
|
||||||
|
@ -369,13 +371,14 @@ module.exports = (cl) => {
|
||||||
|
|
||||||
if (!msg.hasOwnProperty('msg')) return;
|
if (!msg.hasOwnProperty('msg')) return;
|
||||||
if (typeof msg.msg != 'object') return;
|
if (typeof msg.msg != 'object') return;
|
||||||
|
if (typeof msg.msg.m != 'string') return;
|
||||||
|
|
||||||
if (!cl.channel) return;
|
if (!cl.channel) return;
|
||||||
if (!msg.hasOwnProperty('_id')) msg._id = cl.channel._id;
|
if (!msg.hasOwnProperty('_id')) msg._id = cl.channel._id;
|
||||||
|
|
||||||
let ch = cl.server.rooms.get(msg._id);
|
let ch = cl.server.rooms.get(msg._id);
|
||||||
if (!ch) return;
|
if (!ch) return;
|
||||||
ch.emit(msg.m, msg);
|
ch.emit(msg.msg.m, msg.msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
cl.on('name', (msg, admin) => {
|
cl.on('name', (msg, admin) => {
|
||||||
|
|
Loading…
Reference in New Issue