공백지 점령용 예비 코드에 '수도'가 지정되지 않은 문제 해결

천통 가능
This commit is contained in:
2018-04-13 01:52:27 +09:00
parent 3a472506cf
commit 033466edcc
5 changed files with 46 additions and 29 deletions
+41 -25
View File
@@ -1294,31 +1294,47 @@ function checkEmperior() {
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']); $nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
$query = " $db->insert('emperior', [
insert into emperior ( 'phase'=>'-',
phase, 'nation_count'=>$statNC,
nation_count, nation_name, nation_hist, 'nation_name'=>$statNation['nation_name'],
gen_count, personal_hist, special_hist, 'nation_hist'=>$statNation['nation_hist'],
name, type, color, year, month, power, gennum, citynum, 'gen_count'=>$statGC,
pop, poprate, gold, rice, 'personal_hist'=>$statGeneral['personal_hist'],
l12name, l12pic, l11name, l11pic, 'special_hist'=>$statGeneral['special_hist'],
l10name, l10pic, l9name, l9pic, 'name'=>$nation['name'],
l8name, l8pic, l7name, l7pic, 'type'=>$nation['type'],
l6name, l6pic, l5name, l5pic, 'color'=>$nation['color'],
tiger, eagle, gen, history 'year'=>$admin['year'],
) values ( 'month'=>$admin['month'],
'-', 'power'=>$nation['power'],
'$statNC', '{$statNation['nation_name']}', '{$statNation['nation_hist']}', 'gennum'=>$nation['gennum'],
'$statGC', '{$statGeneral['personal_hist']}', '{$statGeneral['special_hist']}', 'citynum'=>$allcount,
'{$nation['name']}', '{$nation['type']}', '{$nation['color']}', '{$admin['year']}', '{$admin['month']}', '{$nation['power']}', '{$nation['gennum']}', '$allcount', 'pop'=>$pop,
'$pop', '$poprate', '{$nation['gold']}', '{$nation['rice']}', 'poprate'=>$poprate,
'{$level12['name']}', '{$level12['picture']}', '{$level11['name']}', '{$level11['picture']}', 'gold'=>$nation['gold'],
'{$level10['name']}', '{$level10['picture']}', '{$level9['name']}', '{$level9['picture']}', 'rice'=>$nation['rice'],
'{$level8['name']}', '{$level8['picture']}', '{$level7['name']}', '{$level7['picture']}', 'l12name'=>$level12['name'],
'{$level6['name']}', '{$level6['picture']}', '{$level5['name']}', '{$level5['picture']}', 'l12pic'=>$level12['picture'],
'$tigerstr', '$eaglestr', '$gen', '{$nationHistory}' 'l11name'=>$level11['name'],
)"; 'l11pic'=>$level11['picture'],
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); '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 = ["<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."]; $history = ["<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
pushWorldHistory($history, $admin['year'], $admin['month']); pushWorldHistory($history, $admin['year'], $admin['month']);
+1 -1
View File
@@ -55,7 +55,7 @@ session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야
//FIXME: 이곳에서 설정하면 안될 듯 하다. 옮기자. //FIXME: 이곳에서 설정하면 안될 듯 하다. 옮기자.
// 에러 메세지 출력 // 에러 메세지 출력
function Error($message, $url="") function Error($message='', $url="")
{ {
if (!$url) { if (!$url) {
$url = $_SERVER['REQUEST_URI']; $url = $_SERVER['REQUEST_URI'];
+2 -1
View File
@@ -88,6 +88,7 @@ function processWar($general, $city) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destnation = MYDB_fetch_array($result) ?: [ $destnation = MYDB_fetch_array($result) ?: [
'nation'=>0, 'nation'=>0,
'capital'=>0,
'level'=>0, 'level'=>0,
'rice'=>2000, 'rice'=>2000,
'type'=>0, 'type'=>0,
@@ -1866,7 +1867,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) {
], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]); ], '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']); $minCity = findNextCapital($city['city'], $destnation['nation']);
$minCityName = CityConst::byID($minCity)->name; $minCityName = CityConst::byID($minCity)->name;
+1 -1
View File
@@ -462,7 +462,7 @@ create table if not exists emperior (
special_hist text default '', special_hist text default '',
name char(64) default '', name char(64) default '',
type char(64) default '', type char(64) default '',
color char(6) default '', color char(7) default '',
year int(4) default 0, year int(4) default 0,
month int(2) default 0, month int(2) default 0,
power int(8) default 0, power int(8) default 0,
+1 -1
View File
@@ -22,7 +22,7 @@
<button style='width:200px;height:2em;font-size:1.2em;' onclick="location.replace('./')"> 눌러주세요</button> <button style='width:200px;height:2em;font-size:1.2em;' onclick="location.replace('./')"> 눌러주세요</button>
</div> </div>
<div class="with_border"> <div class="with_border">
<?=$this->message?> <?=$message?>
</div> </div>
<div class="with_border"> <div class="with_border">
<pre> <pre>