nation_env 수정, $connect 일부 제거

This commit is contained in:
2020-05-06 01:53:00 +09:00
parent 562c69307e
commit e0c908d88f
26 changed files with 416 additions and 811 deletions
+2 -6
View File
@@ -221,13 +221,9 @@ class che_임관 extends Command\GeneralCommand{
$nationList = $db->query('SELECT nation,`name`,color,scout,gennum FROM nation');
shuffle($nationList);
$nationList = Util::convertArrayToDict($nationList, 'nation');
$nationStor = KVStorage::getStorage($db, 'nation_env');
//NOTE: join 안할것임
$scoutMsgs = $nationStor->getValues(array_map(function($nationID){
return "nation_scout_msg_{$nationID}";
}, array_keys($nationList)));
foreach($scoutMsgs as $nationIDPack=>$scoutMsg){
$nationID = Util::toInt(Util::array_last(explode('_', $nationIDPack)));
$scoutMsgs = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'scout_msg');
foreach($scoutMsgs as $nationID=>$scoutMsg){
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
}
+7 -7
View File
@@ -18,7 +18,6 @@ use function sammo\buildNationTypeClass;
use function sammo\refreshNationStaticInfo;
use function sammo\GetNationColors;
use function sammo\getAllNationStaticInfo;
use function sammo\DeleteConflict;
use function sammo\deleteNation;
@@ -87,19 +86,20 @@ class che_해산 extends Command\GeneralCommand{
$general->increaseVarWithLimit('gold', 0, 0, GameConst::$defaultGold);
$general->increaseVarWithLimit('rice', 0, 0, GameConst::$defaultRice);
DeleteConflict($nationID);
deleteNation($general);
refreshNationStaticInfo();
$logger = $general->getLogger();
$logger->pushGeneralActionLog("세력을 해산했습니다. <1>$date</>");
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 세력을 해산했습니다.");
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>{$josaUl} 해산");
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
$oldNationGenerals = deleteNation($general, false);
foreach($oldNationGenerals as $oldGeneral){
$oldGeneral->setVar('makelimit', 12);
$oldGeneral->applyDB($db);
}
$general->applyDB($db);
return true;
+3 -2
View File
@@ -142,10 +142,11 @@ class che_천도 extends Command\NationCommand
$lastTurn = $this->getLastTurn();
$commandName = $this->getName();
$nationStor = \sammo\KVStorage::getStorage(DB::db(), 'nation_env');
$general = $this->getGeneral();
$nationID = $general->getNationID();
$nationStor->setValue("last천도Trial_{$nationID}", [$general->getVar('officer_level'), $general->getTurnTime()]);
$nationStor = \sammo\KVStorage::getStorage(DB::db(), $nationID, 'nation_env');
$nationStor->last천도Trial = [$general->getVar('officer_level'), $general->getTurnTime()];
if ($lastTurn->getCommand() != $commandName || $lastTurn->getArg() !== $this->arg) {
$this->setResultTurn(new LastTurn(