修改天梯和共斗的返回值
This commit is contained in:
@@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user