diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 5817255a..6cfa2985 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -187,6 +187,11 @@ function popIncrease($connect) { } function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) { + $level2 = []; + $level3 = []; + $level4 = []; + + $query = "select no,city from general where nation='$nationNo' and level=4"; // 태수 $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $count = MYDB_num_rows($result); @@ -225,9 +230,9 @@ function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) { $tax1 = ($city['pop'] * $city['comm'] / $city['comm2'] * $ratio / 1000) / 3; $tax1 *= (1 + $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 추가 //도시 관직 추가 세수 - if($level4[$city['gen1']] == $city['city']) { $tax1 *= 1.05; } - if($level3[$city['gen2']] == $city['city']) { $tax1 *= 1.05; } - if($level2[$city['gen3']] == $city['city']) { $tax1 *= 1.05; } + if(Util::array_get($level4[$city['gen1']]) == $city['city']) { $tax1 *= 1.05; } + if(Util::array_get($level3[$city['gen2']]) == $city['city']) { $tax1 *= 1.05; } + if(Util::array_get($level2[$city['gen3']]) == $city['city']) { $tax1 *= 1.05; } //수도 추가 세수 130%~105% if($city['city'] == $nation['capital']) { $tax1 *= 1+(1/3/$nation['level']); }; diff --git a/hwe/j_basic_info.php b/hwe/j_basic_info.php index ba5e0171..b2d8fd8e 100644 --- a/hwe/j_basic_info.php +++ b/hwe/j_basic_info.php @@ -2,22 +2,21 @@ namespace sammo; include('lib.php'); -include('func.php'); $result = [ "generalID"=>null, "myNationID"=>null, "isChief"=>false ]; -$generalID = Session::Instance()->generalID; +$session = Session::Instance()->loginGame()->setReadOnly(); -session_write_close(); +$generalID = $session->generalID; if(!$generalID){ Json::die($result); } -$generalInfo = DB::db()->queryFirstRow('SELECT `nation`, `level` from `general` where `id`=%i', $generalID); +$generalInfo = DB::db()->queryFirstRow('SELECT `nation`, `level` from `general` where `no`=%i', $generalID); if(!$generalInfo){ Json::die($result); } diff --git a/hwe/js/map.js b/hwe/js/map.js index 67f074dc..00d441c5 100644 --- a/hwe/js/map.js +++ b/hwe/js/map.js @@ -33,21 +33,21 @@ function reloadWorldMap(option){ var cityPosition = getCityPosition(); //OBJ : startYear, year, month, cityList, nationList, spyList, shownByGeneralList, myCity - - - var deferred; function checkReturnObject(obj){ if(!obj.result){ - deferred.reject(); - return; + var obj = $.Deferred(); + obj.reject('fail'); + return obj.promise(); } if(!$.isNumeric(obj.startYear) ||!$.isNumeric(obj.year) - ||!$.isNumeric(obj.month)){ - deferred.reject(); - return; + ||!$.isNumeric(obj.month) + ){ + var obj = $.Deferred(); + obj.reject('fail'); + return obj.promise(); } return obj; @@ -504,7 +504,7 @@ function reloadWorldMap(option){ } //deferred mode of jQuery. != promise-then. - deferred = $.ajax({ + var deferred = $.ajax({ url: option.targetJson, type: 'post', dataType:'json', diff --git a/hwe/sammo/Event/Action/DeleteEvent.php b/hwe/sammo/Event/Action/DeleteEvent.php index 3483ca4f..a6cc98bf 100644 --- a/hwe/sammo/Event/Action/DeleteEvent.php +++ b/hwe/sammo/Event/Action/DeleteEvent.php @@ -7,7 +7,7 @@ class DeleteEvent extends \sammo\Event\Action{ public function __construct(){ } - public function run($env){ + public function run($env=null){ $eventID = \sammo\Util::array_get($env['currentEventID']); if(!$eventID){ diff --git a/hwe/sammo/Event/Action/RegNPC.php b/hwe/sammo/Event/Action/RegNPC.php index cb6208eb..84f8070b 100644 --- a/hwe/sammo/Event/Action/RegNPC.php +++ b/hwe/sammo/Event/Action/RegNPC.php @@ -11,7 +11,7 @@ class RegNPC extends \sammo\Event\Action{ string $name, int $pictureID, int $nationID, - string $locatedCity, + $locatedCity, int $leadership, int $power, int $intel, diff --git a/hwe/sammo/Event/Condition/Date.php b/hwe/sammo/Event/Condition/Date.php index a0d5ea5e..23acff06 100644 --- a/hwe/sammo/Event/Condition/Date.php +++ b/hwe/sammo/Event/Condition/Date.php @@ -33,7 +33,7 @@ class Date extends \sammo\Event\Condition{ $this->month = $month; } - public function eval(array $env=null){ + public function eval($env=null){ if($env === null){ return [ 'value'=>false, @@ -50,7 +50,7 @@ class Date extends \sammo\Event\Condition{ } $lhs = [ - $this->$year, + $this->year, $this->month ]; $rhs = [ diff --git a/src/sammo/Session.php b/src/sammo/Session.php index f9752ba9..181b24a9 100644 --- a/src/sammo/Session.php +++ b/src/sammo/Session.php @@ -118,10 +118,10 @@ class Session { public function __get(string $name){ if($name == 'generalID'){ - return $this->get(DB::prefix().static::GAME_KEY_GENERAL_ID); + return $this->get(UniqueConst::$serverID.static::GAME_KEY_GENERAL_ID); } if($name == 'generalName'){ - return $this->get(DB::prefix().static::GAME_KEY_GENERAL_NAME); + return $this->get(UniqueConst::$serverID.static::GAME_KEY_GENERAL_NAME); } return $this->get($name); }