watchdog
This commit is contained in:
parent
1a9f942297
commit
22b577036f
@ -44,6 +44,7 @@ export default async function (call: ApiCall<ReqOnekeyReceive, ResOnekeyReceive>
|
||||
if (star < taskConf.needStar) return call.error(globalThis.lng.xstask_8);
|
||||
|
||||
change[receive._id] = { time: G.time, heros: receive.heroIds };
|
||||
XstaskFun.receiveNum(call.uid)
|
||||
}
|
||||
|
||||
Object.entries(change).forEach(([k, v]) => {
|
||||
|
@ -18,5 +18,55 @@
|
||||
"key":"use_attr_rmbmoney",
|
||||
"limit":100000,
|
||||
"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次"
|
||||
}
|
||||
]
|
@ -34,7 +34,7 @@ export class WatchDog extends Scheduler {
|
||||
//获取今天0点之后在线的玩家
|
||||
let users = await G.mongodb.collection("user").find({
|
||||
lv: {$gt: 10},
|
||||
newonlinetime:{$gt: PublicShared.getToDayZeroTime() }
|
||||
newonlinetime: {$gte: G.time - 3600, $lte: G.time + 30}
|
||||
}, {
|
||||
projection: {
|
||||
uid: 1,
|
||||
@ -71,7 +71,7 @@ export class WatchDog extends Scheduler {
|
||||
let key = conf[j].key;
|
||||
let myval = actionLogs[i]?.log?.[key] || 0
|
||||
let uid = actionLogs[i].uid
|
||||
if( myval >= conf[j].limit ){
|
||||
if (myval > conf[j].limit) {
|
||||
//触发了警报
|
||||
warns.push({
|
||||
type: 'watchDog',
|
||||
|
@ -3,6 +3,7 @@ import {ApiCall} from 'tsrpc';
|
||||
import {playerInfoType} from '../module/collection_palyerInfo';
|
||||
import {CollectionXstask} from '../module/collection_xstask';
|
||||
import {PublicShared} from '../shared/public/public';
|
||||
import {ActionLog} from "./actionLog/actionLog";
|
||||
|
||||
|
||||
export class XstaskFun {
|
||||
@ -166,6 +167,7 @@ export class XstaskFun {
|
||||
G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'},
|
||||
{$set: {refreshTime: G.time, receiveNum: 0}}, {upsert: true});
|
||||
} else {
|
||||
ActionLog.addDayLog(uid, { key: "xstask/Receive/Num", val: 1 });
|
||||
G.mongodb.cEvent('xstask').updateOne({uid: uid, type: 'xstask'},
|
||||
{$inc: {receiveNum: 1}}, {upsert: true});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user