diff --git a/hwe/process_war.php b/hwe/process_war.php index 83a17c7c..444e1370 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -596,7 +596,7 @@ function ConquerCity(array $admin, General $general, array $city) $lord = new General($db->queryFirstRow( 'SELECT %l FROM general WHERE nation = %i AND officer_level = %i LIMIT 1', - Util::formatListOfBackticks(General::mergeQueryColumn(['npc', 'gold', 'rice', 'experience', 'explevel', 'belong', 'dedication', 'dedlevel', 'aux'], GeneralQueryMode::Lite)[0]), + Util::formatListOfBackticks(General::mergeQueryColumn()[0]), $defenderNationID, 12 ), null, null, $city, $loseNation, $year, $month); diff --git a/hwe/sammo/API/Auction/GetUniqueItemAuctionDetail.php b/hwe/sammo/API/Auction/GetUniqueItemAuctionDetail.php index 16222fb9..782995f3 100644 --- a/hwe/sammo/API/Auction/GetUniqueItemAuctionDetail.php +++ b/hwe/sammo/API/Auction/GetUniqueItemAuctionDetail.php @@ -77,7 +77,7 @@ class GetUniqueItemAuctionDetail extends \sammo\BaseAPI $inheritMgr = InheritancePointManager::getInstance(); //preveious라서 column을 최대한 비울 수 있다. $remainPoint = $inheritMgr->getInheritancePoint( - General::createObjFromDB($generalID, ['owner'], GeneralQueryMode::Core), + General::createObjFromDB($generalID), InheritanceKey::previous ); diff --git a/hwe/sammo/API/Nation/GeneralList.php b/hwe/sammo/API/Nation/GeneralList.php index 4a740589..dcf25d37 100644 --- a/hwe/sammo/API/Nation/GeneralList.php +++ b/hwe/sammo/API/Nation/GeneralList.php @@ -5,8 +5,10 @@ namespace sammo\API\Nation; use ArrayObject; use sammo\DB; use sammo\Enums\APIRecoveryType; +use sammo\Enums\GeneralLiteQueryMode; use sammo\Enums\GeneralQueryMode; use sammo\General; +use sammo\GeneralLite; use sammo\Session; use sammo\Util; @@ -165,7 +167,7 @@ class GeneralList extends \sammo\BaseAPI - [$queryColumns, $rankColumns, $accessLogColumns] = General::mergeQueryColumn(array_keys(static::$viewColumns), GeneralQueryMode::Lite); + [$queryColumns, $rankColumns, $accessLogColumns] = GeneralLite::mergeQueryColumn(array_keys(static::$viewColumns), GeneralLiteQueryMode::Lite); $rawGeneralList = Util::convertArrayToDict( $db->query( diff --git a/hwe/sammo/API/Nation/GetNationInfo.php b/hwe/sammo/API/Nation/GetNationInfo.php index be4a3d86..5133bfd0 100644 --- a/hwe/sammo/API/Nation/GetNationInfo.php +++ b/hwe/sammo/API/Nation/GetNationInfo.php @@ -58,7 +58,7 @@ class GetNationInfo extends \sammo\BaseAPI ]; } - $generalObj = General::createObjFromDB($session->generalID, null, GeneralQueryMode::FullWithoutIAction); + $generalObj = General::createObjFromDB($session->generalID); $gameStor = KVStorage::getStorage($db, 'game_env'); $gameEnv = $gameStor->getValues(['year', 'month', 'startyear']); diff --git a/hwe/sammo/API/NationCommand/GetReservedCommand.php b/hwe/sammo/API/NationCommand/GetReservedCommand.php index 2523a05c..660bb252 100644 --- a/hwe/sammo/API/NationCommand/GetReservedCommand.php +++ b/hwe/sammo/API/NationCommand/GetReservedCommand.php @@ -113,7 +113,7 @@ class GetReservedCommand extends \sammo\BaseAPI ]; } - $generalObj = General::createObjFromDB($session->generalID, null, GeneralQueryMode::FullWithoutIAction); + $generalObj = General::createObjFromDB($session->generalID); return [ diff --git a/hwe/sammo/API/Vote/AddComment.php b/hwe/sammo/API/Vote/AddComment.php index 5c386579..40b1899f 100644 --- a/hwe/sammo/API/Vote/AddComment.php +++ b/hwe/sammo/API/Vote/AddComment.php @@ -6,8 +6,10 @@ use DateTimeInterface; use sammo\DB; use sammo\DTO\VoteComment; use sammo\Enums\APIRecoveryType; +use sammo\Enums\GeneralLiteQueryMode; use sammo\Enums\GeneralQueryMode; use sammo\General; +use sammo\GeneralLite; use sammo\Session; use sammo\TimeUtil; use sammo\Validator; @@ -41,7 +43,7 @@ class AddComment extends \sammo\BaseAPI $text = mb_substr($this->args['text'], 0, 200); $generalID = $session->generalID; - $general = General::createObjFromDB($generalID, null, GeneralQueryMode::Core); + $general = GeneralLite::createObjFromDB($generalID, null, GeneralLiteQueryMode::Core); $generalName = $general->getName(); $nationID = $general->getNationID(); $nationName = $general->getStaticNation()['name']; diff --git a/hwe/sammo/Betting.php b/hwe/sammo/Betting.php index 2fab052a..15619fc1 100644 --- a/hwe/sammo/Betting.php +++ b/hwe/sammo/Betting.php @@ -402,7 +402,7 @@ class Betting $userLogger->flush(); } } else { - $generalList = General::createObjListFromDB(array_unique(Util::squeezeFromArray($rewardList, 'generalID')), ['gold', 'npc', 'betgold'], GeneralQueryMode::Lite); + $generalList = General::createObjListFromDB(array_unique(Util::squeezeFromArray($rewardList, 'generalID'))); foreach ($rewardList as $rewardItem) { $gambler = $generalList[$rewardItem['generalID']]; $reward = Util::round($rewardItem['amount']); diff --git a/hwe/sammo/Command/General/che_선양.php b/hwe/sammo/Command/General/che_선양.php index 2c4d4ecf..9c2ec45e 100644 --- a/hwe/sammo/Command/General/che_선양.php +++ b/hwe/sammo/Command/General/che_선양.php @@ -66,7 +66,7 @@ class che_선양 extends Command\GeneralCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $this->fullConditionConstraints = [ diff --git a/hwe/sammo/Command/General/che_장수대상임관.php b/hwe/sammo/Command/General/che_장수대상임관.php index f33b8850..5f97b9c9 100644 --- a/hwe/sammo/Command/General/che_장수대상임관.php +++ b/hwe/sammo/Command/General/che_장수대상임관.php @@ -84,7 +84,7 @@ class che_장수대상임관 extends Command\GeneralCommand{ protected function initWithArg() { $destGeneralID = $this->arg['destGeneralID']; - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['nation'], GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($destGeneralID); $this->setDestGeneral($destGeneral); $this->setDestNation($this->destGeneralObj->getVar('nation'), ['gennum', 'scout']); diff --git a/hwe/sammo/Command/General/che_증여.php b/hwe/sammo/Command/General/che_증여.php index 97365920..e6e2e6f9 100644 --- a/hwe/sammo/Command/General/che_증여.php +++ b/hwe/sammo/Command/General/che_증여.php @@ -87,7 +87,7 @@ class che_증여 extends Command\GeneralCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $this->fullConditionConstraints = [ diff --git a/hwe/sammo/Command/Nation/che_몰수.php b/hwe/sammo/Command/Nation/che_몰수.php index df4ab98c..9658a6ff 100644 --- a/hwe/sammo/Command/Nation/che_몰수.php +++ b/hwe/sammo/Command/Nation/che_몰수.php @@ -92,7 +92,7 @@ class che_몰수 extends Command\NationCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'npc', 'nation', 'imgsvr', 'picture'], GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $env = $this->env; diff --git a/hwe/sammo/Command/Nation/che_발령.php b/hwe/sammo/Command/Nation/che_발령.php index f7e6439a..7917f796 100644 --- a/hwe/sammo/Command/Nation/che_발령.php +++ b/hwe/sammo/Command/Nation/che_발령.php @@ -72,7 +72,7 @@ class che_발령 extends Command\NationCommand { $this->setDestCity($this->arg['destCityID']); - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); if ($this->arg['destGeneralID'] == $this->getGeneral()->getID()) { diff --git a/hwe/sammo/Command/Nation/che_불가침수락.php b/hwe/sammo/Command/Nation/che_불가침수락.php index 75b1edc4..2056900d 100644 --- a/hwe/sammo/Command/Nation/che_불가침수락.php +++ b/hwe/sammo/Command/Nation/che_불가침수락.php @@ -104,7 +104,7 @@ class che_불가침수락 extends Command\NationCommand $env = $this->env; $relYear = $env['year'] - $env['startyear']; - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $this->setDestNation($this->arg['destNationID']); diff --git a/hwe/sammo/Command/Nation/che_불가침파기수락.php b/hwe/sammo/Command/Nation/che_불가침파기수락.php index 6f397ca6..4b5efebe 100644 --- a/hwe/sammo/Command/Nation/che_불가침파기수락.php +++ b/hwe/sammo/Command/Nation/che_불가침파기수락.php @@ -78,7 +78,7 @@ class che_불가침파기수락 extends Command\NationCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $this->setDestNation($this->arg['destNationID']); diff --git a/hwe/sammo/Command/Nation/che_종전수락.php b/hwe/sammo/Command/Nation/che_종전수락.php index a5a4ae43..2441ee5a 100644 --- a/hwe/sammo/Command/Nation/che_종전수락.php +++ b/hwe/sammo/Command/Nation/che_종전수락.php @@ -87,7 +87,7 @@ class che_종전수락 extends Command\NationCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); $this->setDestNation($this->arg['destNationID']); diff --git a/hwe/sammo/Command/Nation/che_포상.php b/hwe/sammo/Command/Nation/che_포상.php index bded0d39..73791692 100644 --- a/hwe/sammo/Command/Nation/che_포상.php +++ b/hwe/sammo/Command/Nation/che_포상.php @@ -82,7 +82,7 @@ class che_포상 extends Command\NationCommand protected function initWithArg() { - $destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite); + $destGeneral = General::createObjFromDB($this->arg['destGeneralID']); $this->setDestGeneral($destGeneral); if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ diff --git a/hwe/sammo/Command/Nation/che_필사즉생.php b/hwe/sammo/Command/Nation/che_필사즉생.php index 4383eab4..ed7662f1 100644 --- a/hwe/sammo/Command/Nation/che_필사즉생.php +++ b/hwe/sammo/Command/Nation/che_필사즉생.php @@ -95,7 +95,7 @@ class che_필사즉생 extends Command\NationCommand{ $broadcastMessage = "{$generalName}{$josaYi} 필사즉생을 발동하였습니다."; $targetGeneralList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND no != %i', $nationID, $generalID); - foreach(General::createObjListFromDB($targetGeneralList, ['train', 'atmos'], GeneralQueryMode::Lite) as $targetGeneral){ + foreach(General::createObjListFromDB($targetGeneralList) as $targetGeneral){ $targetGeneral->getLogger()->pushGeneralActionLog($broadcastMessage, ActionLogger::PLAIN); if($targetGeneral->getVar('train') < 100){ $targetGeneral->setVar('train', 100); diff --git a/hwe/sammo/DiplomaticMessage.php b/hwe/sammo/DiplomaticMessage.php index dc08c81f..7d9a2596 100644 --- a/hwe/sammo/DiplomaticMessage.php +++ b/hwe/sammo/DiplomaticMessage.php @@ -76,7 +76,7 @@ class DiplomaticMessage extends Message{ $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); - $destGeneralObj = General::createObjFromDB($this->dest->generalID, ['picture', 'imgsvr', 'aux'], GeneralQueryMode::Lite); + $destGeneralObj = General::createObjFromDB($this->dest->generalID); $commandObj = buildNationCommandClass('che_불가침수락', $destGeneralObj, $gameStor->getAll(true), new LastTurn(), [ 'destNationID'=>$this->src->nationID, @@ -100,7 +100,7 @@ class DiplomaticMessage extends Message{ protected function cancelNA(){ $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); - $destGeneralObj = General::createObjFromDB($this->dest->generalID, ['picture', 'imgsvr', 'aux'], GeneralQueryMode::Lite); + $destGeneralObj = General::createObjFromDB($this->dest->generalID); $commandObj = buildNationCommandClass('che_불가침파기수락', $destGeneralObj, $gameStor->getAll(true), new LastTurn(), [ 'destNationID'=>$this->src->nationID, @@ -122,7 +122,7 @@ class DiplomaticMessage extends Message{ protected function stopWar(){ $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); - $destGeneralObj = General::createObjFromDB($this->dest->generalID, ['picture', 'imgsvr', 'aux'], GeneralQueryMode::Lite); + $destGeneralObj = General::createObjFromDB($this->dest->generalID); $commandObj = buildNationCommandClass('che_종전수락', $destGeneralObj, $gameStor->getAll(true), new LastTurn(), [ 'destNationID'=>$this->src->nationID, diff --git a/hwe/sammo/Event/Action/UpdateNationLevel.php b/hwe/sammo/Event/Action/UpdateNationLevel.php index d92de942..88751956 100644 --- a/hwe/sammo/Event/Action/UpdateNationLevel.php +++ b/hwe/sammo/Event/Action/UpdateNationLevel.php @@ -215,7 +215,7 @@ class UpdateNationLevel extends \sammo\Event\Action } if ($chiefID) { - $chiefObj = General::createObjFromDB($chiefID, ['belong', 'npc', 'aux'], GeneralQueryMode::Lite); + $chiefObj = General::createObjFromDB($chiefID); $chiefObj->increaseInheritancePoint(InheritanceKey::unifier, 250 * $levelDiff); $chiefObj->applyDB($db); }