fix,refac: 잠재적인 버그 위치 수정
- aux가 null이 아니라 0으로 되고 있었음 - (0 == null) == true이니 그동안 되고는 있었겠으나.. - increaseInheritancePointRaw()를 호출하도록 변경
This commit is contained in:
@@ -6,6 +6,7 @@ use Ds\Map;
|
|||||||
use sammo\DTO\BettingInfo;
|
use sammo\DTO\BettingInfo;
|
||||||
use sammo\DTO\BettingItem;
|
use sammo\DTO\BettingItem;
|
||||||
use sammo\Enums\GeneralQueryMode;
|
use sammo\Enums\GeneralQueryMode;
|
||||||
|
use sammo\Enums\InheritanceKey;
|
||||||
use sammo\Enums\RankColumn;
|
use sammo\Enums\RankColumn;
|
||||||
|
|
||||||
class Betting
|
class Betting
|
||||||
@@ -351,6 +352,8 @@ class Betting
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
|
$pointManager = InheritancePointManager::getInstance();
|
||||||
|
|
||||||
if ($this->info->reqInheritancePoint) {
|
if ($this->info->reqInheritancePoint) {
|
||||||
/** @var Map<int,UserLogger> */
|
/** @var Map<int,UserLogger> */
|
||||||
$loggers = new Map();
|
$loggers = new Map();
|
||||||
@@ -362,11 +365,8 @@ class Betting
|
|||||||
$userID = $rewardItem['userID'];
|
$userID = $rewardItem['userID'];
|
||||||
$amount = $rewardItem['amount'];
|
$amount = $rewardItem['amount'];
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
$nextPoint = $pointManager->increaseInheritancePointRaw($userID, InheritanceKey::previous, $amount);
|
||||||
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
$previousPoint = $nextPoint - $amount;//역산
|
||||||
$nextPoint = $previousPoint + $amount;
|
|
||||||
$inheritStor->setValue('previous', [$nextPoint, 0]);
|
|
||||||
$inheritStor->invalidateCacheValue('previous'); //XXX: 실제로는 previous 값을 사용할 수 없도록 락을 걸어야 한다.
|
|
||||||
|
|
||||||
$generalID = $rewardItem['generalID'];
|
$generalID = $rewardItem['generalID'];
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
|
|||||||
Reference in New Issue
Block a user