From 30297454f700a895127379edb876cd1244b380ee Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 28 Oct 2025 20:15:05 +0000 Subject: [PATCH] =?UTF-8?q?refac:=20inheritance=5Fresult=EB=A1=9C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=9D=B4=EA=B4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/Join.php | 2 +- hwe/sammo/InheritancePointManager.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/API/General/Join.php b/hwe/sammo/API/General/Join.php index 4b3a6142..bc20229c 100644 --- a/hwe/sammo/API/General/Join.php +++ b/hwe/sammo/API/General/Join.php @@ -99,7 +99,7 @@ class Join extends \sammo\BaseAPI } $gameID = UniqueConst::$serverID; - $alreadyJoined = $db->queryFirstField('SELECT count(*) FROM `storage` WHERE `namespace` = %s AND `key` LIKE %s', 'inheritance_result', "{$gameID}_{$userID}_%"); + $alreadyJoined = $db->queryFirstField('SELECT COUNT(*) FROM `inheritance_result` WHERE `server_id` = %s AND `owner` = %i', $gameID, $userID); if ($alreadyJoined) { //이미 받았음 return 0; diff --git a/hwe/sammo/InheritancePointManager.php b/hwe/sammo/InheritancePointManager.php index 69a4144e..19b92288 100644 --- a/hwe/sammo/InheritancePointManager.php +++ b/hwe/sammo/InheritancePointManager.php @@ -334,11 +334,19 @@ class InheritancePointManager $inheritStor->setValue($key, [$point, $aux]); } - $oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result"); + $db = DB::db(); $serverID = UniqueConst::$serverID; $year = $gameStor->year; $month = $gameStor->month; - $oldInheritStor->setValue("{$serverID}_{$ownerID}_{$general->getID()}_{$year}_{$month}", $inheritStor->getAll(true)); + + $db->insert('inheritance_result', [ + 'owner'=>$ownerID, + 'server'=>$serverID, + 'general_id'=>$general->getID(), + 'year'=>$year, + 'month'=>$month, + 'value'=>$inheritStor->getAll(true) + ]); }