Merge branch 'bugfix' into dev

This commit is contained in:
dy 2023-12-20 15:41:53 +08:00
commit d0a80a4c73
4 changed files with 1769 additions and 49 deletions

1792
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"mathjs": "^11.4.0", "mathjs": "^11.4.0",
"mongodb": "^4.17.1", "mongodb": "^4.17.1",
"node-gyp": "^10.0.1",
"ramda": "^0.29.1", "ramda": "^0.29.1",
"redis": "^4.3.1", "redis": "^4.3.1",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",

View File

@ -1,23 +1,29 @@
import {ApiCall} from "tsrpc"; import {ApiCall} from "tsrpc";
import {ReqRank, ResRank} from "../../cross/protocols/wzry/PtlRank"; import {ReqRank, ResRank} from "../../cross/protocols/wzry/PtlRank";
import {player} from "../../shared/protocols/user/type"; import {player} from "../../shared/protocols/user/type";
import {FindOptions} from "mongodb"; import {Filter, FindOptions, OptionalId} from "mongodb";
import { CollectionRankList } from "../../module/collection_rank";
export async function getRankList(limit?: number, projection?: any) { export async function getRankList(limit?: number, projection?: any, _where?:any) {
let option: FindOptions = { let option: FindOptions = {
sort: { sort: {
'data.valArr': -1, 'data.valArr': -1,
'data.player.power': -1 'data.player.power': -1
} }
} }
let filter:Filter<OptionalId<CollectionRankList>> = {type: 'wzryCross'};
if (limit != null) { if (limit != null) {
option.limit = limit; option.limit = limit;
} }
if (projection != null) { if (projection != null) {
option.projection = projection; option.projection = projection;
} }
if (_where != null) {
Object.assign(filter, _where);
}
let listArr = await G.mongodb.collection('rankList').find({type: 'wzryCross'}, option).toArray(); let listArr = await G.mongodb.collection('rankList').find(filter, option).toArray();
let list = listArr.map(l => l.data); let list = listArr.map(l => l.data);
return list; return list;

View File

@ -102,9 +102,10 @@ export class SchedulerWzryDlDjinji extends SchedulerWzryAutoBaoMing {
return return
} }
let _zuanshiUser = await getRankList(null,{ let _zuanshiUser = await getRankList(256,{
'data.player.uid':1 'data.player.uid':1
}); //Rank.list.wzryCross.getRankListAll() },{'data.player.isNpc':{$exists:false}});
if (_zuanshiUser.length < 256) { if (_zuanshiUser.length < 256) {
console.log("本期无玩家,此次不执行") console.log("本期无玩家,此次不执行")
await this.record() await this.record()
@ -117,10 +118,10 @@ export class SchedulerWzryDlDjinji extends SchedulerWzryAutoBaoMing {
for (let index = 0; index < _zuanshiUser.length; index++) { for (let index = 0; index < _zuanshiUser.length; index++) {
const element = _zuanshiUser[index]; const element = _zuanshiUser[index];
_userList.push(element.player.uid) _userList.push(element.player.uid)
if (element.player.uid.indexOf('npc_') != -1) { // if (element.player.uid.indexOf('npc_') != -1) {
if (_userList.length >= 256) break // if (_userList.length >= 256) break
continue // continue
} // }
// 发送晋级钻石赛奖励 // 发送晋级钻石赛奖励
prize.length > 0 && EmailFun.addEmail({ prize.length > 0 && EmailFun.addEmail({
uid: element.player.uid, uid: element.player.uid,