General 클래스를 General, GeneralLite로 분리 #236
+1
-1
@@ -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);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -113,7 +113,7 @@ class GetReservedCommand extends \sammo\BaseAPI
|
||||
];
|
||||
}
|
||||
|
||||
$generalObj = General::createObjFromDB($session->generalID, null, GeneralQueryMode::FullWithoutIAction);
|
||||
$generalObj = General::createObjFromDB($session->generalID);
|
||||
|
||||
|
||||
return [
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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']);
|
||||
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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']);
|
||||
|
||||
|
||||
@@ -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']);
|
||||
|
||||
|
||||
@@ -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']);
|
||||
|
||||
|
||||
@@ -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()){
|
||||
|
||||
@@ -95,7 +95,7 @@ class che_필사즉생 extends Command\NationCommand{
|
||||
$broadcastMessage = "<Y>{$generalName}</>{$josaYi} <M>필사즉생</>을 발동하였습니다.";
|
||||
|
||||
$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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user