Skip to content

Commit

Permalink
fix bug with app
Browse files Browse the repository at this point in the history
  • Loading branch information
Efosaok committed Apr 19, 2018
1 parent ec71a54 commit 2067217
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ GOOGLE_CALLBACK_URL=<GOOGLE_CALLBACK_URL>
GITHUB_CLIENT_ID=<GITHUB_CLIENT_ID>
GITHUB_CLIENT_SECRET=<GITHUB_CLIENT_SECRET>
GITHUB_CALLBACK_URL=<GITHUB_CALLBACK_URL

EMAIL=<GMAIL_ADDRESS>
EMAIL_PASSWORD=<GMAIL_PASSWORD>
6 changes: 3 additions & 3 deletions config/socket/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Game.prototype.prepareGame = function() {
}
self.questions = results[0];
self.answers = results[1];

self.startGame();
});
};
Expand Down Expand Up @@ -259,9 +260,8 @@ Game.prototype.shuffleCards = function(cards) {
};

Game.prototype.dealAnswers = function(maxAnswers) {
console.log(this);
maxAnswers = maxAnswers || 10;
var storeAnswers = function(err, data) {
var storeAnswers = (err, data) => {
this.answers = data;
};
for (var i = 0; i < this.players.length; i++) {
Expand Down Expand Up @@ -424,4 +424,4 @@ Game.prototype.killGame = function() {
clearTimeout(this.judgingTimeout);
};

module.exports = Game;
module.exports = Game;
5 changes: 1 addition & 4 deletions config/socket/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ module.exports = function(io) {
// no one is in this custom room.
if (game.state === 'awaiting players' && (!game.players.length ||
game.players[0].socket.id !== socket.id) && game.players.length < game.playerMaxLimit) {
console.log("maxxxxx", game.playerMaxLimit)
console.log("mixxxxx", game.players.length)

// Put player into the requested game
console.log('Allowing player to join',requestedGameId);
allPlayers[socket.id] = true;
Expand All @@ -136,7 +133,7 @@ module.exports = function(io) {
game.sendNotification(player.username+' has joined the game!');
if (game.players.length === game.playerMaxLimit) {
gamesNeedingPlayers.shift();
socket.emit('startGame');
game.prepareGame();
}
} else {
socket.emit('maxPlayersReached');
Expand Down

0 comments on commit 2067217

Please sign in to comment.