Nikatlas 6 years ago
parent
commit
ee1e248e35
2 changed files with 3 additions and 2 deletions
  1. 1 0
      routes/matchmaking/randomFree.js
  2. 2 2
      services/matchmaking/randomFree.js

+ 1 - 0
routes/matchmaking/randomFree.js

@@ -6,6 +6,7 @@ const JSONError = require('../../helpers/index').JSONError;
 
 
 /* GET users listing. */
 /* GET users listing. */
 router.get('/join', function(req, res, next) {
 router.get('/join', function(req, res, next) {
+	console.log("HERE!");
     randomFreeService.join(req.user).
     randomFreeService.join(req.user).
     then((data) => {
     then((data) => {
         console.log(data);
         console.log(data);

+ 2 - 2
services/matchmaking/randomFree.js

@@ -89,14 +89,14 @@ class randomFree {
 		let saltArray = [];
 		let saltArray = [];
 		let hashedCardsArray= [];
 		let hashedCardsArray= [];
 		for (let i =0; i<5; i++){
 		for (let i =0; i<5; i++){
-		    let playerCard = Math.floor((Math.random()*100 )% 100 );
+		    let playerCard = Math.floor((Math.random()*100 ) % 100 );
 			let salt = crypto.lib.WordArray.random(128 / 8).toString();
 			let salt = crypto.lib.WordArray.random(128 / 8).toString();
             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};
     }
     }
 
 
 }
 }