🐞 fix(gvg): 修复gvg激战期bug
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export enum GVG_PERIOD {
|
||||
NO = 0, // 什么期都不是
|
||||
TEAM = 1, // 组建期
|
||||
PREPARE = 2, // 备战期
|
||||
BATTLE = 3, // 战斗器
|
||||
|
||||
@@ -325,6 +325,9 @@ export function getInfoKeyByRedisKey(redisKey: REDIS_KEY) {
|
||||
return { infoKey: REDIS_KEY.USER_INFO, extraKey: [] };
|
||||
case REDIS_KEY.GVG_BATTLE_LEAGUE_RANK: // 激战期联军排行榜
|
||||
return { infoKey: REDIS_KEY.LEAGUE_INFO, extraKey: [] };
|
||||
case REDIS_KEY.GVG_BATTLE_LEAGUE_RANK_BY_CITY: // 激战期联军排行榜
|
||||
return { infoKey: REDIS_KEY.LEAGUE_INFO, extraKey: [] };
|
||||
|
||||
default:
|
||||
return { infoKey: REDIS_KEY.USER_INFO, extraKey: [] };
|
||||
}
|
||||
|
||||
@@ -380,6 +380,7 @@ export const STATUS = {
|
||||
GVG_POINT_HAS_SETTLED: { code: 21416, simStr: '该据点已经有其他队伍驻守' },
|
||||
GVG_POINT_NOT_AREA: { code: 21417, simStr: '您不在该积分点所在区域' },
|
||||
GVG_TEAM_NOT_NEED_REVIVE: { code: 21418, simStr: '此队伍不需要复活' },
|
||||
GVG_BATTLE_IS_MOVING_CD: { code: 21403, simStr: '移动冷却中' },
|
||||
|
||||
// 通用 30000 - 30099
|
||||
DIC_DATA_NOT_FOUND: { code: 30000, simStr: '数据表未找到' },
|
||||
|
||||
@@ -82,6 +82,12 @@ export default class GVGBattleRec extends BaseModel {
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
defenseTeam: TeamInfo; // 防守队伍
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
attackTeamAfter: TeamInfo; // 挑战队伍
|
||||
|
||||
@prop({ required: true, type: TeamInfo, _id: false })
|
||||
defenseTeamAfter: TeamInfo; // 防守队伍
|
||||
|
||||
@prop({ required: true })
|
||||
isSuccess: boolean;
|
||||
|
||||
@@ -99,8 +105,8 @@ export default class GVGBattleRec extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async battleEnd(battleCode: string, isSuccess: boolean) {
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { isSuccess, battleEndTime: nowSeconds() } }, { new: true }).lean();
|
||||
public static async battleEnd(battleCode: string, isSuccess: boolean, attackTeam: GVGTeamType, defenseTeam: GVGTeamType) {
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { isSuccess, battleEndTime: nowSeconds(), attackTeamAfter: attackTeam, defenseTeamAfter: defenseTeam } }, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -758,7 +758,7 @@ export class MyTeamInfo {
|
||||
this.index = team.index;
|
||||
this.head = team.head;
|
||||
this.frame = team.spine;
|
||||
this.lineup = team.lineup.map(({ actorId, dataId, outIndex }) => ({ actorId, dataId, order: outIndex }));
|
||||
if(team.lineup) this.lineup = team.lineup.map(({ actorId, dataId, outIndex }) => ({ actorId, dataId, order: outIndex }));
|
||||
this.durability = team.durability;
|
||||
this.maxDurability = team.maxDurability;
|
||||
this.restartTime = team.restartTime;
|
||||
|
||||
Reference in New Issue
Block a user