From 0f104c0b37ca9108f7f8147fe9a6d5ffc3cdd186 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 14 Jun 2022 18:50:14 +0800 Subject: [PATCH] 1 --- webapp/controller/HeroController.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index f794dd6a..f78cd32a 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -393,6 +393,10 @@ class HeroController extends BaseAuthedController { $this->_rspErr(1, 'cost hero parameter error'); return; } + if ($costHeroDb['lock_type']) { + $this->_rspErr(2, 'Cannot operate during locking'); + return; + } { $srcHeroDb = Hero::find($this->_getV(TN_HERO_QUALITY_UP, $slotId)); if ($srcHeroDb) { @@ -428,7 +432,7 @@ class HeroController extends BaseAuthedController { $this->_rspErr(3, 'Trial hero cannot operate'); return; } - if ($heroDb['unlock_time'] > $this->_getNowTime()) { + if ($heroDb['lock_type']) { $this->_rspErr(2, 'Cannot operate during locking'); return; } @@ -497,7 +501,14 @@ class HeroController extends BaseAuthedController { 'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'], ) ); + Hero::update($costHeroUniId, + array( + 'lock_type' => Hero::COST_LOCK, + 'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'], + ) + ); $this->_setV(TN_HERO_QUALITY_UP, (int)$slotId, (int)$heroDb['idx']); + $this->_setV(TN_HERO_QUALITY_UP, (int)$slotId * 100, (int)$costHeroDb['idx']); $propertyChgService = new services\PropertyChgService(); $propertyChgService->addHeroChg(); $propertyChgService->addBagChg();