Commit b610e1ab by Alexander Bazo

Add optional debug mode for server

parent e95888cb
...@@ -12,6 +12,10 @@ const http = require("http"), ...@@ -12,6 +12,10 @@ const http = require("http"),
Logger.disable(); Logger.disable();
if(process.argv[2] === "debug") {
Logger.enable();
}
var app = express(), var app = express(),
server = http.createServer(app), server = http.createServer(app),
imageServer; imageServer;
......
...@@ -50,6 +50,7 @@ class ImageViewerRoom extends colyseus.Room { ...@@ -50,6 +50,7 @@ class ImageViewerRoom extends colyseus.Room {
if (message.type === "gaze") { if (message.type === "gaze") {
if (client.color === undefined) { if (client.color === undefined) {
client.color = Colors.createRandomColor(); client.color = Colors.createRandomColor();
Logger.log(`Assign clien color: ${clien.color}`, "ImageViewer Room");
} }
message.data.color = client.color; message.data.color = client.color;
let point = GazePoint.fromClientData(message.data); let point = GazePoint.fromClientData(message.data);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js",
"debug": "node index.js debug",
"loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2", "loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment