🐞 fix(gvg): 修复gvg显示问题

This commit is contained in:
luying
2023-02-22 21:04:21 +08:00
parent 1190d64d24
commit c9e9184567
6 changed files with 21 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ import { GVGCityModel } from '../../../db/GVGCity';
import { Application, BackendSession, ChannelService, HandlerService, pinus } from "pinus";
import { resResult, genCode } from "../../../pubUtils/util";
import { GVGLeagueModel } from '../../../db/GVGLeague';
import { getGroupKey, getGVGConfig, getGVGPeriodData } from '../../../services/gvg/gvgService';
import { getGroupKey, getGVGConfig, getGVGPeriodData, getGVGServerType } from '../../../services/gvg/gvgService';
import { redisAddBattleScore, battleEndSendMessage, calBattleScoreByCe, checkAreaIsInCity, checkGVGBattleStart, checkMoveStatus, getBattleRanksByCity, getBirthAreaOfCity, getGVGWarId, getOppHeroes, getTechKnifeHurt, getTechReviveMinus, initRobots, pushTeamMoveMessage, getGVGCitiesInfo, leaveCity } from '../../../services/gvg/gvgBattleService';
import { getGVGBattleData } from '../../../services/gvg/gvgBattleMemory';
import { GVGBattleRecModel } from '../../../db/GVGBattleRec';
@@ -214,7 +214,7 @@ export class GVGBattleHandler {
teamObj.enterCity(...teams);
}
const recs = await GVGRecModel.findBattleRecByCity(configId, groupKey, cityId);
// const recs = await GVGRecModel.findBattleRecByCity(configId, groupKey, cityId);
const teamResult = teams.map(team => new MyTeamInfo(team));
const { ranks, myRank } = await getBattleRanksByCity(configId, groupKey, cityId, myLeague);
await leaveGVGCityTeamChannel(roleId, sid);
@@ -223,7 +223,7 @@ export class GVGBattleHandler {
return resResult(STATUS.SUCCESS, {
cityId,
ranks, myRank,
recs,
recs: [],
teams: teamResult,
});
}
@@ -624,12 +624,14 @@ export class GVGBattleHandler {
let { configId } = getGVGPeriodData();
let groupKey = await getGroupKey(serverId);
let serverType = await getGVGServerType(serverId);
const cities = await GVGCityModel.findByConfig(configId, groupKey);
const points = await GVGCityAreaPointModel.findByConfig(configId, groupKey);
let result: { cityId: number, guardLeagueName: string, areas: { areaId: number, points: { pointId: number, guardLeagueName: string }[] }[] }[] = [];
for(let [ cityId, { areaIds }] of gameData.gvgCity) {
for(let [ cityId, { mapType, areaIds }] of gameData.gvgCity) {
if(mapType != serverType) continue;
let areas: { areaId: number, points: {pointId: number, guardLeagueName: string }[]}[] = [];
for(let areaId of areaIds) {
let dicArea = gameData.gvgArea.get(areaId);