Merge branch 'bugfix' of http://git.legu.cc/qixin/HJ_Server into bugfix

This commit is contained in:
ciniao 2024-01-03 14:32:40 +08:00
commit 38dca3a653
4 changed files with 81 additions and 28 deletions

View File

@ -44,6 +44,7 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
if (star < taskConf.needStar) return call.error(globalThis.lng.xstask_8); if (star < taskConf.needStar) return call.error(globalThis.lng.xstask_8);
change[receive._id] = { time: G.time, heros: receive.heroIds }; change[receive._id] = { time: G.time, heros: receive.heroIds };
XstaskFun.receiveNum(call.uid)
} }
Object.entries(change).forEach(([k, v]) => { Object.entries(change).forEach(([k, v]) => {

View File

@ -18,5 +18,55 @@
"key":"use_attr_rmbmoney", "key":"use_attr_rmbmoney",
"limit":100000, "limit":100000,
"tips":"钻石消耗达到10万" "tips":"钻石消耗达到10万"
},
{
"key":"tanxian/FastGuaJi",
"limit":40,
"tips":"快速探险达到40次"
},
{
"key":"xstask/Receive/Num",
"limit":8,
"tips":"接取悬赏任务超过8个"
},
{
"key":"dixiaqianzhuang/Qf",
"limit":500,
"tips":"地下钱庄使用次数超过500次"
},
{
"key":"shop/Buy/2",
"limit":50,
"tips":"势力商店购买某一商品超过50次"
},
{
"key":"shop/Buy/1",
"limit":10,
"tips":"杂货商店购买某一商品超过10次"
},
{
"key":"peijiancangku/Jump",
"limit":500,
"tips":"指定高级仓库超过50次"
},
{
"key":"meirishilian/Fight",
"limit":30,
"tips":"物资缴获挑战和扫荡累计超过30次"
},
{
"key":"pata/SaoDang",
"limit":5,
"tips":"黑暗塔扫荡次数超过5次"
},
{
"key":"lingzhulaixi/PkBoss",
"limit":15,
"tips":"讨伐海盗挑战次数超过15次"
},
{
"key":"gonghui/FbFight",
"limit":5,
"tips":"势力战斗boss超过5次"
} }
] ]

View File

@ -34,7 +34,7 @@ export class WatchDog extends Scheduler {
//获取今天0点之后在线的玩家 //获取今天0点之后在线的玩家
let users = await G.mongodb.collection("user").find({ let users = await G.mongodb.collection("user").find({
lv: {$gt: 10}, lv: {$gt: 10},
newonlinetime:{$gt: PublicShared.getToDayZeroTime() } newonlinetime: {$gte: G.time - 3600, $lte: G.time + 30}
}, { }, {
projection: { projection: {
uid: 1, uid: 1,
@ -71,7 +71,7 @@ export class WatchDog extends Scheduler {
let key = conf[j].key; let key = conf[j].key;
let myval = actionLogs[i]?.log?.[key] || 0 let myval = actionLogs[i]?.log?.[key] || 0
let uid = actionLogs[i].uid let uid = actionLogs[i].uid
if( myval >= conf[j].limit ){ if (myval > conf[j].limit) {
//触发了警报 //触发了警报
warns.push({ warns.push({
type: 'watchDog', type: 'watchDog',

View File

@ -3,6 +3,7 @@ import {ApiCall} from 'tsrpc';
import {playerInfoType} from '../module/collection_palyerInfo'; import {playerInfoType} from '../module/collection_palyerInfo';
import {CollectionXstask} from '../module/collection_xstask'; import {CollectionXstask} from '../module/collection_xstask';
import {PublicShared} from '../shared/public/public'; import {PublicShared} from '../shared/public/public';
import {ActionLog} from "./actionLog/actionLog";
export class XstaskFun { export class XstaskFun {
@ -166,6 +167,7 @@ export class XstaskFun {
G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'}, G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'},
{$set: {refreshTime: G.time, receiveNum: 0}}, {upsert: true}); {$set: {refreshTime: G.time, receiveNum: 0}}, {upsert: true});
} else { } else {
ActionLog.addDayLog(uid, { key: "xstask/Receive/Num", val: 1 });
G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'}, G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'},
{$inc: {receiveNum: 1}}, {upsert: true}); {$inc: {receiveNum: 1}}, {upsert: true});
} }