From 033466edcc185bffe0f8ac28e4ea99b9603606c7 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 13 Apr 2018 01:52:27 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EB=B0=B1=EC=A7=80=20=EC=A0=90?= =?UTF-8?q?=EB=A0=B9=EC=9A=A9=20=EC=98=88=EB=B9=84=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EC=97=90=20'=EC=88=98=EB=8F=84'=EA=B0=80=20=EC=A7=80=EC=A0=95?= =?UTF-8?q?=EB=90=98=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EC=B2=9C=ED=86=B5=20=EA=B0=80=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_gamerule.php | 66 +++++++++++++++++++++++++---------------- hwe/lib.php | 2 +- hwe/process_war.php | 3 +- hwe/sql/schema.sql | 2 +- hwe/templates/error.php | 2 +- 5 files changed, 46 insertions(+), 29 deletions(-) diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index e0242264..8959e79b 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -1294,31 +1294,47 @@ function checkEmperior() { $nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']); - $query = " - insert into emperior ( - phase, - nation_count, nation_name, nation_hist, - gen_count, personal_hist, special_hist, - name, type, color, year, month, power, gennum, citynum, - pop, poprate, gold, rice, - l12name, l12pic, l11name, l11pic, - l10name, l10pic, l9name, l9pic, - l8name, l8pic, l7name, l7pic, - l6name, l6pic, l5name, l5pic, - tiger, eagle, gen, history - ) values ( - '-', - '$statNC', '{$statNation['nation_name']}', '{$statNation['nation_hist']}', - '$statGC', '{$statGeneral['personal_hist']}', '{$statGeneral['special_hist']}', - '{$nation['name']}', '{$nation['type']}', '{$nation['color']}', '{$admin['year']}', '{$admin['month']}', '{$nation['power']}', '{$nation['gennum']}', '$allcount', - '$pop', '$poprate', '{$nation['gold']}', '{$nation['rice']}', - '{$level12['name']}', '{$level12['picture']}', '{$level11['name']}', '{$level11['picture']}', - '{$level10['name']}', '{$level10['picture']}', '{$level9['name']}', '{$level9['picture']}', - '{$level8['name']}', '{$level8['picture']}', '{$level7['name']}', '{$level7['picture']}', - '{$level6['name']}', '{$level6['picture']}', '{$level5['name']}', '{$level5['picture']}', - '$tigerstr', '$eaglestr', '$gen', '{$nationHistory}' - )"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $db->insert('emperior', [ + 'phase'=>'-', + 'nation_count'=>$statNC, + 'nation_name'=>$statNation['nation_name'], + 'nation_hist'=>$statNation['nation_hist'], + 'gen_count'=>$statGC, + 'personal_hist'=>$statGeneral['personal_hist'], + 'special_hist'=>$statGeneral['special_hist'], + 'name'=>$nation['name'], + 'type'=>$nation['type'], + 'color'=>$nation['color'], + 'year'=>$admin['year'], + 'month'=>$admin['month'], + 'power'=>$nation['power'], + 'gennum'=>$nation['gennum'], + 'citynum'=>$allcount, + 'pop'=>$pop, + 'poprate'=>$poprate, + 'gold'=>$nation['gold'], + 'rice'=>$nation['rice'], + 'l12name'=>$level12['name'], + 'l12pic'=>$level12['picture'], + 'l11name'=>$level11['name'], + 'l11pic'=>$level11['picture'], + 'l10name'=>$level10['name'], + 'l10pic'=>$level10['picture'], + 'l9name'=>$level9['name'], + 'l9pic'=>$level9['picture'], + 'l8name'=>$level8['name'], + 'l8pic'=>$level8['picture'], + 'l7name'=>$level7['name'], + 'l7pic'=>$level7['picture'], + 'l6name'=>$level6['name'], + 'l6pic'=>$level6['picture'], + 'l5name'=>$level5['name'], + 'l5pic'=>$level5['picture'], + 'tiger'=>$tigerstr, + 'eagle'=>$eaglestr, + 'gen'=>$gen, + 'history'=>$nationHistory + ]); $history = ["●{$admin['year']}년 {$admin['month']}월:【통일】{$nation['name']}(이)가 전토를 통일하였습니다."]; pushWorldHistory($history, $admin['year'], $admin['month']); diff --git a/hwe/lib.php b/hwe/lib.php index 929b2cde..be4ac818 100644 --- a/hwe/lib.php +++ b/hwe/lib.php @@ -55,7 +55,7 @@ session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 //FIXME: 이곳에서 설정하면 안될 듯 하다. 옮기자. // 에러 메세지 출력 -function Error($message, $url="") +function Error($message='', $url="") { if (!$url) { $url = $_SERVER['REQUEST_URI']; diff --git a/hwe/process_war.php b/hwe/process_war.php index cad21178..0d9e91a1 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -88,6 +88,7 @@ function processWar($general, $city) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $destnation = MYDB_fetch_array($result) ?: [ 'nation'=>0, + 'capital'=>0, 'level'=>0, 'rice'=>2000, 'type'=>0, @@ -1866,7 +1867,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) { ], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]); //수도였으면 긴급 천도 - if($destnation['capital'] == $city['city']) { + if(!isset($destnation['capital']) && $destnation['capital'] == $city['city']) { $minCity = findNextCapital($city['city'], $destnation['nation']); $minCityName = CityConst::byID($minCity)->name; diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index d4430282..bb181b98 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -462,7 +462,7 @@ create table if not exists emperior ( special_hist text default '', name char(64) default '', type char(64) default '', - color char(6) default '', + color char(7) default '', year int(4) default 0, month int(2) default 0, power int(8) default 0, diff --git a/hwe/templates/error.php b/hwe/templates/error.php index 74a76ed1..b36fb030 100644 --- a/hwe/templates/error.php +++ b/hwe/templates/error.php @@ -22,7 +22,7 @@
- message?> +