Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2024-10-12 14:44:37 +08:00
commit b236f1eb45
3 changed files with 44 additions and 0 deletions

View File

@ -966,6 +966,17 @@ class BattleController extends BaseAuthedController {
$info['match_mode'] = 1; $info['match_mode'] = 1;
} }
} }
{
$info['items'] = array();
array_push($info['items'], array(
'item_id' => 900007,
'item_num' => 10,
));
array_push($info['items'], array(
'item_id' => 902101,
'item_num' => 10,
));
}
} }
array_push($teamInfo['members'], $info); array_push($teamInfo['members'], $info);
} }

View File

@ -479,6 +479,33 @@ class UserController extends BaseAuthedController {
)); ));
} }
public function getBattleItem()
{
$itemId = getReqVal("item_id", "");
$itemMeta = mt\Item::get($itemId);
if (empty($itemMeta)) {
myself()->_rspErr(1, 'item_id not found');
return;
}
if ($itemMeta['type'] == mt\Item::FUNC_TYPE &&
in_array($itemMeta['sub_type'],
array(
mt\Item::LUCKY_SYMBOL_SUBTYPE,
mt\Item::BATTLE_POTION_SUBTYPE
)
)) {
$itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId);
myself()->_rspData(array(
'item_id' => $itemId,
'item_type' => $itemMeta['type'],
'item_sub_type' => $itemMeta['sub_type']
));
} else {
myself()->_rspErr(1, 'item_id not found');
return;
}
}
public function query() public function query()
{ {
$name = getReqVal('name', ''); $name = getReqVal('name', '');

View File

@ -65,6 +65,10 @@ class Item {
3.战队改名卡 3.战队改名卡
4.体力药剂 4.体力药剂
5.耐久药剂 5.耐久药剂
6.赏金门票
7.英雄升阶道具
8.幸运符
9.战斗内药剂
type类型为10时配置一下子类id type类型为10时配置一下子类id
1.角色材料 1.角色材料
@ -132,6 +136,8 @@ class Item {
const APPOINT_CHIP_SUBTYPE = 2; const APPOINT_CHIP_SUBTYPE = 2;
const APPOINT_SKIN_SUBTYPE = 3; const APPOINT_SKIN_SUBTYPE = 3;
const LUCKY_SYMBOL_SUBTYPE = 8;
const BATTLE_POTION_SUBTYPE = 9;
public static function get($id) public static function get($id)
{ {