军团活动:修复排行榜时间错误
This commit is contained in:
@@ -185,12 +185,14 @@ export class GateActivityHandler {
|
||||
|
||||
let myR = new Rank(REDIS_KEY.USER_GATE_ACTIVITY, { serverId, guildCode }, true);
|
||||
let r = new Rank(REDIS_KEY.GATE_ACTIVITY, { serverId }, true);
|
||||
if (isSuccess) {
|
||||
if (isSuccess && statusResult.status == GUILD_ACTIVITY_STATUS.START) {
|
||||
let obj = getGateActivityObj();
|
||||
let score = gameData.gateActivityPoint.get(GET_POINT_WAYS.DEFENSE_SUCCESS);
|
||||
// 更新redis数据
|
||||
await myR.setRank({ roleId }, [score, Date.now()], true);
|
||||
|
||||
await r.setRank({ guildCode }, [score, Date.now()], true);
|
||||
if(score > 0) {
|
||||
await myR.setRankWithRoleInfo(roleId, score, obj.getTimeGap(), null, true);
|
||||
await r.setRankWithGuildInfo(guildCode, score, obj.getTimeGap(), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
// 返回当前军团总军功
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { sendAllGuildRanks, calWoodenHorseAndSend, sendRaceStartMsg, setDicGuildActivity, setDicAuctionTime, settleGuildActivityReward, gateActivityStart, cityActivityStart } from '../../../services/guildActivity/guildActivityService';
|
||||
import { sendAllGuildRanks, calWoodenHorseAndSend, sendRaceStartMsg, setDicGuildActivity, setDicAuctionTime, settleGuildActivityReward, gateActivityStart, cityActivityStart, clearActivityObj } from '../../../services/guildActivity/guildActivityService';
|
||||
import { gameData } from '../../../pubUtils/data';
|
||||
import { setWeek } from '../../../pubUtils/timeUtil';
|
||||
import { sendUngotDividend } from '../../../services/auctionService';
|
||||
@@ -176,4 +176,12 @@ export class GuildActivityRemote {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
async clearActivityObj() {
|
||||
try {
|
||||
clearActivityObj();
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,12 @@ export function getRaceActivityObj() {
|
||||
return raceActivityObj;
|
||||
}
|
||||
|
||||
export function clearActivityObj() {
|
||||
gateActivityObj = undefined;
|
||||
cityActivityObj = undefined;
|
||||
raceActivityObj = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务,获得前一天的活跃玩家中位数武将战力
|
||||
*/
|
||||
@@ -295,14 +301,12 @@ export async function settleGuildActivityReward(aid: number) {
|
||||
await gateActivitySettleReward(guildCode, serverId);
|
||||
}
|
||||
}
|
||||
gateActivityObj = new GateActivityObject();
|
||||
} else if (aid == GUILD_ACTIVITY_TYPE.CITY_ACTIVITY) {
|
||||
let obj = getCityActivityObj();
|
||||
let { cities } = obj.getAllCities();
|
||||
for (let { serverId, cityId } of cities) {
|
||||
await cityActivitySettleReward(cityId, serverId);
|
||||
}
|
||||
cityActivityObj = new CityActivityObject();
|
||||
} else if (aid == GUILD_ACTIVITY_TYPE.RACE_ACTIVITY) {
|
||||
let obj = getRaceActivityObj();
|
||||
|
||||
@@ -312,7 +316,6 @@ export async function settleGuildActivityReward(aid: number) {
|
||||
await raceActivitySettleReward(guildCode, woodenHorse);
|
||||
}
|
||||
}
|
||||
raceActivityObj = new RaceActivityObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ export async function everydayRefresh() {
|
||||
setPreDayActiveData(servers);
|
||||
sendUngotDividendJob();
|
||||
sendUnReceivedActivityDailyCoin(servers);
|
||||
pinus.app.rpc.guild.guildActivityRemote.clearActivityObj.broadcast();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user