diff --git a/lib/chat/message.js b/lib/chat/message.js index c4e725d..e246298 100644 --- a/lib/chat/message.js +++ b/lib/chat/message.js @@ -1,8 +1,10 @@ "use strict"; var Author = require("./author"); +var count = 0; function Message (o) { + this.id = count++; this.author = Author(o.author); this.content = o.content; this.createdAt = new Date(); @@ -10,6 +12,7 @@ function Message (o) { Message.prototype.toJson = function () { return { + id: this.id, author: this.author, content: this.content, createdAt: this.createdAt diff --git a/lib/gather/controller.js b/lib/gather/controller.js index 8fa498f..0bfe604 100644 --- a/lib/gather/controller.js +++ b/lib/gather/controller.js @@ -85,7 +85,7 @@ module.exports = function (namespace) { method.call(gather, selectedPlayer.user); if (gather.can("confirmSelection")) { - gather.confirmSelection(user); + gather.confirmSelection(socket._user); } refreshGather(); diff --git a/lib/react/gather.jsx b/lib/react/gather.jsx index a6346dc..9cb5d07 100644 --- a/lib/react/gather.jsx +++ b/lib/react/gather.jsx @@ -536,18 +536,7 @@ var Gatherers = React.createClass({ var CompletedGather = React.createClass({ votedMaps: function () { - var maps = this.props.maps; - var mapVotes = this.props.gather.gatherers.map(function (gatherer) { - return gatherer.mapVote; - }).filter(function (elem) { - return elem !== null; - }).map(function (mapId) { - var result; - maps.forEach(function (map) { - if (map.id === mapId) result = map; - }); - return result; - }); + }, votedServer: function () { @@ -560,14 +549,11 @@ var CompletedGather = React.createClass({
{this.votedMaps() - .map(function (map) {return map.name}) - .join(",")}
+Map Voted: To be completed
+Server Voted: To be completed