fix color

This commit is contained in:
Hri7566 2021-04-13 14:27:01 -04:00
parent 90790fbef2
commit 245f628ad6
3 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
module.exports = Object.seal({
port: 8443,
port: 4000,
motd: "big th0nk",
_id_PrivateKey: process.env.SALT,
defaultUsername: "Anonymous",
@ -10,7 +10,7 @@ module.exports = Object.seal({
// defaultLobbyColor2: "#801014",
defaultLobbyColor2: "#801014",
adminpass: process.env.ADMINPASS,
ssl: true,
ssl: false,
defaultRoomSettings: {
color: "#000000",
crownsolo: false,

View File

@ -2,6 +2,7 @@ const Quota = require('./Quota');
const User = require("./User.js");
const Room = require("./Room.js");
const RoomSettings = require('./RoomSettings');
const Database = require('./Database');
module.exports = (cl) => {
cl.once("hi", (msg, admin) => {
@ -10,8 +11,6 @@ module.exports = (cl) => {
cl.hidden = true;
}
}
console.log(`hidden: ${cl.hidden}`);
let m = {};
m.m = "hi";
@ -191,7 +190,7 @@ module.exports = (cl) => {
if(!cl.quotas.userset.attempt()) return;
cl.user.name = msg.set.name;
let user = new User(cl);
user.getUserData().then((usr) => {
Database.getUserData().then((usr) => {
let dbentry = user.userdb.get(cl.user._id);
if (!dbentry) return;
dbentry.name = msg.set.name;
@ -238,14 +237,15 @@ module.exports = (cl) => {
if (!msg.hasOwnProperty('id') && !msg.hasOwnProperty('_id')) return;
cl.server.connections.forEach((usr) => {
if ((usr.channel && usr.participantId && usr.user) && (usr.user._id == msg._id || (usr.participantId == msg.id))) {
let user = new User(usr);
user.cl.user.color = msg.color;
user.getUserData().then((uSr) => {
if (!usr.hasOwnProperty('user')) return;
let user = new User(usr, usr.user);
user.color = msg.color;
Database.getUserData(cl, cl.server).then((uSr) => {
if (!uSr._id) return;
let dbentry = user.userdb.get(uSr._id);
let dbentry = Database.userdb.get(uSr._id);
if (!dbentry) return;
dbentry.color = msg.color;
user.updatedb();
Database.update();
cl.server.rooms.forEach((room) => {
room.updateParticipant(usr.user._id, {
color: msg.color

View File

@ -29,7 +29,7 @@ class Server extends EventEmitter {
this.https_server.listen(config.port);
} else {
this.wss = new WebSocket.Server({
port: 8443,
port: config.port,
backlog: 100,
verifyClient: (info) => {
if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false;