Commit b610e1ab by Alexander Bazo

Add optional debug mode for server

parent e95888cb
......@@ -12,6 +12,10 @@ const http = require("http"),
Logger.disable();
if(process.argv[2] === "debug") {
Logger.enable();
}
var app = express(),
server = http.createServer(app),
imageServer;
......
......@@ -50,6 +50,7 @@ class ImageViewerRoom extends colyseus.Room {
if (message.type === "gaze") {
if (client.color === undefined) {
client.color = Colors.createRandomColor();
Logger.log(`Assign clien color: ${clien.color}`, "ImageViewer Room");
}
message.data.color = client.color;
let point = GazePoint.fromClientData(message.data);
......
......@@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"start": "node index.js",
"debug": "node index.js debug",
"loadtest": "colyseus-loadtest loadtest/example.js --room my_room --numClients 2",
"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