🐞 fix(gvg): 激战期队伍下发格式修改

This commit is contained in:
luying
2023-02-24 18:03:11 +08:00
parent 42401b317f
commit d7b9167e0f
3 changed files with 16 additions and 9 deletions

View File

@@ -402,15 +402,19 @@ export async function gvgBattleSeconds() {
await redisAddSettleScore(team, addScore);
}
// 向下推送区域数据
let spinesByCity = new Map<number, GVGTeamSpineInMap[]>();
for(let areaId of teamObj.findAreas()) {
let dicArea = gameData.gvgArea.get(areaId);
let teams = teamObj.findTeamsByArea(areaId);
let result = teams.map(team => new GVGTeamSpineInMap(team, serverNames));
await sendMessageToGVGAreaWithSuc(teamObj.groupKey, areaId, PUSH_ROUTE.GVG_AREA_SPINE_CHANGE, { cityId: dicArea.cityId, areaId, spines: result });
let spines = teams.map(team => new GVGTeamSpineInMap(team, serverNames));
if(!spinesByCity.has(dicArea.cityId)) spinesByCity.set(dicArea.cityId, []);
spinesByCity.get(dicArea.cityId).push(...spines);
let index = keys.findIndex(cur => cur.cityId == dicArea.cityId && cur.groupKey == teamObj.groupKey);
if(index == -1) keys.push({ groupKey: teamObj.groupKey, cityId: dicArea.cityId });
}
for(let [cityId, spines] of spinesByCity) {
await sendMessageToGVGCityWithSuc(teamObj.groupKey, cityId, PUSH_ROUTE.GVG_AREA_SPINE_CHANGE, { cityId, spines });
}
}