战令重置定时器时间计算问题修复
This commit is contained in:
xichaoyin 2024-01-08 17:12:11 +08:00
parent e016e708c4
commit d91c413603

View File

@ -15,7 +15,7 @@ export class SchedulerZhanLing extends Scheduler {
let data = await this.db.findOne({ type: this.id }); let data = await this.db.findOne({ type: this.id });
if (!data) { if (!data) {
// 开服时间整除战令周期 // 开服时间整除战令周期
let round = Math.floor(PublicShared.getOpenServerDay() / G.gc.zhanling.eventOpen.day) let round = Math.floor((PublicShared.getOpenServerDay() - 1) / G.gc.zhanling.eventOpen.day)
let prev_run_time = PublicShared.getToDayZeroTime(G.openTime) + round * G.gc.zhanling.eventOpen.day * 86400 let prev_run_time = PublicShared.getToDayZeroTime(G.openTime) + round * G.gc.zhanling.eventOpen.day * 86400
this.db.updateOne({ type: this.id }, { $set: { lastRunTime: prev_run_time, round: round } }, { upsert: true }); this.db.updateOne({ type: this.id }, { $set: { lastRunTime: prev_run_time, round: round } }, { upsert: true });
} }