✨ feat(gvg): 定时器
This commit is contained in:
@@ -32,7 +32,7 @@ import { TimeLimitRankData } from '../domain/activityField/timeLimitRankField';
|
||||
import { sendRankMail, takeSnapshot } from './activity/timeLimitRankService';
|
||||
import { ActivityGroupModel } from '../db/ActivityGroup';
|
||||
import { sendMessageToServer } from './pushService';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { getRandEelm, getRandSingleEelm, resResult } from '../pubUtils/util';
|
||||
import { checkPopUpConditionWhenGuildActivityEnd } from './activity/popUpShopService';
|
||||
import { pushRefreshTime } from './connectorService';
|
||||
import { sendUnReceivedActivityDailyCoin } from './activity/dailyCoinService';
|
||||
@@ -45,6 +45,7 @@ import { setHiddenData, setHiddenDataToMemory } from './dataService';
|
||||
import { GVGConfigModel } from '../db/GVGConfig';
|
||||
import { createNewGVGConfig, initLeaguePrepare } from './gvg/gvgService';
|
||||
import { getFightTimeByPeriod, saveVestigeRankSchedule } from './gvg/gvgFightService';
|
||||
import { gvgBattleEnd } from './gvg/gvgBattleService';
|
||||
|
||||
const PER_SECOND = 1 * 1000;
|
||||
const PER_DAY = 24 * 60 * 60;
|
||||
@@ -928,7 +929,7 @@ export async function gvgBattleStartSchedule() {
|
||||
// 初始化投石车
|
||||
let guildServers = pinus.app.getServersByType('guild');
|
||||
if(guildServers.length > 0) {
|
||||
pinus.app.rpc.guild.guildRemote.gvgBattleStart.toServer(guildServers[0].id);
|
||||
pinus.app.rpc.guild.guildRemote.gvgBattleStart.toServer(getRandSingleEelm(guildServers).id);
|
||||
}
|
||||
// 发放道具
|
||||
if(gvgBattleSecondJob) gvgBattleSecondJob.cancel();
|
||||
@@ -939,7 +940,8 @@ export async function gvgBattleStartSchedule() {
|
||||
|
||||
// 每隔5秒的积分计算定时器
|
||||
async function gvgBattleSecondSchedule() {
|
||||
// console.log('********** gvgBattleSecondJob *************');
|
||||
console.log('********** gvgBattleSecondJob *************');
|
||||
pinus.app.rpc.guild.guildRemote.gvgBattleSeconds.broadcast();
|
||||
}
|
||||
|
||||
// 每隔10秒的投石车投机定时器
|
||||
@@ -949,9 +951,11 @@ async function gvgBattleCatapult() {
|
||||
}
|
||||
|
||||
// gvg激战期结束定时器
|
||||
async function gvgBattleEndSchedule() {
|
||||
// 排行榜发放奖励
|
||||
// 城池占领情况
|
||||
export async function gvgBattleEndSchedule() {
|
||||
let guildServers = pinus.app.getServersByType('guild');
|
||||
if(guildServers.length > 0) {
|
||||
pinus.app.rpc.guild.guildRemote.gvgBattleEnd.toServer(getRandSingleEelm(guildServers).id);
|
||||
}
|
||||
// 定时器关闭
|
||||
if(gvgBattleSecondJob) {
|
||||
gvgBattleSecondJob.cancel();
|
||||
|
||||
Reference in New Issue
Block a user