修改天梯和共斗的返回值

This commit is contained in:
liangtongchuan
2020-10-16 23:48:30 +08:00
parent a027317124
commit 7a490916f1
3 changed files with 44 additions and 109 deletions
@@ -1,4 +1,6 @@
import { STATUS } from './../../../consts/statusCode';
import { Application, BackendSession } from 'pinus';
import { resResult } from '../../../pubUtils/util';
export default function(app: Application) {
return new ComBattleHandler(app);
@@ -31,13 +33,7 @@ export class ComBattleHandler {
sid: tsid
}]);
return {
code: 200,
data: {
users,
battleId
}
}
return resResult(STATUS.SUCCESS, { users, battleId });
}
/**
@@ -59,17 +55,11 @@ export class ComBattleHandler {
if (users.indexOf(roleId) === -1) {
channel.add(roleId, sid);
} else {
return {
code: 202,
data: '不能重复加入'
};
return resResult(STATUS.COM_BATTLE_DUP_ENTER);
}
channel.pushMessage('onAddBattle', {users});
return {
code: 200,
data: users
}
return resResult(STATUS.SUCCESS, { users });
}
async hurtHp(msg: {battleId: string, bossHurt: number, actorHurt: [{ actorId: number, actorHurt: number}]}, session: BackendSession) {
@@ -87,9 +77,6 @@ export class ComBattleHandler {
}
channel.pushMessage('bossHp', {bossHp: this.bossHp}, undefined);
return {
code: 200,
data: this.bossHp
}
return resResult(STATUS.SUCCESS, { bossHp: this.bossHp});
}
}