This commit is contained in:
aozhiwei 2024-07-09 10:54:16 +08:00
commit 2ee70cdbea
2 changed files with 27 additions and 0 deletions

View File

@ -1123,6 +1123,10 @@ class BattleController extends BaseAuthedController {
private function checkTicket($r, $customData, $mapModeMeta) private function checkTicket($r, $customData, $mapModeMeta)
{ {
if ($mapModeMeta['mapMode'] == 501) {
error_log("checkTick error :501");
return false;
}
$itemId = $mapModeMeta['admission_item_id']; $itemId = $mapModeMeta['admission_item_id'];
if (empty($itemId)) { if (empty($itemId)) {
return true; return true;

View File

@ -65,6 +65,9 @@ class GMController extends BaseAuthedController {
'.addhero' => function () use($params) { '.addhero' => function () use($params) {
$this->addHero($params); $this->addHero($params);
}, },
'.dechp' => function () use($params) {
$this->decHP($params);
},
'.loot' => function () use($params) { '.loot' => function () use($params) {
$this->lootTest($params); $this->lootTest($params);
} }
@ -342,4 +345,24 @@ END
myself()->_rspOk(); myself()->_rspOk();
} }
private function decHP($params)
{
$itemNum = getXVal($params, 0, 0);
$userInfo = myself()->_getUserInfo('gold');
$oldGold = myself()->_getItemCount(V_ITEM_GOLD, $userInfo);
$decItems = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => $iteNum
)
);
$newUserInfo = myself()->_getUserInfo('gold');
$newGold = myself()->_getItemCount(V_ITEM_GOLD, $newUserInfo);
myself()->_rspData(array(
'oldGold' => $oldGold,
'newGold' => $newGold,
'itemNum' => $itemNum,
));
}
} }