버그 수정
This commit is contained in:
@@ -234,7 +234,10 @@ abstract class BaseCommand{
|
||||
return static::getName();
|
||||
}
|
||||
|
||||
public function getRawClassName():string{
|
||||
public function getRawClassName(bool $shortName=true):string{
|
||||
if($shortName){
|
||||
return Util::getClassNameFromObj($this);
|
||||
}
|
||||
return static::class;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ use \sammo\{
|
||||
|
||||
|
||||
use function \sammo\{
|
||||
function getNationStaticInfo,
|
||||
getNationStaticInfo,
|
||||
tryUniqueItemLottery
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class GameUnitConstBase{
|
||||
const T_SIEGE = 5;
|
||||
const T_MISC = 6;
|
||||
|
||||
const DEFAULT_CREWTYPE = 0;
|
||||
const DEFAULT_CREWTYPE = 1100;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -886,7 +886,7 @@ class General implements iAction{
|
||||
];
|
||||
|
||||
if($reqColumns === null){
|
||||
return [$fullColumn, static::RANK_COLUMN];
|
||||
return [$fullColumn, array_keys(static::RANK_COLUMN)];
|
||||
}
|
||||
|
||||
$rankColumn = [];
|
||||
@@ -933,14 +933,14 @@ class General implements iAction{
|
||||
|
||||
if($generalIDList === null){
|
||||
$rawGenerals = Util::convertArrayToDict(
|
||||
$db->queryFirstRow('SELECT %l FROM general WHERE 1', Util::formatListOfBackticks($column)),
|
||||
$db->query('SELECT %l FROM general WHERE 1', Util::formatListOfBackticks($column)),
|
||||
'no'
|
||||
);
|
||||
$generalIDList = array_keys($rawGenerals);
|
||||
}
|
||||
else{
|
||||
$rawGenerals = Util::convertArrayToDict(
|
||||
$db->queryFirstRow('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList),
|
||||
$db->query('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList),
|
||||
'no'
|
||||
);
|
||||
}
|
||||
|
||||
+10
-8
@@ -109,6 +109,13 @@ class GeneralAI
|
||||
'color' => '#000000',
|
||||
'name' => '재야',
|
||||
];
|
||||
|
||||
$serverPolicy = KVStorage::getStorage($db, 'autorun_nation_policy_0');
|
||||
$nationPolicy = KVStorage::getStorage($db, "autorun_nation_policy_{$this->nation['nation']}");
|
||||
|
||||
$this->nationPolicy = new AutorunNationPolicy($general, $nationPolicy->getAll(), $serverPolicy->getAll());
|
||||
$this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options']??[]);
|
||||
|
||||
$this->nation['aux'] = Json::decode($this->nation['aux']??'{}');
|
||||
|
||||
$this->leadership = $general->getLeadership();
|
||||
@@ -119,15 +126,10 @@ class GeneralAI
|
||||
$this->fullStrength = $general->getStrength(false);
|
||||
$this->fullIntel = $general->getIntel(false);
|
||||
|
||||
$this->genType = $this::calcGenType($general);
|
||||
|
||||
$this->genType = $this->calcGenType($general);
|
||||
|
||||
$this->calcDiplomacyState();
|
||||
|
||||
$serverPolicy = KVStorage::getStorage($db, 'autorun_nation_policy_0');
|
||||
$nationPolicy = KVStorage::getStorage($db, "autorun_nation_policy_{$this->nation['nation']}");
|
||||
|
||||
$this->nationPolicy = new AutorunNationPolicy($general, $nationPolicy->getAll(), $serverPolicy->getAll());
|
||||
$this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options']??[]);
|
||||
}
|
||||
|
||||
public function getGeneralObj(): General
|
||||
@@ -135,7 +137,7 @@ class GeneralAI
|
||||
return $this->general;
|
||||
}
|
||||
|
||||
protected static function calcGenType(General $general)
|
||||
protected function calcGenType(General $general)
|
||||
{
|
||||
$leadership = $general->getLeadership();
|
||||
$strength = Util::valueFit($general->getStrength(), 1);
|
||||
|
||||
@@ -257,7 +257,8 @@ class ResetHelper{
|
||||
'fiction'=>$fiction,
|
||||
'tnmt_trig'=>$tournament_trig,
|
||||
'prev_winner'=>$prevWinner,
|
||||
'autorun_user'=>$autorun_user
|
||||
'autorun_user'=>$autorun_user,
|
||||
'tournament'=>0,
|
||||
];
|
||||
|
||||
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
|
||||
@@ -283,14 +284,17 @@ class ResetHelper{
|
||||
}
|
||||
$db->insert('general_turn', $turnRows);
|
||||
|
||||
foreach(General::RANK_COLUMN as $rankColumn){
|
||||
$db->insert('rank_data', [
|
||||
|
||||
$rank_data = [];
|
||||
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
|
||||
$rank_data[] = [
|
||||
'general_id'=>$generalID,
|
||||
'nation_id'=>0,
|
||||
'type'=>$rankColumn,
|
||||
'value'=>0
|
||||
]);
|
||||
];
|
||||
}
|
||||
$db->insert('rank_data', $rank_data);
|
||||
}
|
||||
|
||||
foreach($env as $key=>$value){
|
||||
|
||||
@@ -358,7 +358,7 @@ class NPC{
|
||||
}
|
||||
$db->insert('general_turn', $turnRows);
|
||||
|
||||
foreach(\sammo\General::RANK_COLUMN as $rankColumn){
|
||||
foreach(array_keys(\sammo\General::RANK_COLUMN) as $rankColumn){
|
||||
$db->insert('rank_data', [
|
||||
'general_id'=>$this->generalID,
|
||||
'nation_id'=>0,
|
||||
|
||||
Reference in New Issue
Block a user