Compare commits
No commits in common. "b84fd92528bc64f471bee4787f68c7fce6abb129" and "eb1e34698850605a1aa6f3ec6b4a82e402992dc4" have entirely different histories.
b84fd92528
...
eb1e346988
@ -1,13 +1,20 @@
|
|||||||
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 { 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 { player } from "../../shared/protocols/user/type";
|
||||||
|
import { rankInfo } from "../../shared/protocols/type";
|
||||||
import { FindOptions } from "mongodb";
|
import { FindOptions } from "mongodb";
|
||||||
|
|
||||||
export async function getRankList(limit?: number, projection?:any){
|
export async function getRankList(limit?: number, projection?:any){
|
||||||
let option : FindOptions = {
|
let option : FindOptions = {
|
||||||
sort : {
|
sort : {
|
||||||
'data.valArr': -1,
|
'data.valArr': -1
|
||||||
'data.player.power': -1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(limit!=null){
|
if(limit!=null){
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
import { ApiCall } from "tsrpc";
|
import { ApiCall } from "tsrpc";
|
||||||
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/shouchong/PtlOpen";
|
import { ReqOpen, ResOpen } from "../../../shared/protocols/event/shouchong/PtlOpen";
|
||||||
import {PayFun} from "../../../public/pay";
|
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||||
let data = await G.mongodb.cEvent('shouchongzhigou').findOne({uid: call.uid, type: 'shouchongzhigou'})
|
let data = await G.mongodb.cEvent('shouchong').findOne({ uid: call.uid, type: 'shouchong' });
|
||||||
|
|
||||||
let payIds = R.compose(R.map(i=>i.payid),R.values())(G.gc.shouchong)
|
|
||||||
|
|
||||||
call.succ({
|
call.succ({
|
||||||
receive: data?.receive || {},
|
payNum: call.conn.gud.payExp / 10,
|
||||||
buyLog: await PayFun.getPayLogs(call.uid, payIds)
|
receive: Object.fromEntries(Object.keys(G.gc.shouchong).map(k => [k, data?.receive?.[k] || []]))
|
||||||
})
|
});
|
||||||
}
|
}
|
@ -3,29 +3,26 @@ import {PlayerFun} from '../../../public/player';
|
|||||||
import { ReqReceive, ResReceive } from "../../../shared/protocols/event/shouchong/PtlReceive";
|
import { ReqReceive, ResReceive } from "../../../shared/protocols/event/shouchong/PtlReceive";
|
||||||
import { PublicShared } from '../../../shared/public/public';
|
import { PublicShared } from '../../../shared/public/public';
|
||||||
import { HongDianChange } from "../../hongdian/fun";
|
import { HongDianChange } from "../../hongdian/fun";
|
||||||
import {PayFun} from "../../../public/pay";
|
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
||||||
|
|
||||||
let conf = G.gc.shouchong[call.req.k];
|
let conf = G.gc.shouchong[call.req.k];
|
||||||
|
|
||||||
if (!conf) return call.error(globalThis.lng.pata_getprize_1);
|
if (!conf) return call.error(globalThis.lng.pata_getprize_1);
|
||||||
|
|
||||||
let payLog = await PayFun.getPayLog(call.uid, conf.payid)
|
let data = await G.mongodb.cEvent('shouchong').findOne({ uid: call.uid, type: 'shouchong' });
|
||||||
if (!payLog) return call.errorCode(-1)
|
|
||||||
|
|
||||||
let data = await G.mongodb.cEvent('shouchongzhigou').findOne({ uid: call.uid, type: 'shouchongzhigou' });
|
|
||||||
|
|
||||||
let recArr = data?.receive?.[call.req.k] || [];
|
let recArr = data?.receive?.[call.req.k] || [];
|
||||||
|
|
||||||
// if (call.conn.gud.payExp < conf.paynum) return call.error(globalThis.lng.event_kfkh_9);
|
if (call.conn.gud.payExp < conf.paynum) return call.error(globalThis.lng.event_kfkh_9);
|
||||||
|
|
||||||
if (recArr.length >= conf.prize.length) return call.error(globalThis.lng.event_kfkh_3);
|
if (recArr.length >= conf.prize.length) return call.error(globalThis.lng.event_kfkh_3);
|
||||||
|
|
||||||
if (recArr.slice(-1)[0] && PublicShared.getToDayZeroTime() < recArr.slice(-1)[0]) return call.error(globalThis.lng.event_kfkh_10);
|
if (recArr.slice(-1)[0] && PublicShared.getToDayZeroTime() < recArr.slice(-1)[0]) return call.error(globalThis.lng.event_kfkh_10);
|
||||||
|
|
||||||
await PlayerFun.sendPrize(call, conf.prize[recArr.length]);
|
await PlayerFun.sendPrize(call, conf.prize[recArr.length]);
|
||||||
await G.mongodb.cEvent('shouchongzhigou').updateOne(
|
await G.mongodb.cEvent('shouchong').updateOne(
|
||||||
{ uid: call.uid, type: 'shouchongzhigou' },
|
{ uid: call.uid, type: 'shouchong' },
|
||||||
{ $push: G.mongodb.createTreeObj({ key: 'receive', k: call.req.k, val: G.time }) },
|
{ $push: G.mongodb.createTreeObj({ key: 'receive', k: call.req.k, val: G.time }) },
|
||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
);
|
);
|
||||||
@ -43,16 +40,17 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getShouChongRedPoint(call: ApiCall) {
|
export async function getShouChongRedPoint(call: ApiCall) {
|
||||||
// let data = await G.mongodb.cEvent('shouchong').findOne({ uid: call.uid, type: 'shouchong' });
|
let res = { show: false };
|
||||||
//
|
let data = await G.mongodb.cEvent('shouchong').findOne({ uid: call.uid, type: 'shouchong' });
|
||||||
// for (let [id, conf] of Object.entries(G.gc.shouchong)) {
|
|
||||||
// let rec = data?.receive?.[id] || [];
|
|
||||||
// if (call.conn.gud.payExp / 10 < conf.paynum || rec.length >= conf.prize.length) continue;
|
|
||||||
// if (rec.length == 0 || rec.slice(-1)[0] < PublicShared.getToDayZeroTime(G.time)) {
|
|
||||||
// res = { show: true };
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return {show: false};
|
for (let [id, conf] of Object.entries(G.gc.shouchong)) {
|
||||||
|
let rec = data?.receive?.[id] || [];
|
||||||
|
if (call.conn.gud.payExp / 10 < conf.paynum || rec.length >= conf.prize.length) continue;
|
||||||
|
if (rec.length == 0 || rec.slice(-1)[0] < PublicShared.getToDayZeroTime(G.time)) {
|
||||||
|
res = { show: true };
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
@ -26,9 +26,6 @@ export type eventType = {
|
|||||||
shouchong: {
|
shouchong: {
|
||||||
receive: k_v<number[]>;
|
receive: k_v<number[]>;
|
||||||
};
|
};
|
||||||
shouchongzhigou: {
|
|
||||||
receive: k_v<number[]>;
|
|
||||||
};
|
|
||||||
kaifukuanghuan: Omit<ResOpen, 'day' | 'taskFinished'>;
|
kaifukuanghuan: Omit<ResOpen, 'day' | 'taskFinished'>;
|
||||||
dayjijin: Omit<ResOpenJiJin, 'isPay' | 'finished'>;
|
dayjijin: Omit<ResOpenJiJin, 'isPay' | 'finished'>;
|
||||||
dengjijijin: Omit<ResOpenJiJin, 'isPay' | 'finished'>;
|
dengjijijin: Omit<ResOpenJiJin, 'isPay' | 'finished'>;
|
||||||
|
@ -640,25 +640,25 @@ export class _mongodb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// //@ts-ignore
|
//@ts-ignore
|
||||||
// FindCursor.prototype._toArray = FindCursor.prototype.toArray;
|
FindCursor.prototype._toArray = FindCursor.prototype.toArray;
|
||||||
// //@ts-ignore
|
//@ts-ignore
|
||||||
// FindCursor.prototype.toArray = async function(){
|
FindCursor.prototype.toArray = async function(){
|
||||||
// let rss = await this._toArray();
|
let rss = await this._toArray();
|
||||||
//
|
|
||||||
// //如果返回的数据超过50条
|
//如果返回的数据超过50条
|
||||||
// if(rss.length>50){
|
if(rss.length>50){
|
||||||
// addGameLog("system","findCount",null,{
|
addGameLog("system","findCount",null,{
|
||||||
// collection: this.namespace.collection,
|
collection: this.namespace.collection,
|
||||||
// db:this.namespace.db,
|
db:this.namespace.db,
|
||||||
// count:rss.length
|
count:rss.length
|
||||||
// })
|
})
|
||||||
// console.log("system,findCount",{
|
console.log("system,findCount",{
|
||||||
// collection: this.namespace.collection,
|
collection: this.namespace.collection,
|
||||||
// db:this.namespace.db,
|
db:this.namespace.db,
|
||||||
// count:rss.length
|
count:rss.length
|
||||||
// })
|
})
|
||||||
// console.trace();
|
console.trace();
|
||||||
// }
|
}
|
||||||
// return rss;
|
return rss;
|
||||||
// }
|
}
|
@ -8,10 +8,8 @@ export type ReqOpen = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ResOpen = {
|
export type ResOpen = {
|
||||||
|
payNum: number;
|
||||||
receive: {
|
receive: {
|
||||||
[k: string]: number[];
|
[k: string]: number[];
|
||||||
};
|
};
|
||||||
buyLog:{
|
|
||||||
[k: string]: any;
|
|
||||||
}
|
|
||||||
};
|
};
|
@ -10262,6 +10262,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
|
"name": "payNum",
|
||||||
|
"type": {
|
||||||
|
"type": "Number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
"name": "receive",
|
"name": "receive",
|
||||||
"type": {
|
"type": {
|
||||||
"type": "Interface",
|
"type": "Interface",
|
||||||
@ -10275,19 +10282,6 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "buyLog",
|
|
||||||
"type": {
|
|
||||||
"type": "Interface",
|
|
||||||
"indexSignature": {
|
|
||||||
"keyType": "String",
|
|
||||||
"type": {
|
|
||||||
"type": "Any"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user