Nikatlas 6 年之前
父节点
当前提交
ee1e248e35
共有 2 个文件被更改,包括 3 次插入2 次删除
  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. */
 router.get('/join', function(req, res, next) {
+	console.log("HERE!");
     randomFreeService.join(req.user).
     then((data) => {
         console.log(data);

+ 2 - 2
services/matchmaking/randomFree.js

@@ -89,14 +89,14 @@ class randomFree {
 		let saltArray = [];
 		let hashedCardsArray= [];
 		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 hashedCard = cryptoSHA256(playerCard.toString + salt);
 		    playerCardsArray.push(playerCard);
 			saltArray.push(salt);
 			hashedCardsArray.push(hashedCard.toString());
 		}
-    return {playerCardsArray, saltArray, hashedCardsArray};
+    	return {playerCardsArray, saltArray, hashedCardsArray};
     }
 
 }