Browse Source

Stack changes

Dim Dim 6 years ago
parent
commit
63f4b4feda
1 changed files with 4 additions and 4 deletions
  1. 4 4
      services/matchmaking/randomFree.js

+ 4 - 4
services/matchmaking/randomFree.js

@@ -63,11 +63,11 @@ class randomFree {
                     p1.on('broadcast', broadcast);
                     p1.on('broadcast', broadcast);
                     p2.on('broadcast', broadcast);
                     p2.on('broadcast', broadcast);
 
 
-                    const gameOver = (stack) => {
+                    const gameOver = (data) => {
                         // TODO this should be emitted ONLY if all 9 moves have been played
                         // TODO this should be emitted ONLY if all 9 moves have been played
                         //TODO verify move stack (compare with hashed cards)
                         //TODO verify move stack (compare with hashed cards)
-                        let gameMachine = new GameMachine(stack.setup);
-                        let winner = gameMachine.runMatch(stack.moves);
+                        let gameMachine = new GameMachine(data.setup);
+                        let winner = gameMachine.runMatch(data.stack.moves);
 
 
                         nsp.in(channel).emit('winner', winner);
                         nsp.in(channel).emit('winner', winner);
                     };
                     };
@@ -127,7 +127,7 @@ class randomFree {
             let hashedCard = cryptoSHA256(playerCard.toString() + salt);
             let hashedCard = cryptoSHA256(playerCard.toString() + salt);
 		    playerCardsArray.push(playerCard);
 		    playerCardsArray.push(playerCard);
 			saltArray.push(salt);
 			saltArray.push(salt);
-			hashedCardsArray.push(hashedCard.toString());
+            hashedCardsArray.push(hashedCard.toString());
 		}
 		}
     	return {playerCardsArray, saltArray, hashedCardsArray};
     	return {playerCardsArray, saltArray, hashedCardsArray};
     }
     }