diff --git a/twe/func_converter.php b/twe/func_converter.php index 102e36a6..9e2265c4 100644 --- a/twe/func_converter.php +++ b/twe/func_converter.php @@ -1,5 +1,7 @@ setReadOnly(); if($session->userGrade < 5){ Json::die([ diff --git a/twe/sammo/Scenario.php b/twe/sammo/Scenario.php index af30c0fa..b5afb8f7 100644 --- a/twe/sammo/Scenario.php +++ b/twe/sammo/Scenario.php @@ -238,7 +238,9 @@ class Scenario{ 'title'=>$this->getTitle(), 'npc_cnt'=>count($this->getNPC()), 'npcEx_cnt'=>count($this->getNPCex()), - 'nation'=>$this->getNation() + 'nation'=>array_map(function($nation){ + return $nation->getBrief(); + },$this->getNation()) ]; } diff --git a/twe/sammo/Scenario/NPC.php b/twe/sammo/Scenario/NPC.php index e4dff203..5059fc47 100644 --- a/twe/sammo/Scenario/NPC.php +++ b/twe/sammo/Scenario/NPC.php @@ -26,7 +26,7 @@ class NPC{ string $name, int $pictureID, int $nationID, - string $locatedCity, + $locatedCity, //FIXME: 7.1로 올릴 때 ?string 으로 변경 int $leadership, int $power, int $intel, diff --git a/twe/sammo/Scenario/Nation.php b/twe/sammo/Scenario/Nation.php index 268d28d5..7f04417e 100644 --- a/twe/sammo/Scenario/Nation.php +++ b/twe/sammo/Scenario/Nation.php @@ -117,4 +117,21 @@ class Nation{ } $db->insert('diplomacy', $diplomacy); } + + public function getBrief(){ + return [ + 'id'=>$this->id, + 'name'=>$this->name, + 'color'=>$this->color, + 'gold'=>$this->gold, + 'rice'=>$this->rice, + 'infoText'=>$this->infoText, + 'tech'=>$this->tech, + 'type'=>$this->type, + 'nationLevel'=>$this->nationLevel, + 'cities'=>$this->cities, + 'generals'=>count($this->generals), + 'generalsEx'=>count($this->generalsEx) + ]; + } } \ No newline at end of file