From 1462e2c39b24fda5b58dbbebd7b91df0aae81b9d Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 16 Apr 2024 16:06:17 +0800 Subject: [PATCH] 1 --- doc/Hero.py | 14 ++++++++++++++ webapp/controller/BagController.class.php | 11 +++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/Hero.py b/doc/Hero.py index 6fc17694..c635e68b 100644 --- a/doc/Hero.py +++ b/doc/Hero.py @@ -130,5 +130,19 @@ class Hero(object): ['property_chg', _common.PropertyChg(), '属性变更'], ] }, + { + 'name': 'unSealHero', + 'desc': '英雄解封', + 'group': 'Hero', + 'url': 'webapp/index.php?c=Hero&a=unSealHero', + 'params': [ + _common.ReqHead(), + ['hero_uniid', 0, '英雄唯一id'], + ], + 'response': [ + _common.RspHead(), + ['property_chg', _common.PropertyChg(), '属性变更'], + ] + }, ] diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index cbb9cbe3..a5faa827 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -435,10 +435,8 @@ class BagController extends BaseAuthedController { $this->_rspErr(1, "item_id error"); return; } - if (!( - $itemMeta['type'] == mt\Item::FUNC_TYPE && - $itemMeta['sub_type'] == mt\Item::FUNC_RENAME_CARD_SUBTYPE)) { - $this->_rspErr(1, "only supported rename card"); + if ($itemMeta['type'] != mt\Item::FUNC_TYPE) { + $this->_rspErr(1, "only supported property"); return; } $costItems= array( @@ -498,6 +496,7 @@ class BagController extends BaseAuthedController { private function useSealDrug($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3) { + $userInfo = $this->_getOrmUserInfo(); $errCode = 0; $errMsg = ''; $heroUniId = $param1; @@ -506,6 +505,10 @@ class BagController extends BaseAuthedController { $this->_rspErr(1, "You don't have the hero yet"); return; } + if ($userInfo['hero_id'] == $heroUniId){ + $this->_rspErr(1, "Unable to operate the battle hero"); + return; + } if (!$heroDb['token_id']){ $this->_rspErr(1, "this hero is not NFT"); return;