🐞 fix(gvgBattle): 修改 battleStart 返回值

This commit is contained in:
liangtongchuan
2023-01-29 17:56:54 +08:00
committed by luying
parent 7201b2ba49
commit 90740fa8b0

View File

@@ -6,7 +6,7 @@ import { GVGCityModel } from './../../../../../shared/db/GVGCity';
import { Application, BackendSession, ChannelService, HandlerService } from "pinus";
import { STATUS } from "../../../consts";
import { LineupHero } from "../../../domain/roleField/hero";
import { resResult } from "../../../pubUtils/util";
import { resResult, genCode } from "../../../pubUtils/util";
export default function (app: Application) {
new HandlerService(app, {});
@@ -82,6 +82,7 @@ export class GVGBattleHandler {
// 队伍离开积分点
async teamLeave(msg: any, session: BackendSession) {
return resResult(STATUS.SUCCESS);
}
// 队伍开始攻击
@@ -101,7 +102,9 @@ export class GVGBattleHandler {
if (teamInvalid) {
return resResult(STATUS.GVG_BATTLE_TEAM_INVALID, { teamCode: invalidTeamCode });
}
return resResult(STATUS.SUCCESS);
// 生成 battleCode
const battleCode = genCode(8);
return resResult(STATUS.SUCCESS, { battleCode });
}
// 队伍停止攻击