유산 포인트 초기화/저장 구조 추가

This commit is contained in:
2021-08-08 03:02:42 +09:00
parent a62cc65b53
commit 44bd408471
4 changed files with 94 additions and 10 deletions
+15
View File
@@ -988,6 +988,10 @@ function checkEmperior()
foreach ($db->queryFirstColumn('SELECT no FROM general WHERE npc<2 AND age>=%i', GameConst::$minPushHallAge) as $hallGeneralNo) {
CheckHall($hallGeneralNo);
}
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
$genObj->mergeTotalInheritancePoint();
}
[$totalPop, $totalMaxPop] = $db->queryFirstList('SELECT SUM(pop), SUM(pop_max) FROM city');
$pop = "{$totalPop} / {$totalMaxPop}";
@@ -1132,3 +1136,14 @@ function checkEmperior()
//연감 월결산
LogHistory();
}
function resetInheritanceUser(int $userID){
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
$totalPoint = 0;
foreach($inheritStor->getAll() as [$value,]){
$totalPoint += $value;
}
$totalPoint = Util::toInt($totalPoint);
$inheritStor->resetValues();
$inheritStor->setValue('previous', [$totalPoint, null]);
}