1
This commit is contained in:
parent
607625da33
commit
31c3b0fa63
14
doc/Bag.py
14
doc/Bag.py
@ -53,4 +53,18 @@ class Bag(object):
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'buyItem',
|
||||
'desc': '购买道具(目前只一次购买改名卡)',
|
||||
'group': 'Bag',
|
||||
'url': 'webapp/index.php?c=Bag&a=buyItem',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['item_id', '', '道具id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
]
|
||||
|
@ -29,6 +29,7 @@ class Battle(object):
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['battle_uniid', '', 'battle_uuid'],
|
||||
['match_mode', 0, '0: 匹配赛模式 1: 排位赛 3: pve'],
|
||||
['is_valid_battle', 0, 'is_valid_battle'],
|
||||
['payload', '', 'payload'],
|
||||
['map_id', 0, '地图id'],
|
||||
|
@ -138,6 +138,7 @@ class BagController extends BaseAuthedController {
|
||||
));
|
||||
$this->propertyChgService->addBagChg();
|
||||
}
|
||||
$this->propertyChgService->addUserChg();
|
||||
$this->_rspData(array(
|
||||
'property_chg' => $this->propertyChgService->toDto(),
|
||||
));
|
||||
@ -236,6 +237,32 @@ class BagController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
public function buyItem()
|
||||
{
|
||||
$itemId = getReqVal('item_id', 0);
|
||||
$itemMeta = mt\Item::get($itemId);
|
||||
if (!$itemMeta) {
|
||||
$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");
|
||||
return;
|
||||
}
|
||||
$items = array(
|
||||
'item_id' => itemId,
|
||||
'item_num' => 1
|
||||
);
|
||||
$this->_addItems($items, $this->awardService, $this->propertyService);
|
||||
$this->propertyChgService->addBagChg();
|
||||
$this->_rspData(array(
|
||||
'award' => $this->awardService->toDto(),
|
||||
'property_chg' => $this->propertyChgService->toDto(),
|
||||
));
|
||||
}
|
||||
|
||||
private function useTiliDrug($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3)
|
||||
{
|
||||
$errCode = 0;
|
||||
|
@ -49,7 +49,7 @@ class PropertyChgService extends BaseService {
|
||||
public function toDto()
|
||||
{
|
||||
return array(
|
||||
'user_info' => $this->userChg ? User::info(myself()->_getOrmUserInfo()) : array(),
|
||||
'user_info' => $this->userChg ? User::info(myself()->_getOrmUserInfo()) : null,
|
||||
'container_chg' => $this->chgList
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user