寻宝:单排玩家强退

This commit is contained in:
luying
2021-08-17 17:45:52 +08:00
parent e81a9b67db
commit a785644cbb
5 changed files with 22 additions and 3 deletions
@@ -1,6 +1,8 @@
import { Application, ChannelService, FrontendSession, RemoterClass, HandlerService, pinus, } from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { STATUS } from '../../../consts';
import { handleComBtlProgress } from '../../../services/comBattleService';
import { MemComBtlTeam } from '../../../domain/battleField/ComBattleTeamField';
export default function (app: Application) {
new HandlerService(app, {});
@@ -129,6 +131,18 @@ export class ComBattleRemote {
}
public async leaveFromBattle(roleId: string, teamCode: string ) {
// this.app.sysrpc.msgRemote.forwardMessage
let teamMap: Map<string, MemComBtlTeam> = this.app.get('teamMap');
if(teamMap && teamMap.has(teamCode)) {
let myTeam = teamMap.get(teamCode);
for(let roleStatus of myTeam.roleStatus) {
if(roleStatus.roleId == roleId) {
roleStatus.battleStatus = 2; // 自己失败了
}
}
let channelService = this.app.get('channelService');
let channel = channelService.getChannel(teamCode, false);
await handleComBtlProgress(myTeam, this.app.get('robotHurtTimer'), teamMap, channel); // 结算
}
}
}