pvp:赛季定时器
This commit is contained in:
@@ -58,7 +58,7 @@ export async function init() {
|
|||||||
console.log('******* init systimer *******')
|
console.log('******* init systimer *******')
|
||||||
|
|
||||||
// pvp赛季
|
// pvp赛季
|
||||||
await setPvpSeason();
|
await setPvpSeason(true);
|
||||||
|
|
||||||
// 周功勋结算任务
|
// 周功勋结算任务
|
||||||
guildWeeklyJobId = scheduleJob('settleGuildWeekly', '0 0 0 * * 1', settleGuildWeekly);
|
guildWeeklyJobId = scheduleJob('settleGuildWeekly', '0 0 0 * * 1', settleGuildWeekly);
|
||||||
@@ -116,10 +116,10 @@ function getSeasonContinueDay(seasonNum: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setPvpSeasonJob() {
|
async function setPvpSeasonJob() {
|
||||||
await setPvpSeason();
|
await setPvpSeason(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setPvpSeason(isForce?: boolean, minute?: number) {
|
async function setPvpSeason(isFirst: boolean, isForce?: boolean, minute?: number) {
|
||||||
console.log(`******** setPvpSeason1: isForce-${isForce}, minute-${minute}`)
|
console.log(`******** setPvpSeason1: isForce-${isForce}, minute-${minute}`)
|
||||||
|
|
||||||
let during = minute? minute * PER_MINUTE: null; // 下一次重置赛季天数
|
let during = minute? minute * PER_MINUTE: null; // 下一次重置赛季天数
|
||||||
@@ -158,7 +158,7 @@ async function setPvpSeason(isForce?: boolean, minute?: number) {
|
|||||||
}
|
}
|
||||||
await setPvpSeasonMakeRewardJob(pvpConfig);
|
await setPvpSeasonMakeRewardJob(pvpConfig);
|
||||||
await setNextSeasonJob(pvpConfig);
|
await setNextSeasonJob(pvpConfig);
|
||||||
setPvpSeasonNum(pvpConfig, true);
|
setPvpSeasonNum(pvpConfig, isFirst);
|
||||||
return pvpConfig;
|
return pvpConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ async function setNextSeasonJob(pvpConfig: PVPConfigType) {
|
|||||||
* @param hour
|
* @param hour
|
||||||
*/
|
*/
|
||||||
export async function resetPvpSeasonTime(minute: number) {
|
export async function resetPvpSeasonTime(minute: number) {
|
||||||
return await setPvpSeason(true, minute);
|
return await setPvpSeason(false, true, minute);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function reportOnlineSchedule() {
|
export async function reportOnlineSchedule() {
|
||||||
|
|||||||
Reference in New Issue
Block a user