From 0ded0384afa1da6de1e7e0e74d63b4eaa3dc8409 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Sep 2022 19:42:32 +0800 Subject: [PATCH] 1 --- webapp/services/BattleDataService.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/webapp/services/BattleDataService.php b/webapp/services/BattleDataService.php index 690053f3..5926e539 100644 --- a/webapp/services/BattleDataService.php +++ b/webapp/services/BattleDataService.php @@ -41,6 +41,10 @@ class BattleDataService extends BaseService { const MAX_DROP_NUM = 2; + const MATCH_MODE_PVP = 0; + const MATCH_MODE_MATCH = 1; + const MATCH_MODE_PVE = 2; + private $seasonDb = array(); private $heroDto = null; private $heroMeta = null; @@ -82,7 +86,8 @@ class BattleDataService extends BaseService { return false; } $this->reward['hero']['hero_uniid'] = $this->heroDto['hero_uniid']; - $this->reward['hero']['ceg_uplimit'] = $matchMode == 2 ? $this->heroDto['pve_ceg_uplimit'] : $this->heroDto['pvp_ceg_uplimit']; + $this->reward['hero']['ceg_uplimit'] = $matchMode == self::MATCH_MODE_PVE ? + $this->heroDto['pve_ceg_uplimit'] : $this->heroDto['pvp_ceg_uplimit']; } { $weaponUuid1 = getReqVal('weapon_uuid1', ''); @@ -93,7 +98,8 @@ class BattleDataService extends BaseService { } $this->weapon1Dto = Gun::toDto($weaponDb); $this->reward['weapon1']['gun_uniid'] = $this->weapon1Dto['gun_uniid']; - $this->reward['weapon1']['ceg_uplimit'] = $matchMode == 2 ? $this->weapon1Dto['pve_ceg_uplimit'] : $this->weapon1Dto['pvp_ceg_uplimit']; + $this->reward['weapon1']['ceg_uplimit'] = $matchMode == self::MATCH_MODE_PVE ? + $this->weapon1Dto['pve_ceg_uplimit'] : $this->weapon1Dto['pvp_ceg_uplimit']; } } { @@ -105,7 +111,8 @@ class BattleDataService extends BaseService { } $this->weapon2Dto = Gun::toDto($weaponDb); $this->reward['weapon2']['gun_uniid'] = $this->weapon2Dto['gun_uniid']; - $this->reward['weapon2']['ceg_uplimit'] = $matchMode == 2 ? $this->weapon2Dto['pve_ceg_uplimit'] : $this->weapon2Dto['pvp_ceg_uplimit']; + $this->reward['weapon2']['ceg_uplimit'] = $matchMode == self::MATCH_MODE_PVE ? + $this->weapon2Dto['pve_ceg_uplimit'] : $this->weapon2Dto['pvp_ceg_uplimit']; } } switch ($matchMode) { @@ -697,6 +704,7 @@ class BattleDataService extends BaseService { private function procDrop($dropIdx) { + $matchMode = getReqVal('match_mode'); if ($dropIdx == 0) { $itemId = FragmentPool::dropHero(); if ($itemId) { @@ -705,7 +713,11 @@ class BattleDataService extends BaseService { 'item_id' => $itemId, 'item_num' => 1 )); - $this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1); + if ($matchMode == self::MATCH_MODE_PVE) { + $this->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 1); + } else { + $this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1); + } } } else if ($dropIdx == 1) { $itemId = FragmentPool::dropGun(); @@ -715,7 +727,11 @@ class BattleDataService extends BaseService { 'item_id' => $itemId, 'item_num' => 1 )); - $this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1); + if ($matchMode == self::MATCH_MODE_PVE) { + $this->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 1); + } else { + $this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1); + } } } }