forked from Hri7566/mpp-server-dev2
Fix things
fix some forgotten thigs, like adding the correct messages (legit_m) to the server... and cleaning up Quotas.js and Config.js
This commit is contained in:
parent
0badfa0eb1
commit
78d24224d6
72
Quotas.js
72
Quotas.js
|
@ -1,51 +1,51 @@
|
|||
module.exports = Object.seal({
|
||||
"note": {
|
||||
"lobby": {
|
||||
"allowance": 200,
|
||||
"max": 600,
|
||||
"maxHistLen": 3
|
||||
note: {
|
||||
lobby: {
|
||||
allowance: 200,
|
||||
max: 600,
|
||||
maxHistLen: 3
|
||||
},
|
||||
"normal": {
|
||||
"allowance": 400,
|
||||
"max": 1200,
|
||||
"maxHistLen": 3
|
||||
normal: {
|
||||
allowance: 400,
|
||||
max: 1200,
|
||||
maxHistLen: 3
|
||||
},
|
||||
"insane": {
|
||||
"allowance": 600,
|
||||
"max": 1800,
|
||||
"maxHistLen": 3
|
||||
insane: {
|
||||
allowance: 600,
|
||||
max: 1800,
|
||||
maxHistLen: 3
|
||||
}
|
||||
},
|
||||
"chat": {
|
||||
"lobby": {
|
||||
"amount": 4,
|
||||
"time": 4000
|
||||
chat: {
|
||||
lobby: {
|
||||
amount: 4,
|
||||
time: 4000
|
||||
},
|
||||
"normal": {
|
||||
"amount": 4,
|
||||
"time": 4000
|
||||
normal: {
|
||||
amount: 4,
|
||||
time: 4000
|
||||
},
|
||||
"insane": {
|
||||
"amount": 10,
|
||||
"time": 4000
|
||||
insane: {
|
||||
amount: 10,
|
||||
time: 4000
|
||||
}
|
||||
},
|
||||
"chown": {
|
||||
"amount": 10,
|
||||
"time": 5000
|
||||
chown: {
|
||||
amount: 10,
|
||||
time: 5000
|
||||
},
|
||||
"name": {
|
||||
"amount": 30,
|
||||
"time": 30 * 60000
|
||||
name: {
|
||||
amount: 30,
|
||||
time: 30 * 60000
|
||||
},
|
||||
"room": {
|
||||
"time": 500
|
||||
room: {
|
||||
time: 500
|
||||
},
|
||||
"cursor": {
|
||||
"time": 16
|
||||
cursor: {
|
||||
time: 16
|
||||
},
|
||||
"kickban": {
|
||||
"amount": 2,
|
||||
"time": 1000
|
||||
kickban: {
|
||||
amount: 2,
|
||||
time: 1000
|
||||
}
|
||||
})
|
|
@ -1,3 +1,3 @@
|
|||
[
|
||||
"1.2.3.4"
|
||||
|
||||
]
|
16
config.js
16
config.js
|
@ -1,10 +1,10 @@
|
|||
module.exports = Object.seal({
|
||||
"port": "8080",
|
||||
"motd": "You agree to read this message.",
|
||||
"_id_PrivateKey": "boppity",
|
||||
"defaultUsername": "Anonymous",
|
||||
"defaultRoomColor": "#3b5054",
|
||||
"defaultLobbyColor": "#19b4b9",
|
||||
"defaultLobbyColor2": "#801014",
|
||||
"adminpass": "adminpass"
|
||||
port: "8080",
|
||||
motd: "You agree to read this message.",
|
||||
_id_PrivateKey: "boppity",
|
||||
defaultUsername: "Anonymous",
|
||||
defaultRoomColor: "#3b5054",
|
||||
defaultLobbyColor: "#19b4b9",
|
||||
defaultLobbyColor2: "#801014",
|
||||
adminpass: "adminpass"
|
||||
})
|
||||
|
|
|
@ -157,7 +157,7 @@ module.exports = (cl) => {
|
|||
cl.on("bye", msg => {
|
||||
cl.destroy();
|
||||
})
|
||||
cl.on("admin message", msg => {
|
||||
cl.on("admin message" || "adminmsg" || "admin msg", msg => {
|
||||
if (!(cl.channel && cl.participantId)) return;
|
||||
if (!msg.hasOwnProperty('password') || !msg.hasOwnProperty('msg')) return;
|
||||
if (typeof msg.msg != 'object') return;
|
||||
|
@ -189,7 +189,7 @@ module.exports = (cl) => {
|
|||
if (!dbentry) return;
|
||||
dbentry.color = msg.color;
|
||||
dbentry.noteColor = msg.color;
|
||||
//user.updatedb();
|
||||
user.updatedb();
|
||||
cl.server.rooms.forEach((room) => {
|
||||
room.updateParticipant(usr.participantId, {
|
||||
color: msg.color,
|
||||
|
|
|
@ -9,7 +9,6 @@ class Server extends EventEmitter {
|
|||
port: config.port,
|
||||
backlog: 100,
|
||||
verifyClient: (info) => {
|
||||
//if (banned.includes(info.req.headers['x-forwarded-for'].split(",")[0].replace('::ffff:', ''))) return false;
|
||||
if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -21,7 +20,30 @@ class Server extends EventEmitter {
|
|||
this.wss.on('connection', (ws, req) => {
|
||||
this.connections.set(++this.connectionid, new Client(ws, req, this));
|
||||
});
|
||||
this.legit_m = ["a", "bye", "hi", "ch", "+ls", "-ls", "m", "n", "devices", "t", "chset", "userset", "chown", "kickban", "admin message", "color"]
|
||||
this.legit_m = [
|
||||
"a",
|
||||
"bye",
|
||||
"hi",
|
||||
"ch",
|
||||
"+ls",
|
||||
"-ls",
|
||||
"m",
|
||||
"n",
|
||||
"devices",
|
||||
"t",
|
||||
"chset",
|
||||
"userset",
|
||||
"chown",
|
||||
"kickban",
|
||||
|
||||
"admin message",
|
||||
"admin_color",
|
||||
"admin_noteColor",
|
||||
"admin_chset",
|
||||
"admin_chown",
|
||||
"admin_kickban",
|
||||
"admin_notification"
|
||||
];
|
||||
this.welcome_motd = config.motd || "You agree to read this message.";
|
||||
this._id_Private_Key = config._id_PrivateKey || "boppity";
|
||||
this.defaultUsername = config.defaultUsername || "Anonymous";
|
||||
|
|
|
@ -1 +1,37 @@
|
|||
{}
|
||||
{
|
||||
"999d1d8bbe8cf06eb15e5d56": {
|
||||
"color": "#7fd09e",
|
||||
"noteColor": "#7fd09e",
|
||||
"name": "Anonymous",
|
||||
"_id": "999d1d8bbe8cf06eb15e5d56",
|
||||
"ip": "108.169.248.183"
|
||||
},
|
||||
"a6a35eb1546b541be5f11cc8": {
|
||||
"color": "#d3de03",
|
||||
"noteColor": "#d3de03",
|
||||
"name": "Anonymous",
|
||||
"_id": "a6a35eb1546b541be5f11cc8",
|
||||
"ip": "177.18.157.8"
|
||||
},
|
||||
"c6d435dd7fa48be7cea001ba": {
|
||||
"color": "#FF00FF",
|
||||
"noteColor": "#FF00FF",
|
||||
"name": "Wolfy",
|
||||
"_id": "c6d435dd7fa48be7cea001ba",
|
||||
"ip": "75.91.45.152"
|
||||
},
|
||||
"931fb786761b12807265771b": {
|
||||
"color": "#612196",
|
||||
"noteColor": "#612196",
|
||||
"name": "Anonymous",
|
||||
"_id": "931fb786761b12807265771b",
|
||||
"ip": "185.180.198.66"
|
||||
},
|
||||
"63c4f4f0b079c466e5dd6df6": {
|
||||
"color": "#b2b055",
|
||||
"noteColor": "#b2b055",
|
||||
"name": "Anonymous",
|
||||
"_id": "63c4f4f0b079c466e5dd6df6",
|
||||
"ip": "95.110.114.123"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue