🐞 fix(gvg): 修复可能会一直继承城池的问题
This commit is contained in:
@@ -3,14 +3,14 @@ import { GVGLeagueModel, GVGLeagueType } from "../../db/GVGLeague";
|
||||
import { GVGTeamModel, GVGTeamType, GVGTeamUpdate } from "../../db/GVGTeam";
|
||||
import { GVGCityModel, GVGCityType } from "../../db/GVGCity";
|
||||
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 { COUNTER, GVG_AREA_TYPE, GVG_ATTACK_TYPE, GVG_BATTLE_RANK_TYPE, GVG_PERIOD, GVG_POINT_TYPE, GVG_SERVER_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 "../memoryCache/gvgBattleData";
|
||||
import { GVGAttackSpine, GVGCityMapInfo, GVGTeamInList, GVGTeamInListOnPoint, GVGTeamSpineInMap } from "../../domain/gvgField/returnData";
|
||||
import { GVG } from "../../pubUtils/dicParam";
|
||||
import { GVGHeroInfo, PvpEnemies, PvpHeroInfo } from "../../domain/dbGeneral";
|
||||
import { getGroupKey, getGVGConfig, getGVGConfigFromRemote, getGVGPeriodData } from "./gvgService";
|
||||
import { getGroupKey, getGVGConfig, getGVGConfigFromRemote, getGVGPeriodData, getGVGServerType } from "./gvgService";
|
||||
import { GVGLeaguePrepareModel } from "../../db/GVGLeaguePrepare";
|
||||
import { pinus } from "pinus";
|
||||
import { dispatch } from "../../pubUtils/dispatcher";
|
||||
@@ -679,6 +679,11 @@ async function addGuardCity(configId: number, groupKey: string, cityId: number,
|
||||
let dicCityAdd = gameData.gvgCityAdd.get(dicCity.cityType);
|
||||
let league = await GVGLeagueModel.findByCodeWithoutPopulate(leagueCode);
|
||||
if(!league) return;
|
||||
let leagueGroupKey = await getGroupKey(league.serverId);
|
||||
if(groupKey != leagueGroupKey) {
|
||||
console.log('addGuardCity groupKey err', cityId, groupKey, leagueCode, league.serverId);
|
||||
return;
|
||||
}
|
||||
await GVGCityModel.guardCity(configId, groupKey, cityId, league);
|
||||
await sendMailToLeagueByContent(MAIL_TYPE.GVG_GUARD_CITY_REWARD, leagueCode, { params: [dicCity.cityName], goods: dicCityAdd.occupyReward }, league, canSendReward);
|
||||
await addCityGuardMessage(league, cityId);
|
||||
|
||||
Reference in New Issue
Block a user