2015-07-22 16:28:15 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Gather Controller
|
|
|
|
*
|
|
|
|
* Server API
|
2015-07-22 23:30:14 +00:00
|
|
|
* gather:refresh - Refreshes active gather
|
|
|
|
*
|
2015-07-22 16:28:15 +00:00
|
|
|
* Client API
|
2015-07-22 23:30:14 +00:00
|
|
|
* gather:join - Assigns user to gather
|
|
|
|
* gather:vote - Assigns vote to map, captain or server
|
2015-07-22 16:28:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
var Gather = require("./gather");
|
2015-07-22 23:30:14 +00:00
|
|
|
var latestGather = new Gather();
|
2015-07-22 16:28:15 +00:00
|
|
|
|
|
|
|
module.exports = function (namespace) {
|
2015-07-22 23:30:14 +00:00
|
|
|
var refreshGather = function () {
|
|
|
|
namespace.emit("gather:refresh", {
|
|
|
|
gather: gather
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace.on("connection", function (socket) {
|
|
|
|
|
|
|
|
socket.on("gather:join", function (data) {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
socket.on("gather:vote", function (data) {
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2015-07-22 16:28:15 +00:00
|
|
|
};
|