didn't commit these two for some reason

This commit is contained in:
charsyチャーシィ 2021-02-28 21:06:39 -07:00
parent 3b21ce6d03
commit 78ea25ed37
2 changed files with 3 additions and 3 deletions

View File

@ -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) => {

View File

@ -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();