铁笼死斗,相同积分用战力排名
This commit is contained in:
parent
d4634f729e
commit
beae71eb7f
@ -1,39 +1,32 @@
|
||||
import { ApiCall } from "tsrpc";
|
||||
import { ReqRank, ResRank } from "../../cross/protocols/wzry/PtlRank";
|
||||
import { ChatFun } from "../../public/chat";
|
||||
import { EmailFun } from "../../public/email";
|
||||
import { FightFun } from "../../public/fight";
|
||||
import { Rank } from '../../public/rank/rank';
|
||||
import { SchedulerWzryDlDstart, wzrygroup } from "../../public/scheduler/scheduler_wzry";
|
||||
import { WangZheRongYaofun } from "../../public/wzry";
|
||||
import { PublicShared } from "../../shared/public/public";
|
||||
import { player } from "../../shared/protocols/user/type";
|
||||
import { rankInfo } from "../../shared/protocols/type";
|
||||
import { FindOptions } from "mongodb";
|
||||
import {ApiCall} from "tsrpc";
|
||||
import {ReqRank, ResRank} from "../../cross/protocols/wzry/PtlRank";
|
||||
import {player} from "../../shared/protocols/user/type";
|
||||
import {FindOptions} from "mongodb";
|
||||
|
||||
export async function getRankList(limit?: number, projection?:any){
|
||||
let option : FindOptions = {
|
||||
sort : {
|
||||
'data.valArr': -1
|
||||
export async function getRankList(limit?: number, projection?: any) {
|
||||
let option: FindOptions = {
|
||||
sort: {
|
||||
'data.valArr': -1,
|
||||
'data.player.power': -1
|
||||
}
|
||||
}
|
||||
if(limit!=null){
|
||||
if (limit != null) {
|
||||
option.limit = limit;
|
||||
}
|
||||
if(projection!=null){
|
||||
if (projection != null) {
|
||||
option.projection = projection;
|
||||
}
|
||||
|
||||
let listArr = await G.mongodb.collection('rankList').find({ type: 'wzryCross' },option).toArray();
|
||||
let listArr = await G.mongodb.collection('rankList').find({type: 'wzryCross'}, option).toArray();
|
||||
let list = listArr.map(l => l.data);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
export async function getPlayerRank(uid: string) {
|
||||
let _r = await getRankList(50,{
|
||||
"data.player.uid":1,
|
||||
"data.valArr":1,
|
||||
let _r = await getRankList(50, {
|
||||
"data.player.uid": 1,
|
||||
"data.valArr": 1,
|
||||
});
|
||||
if (!Object.keys(_r).length) {
|
||||
return -1
|
||||
@ -42,14 +35,14 @@ export async function getPlayerRank(uid: string) {
|
||||
return myrank;
|
||||
}
|
||||
|
||||
export async function getWzryRankList(uid: string, gud: player){
|
||||
export async function getWzryRankList(uid: string, gud: player) {
|
||||
let list = await getRankList(50);
|
||||
return {
|
||||
rankList: list,
|
||||
myRank: {
|
||||
rank: list.findIndex(li => li.player.uid == uid) + 1 || -1,
|
||||
player: gud,
|
||||
valArr: [(await G.mongodb.collection('wzry_fight').findOne({ uid: uid }))?.jifen || 0]
|
||||
valArr: [(await G.mongodb.collection('wzry_fight').findOne({uid: uid}))?.jifen || 0]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user