寻宝:加入超时标识
This commit is contained in:
@@ -56,6 +56,8 @@ class ComTeam {
|
||||
roleCnt: number;
|
||||
// 藏宝图等级所处范围,用来匹配
|
||||
lvRange: number;
|
||||
// 队伍是否开放加入
|
||||
timeout: boolean;
|
||||
constructor(teamCode: string, pub: boolean, blueprtId: number, status: number, capId: string, ceLimit: number, bossHp: number, quality: number, bossHpArr:Array<BossHp> ) {
|
||||
this.teamCode = teamCode;
|
||||
this.pub = pub;
|
||||
@@ -69,6 +71,7 @@ class ComTeam {
|
||||
this.bossHpArr = bossHpArr;
|
||||
this.curRnd = 0;
|
||||
this.roleCnt = 1;
|
||||
this.timeout = false;
|
||||
let { lvLimited } = getGoodById(blueprtId);
|
||||
this.lvRange = comBtlRangeByLv(lvLimited);
|
||||
}
|
||||
@@ -542,9 +545,9 @@ export class ComBattleHandler {
|
||||
clearRobotHurtTimer(teamStatus, this.robotHurtTimer);
|
||||
let channelService = thiz.app.get('channelService');
|
||||
let channel = channelService.getChannel(teamCode, false);
|
||||
let team = await ComBattleTeamModel.syncTeamData({teamCode, status: COM_TEAM_STATUS.LOOSE, roleStatus: teamStatus.roleStatus, bossHpArr: teamStatus.bossHpArr});
|
||||
let team = await ComBattleTeamModel.syncTeamData({teamCode, status: COM_TEAM_STATUS.LOOSE, roleStatus: teamStatus.roleStatus, bossHpArr: teamStatus.bossHpArr}, true);
|
||||
if (!team) return resResult(STATUS.COM_BATTLE_RESULT_ERR);
|
||||
channel.pushMessage('onTeamComplete', resResult(STATUS.SUCCESS, {teamCode, result: false}));
|
||||
channel.pushMessage('onTeamComplete', resResult(STATUS.SUCCESS, {teamCode, result: false, timeout: true}));
|
||||
thiz.teamMap.delete(teamCode);
|
||||
}
|
||||
}, COM_BTL_CONST.BTL_TIME_LMT);
|
||||
@@ -702,16 +705,16 @@ export class ComBattleHandler {
|
||||
|
||||
async getComBtlStatus(msg: {teamCode: string}, session: BackendSession) {
|
||||
let { teamCode } = msg;
|
||||
let roleStatus, status, bossHpArr;
|
||||
let roleStatus, status, bossHpArr, timeout;
|
||||
let memTeam = this.teamMap.get(teamCode);
|
||||
if (memTeam) {
|
||||
({ roleStatus, status, bossHpArr } = memTeam);
|
||||
({ roleStatus, status, bossHpArr, timeout } = memTeam);
|
||||
} else {
|
||||
let dbTeam = await ComBattleTeamModel.getTeamByCode(teamCode);
|
||||
if (!dbTeam) return resResult(STATUS.COM_BATTLE_TEAM_INVALID);
|
||||
({ roleStatus, status, bossHpArr } = dbTeam);
|
||||
({ roleStatus, status, bossHpArr, timeout } = dbTeam);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
return resResult(STATUS.SUCCESS, { teamInfo: {status, teamCode, roleStatus, bossHpArr, timeout} });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user