Merge branch 'bugfix' into dev

This commit is contained in:
dy 2024-01-04 11:36:52 +08:00
commit 4c0a37cd78
9 changed files with 71 additions and 62 deletions

View File

@ -91,13 +91,13 @@ export default async function (call: ApiCall<ReqPkBoss, ResPkBoss>) {
}
_mySetDat = {
maxdps: _myData.maxdps,
time: _myData.time,
}
_bossData.delhp += result.totalDamage[0]
}
// 无论挑战成功失败都扣除战斗次数
_mySetDat["num"] = _myData.num + 1;
_mySetDat["time"] = G.time;
// 设置boss数据
await LingZhuLaiXifun.setBossData(_bossData.bid, _setData)

View File

@ -86,7 +86,7 @@ export default async function (call: ApiCall<ReqSaoDang, ResSaoDang>) {
// 设置boss数据
await LingZhuLaiXifun.setBossData(_bossData.bid, _setData)
await LingZhuLaiXifun.setMyData(call, { $inc: { num: _num } })
await LingZhuLaiXifun.setMyData(call, {$inc: {num: _num}, $set: {time: G.time}})
// 发奖
prize = PublicShared.mergePrize(prize)

View File

@ -25,11 +25,11 @@ export default async function (call: ApiCall<ReqSaoDang, ResSaoDang>) {
changeInfo.saodangNum = call.req.num + (changeInfo?.saodangNum || 0);
// 改变的数据
let setData = {
saodangNum: changeInfo.saodangNum
};
// let setData = {
// saodangNum: changeInfo.saodangNum
// };
// 设置数据
await PataFun.changeInfo(call.uid, changeInfo.sid, { $set: setData });
await PataFun.changeInfo(call.uid, changeInfo.sid, {"$inc": {saodangNum: call.req.num}});
_prize = await PlayerFun.sendPrize(call, _prize);
let data = {

View File

@ -1,4 +1,5 @@
import {ApiCall} from "tsrpc";
import { addGameLog } from "../../gameLog";
import {HeroFun} from '../../public/hero';
import {XstaskFun} from '../../public/xstask';
import {ReqOnekeyReceive, ResOnekeyReceive} from "../../shared/protocols/xstask/PtlOnekeyReceive";
@ -33,7 +34,9 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
if (heroList.length != heroIds.length) return call.error(globalThis.lng.xstask_6);
let change: ResOnekeyReceive = {};
let lockNum = event?.receiveNum || 0
for (let receive of args) {
if (lockNum >= 8) continue
let task = taskList.find(task => task._id == receive._id);
let taskConf = G.gc.xstask[task.taskId];
@ -45,6 +48,7 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
change[receive._id] = {time: G.time, heros: receive.heroIds};
XstaskFun.receiveNum(call.uid)
lockNum += 1
}
Object.entries(change).forEach(([k, v]) => {
@ -53,4 +57,6 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
call.succ(change);
addGameLog(call.uid, "_onekeyReceive", {}, change)
}

View File

@ -6,13 +6,13 @@
},
{
"key":"got_jinbi",
"limit":200000000,
"limit":2000000000,
"tips":"jinbi获取达到20亿"
},
{
"key":"got_rmbmoney",
"limit":30000,
"tips":"钻石获取达到3万"
"limit":50000,
"tips":"钻石获取达到5万"
},
{
"key":"use_attr_rmbmoney",
@ -21,8 +21,8 @@
},
{
"key":"tanxian/FastGuaJi",
"limit":40,
"tips":"快速探险达到40次"
"limit":30,
"tips":"快速探险达到30次"
},
{
"key":"xstask/Receive/Num",

View File

@ -38,9 +38,8 @@ export class PataFun {
}
/**修改爬塔信息 */
static async changeInfo(uid: string, sid: number, change: Pick<UpdateFilter<paTaType>, '$set'>) {
G.mongodb.collection('pata').updateOne(
static async changeInfo(uid: string, sid: number, change: Pick<UpdateFilter<paTaType>, string>) {
await G.mongodb.collection('pata').updateOne(
{uid: uid, sid: sid},
change,
{upsert: true}
@ -51,7 +50,7 @@ export class PataFun {
static async getHongDian(uid: string) {
let mydata = await this.getInfo(uid);
let con = Object.keys(G.gc.patacom);
con.sort((a, b) => { return parseInt(a) - parseInt(b); });
con.sort((a, b) => parseInt(a) - parseInt(b));
for (let idx in con) {
idx = con[idx];
if (mydata.lv <= parseInt(idx)) {

View File

@ -13,7 +13,7 @@ import {getConf as zmlbGetConf} from '../api_s2c/event/zhoumolibao/ApiOpen';
import {Christmasfun} from "../api_s2c/event/christmas/fun";
async function checkPayIsActive(payId: string, logs: payLog[], payArgs) {
let conf: any = await this.getConf(payId, payArgs);
let conf: any = await PayFun.getConf(payId, payArgs);
if (!conf) return false;
let lastLog = logs.last();

View File

@ -34,7 +34,7 @@ export class WatchDog extends Scheduler {
//获取今天0点之后在线的玩家
let users = await G.mongodb.collection("user").find({
lv: {$gt: 10},
newonlinetime: {$gte: G.time - 3600, $lte: G.time + 30}
newonlinetime: {$gte: G.time - 1800, $lte: G.time + 30}
}, {
projection: {
uid: 1,

View File

@ -140,7 +140,7 @@ function setWs(server: WsServer<ServiceType>) {
//处理API锁极限情况下只锁10s防止死锁
//在下方postApiReturnFlow里会解锁
if (call.conn.apiLock[call.service.name] && call.conn.apiLock[call.service.name] > new Date().getTime()) {
call.error('', {code: -100, message: '', time: 0});
call.error('', {code: -100, message: '', apilock: 1});
return null;
}
@ -199,10 +199,14 @@ function setWs(server: WsServer<ServiceType>) {
let now = new Date().getTime();
if (node.return.isSucc) {
if (!writeList.includes(node.call.service.name)){
node.call.conn.apiLock[node.call.service.name] = now + 200;
}
} else {
if (!node.return.err.apilock) {
delete node.call.conn.apiLock[node.call.service.name];
}
}
return node;
});