🐞 fix(gvg): 添加退出游戏后撤退据点
This commit is contained in:
@@ -190,6 +190,7 @@ export async function leaveCity(isForce: boolean, roleId: string, serverId: numb
|
|||||||
await GVGTeamModel.leaveCity(roleId);
|
await GVGTeamModel.leaveCity(roleId);
|
||||||
await GVGCityModel.decreasePlayer(configId, groupKey, roleId);
|
await GVGCityModel.decreasePlayer(configId, groupKey, roleId);
|
||||||
await GVGUserDataModel.changeCity(configId, myLeague.leagueCode, roleId, 0);
|
await GVGUserDataModel.changeCity(configId, myLeague.leagueCode, roleId, 0);
|
||||||
|
await GVGCityAreaPointModel.playerLeave(configId, groupKey, roleId);
|
||||||
// 处理内存数据
|
// 处理内存数据
|
||||||
let teamObj = getGVGBattleData(groupKey);
|
let teamObj = getGVGBattleData(groupKey);
|
||||||
teamObj.leaveCity(roleId);
|
teamObj.leaveCity(roleId);
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ export default class GVGCityAreaPoint extends BaseModel {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async playerLeave(configId: number, groupKey: string, roleId: string) {
|
||||||
|
await GVGCityAreaPointModel.updateMany({ configId, groupKey, roleId }, { $set: { teamCode: '', roleId: '', roleName: '', leagueCode: '', leagueName: '' }});
|
||||||
|
}
|
||||||
|
|
||||||
public static async findByConfig(configId: number, groupKey: string) {
|
public static async findByConfig(configId: number, groupKey: string) {
|
||||||
let result: GVGCityAreaPointType[] = await GVGCityAreaPointModel.find({ configId, groupKey }).lean();
|
let result: GVGCityAreaPointType[] = await GVGCityAreaPointModel.find({ configId, groupKey }).lean();
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user