🦄 refactor(热更新): 分割状态代码和功能代码
This commit is contained in:
@@ -6,7 +6,7 @@ import { gameData, getGVGBattleRankReward } from "../../pubUtils/data";
|
||||
import { COUNTER, GVG_AREA_TYPE, GVG_ATTACK_TYPE, GVG_BATTLE_RANK_TYPE, GVG_PERIOD, GVG_POINT_TYPE, GVG_TECH_TYPE, MAIL_TYPE, PUSH_ROUTE, REDIS_KEY, STATUS } from "../../consts";
|
||||
import { getTimeFun, nowSeconds } from "../../pubUtils/timeUtil";
|
||||
import { DicGVGAreaPoint } from "../../pubUtils/dictionary/DicGVGAreaPoint";
|
||||
import { getGVGBattleData, getGVGBattleMap } from "./gvgBattleMemory";
|
||||
import { getGVGBattleData, getGVGBattleMap } from "../memoryCache/gvgBattleData";
|
||||
import { GVGAttackSpine, GVGCityMapInfo, GVGTeamInList, GVGTeamInListOnPoint, GVGTeamSpineInMap } from "../../domain/gvgField/returnData";
|
||||
import { GVG } from "../../pubUtils/dicParam";
|
||||
import { GVGHeroInfo, PvpEnemies, PvpHeroInfo } from "../../domain/dbGeneral";
|
||||
@@ -516,6 +516,7 @@ export async function gvgBattleSeconds() {
|
||||
await redisAddSettleScore(team, addScore);
|
||||
}
|
||||
}
|
||||
|
||||
// 向下推送区域数据
|
||||
let spinesByCity = new Map<number, GVGTeamSpineInMap[]>();
|
||||
for(let areaId of teamObj.findAreas()) {
|
||||
@@ -758,4 +759,19 @@ export async function getBattleRank(redisKey: REDIS_KEY, keyParam: KeyNameParam,
|
||||
}
|
||||
}
|
||||
return { ranks, myRank }
|
||||
}
|
||||
|
||||
export async function initTeamToMem() {
|
||||
let sid = pinus.app.getServerId();
|
||||
let servers = pinus.app.getServersByType('guild');
|
||||
let { configId, period } = getGVGPeriodData();
|
||||
if(period != GVG_PERIOD.BATTLE) return;
|
||||
let teams = await GVGTeamModel.findByConfigId(configId);
|
||||
for(let team of teams) {
|
||||
if(team.isBroken) continue;
|
||||
if((await dispatch(redisClient(), team.cityId.toString(), servers, 'guild'))?.id == sid) {
|
||||
let teamObj = getGVGBattleData(team.groupKey);
|
||||
teamObj.enterCity(team);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user