fix 黑帮争霸分组定时器

This commit is contained in:
dy 2023-12-23 12:30:11 +08:00
parent 077f7a488e
commit 14daa94dba

View File

@ -6,13 +6,16 @@
export async function zbsGroup() { export async function zbsGroup() {
let arr = await G.mongodb.collection("hbzb_user_cross").find( let arr = await G.mongodb.collection("hbzb_user_cross").find(
{"jifen": {$gt: -999999}} {"jifen": {$gt: -999999}}
).sort(
{ "data.player.cTime": -1 }
).project({ ).project({
uid: 1, uid: 1,
jifen:1 jifen: 1,
'data.player.cTime': 1
}).toArray(); }).toArray();
// 移除mongo查询里的排序↑会造成内存超出报错
// 在内存里按照玩家注册时间相近的排序分组
R.sort((a, b) => b.data.player.cTime - a.data.player.cTime)
//有积分的玩家总数 //有积分的玩家总数
let groups = []; let groups = [];
let currGroup = []; let currGroup = [];