From c9903340a3767adc5da3f43162db986b82c3e835 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 00:40:52 +0800 Subject: [PATCH 1/7] 1 --- webapp/controller/BattleController.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index d10f5544..f8835df3 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1128,6 +1128,9 @@ class BattleController extends BaseAuthedController { if (!$mapModeMeta['is_open']) { return false; } + if ($mapModeMeta['map_mode'] == 501) { + return false; + } $roomUuid = $customData['room_uuid']; if ($r->get(DEC_BATTLE_TICKET . $roomUuid)) { return true; From b41da02aa4d510c7f41f0436f0d34db97e4ba725 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 00:55:07 +0800 Subject: [PATCH 2/7] 1 --- webapp/controller/BattleController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index f8835df3..260cffba 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1121,6 +1121,9 @@ class BattleController extends BaseAuthedController { private function checkTicket($r, $customData, $mapModeMeta) { + if ($mapModeMeta['map_mode'] == 501) { + return false; + } $itemId = $mapModeMeta['admission_item_id']; if (empty($itemId)) { return true; @@ -1128,9 +1131,6 @@ class BattleController extends BaseAuthedController { if (!$mapModeMeta['is_open']) { return false; } - if ($mapModeMeta['map_mode'] == 501) { - return false; - } $roomUuid = $customData['room_uuid']; if ($r->get(DEC_BATTLE_TICKET . $roomUuid)) { return true; From fffe218e1cf8f6a5ab9e83aca18c122aca03c18e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 01:06:06 +0800 Subject: [PATCH 3/7] 1 --- webapp/controller/BattleController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 260cffba..9d237ed4 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1122,6 +1122,7 @@ class BattleController extends BaseAuthedController { private function checkTicket($r, $customData, $mapModeMeta) { if ($mapModeMeta['map_mode'] == 501) { + error_log("checkTick error :501"); return false; } $itemId = $mapModeMeta['admission_item_id']; From 55aa884cfe90abf0c329fc11e004fb998c5a9335 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 01:19:14 +0800 Subject: [PATCH 4/7] 1 --- webapp/controller/BattleController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 9d237ed4..e45408fd 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1121,7 +1121,7 @@ class BattleController extends BaseAuthedController { private function checkTicket($r, $customData, $mapModeMeta) { - if ($mapModeMeta['map_mode'] == 501) { + if ($mapModeMeta['mapMode'] == 501) { error_log("checkTick error :501"); return false; } From 44fc07e4efb0bf58ee4a6b0c8d9fd89110f1fc7d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 10:37:30 +0800 Subject: [PATCH 5/7] 1 --- webapp/controller/BaseAuthedController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 02e6c1b9..84824e70 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -440,7 +440,7 @@ class BaseAuthedController extends BaseController { { $this->_updateUserInfo(array( 'gold' => function () use($itemNum) { - return "GREATEST(0, gold - ${itemNum})"; + return "gold - ${itemNum}"; }, 'consume_gold' => function () use ($itemNum){ return "consume_gold + ${itemNum}"; From c2d24c126d920121e64f0521af2419c5666d9222 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 10:50:33 +0800 Subject: [PATCH 6/7] 1 --- webapp/controller/GMController.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index ca5ce24a..40311a54 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -65,6 +65,9 @@ class GMController extends BaseAuthedController { '.addhero' => function () use($params) { $this->addHero($params); }, + '.dechp' => function () use($params) { + $this->decHP($params); + }, '.loot' => function () use($params) { $this->lootTest($params); } @@ -342,4 +345,17 @@ END 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 + ) + ); + } + } From bed62b93ba80bb613e79ba831593076feb78b71d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 9 Jul 2024 10:54:02 +0800 Subject: [PATCH 7/7] 1 --- webapp/controller/GMController.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index 40311a54..08aeea3a 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -349,13 +349,20 @@ END { $itemNum = getXVal($params, 0, 0); $userInfo = myself()->_getUserInfo('gold'); - $oldGOld = myself()->_getItemCount(V_ITEM_GOLD, $userInfo); + $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, + )); } }