forked from Hri7566/mpp-server-dev2
This commit is contained in:
parent
427377dfcc
commit
07502f5e92
4
.env
4
.env
|
@ -1,2 +1,2 @@
|
|||
ADMINPASS=put_password_here
|
||||
SALT=seed_here
|
||||
ADMINPASS=amogus
|
||||
SALT=๖ۣۜH͜r̬i͡7566
|
||||
|
|
38
banned.json
38
banned.json
|
@ -1,3 +1,37 @@
|
|||
[
|
||||
|
||||
]
|
||||
"68.106.138.210",
|
||||
"154.28.188.216",
|
||||
"154.28.188.214",
|
||||
"154.28.188.217",
|
||||
"154.28.188.215",
|
||||
"154.28.188.213",
|
||||
"154.28.188.212",
|
||||
"154.28.188.220",
|
||||
"154.28.188.219",
|
||||
"154.28.188.218",
|
||||
"154.28.188.222",
|
||||
"154.28.188.223",
|
||||
"154.28.188.221",
|
||||
"154.28.188.224",
|
||||
"154.28.188.226",
|
||||
"154.28.188.225",
|
||||
"177.54.145.61",
|
||||
"213.6.141.146",
|
||||
"103.23.101.30",
|
||||
"210.245.51.15",
|
||||
"91.237.161.211",
|
||||
"213.136.89.190",
|
||||
"177.137.168.132",
|
||||
"92.86.33.126",
|
||||
"138.97.236.2",
|
||||
"119.243.95.62",
|
||||
"49.51.74.19",
|
||||
"31.128.248.1",
|
||||
"185.220.102.245",
|
||||
"61.41.9.213",
|
||||
"103.25.120.138",
|
||||
"46.8.247.3",
|
||||
"45.70.84.46",
|
||||
"46.0.205.175",
|
||||
"36.94.126.50"
|
||||
]
|
||||
|
|
|
@ -3,9 +3,11 @@ module.exports = Object.seal({
|
|||
motd: "big th0nk",
|
||||
_id_PrivateKey: process.env.SALT,
|
||||
defaultUsername: "Anonymous",
|
||||
defaultRoomColor: "#3b5054",
|
||||
//defaultRoomColor: "#3b5054",
|
||||
defaultRoomColor: "#9900ff",
|
||||
// defaultLobbyColor: "#19b4b9",
|
||||
defaultLobbyColor: "#5e32a8",
|
||||
defaultLobbyColor2: "#801014",
|
||||
defaultLobbyColor: "#9900ff",
|
||||
// defaultLobbyColor2: "#801014",
|
||||
defaultLobbyColor2: "#9900ff",
|
||||
adminpass: process.env.ADMINPASS
|
||||
});
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -108,6 +108,7 @@ class Client extends EventEmitter {
|
|||
if (typeof(evt) !== 'string') evt = evt.toJSON();
|
||||
let transmission = JSON.parse(evt);
|
||||
for (let msg of transmission) {
|
||||
if (typeof(msg) !== 'object' || msg == null || msg == NaN) return;
|
||||
if (!msg.hasOwnProperty("m")) return;
|
||||
if (!this.server.legit_m.includes(msg.m)) return;
|
||||
this.emit(msg.m, msg, !!admin);
|
||||
|
|
|
@ -215,11 +215,6 @@ module.exports = (cl) => {
|
|||
cl.on('notification', (msg, admin) => {
|
||||
if (!admin) return;
|
||||
if (!msg.hasOwnProperty("id") || (!msg.hasOwnProperty("targetChannel") && !msg.hasOwnProperty("targetUser")) || !msg.hasOwnProperty("target") || !msg.hasOwnProperty("duration") || !msg.hasOwnProperty("class") || !msg.hasOwnProperty("html")) return;
|
||||
if (msg.hasOwnProperty("targetChannel")) {
|
||||
cl.channel.emit("notification", msg);
|
||||
}
|
||||
if (msg.hasOwnProperty("targetUser")) {
|
||||
cl.ws.emit("message", JSON.stringify([msg.msg]), true);
|
||||
}
|
||||
cl.channel.Notification(msg.targetUser || msg.targetChannel, null, null, msg.html, msg.duration, msg.target, msg.class);
|
||||
});
|
||||
}
|
||||
|
|
21
src/Room.js
21
src/Room.js
|
@ -196,7 +196,6 @@ class Room extends EventEmitter {
|
|||
}
|
||||
isLobby(_id) {
|
||||
if (_id.startsWith("lobby")) {
|
||||
return true;
|
||||
let lobbynum = _id.split("lobby")[1];
|
||||
if (_id == "lobby") {
|
||||
return true;
|
||||
|
@ -278,6 +277,21 @@ class Room extends EventEmitter {
|
|||
let filter = ["AMIGHTYWIND"];
|
||||
let regexp = new RegExp("\\b(" + filter.join("|") + ")\\b", "i");
|
||||
if (regexp.test(msg.message)) return;
|
||||
if (p.participantId == 0) {
|
||||
let message = {};
|
||||
message.m = "a";
|
||||
message.a = msg.message;
|
||||
message.p = {
|
||||
color: "#ffffff",
|
||||
id: "0",
|
||||
name: "mpp",
|
||||
_id: "0"
|
||||
};
|
||||
message.t = Date.now();
|
||||
this.sendArray([message]);
|
||||
this.chatmsgs.push(message);
|
||||
return;
|
||||
}
|
||||
let prsn = this.ppl.get(p.participantId);
|
||||
if (prsn) {
|
||||
let message = {};
|
||||
|
@ -382,12 +396,13 @@ class Room extends EventEmitter {
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
Array.from(this.server.connections.values()).filter((usr) => usr.user._id == who).forEach((p) => {
|
||||
Array.from(this.server.connections.values()).filter((usr) => typeof(usr.user) !== 'undefined' ? usr.user._id == who : null).forEach((p) => {
|
||||
p.sendArray([obj]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bindEventListeners() {
|
||||
this.on("bye", participant => {
|
||||
this.remove(participant);
|
||||
|
@ -401,6 +416,7 @@ class Room extends EventEmitter {
|
|||
this.chat(participant, msg);
|
||||
})
|
||||
}
|
||||
|
||||
verifySet(_id,msg){
|
||||
if(!isObj(msg.set)) msg.set = {visible:true,color:this.server.defaultRoomColor,chat:true,crownsolo:false};
|
||||
if(isBool(msg.set.lobby)){
|
||||
|
@ -433,6 +449,5 @@ class Room extends EventEmitter {
|
|||
};
|
||||
return msg.set;
|
||||
}
|
||||
|
||||
}
|
||||
module.exports = Room;
|
||||
|
|
|
@ -50,7 +50,7 @@ class Server extends EventEmitter {
|
|||
}
|
||||
|
||||
ev(str) {
|
||||
let out;
|
||||
let out = "";
|
||||
try {
|
||||
out = eval(str);
|
||||
} catch(err) {
|
||||
|
|
1444
src/db/users.json
1444
src/db/users.json
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue