🐞 fix(gvg): 离开城池的路由错误

This commit is contained in:
luying
2023-03-09 11:02:28 +08:00
parent d2bef09390
commit 41decd4317
3 changed files with 17 additions and 12 deletions

View File

@@ -229,14 +229,18 @@ export async function leaveCity(isForce: boolean, roleId: string, serverId: numb
if(myLeague) await GVGUserDataModel.changeCity(configId, myLeague.leagueCode, roleId, 0);
await GVGCityAreaPointModel.playerLeave(configId, groupKey, roleId);
// 处理内存数据
let teamObj = getGVGBattleData(groupKey);
teamObj.leaveCity(roleId);
for(let team of teams) {
if(team.cityId > 0 && team.areaId > 0) {
await sendMessageToGVGAreaByTeamWithSuc(groupKey, team.areaId, PUSH_ROUTE.GVG_PLAYER_LEAVE_AREA, {
cityId: team.cityId, areaId: team.areaId, teamCode: team.teamCode
});
}
await pinus.app.rpc.guild.guildRemote.leaveCityMem.broadcast(groupKey, roleId, teams);
}
}
export async function leaveCityMem(groupKey: string, roleId: string, teams: GVGTeamType[]) {
let teamObj = getGVGBattleData(groupKey);
teamObj.leaveCity(roleId);
for(let team of teams) {
if(team.cityId > 0 && team.areaId > 0) {
await sendMessageToGVGAreaByTeamWithSuc(groupKey, team.areaId, PUSH_ROUTE.GVG_PLAYER_LEAVE_AREA, {
cityId: team.cityId, areaId: team.areaId, teamCode: team.teamCode
});
}
}
}