✨ feat(gvg): redis排行榜添加过期时间
This commit is contained in:
@@ -4,7 +4,7 @@ import { GVGTeamModel, GVGTeamType, GVGTeamUpdate } from "../../db/GVGTeam";
|
||||
import { GVGCityModel, GVGCityType } from "../../db/GVGCity";
|
||||
import { gameData, getGVGBattleRankReward } from "../../pubUtils/data";
|
||||
import { GVG_AREA_TYPE, GVG_BATTLE_RANK_TYPE, GVG_TECH_TYPE, MAIL_TYPE, PUSH_ROUTE, REDIS_KEY, STATUS } from "../../consts";
|
||||
import { nowSeconds } from "../../pubUtils/timeUtil";
|
||||
import { getTimeFun, nowSeconds } from "../../pubUtils/timeUtil";
|
||||
import { DicGVGAreaPoint } from "../../pubUtils/dictionary/DicGVGAreaPoint";
|
||||
import { getGVGBattleData, getGVGBattleMap } from "./gvgBattleMemory";
|
||||
import { GVGCityMapInfo, GVGTeamInList, GVGTeamInListOnPoint, GVGTeamSpineInMap } from "../../domain/gvgField/returnData";
|
||||
@@ -275,20 +275,25 @@ export async function catapultHurt() {
|
||||
export async function redisAddBattleScore(gvgTeam: GVGTeamType, incScore: number) {
|
||||
let { configId, groupKey, cityId, roleId, isRobot } = gvgTeam;
|
||||
if(isRobot) return;
|
||||
let nextWeek = <number>getTimeFun().getAfterDayWithHour(7);
|
||||
|
||||
let r = new Rank(REDIS_KEY.GVG_BATTLE_RANK, { configId, groupKey, cityId });
|
||||
r.setRankWithRoleInfo(roleId, incScore, Date.now(), null, true);
|
||||
await r.setExpire(nextWeek);
|
||||
await r.setRankWithRoleInfo(roleId, incScore, Date.now(), null, true);
|
||||
}
|
||||
|
||||
export async function redisAddSettleScore(gvgTeam: GVGTeamType, incScore: number) {
|
||||
let { configId, groupKey, cityId, leagueCode, isRobot } = gvgTeam;
|
||||
if(isRobot) return;
|
||||
let nextWeek = <number>getTimeFun().getAfterDayWithHour(7);
|
||||
|
||||
let r1 = new Rank(REDIS_KEY.GVG_BATTLE_LEAGUE_RANK, { configId, groupKey });
|
||||
r1.setRankWithLeagueInfo(leagueCode, incScore, Date.now(), null, true);
|
||||
await r1.setExpire(nextWeek);
|
||||
await r1.setRankWithLeagueInfo(leagueCode, incScore, Date.now(), null, true);
|
||||
|
||||
let r2 = new Rank(REDIS_KEY.GVG_BATTLE_LEAGUE_RANK_BY_CITY, { configId, groupKey, cityId });
|
||||
r2.setRankWithLeagueInfo(leagueCode, incScore, Date.now(), null, true);
|
||||
await r2.setExpire(nextWeek);
|
||||
await r2.setRankWithLeagueInfo(leagueCode, incScore, Date.now(), null, true);
|
||||
}
|
||||
|
||||
// 获取排行榜
|
||||
|
||||
Reference in New Issue
Block a user