소스 검색

Stack changes

Dim Dim 6 년 전
부모
커밋
63f4b4feda
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      services/matchmaking/randomFree.js

+ 4 - 4
services/matchmaking/randomFree.js

@@ -63,11 +63,11 @@ class randomFree {
                     p1.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 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);
                     };
@@ -127,7 +127,7 @@ class randomFree {
             let hashedCard = cryptoSHA256(playerCard.toString() + salt);
 		    playerCardsArray.push(playerCard);
 			saltArray.push(salt);
-			hashedCardsArray.push(hashedCard.toString());
+            hashedCardsArray.push(hashedCard.toString());
 		}
     	return {playerCardsArray, saltArray, hashedCardsArray};
     }