forked from Hri7566/mpp-server-dev2
didn't commit these two for some reason
This commit is contained in:
parent
4d99e248c5
commit
3bb2a49b28
|
@ -33,14 +33,13 @@ class Client extends EventEmitter {
|
||||||
setChannel(_id, settings) {
|
setChannel(_id, settings) {
|
||||||
if (this.channel && this.channel._id == _id) return;
|
if (this.channel && this.channel._id == _id) return;
|
||||||
if (this.server.rooms.get(_id)) {
|
if (this.server.rooms.get(_id)) {
|
||||||
let room = this.server.rooms.get(_id);
|
let room = this.server.rooms.get(_id, settings);
|
||||||
let userbanned = room.bans.get(this.user._id);
|
let userbanned = room.bans.get(this.user._id);
|
||||||
if (userbanned && (Date.now() - userbanned.bannedtime >= userbanned.msbanned)) {
|
if (userbanned && (Date.now() - userbanned.bannedtime >= userbanned.msbanned)) {
|
||||||
room.bans.delete(userbanned.user._id);
|
room.bans.delete(userbanned.user._id);
|
||||||
userbanned = undefined;
|
userbanned = undefined;
|
||||||
}
|
}
|
||||||
if (userbanned) {
|
if (userbanned) {
|
||||||
console.log(Date.now() - userbanned.bannedtime)
|
|
||||||
room.Notification(this.user._id,
|
room.Notification(this.user._id,
|
||||||
"Notice",
|
"Notice",
|
||||||
`Currently banned from \"${_id}\" for ${Math.ceil(Math.floor((userbanned.msbanned - (Date.now() - userbanned.bannedtime)) / 1000) / 60)} minutes.`,
|
`Currently banned from \"${_id}\" for ${Math.ceil(Math.floor((userbanned.msbanned - (Date.now() - userbanned.bannedtime)) / 1000) / 60)} minutes.`,
|
||||||
|
@ -49,6 +48,7 @@ class Client extends EventEmitter {
|
||||||
"#room",
|
"#room",
|
||||||
"short"
|
"short"
|
||||||
);
|
);
|
||||||
|
this.setChannel("test/awkward", settings);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let channel = this.channel;
|
let channel = this.channel;
|
||||||
|
@ -100,7 +100,6 @@ class Client extends EventEmitter {
|
||||||
this.connectionid;
|
this.connectionid;
|
||||||
this.server.connections.delete(this.connectionid);
|
this.server.connections.delete(this.connectionid);
|
||||||
this.destroied = true;
|
this.destroied = true;
|
||||||
console.log(`Removed Connection ${this.connectionid}.`);
|
|
||||||
}
|
}
|
||||||
bindEventListeners() {
|
bindEventListeners() {
|
||||||
this.ws.on("message", (evt, admin) => {
|
this.ws.on("message", (evt, admin) => {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
const Client = require("./Client.js");
|
const Client = require("./Client.js");
|
||||||
const banned = require('../banned.json');
|
const banned = require('../banned.json');
|
||||||
|
|
||||||
class Server extends EventEmitter {
|
class Server extends EventEmitter {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
super();
|
super();
|
||||||
|
|
Loading…
Reference in New Issue