refac: inheritance_result로 데이터 이관

This commit is contained in:
2025-10-28 20:15:05 +00:00
parent bc602722bf
commit 30297454f7
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ class Join extends \sammo\BaseAPI
} }
$gameID = UniqueConst::$serverID; $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) { if ($alreadyJoined) {
//이미 받았음 //이미 받았음
return 0; return 0;
+10 -2
View File
@@ -334,11 +334,19 @@ class InheritancePointManager
$inheritStor->setValue($key, [$point, $aux]); $inheritStor->setValue($key, [$point, $aux]);
} }
$oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result"); $db = DB::db();
$serverID = UniqueConst::$serverID; $serverID = UniqueConst::$serverID;
$year = $gameStor->year; $year = $gameStor->year;
$month = $gameStor->month; $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)
]);
} }