寻宝:单排玩家强退
This commit is contained in:
@@ -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); // 结算
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user