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) + ]); }