Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ff9ca3c99 | ||
|
|
fe55df8b2f | ||
|
|
457f605898 | ||
|
|
0f2625133f | ||
|
|
fa34dbdf6f | ||
|
|
050913b0b4 | ||
|
|
a47e47d42c | ||
|
|
43d994b59a | ||
|
|
e8204d46ce | ||
|
|
fece659cfb | ||
|
|
695265b299 | ||
|
|
b652ed0b33 | ||
|
|
9a641552e4 | ||
|
|
3d18aeb5bc | ||
|
|
b545afce50 | ||
|
|
8fca98c0c9 | ||
|
|
0a98c71dfe | ||
|
|
ed75f39094 | ||
|
|
456245f23a | ||
|
|
b4529c9338 | ||
|
|
0ca7a8ab8a | ||
|
|
02f2209e8f | ||
|
|
fb72d02912 | ||
|
|
665fb25fc1 | ||
|
|
742c3c7156 | ||
|
|
637dbbba0d | ||
|
|
f2a3bc4626 | ||
|
|
e8ffa44544 | ||
|
|
bc09287666 | ||
|
|
392d9055fe | ||
|
|
0ee833d7ae | ||
|
|
3074bc00d7 | ||
|
|
cb6fb590c4 | ||
|
|
a7270b2cd2 | ||
|
|
0d925af065 | ||
|
|
7c7991e8ae | ||
|
|
54461b6ea4 | ||
|
|
6a17497fbd | ||
|
|
84f18aa4b6 | ||
|
|
73ab38563f | ||
|
|
1f2b40e4d4 | ||
|
|
1d920c5935 | ||
|
|
037a1e9c0c | ||
|
|
87e324d4d9 | ||
|
|
d1e9b489e3 | ||
|
|
34f1d538d1 | ||
|
|
fb8d2a2e01 | ||
|
|
837db5183e | ||
|
|
a556877a17 | ||
|
|
bcbd6dc4db | ||
|
|
41f7ad8d75 | ||
|
|
258d4b28da | ||
|
|
31e900c422 | ||
|
|
7b1a76871a | ||
|
|
c6f3e7672f | ||
|
|
540c31903c | ||
|
|
3e5262d7a3 | ||
|
|
2b36ffef45 | ||
|
|
4c25d2275c | ||
|
|
6c66fcdfc3 | ||
|
|
aaa972d767 | ||
|
|
45c8538426 | ||
|
|
95702724a9 | ||
|
|
98c4d3853c | ||
|
|
7c91143f39 | ||
|
|
56e6f57568 | ||
|
|
ccab456679 | ||
|
|
5af000ca43 | ||
|
|
354c8f04ae | ||
|
|
3fbd336b45 | ||
|
|
3c0b86a322 | ||
|
|
fca4b69d5a | ||
|
|
ce62072761 | ||
|
|
93dd7a8478 | ||
|
|
02fb84a312 | ||
|
|
f3e68989e5 | ||
|
|
468050a9ce | ||
|
|
f37a602da3 | ||
|
|
2979691d7e | ||
|
|
72920a0432 | ||
|
|
e81075ef04 | ||
|
|
df1a99d877 | ||
|
|
10e825dc9f | ||
|
|
07ba7933fb | ||
|
|
3059eac0fd | ||
|
|
aa33aa6d4f | ||
|
|
0a1cdeeaa3 | ||
|
|
e4bef47b7e | ||
|
|
f551f994b5 | ||
|
|
4b7a3af691 | ||
|
|
6f88a80118 | ||
|
|
e03715ee46 |
@@ -89,4 +89,78 @@ input.with_skin:disabled {
|
||||
|
||||
caption.section_title {
|
||||
caption-side:top;
|
||||
}
|
||||
|
||||
|
||||
.samButton{
|
||||
float:left;
|
||||
display:block;
|
||||
padding:0;
|
||||
margin:0;
|
||||
text-decoration: none;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
a.samButton.disabled {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.samButtonOuter{
|
||||
display: table;
|
||||
border: outset 2px white;
|
||||
box-sizing: border-box;
|
||||
font-weight:bold;
|
||||
padding: 1px 6px;
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#000000;
|
||||
color:#ffffff;
|
||||
}
|
||||
|
||||
.samButtonOuter:active{
|
||||
border: inset 2px white;
|
||||
}
|
||||
|
||||
|
||||
.samButtonInner{
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.samToolbarButton > .samButtonOuter{
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#225500;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.samToolbarButton2 > .samButtonOuter{
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#225500;
|
||||
color:magenta;
|
||||
}
|
||||
|
||||
.samCommandButton > .samButtonOuter{
|
||||
width:111px;
|
||||
height:30px;
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter{
|
||||
background-color:transparent !important;
|
||||
color:gray !important;
|
||||
border-color:transparent !important;
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::before{
|
||||
content:'【'
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
|
||||
content:'】'
|
||||
}
|
||||
|
After Width: | Height: | Size: 341 B |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 386 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@@ -8,12 +8,14 @@ require(__dir__.'/../vendor/autoload.php');
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>설치</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/sha512.min.js')?>
|
||||
<?=WebUtil::printJS('../js/common.js')?>
|
||||
<?=WebUtil::printJS('../js/install.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../css/install.css')?>
|
||||
|
||||
@@ -41,18 +41,44 @@
|
||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_spring .map_body{
|
||||
background: url('_tK_gameImagePath_/map1.jpg') no-repeat;
|
||||
/*체 지도*/
|
||||
.map_theme_che.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_summer .map_body{
|
||||
background: url('_tK_gameImagePath_/map2.jpg') no-repeat;
|
||||
.map_theme_che.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_fall .map_body{
|
||||
background: url('_tK_gameImagePath_/map3.jpg') no-repeat;
|
||||
.map_theme_che.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_winter .map_body{
|
||||
background: url('_tK_gameImagePath_/map4.jpg') no-repeat;
|
||||
.map_theme_che.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_che .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/che_road.png') no-repeat;
|
||||
}
|
||||
|
||||
/*미니체 지도*/
|
||||
.map_theme_miniche.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||
}
|
||||
@@ -11,7 +11,9 @@ if($session->userGrade < 4) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -28,7 +30,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
list($turntime, $tnmt_time) = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
[$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
|
||||
$query = "select plock from plock";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -38,7 +40,9 @@ $plock = MYDB_fetch_array($result);
|
||||
<html>
|
||||
<head>
|
||||
<title>삼국지 모의전투 HiDCHe</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -34,7 +36,9 @@ $admin = getAdmin();
|
||||
<html>
|
||||
<head>
|
||||
<title>게임관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -32,7 +34,9 @@ $db = DB::db();
|
||||
<html>
|
||||
<head>
|
||||
<title>회원관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -54,7 +58,7 @@ $db = DB::db();
|
||||
<?php
|
||||
|
||||
echo "
|
||||
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
|
||||
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
|
||||
$generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)');
|
||||
|
||||
foreach($generalList as $general){
|
||||
@@ -72,7 +76,7 @@ echo "
|
||||
</td>
|
||||
<td width=100 align=center>아이템 지급</td>
|
||||
<td width=504>
|
||||
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
|
||||
<select name=weap size=1 style='color:white;background-color:black;font-size:13px'>";
|
||||
for($i=0; $i < 27; $i++) {
|
||||
echo "
|
||||
<option value={$i}>{$i}</option>";
|
||||
|
||||
@@ -93,13 +93,13 @@ switch($btn) {
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db->update('general', [
|
||||
'turn0'=>0,
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 0),
|
||||
'killturn'=>0,
|
||||
'turntime'=>$date,
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "특기 부여":
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
$text = "특기 부여!";
|
||||
|
||||
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
||||
@@ -314,13 +314,13 @@ switch($btn) {
|
||||
break;
|
||||
case "하야입력":
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000045'
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 45)
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "방랑해산":
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000047',
|
||||
'turn1'=>'00000000000056'
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 47),
|
||||
'turn1'=>EncodeCommand(0, 0, 0, 56)
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "NPC설정":
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -35,7 +37,9 @@ $conlimit = $gameStor->conlimit;
|
||||
<html>
|
||||
<head>
|
||||
<title>멀티관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -51,14 +55,9 @@ $conlimit = $gameStor->conlimit;
|
||||
<?php
|
||||
|
||||
echo "
|
||||
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
|
||||
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
|
||||
|
||||
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
|
||||
$style = "style=;";
|
||||
if($general['block'] > 0) { $style .= "background-color:red;"; }
|
||||
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
|
||||
|
||||
@@ -52,7 +52,7 @@ switch($btn) {
|
||||
break;
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
DB::db()->query('update general set turn0=0,killturn=0,turntime=%s where no IN %li',$date, $genlist);
|
||||
DB::db()->query('update general set turn0=%s,killturn=0,turntime=%s where no IN %li',EncodeCommand(0, 0, 0, 0),$date, $genlist);
|
||||
break;
|
||||
case "메세지 전달":
|
||||
//TODO:새 갠메 시스템으로 변경
|
||||
|
||||
@@ -25,7 +25,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -51,7 +53,9 @@ $sel2[$type2] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>일제정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -19,7 +19,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -42,7 +44,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>접속정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -23,7 +23,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -49,7 +51,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>로그정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -19,7 +19,9 @@ if ($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -45,7 +47,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>외교정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -1140,7 +1140,9 @@ switch($dex240) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title>전투시뮬레이션</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -22,11 +22,18 @@ increaseRefresh("명장일람", 1);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1136" />
|
||||
<title><?=UniqueConst::$serverName?>: 명장일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -67,22 +74,83 @@ $types = [
|
||||
}],
|
||||
["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }],
|
||||
["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }],
|
||||
["승 률", "percent", function($v){$v['value'] = $v['killnum'] / max(1, $v['warnum']); return $v; }],
|
||||
["승 률", "percent", function($v){
|
||||
if($v['warnum'] < 10){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['killnum'] / max(1, $v['warnum']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
|
||||
["살 상 률", "percent", function($v){$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); return $v; }],
|
||||
["살 상 률", "percent", function($v){
|
||||
if($v['warnum'] < 10){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex0']; return $v; }],
|
||||
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex10']; return $v; }],
|
||||
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex20']; return $v; }],
|
||||
["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex30']; return $v; }],
|
||||
["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex40']; return $v; }],
|
||||
["전 력 전 승 률", "percent", function($v){$v['value'] = $v['ttw']/max(1, $v['ttw']+$v['ttd']+$v['ttl']); return $v; }],
|
||||
["통 솔 전 승 률", "percent", function($v){$v['value'] = $v['tlw']/max(1, $v['tlw']+$v['tld']+$v['tll']); return $v; }],
|
||||
["일 기 토 승 률", "percent", function($v){$v['value'] = $v['tpw']/max(1, $v['tpw']+$v['tpd']+$v['tpl']); return $v; }],
|
||||
["설 전 승 률", "percent", function($v){$v['value'] = $v['tiw']/max(1, $v['tiw']+$v['tid']+$v['til']); return $v; }],
|
||||
["전 력 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['ttw']+$v['ttd']+$v['ttl'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['ttw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["통 솔 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tlw']+$v['tld']+$v['tll'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tlw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["일 기 토 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tpw']+$v['tpd']+$v['tpl'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tpw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["설 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tiw']+$v['tid']+$v['til'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tiw']/max(1, $totalCnt);
|
||||
}
|
||||
|
||||
return $v;
|
||||
}],
|
||||
["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }],
|
||||
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
|
||||
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){$v['value'] = $v['betwingold']/max(1, $v['betgold']); return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){
|
||||
if($v['betgold'] < 1000){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['betwingold']/max(1, $v['betgold']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
];
|
||||
|
||||
$generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
@@ -112,10 +180,15 @@ $generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc){
|
||||
$validCnt = 0;
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){
|
||||
$general = ($typeFunc)($general);
|
||||
$value = $general['value'];
|
||||
|
||||
if($value > 0){
|
||||
$validCnt+=1;
|
||||
}
|
||||
|
||||
if($typeValue == 'percent'){
|
||||
$general['printValue'] = number_format($value*100, 2).'%';
|
||||
}
|
||||
@@ -130,9 +203,10 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
return -($lhs['value'] <=> $rhs['value']);
|
||||
});
|
||||
|
||||
|
||||
echo $templates->render('hallOfFrame', [
|
||||
'typeName'=>$typeName,
|
||||
'generals'=>array_slice($typeGenerals, 0, 10)
|
||||
'generals'=>array_slice($typeGenerals, 0, min(10, $validCnt))
|
||||
]);
|
||||
}
|
||||
?>
|
||||
@@ -144,7 +218,7 @@ $itemTypes = [
|
||||
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
|
||||
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
|
||||
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return getItemName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return displayItemInfo($v);}, 7, 26, []],
|
||||
];
|
||||
|
||||
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
|
||||
|
||||
@@ -4,12 +4,7 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("왕조일람", 1);
|
||||
?>
|
||||
@@ -17,7 +12,9 @@ increaseRefresh("왕조일람", 1);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -27,35 +24,57 @@ increaseRefresh("왕조일람", 1);
|
||||
<body>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
<button onclick=window.close()>창 닫기</button><br>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
if ($select == 0) {
|
||||
$query = "select * from emperior order by no desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$empcount = MYDB_num_rows($result);
|
||||
$showCurrentNation = true;
|
||||
|
||||
for ($i=0; $i < $empcount; $i++) {
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
$emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC');
|
||||
|
||||
if($emperiors){
|
||||
$serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null);
|
||||
if($serverID == UniqueConst::$serverID){
|
||||
$showCurrentNation = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($showCurrentNation) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td style="background-color:#333333;" align=center colspan=8>
|
||||
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
|
||||
|
||||
<a href="a_emperior_detail.php"><button>자세히</button></a>
|
||||
|
||||
<a href="a_history.php"><button>역사 보기</button></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
foreach($emperiors as $emperior){
|
||||
$serverID = $emperior['server_id']??($emperior['serverID']??null);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
|
||||
<input type=submit value='자세히'>
|
||||
<input type=hidden name=select value='<?=$emperior['no']?>'>
|
||||
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button>자세히</button></a>
|
||||
|
||||
<?php if($emperior['server_id']): ?>
|
||||
<a href="a_history.php?server_id=<?=$emperior['server_id']?>"><button type="button">역사 보기</button></a>
|
||||
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button>역사 보기</button></a>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -88,132 +107,10 @@ if ($select == 0) {
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
die();
|
||||
}
|
||||
|
||||
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
<input type=submit value='전체보기'>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5><?=$emperior['nation_name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5><?=$emperior['nation_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5><?=$emperior['personal_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5><?=$emperior['special_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2><?=$emperior['pop']?></td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2><?=$emperior['poprate']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2><?=$emperior['gold']?></td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2><?=$emperior['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l11name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l7name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5><?=$emperior['tiger']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5><?=$emperior['eagle']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5><?=$emperior['gen']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -17,7 +17,9 @@ increaseRefresh("왕조일람", 2);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates->registerFunction('ConvertLog', '\sammo\ConvertLog');
|
||||
$templates->registerFunction('newColor', '\sammo\newColor');
|
||||
increaseRefresh("왕조일람", 1);
|
||||
|
||||
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
|
||||
$serverID = $emperior['server_id']??($emperior['serverID']??null);
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td><?=$emperior?'역 대 왕 조':'현 재 왕 조'?><br>
|
||||
<button onclick=window.close()>창 닫기</button>
|
||||
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
if($emperior):
|
||||
?>
|
||||
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5><?=$emperior['nation_name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5><?=$emperior['nation_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5><?=$emperior['personal_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5><?=$emperior['special_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2><?=$emperior['pop']?></td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2><?=$emperior['poprate']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2><?=$emperior['gold']?></td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2><?=$emperior['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l11name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l7name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5><?=$emperior['tiger']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5><?=$emperior['eagle']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5><?=$emperior['gen']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
$showServers = $serverID || (!$emperior);
|
||||
|
||||
if(!$serverID){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
}
|
||||
|
||||
if($showServers){
|
||||
$nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID);
|
||||
foreach($nations as $nation){
|
||||
if(!$nation['nation']??null){
|
||||
continue;
|
||||
}
|
||||
$nation += Json::decode($nation['data']);
|
||||
|
||||
$nation['typeName'] = getNationType($nation['type']);
|
||||
$nation['levelName'] = getNationLevel($nation['level']);
|
||||
if($nation['generals']){
|
||||
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
|
||||
|
||||
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
|
||||
$liveGenerals = $nation['generals'];
|
||||
foreach($generals as $general){
|
||||
if(in_array($general['general_no'], $nation['generals'])){
|
||||
unset($nation['generals'][$general['general_no']]);
|
||||
}
|
||||
}
|
||||
$liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals);
|
||||
$nation['generalsFull'] = array_merge($liveGenerals, $generals);
|
||||
}
|
||||
else{
|
||||
$nation['generalsFull'] = $generals;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$nation['generalsFull'] = [];
|
||||
}
|
||||
|
||||
if(key_exists('aux', $nation) && !is_array($nation['aux'])){
|
||||
$nation += Json::decode($nation['aux']);
|
||||
}
|
||||
|
||||
echo $templates->render('oldNation', $nation);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -37,12 +37,17 @@ if ($type <= 0 || $type > 15) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 장수일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -165,8 +170,8 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
<td align=center><img width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
|
||||
<td align=center>$name</td>
|
||||
<td align=center>{$general['age']}세</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".getHonor($general['experience'])."</td>
|
||||
|
||||
@@ -12,7 +12,7 @@ $db = DB::db();
|
||||
increaseRefresh("명예의전당", 1);
|
||||
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT distinct(scenario_name) as name, count(scenario) as cnt, scenario from ng_games order by scenario asc') as $scenarioInfo){
|
||||
foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){
|
||||
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
|
||||
}
|
||||
|
||||
@@ -32,13 +32,19 @@ else{
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1136" />
|
||||
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJs('js/hallOfFame.js')?>
|
||||
</head>
|
||||
|
||||
@@ -92,10 +98,15 @@ foreach($types as $idx=>[$typeName, $typeValue]) {
|
||||
$hallResult = array_map(function($general)use($typeValue){
|
||||
$aux = Json::decode($general['aux']);
|
||||
$general += $aux;
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
|
||||
if(!key_exists('bgColor', $general)){
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
}
|
||||
else{
|
||||
$general['bgColor'] = $general['color'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!key_exists('fgColor', $general)){
|
||||
$general['fgColor'] = newColor($general['bgColor']);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ include "lib.php";
|
||||
include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$yearmonth = Util::getReq('yearmonth', 'int');
|
||||
$serverID = Util::getReq('server_id', 'string', null);
|
||||
$serverID = Util::getReq('serverID', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -25,7 +25,7 @@ if($serverID === UniqueConst::$serverID){
|
||||
increaseRefresh("연감", 1);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','map_theme']);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -45,6 +45,13 @@ $s = $s_year * 12 + $s_month;
|
||||
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
||||
$e = $e_year * 12 + $e_month;
|
||||
|
||||
if($serverID !== UniqueConst::$serverID){
|
||||
$mapTheme = $db->queryFirstColumn('SELECT map FROM ng_games WHERE server_id=%s', $serverID)??'che';
|
||||
}
|
||||
else{
|
||||
$mapTheme = $admin['map_theme']??'che';
|
||||
}
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
||||
$year = $s_year;
|
||||
@@ -84,12 +91,14 @@ if ($month <= 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 연감</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS("js/map/theme_{$mapTheme}.js")?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
@@ -131,7 +140,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
||||
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
||||
<tr height=520>
|
||||
<td width=698>
|
||||
<?=getMapHtml();?>
|
||||
<?=getMapHtml($mapTheme);?>
|
||||
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$history['nation']?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$history['power']?></td>
|
||||
@@ -157,7 +166,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
||||
</table>
|
||||
<script>
|
||||
reloadWorldMap({
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&server_id=<?=$serverID?>',
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
|
||||
showMe:false,
|
||||
neutralView:true
|
||||
});
|
||||
|
||||
@@ -24,10 +24,14 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -25,11 +25,18 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -104,8 +111,8 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>{$general['name2']}</td>
|
||||
<td align=center>Lv {$general['explevel']}</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['sum']}</td>
|
||||
<td align=center>{$general['leader']}</td>
|
||||
<td align=center>{$general['power']}</td>
|
||||
|
||||
@@ -14,6 +14,8 @@ $connect=$db->get();
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn();
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -26,11 +28,12 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
@@ -59,7 +62,7 @@ $(function(){
|
||||
<?=getGeneralPublicRecordRecent(34)?>
|
||||
</td>
|
||||
<td width=698>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -50,7 +50,9 @@ if ($admin['maxonline'] < $curonline) {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
|
||||
@@ -28,7 +28,9 @@ $vote = $admin['vote']?:['-'];
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 설문조사</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
|
||||
@@ -56,7 +56,9 @@ if ($msg2 == "") {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 거래장</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -74,7 +74,9 @@ $sel[$type] = "selected";
|
||||
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 감찰부</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@ if($str3){
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다!");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -26,7 +26,9 @@ if($me['level'] < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ for($i= $lv - 1; $i>=5; $i--){
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -21,9 +21,7 @@ $query = "select no,nation,level,city from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,level,spy from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$myNation = MYDB_fetch_array($result);
|
||||
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
@@ -33,7 +31,9 @@ $templates = new \League\Plates\Engine('templates');
|
||||
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 도시정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
@@ -119,27 +119,34 @@ if($me['level'] == 0) {
|
||||
|
||||
if($myNation['level'] > 0) {
|
||||
// 첩보도시도 목록에 추가
|
||||
$where = 'city=0';
|
||||
$cities = array_map('intval',explode("|", $myNation['spy']));
|
||||
foreach($cities as $citySpy) {
|
||||
$city = intdiv($citySpy, 10);
|
||||
$where .= " or city='{$city}'";
|
||||
|
||||
$rawSpy = $myNation['spy'];
|
||||
|
||||
if($rawSpy == ''){
|
||||
$spyCities = [];
|
||||
}
|
||||
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyCities = array_map(function($val){
|
||||
$val = intval($val);
|
||||
return intdiv($val, 10);
|
||||
}, 'intval',explode('|', $myNation['spy']));
|
||||
}
|
||||
else{
|
||||
$spyCities = array_keys(Json::decode($rawSpy));
|
||||
}
|
||||
|
||||
$query = "select city,name,nation from city where {$where}";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
if($spyCities){
|
||||
foreach ($db->query('SELECT city,name,nation FROM city WHERE city in %li', $spyCities) as $city) {
|
||||
echo "<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,8 +44,14 @@ if ($me['level'] >= 5) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("중원정보", 1);
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -45,11 +47,11 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
}
|
||||
|
||||
$realConflict = [];
|
||||
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as list(
|
||||
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as [
|
||||
$cityID,
|
||||
$cityName,
|
||||
$rawConflict
|
||||
))
|
||||
])
|
||||
{
|
||||
$conflict = Json::decode($rawConflict);
|
||||
if (count($conflict)<2) {
|
||||
@@ -75,11 +77,12 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
@@ -213,7 +216,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=698 height=420>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$nationStr?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$powerStr?></td>
|
||||
|
||||
@@ -50,11 +50,16 @@ $sel[$type] = "selected";
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다!");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 암행부</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -97,24 +102,28 @@ switch ($type) {
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center class='tb_layout bg0'>
|
||||
?>
|
||||
<table align=center id='general_list' class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>이 름</td>
|
||||
<td width=98 align=center id=bg1>통무지</td>
|
||||
<td width=98 align=center id=bg1>부 대</td>
|
||||
<td width=58 align=center id=bg1>자 금</td>
|
||||
<td width=58 align=center id=bg1>군 량</td>
|
||||
<td width=48 align=center id=bg1>도시</td>
|
||||
<td width=28 align=center id=bg1>守</td>
|
||||
<td width=58 align=center id=bg1>병 종</td>
|
||||
<td width=68 align=center id=bg1>병 사</td>
|
||||
<td width=48 align=center id=bg1>훈련</td>
|
||||
<td width=48 align=center id=bg1>사기</td>
|
||||
<td width=148 align=center id=bg1>명 령</td>
|
||||
<td width=58 align=center id=bg1>삭턴</td>
|
||||
<td width=58 align=center id=bg1>턴</td>
|
||||
</tr>";
|
||||
<td width=98 align=center class=bg1>이 름</td>
|
||||
<td width=98 align=center class=bg1>통무지</td>
|
||||
<td width=98 align=center class=bg1>부 대</td>
|
||||
<td width=58 align=center class=bg1>자 금</td>
|
||||
<td width=58 align=center class=bg1>군 량</td>
|
||||
<td width=48 align=center class=bg1>도시</td>
|
||||
<td width=28 align=center class=bg1>守</td>
|
||||
<td width=58 align=center class=bg1>병 종</td>
|
||||
<td width=68 align=center class=bg1>병 사</td>
|
||||
<td width=48 align=center class=bg1>훈련</td>
|
||||
<td width=48 align=center class=bg1>사기</td>
|
||||
<td width=148 align=center class=bg1>명 령</td>
|
||||
<td width=58 align=center class=bg1>삭턴</td>
|
||||
<td width=58 align=center class=bg1>턴</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
$city = CityConst::byID($general['city'])->name;
|
||||
@@ -162,24 +171,24 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
|
||||
<td align=center>{$leader}∥{$power}∥{$intel}</td>
|
||||
<td align=center>$troop</td>
|
||||
<td align=center>{$general['gold']}</td>
|
||||
<td align=center>{$general['rice']}</td>
|
||||
<td align=center>$city</td>
|
||||
<td class='i_name' align=center><span class='t_name'>$name</span><br>Lv <span class='t_explevel'>".getExpLevel($general['experience'])."</span></td>
|
||||
<td class='i_stat' align=center>{$leader}∥{$power}∥{$intel}</td>
|
||||
<td class='i_troop' align=center>$troop</td>
|
||||
<td class='i_gold' align=center>{$general['gold']}</td>
|
||||
<td class='i_rice' align=center>{$general['rice']}</td>
|
||||
<td class='i_city' align=center>$city</td>
|
||||
<td align=center>$mode</td>
|
||||
<td align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
|
||||
<td align=center>{$general['crew']}</td>
|
||||
<td align=center>{$general['train']}</td>
|
||||
<td align=center>{$general['atmos']}</td>";
|
||||
<td class='i_crewtype' align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
|
||||
<td class='i_crew' align=center>{$general['crew']}</td>
|
||||
<td class='i_train' align=center>{$general['train']}</td>
|
||||
<td class='i_atmos' align=center>{$general['atmos']}</td>";
|
||||
if ($general['npc'] >= 2) {
|
||||
echo "
|
||||
<td>
|
||||
<td class='i_action'>
|
||||
<font size=3>NPC 장수";
|
||||
} else {
|
||||
echo "
|
||||
<td>
|
||||
<td class='i_action'>
|
||||
<font size=1>";
|
||||
$turn = getTurn($general, 1, 0);
|
||||
|
||||
@@ -194,10 +203,11 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
</font>
|
||||
</td>
|
||||
<td align=center>{$general['killturn']}</td>
|
||||
<td align=center>".substr($general['turntime'], 14, 5)."</td>
|
||||
<td class='i_turntime' align=center>".substr($general['turntime'], 14, 5)."</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
</tbody>
|
||||
</table>
|
||||
";
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ if($meLevel == 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.expand_city.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -188,11 +194,11 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1000 class='tb_layout bg0 anchor'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
<div id="helper_genlist" style="display:none;"></div>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력장수</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -179,8 +185,8 @@ for($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>$intel</td>
|
||||
<td align=center>{$general['gold']}</td>
|
||||
<td align=center>{$general['rice']}</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['belong']}</td>
|
||||
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
|
||||
</tr>";
|
||||
|
||||
@@ -26,7 +26,9 @@ if($me['level'] == 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -77,7 +77,9 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -21,7 +21,9 @@ $me = MYDB_fetch_array($result);
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ increaseRefresh("국법", 1);
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -400,7 +402,7 @@ for($i=0;$i<16;$i+=1){
|
||||
}
|
||||
$bet = [];
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
if($betting['bet'] == 0){
|
||||
if($betting["bet{$i}"] == 0){
|
||||
$bet[$i] = '∞';
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -24,10 +24,14 @@ $troopcount = MYDB_num_rows($result);
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -36,7 +40,8 @@ $troopcount = MYDB_num_rows($result);
|
||||
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=c_troop.php>
|
||||
<table class='tb_layout bg0'>
|
||||
<table id="troop_list" class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 class='bg1 center'>선 택</td>
|
||||
<td width=130 class='bg1 center'>부 대 정 보</td>
|
||||
@@ -44,6 +49,8 @@ $troopcount = MYDB_num_rows($result);
|
||||
<td width=576 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
|
||||
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $i < $troopcount; $i++) {
|
||||
$troop = MYDB_fetch_array($result);
|
||||
@@ -119,10 +126,11 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
||||
<tr><td colspan=5>";
|
||||
<tr><td colspan=5></td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tbody>
|
||||
<tfoot><tr><td>";
|
||||
if ($troopcount == 0) {
|
||||
}
|
||||
else if($me['troop'] == 0) {
|
||||
@@ -135,6 +143,7 @@ else if($me['troop'] == 0) {
|
||||
|
||||
echo "
|
||||
</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<br>";
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ if($btn == "추방") {
|
||||
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] == 0 || rand()%100 == 0)) {
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] < 100 || rand()%100 == 0)) {
|
||||
switch(rand()%5) {
|
||||
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
|
||||
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
|
||||
|
||||
@@ -13,7 +13,9 @@ $db = DB::db();
|
||||
<html>
|
||||
<head>
|
||||
<title>커맨드리스트</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/* font-boostring Block */
|
||||
html * {max-height:1000000px;}
|
||||
|
||||
|
||||
html, body{
|
||||
background-color:black;
|
||||
color:white;
|
||||
line-height:1.3;
|
||||
font-family:'맑은 고딕';
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
table { font-family:'맑은 고딕'; }
|
||||
@@ -182,38 +188,10 @@ div.bar_out div.bar_in{
|
||||
}
|
||||
|
||||
.tooltip{
|
||||
position: relative;
|
||||
font-size:12px;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 120px;
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
margin-left: -60px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
.tooltiptext {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #555 transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -27,6 +27,30 @@
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer1{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer2{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bgroad{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.world_map .city_tooltip{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
@@ -63,8 +87,8 @@
|
||||
|
||||
.world_map.map_detail .city_filler{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
width:calc(100% + 2px);
|
||||
height:calc(100% + 2px);
|
||||
left:-1px;
|
||||
top:-1px;
|
||||
background:transparent;
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
#message_board section{
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
max-width:498px;
|
||||
}
|
||||
|
||||
.msg_plate{
|
||||
width:100%;
|
||||
border-bottom:solid 1px gray;
|
||||
border-left:solid 1px gray;
|
||||
border-right:solid 1px gray;
|
||||
height:64px;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
min-height:64px;
|
||||
font-size:12px;
|
||||
word-break:break-all;
|
||||
color:white;
|
||||
@@ -96,7 +95,8 @@
|
||||
font-size:12px;
|
||||
width:715px;
|
||||
margin:0 2px;
|
||||
height:15px;
|
||||
height:20px;
|
||||
border:solid 1px gray;
|
||||
}
|
||||
|
||||
#msg_submit{
|
||||
@@ -116,17 +116,19 @@
|
||||
|
||||
.board_header{
|
||||
color:white;
|
||||
border:solid 1px gray;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
}
|
||||
|
||||
.board_side{
|
||||
position:absolute;
|
||||
height:1370px;
|
||||
width:498px;
|
||||
width:50%;
|
||||
overflow-y: hidden;
|
||||
border-left:solid 1px;
|
||||
border-right:solid 1px;
|
||||
border-bottom:solid 1px;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
class CityConst extends CityConstBase{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameConst extends GameConstBase
|
||||
{
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameCustomConst
|
||||
{
|
||||
/** @var int 유저 스탯 총합 */
|
||||
public static $defaultStatTotal = _tK_statTotal_;
|
||||
public static $defaultStatMin = _tK_statMin_;
|
||||
public static $defaultStatMax = _tK_statMax_;
|
||||
public static $defaultStatNPCMax = _tK_statNPCMax_;
|
||||
public static $chiefStatMin = _tK_statChiefMin_;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitConst extends GameUnitConstBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Deny from all
|
||||
@@ -490,7 +490,7 @@ function commandTable() {
|
||||
$develcostE = Util::round($develcostE);
|
||||
|
||||
echo "
|
||||
<select name=commandtype size=1 style=width:260px;color:white;background-color:black;font-size:12px;>";
|
||||
<select name=commandtype size=1 style='height:20px;width:260px;color:white;background-color:black;font-size:12px;'>";
|
||||
addCommand("휴 식", 0);
|
||||
addCommand("요 양", 50);
|
||||
commandGroup("========= 내 정 ==========");
|
||||
@@ -699,7 +699,7 @@ function CoreCommandTable() {
|
||||
if($city['supply'] == 0) { $valid = 0; }
|
||||
|
||||
echo "
|
||||
<select name=commandtype size=1 style=color:white;background-color:black;font-size:13>";
|
||||
<select name=commandtype size=1 style='height:20px;color:white;background-color:black;font-size:13px;>";
|
||||
addCommand("휴 식", 99);
|
||||
commandGroup("", 1);
|
||||
commandGroup("====== 인 사 ======");
|
||||
@@ -821,7 +821,7 @@ function generalInfo($no) {
|
||||
$weapname = getWeapName($general['weap']);
|
||||
$bookname = getBookName($general['book']);
|
||||
$horsename = getHorseName($general['horse']);
|
||||
$itemname = getItemName($general['item']);
|
||||
$itemname = displayItemInfo($general['item']);
|
||||
if($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
@@ -847,8 +847,8 @@ function generalInfo($no) {
|
||||
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
|
||||
|
||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||
$special = $general['special'] == 0 ? "{$general['specage']}세" : "<font color=limegreen>".getGenSpecial($general['special'])."</font>";
|
||||
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".getGenSpecial($general['special2'])."</font>";
|
||||
$special = $general['special'] == 0 ? "{$general['specage']}세" : "<font color=limegreen>".displaySpecialInfo($general['special'])."</font>";
|
||||
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".displaySpecialInfo($general['special2'])."</font>";
|
||||
|
||||
switch($general['personal']) {
|
||||
case 2: case 4:
|
||||
@@ -913,7 +913,7 @@ function generalInfo($no) {
|
||||
<td style='text-align:center;' class='bg1'><b>병사</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['crew']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>성격</b></td>
|
||||
<td style='text-align:center;' colspan=2>".getGenChar($general['personal'])."</td>
|
||||
<td style='text-align:center;' colspan=2>".displayCharInfo($general['personal'])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align:center;' class='bg1'><b>훈련</b></td>
|
||||
@@ -1128,7 +1128,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$message = explode("|", $msg);
|
||||
$message = explode('|', $msg);
|
||||
$count = (count($message) - 2)/2;
|
||||
$message[0] = Tag2Code($message[0]);
|
||||
$message[1] = Tag2Code($message[1]);
|
||||
@@ -1180,11 +1180,10 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
function banner() {
|
||||
|
||||
return sprintf(
|
||||
'<font size=2>%s %s / %s <br> %s</font>',
|
||||
'<font size=2>%s %s / %s</font>',
|
||||
GameConst::$title,
|
||||
VersionGit::$version,
|
||||
GameConst::$banner,
|
||||
GameConst::$helper);
|
||||
GameConst::$banner);
|
||||
}
|
||||
|
||||
function addTurn($date, int $turnterm, int $turn=1) {
|
||||
@@ -1871,7 +1870,7 @@ function PreprocessCommand($no) {
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[0] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용하여 치료합니다!";
|
||||
pushGenLog($general, $log);
|
||||
} elseif($general['injury'] > 10 && $general['item'] == 1 && $general['turn0'] != EncodeCommand(0, 0, 0, 50)) {
|
||||
} elseif($general['injury'] > 10 && $general['item'] == 1 && DecodeCommand($general['turn0'])[0] != 50) {
|
||||
//환약 사용
|
||||
$query = "update general set injury=0,item=0 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1910,8 +1909,14 @@ function updateTurntime($no) {
|
||||
if($general['npc'] == 1 && $general['deadyear'] > $admin['year']) {
|
||||
$general['killturn'] = ($general['deadyear'] - $admin['year']) * 12;
|
||||
$general['npc'] = $general['npc_org'];
|
||||
$query = "update general set owner=-1,npc='{$general['npc']}',killturn='{$general['killturn']}',mode=2 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$db->update('general', [
|
||||
'owner'=>-1,
|
||||
'npc'=>$general['npc_org'],
|
||||
'killturn'=>$general['killturn'],
|
||||
'mode'=>2,
|
||||
'name2'=>null
|
||||
], 'no=%i',$no);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name2'], '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>{$josaYi} <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
|
||||
@@ -2161,6 +2166,7 @@ function CheckHall($no) {
|
||||
|
||||
|
||||
function uniqueItem($general, $log, $vote=0) {
|
||||
//TODO: uniqueItem 재 구현
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
@@ -2178,7 +2184,7 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if($admin['scenario'] == 0) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
if($admin['scenario'] < 100) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
|
||||
|
||||
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||
@@ -2289,6 +2295,69 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function checkAbilityEx(int $generalID, ActionLogger $actLog){
|
||||
$db = DB::db();
|
||||
$general = $db->queryFirstRow('SELECT leader,leader2,power,power2,intel,intel2 FROM general WHERE no = %i',$generalID);
|
||||
|
||||
if(!$general){
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader2'] < 0){
|
||||
$general->updqte('general',[
|
||||
'leader2'=>$db->sqleval('leader2 + %i', GameConst::$upgradeLimit),
|
||||
'leader'=>$db->sqleval('leader - 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['power2'] < 0){
|
||||
$general->updqte('general',[
|
||||
'power2'=>$db->sqleval('power2 + %i', GameConst::$upgradeLimit),
|
||||
'power'=>$db->sqleval('power - 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['intel2'] < 0){
|
||||
$general->updqte('general',[
|
||||
'intel2'=>$db->sqleval('intel2 + %i', GameConst::$upgradeLimit),
|
||||
'intel'=>$db->sqleval('intel - 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader2'] >= GameConst::$upgradeLimit){
|
||||
$general->updqte('general',[
|
||||
'leader2'=>$db->sqleval('leader2 - %i', GameConst::$upgradeLimit),
|
||||
'leader'=>$db->sqleval('leader + 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['power2'] >= GameConst::$upgradeLimit){
|
||||
$general->updqte('general',[
|
||||
'power2'=>$db->sqleval('power2 - %i', GameConst::$upgradeLimit),
|
||||
'power'=>$db->sqleval('power + 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['intel2'] >= GameConst::$upgradeLimit){
|
||||
$general->updqte('general',[
|
||||
'intel2'=>$db->sqleval('intel2 - %i', GameConst::$upgradeLimit),
|
||||
'intel'=>$db->sqleval('intel + 1')
|
||||
]);
|
||||
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function checkAbility($general, $log) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -2449,6 +2518,7 @@ function deleteNation($general) {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $general['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $general['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
// 전 장수 재야로 // 전 장수 소속 무소속으로
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
|
||||
|
||||
@@ -628,7 +628,7 @@ function updateCommand($no, $type=0) {
|
||||
update general set
|
||||
turn0=turn1,turn1=turn2,turn2=turn3,turn3=turn4,turn4=turn5,turn5=turn6,turn6=turn7,turn7=turn8,turn8=turn9,
|
||||
turn9=turn10,turn10=turn11,turn11=turn12,turn12=turn13,turn13=turn14,turn14=turn15,turn15=turn16,turn16=turn17,
|
||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='00000000000000'
|
||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='{$general['no']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -642,7 +642,7 @@ update nation set
|
||||
{$turn}4={$turn}5,{$turn}5={$turn}6,
|
||||
{$turn}6={$turn}7,{$turn}7={$turn}8,
|
||||
{$turn}8={$turn}9,{$turn}9={$turn}10,
|
||||
{$turn}10={$turn}11,{$turn}11='00000000000099'
|
||||
{$turn}10={$turn}11,{$turn}11='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -672,7 +672,7 @@ turn9=turn8,turn8=turn7,
|
||||
turn7=turn6,turn6=turn5,
|
||||
turn5=turn4,turn4=turn3,
|
||||
turn3=turn2,turn2=turn1,
|
||||
turn1=turn0,turn0='00000000000000'
|
||||
turn1=turn0,turn0='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='$no'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -685,7 +685,7 @@ update nation set
|
||||
{$turn}7={$turn}6,{$turn}6={$turn}5,
|
||||
{$turn}5={$turn}4,{$turn}4={$turn}3,
|
||||
{$turn}3={$turn}2,{$turn}2={$turn}1,
|
||||
{$turn}1={$turn}0,{$turn}0='00000000000099'
|
||||
{$turn}1={$turn}0,{$turn}0='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -747,8 +747,9 @@ function command_Other($turn, $commandtype) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<script>
|
||||
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
||||
</script>
|
||||
@@ -771,19 +772,10 @@ parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
||||
|
||||
|
||||
function EncodeCommand($fourth, $third, $double, $command) {
|
||||
$str = StringUtil::padStringAlignRight((string)$fourth, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$third, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$double, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$command, 2, "0");
|
||||
return $str;
|
||||
return Json::encode([$command, $double, $third, $fourth]);
|
||||
}
|
||||
|
||||
function DecodeCommand($str) {
|
||||
$command = [];
|
||||
$command[3] = (int)(substr($str, 0, 4));
|
||||
$command[2] = (int)(substr($str, 4, 4));
|
||||
$command[1] = (int)(substr($str, 8, 4));
|
||||
$command[0] = (int)(substr($str, 12, 2));
|
||||
return $command;
|
||||
return Json::decode($str);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,28 @@ function getGenChar($type) {
|
||||
return $call;
|
||||
}
|
||||
|
||||
function getCharInfo(?int $type):?string {
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$infoText = [
|
||||
10=>['은둔', '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%'],
|
||||
9=>['안전', '사기 -5, 징·모병 비용 -20%'],
|
||||
8=>['유지', '훈련 -5, 징·모병 비용 -20%'],
|
||||
7=>['재간', '명성 -10%, 징·모병 비용 -20%'],
|
||||
6=>['출세', '명성 +10%, 징·모병 비용 +20%'],
|
||||
5=>['할거', '명성 -10%, 훈련 +5'],
|
||||
4=>['정복', '명성 -10%, 사기 +5'],
|
||||
3=>['패권', '훈련 +5, 징·모병 비용 +20%'],
|
||||
2=>['의협', '사기 +5, 징·모병 비용 +20%'],
|
||||
1=>['대의', '명성 +10%, 훈련 -5'],
|
||||
0=>['왕좌', '명성 +10%, 사기 -5'],
|
||||
];
|
||||
|
||||
return $infoText[$type][1]??null;
|
||||
}
|
||||
|
||||
function getGenSpecial($type) {
|
||||
switch($type) {
|
||||
case 0: $call = '-'; break;
|
||||
@@ -179,6 +201,55 @@ function getGenSpecial($type) {
|
||||
return $call;
|
||||
}
|
||||
|
||||
function getSpecialInfo(?int $type):?string{
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//앞칸은 '설명을 위해' '그냥' 적어둠
|
||||
$infoText = [
|
||||
0 => ['-', null],
|
||||
1 => ['경작', '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
2 => ['상재', '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
3 => ['발명', '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
10 => ['축성', '[내정] 성벽 보수 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
11 => ['수비', '[내정] 수비 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
12 => ['통찰', '[내정] 치안 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
20 => ['인덕', '[내정] 주민 선정·정착 장려 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
30 => ['거상', '이것 저것'],
|
||||
31 => ['귀모', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
|
||||
40 => ['귀병', '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p'],
|
||||
41 => ['신산', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p '],
|
||||
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
|
||||
43 => ['집중', '[전투] 계략 성공 시 대미지 +50%'],
|
||||
44 => ['신중', '[전투] 계략 성공 확률 100%'],
|
||||
45 => ['반계', '[전투] 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
|
||||
|
||||
50 => ['보병', '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'],
|
||||
51 => ['궁병', '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p'],
|
||||
52 => ['기병', '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%'],
|
||||
53 => ['공성', '[군사] 차병 계통 징·모병비 -10%<br>[전투] 성벽 공격 시 대미지 +100%'],
|
||||
|
||||
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
|
||||
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
|
||||
62 => ['견고', '[전투] 수비 시 대미지 +10%, 공격 시 아군 피해 -10%'],
|
||||
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
|
||||
|
||||
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
|
||||
71 => ['필살', '[전투] 필살 확률 +20%p'],
|
||||
72 => ['징병', '[군사] 징·모병비 -50%'],
|
||||
73 => ['의술', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
|
||||
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
|
||||
];
|
||||
|
||||
return $infoText[$type][1]??null;
|
||||
}
|
||||
|
||||
function getNationType($type) {
|
||||
switch($type) {
|
||||
case 13: $call = '명 가'; break;
|
||||
@@ -727,7 +798,7 @@ function getHorseEff($horse) : int {
|
||||
return $horse;
|
||||
}
|
||||
|
||||
function getItemName($item) : string {
|
||||
function getItemName($item) : ?string {
|
||||
switch($item) {
|
||||
case 0: $itemname = '-'; break;
|
||||
case 1: $itemname = '환약(치료)'; break;
|
||||
@@ -757,10 +828,45 @@ function getItemName($item) : string {
|
||||
case 24: $itemname = '태평청령(의술)'; break;
|
||||
case 25: $itemname = '태평요술(회피)'; break;
|
||||
case 26: $itemname = '둔갑천서(회피)'; break;
|
||||
default: $itemname = null;
|
||||
}
|
||||
return $itemname;
|
||||
}
|
||||
|
||||
function getItemInfo(?int $item):?string{
|
||||
$itemInfo = [
|
||||
1=>['환약(치료)', '[군사] 턴 실행 전 부상 회복. 1회용'],
|
||||
2=>['수극(저격)', '[전투] 전투 개시 전 20% 확률로 저격 시도. 1회용'],
|
||||
3=>['탁주(사기)', '[전투] 사기 보정 +3. 1회용'],
|
||||
4=>['청주(훈련)', '[전투] 훈련 보정 +3. 1회용'],
|
||||
5=>['이추(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p. 1회용'],
|
||||
6=>['향낭(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p. 1회용'],
|
||||
|
||||
7=>['오석산(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
8=>['무후행군(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
9=>['도소연명(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
10=>['칠엽청점(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
11=>['정력견혈(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
12=>['과실주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
13=>['이강주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
14=>['의적주(사기)', '[전투] 사기 보정 +5'],
|
||||
15=>['두강주(사기)', '[전투] 사기 보정 +5'],
|
||||
16=>['보령압주(사기)', '[전투] 사기 보정 +5'],
|
||||
17=>['철벽서(훈련)', '[전투] 훈련 보정 +7'],
|
||||
18=>['단결도(훈련)', '[전투] 훈련 보정 +7'],
|
||||
19=>['춘화첩(사기)', '[전투] 사기 보정 +7'],
|
||||
20=>['초선화(사기)', '[전투] 사기 보정 +7'],
|
||||
21=>['육도(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
22=>['삼략(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
23=>['청낭서(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
24=>['태평청령(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
25=>['태평요술(회피)', '[전투] 회피 확률 +20%p'],
|
||||
26=>['둔갑천서(회피)', '[전투] 회피 확률 +20%p'],
|
||||
];
|
||||
|
||||
return $itemInfo[$item][1]??null;
|
||||
}
|
||||
|
||||
function getItemCost2($weap) : int {
|
||||
switch($weap) {
|
||||
case 0: $weapcost = 0; break;
|
||||
|
||||
@@ -115,22 +115,33 @@ function getSpecial2($leader, $power, $intel, $nodex=1, $dex0=0, $dex10=0, $dex2
|
||||
}
|
||||
|
||||
function getGenDex($general, $type) {
|
||||
$type = intdiv($type, 10) * 10;
|
||||
return $general["dex{$type}"];
|
||||
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||
$ntype = GameUnitCons::byId($type)->armType * 10;
|
||||
return $general["dex{$ntype}"]??0;
|
||||
}
|
||||
|
||||
function addGenDex($no, $atmos, $train, $type, $exp) {
|
||||
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$type = intdiv($type, 10) * 10;
|
||||
$dexType = "dex{$type}";
|
||||
if($type == 30) { $exp = Util::round($exp * 0.90); } //귀병은 90%효율
|
||||
elseif($type == 40) { $exp = Util::round($exp * 0.90); } //차병은 90%효율
|
||||
$exp = Util::round($exp * ($atmos+$train) / 200); // 사기 + 훈련 / 200
|
||||
$armType = GameUnitConst::byId($type)->armType;
|
||||
if($armType < 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$ntype = $armType*10;
|
||||
$dexType = "dex{$ntype}";
|
||||
if($armType == GameUnitConst::T_WIZARD) {
|
||||
$exp = Util::round($exp * 0.90);
|
||||
}
|
||||
else if($armType == GameUnitConst::T_SIEGE) {
|
||||
$exp = Util::round($exp * 0.90);
|
||||
}
|
||||
$exp = Util::round($exp * ($atmos + $train) / 200); // 사기 + 훈련 / 200
|
||||
|
||||
$query = "update general set {$dexType}={$dexType}+{$exp} where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
$dexType=>$db->sqleval('%b + %i', $dexType, $exp)
|
||||
], 'no=%i', $no);
|
||||
}
|
||||
|
||||
|
||||
@@ -395,23 +406,33 @@ function preUpdateMonthly() {
|
||||
}
|
||||
|
||||
//첩보-1
|
||||
$query = "select nation,spy from nation where spy!=''";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$spy = ""; $k = 0;
|
||||
$cities = [];
|
||||
if($nation['spy'] != "") { $cities = explode("|", (string)$nation['spy']); }
|
||||
while(count($cities)) {
|
||||
$cities[$k]--;
|
||||
if($cities[$k]%10 != 0) { $spy .= (string)$cities[$k]; }
|
||||
$k++;
|
||||
if($k >= count($cities)) { break; }
|
||||
if($cities[$k-1]%10 != 0) { $spy .= "|"; }
|
||||
foreach($db->queryAllLists("SELECT nation, spy FROM nation WHERE spy!='' AND spy!='{}'") as [$nationNo, $rawSpy]){
|
||||
if (strpos($rawSpy, '|') !== false || is_numeric($rawSpy)) {
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
$query = "update nation set spy='$spy' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else{
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
|
||||
foreach($spyInfo as $cityNo => $remainMonth){
|
||||
if($remainMonth <= 1){
|
||||
unset($spyInfo[$cityNo]);
|
||||
}
|
||||
else{
|
||||
$spyInfo[$cityNo] -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
|
||||
], 'nation=%i', $nationNo);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -427,6 +448,15 @@ function postUpdateMonthly() {
|
||||
|
||||
$history = [];
|
||||
|
||||
//도시 수 측정
|
||||
$cityNations = [];
|
||||
foreach($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $cityNation]){
|
||||
if(!key_exists($cityNation, $cityNations)){
|
||||
$cityNations[$cityNation] = [];
|
||||
}
|
||||
$cityNations[$cityNation][] = $cityName;
|
||||
}
|
||||
|
||||
//각 국가 전월 장수수 대비 당월 장수수로 단합도 산정
|
||||
//각 국가 장수수를 구하고 국력 산정
|
||||
// $query = "select nation,gennum from nation where level>0";
|
||||
@@ -438,34 +468,33 @@ function postUpdateMonthly() {
|
||||
// 접속률
|
||||
// 숙련도
|
||||
// 명성,공헌
|
||||
$query = "
|
||||
select
|
||||
A.nation,
|
||||
A.gennum, A.gennum2, A.chemi,
|
||||
round((
|
||||
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
||||
+A.tech
|
||||
+if(A.level=0,0,(
|
||||
select round(
|
||||
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
|
||||
) from city where nation=A.nation and supply=1
|
||||
))
|
||||
+(select sum(leader+power+intel) from general where nation=A.nation)
|
||||
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
|
||||
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
||||
+(select round(avg(connect)) from general where nation=A.nation)
|
||||
)/10)
|
||||
as power
|
||||
from nation A
|
||||
group by A.nation
|
||||
";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
$genNum = [];
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nations = $db->query('SELECT
|
||||
A.nation,
|
||||
A.gennum, A.gennum2, A.chemi, A.aux,
|
||||
round((
|
||||
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
||||
+A.tech
|
||||
+if(A.level=0,0,(
|
||||
select round(
|
||||
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
|
||||
) from city where nation=A.nation and supply=1
|
||||
))
|
||||
+(select sum(leader+power+intel) from general where nation=A.nation)
|
||||
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
|
||||
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
||||
+(select round(avg(connect)) from general where nation=A.nation)
|
||||
)/10)
|
||||
as power,
|
||||
(select sum(crew) from general where nation=A.nation) as totalCrew
|
||||
from nation A
|
||||
group by A.nation');
|
||||
foreach($nations as $nation) {
|
||||
$genNum[$nation['nation']] = $nation['gennum'];
|
||||
|
||||
$aux = Json::decode($nation['aux']);
|
||||
|
||||
|
||||
|
||||
if($nation['gennum'] > $nation['gennum2']) {
|
||||
// 장수가 증가했을때
|
||||
$nation['chemi'] -= ceil(($nation['gennum'] - $nation['gennum2']) / $nation['gennum'] * 100);
|
||||
@@ -479,9 +508,21 @@ group by A.nation
|
||||
if($nation['chemi'] > 100) { $nation['chemi'] = 100; }
|
||||
|
||||
//약간의 랜덤치 부여 (95% ~ 105%)
|
||||
|
||||
$nation['power'] = Util::round($nation['power'] * (rand()%101 + 950) / 1000);
|
||||
$query = "update nation set power='{$nation['power']}',gennum2='{$nation['gennum']}',chemi='{$nation['chemi']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$aux['maxPower'] = max($aux['maxPower']??0, $nation['power']);
|
||||
$aux['maxCrew'] = max($aux['maxCrew']??0, Util::toInt($nation['totalCrew']));
|
||||
|
||||
if(count($cityNations[$nation['nation']]??[]) > count($aux['maxCities']??[])){
|
||||
$aux['maxCities'] = $cityNations[$nation['nation']];
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'power'=>$nation['power'],
|
||||
'gennum2'=>$nation['gennum'],
|
||||
'chemi'=>$nation['chemi'],
|
||||
'aux'=>Json::encode($aux)
|
||||
], 'nation=%i', $nation['nation']);
|
||||
}
|
||||
|
||||
// 전쟁기한 세팅
|
||||
@@ -690,6 +731,7 @@ function checkMerge() {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
// 자금 통합, 외교제한 5년, 기술유지
|
||||
$query = "update nation set name='{$you['makenation']}',gold=gold+'{$mynation['gold']}',rice=rice+'{$mynation['rice']}',surlimit='24',totaltech='$newTotalTech',tech='$newTech',gennum='{$newGenCount}' where nation='{$younation['nation']}'";
|
||||
@@ -820,6 +862,7 @@ function checkSurrender() {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
$newGenCount = $gencount + $gencount2;
|
||||
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
|
||||
@@ -1332,6 +1375,7 @@ function checkEmperior() {
|
||||
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
storeOldGenerals(0, $admin['year'], $admin['month']);
|
||||
storeOldGenerals($nation['nation'], $admin['year'], $admin['month']);
|
||||
@@ -1339,7 +1383,6 @@ function checkEmperior() {
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$nation['nation'],
|
||||
'history'=>'',
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
@@ -1359,6 +1402,10 @@ function checkEmperior() {
|
||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||
$serverName = UniqueConst::$serverName;
|
||||
|
||||
$db->update('ng_games', [
|
||||
'winner_nation'=>$nation['nation']
|
||||
], 'server_id=%s', UniqueConst::$serverID);
|
||||
|
||||
$db->insert('emperior', [
|
||||
'phase'=>$serverName.$serverCnt.'기',
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
|
||||
@@ -156,7 +156,10 @@ function pushOldNationStop(int $no, int $nationNo){
|
||||
}
|
||||
|
||||
//DB-based
|
||||
function pushNationHistory($nation, $history) {
|
||||
function pushNationHistory($nation, ?string $history) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
if(!$nation || !$nation['nation']){
|
||||
return;
|
||||
}
|
||||
@@ -164,7 +167,10 @@ function pushNationHistory($nation, $history) {
|
||||
$history.'<br>', $nation['nation']);
|
||||
}
|
||||
|
||||
function pushGeneralHistory($me, $history) {
|
||||
function pushGeneralHistory($me, ?string $history) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
DB::db()->query("UPDATE general set history=concat(%s, history) where no=%i",
|
||||
$history.'<br>', $me['no']);
|
||||
}
|
||||
@@ -174,7 +180,7 @@ function getGeneralHistoryAll(int $no) {
|
||||
return ConvertLog($history);
|
||||
}
|
||||
|
||||
function pushWorldHistory(array $history, $year=null, $month=null) {
|
||||
function pushWorldHistory(?array $history, $year=null, $month=null) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
@@ -221,7 +227,7 @@ function getWorldHistoryWithDate($year, $month) {
|
||||
}
|
||||
|
||||
|
||||
function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
|
||||
function pushGeneralPublicRecord(?array $history, $year=null, $month=null) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ function printLimitMsg($turntime) {
|
||||
<html>
|
||||
<head>
|
||||
<title>접속제한</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -29,7 +31,7 @@ function bar($per, $h=7) {
|
||||
|
||||
$per = round($per, 1);
|
||||
|
||||
$str = "<div class='bar_out' style='height:{$h2}px;'>
|
||||
$str = "<div class='bar_out' style='height:{$h}px;'>
|
||||
<div class='bar_in' style='background:url(".ServConfig::$gameImagePath."/pr{$h2}.gif)'></div>
|
||||
<div style='width:{$per}%;background:url(".ServConfig::$gameImagePath."/pb{$h2}.gif)'></div>
|
||||
</div>";
|
||||
|
||||
@@ -94,19 +94,29 @@ function getWorldMap($req){
|
||||
$myNation = null;
|
||||
}
|
||||
|
||||
$spyInfo = (object)null;
|
||||
|
||||
if($myNation){
|
||||
$spyList = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
|
||||
$rawSpy = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
|
||||
$myNation);
|
||||
if($spyList){
|
||||
$spyList = array_map('\sammo\Util::toInt', explode("|", $spyList));
|
||||
|
||||
if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//NOTE: 0.8 이전 데이터가 남아있으므로, 0.8버전으로 마이그레이션 이후에도 이곳은 삭제하면 안됨
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$spyList = [];
|
||||
else if($rawSpy != ''){
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$spyList = [];
|
||||
|
||||
if(!$spyInfo){
|
||||
$spyInfo = (object)null;
|
||||
}
|
||||
|
||||
$nationList = [];
|
||||
@@ -142,7 +152,7 @@ function getWorldMap($req){
|
||||
'month' => $month,
|
||||
'cityList' => $cityList,
|
||||
'nationList' => $nationList,
|
||||
'spyList' => $spyList,
|
||||
'spyList' => $spyInfo,
|
||||
'shownByGeneralList' => $shownByGeneralList,
|
||||
'myCity' => $myCity,
|
||||
'myNation' => $myNation,
|
||||
|
||||
@@ -107,6 +107,8 @@ function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
switch($sel) {
|
||||
case 0:
|
||||
$type = 0; //보병
|
||||
@@ -181,7 +183,7 @@ function processAI($no) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
// 입력된 턴이 있으면 그것 실행
|
||||
if($general['turn0'] != "00000000000000") {
|
||||
if(DecodeCommand($general['turn0'])[0] != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -361,7 +363,7 @@ function processAI($no) {
|
||||
}
|
||||
break;
|
||||
case 2: //이동 20%
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
|
||||
break;
|
||||
default:
|
||||
@@ -429,7 +431,7 @@ function processAI($no) {
|
||||
return;
|
||||
} elseif(rand()%4 > 0) {
|
||||
//이동
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
@@ -600,7 +602,7 @@ function processAI($no) {
|
||||
//현도시가 전방이면 공격 가능성 체크
|
||||
if($city['front'] > 0) {
|
||||
//주변도시 체크
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
for($i=0; $i < count($paths); $i++) {
|
||||
$query = "select city,nation from city where city='$paths[$i]'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),"");
|
||||
@@ -766,7 +768,7 @@ function processAI($no) {
|
||||
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달
|
||||
} else {
|
||||
//공격 & 내정
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
for($i=0; $i < count($paths); $i++) {
|
||||
$query = "select city,nation from city where city='$paths[$i]'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI21 ".MYDB_error($connect),"");
|
||||
@@ -824,10 +826,10 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
switch($command) {
|
||||
case "00000000000001": //내정
|
||||
case EncodeCommand(0, 0, 0, 1): //내정
|
||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||
return;
|
||||
case "00000000000011": //징병
|
||||
case EncodeCommand(0, 0, 0, 11): //징병
|
||||
$query = "select region from city where nation='{$general['nation']}' order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
||||
$selRegion = MYDB_fetch_array($result);
|
||||
@@ -1008,7 +1010,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$isWarUser = true;
|
||||
break;
|
||||
}
|
||||
if(Util::randF(0.2)){
|
||||
if(Util::randBool(0.2)){
|
||||
$isWarUser = false;
|
||||
break;
|
||||
}
|
||||
@@ -1206,7 +1208,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$score *= 4;
|
||||
}
|
||||
|
||||
if(Util::randF(0.3) && $frontImportantCitiesID){
|
||||
if(Util::randBool(0.3) && $frontImportantCitiesID){
|
||||
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
|
||||
}
|
||||
else{
|
||||
@@ -1262,7 +1264,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
|
||||
continue;
|
||||
}
|
||||
if (Util::randF($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,188 +852,170 @@ function process_9(&$general) {
|
||||
}
|
||||
|
||||
function process_11(&$general, $type) {
|
||||
if($type == 1){
|
||||
$type = '징병';
|
||||
}
|
||||
else{
|
||||
$type = '모병';
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; }
|
||||
else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; }
|
||||
if($type === '징병') {
|
||||
$defaultatmos = GameConst::$defaultAtmosLow;
|
||||
$defaulttrain = GameConst::$defaultTrainLow;
|
||||
}
|
||||
else {
|
||||
$defaultatmos = GameConst::$defaultAtmosHigh;
|
||||
$defaulttrain = GameConst::$defaultTrainHigh;
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
[$startYear, $year, $month] = $gameStor->getValuesAsArray(['startyear, year, month']);
|
||||
|
||||
$query = "select level,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$lbonus = setLeadershipBonus($general, $nation['level']);
|
||||
|
||||
$query = "select * from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$actLog = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$armtype = $command[2];
|
||||
$crew = $command[1];
|
||||
$crewType = $command[2];
|
||||
$rawCrew = $command[1];
|
||||
|
||||
|
||||
if($armtype != $general['crewtype']) { $general['crew'] = 0; $general['train'] = $defaulttrain; $general['atmos'] = $defaultatmos; }
|
||||
|
||||
if($crew*100 + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
||||
$crew = Util::round(getGeneralLeadership($general, true, true, true) - $general['crew']/100);
|
||||
if($crewType != $general['crewtype']) {
|
||||
$general['crew'] = 0;
|
||||
$general['train'] = $defaulttrain;
|
||||
$general['atmos'] = $defaultatmos;
|
||||
}
|
||||
if($crew < 0) { $crew = 0; }
|
||||
$cost = $crew * getCost($armtype);
|
||||
//기술로 가격
|
||||
$cost *= getTechCost($nation['tech']);
|
||||
|
||||
if($general['crew'] != 0) {
|
||||
$dtype = "추가".$type;
|
||||
}
|
||||
else {
|
||||
$dtype = $type;
|
||||
}
|
||||
|
||||
if(!$general['nation']){
|
||||
$actLog->pushGeneralActionLog("재야입니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $general['city']);
|
||||
|
||||
if($city['nation'] != $general['nation']){
|
||||
$actLog->pushGeneralActionLog("아국이 아닙니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$crewTypeObj = GameUnitConst::byID($crewType);
|
||||
if($crewTypeObj === null){
|
||||
$actLog->pushGeneralActionLog("병종 코드 에러. $type 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
[$nationLevel, $tech] = $db->queryFirstList('SELECT `level`,tech FROM nation WHERE nation=%i', $general['nation']);
|
||||
|
||||
$lbonus = setLeadershipBonus($general, $nationLevel);
|
||||
|
||||
//NOTE: 입력 변수는 100명 단위임
|
||||
$crew = $rawCrew * 100;
|
||||
|
||||
if($crew + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
||||
$crew = max(0, getGeneralLeadership($general, true, true, true) * 100 - $general['crew']);
|
||||
}
|
||||
|
||||
if($crew <= 0) {
|
||||
$actLog->pushGeneralActionLog("더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$cost = $crewTypeObj->costWithTech($tech, $crew);
|
||||
//성격 보정
|
||||
$cost = CharCost($cost, $general['personal']);
|
||||
$cost = Util::round($cost);
|
||||
$cost = Util::round(CharCost($cost, $general['personal']));
|
||||
|
||||
//특기 보정 : 보병, 궁병, 기병, 귀병, 공성, 징병
|
||||
if(intdiv($armtype, 10) == 0 && $general['special2'] == 50) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 1 && $general['special2'] == 51) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 2 && $general['special2'] == 52) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 3 && $general['special2'] == 40) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 4 && $general['special2'] == 43) { $cost *= 0.9; }
|
||||
//특기 보정 : 징병, 보병, 궁병, 기병, 귀병, 공성
|
||||
if($general['special2'] == 72) { $cost *= 0.5; }
|
||||
|
||||
if($type == 1) { $dtype = "징병"; }
|
||||
elseif($type == 2) { $dtype = "모병"; $cost *= 2; }
|
||||
if($general['crew'] != 0) { $dtype = "추가".$dtype; }
|
||||
|
||||
//현재 가능한지 검사
|
||||
switch($armtype) {
|
||||
case 0: case 10: case 20: case 30: case 35: // 보병 궁병 기병 귀병 남귀병
|
||||
$sel = 0; break;
|
||||
|
||||
case 1: $sel = 1; $rg = 2; break; // 청주병(중원)
|
||||
case 2: $sel = 1; $rg = 7; break; // 수병(오월)
|
||||
case 3: $sel = 2; $ct = 64; break; // 자객병(저)
|
||||
case 4: $sel = 2; $ct = 3; break; // 근위병(낙양)
|
||||
case 5: $sel = 1; $rg = 5; break; // 등갑병(남중)
|
||||
|
||||
case 11: $sel = 1; $rg = 8; break; // 궁기병(동이)
|
||||
case 12: $sel = 1; $rg = 4; break; // 연노병(서촉)
|
||||
case 13: $sel = 2; $ct = 6; break; // 강궁병(양양)
|
||||
case 14: $sel = 2; $ct = 7; break; // 석궁병(건업)
|
||||
|
||||
case 21: $sel = 1; $rg = 1; break; // 백마병(하북)
|
||||
case 22: $sel = 1; $rg = 3; break; // 중장기병(서북)
|
||||
case 23: $sel = 2; $ct = 65; break; // 돌격기병(흉노)
|
||||
case 24: $sel = 2; $ct = 63; break; // 철기병(강)
|
||||
case 25: $sel = 2; $ct = 67; break; // 수렵기병(산월)
|
||||
case 26: $sel = 2; $ct = 66; break; // 맹수병(남만)
|
||||
case 27: $sel = 2; $ct = 2; break; // 호표기병(허창)
|
||||
|
||||
case 31: $sel = 1; $rg = 6; break; // 신귀병(초)
|
||||
case 32: $sel = 2; $ct = 68; break; // 백귀병(오환)
|
||||
case 33: $sel = 2; $ct = 69; break; // 흑귀병(왜)
|
||||
case 34: $sel = 2; $ct = 4; break; // 악귀병(장안)
|
||||
case 36: $sel = 2; $ct = 3; break; // 황귀병(낙양)
|
||||
case 37: $sel = 2; $ct = 5; break; // 천귀병(성도)
|
||||
case 38: $sel = 2; $ct = 1; break; // 마귀병(업)
|
||||
|
||||
case 40: $sel = 0; break; // 정란
|
||||
case 41: $sel = 0; break; // 충차
|
||||
case 42: $sel = 2; $ct = 1; break; // 벽력거(업)
|
||||
case 43: $sel = 2; $ct = 5; break; // 목우(성도)
|
||||
|
||||
default: $sel = 0; $armtype = 0; break;
|
||||
}
|
||||
if($sel == 0) {
|
||||
// 남귀병은 기술1등급부터
|
||||
// 충차는 기술1등급부터
|
||||
if($armtype == 35 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
} elseif($armtype == 41 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
} else {
|
||||
$cnt = 1;
|
||||
}
|
||||
} elseif($sel == 1) {
|
||||
$query = "select city,level from city where nation='{$general['nation']}' and region='$rg'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$rgcity = MYDB_fetch_array($result);
|
||||
// 기술 1000 이상부터 지역병
|
||||
if($cnt > 0 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
} else {
|
||||
$query = "select city,level from city where nation='{$general['nation']}' and city='$ct'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$ctcity = MYDB_fetch_array($result);
|
||||
// 기술 2000 이상부터 이민족병
|
||||
if($cnt > 0 && $ctcity['level'] == 4 && $nation['tech'] < 2000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
// 기술 3000 이상부터 특수병
|
||||
if($cnt > 0 && $ctcity['level'] == 8 && $nation['tech'] < 3000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
}
|
||||
if($cnt > 0) { $valid = 1; }
|
||||
else { $valid = 0; }
|
||||
|
||||
// 초반 제한중 차병 불가
|
||||
if($admin['year'] < $admin['startyear']+3 && intdiv($armtype, 10) == 4) {
|
||||
$valid = 0;
|
||||
else if($general['special2'] == 50 && $crewTypeObj->armType == GameUnitConstBase::T_FOOTMAN) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 51 && $crewTypeObj->armType == GameUnitConstBase::T_ARCHER) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 52 && $crewTypeObj->armType == GameUnitConstBase::T_CAVALRY) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 40 && $crewTypeObj->armType == GameUnitConstBase::T_WIZARD) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 53 && $crewTypeObj->armType == GameUnitConstBase::T_SIEGE) { $cost *= 0.9; }
|
||||
|
||||
if($general['gold'] < $cost){
|
||||
$actLog->pushGeneralActionLog("자금이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
}
|
||||
|
||||
if($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. $dtype 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($crew <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $cost) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $crew) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($valid == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['pop']-30000 < $crew*100) { // 주민 30000명 이상만 가능
|
||||
$log[] = "<C>●</>{$admin['month']}월:주민이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['rate'] < 20) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:".GameUnitConst::byId($armtype)->name."을(를) <C>{$crew}00</>명 {$dtype}했습니다. <1>$date</>";
|
||||
$exp = $crew;
|
||||
$ded = $crew;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $armtype, $crew);
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew*100) / ($general['crew'] + $crew*100));
|
||||
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew*100) / ($general['crew'] + $crew*100));
|
||||
$general['crew'] += $crew*100;
|
||||
$general['gold'] -= $cost;
|
||||
// 주민수 감소 // 민심 김소
|
||||
if($type == 1) { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*100); }
|
||||
else { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*50); }
|
||||
if($city['rate'] < 0) { $city['rate'] = 0; }
|
||||
$query = "update city set pop=pop-({$crew}*100),rate='{$city['rate']}' where city='{$general['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
||||
$general['leader2']++;
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',crewtype='$armtype',crew='{$general['crew']}',train='$train',atmos='$atmos',gold='{$general['gold']}',rice=rice-'$crew',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
if($general['rice'] < $crew) {
|
||||
$actLog->pushGeneralActionLog("군량이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
$ownCities = [];
|
||||
$ownRegions = [];
|
||||
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $me['nation']) as $ownCity){
|
||||
$ownCities[$ownCity] = 1;
|
||||
$ownRegions[CityConst::byId($ownCity)->region] = 1;
|
||||
}
|
||||
$valid = $crewTypeObj->isValid($ownCities, $ownRegions, $admin['year'] - $admin['startyear'], $tech);
|
||||
|
||||
if(!$valid) {
|
||||
$actLog->pushGeneralActionLog("현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
if($city['pop']-30000 < $crew) { // 주민 30000명 이상만 가능
|
||||
$actLog->pushGeneralActionLog("주민이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
if($city['rate'] < 20) {
|
||||
$actLog->pushGeneralActionLog("민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$actLog->pushGeneralActionLog($crewTypeObj->name."을(를) <C>{$crew}</>명 {$dtype}했습니다. <1>$date</>");
|
||||
$exp = Util::round($crew / 100);
|
||||
$ded = Util::round($crew / 100);
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $crewType, $crew);
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew) / ($general['crew'] + $crew));
|
||||
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew) / ($general['crew'] + $crew));
|
||||
$general['crew'] += $crew;
|
||||
$general['gold'] -= $cost;
|
||||
// 주민수 감소 // 민심 감소
|
||||
if($type === '징병') {
|
||||
$city['rate'] -= Util::round($crew / $city['pop']);
|
||||
}
|
||||
else {
|
||||
$city['rate'] -= Util::round($crew / 2 / $city['pop']);
|
||||
}
|
||||
if($city['rate'] < 0) { $city['rate'] = 0; }
|
||||
|
||||
$db->update('city', [
|
||||
'pop'=>$db->sqleval('pop-%i', $crew),
|
||||
'rate'=>$city['rate']
|
||||
], 'city = %i',$general['city']);
|
||||
|
||||
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
||||
$general['leader2']++;
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'leader2'=>$general['leader2'],
|
||||
'crewtype'=>$crewTypeObj->id,
|
||||
'crew'=>$general['crew'],
|
||||
'train'=>$train,
|
||||
'atmos'=>$atmos,
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$db->sqleval('rice - %i', Util::round($crew/100)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', $ded),
|
||||
'experience'=>$db->sqleval('experience + %i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $actLog);
|
||||
$log = uniqueItem($general, []);//TODO: uniqueItem 재 구현
|
||||
$actLog->pushGeneralActionLog($log, ActionLogger::RAWTEXT);
|
||||
}
|
||||
|
||||
function process_13(&$general) {
|
||||
@@ -1060,14 +1042,10 @@ function process_13(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 훈련 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($general['crew'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
|
||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 훈련이 불가능합니다. <1>$date</>";
|
||||
} else {
|
||||
// 훈련시
|
||||
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
|
||||
@@ -1128,16 +1106,12 @@ function process_14(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 사기진작 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['crew'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $general['crew']/100) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
|
||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 사기 진작이 불가능합니다. <1>$date</>";
|
||||
} else {
|
||||
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
||||
$gold = $general['gold'] - Util::round($general['crew']/100);
|
||||
@@ -1743,32 +1717,32 @@ function process_31(&$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select spy from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
if($nation['spy'] != "")
|
||||
{
|
||||
$cities = array_map('intval', explode("|", $nation['spy']));
|
||||
|
||||
|
||||
$rawSpy = $db->queryFirstField('SELECT spy FROM nation WHERE nation = %i', $general['nation']);
|
||||
|
||||
if($rawSpy == ''){
|
||||
$spyInfo = [];
|
||||
}
|
||||
else{
|
||||
$cities = [];
|
||||
}
|
||||
$exist = 0;
|
||||
for($i=0; $i < count($cities); $i++) {
|
||||
if(intdiv($cities[$i], 10) == $destination) {
|
||||
$exist = 1;
|
||||
break;
|
||||
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
// 기존 첩보 목록에 없으면 새로 등록, 있으면 갱신
|
||||
if($exist == 0) {
|
||||
$cities[] = $destination * 10 + 3;
|
||||
} else {
|
||||
$cities[$i] = $destination * 10 + 3;
|
||||
else{
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
$spy = implode("|", $cities);
|
||||
$query = "update nation set spy='$spy' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$spyInfo[$destination] = 3;
|
||||
|
||||
$db->update('nation', [
|
||||
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
|
||||
], 'nation=%i', $general['nation']);
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
@@ -1812,14 +1786,7 @@ function process_41(&$general) {
|
||||
} elseif($crewexp == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
||||
} else {
|
||||
$type = intdiv($general['crewtype'], 10);
|
||||
switch($type) {
|
||||
case 0: $crewstr = '보병'; break;
|
||||
case 1: $crewstr = '궁병'; break;
|
||||
case 2: $crewstr = '기병'; break;
|
||||
case 3: $crewstr = '귀병'; break;
|
||||
case 4: $crewstr = '차병'; break;
|
||||
}
|
||||
$crewstr = GameUnitConst::$typeData[GameUnitConst::byID($general['crewtype']->armType)];
|
||||
|
||||
if($ratio < 33) {
|
||||
// 숙련도 증가
|
||||
|
||||
@@ -84,7 +84,7 @@ function process_25(&$general) {
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] == 0 || $admin['scenario'] >= 20 || !$admin['fiction'])){
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] < 100 || $admin['scenario'] >= 2000 || !$admin['fiction'])){
|
||||
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
||||
$nations = $db->query(
|
||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
||||
@@ -339,7 +339,7 @@ function process_29(&$general) {
|
||||
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
||||
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
||||
$type = rand() % 10;
|
||||
if($admin['scenario'] == 0) {
|
||||
if($admin['scenario'] < 100) {
|
||||
switch($type) {
|
||||
case 0: case 1:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
|
||||
@@ -64,6 +64,42 @@ function CoreTurnTable() {
|
||||
";
|
||||
}
|
||||
|
||||
function displayCharInfo(?int $type):string{
|
||||
$info = getCharInfo($type);
|
||||
$text = getGenChar($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
function displaySpecialInfo(?int $type):string{
|
||||
$info = getSpecialInfo($type);
|
||||
$text = getGenSpecial($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
function displayItemInfo(?int $type):string{
|
||||
$info = getItemInfo($type);
|
||||
$text = getItemName($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
function allButton() {
|
||||
$db = DB::db();
|
||||
@@ -167,11 +203,18 @@ function formatName(string $name, int $npc): string{
|
||||
return $name;
|
||||
}
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
function getMapHtml(?string $mapTheme=null){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('map');
|
||||
if($mapTheme === null){
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
}
|
||||
|
||||
return $templates->render('map', [
|
||||
'mapTheme'=>$mapTheme
|
||||
]);
|
||||
}
|
||||
|
||||
function getInvitationList(array $nationList){
|
||||
|
||||
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
|
||||
|
||||
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
||||
|
||||
@@ -76,7 +76,7 @@ if ($admin['npcmode'] == 0) {
|
||||
$valid = 1;
|
||||
}
|
||||
$color = "cyan";
|
||||
|
||||
$mapTheme = $admin['map_theme'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -84,12 +84,14 @@ $color = "cyan";
|
||||
<title><?=UniqueConst::$serverName?>: 메인</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/main.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<?=WebUtil::printJS('js/msg.js')?>
|
||||
<script>
|
||||
@@ -103,7 +105,7 @@ $(function(){
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/main.css')?>
|
||||
@@ -228,7 +230,7 @@ else if($session->userGrade == 4){
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr>
|
||||
<td width=698 height=520 colspan=2>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=298 rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
||||
</tr>
|
||||
@@ -286,7 +288,7 @@ else if($session->userGrade == 4){
|
||||
<div class="message_input_form bg0">
|
||||
<select id="mailbox_list" size="1">
|
||||
|
||||
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13">
|
||||
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13px">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ if($session->userGrade < 5 && !$allowReset){
|
||||
<title>설치</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
@@ -20,7 +20,8 @@ if($session->userGrade == 5){
|
||||
<title>설치</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
@@ -6,6 +6,15 @@ include "func.php";
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'affected'=>0,
|
||||
'status'=>'no_reserved_table'
|
||||
]);
|
||||
}
|
||||
|
||||
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
|
||||
|
||||
if(!$reserved){
|
||||
|
||||
@@ -13,7 +13,8 @@ $defaultPost = [
|
||||
'neutralView' => false,
|
||||
'showMe' => true
|
||||
];
|
||||
$post = WebUtil::parseJsonPost() + $defaultPost;
|
||||
$post = Json::decode(Util::getReq('data', 'string', '{}'));
|
||||
$post += $defaultPost;
|
||||
|
||||
if(!$session->isGameLoggedIn()){
|
||||
$post['neutralView'] = true;
|
||||
|
||||
@@ -6,7 +6,7 @@ include "func.php";
|
||||
|
||||
$year = Util::getReq('year', 'int');
|
||||
$month = Util::getReq('month', 'int');
|
||||
$serverID = Util::getReq('server_id', 'string', null);
|
||||
$serverID = Util::getReq('serverID', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ if (!$generalID) {
|
||||
]);
|
||||
}
|
||||
|
||||
$jsonPost = WebUtil::parseJsonPost();
|
||||
$jsonPost = Json::decode(Util::getReq('data', 'string', '{}'));
|
||||
|
||||
$msgID = Util::toInt($jsonPost['msgID']??null);
|
||||
$msgResponse = $jsonPost['response']??null;
|
||||
|
||||
@@ -7,8 +7,7 @@ include('func.php');
|
||||
$session = Session::requireGameLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$jsonPost = WebUtil::parseJsonPost();
|
||||
$reqSequence = (int)Util::array_get($jsonPost['sequence'], 0);
|
||||
$reqSequence = Util::getReq('sequence', 'int', 0);
|
||||
|
||||
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace sammo;
|
||||
include 'lib.php';
|
||||
include 'func.php';
|
||||
|
||||
$post = WebUtil::parseJsonPost();
|
||||
$post = Json::decode(Util::getReq('data', 'string', '{}'));
|
||||
'@phan-var mixed[] $post';
|
||||
|
||||
$v = new Validator($post);
|
||||
|
||||
@@ -31,16 +31,31 @@ $connect=$db->get();
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<script>
|
||||
var defaultStatTotal = <?=GameConst::$defaultStatTotal?>;
|
||||
var defaultStatMin = <?=GameConst::$defaultStatMin?>;
|
||||
var defaultStatMax = <?=GameConst::$defaultStatMax?>;
|
||||
|
||||
var charInfoText = <?php
|
||||
|
||||
$charInfoText = [];
|
||||
for($i=0;$i<=9;$i++){
|
||||
//XXX:하드코딩 금지!
|
||||
$charInfoText[$i] = getCharInfo($i);
|
||||
}
|
||||
echo Json::encode((object)$charInfoText);
|
||||
?>;
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/join.js')?>
|
||||
|
||||
</head>
|
||||
@@ -104,7 +119,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
<tr>
|
||||
<td width=498 align=right id=bg1>성격</td>
|
||||
<td colspan=2>
|
||||
<select name=character size=1 maxlength=15 style=color:white;background-color:black;>
|
||||
<select id="selChar" name=character size=1 maxlength=15 style=color:white;background-color:black;>
|
||||
<option selected value=11>????</option>
|
||||
<!--
|
||||
<option value=10>은둔</option>
|
||||
@@ -119,7 +134,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
<option value=2>의협</option>
|
||||
<option value=1>대의</option>
|
||||
<option value=0>왕좌</option>
|
||||
</select> ※보정은 도움말 참고
|
||||
</select> <span id="charInfoText"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -281,7 +281,7 @@ $rootDB->insert('member_log', [
|
||||
|
||||
?>
|
||||
<script>
|
||||
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n튜토리얼을 꼭 읽어보세요!');
|
||||
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
|
||||
</script>
|
||||
<script>location.replace('./');</script>
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
|
||||
|
||||
function getCityPosition(){
|
||||
return {
|
||||
1: ["업", 345, 130],
|
||||
2: ["허창", 330, 215],
|
||||
3: ["낙양", 275, 180],
|
||||
4: ["장안", 145, 165],
|
||||
5: ["성도", 25, 290],
|
||||
6: ["양양", 255, 290],
|
||||
7: ["건업", 505, 305],
|
||||
8: ["북평", 465, 65],
|
||||
9: ["남피", 395, 95],
|
||||
10: ["완", 270, 235],
|
||||
11: ["수춘", 395, 270],
|
||||
12: ["서주", 440, 250],
|
||||
13: ["강릉", 245, 335],
|
||||
14: ["장사", 255, 375],
|
||||
15: ["시상", 360, 360],
|
||||
16: ["위례", 620, 145],
|
||||
17: ["계", 365, 35],
|
||||
18: ["복양", 410, 170],
|
||||
19: ["진류", 365, 185],
|
||||
20: ["여남", 330, 260],
|
||||
21: ["하비", 480, 235],
|
||||
22: ["서량", 25, 50],
|
||||
23: ["하내", 230, 150],
|
||||
24: ["한중", 135, 205],
|
||||
25: ["상용", 185, 225],
|
||||
26: ["덕양", 85, 275],
|
||||
27: ["강주", 70, 310],
|
||||
28: ["건녕", 80, 400],
|
||||
29: ["남해", 245, 480],
|
||||
30: ["계양", 230, 400],
|
||||
31: ["오", 510, 345],
|
||||
32: ["평양", 590, 100],
|
||||
33: ["사비", 605, 205],
|
||||
34: ["계림", 655, 200],
|
||||
35: ["진양", 295, 60],
|
||||
36: ["평원", 440, 115],
|
||||
37: ["북해", 470, 155],
|
||||
38: ["초", 365, 230],
|
||||
39: ["패", 430, 220],
|
||||
40: ["천수", 70, 105],
|
||||
41: ["안정", 95, 145],
|
||||
42: ["홍농", 210, 175],
|
||||
43: ["하변", 45, 190],
|
||||
44: ["자동", 75, 245],
|
||||
45: ["영안", 115, 295],
|
||||
46: ["귀양", 90, 360],
|
||||
47: ["주시", 30, 345],
|
||||
48: ["운남", 30, 415],
|
||||
49: ["남영", 135, 405],
|
||||
50: ["교지", 130, 480],
|
||||
51: ["신야", 250, 260],
|
||||
52: ["강하", 315, 295],
|
||||
53: ["무릉", 195, 355],
|
||||
54: ["영릉", 190, 395],
|
||||
55: ["상동", 210, 435],
|
||||
56: ["여강", 380, 315],
|
||||
57: ["회계", 480, 395],
|
||||
58: ["고창", 350, 405],
|
||||
59: ["대", 450, 480],
|
||||
60: ["안평", 530, 80],
|
||||
61: ["졸본", 570, 65],
|
||||
62: ["이도", 680, 260],
|
||||
63: ["강", 95, 35],
|
||||
64: ["저", 25, 120],
|
||||
65: ["흉노", 180, 95],
|
||||
66: ["남만", 80, 455],
|
||||
67: ["산월", 425, 430],
|
||||
68: ["오환", 610, 20],
|
||||
69: ["왜", 680, 320],
|
||||
70: ["호관", 285, 140],
|
||||
71: ["호로", 285, 205],
|
||||
72: ["사곡", 240, 175],
|
||||
73: ["함곡", 180, 175],
|
||||
74: ["사수", 310, 185],
|
||||
75: ["양평", 90, 220],
|
||||
76: ["가맹", 45, 225],
|
||||
77: ["역경", 410, 65],
|
||||
78: ["계교", 405, 135],
|
||||
79: ["동황", 515, 145],
|
||||
80: ["관도", 340, 165],
|
||||
81: ["정도", 400, 210],
|
||||
82: ["합비", 435, 285],
|
||||
83: ["광릉", 490, 275],
|
||||
84: ["적도", 130, 75],
|
||||
85: ["가정", 40, 160],
|
||||
86: ["기산", 110, 180],
|
||||
87: ["면죽", 35, 255],
|
||||
88: ["이릉", 215, 295],
|
||||
89: ["장판", 280, 315],
|
||||
90: ["백랑", 530, 30],
|
||||
91: ["적벽", 330, 325],
|
||||
92: ["파양", 430, 350],
|
||||
93: ["탐라", 605, 260],
|
||||
94: ["유구", 625, 435],
|
||||
};
|
||||
}
|
||||
@@ -128,4 +128,13 @@ function getIconPath(imgsvr, picture){
|
||||
else{
|
||||
return pathConfig.root+'/d_pic/'+picture;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(function($){
|
||||
$('.obj_tooltip').tooltip({
|
||||
title:function(){
|
||||
return $.trim($(this).find('.tooltiptext').html());
|
||||
},
|
||||
html:true
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,908 @@
|
||||
|
||||
$(function() {
|
||||
|
||||
var cityList = {};
|
||||
var userList = {};
|
||||
|
||||
var cityGroupOrder = ['하북','중원','서북','서촉','남중','초','오월','동이'];
|
||||
var city규모 = {특:1,대:2,중:3,소:4,이:5,진:6,관:7,수:8};
|
||||
window.cityList = cityList;
|
||||
window.userList = userList;
|
||||
|
||||
var basicPath = document.location.pathname;
|
||||
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
|
||||
|
||||
|
||||
|
||||
var mergeSort = function(arr,cmpFunc){
|
||||
|
||||
if(typeof cmpFunc == "undefined"){
|
||||
cmpFunc = function(a,b){
|
||||
if(a<b) return -1;
|
||||
if(a>b) return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
var merge = function(left,right){
|
||||
var retVal=[];
|
||||
|
||||
var leftIdx=0;
|
||||
var rightIdx=0;
|
||||
|
||||
while(leftIdx<left.length && rightIdx<right.length){
|
||||
var cmpVal = cmpFunc(left[leftIdx],right[rightIdx]);
|
||||
|
||||
if(cmpVal<=0){
|
||||
retVal.push(left[leftIdx]);
|
||||
leftIdx++;
|
||||
}
|
||||
else{
|
||||
retVal.push(right[rightIdx]);
|
||||
rightIdx++;
|
||||
}
|
||||
}
|
||||
|
||||
retVal = retVal.concat(left.slice(leftIdx)).concat(right.slice(rightIdx))
|
||||
|
||||
return retVal;
|
||||
};
|
||||
|
||||
var _mergeSort = function(arr){
|
||||
if(arr.length<2){
|
||||
return arr;
|
||||
}
|
||||
|
||||
var middle = Math.floor(arr.length/2);
|
||||
|
||||
var left = arr.slice(0,middle);
|
||||
var right = arr.slice(middle);
|
||||
|
||||
return merge(_mergeSort(left),_mergeSort(right));
|
||||
};
|
||||
|
||||
return _mergeSort(arr);
|
||||
|
||||
};
|
||||
|
||||
window.mergeSort = mergeSort;
|
||||
|
||||
var extDutyWindow = function(userInfo){
|
||||
window.currUser = userInfo;
|
||||
//도시 순서 재구성
|
||||
var subCityGroupList = {};
|
||||
var subCityList = {};
|
||||
|
||||
var tmpOldVal = 0;
|
||||
|
||||
//var callCity = function(num){console.log('city no.'+num+' is clicked!')};
|
||||
|
||||
if($('#ext_win').length==0){
|
||||
|
||||
var $win = $('<div id="ext_win" style="padding:0;" title="관직 임명"><table style="padding:0;margin:0;" cellspacing="0" cellpadding="0" border="0"><tr><td width="700px" style="padding:0;"><iframe id="in_frame" src="map.php?type=1&graphic=1" width="700" height="520" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe></td>'+
|
||||
'<td width="305px" style="padding:0;vertical-align:top;height:520px;"><div style="height:520px;width:305px;overflow-y:scroll;overflow-x:hidden;">'+
|
||||
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">시중</th></tr></thead><tbody class="content">'+
|
||||
'</tbody></table></div></td></tr></table>'+
|
||||
'<form name="form1" id="fake_form"><span id="user_name"></span> : <select name="double" id="city_select"></select>'+
|
||||
'<div id="duty_radio" style="display:inline;">'+
|
||||
'<input type="radio" id="duty_type1" value="4" name="duty_radio"><label for="duty_type1">태수</label>'+
|
||||
'<input type="radio" id="duty_type2" value="3" name="duty_radio"><label for="duty_type2">군사</label>'+
|
||||
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">시중</label>'+
|
||||
'</div></form></div>');
|
||||
$win.hide();
|
||||
|
||||
$win.css('font-size','9pt');
|
||||
|
||||
|
||||
|
||||
$('#fake_form').css('display','inline');
|
||||
$('body').append($win);
|
||||
|
||||
$('#inner_table').attr('border','1').attr('cellspacing',"0").attr('cellpadding',"0")
|
||||
.attr('bordercolordark',"gray").attr('bordercolorlight',"black").attr('align','center')
|
||||
.css('font-size','13px').css('width','290px');
|
||||
|
||||
$('#inner_table thead tr');
|
||||
|
||||
$('#fake_form').submit(function(){
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#in_frame').load(function(){
|
||||
$('#in_frame').contents().find('div').click(function(){$('#city_select').change();});
|
||||
});
|
||||
|
||||
$("#duty_radio").buttonset();
|
||||
|
||||
var $city_select = $('#city_select');
|
||||
$city_select.css('color','white').css('background-color','black');
|
||||
|
||||
|
||||
$city_select.change(function(event){
|
||||
if($city_select.val()==null){
|
||||
$city_select.val(tmpOldVal);
|
||||
return false;
|
||||
}
|
||||
|
||||
if($city_select.val() == tmpOldVal){
|
||||
return false;
|
||||
}
|
||||
|
||||
tmpOldVal = $city_select.val();
|
||||
//console.log(tmpOldVal);
|
||||
var newInfo = subCityList[tmpOldVal];
|
||||
var cityInfo = newInfo.city;
|
||||
|
||||
var p태수 = cityInfo.p태수 && currUser.p태수;
|
||||
var p군사 = cityInfo.p군사 && currUser.p군사;
|
||||
var p시중 = cityInfo.p시중 && currUser.p시중;
|
||||
|
||||
//console.log(p태수,p군사,p시중);
|
||||
|
||||
$('#duty_type1').button({disabled:!p태수});
|
||||
$('#duty_type2').button({disabled:!p군사});
|
||||
$('#duty_type3').button({disabled:!p시중});
|
||||
|
||||
var $태수 = cityInfo.$태수;
|
||||
var $군사 = cityInfo.$군사;
|
||||
var $시중 = cityInfo.$시중;
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
$win.dialog({
|
||||
autoOpen:false,
|
||||
width:1005,
|
||||
height:680,
|
||||
buttons:{
|
||||
"임명":function(){
|
||||
//console.log("임명!");
|
||||
|
||||
var $checked = $('#duty_radio :radio:checked');
|
||||
|
||||
if($checked.length==0 || $checked.attr('disabled')=='disabled'){
|
||||
alert('직책을 선택해주세요!');
|
||||
return false;
|
||||
}
|
||||
var type = $checked.attr('value');
|
||||
var text = $checked.next().text();
|
||||
var userVal = currUser.val;
|
||||
var userName = currUser.name;
|
||||
var cityVal = $city_select.val();
|
||||
|
||||
var cityInfo = subCityList[cityVal].city;
|
||||
|
||||
$.post(basicPath+'c_myBossInfo.php',{
|
||||
citylist:cityVal,
|
||||
genlist:userVal,
|
||||
level:type,
|
||||
btn:'임명'
|
||||
},function(rawData){
|
||||
|
||||
cityInfo['p'+text]=false;
|
||||
var $target = cityInfo.users.find('.mode_'+type);
|
||||
$target.prop('disabled',true);
|
||||
$target.css('background','transparent');
|
||||
$target.css('border','0');
|
||||
$target.css('color','');
|
||||
|
||||
cityInfo['$'+text].html(userName);
|
||||
|
||||
$win.dialog("close");
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
"닫기":function(){
|
||||
$win.dialog("close");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//console.log($win.parent());
|
||||
$win.parent().css('font-size','10pt');
|
||||
}
|
||||
|
||||
$('#ext_win').dialog("close").dialog( "option", "position", { my: "center top", at: "center bottom", of: userInfo.$user} );
|
||||
|
||||
var $innerContent = $('#inner_table .content');
|
||||
$innerContent.html('');
|
||||
$("#user_name").html(userInfo.name+'['+userInfo.city+']');
|
||||
|
||||
$('#city_select').html('');
|
||||
|
||||
$.each(cityList,function(idx,cityInfo){
|
||||
var 지역 = cityInfo.지역;
|
||||
|
||||
var p태수 = cityInfo.p태수 && currUser.p태수;
|
||||
var p군사 = cityInfo.p군사 && currUser.p군사;
|
||||
var p시중 = cityInfo.p시중 && currUser.p시중;
|
||||
|
||||
var newInfo = {
|
||||
지역 : 지역,
|
||||
규모 : cityInfo.규모,
|
||||
이름 : cityInfo.이름,
|
||||
val : cityInfo.val,
|
||||
city : cityInfo,
|
||||
p태수 : p태수,
|
||||
p군사 : p군사,
|
||||
p시중 : p시중
|
||||
};
|
||||
|
||||
//console.log(newInfo);
|
||||
|
||||
if(p태수 || p군사 || p시중){
|
||||
if(typeof subCityGroupList[지역] == 'undefined'){
|
||||
subCityGroupList[지역] = [];
|
||||
}
|
||||
subCityGroupList[지역].push(newInfo);
|
||||
subCityList[cityInfo.val] = newInfo;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.each(cityGroupOrder,function(idx,groupName){
|
||||
if(typeof subCityGroupList[groupName] == 'undefined'){
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
var subList = subCityGroupList[groupName];
|
||||
|
||||
var $group = $('<tr><td colspan="4" style="color:skyblue;">【 '+groupName+' 】</td></tr>');
|
||||
$innerContent.append($group);
|
||||
|
||||
subList.sort(function(a,b){
|
||||
|
||||
var cmp규모 = city규모[a.규모] - city규모[b.규모];
|
||||
if(cmp규모 != 0) return cmp규모;
|
||||
|
||||
return a.이름.localeCompare(b.이름);
|
||||
});
|
||||
var $optgroup = $('<optgroup label=" 【 '+groupName+' 】 " style="color:skyblue;"></optgroup>');
|
||||
|
||||
$.each(subList,function(idx,newInfo){
|
||||
$optgroup.append('<option value="'+newInfo.val+'" style="color:white;">'+newInfo.이름+'</option>');
|
||||
|
||||
var cityInfo = newInfo.city;
|
||||
var $city = $('<tr><td>'+newInfo.이름+'</td></tr>');
|
||||
|
||||
var $태수 = cityInfo.$태수.clone();
|
||||
$city.append($태수);
|
||||
if(!newInfo.p태수){
|
||||
$태수.css('color','red');
|
||||
}
|
||||
else{
|
||||
$태수.click(function(){
|
||||
$('#duty_radio :radio:eq(0)').attr('checked','checked');
|
||||
$('#duty_radio :radio').button('refresh');
|
||||
}).css('cursor','pointer');
|
||||
}
|
||||
|
||||
|
||||
var $군사 = cityInfo.$군사.clone();
|
||||
$city.append($군사);
|
||||
if(!newInfo.p군사)$군사.css('color','red');
|
||||
else{
|
||||
$군사.click(function(){
|
||||
$('#duty_radio :radio:eq(1)').attr('checked','checked');
|
||||
$('#duty_radio :radio').button('refresh');
|
||||
}).css('cursor','pointer');
|
||||
}
|
||||
|
||||
var $시중 = cityInfo.$시중.clone();
|
||||
$city.append($시중);
|
||||
if(!newInfo.p시중)$시중.css('color','red');
|
||||
else{
|
||||
$시중.click(function(){
|
||||
$('#duty_radio :radio:eq(2)').attr('checked','checked');
|
||||
$('#duty_radio :radio').button('refresh');
|
||||
}).css('cursor','pointer');
|
||||
}
|
||||
|
||||
$innerContent.append($city);
|
||||
$city.click(function(){
|
||||
$('#city_select').val(newInfo.val).change();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#city_select').append($optgroup);
|
||||
});
|
||||
|
||||
tmpOldVal = $('#city_select').val();
|
||||
$('#city_select').change();
|
||||
$('#ext_win').dialog("open");
|
||||
};
|
||||
|
||||
var loadDuty = function(){
|
||||
|
||||
try{
|
||||
$('.for_duty').remove();
|
||||
$.get(basicPath+'b_myBossInfo.php',function(rawData){
|
||||
$html = $(rawData);
|
||||
//window.$html = $html;
|
||||
|
||||
var cnt =0;
|
||||
var $tmpTable = null;
|
||||
$html.each(function(idx){
|
||||
if(this.tagName == "TABLE"){
|
||||
cnt+=1;
|
||||
if(cnt==5){
|
||||
$tmpTable = $(this);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$selects = $tmpTable.find("select");
|
||||
if($selects.length == 0){
|
||||
alert("수뇌가 아닙니다!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var setUserAvailable = function($userList,typeName){
|
||||
$userList.each(function(idx){
|
||||
var $this = $(this);
|
||||
|
||||
var val = $this.val();
|
||||
var name = $.trim($this.text());
|
||||
|
||||
for(var i=name.length-1;i>0;i--){
|
||||
if(name[i]=='【'){
|
||||
name = $.trim(name.substr(0,i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(val == '0'){
|
||||
return true;
|
||||
}
|
||||
|
||||
if(typeof userList[name] != 'undefined'){
|
||||
userList[name].val = val;
|
||||
userList[name][typeName] = true;
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
var setCityAvailiable = function($cityList,typeName){
|
||||
$cityList.each(function(idx){
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
var val = $.trim($this.val());
|
||||
var name = $.trim($this.text());
|
||||
|
||||
cityList[name].val = val;
|
||||
cityList[name][typeName] = true;
|
||||
});
|
||||
}
|
||||
|
||||
$.each(cityList,function(idx,cityInfo){
|
||||
cityInfo.p태수=false;
|
||||
cityInfo.p군사=false;
|
||||
cityInfo.p시중=false;
|
||||
});
|
||||
|
||||
$.each(userList,function(idx,userInfo){
|
||||
userInfo.p태수=false;
|
||||
userInfo.p군사=false;
|
||||
userInfo.p시중=false;
|
||||
});
|
||||
|
||||
setUserAvailable($selects.eq(1).find("option"),"p태수");
|
||||
setUserAvailable($selects.eq(3).find("option"),"p군사");
|
||||
setUserAvailable($selects.eq(5).find("option"),"p시중");
|
||||
|
||||
setCityAvailiable($selects.eq(0).find("option"),"p태수");
|
||||
setCityAvailiable($selects.eq(2).find("option"),"p군사");
|
||||
setCityAvailiable($selects.eq(4).find("option"),"p시중");
|
||||
|
||||
|
||||
$.each(cityList,function(idx,cityInfo){
|
||||
|
||||
//console.log(cityInfo.users.children());
|
||||
|
||||
cityInfo.users.children().each(function(idx){
|
||||
//console.log(this);
|
||||
var $this = $(this);
|
||||
|
||||
var username = $this.data('username');
|
||||
|
||||
var userInfo = userList[username];
|
||||
if(!userInfo){
|
||||
return true;
|
||||
}
|
||||
|
||||
if(userInfo.val == '-1'){
|
||||
return true;
|
||||
}
|
||||
|
||||
$name = $this.find('.nameplate');
|
||||
|
||||
$name.append('<br class="for_duty">');
|
||||
|
||||
|
||||
var addBtn=function($name,cityInfo,userInfo,type,text,warn){
|
||||
|
||||
var enabled = cityInfo['p'+text]&&userInfo['p'+text];
|
||||
var cityVal = cityInfo.val;
|
||||
var $btn = $('<button>'+text.substr(0,1)+'</button>');
|
||||
$btn.addClass('mode_'+type);
|
||||
$btn.addClass('for_duty');
|
||||
|
||||
if(!enabled){
|
||||
$btn.prop('disabled',true);
|
||||
$btn.css('background','transparent');
|
||||
$btn.css('border','0');
|
||||
}
|
||||
else{
|
||||
if(userInfo.is수뇌){
|
||||
$btn.css('color','red');
|
||||
}
|
||||
}
|
||||
|
||||
$btn.css('padding','1px 4px');
|
||||
$btn.css('margin','0');
|
||||
|
||||
$btn.click(function(){
|
||||
if(userInfo.is수뇌){
|
||||
if(!confirm('수뇌입니다. 임명할까요?')){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$.post(basicPath+'c_myBossInfo.php',{
|
||||
citylist:cityVal,
|
||||
genlist:userInfo.val,
|
||||
level:type,
|
||||
btn:'임명'
|
||||
},function(rawData){
|
||||
|
||||
cityInfo['p'+text]=false;
|
||||
var $target = cityInfo.users.find('.mode_'+type);
|
||||
$target.prop('disabled',true);
|
||||
$target.css('background','transparent');
|
||||
$target.css('border','0');
|
||||
$target.css('color','');
|
||||
|
||||
cityInfo['$'+text].html(userInfo.name);
|
||||
});
|
||||
});
|
||||
|
||||
//console.log($btn);
|
||||
$name.append($btn);
|
||||
};
|
||||
|
||||
addBtn($name,cityInfo,userInfo,4,'태수');
|
||||
addBtn($name,cityInfo,userInfo,3,'군사');
|
||||
addBtn($name,cityInfo,userInfo,2,'시중');
|
||||
|
||||
//특수 버튼!
|
||||
if(userInfo.p태수||userInfo.p군사||userInfo.p시중){
|
||||
var $btn = $('<button>...</button>');
|
||||
$btn.addClass('for_duty');
|
||||
if(userInfo.is수뇌){
|
||||
$btn.css('color','red');
|
||||
}
|
||||
$btn.css('padding','1px 4px');
|
||||
$btn.css('margin','0');
|
||||
|
||||
$btn.click(function(){
|
||||
if(userInfo.is수뇌){
|
||||
if(!confirm('수뇌입니다. 임명할까요?')){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
extDutyWindow(userInfo);
|
||||
});
|
||||
|
||||
$btn.css('border','solid 1px Chocolate').css('background-color','#400000').css('margin-left','4px');
|
||||
$btn.css('line-hight','20px').css('color','GhostWhite').css('padding','2px 2px').css('height','18px').css('line-height','8px');
|
||||
|
||||
//$name.append($btn);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
catch(a){
|
||||
console.log(a);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
var loadUser = function(){
|
||||
$.each(cityList,function(idx,val){
|
||||
if(typeof val.users == "undefined"){
|
||||
val.obj.append('<tr><td colspan="12"><table align="center" class="tb_layout cityUser bg0">'+
|
||||
'<thead><tr>'+
|
||||
'<td width="100" align="center" class="bg1">이 름</td><td width="100" align="center" class="bg1">통무지</td><td width="100" align="center" class="bg1">부 대</td><td width="60" align="center" class="bg1">자 금</td>'+
|
||||
'<td width="60" align="center" class="bg1">군 량</td><td width="30" align="center" class="bg1">守</td><td width="60" align="center" class="bg1">병 종</td>'+
|
||||
'<td width="60" align="center" class="bg1">병 사</td><td width="50" align="center" class="bg1">훈련</td><td width="50" align="center" class="bg1">사기</td><td width="150" align="center" class="bg1">명 령</td>'+
|
||||
'<td width="60" align="center" class="bg1">삭턴</td><td width="60" align="center" class="bg1">턴</td>'+
|
||||
'</tr></thead>'+
|
||||
'<tbody class="cityUserBody"></tbody></table></td></tr>');
|
||||
|
||||
val.users = val.obj.find(".cityUserBody");
|
||||
}
|
||||
else{
|
||||
val.users.html("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$.get(basicPath+'b_genList.php',function(rawData){
|
||||
var cnt =0;
|
||||
|
||||
var $helper = $('#helper_genlist');
|
||||
$helper.html('').append($.parseHTML(rawData));
|
||||
|
||||
var tmpUsers = $('#general_list tbody tr');
|
||||
|
||||
tmpUsers.each(function(idx){
|
||||
var $this = $(this);
|
||||
|
||||
var $city = $this.children('.i_city');
|
||||
$city.remove();
|
||||
var cityName = $.trim($city.text());
|
||||
|
||||
var $name = $this.children('.i_name');
|
||||
$name.addClass('nameplate');
|
||||
|
||||
var name = $name.find('.t_name').text();
|
||||
|
||||
var $work = $this.children('.i_action');
|
||||
|
||||
var cityInfo = cityList[cityName];
|
||||
if(typeof cityInfo == 'undefined'){
|
||||
return true;
|
||||
}
|
||||
if(cityInfo.warn주민)$work.html($work.html().split('정착 장려').join('<span style="color:yellow;">정착 장려</span>'));
|
||||
if(cityInfo.warn농업)$work.html($work.html().split('농지 개간').join('<span style="color:yellow;">농지 개간</span>'));
|
||||
if(cityInfo.warn상업)$work.html($work.html().split('상업 투자').join('<span style="color:yellow;">상업 투자</span>'));
|
||||
if(cityInfo.warn치안)$work.html($work.html().split('치안 강화').join('<span style="color:yellow;">치안 강화</span>'));
|
||||
if(cityInfo.warn수비)$work.html($work.html().split('수비 강화').join('<span style="color:yellow;">수비 강화</span>'));
|
||||
if(cityInfo.warn성벽)$work.html($work.html().split('성벽 보수').join('<span style="color:yellow;">성벽 보수</span>'));
|
||||
|
||||
|
||||
|
||||
var $stat = $this.children('.i_stat');
|
||||
var stat = $stat.text();
|
||||
|
||||
var is수뇌 = stat.indexOf('+')>=0;
|
||||
|
||||
$this.data('username',name);
|
||||
|
||||
if(cityList[cityName].$태수.text() == name){
|
||||
cityList[cityName].$태수.css('color','lightgreen');
|
||||
}
|
||||
if(cityList[cityName].$군사.text() == name){
|
||||
cityList[cityName].$군사.css('color','lightgreen');
|
||||
}
|
||||
if(cityList[cityName].$시중.text() == name){
|
||||
cityList[cityName].$시중.css('color','lightgreen');
|
||||
}
|
||||
|
||||
userList[name]={
|
||||
$city:cityInfo,
|
||||
city:cityName,
|
||||
$user:$this,
|
||||
name:name,
|
||||
val:'-1',
|
||||
p태수:false,
|
||||
p군사:false,
|
||||
p시중:false,
|
||||
is수뇌:is수뇌
|
||||
};
|
||||
|
||||
if(cityList[cityName]){
|
||||
cityList[cityName].users.append($this);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
if($("#loadDutyBtn").length == 0){
|
||||
|
||||
var $onBossList = $('<button id="loadDutyBtn">인사부 연동</button>');
|
||||
$onBossList.click(function(){
|
||||
loadDuty();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('form').append($onBossList);
|
||||
}
|
||||
|
||||
$('#by_users').show();
|
||||
};
|
||||
|
||||
var mainFunc = function(){
|
||||
//대상 추출
|
||||
window.cityList = {};
|
||||
window.userList = {};
|
||||
|
||||
$("form").each(function(){
|
||||
var $this = $(this);
|
||||
$this.attr('name','p'+$this.attr('name'));
|
||||
});
|
||||
|
||||
$("table").each(function(idx,val){
|
||||
$this = $(this);
|
||||
|
||||
|
||||
if($this.attr('class')=='tb_layout bg2'){
|
||||
$this.addClass('cityInfo');
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
|
||||
window.$tmpTable = $this;
|
||||
var cityInfo = {};
|
||||
|
||||
//이름 추출
|
||||
{
|
||||
|
||||
var titleText = $this.find('tr:eq(0)>td:eq(0)').text();
|
||||
var loc0 = titleText.indexOf("【");
|
||||
var loc1 = titleText.indexOf("|");
|
||||
var loc2 = titleText.indexOf("】");
|
||||
|
||||
var cityLoc = $.trim(titleText.substring(loc0+1,loc1));
|
||||
var citySize = $.trim(titleText.substring(loc1+1,loc2));
|
||||
var cityName = $.trim(titleText.substring(loc2+1));
|
||||
|
||||
cityName = cityName.replace("[","");
|
||||
cityName = cityName.replace("]","");
|
||||
|
||||
$this.data('cityname',cityName);
|
||||
|
||||
cityInfo.지역 = cityLoc;
|
||||
cityInfo.규모 = citySize;
|
||||
cityInfo.이름 = cityName;
|
||||
|
||||
cityInfo.val = '-1';
|
||||
|
||||
cityInfo.p태수 = false;
|
||||
cityInfo.p군사 = false;
|
||||
cityInfo.p시중 = false;
|
||||
|
||||
}
|
||||
|
||||
//주민, 농상치성수
|
||||
|
||||
|
||||
{
|
||||
var $baseTr = $this.find('tr:eq(1)');
|
||||
cityInfo.$주민 = $baseTr.find('td:eq(1)');
|
||||
cityInfo.$농업 = $baseTr.find('td:eq(3)');
|
||||
cityInfo.$상업 = $baseTr.find('td:eq(5)');
|
||||
cityInfo.$치안 = $baseTr.find('td:eq(7)');
|
||||
cityInfo.$수비 = $baseTr.find('td:eq(9)');
|
||||
cityInfo.$성벽 = $baseTr.find('td:eq(11)');
|
||||
|
||||
var tmpVal;
|
||||
|
||||
tmpVal = cityInfo.$주민.text().split('/');
|
||||
cityInfo.주민 = parseInt(tmpVal[0]);
|
||||
cityInfo.max주민 = parseInt(tmpVal[1]);
|
||||
|
||||
tmpVal = cityInfo.$농업.text().split('/');
|
||||
cityInfo.농업 = parseInt(tmpVal[0]);
|
||||
cityInfo.max농업 = parseInt(tmpVal[1]);
|
||||
|
||||
tmpVal = cityInfo.$상업.text().split('/');
|
||||
cityInfo.상업 = parseInt(tmpVal[0]);
|
||||
cityInfo.max상업 = parseInt(tmpVal[1]);
|
||||
|
||||
tmpVal = cityInfo.$치안.text().split('/');
|
||||
cityInfo.치안 = parseInt(tmpVal[0]);
|
||||
cityInfo.max치안 = parseInt(tmpVal[1]);
|
||||
|
||||
tmpVal = cityInfo.$수비.text().split('/');
|
||||
cityInfo.수비 = parseInt(tmpVal[0]);
|
||||
cityInfo.max수비 = parseInt(tmpVal[1]);
|
||||
|
||||
tmpVal = cityInfo.$성벽.text().split('/');
|
||||
cityInfo.성벽 = parseInt(tmpVal[0]);
|
||||
cityInfo.max성벽 = parseInt(tmpVal[1]);
|
||||
|
||||
if (cityInfo.주민>cityInfo.max주민*0.9){ cityInfo.$주민.css('color','lightgreen');}
|
||||
else if (cityInfo.주민>cityInfo.max주민*0.7){ cityInfo.$주민.css('color','yellow');}
|
||||
else { cityInfo.$주민.css('color','orangered');}
|
||||
|
||||
if (cityInfo.농업>cityInfo.max농업*0.8){ cityInfo.$농업.css('color','lightgreen');}
|
||||
else if (cityInfo.농업>cityInfo.max농업*0.4){ cityInfo.$농업.css('color','yellow');}
|
||||
else { cityInfo.$농업.css('color','orangered');}
|
||||
|
||||
if (cityInfo.상업>cityInfo.max상업*0.8){ cityInfo.$상업.css('color','lightgreen');}
|
||||
else if (cityInfo.상업>cityInfo.max상업*0.4){ cityInfo.$상업.css('color','yellow');}
|
||||
else { cityInfo.$상업.css('color','orangered');}
|
||||
|
||||
if (cityInfo.치안>cityInfo.max치안*0.8){ cityInfo.$치안.css('color','lightgreen');}
|
||||
else if (cityInfo.치안>cityInfo.max치안*0.4){ cityInfo.$치안.css('color','yellow');}
|
||||
else { cityInfo.$치안.css('color','orangered');}
|
||||
|
||||
if (cityInfo.수비>cityInfo.max수비*0.6){ cityInfo.$수비.css('color','lightgreen');}
|
||||
else if (cityInfo.수비>cityInfo.max수비*0.3){ cityInfo.$수비.css('color','yellow');}
|
||||
else { cityInfo.$수비.css('color','orangered');}
|
||||
|
||||
if (cityInfo.성벽>cityInfo.max성벽*0.6){ cityInfo.$성벽.css('color','lightgreen');}
|
||||
else if (cityInfo.성벽>cityInfo.max성벽*0.3){ cityInfo.$성벽.css('color','yellow');}
|
||||
else { cityInfo.$성벽.css('color','orangered');}
|
||||
|
||||
|
||||
cityInfo.remain주민 = cityInfo.주민-cityInfo.max주민;
|
||||
cityInfo.remain농업 = cityInfo.농업-cityInfo.max농업;
|
||||
cityInfo.remain상업 = cityInfo.상업-cityInfo.max상업;
|
||||
cityInfo.remain치안 = cityInfo.치안-cityInfo.max치안;
|
||||
cityInfo.remain수비 = cityInfo.수비-cityInfo.max수비;
|
||||
cityInfo.remain성벽 = cityInfo.성벽-cityInfo.max성벽;
|
||||
|
||||
cityInfo.warn주민 = false;
|
||||
cityInfo.warn농업 = false;
|
||||
cityInfo.warn상업 = false;
|
||||
cityInfo.warn치안 = false;
|
||||
cityInfo.warn수비 = false;
|
||||
cityInfo.warn성벽 = false;
|
||||
|
||||
if(cityInfo.remain주민 > -10*2000) cityInfo.warn주민 = true;
|
||||
if(cityInfo.주민 > 0.92*cityInfo.max주민) cityInfo.warn주민 = true;
|
||||
if(cityInfo.remain농업 > -10*100) cityInfo.warn농업 = true;
|
||||
if(cityInfo.remain상업 > -10*100) cityInfo.warn상업 = true;
|
||||
if(cityInfo.remain치안 > -10*100) cityInfo.warn치안 = true;
|
||||
if(cityInfo.remain수비 > -10*70) cityInfo.warn수비 = true;
|
||||
if(cityInfo.remain성벽 > -10*70) cityInfo.warn성벽 = true;
|
||||
|
||||
if(cityInfo.warn농업) cityInfo.$농업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain농업+']</span>');
|
||||
if(cityInfo.warn상업) cityInfo.$상업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain상업+']</span>');
|
||||
if(cityInfo.warn치안) cityInfo.$치안.append('<span class="remain" style="color:yellow;">['+cityInfo.remain치안+']</span>');
|
||||
if(cityInfo.warn수비) cityInfo.$수비.append('<span class="remain" style="color:yellow;">['+cityInfo.remain수비+']</span>');
|
||||
if(cityInfo.warn성벽) cityInfo.$성벽.append('<span class="remain" style="color:yellow;">['+cityInfo.remain성벽+']</span>');
|
||||
|
||||
}
|
||||
|
||||
//태수,군사,시중
|
||||
{
|
||||
var $baseTr = $this.find('tr:eq(2)');
|
||||
cityInfo.$태수 = $baseTr.find('td:eq(7)');
|
||||
cityInfo.$군사 = $baseTr.find('td:eq(9)');
|
||||
cityInfo.$시중 = $baseTr.find('td:eq(11)');
|
||||
}
|
||||
|
||||
//기타
|
||||
{
|
||||
|
||||
cityInfo.userCnt = $this.find('tr:eq(3) td:eq(1)').text().split(',').length -1;
|
||||
}
|
||||
|
||||
cityInfo.obj = $this;
|
||||
cityList[cityInfo.이름] = cityInfo;
|
||||
});
|
||||
|
||||
|
||||
var $onGenList = $('<button>암행부 연동</button>');
|
||||
$onGenList.click(function(){
|
||||
loadUser();
|
||||
return false;
|
||||
});
|
||||
$('form').append($onGenList);
|
||||
|
||||
|
||||
$('table:eq(0) tr:last').after('<tr><td id="sort_more"></td></tr>');
|
||||
|
||||
|
||||
$sort_more = $('#sort_more');
|
||||
$sort_more.html('재 정렬 순서 :');
|
||||
|
||||
var sortIt = function(callback){
|
||||
var arCity = [];
|
||||
$('.cityInfo').each(function(){
|
||||
var $this = $(this);
|
||||
var cityName = $this.data('cityname');
|
||||
|
||||
var cityInfo = cityList[cityName];
|
||||
arCity.push(cityInfo);
|
||||
});
|
||||
|
||||
arCity = mergeSort(arCity,callback);
|
||||
//console.log(arCity);
|
||||
|
||||
var $anchor = $('.anchor');
|
||||
//console.log($anchor);
|
||||
|
||||
$('body > br').remove();
|
||||
|
||||
$('.cityInfo').detach();
|
||||
|
||||
$.each(arCity,function(idx,val){
|
||||
$anchor.before('<br>');
|
||||
$anchor.before(val.obj);
|
||||
});
|
||||
$anchor.before('<br>');
|
||||
|
||||
};
|
||||
|
||||
var $btn;
|
||||
|
||||
$btn = $('<button>도시명</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.이름.localeCompare(b.이름);
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>인구율</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return 1.0*a.주민/a.max주민 - 1.0*b.주민/b.max주민;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 주민</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain주민 - b.remain주민;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 농업</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain농업 - b.remain농업;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 상업</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain상업 - b.remain상업;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 치안</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain치안 - b.remain치안;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 수비</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain수비 - b.remain수비;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>남은 성벽</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return a.remain성벽 - b.remain성벽;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
|
||||
$btn = $('<button>배치 장수 수</button>').click(function(){
|
||||
sortIt(function(a,b){
|
||||
return b.userCnt - a.userCnt;
|
||||
});
|
||||
});
|
||||
$sort_more.append($btn);
|
||||
};
|
||||
|
||||
mainFunc();
|
||||
});
|
||||