Commit 560db373 authored by IamI's avatar IamI

Fix

parent b51563d4
...@@ -15,7 +15,7 @@ let entertainRequestCountInTime = 0, athleticRequestCountInTime = 0; ...@@ -15,7 +15,7 @@ let entertainRequestCountInTime = 0, athleticRequestCountInTime = 0;
let localLog = function (content) { let localLog = function (content) {
console.log("[" + new Date().toLocaleString() + "] " + content) console.log("[" + new Date().toLocaleString() + "] " + content)
} };
let getUserConfig = function (user, callback) { let getUserConfig = function (user, callback) {
// HTTP GET 抓取数据。 // HTTP GET 抓取数据。
...@@ -114,7 +114,7 @@ let updateAthleticMatch = function () { ...@@ -114,7 +114,7 @@ let updateAthleticMatch = function () {
updateAthleticMatch = function () { updateAthleticMatch = function () {
let length = athleticUserPool.length; let length = athleticUserPool.length;
if (length < 2) return; if (length < 2) return;
athleticUserPool.sort((a, b) => b.pt - a.pt); athleticUserPool.sort((a, b) => b.data.pt - a.data.pt);
let newPool = []; let newPool = [];
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
let userA = athleticUserPool[i]; let userA = athleticUserPool[i];
...@@ -126,7 +126,7 @@ updateAthleticMatch = function () { ...@@ -126,7 +126,7 @@ updateAthleticMatch = function () {
newPool.push(userA); newPool.push(userA);
break; break;
} }
// 若 exp 之差小于门限,则匹配房间 // 若 pt 之差小于门限,则匹配房间
if (userA.data.pt - userB.data.pt < config.match.atheleticPtGate) { if (userA.data.pt - userB.data.pt < config.match.atheleticPtGate) {
pair(userA.client, userB.client, 'athletic'); pair(userA.client, userB.client, 'athletic');
i += 1; i += 1;
...@@ -136,7 +136,7 @@ updateAthleticMatch = function () { ...@@ -136,7 +136,7 @@ updateAthleticMatch = function () {
newPool.push(userA); newPool.push(userA);
} }
athleticUserPool = newPool; athleticUserPool = newPool;
} };
// 刷新娱乐玩家池 // 刷新娱乐玩家池
let updateEntertainMatch = function () { let updateEntertainMatch = function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment