mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 07:11:53 +00:00
Added gather logging
This commit is contained in:
parent
0d592c85b5
commit
7005c58082
1 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,7 @@ var Map = require("./map");
|
|||
var Server = require("./server");
|
||||
var Gather = require("./gather_singleton");
|
||||
var _ = require("lodash");
|
||||
var winston = require("winston");
|
||||
|
||||
module.exports = function (namespace) {
|
||||
var refreshGather = _.debounce(function () {
|
||||
|
@ -54,6 +55,7 @@ module.exports = function (namespace) {
|
|||
socket.on("gather:join", function (data) {
|
||||
let gather = Gather.current;
|
||||
if (gather.can("addGatherer")) gather.addGatherer(socket._user);
|
||||
winston.info("Gather Joiner", JSON.stringify(socket._user));
|
||||
refreshGather();
|
||||
});
|
||||
|
||||
|
@ -67,6 +69,7 @@ module.exports = function (namespace) {
|
|||
socket.on("gather:leave", function (data) {
|
||||
let gather = Gather.current;
|
||||
if (gather.can("removeGatherer")) gather.removeGatherer(socket._user);
|
||||
winston.info("Gather Leaver", JSON.stringify(socket._user));
|
||||
refreshGather();
|
||||
});
|
||||
|
||||
|
@ -97,6 +100,10 @@ module.exports = function (namespace) {
|
|||
gather.confirmSelection(socket._user);
|
||||
}
|
||||
|
||||
winston.info("Selection Data",
|
||||
JSON.stringify(socket._user),
|
||||
JSON.stringify(data));
|
||||
|
||||
refreshGather();
|
||||
});
|
||||
|
||||
|
@ -118,6 +125,10 @@ module.exports = function (namespace) {
|
|||
gather.voteForServer(socket._user, data.server.id);
|
||||
}
|
||||
|
||||
winston.info("Vote Data",
|
||||
JSON.stringify(socket._user),
|
||||
JSON.stringify(data));
|
||||
|
||||
refreshGather();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue