参数错误拦截
This commit is contained in:
@@ -66,7 +66,7 @@ export class DailyBattleHandler {
|
|||||||
// 购买每日次数
|
// 购买每日次数
|
||||||
async buyNum(msg: { type: number, count: number }, session: BackendSession) {
|
async buyNum(msg: { type: number, count: number }, session: BackendSession) {
|
||||||
let {type, count} = msg;
|
let {type, count} = msg;
|
||||||
if(count < 0) return resResult(STATUS.WRONG_PARMS);
|
if( !count || count < 0) return resResult(STATUS.WRONG_PARMS);
|
||||||
const roleId = session.get('roleId');
|
const roleId = session.get('roleId');
|
||||||
const sid = session.get('sid');
|
const sid = session.get('sid');
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class DungeonBattleHandler {
|
|||||||
// 购买每日次数
|
// 购买每日次数
|
||||||
async buyNum(msg: { count: number }, session: BackendSession) {
|
async buyNum(msg: { count: number }, session: BackendSession) {
|
||||||
let { count } = msg;
|
let { count } = msg;
|
||||||
if(count < 0) return resResult(STATUS.WRONG_PARMS);
|
if( !count || count < 0) return resResult(STATUS.WRONG_PARMS);
|
||||||
const roleId = session.get('roleId');
|
const roleId = session.get('roleId');
|
||||||
const sid = session.get('sid');
|
const sid = session.get('sid');
|
||||||
|
|
||||||
|
|||||||
@@ -168,5 +168,11 @@ module.exports = {
|
|||||||
"battle.normalBattleHandler.checkBattle": {
|
"battle.normalBattleHandler.checkBattle": {
|
||||||
"required uInt32 battleId": 1,
|
"required uInt32 battleId": 1,
|
||||||
"repeated uInt32 heroes": 2
|
"repeated uInt32 heroes": 2
|
||||||
|
},
|
||||||
|
"battle.dungeonBattleHandler.buyNum": {
|
||||||
|
"required uInt32 count": 1
|
||||||
|
},
|
||||||
|
"battle.dailyBattleHandler.buyNum": {
|
||||||
|
"required uInt32 count": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user