This room is public. This room is private.
You are the owner of this room.
send |
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/server/index.js",
"cwd": "${workspaceRoot}/server/"
}
]
}
src/cca/platforms/android/**
src/node_modules/**
src/.sass-cache/**
src/cca/www/**
src/cca/config.xml
src/cordova/platforms/**
src/cordova/node_modules/**
src/cordova/plugins/**
src/cordova/www/**
src/cordova/config.xml
src/www/tmp/**
build/**
server/node_modules/**
server/settings.json
server/bans.json
server/logs/**
# IntelliJ IDEA files
*.iml
.idea
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
# Compiled source #
###################
*.com
@@ -21,7 +34,7 @@ server/logs/**
*.apk
*.ap_
*.es2015.js
*.es2015.js.map
*.map
# files for the dex VM
*.dex
exports.beat = function() {
io.on('connection', function(socket) {
// users.push(new User(socket));
new User(socket);
});
};
@@ -56,16 +55,24 @@ class Room {
}
leave(user) {
this.emit('leave', {
guid: user.guid
});
let userIndex = this.users.indexOf(user);
if (userIndex == -1) return;
this.users.splice(userIndex, 1);
checkRoomEmpty(this);
// HACK
try {
this.emit('leave', {
guid: user.guid
});
let userIndex = this.users.indexOf(user);
if (userIndex == -1) return;
this.users.splice(userIndex, 1);
checkRoomEmpty(this);
} catch(e) {
log.info.log('warn', 'roomLeave', {
e: e,
thisCtx: this
});
}
}
updateUser(user) {
@@ -138,7 +145,7 @@ let userCommands = {
"pawn": "passthrough",
"bees": "passthrough",
"color": function(color) {
if (typeof color == "undefined") {
if (typeof color != "undefined") {
if (settings.bonziColors.indexOf(color) == -1)
return;
@@ -162,6 +169,12 @@ let userCommands = {
target: sanitize(Utils.argsString(arguments))
});
},
"owo": function() {
this.room.emit("owo", {
guid: this.guid,
target: sanitize(Utils.argsString(arguments))
});
},
"triggered": "passthrough",
"vaporwave": function() {
this.socket.emit("vaporwave");
@@ -254,6 +267,8 @@ class User {
}
login(data) {
if (this.private.login) return;
log.info.log('info', 'login', {
guid: this.guid,
});
@@ -339,6 +354,7 @@ class User {
this.room.join(this);
this.private.login = true;
this.socket.removeAllListeners("login");
// Send all user info
this.socket.emit('updateAll', {
@@ -412,7 +428,6 @@ class User {
}
disconnect() {
let ip = "N/A";
let port = "N/A";
@@ -456,7 +471,11 @@ class User {
roomsPublic.splice(publicIndex, 1);
}
}
}
this.socket.removeAllListeners('talk');
this.socket.removeAllListeners('command');
this.socket.removeAllListeners('disconnect');
} catch(e) {
log.info.log('warn', "exception", {
guid: this.guid,
2 server/package.json
@@ -1,6 +1,6 @@
{
"name": "bonziworld_server",
"version": "2.0",
"version": "2.0.1",
"description": "Server for the BonziWORLD chat client.",
"main": "index.js",
"author": "Joseph Judge",
133 server/rooms.js.old
This file was deleted.
9 server/settings.example.json
@@ -7,7 +7,6 @@
"runlevel": {
"godmode": 0,
"youtube": 0,
"sanitize": 3,
"joke": 0,
"fact": 0,
"backflip": 0,
@@ -22,6 +21,8 @@
"vaporwave": 0,
"unvaporwave": 0,
"name": 0,
"owo": 0,
"sanitize": 3,
"pope": 3
},
"room_max": 8,
@@ -45,7 +46,6 @@
"runlevel": {
"godmode": 0,
"youtube": 0,
"sanitize": 3,
"joke": 0,
"fact": 0,
"backflip": 0,
@@ -60,6 +60,8 @@
"vaporwave": 0,
"unvaporwave": 0,
"name": 0,
"owo": 0,
"sanitize": 3,
"pope": 3
},
"room_max": 30,
@@ -102,7 +104,8 @@
"green",
"red",
"black",
"brown"
"brown",
"pink"
],
"banLength": 1440,
"port": 3000,
send |