From be3eb07795454035e63725697dd334db0c7b99de Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Wed, 29 Jul 2015 15:54:45 +0100 Subject: [PATCH] Stuff --- lib/chat/message.js | 3 +++ lib/gather/controller.js | 2 +- lib/react/gather.jsx | 20 +++----------------- public/js/app.js | 20 +++----------------- 4 files changed, 10 insertions(+), 35 deletions(-) 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({

Join Up:

-

{this.votedMaps() - .map(function (map) {return map.name}) - .join(",")}

+

Map Voted: To be completed

+

Server Voted: To be completed

); } }); - - diff --git a/public/js/app.js b/public/js/app.js index 17331dc..e40436a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -536,18 +536,7 @@ var Gatherers = React.createClass({displayName: "Gatherers", var CompletedGather = React.createClass({displayName: "CompletedGather", 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,9 +549,8 @@ var CompletedGather = React.createClass({displayName: "CompletedGather", ), React.createElement("div", {className: "panel-body"}, React.createElement("h3", null, "Join Up:"), - React.createElement("p", null, this.votedMaps() - .map(function (map) {return map.name}) - .join(",")) + React.createElement("p", null, "Map Voted: To be completed"), + React.createElement("p", null, "Server Voted: To be completed") ), React.createElement(GatherTeams, {gather: this.props.gather}) ) @@ -570,8 +558,6 @@ var CompletedGather = React.createClass({displayName: "CompletedGather", } }); - - "use strict"; var socket;