Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70b1f23a49 | ||
|
|
5e4493b49a | ||
|
|
dec24e09cf | ||
|
|
95445d8f8a | ||
|
|
683a844a08 | ||
|
|
a75eb5b74e | ||
|
|
5dfb844c7e | ||
|
|
20f991a205 | ||
|
|
3c1c339498 | ||
|
|
5974028c4d | ||
|
|
a534b8f812 | ||
|
|
cb2fbf1a32 | ||
|
|
a1392652ae | ||
|
|
69af23b60a | ||
|
|
063b3d37a6 | ||
|
|
ebf9b4b75d | ||
|
|
45fd06c195 | ||
|
|
7db3675e71 | ||
|
|
a19661199e | ||
|
|
953196ec78 | ||
|
|
d5be6e3e08 | ||
|
|
551b79d8c2 | ||
|
|
a242b9a20e | ||
|
|
19e91b2de0 | ||
|
|
a1397e41aa | ||
|
|
13fccb998e | ||
|
|
1e54220230 | ||
|
|
6b2000bb39 | ||
|
|
5f3fbdb089 | ||
|
|
63e888c9b1 | ||
|
|
e97e702c2e | ||
|
|
657c35f876 | ||
|
|
bc79250f96 | ||
|
|
dd7846e995 | ||
|
|
8a5483d508 | ||
|
|
805053e921 | ||
|
|
170a32a1bd | ||
|
|
5262d424b4 | ||
|
|
9c3c1045ac | ||
|
|
2d1a3f5da9 | ||
|
|
088260bbc6 | ||
|
|
18ebbbc555 | ||
|
|
80b70a8765 | ||
|
|
d3d4cce8b5 | ||
|
|
76bfcd4fa8 | ||
|
|
7cbe383a8a | ||
|
|
0488ebf071 | ||
|
|
1cfab53472 | ||
|
|
084c7a2626 | ||
|
|
161836a233 | ||
|
|
c86ac7d20f | ||
|
|
20cceec090 | ||
|
|
62c6ba362d | ||
|
|
5ed31881e6 | ||
|
|
647c51fe0f | ||
|
|
a2d3ac9e70 | ||
|
|
20f74f6645 | ||
|
|
0bb1ed6f18 | ||
|
|
2102a852cb | ||
|
|
0cfb80b7bf | ||
|
|
4297ea9e40 | ||
|
|
0ce36e93bd | ||
|
|
18bd5f4246 | ||
|
|
2e7bcd9038 | ||
|
|
bfef0c28bc | ||
|
|
b447065651 | ||
|
|
f540f87e77 | ||
|
|
6ebe3454af | ||
|
|
7e00500870 | ||
|
|
bc37dd1df7 | ||
|
|
77aca09f53 | ||
|
|
23fb1194ee | ||
|
|
6253b757ec | ||
|
|
9122342fb9 | ||
|
|
fb42a32089 | ||
|
|
5c7f4c43ae | ||
|
|
3da256cc29 | ||
|
|
717c576cba | ||
|
|
ddb4011b5d | ||
|
|
48207b9300 | ||
|
|
388afe6fb4 | ||
|
|
99b459766a | ||
|
|
230fc5ba53 | ||
|
|
9c266b7b1c | ||
|
|
603599d666 | ||
|
|
b3cd29ac95 | ||
|
|
a4beab86c2 | ||
|
|
3a84e0d064 | ||
|
|
31f1eb2d28 | ||
|
|
d73c0c6f0c | ||
|
|
36409cf066 | ||
|
|
556e1059f9 | ||
|
|
131a6cb6c3 | ||
|
|
598943eb1b | ||
|
|
bf746393b8 | ||
|
|
70b6997436 | ||
|
|
b26c6a04c0 | ||
|
|
4f262a03e4 | ||
|
|
a0ca3dc3f6 | ||
|
|
f58736277f | ||
|
|
473cae169e | ||
|
|
4b956385bd | ||
|
|
481494a885 | ||
|
|
243604d6c1 | ||
|
|
dc97c71e0b | ||
|
|
e6b4832b5d | ||
|
|
00ac67e8ac | ||
|
|
953b609b32 | ||
|
|
a5875be39b | ||
|
|
0f45de8384 | ||
|
|
d119200287 | ||
|
|
b9fa0bea6e | ||
|
|
3a28180700 | ||
|
|
5b6f456d5c | ||
|
|
fb1ae6ea88 | ||
|
|
50582a0e8b | ||
|
|
8fe3d0258a | ||
|
|
f2537b20de | ||
|
|
31d6850e6e | ||
|
|
31468d5425 | ||
|
|
688b839315 | ||
|
|
fa4c9046fc | ||
|
|
c7560f9113 | ||
|
|
f7e3966310 | ||
|
|
7359237da4 | ||
|
|
d617203c05 | ||
|
|
910526ba44 | ||
|
|
c1842703d7 | ||
|
|
2f9d2e2bc2 | ||
|
|
20d7e005a0 | ||
|
|
0ce5a88e49 | ||
|
|
4af10fb485 | ||
|
|
f872113e99 | ||
|
|
f33fefd188 | ||
|
|
8c2f4f9dc9 | ||
|
|
3b6e7c5c28 | ||
|
|
595c11a9a7 | ||
|
|
1ab7b57885 | ||
|
|
07130e6022 | ||
|
|
2cc2f7eb23 | ||
|
|
c798ac49b9 | ||
|
|
a8796edbd3 | ||
|
|
a4ead74cb2 | ||
|
|
0beb00c5e5 | ||
|
|
3d43690303 | ||
|
|
938c819e9a | ||
|
|
889ced68ed | ||
|
|
de97384424 | ||
|
|
f6ffc20a23 | ||
|
|
c0ec82051f | ||
|
|
91273522c0 | ||
|
|
20a475466d | ||
|
|
10b6a4ff6e | ||
|
|
2a4e59d6e2 | ||
|
|
c016ea7c52 | ||
|
|
00bece9c9c | ||
|
|
44ed61c14e | ||
|
|
002b7ae534 | ||
|
|
63000bdd22 | ||
|
|
20fd52b32d | ||
|
|
7a3064d37b | ||
|
|
7fea0a41c6 | ||
|
|
e701540d7f | ||
|
|
5187ebbf52 | ||
|
|
df26c511b5 | ||
|
|
0e650da34a | ||
|
|
2c382da773 | ||
|
|
e709ee5db8 | ||
|
|
d550415b65 | ||
|
|
9ec144e8f6 | ||
|
|
9458307612 | ||
|
|
915c5fcd8e | ||
|
|
0df1293139 | ||
|
|
9bcd18c42e | ||
|
|
1c853107b7 | ||
|
|
3f21e28ef7 | ||
|
|
61244fcef9 | ||
|
|
03c930ce7d | ||
|
|
f57c4967f2 | ||
|
|
49f40d56b0 | ||
|
|
190fcabbac | ||
|
|
8bccf449ad | ||
|
|
f7dc1a588b | ||
|
|
0eb91c6301 | ||
|
|
0fa4d88ea9 | ||
|
|
18e355b701 | ||
|
|
1cb877503d | ||
|
|
b65e691255 | ||
|
|
a4ee43f12b | ||
|
|
f71c61a55b | ||
|
|
418130f4cd | ||
|
|
1566aa0243 | ||
|
|
ab546f66f0 | ||
|
|
fc021dae54 | ||
|
|
58a7b3afe1 | ||
|
|
72f41df5d2 | ||
|
|
8fd6b91cf7 | ||
|
|
cf2ace32d1 | ||
|
|
05c4f721f2 | ||
|
|
b2096cc274 | ||
|
|
067df49914 | ||
|
|
6961298e53 | ||
|
|
3e6523002c | ||
|
|
c26add7b04 | ||
|
|
12d50fec03 | ||
|
|
a43bbc9f23 | ||
|
|
2bec3b253c | ||
|
|
a69f256168 | ||
|
|
d7fb88eed6 | ||
|
|
bfd79f479e | ||
|
|
7ec3fcc78e | ||
|
|
858a09b429 | ||
|
|
da7fcafb27 | ||
|
|
7f7d8b2099 | ||
|
|
b5fb2e9cf4 | ||
|
|
d9ffdf9df8 | ||
|
|
f919187b91 | ||
|
|
d5ead5b74f | ||
|
|
ec1be2c887 | ||
|
|
af0c470923 | ||
|
|
78ce7d20e3 | ||
|
|
932ce9bf51 | ||
|
|
3d602b49bf | ||
|
|
33b7d228f9 | ||
|
|
95a8fd5495 | ||
|
|
87bc416fc7 | ||
|
|
8c21eec168 | ||
|
|
7ef3f0d5c5 | ||
|
|
e90e508005 | ||
|
|
816daed570 | ||
|
|
3626266763 | ||
|
|
6c117a628c | ||
|
|
d3225dfb41 | ||
|
|
bd7e7540d8 | ||
|
|
48088748df | ||
|
|
7a5eecc3e1 | ||
|
|
51d7dede55 | ||
|
|
bcad77ec06 | ||
|
|
9b79d12521 | ||
|
|
4b33461c70 | ||
|
|
c2298efaf0 |
@@ -30,6 +30,7 @@ d_pic/*.png
|
||||
|
||||
d_setting/*.php
|
||||
*/d_setting/*.php
|
||||
*/d_setting/templates/*.php
|
||||
|
||||
**/old/*
|
||||
test.php
|
||||
|
||||
+22
-39
@@ -1,14 +1,16 @@
|
||||
@charset "utf-8";
|
||||
|
||||
* { margin: 0px; padding: 0px; }
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table {
|
||||
body {
|
||||
color:white; background-color:black; font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
table {
|
||||
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
font-family: '맑은 고딕'; line-height: 110%;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
th, td {
|
||||
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
|
||||
@@ -16,21 +18,15 @@ th, td {
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
font-family: '맑은 고딕'; line-height: 110%;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
a.just_link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div {
|
||||
margin:0px;
|
||||
padding: 0px;
|
||||
word-break: break-all;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.with_border{
|
||||
margin:0;
|
||||
border: solid 1px;
|
||||
border-spacing: 0px;
|
||||
border-collapse: separate;
|
||||
@@ -45,6 +41,8 @@ div {
|
||||
line-height:50px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
text-align: center;
|
||||
color:white;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.legacy_layout div {
|
||||
@@ -53,20 +51,9 @@ div {
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
font-family: '맑은 고딕'; line-height: 110%;
|
||||
font-family: '맑은 고딕';;
|
||||
}
|
||||
|
||||
font { font-family: '맑은 고딕'; line-height: 110%; }
|
||||
/*
|
||||
input {
|
||||
width: 100px; height: 18px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
line-height: 110%;
|
||||
}
|
||||
*/
|
||||
|
||||
.obj_fill{
|
||||
display:block;
|
||||
width:100%;
|
||||
@@ -77,28 +64,20 @@ button.with_skin {
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
button.with_skin:disabled {
|
||||
background-color:#333333;
|
||||
}
|
||||
|
||||
input.with_skin {
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100px; height: 18px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
line-height: 110%;
|
||||
}
|
||||
button {
|
||||
width: 100px; height: 20px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
input.with_skin:disabled {
|
||||
background-color: #333333;
|
||||
}
|
||||
|
||||
.font0 { font-size: 10px; }
|
||||
@@ -106,4 +85,8 @@ button {
|
||||
.font2 { font-size: 15px; }
|
||||
.font3 { font-size: 20px; }
|
||||
.font4 { font-size: 30px; }
|
||||
.font5 { font-size: 50px; }
|
||||
.font5 { font-size: 50px; }
|
||||
|
||||
caption.section_title {
|
||||
caption-side:top;
|
||||
}
|
||||
+5
-93
@@ -1,5 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
body{
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
#server_notice {
|
||||
margin:10px 0;
|
||||
border: none;
|
||||
@@ -55,77 +59,6 @@
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/*Legacy*/
|
||||
|
||||
|
||||
#Entrance_00 {
|
||||
width: 800px;
|
||||
position: absolute; top: 50px; left: 50%;
|
||||
margin-left: -400px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#Entrance_0004 {
|
||||
width: 52px; height: 52px;
|
||||
position: absolute; top: 0px; left: -62px;
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
#Entrance_0005 {
|
||||
width: 160px; height: 600px;
|
||||
position: absolute; top: 62px; left: -170px;
|
||||
}
|
||||
|
||||
#Entrance_0006 {
|
||||
width: 160px; height: 600px;
|
||||
position: absolute; top: 62px; left: 810px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#Entrance_0000 {
|
||||
width: 800px; height: 134px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_000000 {
|
||||
width: 798px; height: 50px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_000001 {
|
||||
width: 798px; height: 20px;
|
||||
position: absolute; top: 52px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#Entrance_00000000 {
|
||||
width: 98px; height: 20px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_00000001 {
|
||||
width: 398px; height: 20px;
|
||||
position: absolute; top: 0px; left: 100px;
|
||||
}
|
||||
|
||||
#Entrance_00000002 {
|
||||
width: 178px; height: 20px;
|
||||
position: absolute; top: 0px; left: 500px;
|
||||
}
|
||||
|
||||
#Entrance_00000003 {
|
||||
width: 118px; height: 20px;
|
||||
position: absolute; top: 0px; left: 680px;
|
||||
}
|
||||
|
||||
#Entrance_000002 {
|
||||
width: 798px; height: 64px;
|
||||
position: absolute; top: 74px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.Entrance_ServerList {
|
||||
width: 800px; height: 64px;
|
||||
border: none;
|
||||
@@ -197,25 +130,4 @@
|
||||
|
||||
.Entrance_Hwe {
|
||||
color: red; font-size: 15px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_0001 {
|
||||
width: 800px; height: 130px;
|
||||
position: absolute; top: 154px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_000100 {
|
||||
width: 798px; height: 50px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_000101 {
|
||||
width: 200px; height: 50px;
|
||||
position: absolute; top: 65px; left: 150px;
|
||||
}
|
||||
|
||||
#Entrance_000102 {
|
||||
width: 200px; height: 50px;
|
||||
position: absolute; top: 65px; left: 450px;
|
||||
}
|
||||
}
|
||||
+42
-1
@@ -62,8 +62,21 @@ input::-webkit-input-placeholder {
|
||||
}
|
||||
|
||||
|
||||
.col-form-label{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.terms{
|
||||
max-height: 200px; overflow: auto;
|
||||
max-height: 200px; overflow-y: auto;
|
||||
}
|
||||
|
||||
.terms pre{
|
||||
width:100%;
|
||||
white-space: pre-wrap; /* Since CSS 2.1 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
.vertical-center {
|
||||
@@ -72,4 +85,32 @@ input::-webkit-input-placeholder {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#btn_kakao_login{
|
||||
cursor: pointer;
|
||||
height:46px;
|
||||
width:116px;
|
||||
background-color: transparent;
|
||||
color:transparent;
|
||||
border:0;
|
||||
background-size: 100%; /* To fill the dimensions of container (button), or */
|
||||
background-repeat: no-repeat;
|
||||
background-position: bottom center;
|
||||
margin-top:5px;
|
||||
background-image:url('../oauth_kakao/kakao_login_join.png');
|
||||
}
|
||||
|
||||
#btn_kakao_login:hover {
|
||||
background-image:url('../oauth_kakao/kakao_login_join_ov.png');
|
||||
}
|
||||
|
||||
#bottom_box{
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
width:100%;
|
||||
left:0;
|
||||
}
|
||||
#bottom_box .container{
|
||||
text-align:center;
|
||||
}
|
||||
+11
-173
@@ -21,6 +21,7 @@
|
||||
right: 6px;
|
||||
margin:6px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
}
|
||||
|
||||
#btn_delete_me{
|
||||
@@ -37,15 +38,15 @@
|
||||
|
||||
#image_upload_filename{
|
||||
position:absolute;
|
||||
height:16px;
|
||||
height:20px;
|
||||
left:10px;
|
||||
width:130px;
|
||||
top:16px;
|
||||
top:12px;
|
||||
}
|
||||
|
||||
#image_upload_fake_btn{
|
||||
top:16px;
|
||||
height:20px;
|
||||
top:12px;
|
||||
height:22px;
|
||||
right:10px;
|
||||
position:absolute;
|
||||
}
|
||||
@@ -53,8 +54,7 @@
|
||||
#image_upload{
|
||||
opacity: 0;
|
||||
position:absolute;
|
||||
top:16px;
|
||||
height:22px;
|
||||
top:12px;
|
||||
left:0;
|
||||
height:20px;
|
||||
width:100%;
|
||||
@@ -70,7 +70,6 @@
|
||||
bottom:0;
|
||||
left:0;
|
||||
width:50%;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
#btn_remove_icon{
|
||||
@@ -78,171 +77,10 @@
|
||||
bottom:0;
|
||||
right:0;
|
||||
width:50%;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
#EntranceManage_00 {
|
||||
width: 500px; height: 409px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#EntranceManage_0000 {
|
||||
width: 498px; height: 50px;
|
||||
}
|
||||
|
||||
#EntranceManage_0001 {
|
||||
width: 100px; height: 30px;
|
||||
}
|
||||
|
||||
#EntranceManage_0002 {
|
||||
width: 498px; height: 25px;
|
||||
}
|
||||
|
||||
#EntranceManage_0003 {
|
||||
width: 98px; height: 84px;
|
||||
line-height: 84px;
|
||||
}
|
||||
|
||||
#EntranceManage_0004 {
|
||||
width: 148px; height: 84px;
|
||||
line-height: 84px;
|
||||
}
|
||||
|
||||
#EntranceManage_0005 {
|
||||
width: 98px; height: 84px;
|
||||
line-height: 84px;
|
||||
}
|
||||
|
||||
#EntranceManage_0006 {
|
||||
width: 148px; height: 84px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#EntranceManage_000600 {
|
||||
width: 80px; height: 17px;
|
||||
}
|
||||
|
||||
#EntranceManage_000601 {
|
||||
width: 80px; height: 17px;
|
||||
}
|
||||
|
||||
#EntranceManage_000602 {
|
||||
width: 80px; height: 17px;
|
||||
}
|
||||
|
||||
#EntranceManage_000603 {
|
||||
width: 144px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0007 {
|
||||
width: 98px; height: 64px;
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0008 {
|
||||
width: 148px; height: 64px;
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0009 {
|
||||
width: 98px; height: 64px;
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0010 {
|
||||
width: 148px; height: 64px;
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0011 {
|
||||
width: 98px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0012 {
|
||||
width: 148px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0013 {
|
||||
width: 248px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0014 {
|
||||
width: 98px; height: 64px;
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0015 {
|
||||
width: 148px; height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_001500 {
|
||||
width: 64px; height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_001501 {
|
||||
width: 64px; height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_0016 {
|
||||
width: 248px; height: 64px;
|
||||
}
|
||||
|
||||
#EntranceManage_001600 {
|
||||
width: 100px; height: 16px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#EntranceManage_001601 {
|
||||
width: 70px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_001602 {
|
||||
width: 85px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_001603 {
|
||||
width: 85px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0017 {
|
||||
width: 98px; height: 100px;
|
||||
line-height: 100px;
|
||||
}
|
||||
|
||||
#EntranceManage_0018 {
|
||||
width: 398px; height: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#EntranceManage_0019 {
|
||||
width: 149px; height: 20px;
|
||||
}
|
||||
|
||||
#EntranceManage_0020 {
|
||||
width: 500px; height: 20px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#EntranceManage_002000 {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
#EntranceManage_00200000 {
|
||||
width: 498px; height: 20px;
|
||||
}
|
||||
|
||||
.EntranceManage_Sequence {
|
||||
width: 48px; height: 20px;
|
||||
}
|
||||
|
||||
.EntranceManage_Date {
|
||||
width: 148px; height: 20px;
|
||||
}
|
||||
|
||||
.EntranceManage_Amount {
|
||||
width: 148px; height: 20px;
|
||||
}
|
||||
|
||||
.EntranceManage_Cumul {
|
||||
width: 148px; height: 20px;
|
||||
}
|
||||
#third_use_disallow{
|
||||
display:none;
|
||||
margin-left:10px;
|
||||
width:40px;
|
||||
}
|
||||
+5
-1
@@ -2,11 +2,14 @@
|
||||
namespace sammo;
|
||||
|
||||
define('ROOT', realpath(__dir__.'/..'));
|
||||
|
||||
date_default_timezone_set('Asia/Seoul');
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_http_output('UTF-8');
|
||||
mb_regex_encoding('UTF-8');
|
||||
|
||||
ini_set("session.cache_expire", 10080); // minutes
|
||||
ini_set("session.gc_maxlifetime", 604800); // seconds
|
||||
|
||||
function getFriendlyErrorType($type)
|
||||
{
|
||||
switch($type)
|
||||
@@ -79,6 +82,7 @@ function logExceptionByCustomHandler(\Throwable $e){
|
||||
], Json::PRETTY);
|
||||
|
||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
||||
echo $e->getTraceAsString();
|
||||
throw $e;
|
||||
}
|
||||
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
||||
@@ -24,7 +24,7 @@ $rootDB->error_handler = function($params){
|
||||
]);
|
||||
};
|
||||
|
||||
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER');
|
||||
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
|
||||
if($memberCnt == 0){
|
||||
Json::die([
|
||||
'step'=>'admin',
|
||||
|
||||
@@ -216,6 +216,13 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
true
|
||||
);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/menu.orig.js',
|
||||
ROOT.'/d_shared/menu.js',
|
||||
[],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
DROP TABLE IF EXISTS `system`;
|
||||
DROP TABLE IF EXISTS `member`;
|
||||
DROP TABLE IF EXISTS `member_log`;
|
||||
DROP TABLE IF EXISTS `config`;
|
||||
|
||||
-- 시스템 테이블
|
||||
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
|
||||
@@ -25,6 +26,7 @@ CREATE TABLE `member` (
|
||||
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
|
||||
`PW` CHAR(128) NOT NULL,
|
||||
`salt` CHAR(16) NOT NULL,
|
||||
`third_use` INT(1) NOT NULL DEFAULT '0',
|
||||
`NAME` VARCHAR(64) NOT NULL,
|
||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||
@@ -53,4 +55,13 @@ CREATE TABLE `member_log` (
|
||||
INDEX `action` (`member_no`, `action_type`, `date`),
|
||||
INDEX `member` (`member_no`, `date`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `config` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`key` VARCHAR(50) NOT NULL,
|
||||
`value` VARCHAR(100) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `key` (`key`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
@@ -29,6 +29,8 @@ class RootDB
|
||||
if (self::$uDB === null) {
|
||||
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
|
||||
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
|
||||
|
||||
self::$uDB->error_handler= function(){};
|
||||
self::$uDB->throw_exception_on_error = true;
|
||||
self::$uDB->throw_exception_on_nonsql_error = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
window.sammo_menu = [
|
||||
['/bbs/board', '삼모게시판', '_blank'],
|
||||
['/bbs/tip', '팁/강좌', '_blank'],
|
||||
['/bbs/news', '삼국 일보', '_blank'],
|
||||
['/bbs/history2', '개인 열전', '_blank'],
|
||||
['/bbs/history3', '국가 열전', '_blank'],
|
||||
['/bbs/patch', '패치 내역', '_blank']
|
||||
];
|
||||
+1
-1
@@ -5,7 +5,7 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
if($session->userGrade < 5) {
|
||||
if($session->userGrade < 4) {
|
||||
?><!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ include "func.php";
|
||||
|
||||
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
if($session->userGrade < 5){
|
||||
if($session->userGrade < 4){
|
||||
header('location:_119.php');
|
||||
die();
|
||||
}
|
||||
|
||||
+233
-192
@@ -24,283 +24,324 @@ if(!$generalID){
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
|
||||
switch($btn) {
|
||||
case "전체 접속허용":
|
||||
$query = "update general set con=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'con'=>0
|
||||
], true);
|
||||
break;
|
||||
case "전체 접속제한":
|
||||
$query = "update general set con=1000";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'con'=>1000
|
||||
], true);
|
||||
break;
|
||||
case "블럭 해제":
|
||||
$db->update('general', [
|
||||
'block'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
DB::db()->query('update general set block=0 where no IN %li', $genlist);
|
||||
break;
|
||||
case "1단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
|
||||
//FIXME: subquery로 하는게 더 빠를 듯.
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where no IN %ls', $date, $uid);
|
||||
$db->update('general', [
|
||||
'block'=>1,
|
||||
'killturn'=>24
|
||||
], '`no` IN %li', $genlist);
|
||||
$uid = $db->queryFirstColumn('SELECT `owner` FROM general WHERE `no` IN %li', $genlist);
|
||||
RootDB::db()->update('member',[
|
||||
'block_num'=>$db->sqleval('block_num+1'),
|
||||
'block_date'=>$date
|
||||
], 'id IN %li', $uid);
|
||||
break;
|
||||
case "2단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db = DB::db();
|
||||
$db->query('update general set gold=0,rice=0,block=2,killturn=24 where no IN %li',$genlist);
|
||||
$db->update('general', [
|
||||
'gold'=>0,
|
||||
'rice'=>0,
|
||||
'block'=>2,
|
||||
'killturn'=>24
|
||||
], '`no` IN %li', $genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
RootDB::db()->update('member',[
|
||||
'block_num'=>$db->sqleval('block_num+1'),
|
||||
'block_date'=>$date
|
||||
], 'id IN %li', $uid);
|
||||
break;
|
||||
case "3단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db = DB::db();
|
||||
$db->query('update general set gold=0,rice=0,block=3,killturn=24 where no IN %li',$genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
$db->update('general', [
|
||||
'gold'=>0,
|
||||
'rice'=>0,
|
||||
'block'=>3,
|
||||
'killturn'=>24
|
||||
], '`no` IN %li', $genlist);
|
||||
$uid = $db->queryFirstColumn('SELECT `owner` from general where no IN %li', $genlist);
|
||||
RootDB::db()->update('member',[
|
||||
'block_num'=>$db->sqleval('block_num+1'),
|
||||
'block_date'=>$date
|
||||
], 'id IN %li', $uid);
|
||||
break;
|
||||
case "무한삭턴":
|
||||
DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
|
||||
$db->update('general', [
|
||||
'killturn'=>8000
|
||||
], '`no` IN %li', $genlist);
|
||||
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->update('general', [
|
||||
'turn0'=>0,
|
||||
'killturn'=>0,
|
||||
'turntime'=>$date,
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "특기 부여":
|
||||
$admin = DB::db()->queryFirstRow('select `year`, `month` from `game` where `no`=1');
|
||||
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
|
||||
$text = "특기 부여!";
|
||||
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "특기 부여!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "select no,leader,power,intel from general where no='$genlist[$i]'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
|
||||
$special2 = getSpecial2($general['leader'], $general['power'], $general['intel']);
|
||||
|
||||
$query = "update general set specage2=age,special2='$special2' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log[0] = "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득");
|
||||
pushGenLog($general, $log);
|
||||
$specialWar = SpecialityConst::pickSpecialWar($general);
|
||||
$db->update('general', [
|
||||
'specage2'=>$db->sqleval('age'),
|
||||
'special2'=>$specialWar
|
||||
], 'no=%i', $general['no']);
|
||||
$specialWarName = SpecialityConst::WAR[$specialWar][0];
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:특기 【<b><C>{$specialWarName}</></b>】(을)를 습득");
|
||||
pushGenLog($general, ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】(을)를 익혔습니다!"]);
|
||||
}
|
||||
|
||||
break;
|
||||
case "경험치1000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = $btn." 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set experience=experience+1000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$text = $btn." 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'experience'=>$db->sqleval('experience+1000')
|
||||
], '`no` IN %li', $genlist);
|
||||
|
||||
break;
|
||||
case "공헌치1000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = $btn." 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dedication=dedication+1000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$text = $btn." 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dedication'=>$db->sqleval('dedication+1000')
|
||||
], '`no` IN %li', $genlist);
|
||||
|
||||
break;
|
||||
case "보숙10000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "보병숙련도+10000 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dex0=dex0+10000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$text = "보병숙련도+10000 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dex0'=>$db->sqleval('dex0+10000')
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "궁숙10000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "궁병숙련도+10000 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dex10=dex10+10000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$text = "궁병숙련도+10000 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dex10'=>$db->sqleval('dex10+10000')
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "기숙10000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "기병숙련도+10000 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dex20=dex20+10000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
$text = "기병숙련도+10000 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dex20'=>$db->sqleval('dex20+10000')
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "귀숙10000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "귀병숙련도+10000 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dex30=dex30+10000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
$text = "귀병숙련도+10000 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dex30'=>$db->sqleval('dex30+10000')
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "차숙10000":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
$msg = "차병숙련도+10000 지급!";
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set dex40=dex40+10000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
$text = "차병숙련도+10000 지급!";
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
$db->update('general',[
|
||||
'dex40'=>$db->sqleval('dex40+10000')
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "접속 허용":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set con=0 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general',[
|
||||
'con'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "접속 제한":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set con=1000 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general',[
|
||||
'con'=>1000
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "메세지 전달":
|
||||
//TODO:새 갠메 시스템으로 변경
|
||||
$date = date('Y-m-d H:i:s');
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
$text = $msg;
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
break;
|
||||
case "무기지급":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
if($weap == 0) { $msg = "무기 회수!"; }
|
||||
else { $msg = getWeapName($weap)." 지급!"; }
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
|
||||
if($weap == 0) {
|
||||
$text = "무기 회수!";
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
if($weap == 0) {
|
||||
$query = "update general set weap='0' where no='$genlist[$i]'";
|
||||
} else {
|
||||
$query = "update general set weap='$weap' where no='$genlist[$i]' and weap<'$weap'";
|
||||
}
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else {
|
||||
$text = getWeapName($weap)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
$db->update('general', [
|
||||
'weap'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'weap'=>$weap
|
||||
], '`no` IN %li AND weap < %i', $genlist, $weap);
|
||||
}
|
||||
break;
|
||||
case "책지급":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
if($weap == 0) { $msg = "서적 회수!"; }
|
||||
else { $msg = getBookName($weap)." 지급!"; }
|
||||
// 상대에게 발송
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
if($weap == 0) {
|
||||
$text = "책 회수!";
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
if($weap == 0) {
|
||||
$query = "update general set book='0' where no='$genlist[$i]'";
|
||||
} else {
|
||||
$query = "update general set book='$weap' where no='$genlist[$i]' and book<'$weap'";
|
||||
}
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else {
|
||||
$text = getBookName($weap)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
$db->update('general', [
|
||||
'book'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'book'=>$weap
|
||||
], '`no` IN %li AND book < %i', $genlist, $weap);
|
||||
}
|
||||
break;
|
||||
case "말지급":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
if($weap == 0) { $msg = "말 회수!"; }
|
||||
else { $msg = getHorseName($weap)." 지급!"; }
|
||||
// 상대에게 발송
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
if($weap == 0) {
|
||||
$text = "말 회수!";
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
if($weap == 0) {
|
||||
$query = "update general set horse='0' where no='$genlist[$i]'";
|
||||
} else {
|
||||
$query = "update general set horse='$weap' where no='$genlist[$i]' and horse<'$weap'";
|
||||
}
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else {
|
||||
$text = getHorseName($weap)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
$db->update('general', [
|
||||
'horse'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'horse'=>$weap
|
||||
], '`no` IN %li AND horse < %i', $genlist, $weap);
|
||||
}
|
||||
break;
|
||||
case "도구지급":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
|
||||
if($weap == 0) { $msg = "특수도구 회수!"; }
|
||||
else { $msg = getItemName($weap)." 지급!"; }
|
||||
// 상대에게 발송
|
||||
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
|
||||
if($weap == 0) {
|
||||
$text = "특수도구 회수!";
|
||||
}
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
if($weap == 0) {
|
||||
$query = "update general set item='0' where no='$genlist[$i]'";
|
||||
} else {
|
||||
$query = "update general set item='$weap' where no='$genlist[$i]' and item<'$weap'";
|
||||
}
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else {
|
||||
$text = getItemName($weap)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
$db->update('general', [
|
||||
'item'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'item'=>$weap
|
||||
], '`no` IN %li AND item < %i', $genlist, $weap);
|
||||
}
|
||||
break;
|
||||
case "NPC해제":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set npc=1 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general', [
|
||||
'npc'=>1
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "하야입력":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set turn0='00000000000045' where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000045'
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "방랑해산":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set turn0='00000000000047',turn1='00000000000056' where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000047',
|
||||
'turn1'=>'00000000000056'
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "NPC설정":
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$query = "update general set npc=2 where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$db->update('general', [
|
||||
'npc'=>2
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "00턴":
|
||||
$query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
|
||||
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$turntime = getRandTurn($admin['turnterm']);
|
||||
$cutTurn = cutTurn($turntime, $admin['turnterm']);
|
||||
$query = "update general set turntime='$cutTurn' where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
foreach($genlist as $generalID){
|
||||
$turntime = getRandTurn($turnterm);
|
||||
$cutTurn = cutTurn($turntime, $turnterm);
|
||||
$db->update('general', [
|
||||
'turntime'=>$curTurn
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
break;
|
||||
case "랜덤턴":
|
||||
$query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$turntime = getRandTurn($admin['turnterm']);
|
||||
$query = "update general set turntime='$turntime' where no='$genlist[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
foreach($genlist as $generalID){
|
||||
$turntime = getRandTurn($turnterm);
|
||||
$db->update('general', [
|
||||
'turntime'=>$turntime
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -31,21 +31,21 @@ switch($btn) {
|
||||
$db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
|
||||
//FIXME: subquery로 하는게 더 빠를 듯.
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
break;
|
||||
case "2단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=2,killturn=24 where no IN %li',$genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
break;
|
||||
case "3단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=3,killturn=24 where no IN %li',$genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
break;
|
||||
case "무한삭턴":
|
||||
DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
|
||||
|
||||
@@ -1630,7 +1630,6 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ if ($con >= 2) {
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>명장일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 명장일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -166,7 +166,7 @@ for ($i=0; $i < 21; $i++) {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']);
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></td>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ for ($i=0; $i < 4; $i++) {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']??0);
|
||||
echo "<td align=center> width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +344,6 @@ for ($i=0; $i < 4; $i++) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-2
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>왕조일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -201,7 +201,6 @@ if ($select == 0) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-2
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>왕조일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -202,7 +202,6 @@ if ($select == 0) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+2
-3
@@ -41,7 +41,7 @@ if ($type <= 0 || $type > 15) {
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>장수일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 장수일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
@@ -164,7 +164,7 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center> width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
|
||||
<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>
|
||||
@@ -194,7 +194,6 @@ echo "
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#viewType").val("<?=$type?>").attr("selected", "selected");
|
||||
|
||||
@@ -14,7 +14,7 @@ increaseRefresh("명예의전당", 2);
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>명예의 전당</title>
|
||||
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -118,7 +118,6 @@ for ($i=0; $i < 21; $i++) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+3
-4
@@ -15,13 +15,13 @@ $userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("연감", 5);
|
||||
increaseRefresh("연감", 2);
|
||||
|
||||
$query = "select startyear,year,month,conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select map,con,turntime from general where owner='{$userID}'";
|
||||
$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);
|
||||
|
||||
@@ -77,7 +77,7 @@ if ($month <= 0) {
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>연감</title>
|
||||
<title><?=UniqueConst::$serverName?>: 연감</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
@@ -159,6 +159,5 @@ reloadWorldMap({
|
||||
neutralView:true
|
||||
});
|
||||
</script>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -28,7 +28,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>세력일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -248,7 +248,6 @@ echo"
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+1
-2
@@ -26,7 +26,7 @@ $sel[$type] = "selected";
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>빙의일람</title>
|
||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -124,7 +124,6 @@ echo "
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+3
-4
@@ -17,7 +17,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select map,con,turntime from general where owner='{$userID}'";
|
||||
$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);
|
||||
|
||||
@@ -29,7 +29,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>세력도</title>
|
||||
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
@@ -67,7 +67,7 @@ $(function(){
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 valign=top>
|
||||
<?php getWorldHistoryRecent(34); ?>
|
||||
<?=getWorldHistoryRecent(34)?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -75,7 +75,6 @@ $(function(){
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+11
-12
@@ -22,15 +22,15 @@ $refresh = [];
|
||||
$online = [];
|
||||
|
||||
$curonline = getOnlineNum();
|
||||
$visibleLogs = min(11, count($log));
|
||||
for ($i=0; $i < $visibleLogs; $i++) {
|
||||
$parse = explode("|", $log[count($log)-$visibleLogs+$i]);
|
||||
$date[$i] = trim($parse[0]);
|
||||
$year[$i] = trim($parse[1]);
|
||||
$month[$i] = trim($parse[2]);
|
||||
$refresh[$i] = trim($parse[3]);
|
||||
$online[$i] = trim($parse[4]);
|
||||
foreach($log as $i=>$value){
|
||||
$parse = Json::decode($value);
|
||||
$date[$i] = $parse[0];
|
||||
$year[$i] = $parse[1];
|
||||
$month[$i] = $parse[2];
|
||||
$refresh[$i] = $parse[3];
|
||||
$online[$i] = $parse[4];
|
||||
}
|
||||
|
||||
if ($game['maxrefresh'] == 0) {
|
||||
$game['maxrefresh'] = 1;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ if ($game['maxonline'] < $curonline) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>트래픽정보</title>
|
||||
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -63,7 +63,7 @@ if ($game['maxonline'] < $curonline) {
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
|
||||
<?php
|
||||
for ($i=0; $i < $visibleLogs; $i++) {
|
||||
foreach($log as $i=>$value){
|
||||
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
@@ -133,7 +133,7 @@ $dt = date('H:i');
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
|
||||
<?php
|
||||
for ($i=0; $i < $visibleLogs; $i++) {
|
||||
foreach($log as $i=>$value){
|
||||
$w = round($online[$i] / $game['maxonline'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
@@ -264,7 +264,6 @@ for ($i=0; $i < $count; $i++) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+22
-18
@@ -28,7 +28,7 @@ if ($vote[0] == "") {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>설문조사</title>
|
||||
<title><?=UniqueConst::$serverName?>: 설문조사</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -198,22 +198,19 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
<tr>
|
||||
";
|
||||
|
||||
$memCount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||
if ($memCount == 0) {
|
||||
$memCount = 1;
|
||||
}
|
||||
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
|
||||
|
||||
$totalVote = [];
|
||||
$nationVoteCount = [[0]];
|
||||
$nationVote = [[]];
|
||||
$nationVoteCount = [];
|
||||
$nationVote = [];
|
||||
|
||||
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
|
||||
$nation = $row['nation'];
|
||||
$vote = $row['vote'];
|
||||
$ownVote = $row['vote'];
|
||||
$cnt = $row['cnt'];
|
||||
|
||||
if (!isset($totalVote[$vote])) {
|
||||
$totalVote[$vote] = 0;
|
||||
if (!isset($totalVote[$ownVote])) {
|
||||
$totalVote[$ownVote] = 0;
|
||||
}
|
||||
|
||||
if (!isset($nationVoteCount[$nation])) {
|
||||
@@ -221,20 +218,20 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
$nationVote[$nation] = [];
|
||||
}
|
||||
|
||||
if (!isset($nationVote[$nation][$vote])) {
|
||||
$nationVote[$nation][$vote] = 0;
|
||||
if (!isset($nationVote[$nation][$ownVote])) {
|
||||
$nationVote[$nation][$ownVote] = 0;
|
||||
}
|
||||
|
||||
$totalVote[$vote] += $cnt;
|
||||
$totalVote[$ownVote] += $cnt;
|
||||
$nationVoteCount[$nation] += $cnt;
|
||||
$nationVote[$nation][$vote] += $cnt;
|
||||
$nationVote[$nation][$ownVote] += $cnt;
|
||||
}
|
||||
|
||||
for ($i=0; $i < $voteTypeCount; $i++) {
|
||||
$per = round(($totalVote[$i]??0) / $memCount * 100, 1);
|
||||
$per = round(($totalVote[$i]??0) * 100 / $memCount, 1);
|
||||
// if($per < 5) { $vote['cnt'] = " "; }
|
||||
echo "
|
||||
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
|
||||
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
|
||||
";
|
||||
}
|
||||
|
||||
@@ -293,8 +290,16 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$memCount = MYDB_num_rows($result);
|
||||
|
||||
|
||||
|
||||
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
|
||||
$percentage = round($voteCount / $memCount * 100, 1);
|
||||
if($memCount == 0){
|
||||
$percentage = 100;
|
||||
}
|
||||
else{
|
||||
$percentage = round($voteCount / $memCount * 100, 1);
|
||||
}
|
||||
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -328,7 +333,6 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-2
@@ -58,7 +58,7 @@ if ($msg2 == "") {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>거래장</title>
|
||||
<title><?=UniqueConst::$serverName?>: 거래장</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -299,6 +299,5 @@ for ($i=0; $i < $count; $i++) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+22
-7
@@ -75,7 +75,7 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>감찰부</title>
|
||||
<title><?=UniqueConst::$serverName?>: 감찰부</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -100,20 +100,23 @@ $sel[$type] = "selected";
|
||||
<?php
|
||||
switch ($type) {
|
||||
default:
|
||||
case 0: $query = "select no,name from general where nation='{$me['nation']}' order by turntime desc"; break;
|
||||
case 1: $query = "select no,name from general where nation='{$me['nation']}' order by recwar desc"; break;
|
||||
case 2: $query = "select no,name from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
|
||||
case 3: $query = "select no,name from general where nation='{$me['nation']}' order by warnum desc"; break;
|
||||
case 0: $query = "select no,name,npc from general where nation='{$me['nation']}' order by turntime desc"; break;
|
||||
case 1: $query = "select no,name,npc from general where nation='{$me['nation']}' order by recwar desc"; break;
|
||||
case 2: $query = "select no,name,npc from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
|
||||
case 3: $query = "select no,name,npc from general where nation='{$me['nation']}' order by warnum desc"; break;
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
$npc = 0;
|
||||
for ($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
// 선택 없으면 맨 처음 장수
|
||||
if ($gen == 0) {
|
||||
$gen = $general['no'];
|
||||
}
|
||||
if($gen == $general['no']){
|
||||
$npc = $general['npc'];
|
||||
}
|
||||
if ($gen == $general['no']) {
|
||||
echo "
|
||||
<option selected value={$general['no']}>{$general['name']}</option>";
|
||||
@@ -153,11 +156,23 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
<?=getBatResRecent($gen, 24)?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($npc > 1): ?>
|
||||
<tr>
|
||||
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
|
||||
<td align=center id=bg1><font color=orange size=3> </font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?=getGenLogRecent($gen, 24)?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+41
-14
@@ -37,7 +37,13 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
|
||||
$str1 = getTournament($admin['tournament']);
|
||||
$str2 = getTournamentTime();
|
||||
if($str2){
|
||||
$str2 = ', '.$str2;
|
||||
}
|
||||
$str3 = getTournamentTerm();
|
||||
if($str3){
|
||||
$str3 = ', '.$str3;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -47,13 +53,13 @@ $str3 = getTournamentTerm();
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>베팅장</title>
|
||||
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||
<style>
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
||||
select { font-family:'굴림'; line-height:100%; }
|
||||
table { font-family:'맑은 고딕';}
|
||||
font { font-family:'맑은 고딕';}
|
||||
input { font-family:'맑은 고딕';height:20px }
|
||||
select { font-family:'굴림'; }
|
||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
|
||||
@@ -67,7 +73,7 @@ select { font-family:'굴림'; line-height:100%; }
|
||||
</table>
|
||||
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
|
||||
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
|
||||
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
|
||||
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
|
||||
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet']?> / 내 투자 금액 : <?=$me['bet']?>)</font></td></tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
|
||||
@@ -77,7 +83,11 @@ select { font-family:'굴림'; line-height:100%; }
|
||||
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 1; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -102,7 +112,11 @@ for ($i=0; $i < 1; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -143,7 +157,11 @@ for ($i=0; $i < 2; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -184,7 +202,11 @@ for ($i=0; $i < 4; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 8; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -225,7 +247,11 @@ for ($i=0; $i < 8; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -268,10 +294,12 @@ for ($i=0; $i < 16; $i++) {
|
||||
}
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$bet[$i] = @round($admin['bet'] / $admin["bet{$i}"], 2);
|
||||
if ($bet[$i] == 0) {
|
||||
if($admin["bet{$i}"] == 0){
|
||||
$bet[$i] = "∞";
|
||||
}
|
||||
else{
|
||||
$bet[$i] = round($admin['bet'] / $admin["bet{$i}"], 2);
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
@@ -405,6 +433,5 @@ for ($i=0; $i < 4; $i++) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -25,7 +25,7 @@ if($me['level'] < 5) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>기밀실</title>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -69,7 +69,6 @@ for($i=0; $i < 20; $i++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+38
-36
@@ -58,13 +58,24 @@ $nation = MYDB_fetch_array($result);
|
||||
|
||||
$lv = getNationChiefLevel($nation['level']);
|
||||
$turn = [];
|
||||
$gen = [];
|
||||
|
||||
for($i=12; $i >= $lv; $i--) {
|
||||
$turn[$i] = getCoreTurn($nation, $i);
|
||||
|
||||
$query = "select name,turntime,npc from general where level={$i} and nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen[$i] = MYDB_fetch_array($result);
|
||||
$gen[$i] = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'turntime'=>''
|
||||
];
|
||||
}
|
||||
for($i= $lv - 1; $i>=5; $i--){
|
||||
$gen[$i] = [
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'turntime'=>''
|
||||
];
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -72,7 +83,7 @@ for($i=12; $i >= $lv; $i--) {
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>사령부</title>
|
||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<script type="text/javascript">
|
||||
@@ -105,35 +116,27 @@ for($i=12; $i >= $lv; $i--) {
|
||||
$turntime[$i] = substr($gen[$i]['turntime'], 14);
|
||||
}
|
||||
|
||||
|
||||
//FIXME: 각 칸을 div로 놓으면 네개씩 출력하는 삽질이 필요없다.
|
||||
|
||||
for($k=0; $k < 2; $k++) {
|
||||
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $k;
|
||||
|
||||
if(!isset($gen[$l4])){
|
||||
$gen[$l4] = [
|
||||
'npc'=>0,
|
||||
'name'=>0
|
||||
];
|
||||
}
|
||||
|
||||
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".$gen[$l4]['name']."</font>"; }
|
||||
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".$gen[$l4]['name']."</font>"; }
|
||||
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".$gen[$l3]['name']."</font>"; }
|
||||
elseif($gen[$l3]['npc'] == 1) { $gen[$l3]['name'] = "<font color=skyblue>".$gen[$l3]['name']."</font>"; }
|
||||
if ($gen[$l2]['npc'] >= 2) { $gen[$l2]['name'] = "<font color=cyan>".$gen[$l2]['name']."</font>"; }
|
||||
elseif($gen[$l2]['npc'] == 1) { $gen[$l2]['name'] = "<font color=skyblue>".$gen[$l2]['name']."</font>"; }
|
||||
if ($gen[$l1]['npc'] >= 2) { $gen[$l1]['name'] = "<font color=cyan>".$gen[$l1]['name']."</font>"; }
|
||||
elseif($gen[$l1]['npc'] == 1) { $gen[$l1]['name'] = "<font color=skyblue>".$gen[$l1]['name']."</font>"; }
|
||||
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".($gen[$l4]['name']??'')."</font>"; }
|
||||
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".($gen[$l4]['name']??'')."</font>"; }
|
||||
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".($gen[$l3]['name']??'')."</font>"; }
|
||||
elseif($gen[$l3]['npc'] == 1) { $gen[$l3]['name'] = "<font color=skyblue>".($gen[$l3]['name']??'')."</font>"; }
|
||||
if ($gen[$l2]['npc'] >= 2) { $gen[$l2]['name'] = "<font color=cyan>".($gen[$l2]['name']??'')."</font>"; }
|
||||
elseif($gen[$l2]['npc'] == 1) { $gen[$l2]['name'] = "<font color=skyblue>".($gen[$l2]['name']??'')."</font>"; }
|
||||
if ($gen[$l1]['npc'] >= 2) { $gen[$l1]['name'] = "<font color=cyan>".($gen[$l1]['name']??'')."</font>"; }
|
||||
elseif($gen[$l1]['npc'] == 1) { $gen[$l1]['name'] = "<font color=skyblue>".($gen[$l1]['name']??'')."</font>"; }
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center id=bg1>.</td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : {$gen[$l4]['name']}</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : {$gen[$l3]['name']}</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : {$gen[$l2]['name']}</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : {$gen[$l1]['name']}</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : ".($gen[$l4]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : ".($gen[$l3]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : ".($gen[$l2]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : ".($gen[$l1]['name']??'')."</b></td>
|
||||
<td align=center id=bg1>.</td>
|
||||
</tr>
|
||||
";
|
||||
@@ -144,14 +147,14 @@ for($k=0; $k < 2; $k++) {
|
||||
$turndate[$l2] = substr($totaldate[$l2]??'', 11, 5);
|
||||
$turndate[$l1] = substr($totaldate[$l1]??'', 11, 5);
|
||||
$j = $i + 1;
|
||||
$td4 = $turndate[$l4] ?: "-";
|
||||
$td3 = $turndate[$l3] ?: "-";
|
||||
$td2 = $turndate[$l2] ?: "-";
|
||||
$td1 = $turndate[$l1] ?: "-";
|
||||
$tn4 = $turn[$l4][$i] ?? "-";
|
||||
$tn3 = $turn[$l3][$i] ?? "-";
|
||||
$tn2 = $turn[$l2][$i] ?? "-";
|
||||
$tn1 = $turn[$l1][$i] ?? "-";
|
||||
$td4 = $turndate[$l4]??"-";
|
||||
$td3 = $turndate[$l3]??"-";
|
||||
$td2 = $turndate[$l2]??"-";
|
||||
$td1 = $turndate[$l1]??"-";
|
||||
$tn4 = $turn[$l4][$i]??"-";
|
||||
$tn3 = $turn[$l3][$i]??"-";
|
||||
$tn2 = $turn[$l2][$i]??"-";
|
||||
$tn1 = $turn[$l1][$i]??"-";
|
||||
echo "
|
||||
<tr>
|
||||
<td width=28 align=center id=bg0><b>$j</b></td>
|
||||
@@ -166,10 +169,10 @@ for($k=0; $k < 2; $k++) {
|
||||
<td width=28 align=center id=bg0><b>$j</b></td>
|
||||
</tr>
|
||||
";
|
||||
if($totaldate[$l4] != "") { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
|
||||
if($totaldate[$l3] != "") { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
|
||||
if($totaldate[$l2] != "") { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
|
||||
if($totaldate[$l1] != "") { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
|
||||
if($totaldate[$l4]??'') { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
|
||||
if($totaldate[$l3]??'') { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
|
||||
if($totaldate[$l2]??'') { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
|
||||
if($totaldate[$l1]??'') { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
|
||||
}
|
||||
if($k == 0) {
|
||||
echo "<form action=processing.php method=post><tr><td colspan=5 align=right>";
|
||||
@@ -189,7 +192,6 @@ for($k=0; $k < 2; $k++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+145
-120
@@ -25,23 +25,39 @@ $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);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>도시정보</title>
|
||||
<title><?=UniqueConst::$serverName?>: 도시정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link href="css/common.css" rel="stylesheet">
|
||||
<style>
|
||||
#general_list tr td{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#general_list tr td:last-child{
|
||||
text-align:left;
|
||||
padding-left:1em;
|
||||
}
|
||||
|
||||
.general_turn_text{
|
||||
font-size:x-small;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td>도 시 정 보<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr>
|
||||
<td width=998>
|
||||
<form name=cityselect method=get>도시선택 :
|
||||
@@ -159,44 +175,44 @@ if($city['trade'] == 0) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg2>
|
||||
<tr>
|
||||
<td colspan=12 align=center style=color:"<?=newColor($nation['color'])?>"; bgcolor=<?=$nation['color']?>>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=48 id=bg1>주민</td>
|
||||
<td align=center width=48 class=bg1>주민</td>
|
||||
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
|
||||
<td align=center width=48 id=bg1>농업</td>
|
||||
<td align=center width=48 class=bg1>농업</td>
|
||||
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
|
||||
<td align=center width=48 id=bg1>상업</td>
|
||||
<td align=center width=48 class=bg1>상업</td>
|
||||
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
|
||||
<td align=center width=48 id=bg1>치안</td>
|
||||
<td align=center width=48 class=bg1>치안</td>
|
||||
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
|
||||
<td align=center width=48 id=bg1>수비</td>
|
||||
<td align=center width=48 class=bg1>수비</td>
|
||||
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
|
||||
<td align=center width=48 id=bg1>성벽</td>
|
||||
<td align=center width=48 class=bg1>성벽</td>
|
||||
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>민심</td>
|
||||
<td align=center class=bg1>민심</td>
|
||||
<td align=center><?=$city['rate']?></td>
|
||||
<td align=center id=bg1>시세</td>
|
||||
<td align=center class=bg1>시세</td>
|
||||
<td align=center><?=$city['trade']?>%</td>
|
||||
<td align=center id=bg1>인구</td>
|
||||
<td align=center class=bg1>인구</td>
|
||||
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
||||
<td align=center id=bg1>태수</td>
|
||||
<td align=center class=bg1>태수</td>
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center id=bg1>군사</td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center id=bg1>시중</td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>장수</td>
|
||||
<td align=center class=bg1>장수</td>
|
||||
<td colspan=11>
|
||||
<?php
|
||||
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
|
||||
@@ -211,6 +227,26 @@ if($city['trade'] == 0) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 align=center class=bg1>얼 굴</td>
|
||||
<td width=98 align=center class=bg1>이 름</td>
|
||||
<td width=48 align=center class=bg1>통솔</td>
|
||||
<td width=48 align=center class=bg1>무력</td>
|
||||
<td width=48 align=center class=bg1>지력</td>
|
||||
<td width=78 align=center class=bg1>관 직</td>
|
||||
<td width=28 align=center class=bg1>守</td>
|
||||
<td width=78 align=center class=bg1>병 종</td>
|
||||
<td width=78 align=center class=bg1>병 사</td>
|
||||
<td width=48 align=center class=bg1>훈련</td>
|
||||
<td width=48 align=center class=bg1>사기</td>
|
||||
<td width=310 align=center class=bg1>명 령</td>
|
||||
</tr></thead><tbody class='bg0' id='general_list'>
|
||||
|
||||
<?php
|
||||
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -223,127 +259,116 @@ foreach(getAllNationStaticInfo() as $nation){
|
||||
$nationlevel[$nation['nation']] = $nation['level'];
|
||||
}
|
||||
|
||||
if($gencount != 0) {
|
||||
echo "
|
||||
<br>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=64 align=center id=bg1>얼 굴</td>
|
||||
<td width=98 align=center id=bg1>이 름</td>
|
||||
<td width=48 align=center id=bg1>통솔</td>
|
||||
<td width=48 align=center id=bg1>무력</td>
|
||||
<td width=48 align=center id=bg1>지력</td>
|
||||
<td width=78 align=center id=bg1>관 직</td>
|
||||
<td width=28 align=center id=bg1>守</td>
|
||||
<td width=78 align=center id=bg1>병 종</td>
|
||||
<td width=78 align=center id=bg1>병 사</td>
|
||||
<td width=48 align=center id=bg1>훈련</td>
|
||||
<td width=48 align=center id=bg1>사기</td>
|
||||
<td width=310 align=center id=bg1>명 령</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
|
||||
$nationInfo = getNationStaticInfo($general['nation']);
|
||||
|
||||
if($general['nation'] != 0 && $general['nation'] == $myNation['nation']){
|
||||
$ourGeneral = true;
|
||||
}
|
||||
else{
|
||||
$ourGeneral = false;
|
||||
}
|
||||
|
||||
$isNPC = $general['npc']>1;
|
||||
$wounded = $general['injury'];
|
||||
|
||||
|
||||
$name = $general['name'];
|
||||
$nameText = formatName($name, $general['npc']);
|
||||
|
||||
$leadership = $general['leader'];
|
||||
$power = $general['power'];
|
||||
$intel = $general['intel'];
|
||||
|
||||
$leadershipText = formatWounded($leadership, $general['injury']);
|
||||
$powerText = formatWounded($power, $general['injury']);
|
||||
$intelText = formatWounded($intel, $general['injury']);
|
||||
|
||||
$level = $general['level'];
|
||||
$levelText = getLevel($general['level']);
|
||||
|
||||
if($general['level'] == 12) {
|
||||
$lbonus = $nationlevel[$general['nation']] * 2;
|
||||
$leadershipBonus = $nationInfo['level'] * 2;
|
||||
} elseif($general['level'] >= 5) {
|
||||
$lbonus = $nationlevel[$general['nation']];
|
||||
$leadershipBonus = $nationInfo['level'];
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
$leadershipBonus = 0;
|
||||
}
|
||||
if($lbonus > 0) {
|
||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
$lbonus = "";
|
||||
$leadershipBonusText = formatLeadershipBonus($leadershipBonus);
|
||||
|
||||
if($ourGeneral){
|
||||
$defenceMode = $general['mode'];
|
||||
$defenceModeText = formatDefenceMode($defenceMode);
|
||||
$crewType = $general['crewtype'];
|
||||
$crewTypeText = GameUnitConst::byId($crewType)->name;
|
||||
$crew = $general['crew'];
|
||||
$train = $general['train'];
|
||||
$atmos = $general['atmos'];
|
||||
}
|
||||
else{
|
||||
$defenceMode = 0;
|
||||
$defenceModeText = '';
|
||||
$crewType = 0;
|
||||
$crewTypeText = '';
|
||||
$crew = $general['crew'];
|
||||
$train = -1;
|
||||
$atmos = -1;
|
||||
}
|
||||
|
||||
if($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonus}";
|
||||
$power = "{$general['power']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
$nation = $general['nation'];
|
||||
$nationName = $nationInfo['name'];
|
||||
|
||||
if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>{$general['name']}</font>"; }
|
||||
elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>{$general['name']}</font>"; }
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center height=64></td>
|
||||
<td align=center>{$general['name']}</td>
|
||||
<td align=center>$leader</td>
|
||||
<td align=center>$power</td>
|
||||
<td align=center>$intel</td>
|
||||
<td align=center>".getLevel($general['level'])."</td>";
|
||||
//아국장수이거나 보는 사람이 운영자일때 보여줌
|
||||
if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || $session->userGrade >= 5) {
|
||||
switch($general['mode']) {
|
||||
case 0: $mode = "×"; break;
|
||||
case 1: $mode = "○"; break;
|
||||
case 2: $mode = "◎"; break;
|
||||
if($ourGeneral && !$isNPC){
|
||||
$turnText = [];
|
||||
foreach(getTurn($general, 1) as $turnRawIdx=>$turn){
|
||||
$turnIdx = $turnRawIdx+1;
|
||||
$turnText[] = "{$turnIdx} : $turn";
|
||||
}
|
||||
|
||||
echo "
|
||||
<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>";
|
||||
if($general['npc'] >= 2) {
|
||||
echo "
|
||||
<td>NPC 장수";
|
||||
} else {
|
||||
echo "
|
||||
<td>
|
||||
<font size=1>";
|
||||
$turn = getTurn($general, 1);
|
||||
|
||||
for($i=0; $i < 4; $i++) {
|
||||
$k = $i+1;
|
||||
echo "
|
||||
$k : $turn[$i]<br>";
|
||||
}
|
||||
echo "
|
||||
</font>";
|
||||
}
|
||||
} elseif($general['nation'] != 0) {
|
||||
echo "
|
||||
<td align=center>?</td>
|
||||
<td align=center>?</td>
|
||||
<td align=center>{$general['crew']}</td>
|
||||
<td align=center>?</td>
|
||||
<td align=center>?</td>
|
||||
<td>【{$nationname[$general['nation']]}】 장수";
|
||||
} else {
|
||||
echo "
|
||||
<td align=center>?</td>
|
||||
<td align=center>?</td>
|
||||
<td align=center>{$general['crew']}</td>
|
||||
<td align=center>?</td>
|
||||
<td align=center>?</td>
|
||||
<td> 재 야";
|
||||
$turnText = join('<br>', $turnText);
|
||||
}
|
||||
|
||||
echo "
|
||||
</td>
|
||||
</tr>";
|
||||
else{
|
||||
$turnText = '';
|
||||
}
|
||||
|
||||
echo $templates->render('cityGeneral', [
|
||||
'ourGeneral'=>$ourGeneral,
|
||||
'isNPC'=>$isNPC,
|
||||
'wounded'=>$wounded,
|
||||
'name'=>$name,
|
||||
'nameText'=>$nameText,
|
||||
'leadership'=>$leadership,
|
||||
'leadershipText'=>$leadershipText,
|
||||
'leadershipBonus'=>$leadershipBonus,
|
||||
'leadershipBonusText'=>$leadershipBonusText,
|
||||
'level'=>$level,
|
||||
'levelText'=>$levelText,
|
||||
'power'=>$power,
|
||||
'powerText'=>$powerText,
|
||||
'intel'=>$intel,
|
||||
'intelText'=>$intelText,
|
||||
'defenceMode'=>$defenceMode,
|
||||
'defenceModeText'=>$defenceModeText,
|
||||
'crewType'=>$crewType,
|
||||
'crewTypeText'=>$crewTypeText,
|
||||
'crew'=>$crew,
|
||||
'train'=>$train,
|
||||
'atmos'=>$atmos,
|
||||
'nation'=>$nation,
|
||||
'nationName'=>$nationName,
|
||||
'turnText'=>$turnText
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+43
-47
@@ -48,27 +48,27 @@ if ($me['level'] >= 5) {
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>내무부</title>
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td>내 무 부<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
|
||||
<tr>
|
||||
<td width=100 align=center id=bg1>국 가 명</td>
|
||||
<td width=50 align=center id=bg1>국력</td>
|
||||
<td width=40 align=center id=bg1>장수</td>
|
||||
<td width=40 align=center id=bg1>속령</td>
|
||||
<td width=80 align=center id=bg1>상태</td>
|
||||
<td width=60 align=center id=bg1>기간</td>
|
||||
<td width=100 align=center id=bg1>종 료 시 점</td>
|
||||
<td align=center id=bg1>비 고</td>
|
||||
<td width=100 align=center class=bg1>국 가 명</td>
|
||||
<td width=50 align=center class=bg1>국력</td>
|
||||
<td width=40 align=center class=bg1>장수</td>
|
||||
<td width=40 align=center class=bg1>속령</td>
|
||||
<td width=80 align=center class=bg1>상태</td>
|
||||
<td width=60 align=center class=bg1>기간</td>
|
||||
<td width=100 align=center class=bg1>종 료 시 점</td>
|
||||
<td align=center class=bg1>비 고</td>
|
||||
</tr>
|
||||
<?php
|
||||
$query = "select year,month from game limit 1";
|
||||
@@ -220,65 +220,62 @@ if ($budgetricediff > 0) {
|
||||
}
|
||||
|
||||
?>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<form name=form1 method=post action=c_dipcenter.php>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</td></tr>
|
||||
<tr><td colspan=2 id=bg1>국가 방침 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=msg value='<?=$nation['msg']?>'><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
||||
<tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
|
||||
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=1000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
||||
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
|
||||
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<?php
|
||||
echo "
|
||||
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr>
|
||||
<td colspan=2 align=center id=bg1>자금 예산</td>
|
||||
<td colspan=2 align=center id=bg1>병량 예산</td>
|
||||
<td colspan=2 align=center class=bg1>자금 예산</td>
|
||||
<td colspan=2 align=center class=bg1>병량 예산</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=248 align=right id=bg1>현 재 </td>
|
||||
<td width=248 align=center>{$nation['gold']}</td>
|
||||
<td width=248 align=right id=bg1>현 재 </td>
|
||||
<td width=248 align=center>{$nation['rice']}</td>
|
||||
<td width=248 align=right class=bg1>현 재 </td>
|
||||
<td width=248 align=center><?=$nation['gold']?></td>
|
||||
<td width=248 align=right class=bg1>현 재 </td>
|
||||
<td width=248 align=center><?=$nation['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>단기수입 </td>
|
||||
<td align=center>+$deadIncome</td>
|
||||
<td align=right id=bg1>둔전수입 </td>
|
||||
<td align=center>+$riceincomeList[1]</td>
|
||||
<td align=right class=bg1>단기수입 </td>
|
||||
<td align=center>+<?=$deadIncome?></td>
|
||||
<td align=right class=bg1>둔전수입 </td>
|
||||
<td align=center>+<?=$riceincomeList[1]?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>세 금 </td>
|
||||
<td align=center>+$goldincomeList[0]</td>
|
||||
<td align=right id=bg1>세 곡 </td>
|
||||
<td align=center>+$riceincomeList[0]</td>
|
||||
<td align=right class=bg1>세 금 </td>
|
||||
<td align=center>+<?=$goldincomeList[0]?></td>
|
||||
<td align=right class=bg1>세 곡 </td>
|
||||
<td align=center>+<?=$riceincomeList[0]?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>수입 / 지출 </td>
|
||||
<td align=center>+$goldincome / -$goldoutcome</td>
|
||||
<td align=right id=bg1>수입 / 지출 </td>
|
||||
<td align=center>+$riceincome / -$riceoutcome</td>
|
||||
<td align=right class=bg1>수입 / 지출 </td>
|
||||
<td align=center>+<?=$goldincome?> / -<?=$goldoutcome?></td>
|
||||
<td align=right class=bg1>수입 / 지출 </td>
|
||||
<td align=center>+<?=$riceincome?> / -<?=$riceoutcome?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>국고 예산 </td>
|
||||
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
|
||||
<td align=right id=bg1>병량 예산 </td>
|
||||
<td align=center>{$budgetrice} ({$budgetricediff})</td>
|
||||
</tr>";
|
||||
?>
|
||||
<td align=right class=bg1>국고 예산 </td>
|
||||
<td align=center><?=$budgetgold?> (<?=$budgetgolddiff?>)</td>
|
||||
<td align=right class=bg1>병량 예산 </td>
|
||||
<td align=center><?=$budgetrice?> (<?=$budgetricediff?>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>세율 (5 ~ 30%) </td>
|
||||
<td align=right class=bg1>세율 (5 ~ 30%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn?> name=btn value=세율></td>
|
||||
<td align=right id=bg1>봉급 지급율 (20 ~ 200%) </td>
|
||||
<td align=right class=bg1>봉급 지급율 (20 ~ 200%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급율></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right id=bg1>기밀 권한 (1 ~ 99년) </td>
|
||||
<td align=right class=bg1>기밀 권한 (1 ~ 99년) </td>
|
||||
<td align=center><input type=text <?=$read?> name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['secretlimit']?>>년 <input type=<?=$btn?> name=btn value=기밀권한></td>
|
||||
<td align=right id=bg1>임관&전쟁 변경 가능</td>
|
||||
<td align=right class=bg1>임관&전쟁 변경 가능</td>
|
||||
<td align=center>무제한</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -307,10 +304,9 @@ if ($nation['war'] == 0) {
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+15
-19
@@ -16,7 +16,7 @@ $query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,map from general where owner='{$userID}'";
|
||||
$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);
|
||||
|
||||
@@ -25,7 +25,6 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
$nationnum = [];
|
||||
$nationname = [];
|
||||
$nationcolor = [];
|
||||
|
||||
$nationStr = "";
|
||||
$powerStr = "";
|
||||
@@ -41,7 +40,6 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
|
||||
$nationnum[] = $nation['nation'];
|
||||
$nationname[$nation['nation']] = $nation['name'];
|
||||
$nationcolor[$nation['nation']] = $nation['color'];
|
||||
|
||||
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
|
||||
$powerStr .= "국력 {$nation['power']}<br>";
|
||||
@@ -64,9 +62,10 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
||||
$sum = array_sum($conflict);
|
||||
|
||||
foreach ($conflict as $nationID=>$killnum) {
|
||||
$conflict['percent'] = round(100*$killnum / $sum, 1);
|
||||
$conflict['name'] = $nationname[$nationID];
|
||||
$conflict['color'] = $nationcolor[$nationID];
|
||||
$conflict[$nationID] = ['killnum'=>$killnum];
|
||||
$conflict[$nationID]['percent'] = round(100*$killnum / $sum, 1);
|
||||
$conflict[$nationID]['name'] = $nationname[$nationID];
|
||||
$conflict[$nationID]['color'] = getNationStaticInfo($nationID)['color'];
|
||||
}
|
||||
|
||||
$realConflict[] = [$cityID, $cityName, $conflict];
|
||||
@@ -79,7 +78,7 @@ 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">
|
||||
<title>중원정보</title>
|
||||
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
@@ -120,7 +119,7 @@ if($nationcount != 0) {
|
||||
|
||||
for($i=0; $i < $nationcount; $i++) {
|
||||
echo "
|
||||
<td align=center width={$width} style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
|
||||
<td align=center width={$width} style=background-color:".getNationStaticInfo($nationnum[$i])['color'].";color:".newColor(getNationStaticInfo($nationnum[$i])['color']).";>{$nationname[$nationnum[$i]]}</td>";
|
||||
}
|
||||
echo "
|
||||
</tr>";
|
||||
@@ -137,7 +136,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
}
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
|
||||
<td align=center style=background-color:".getNationStaticInfo($nationnum[$i])['color'].";color:".newColor(getNationStaticInfo($nationnum[$i])['color']).";>{$nationname[$nationnum[$i]]}</td>";
|
||||
|
||||
for($k=0; $k < $nationcount; $k++) {
|
||||
if($i == $k) {
|
||||
@@ -202,7 +201,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
cellpadding=0
|
||||
bordercolordark='gray'
|
||||
bordercolorlight='black'
|
||||
style='font-size:13px;word-break:break-all;'
|
||||
style='font-size:13px;word-break:break-all;width:100%;'
|
||||
class='bg0'
|
||||
>
|
||||
<?php foreach($conflict as $item): ?>
|
||||
@@ -212,12 +211,10 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
align=right
|
||||
style='color:<?=newColor($item['color'])?>;background-color:<?=$item['color']?>;'
|
||||
><?=$item['name']?> </td>
|
||||
<td width=48 align=right><?=$item['percent']?>% </td>
|
||||
<td
|
||||
width='<?=$item['percent']?>%'
|
||||
style='background-color:<?=$item['color']?>;'
|
||||
></td>
|
||||
<td width=*></td>
|
||||
<td width=48 align=right><?=(float)$item['percent']?> % </td>
|
||||
<td width=*><div
|
||||
style='display:inline-block;width:<?=$item['percent']?>%;background-color:<?=$item['color']?>;'
|
||||
> </div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
@@ -239,10 +236,10 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<td width=698 height=420>
|
||||
<?=getMapHtml()?>
|
||||
</td>
|
||||
<td width=98 valign=top><?=$nationStr?></td>
|
||||
<td width=101 valign=top><?=$nationStr?></td>
|
||||
<td width=78 valign=top><?=$powerStr?></td>
|
||||
<td width=58 valign=top><?=$genStr?></td>
|
||||
<td width=58 valign=top><?=$cityStr?></td>
|
||||
<td width=55 valign=top><?=$cityStr?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
@@ -251,6 +248,5 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-2
@@ -54,7 +54,7 @@ $sel[$type] = "selected";
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>암행부</title>
|
||||
<title><?=UniqueConst::$serverName?>: 암행부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -210,6 +210,5 @@ echo "
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+18
-14
@@ -30,7 +30,7 @@ if($meLevel == 0) {
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>인사부</title>
|
||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<script type="text/javascript">
|
||||
@@ -81,18 +81,18 @@ echo "
|
||||
";
|
||||
for($i=12; $i >= $lv; $i-=2) {
|
||||
$i1 = $i; $i2 = $i - 1;
|
||||
$imageTemp1 = GetImageURL($level[$i1]['imgsvr']);
|
||||
$imageTemp2 = GetImageURL($level[$i2]['imgsvr']);
|
||||
echo "
|
||||
$imageTemp1 = GetImageURL($level[$i1]['imgsvr']??0);
|
||||
$imageTemp2 = GetImageURL($level[$i2]['imgsvr']??0);
|
||||
?>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1><font size=4>".getLevel($i1, $nation['level'])."</font></td>
|
||||
<td width=64 height=64 style='background:no-repeat center url(\"{$imageTemp1}/{$level[$i1]['picture']}\");background-size:64px;'></td>
|
||||
<td width=332><font size=4>";echo $level[$i1]['name']==''?"-":$level[$i1]['name']; echo " ({$level[$i1]['belong']}년)</font></td>
|
||||
<td width=98 align=center id=bg1><font size=4>".getLevel($i2, $nation['level'])."</font></td>
|
||||
<td width=64 height=64 style='background:no-repeat center url(\"{$imageTemp2}/{$level[$i2]['picture']}\");background-size:64px;'></td>
|
||||
<td width=332><font size=4>";echo $level[$i2]['name']==''?"-":$level[$i2]['name']; echo " ({$level[$i2]['belong']}년)</font></td>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i1, $nation['level'])?></font></td>
|
||||
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp1?>/<?=$level[$i1]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||
<td width=332><font size=4><?=$level[$i1]['name']??'-'?>(<?=$level[$i1]['belong']??'-'?>년)</font></td>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i2, $nation['level'])?></font></td>
|
||||
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp2?>/<?=$level[$i2]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||
<td width=332><font size=4><?=$level[$i2]['name']??'-'?>(<?=$level[$i2]['belong']??'-'?>년)</font></td>
|
||||
</tr>
|
||||
";
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "
|
||||
@@ -205,7 +205,10 @@ if($meLevel >= 5 && $nation['l11set'] == 0) {
|
||||
$query = "select name,city from general where nation='{$me['nation']}' and level='11'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
if($general){
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
}
|
||||
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
@@ -257,7 +260,9 @@ for($i=10; $i >= $lv; $i--) {
|
||||
$query = "select name,city from general where nation='{$me['nation']}' and level={$i}";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
if($general){
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
}
|
||||
}
|
||||
echo "</td></form>";
|
||||
if($i % 2 == 1) { echo "</tr>"; }
|
||||
@@ -504,6 +509,5 @@ for($j=0; $j < $citycount; $j++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>세력도시</title>
|
||||
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -192,7 +192,6 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+1
-2
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>세력장수</title>
|
||||
<title><?=UniqueConst::$serverName?>: 세력장수</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -195,7 +195,6 @@ for($j=0; $j < $gencount; $j++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -26,7 +26,7 @@ if($me['level'] == 0) {
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>세력정보</title>
|
||||
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -160,7 +160,6 @@ echo"
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+33
-34
@@ -5,16 +5,12 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$map = Util::getReq('map', 'int', 0);
|
||||
$mode = Util::getReq('mode', 'int', 2);
|
||||
$tnmt = Util::getReq('tnmt', 'int', 1);
|
||||
$detachNPC = Util::getReq('detachNPC', 'bool');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
if($map < 0 || $map > 2){
|
||||
$map = 0;
|
||||
}
|
||||
|
||||
if($mode < 0 || $mode > 2){
|
||||
$mode = 2;
|
||||
}
|
||||
@@ -32,50 +28,57 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("내정보", 1);
|
||||
|
||||
$query = "select myset from general where owner='{$userID}'";
|
||||
$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
if ($me['myset'] > 0) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
if ($btn == "설정저장" && $me['myset'] > 0) {
|
||||
if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
if ($me['myset'] > 1) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
$me['myset'] -= 1;
|
||||
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'map'=>$map,
|
||||
'mode'=>$mode,
|
||||
'tnmt'=>$tnmt
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$query = "select no,map,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
if($me['npc'] == 1 && $detachNPC){
|
||||
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
|
||||
|
||||
if($turnterm < 10){
|
||||
$targetKillTurn = 30 / $turnterm;
|
||||
}
|
||||
else{
|
||||
$targetKillTurn = 60 / $turnterm;
|
||||
}
|
||||
$db->update('general', [
|
||||
'killturn'=>$targetKillTurn
|
||||
], 'owner=%i AND npc=1', $userID);
|
||||
|
||||
$me['killturn']=$targetKillTurn;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>내정보</title>
|
||||
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link rel=stylesheet href="css/common.css">
|
||||
<script type="text/javascript">
|
||||
function go(type) {
|
||||
if(type == 0){
|
||||
location.replace('c_vacation.php');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -89,28 +92,25 @@ function go(type) {
|
||||
<?php myInfo(); ?>
|
||||
<?php myInfo2(); ?>
|
||||
</td>
|
||||
<td width=50% valign=top>
|
||||
<td width=50% valign=top style="padding-left:4ch;">
|
||||
<form name=form1 action=b_myPage.php method=post>
|
||||
지도수준 【
|
||||
<input type=radio name=map value=0 <?=$me['map']==0?"checked":""; ?>>상세
|
||||
<input type=radio name=map value=1 <?=$me['map']==1?"checked":""; ?>>간단
|
||||
<input type=radio name=map value=2 <?=$me['map']==2?"checked":""; ?>>생략
|
||||
】<br><br>
|
||||
토너먼트 【
|
||||
토너먼트 【
|
||||
<input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
|
||||
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
|
||||
】<br>
|
||||
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
|
||||
수비 【
|
||||
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
|
||||
수비 【
|
||||
<input type=radio name=mode value=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
|
||||
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
|
||||
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
|
||||
】<br><br>
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
</form>
|
||||
휴 가 신 청<br>
|
||||
<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=휴가신청 onclick='go(0)'>
|
||||
휴 가 신 청<br>
|
||||
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
|
||||
빙의 해제용 삭턴 조절<br>
|
||||
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -142,7 +142,6 @@ function go(type) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ $me = MYDB_fetch_array($result);
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>회의실</title>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -64,7 +64,6 @@ for($i=0; $i < 20; $i++) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ increaseRefresh("국법", 1);
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>국법</title>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
@@ -52,7 +52,6 @@ if($me['level'] >= 5) {
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+11
-6
@@ -43,12 +43,12 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>토너먼트</title>
|
||||
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
|
||||
<style>
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
||||
table { font-family:'맑은 고딕'; }
|
||||
font { font-family:'맑은 고딕'; }
|
||||
input { font-family:'맑은 고딕'; height:20px }
|
||||
select { font-family:'굴림'; line-height:100%; }
|
||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||
@@ -176,10 +176,16 @@ if ($session->userGrade >= 5) {
|
||||
|
||||
$str1 = getTournament($admin['tournament']);
|
||||
$str2 = getTournamentTime();
|
||||
if($str2){
|
||||
$str2 = ', '.$str2;
|
||||
}
|
||||
$str3 = getTournamentTerm();
|
||||
if($str3){
|
||||
$str3 = ', '.$str3;
|
||||
}
|
||||
?>
|
||||
<tr><td colspan=8>운영자 메세지 : <font color=orange size=5><?=$admin['tnmt_msg']?></font></td></tr>
|
||||
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
|
||||
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
|
||||
<tr><td colspan=8 align=center id=bg2><font color=magenta size=5>16강 승자전</font></td></tr>
|
||||
<tr><td height=10 colspan=8 align=center></td></tr>
|
||||
<?php
|
||||
@@ -504,6 +510,5 @@ if ($admin['tournament'] == 2 || $admin['tournament'] == 3) {
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+4
-3
@@ -25,7 +25,7 @@ $troopcount = MYDB_num_rows($result);
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>부대편성</title>
|
||||
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
@@ -123,7 +123,9 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
}
|
||||
}
|
||||
|
||||
if($me['troop'] == 0) {
|
||||
if ($troopcount == 0) {
|
||||
}
|
||||
else if($me['troop'] == 0) {
|
||||
echo"
|
||||
<input type=submit name=btn value='부 대 가 입'>";
|
||||
} else {
|
||||
@@ -158,7 +160,6 @@ echo "
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@ $term = Util::getReq('term', 'int');
|
||||
$stuff = Util::getReq('stuff', 'int');
|
||||
$sel = Util::getReq('sel', 'int');
|
||||
|
||||
$msg = '';
|
||||
$msg2 = '';
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
|
||||
+26
-20
@@ -32,37 +32,43 @@ if($me['level'] < 5) {
|
||||
}
|
||||
|
||||
if($btn == "국가방침") {
|
||||
$msg = BadTag2Code(addslashes(SQ2DQ($msg)));
|
||||
$query = "update nation set msg='$msg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$msg == mb_substr($msg, 0, 1000);
|
||||
//$msg = StringUtil::
|
||||
$db->update('nation', [
|
||||
'msg'=>BadTag2Code($msg)
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "임관권유") {
|
||||
$scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg)));
|
||||
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$scoutmsg == mb_substr($msg, 0, 500);
|
||||
$db->update('nation', [
|
||||
'scoutmsg'=>BadTag2Code($scoutmsg)
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "세율") {
|
||||
if($rate < 5) { $rate = 5; }
|
||||
if($rate > 30) { $rate = 30; }
|
||||
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($btn == "지급율") {
|
||||
if($bill < 20) { $bill = 20; }
|
||||
if($bill > 200) { $bill = 200; }
|
||||
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$bill = Util::valueFit($bill, 20, 200);
|
||||
$db->update('nation', [
|
||||
'bill'=>$bill
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "기밀권한") {
|
||||
if($secretlimit < 1) { $secretlimit = 1; }
|
||||
if($secretlimit > 99) { $secretlimit = 99; }
|
||||
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$secretlimit = Util::valueFit($secretlimit, 1, 99);
|
||||
$db->update('nation', [
|
||||
'secretlimit'=>$secretlimit
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "임관 금지") {
|
||||
$query = "update nation set scout='1' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'scout'=>1
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "임관 허가") {
|
||||
$query = "update nation set scout='0' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'scout'=>0
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "전쟁 금지") {
|
||||
$query = "update nation set war='1' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'war'=>1
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "전쟁 허가") {
|
||||
$query = "update nation set war='0' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+31
-11
@@ -20,7 +20,7 @@ $userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$query = "select startyear,year,month,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
@@ -41,17 +41,20 @@ if($meLevel < 5){
|
||||
|
||||
|
||||
if($btn == "임명") {
|
||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
if($genlist !== 0){
|
||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) {
|
||||
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
|
||||
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
@@ -74,13 +77,13 @@ if($btn == "임명") {
|
||||
}
|
||||
|
||||
//나와 대상 장수는 국가가 같아야 함
|
||||
if($me['nation'] != $general['nation']){
|
||||
if($genlist != 0 && $me['nation'] != $general['nation']){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
if($btn == "추방") {
|
||||
$query = "select name,l{$meLevel}set,chemi from nation where nation='{$me['nation']}'";
|
||||
$query = "select name,l{$meLevel}set,chemi,color from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -165,7 +168,24 @@ if($btn == "추방") {
|
||||
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
|
||||
}
|
||||
|
||||
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$general['nation'],
|
||||
$nation['name'],
|
||||
$nation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
$msg = new Message(
|
||||
Message::MSGTYPE_PUBLIC,
|
||||
$src,
|
||||
$src,
|
||||
$str,
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
$msg->send();
|
||||
}
|
||||
|
||||
//국가 기술력 그대로
|
||||
|
||||
@@ -7,6 +7,7 @@ include "func.php";
|
||||
$title = Util::getReq('title');
|
||||
$msg = Util::getReq('msg');
|
||||
$num = Util::getReq('num', 'int');
|
||||
$reply = Util::getReq('reply');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ if($btn == '참가') {
|
||||
}
|
||||
$map = [];
|
||||
for($i=0; $i < 8; $i++) {
|
||||
if($occupied[$i] == 0) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$map[] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -40,8 +40,9 @@ if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
|
||||
'troop'=>0
|
||||
], 'no=%i AND troop=(SELECT troop FROM troop WHERE no = %i)', $gen, $me['no']);
|
||||
} elseif($btn == "부 대 가 입" && $troop != 0) {
|
||||
$troop = $db->queryFirstField('SELECT troop FROM troop WHERE no = %i', $troop);
|
||||
if($troop){
|
||||
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $troop);
|
||||
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `nation`=%i', $troopLeader, $me['nation']);
|
||||
if($troopLeaderNation){
|
||||
$db->update('general', [
|
||||
'troop'=>$troop
|
||||
], 'no=%i', $me['no']);
|
||||
|
||||
@@ -80,6 +80,10 @@ function myCommandList() {
|
||||
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
if(!$me){
|
||||
echo "로그인 되어있지 않습니다.";
|
||||
return;
|
||||
}
|
||||
$turn = getTurn($me, 2);
|
||||
|
||||
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
|
||||
+4
-3
@@ -3,11 +3,12 @@
|
||||
html, body{
|
||||
background-color:black;
|
||||
color:white;
|
||||
line-height:1.3;
|
||||
}
|
||||
|
||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
||||
table { font-family:'맑은 고딕'; }
|
||||
font { font-family:'맑은 고딕'; }
|
||||
input { font-family:'맑은 고딕'; font-size:13px; }
|
||||
select { font-family:'굴림'; line-height:100%; }
|
||||
|
||||
/* */
|
||||
|
||||
+26
-3
@@ -9,6 +9,11 @@
|
||||
}
|
||||
/*임시용 끝*/
|
||||
|
||||
#message_board{
|
||||
height:1370px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#message_board section{
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
@@ -70,19 +75,32 @@
|
||||
color:white;
|
||||
}
|
||||
|
||||
.message_input_form{
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#msg_input{
|
||||
color:white;
|
||||
background-color:black;
|
||||
font-size:12px;
|
||||
width:720px;
|
||||
width:715px;
|
||||
margin:0 2px;
|
||||
height:15px;
|
||||
}
|
||||
|
||||
#msg_submit{
|
||||
position:absolute;
|
||||
right:0;
|
||||
margin-right:2px;
|
||||
}
|
||||
|
||||
#mailbox_list{
|
||||
float:left;
|
||||
color:white;
|
||||
background-color:black;
|
||||
font-size:12px;
|
||||
width:160px;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.board_header{
|
||||
@@ -91,8 +109,13 @@
|
||||
}
|
||||
|
||||
.board_side{
|
||||
width:50%;
|
||||
float:left;
|
||||
position:absolute;
|
||||
height:1370px;
|
||||
width:498px;
|
||||
overflow-y: hidden;
|
||||
border-left:groove 1px;
|
||||
border-right:groove 1px;
|
||||
border-bottom:groove 1px;
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
.container{
|
||||
width:1000px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.card_holder{
|
||||
text-align:center;
|
||||
}
|
||||
.general_card{
|
||||
width:100px;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.general_card h4 {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.general_card p {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
|
||||
.general_card .select_btn {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.general_card label {
|
||||
display: block;
|
||||
padding-left: 15px;
|
||||
text-indent: -15px;
|
||||
}
|
||||
|
||||
.general_card input {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
padding: 0;
|
||||
margin:0;
|
||||
vertical-align: bottom;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
*overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
#outdate_token{
|
||||
color:red;
|
||||
display:none;
|
||||
}
|
||||
@@ -27,6 +27,8 @@ class DB{
|
||||
if(self::$uDB === null){
|
||||
self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding);
|
||||
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
|
||||
|
||||
self::$uDB->error_handler= function(){};
|
||||
self::$uDB->throw_exception_on_error = true;
|
||||
self::$uDB->throw_exception_on_nonsql_error = true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace sammo;
|
||||
|
||||
class UniqueConst{
|
||||
public static $serverID = '_tK_serverID_';
|
||||
public static $serverName = '_tK_serverName_';
|
||||
|
||||
private function __construct(){}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="buttonPlate bg1">
|
||||
<div>
|
||||
<a href="a_status.php" target="_blank"><button class="toolbarButton">세력도</button></a>
|
||||
<a href="a_kingdomList.php" target="_blank"><button class="toolbarButton">세력일람</button></a>
|
||||
<a href="a_genList.php" target="_blank"><button class="toolbarButton">장수일람</button></a>
|
||||
<a href="a_bestGeneral.php" target="_blank"><button class="toolbarButton">명장일람</button></a>
|
||||
<a href="a_history.php" target="_blank"><button class="toolbarButton">연감</button></a>
|
||||
<a href="a_hallOfFame.php" target="_blank"><button class="toolbarButton">명예의전당</button></a>
|
||||
<a href="a_emperior.php" target="_blank"><button class="toolbarButton">왕조일람</button></a>
|
||||
<a href="a_traffic.php" target="_blank"><button class="toolbarButton">접속량정보</button></a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/bbs/board" target="_blank"><button class="toolbarButton2">삼모게시판</button></a>
|
||||
<a href="/bbs/tip" target="_blank"><button class="toolbarButton">팁/강좌</button></a>
|
||||
<a href="/bbs/news" target="_blank"><button class="toolbarButton">삼국 일보</button></a>
|
||||
<a href="/bbs/history2" target="_blank"><button class="toolbarButton">개인 열전</button></a>
|
||||
<a href="/bbs/history3" target="_blank"><button class="toolbarButton">국가 열전</button></a>
|
||||
<a href="/bbs/patch" target="_blank"><button class="toolbarButton">패치 내역</button></a>
|
||||
<a href="../i_other/help.php" target="_blank"><button class="toolbarButton">튜토리얼</button></a>
|
||||
<a href="<?=$site?>" target="_blank"><button class="toolbarButton"><?=$call?></button></a>
|
||||
</div>
|
||||
</div>
|
||||
+79
-85
@@ -18,7 +18,6 @@ require_once 'func_time_event.php';
|
||||
require_once('func_template.php');
|
||||
require_once('func_message.php');
|
||||
require_once('func_map.php');
|
||||
require_once('func_diplomacy.php');
|
||||
require_once('func_command.php');
|
||||
|
||||
/**
|
||||
@@ -557,15 +556,13 @@ function commandTable() {
|
||||
} else {
|
||||
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
||||
}
|
||||
//TODO:등용장 재 디자인
|
||||
//xxx:등용장 일단 끔
|
||||
/*
|
||||
|
||||
if($me['level'] >= 1 && $city['supply'] != 0) {
|
||||
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
||||
} else {
|
||||
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
if($me['no'] == $troop['no'] && $citycount > 0 && $city['supply'] != 0 && $city['nation'] == $me['nation']) {
|
||||
addCommand("집합(통솔경험)", 26);
|
||||
} else {
|
||||
@@ -647,7 +644,13 @@ function commandTable() {
|
||||
if($me['level'] == 12) {
|
||||
addCommand("선양", 54);
|
||||
if($citycount != 0) {
|
||||
addCommand("방랑", 47);
|
||||
if ($admin['year'] + 3 < $admin['startyear']) {
|
||||
addCommand("방랑", 47, 0);
|
||||
}
|
||||
else{
|
||||
addCommand("방랑", 47);
|
||||
}
|
||||
|
||||
addCommand("해산", 56, 0);
|
||||
} else {
|
||||
addCommand("방랑", 47, 0);
|
||||
@@ -999,11 +1002,17 @@ function generalInfo2($no) {
|
||||
if($dex30 > 100) { $dex30 = 100; }
|
||||
if($dex40 > 100) { $dex40 = 100; }
|
||||
|
||||
$general['dex0'] = getDexCall($general['dex0']);
|
||||
$general['dex10'] = getDexCall($general['dex10']);
|
||||
$general['dex20'] = getDexCall($general['dex20']);
|
||||
$general['dex30'] = getDexCall($general['dex30']);
|
||||
$general['dex40'] = getDexCall($general['dex40']);
|
||||
$general['dex0_text'] = getDexCall($general['dex0']);
|
||||
$general['dex10_text'] = getDexCall($general['dex10']);
|
||||
$general['dex20_text'] = getDexCall($general['dex20']);
|
||||
$general['dex30_text'] = getDexCall($general['dex30']);
|
||||
$general['dex40_text'] = getDexCall($general['dex40']);
|
||||
|
||||
$general['dex0_short'] = sprintf('%.1fK', $general['dex0']/1000);
|
||||
$general['dex10_short'] = sprintf('%.1fK', $general['dex10']/1000);
|
||||
$general['dex20_short'] = sprintf('%.1fK', $general['dex20']/1000);
|
||||
$general['dex30_short'] = sprintf('%.1fK', $general['dex30']/1000);
|
||||
$general['dex40_short'] = sprintf('%.1fK', $general['dex40']/1000);
|
||||
|
||||
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<tr><td align=center colspan=6 id=bg1><b>추 가 정 보</b></td></tr>
|
||||
@@ -1039,30 +1048,35 @@ function generalInfo2($no) {
|
||||
</tr>
|
||||
</table>
|
||||
<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<tr><td align=center colspan=3 id=bg1><b>숙 련 도</b></td></tr>
|
||||
<tr><td align=center colspan=4 id=bg1><b>숙 련 도</b></td></tr>
|
||||
<tr height=16>
|
||||
<td width=64 align=center id=bg1><b>보병</b></td>
|
||||
<td width=64> {$general['dex0']}</td>
|
||||
<td width=366 align=center>".bar($dex0, 16)."</td>
|
||||
<td width=40> {$general['dex0_text']}</td>
|
||||
<td width=60 align=right>{$general['dex0_short']} </td>
|
||||
<td width=330 align=center>".bar($dex0, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>궁병</b></td>
|
||||
<td> {$general['dex10']}</td>
|
||||
<td> {$general['dex10_text']}</td>
|
||||
<td align=right>{$general['dex10_short']} </td>
|
||||
<td align=center>".bar($dex10, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>기병</b></td>
|
||||
<td> {$general['dex20']}</td>
|
||||
<td> {$general['dex20_text']}</td>
|
||||
<td align=right>{$general['dex20_short']} </td>
|
||||
<td align=center>".bar($dex20, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>귀병</b></td>
|
||||
<td> {$general['dex30']}</td>
|
||||
<td> {$general['dex30_text']}</td>
|
||||
<td align=right>{$general['dex30_short']} </td>
|
||||
<td align=center>".bar($dex30, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>차병</b></td>
|
||||
<td> {$general['dex40']}</td>
|
||||
<td> {$general['dex40_text']}</td>
|
||||
<td align=right>{$general['dex40_short']} </td>
|
||||
<td align=center>".bar($dex40, 16)."</td>
|
||||
</tr>
|
||||
</table>";
|
||||
@@ -1129,23 +1143,6 @@ function nationMsg() {
|
||||
echo "<font color=orange>".$nation['msg']."</font>";
|
||||
}
|
||||
|
||||
|
||||
function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $tocolor, $msg) {
|
||||
if($nation == 0) { $nation = 0; }
|
||||
if($fromcolor == "") { $fromcolor = "#FFFFFF"; }
|
||||
if($to == "") { $to = "재야"; }
|
||||
if($tocolor == "") { $tocolor = "#FFFFFF"; }
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
if($type == 1) { $file = "_all_msg.txt"; }
|
||||
else { $file = "_nation_msg{$nation}.txt"; }
|
||||
$fp = fopen("logs/{$file}", "a");
|
||||
//로그 파일에 기록
|
||||
$str = "{$type}|".StringUtil::padStringAlignRight($from,12," ")."|".StringUtil::padStringAlignRight($to,12," ")."|".$date."|".$msg."|".$fromcolor."|".$tocolor."|".$picture."|".$imgsvr;
|
||||
fwrite($fp, "{$str}\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -1265,6 +1262,7 @@ function cutDay($date, int $turnterm) {
|
||||
function increaseRefresh($type="", $cnt=1) {
|
||||
//FIXME: 로그인, 비로그인 시 처리가 명확하지 않음
|
||||
$session = Session::getInstance();
|
||||
$userID = $session->userID;
|
||||
$generalID = $session->generalID;
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
@@ -1281,14 +1279,14 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
'connect'=>$db->sqleval('connect + %i', $cnt),
|
||||
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
|
||||
'refresh'=>$db->sqleval('refresh + %i', $cnt)
|
||||
], 'owner=%i', $generalID);
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$date = date('Y_m_d H:i:s');
|
||||
$date2 = substr($date, 0, 10);
|
||||
$online = getOnlineNum();
|
||||
file_put_contents(
|
||||
"logs/_{$date2}_refresh.txt",
|
||||
__dir__."/logs/_{$date2}_refresh.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s, %s, %s, %d\n",
|
||||
$date,
|
||||
@@ -1325,7 +1323,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
}
|
||||
if($str != "") {
|
||||
file_put_contents(
|
||||
"logs/_{$date2}_ipcheck.txt",
|
||||
__dir__."/logs/_{$date2}_ipcheck.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s%s\n",
|
||||
$session->userName,
|
||||
@@ -1362,19 +1360,21 @@ function updateTraffic() {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
//일시|년|월|총갱신|접속자|최다갱신자
|
||||
file_put_contents(__dir__."/logs/_traffic.txt",
|
||||
StringUtil::padStringAlignRight($date,20," ")
|
||||
."|".StringUtil::padStringAlignRight($game['year'],3," ")
|
||||
."|".StringUtil::padStringAlignRight($game['month'],2," ")
|
||||
."|".StringUtil::padStringAlignRight($game['refresh'],8," ")
|
||||
."|".StringUtil::padStringAlignRight($online,5," ")
|
||||
."|".StringUtil::padStringAlignRight($user['name']."(".$user['refresh'].")",20," ")
|
||||
Json::encode([
|
||||
$date,
|
||||
$game['year'],
|
||||
$game['month'],
|
||||
$game['refresh'],
|
||||
$online,
|
||||
$user['name']."(".$user['refresh'].")"
|
||||
])."\n"
|
||||
, FILE_APPEND);
|
||||
}
|
||||
|
||||
function CheckOverhead() {
|
||||
//서버정보
|
||||
$db = DB::db();
|
||||
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from GAME LIMIT 1');
|
||||
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
|
||||
|
||||
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
|
||||
|
||||
@@ -1524,7 +1524,7 @@ function checkTurn() {
|
||||
|
||||
// 파일락 획득
|
||||
//FIXME:이미 DB 테이블로 lock을 시도하는데 이게 따로 필요한가?
|
||||
$fp = fopen('lock.txt', 'r');
|
||||
$fp = fopen(__dir__.'/lock.txt', 'r');
|
||||
if(!flock($fp, LOCK_EX)) {
|
||||
return;
|
||||
}
|
||||
@@ -1721,14 +1721,6 @@ function checkTurn() {
|
||||
$query = "update game set turntime='$date'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 3턴 전 시간
|
||||
$letterdate = subTurn($date, $admin['turnterm'], 3);
|
||||
//기한 지난 외교 메세지 지움(3개월 유지)
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
|
||||
for($i=0; $i < 5; $i++) {
|
||||
$query = "update nation set dip{$i}='',dip{$i}_who='0',dip{$i}_type='0',dip{$i}_when='' where dip{$i}_when < '$letterdate'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
// 부상 과도 제한
|
||||
$query = "update general set injury='80' where injury>'80'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1795,25 +1787,27 @@ function addAge() {
|
||||
|
||||
function turnDate($curtime) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,starttime,turnterm,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
|
||||
|
||||
$turn = $admin['starttime'];
|
||||
$curturn = cutTurn($curtime, $admin['turnterm']);
|
||||
$num = 0;
|
||||
$term = $admin['turnterm']*60;
|
||||
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term);
|
||||
$term = $admin['turnterm'];
|
||||
|
||||
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term*60);
|
||||
|
||||
$year = $admin['startyear'] + intdiv($num, 12);
|
||||
$month = 1 + (12+$num) % 12;
|
||||
$date = $admin['startyear'] * 12;
|
||||
$date += $num;
|
||||
|
||||
$year = intdiv($date, 12);
|
||||
$month = 1 + $date % 12;
|
||||
|
||||
// 바뀐 경우만 업데이트
|
||||
if($admin['month'] != $month || $admin['year'] != $year) {
|
||||
$query = "update game set year='$year',month='$month'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('game', [
|
||||
'year'=>$year,
|
||||
'month'=>$month
|
||||
], true);
|
||||
}
|
||||
|
||||
return [$year, $month];
|
||||
@@ -1830,8 +1824,8 @@ function triggerTournament() {
|
||||
|
||||
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
||||
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
|
||||
$type = rand() % 6; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||
//전력전 50%, 통, 일, 설 각 17%
|
||||
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||
//전력전 40%, 통, 일, 설 각 20%
|
||||
if($type > 3) { $type = 0; }
|
||||
startTournament($admin['tnmt_trig'], $type);
|
||||
}
|
||||
@@ -2213,11 +2207,11 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$occupied[$gen[$type]] = 1;
|
||||
}
|
||||
for($i=7; $i <= 26; $i++) {
|
||||
if($occupied[$i] == 0) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$item[] = $i;
|
||||
}
|
||||
}
|
||||
$it = $item[rand() % count($item)];
|
||||
$it = $item[rand() % count($item)]??0;
|
||||
|
||||
$query = "update general set {$type}='$it' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2230,13 +2224,13 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
|
||||
if($vote == 0) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -2244,13 +2238,13 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
|
||||
if($vote == 0) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -2258,13 +2252,13 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
|
||||
if($vote == 0) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -2272,13 +2266,13 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
|
||||
if($vote == 0) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[0] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+15
-10
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function getTurn($general, $type, $font=1) {
|
||||
function getTurn(array $general, $type, $font=1) {
|
||||
//TODO: 왜 'Type' 인가. 그냥 count로 하자.
|
||||
$str = [];
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -532,13 +533,15 @@ function processCommand($no) {
|
||||
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif(intval($command[0]) == 0 && $session->userGrade < 5) {
|
||||
} elseif($command[0] == 0) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$admin['killturn']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
|
||||
|
||||
//연속턴 아닌경우 텀 리셋
|
||||
if($general['term']%100 != $command[0]) {
|
||||
$query = "update general set term=0 where no='{$general['no']}'";
|
||||
@@ -570,7 +573,7 @@ function processCommand($no) {
|
||||
case 17: process_17($general); break; //소집해제
|
||||
|
||||
case 21: process_21($general); break; //이동
|
||||
//case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
|
||||
case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
|
||||
case 25: process_25($general); break; //임관
|
||||
case 26: process_26($general); break; //집합
|
||||
case 28: process_28($general); break; //귀환
|
||||
@@ -681,19 +684,21 @@ where nation='{$general['nation']}'
|
||||
|
||||
|
||||
function command_Single($turn, $command) {
|
||||
if(!$turn){
|
||||
header('location:commandlist.php');
|
||||
return;
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, $command);
|
||||
|
||||
$count = count($turn);
|
||||
$str = "con=con";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$str .= ",turn{$turn[$i]}='{$command}'";
|
||||
$setValues = [];
|
||||
foreach($turn as $turnIdx){
|
||||
$setValues["turn{$turnIdx}"] = $command;
|
||||
}
|
||||
$query = "update general set {$str} where owner='{$userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||
|
||||
header('location:commandlist.php');
|
||||
}
|
||||
|
||||
@@ -397,9 +397,6 @@ function getBill(int $dedication) : int{
|
||||
}
|
||||
|
||||
function getCost(int $armtype) : int {
|
||||
//FIXME: 정말로 side effect가 없으려면 query는 밖으로 이동해야함.
|
||||
//TODO: 병종 값이 column으로 들어있는건 전혀 옳지 않음. key->value 형태로 바꿔야함
|
||||
|
||||
return GameUnitConst::byID($armtype)->cost;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function checkScoutAvailable($messageInfo, $general, $srcGeneral, $startyear, $year){
|
||||
$nationID = $messageInfo['src']['nationID'];
|
||||
|
||||
$srcNation = DB::db()->queryFirstRow('SELECT `level`, `scout` FROM `nation` WHERE `nation` = %i', $nationID);
|
||||
|
||||
$realNationID = $srcGeneral['nation'];
|
||||
|
||||
|
||||
|
||||
if($general['level'] == 12) {
|
||||
return [false, "군주입니다."];
|
||||
}
|
||||
if(!$srcNation || $srcNation['level'] == 0) {
|
||||
return [false, "없는 국가이거나 방랑군입니다."];
|
||||
}
|
||||
if($realNationID != $nationID){
|
||||
return [false, "권유자의 소속이 바뀌었습니다."];
|
||||
}
|
||||
if($srcNation['scout'] != 0) {
|
||||
return [false, "임관 금지중입니다."];
|
||||
}
|
||||
if($year < $startyear+3) {
|
||||
return [false, "초반 제한중입니다."];
|
||||
}
|
||||
if(strpos($general['nations'], ",{$nationID},") > 0) {
|
||||
return [false, "이미 임관했었던 국가입니다."];
|
||||
}
|
||||
|
||||
return [true, null];
|
||||
|
||||
}
|
||||
|
||||
function acceptScout($messageInfo, $general, $msgResponse){
|
||||
$me = $general;
|
||||
$you = DB::db()->queryFirstRow('SELECT `no`, `name`, `nation` FROM `general` WHERE `no` = %i', $messageInfo['src']['id']);
|
||||
|
||||
list($startyear, $year, $month, $killturn) = Util::convertDictToArray(DB::db()->queryFirstRow('SELECT `startyear`, `year`, `month`, `killturn` FROM `game` LIMIT 1'), ['startyear', 'year', 'month', `killturn`]);
|
||||
|
||||
list($avaliableScout, $reason) = checkScoutAvailable($messageInfo, $general, $you, $startyear, $year);
|
||||
|
||||
if(!$msgResponse || !$avaliableScout){
|
||||
return declineScout($messageInfo, $reason);
|
||||
}
|
||||
|
||||
$nation = getNationStaticInfo($messageInfo['src']['nationID']);
|
||||
$generalID = $me['no'];
|
||||
$nationID = $nation['nation'];
|
||||
$nationName = $nation['name'];
|
||||
$myName = $me['name'];
|
||||
|
||||
$mylog = [];
|
||||
$youlog = [];
|
||||
$alllog = [];
|
||||
|
||||
$youlog[] = "<C>●</><Y>{$myName}</> 등용에 성공했습니다.";
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$myName}</>(이)가 <D><b>{$nationName}</b></>(으)로 <S>망명</>하였습니다.";
|
||||
$mylog[] = "<C>●</><D>{$nationName}</>(으)로 망명하여 수도로 이동합니다.";
|
||||
pushGeneralHistory($you, "<C>●</>{$year}년 {$month}월:<Y>{$myName}</> 등용에 성공");
|
||||
pushGeneralHistory($me, "<C>●</>{$year}년 {$month}월:<D>{$nationName}</>(으)로 망명");
|
||||
|
||||
$me['nations'] .= "{$nationID},";
|
||||
|
||||
$updateMe = [
|
||||
'belong'=>1,
|
||||
'nation'=>$nationID,
|
||||
'level'=>1,
|
||||
'city'=>$nation['capital'],
|
||||
'troop'=>0
|
||||
];
|
||||
|
||||
|
||||
//처리가 조금 다름.
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
|
||||
if($me['level'] > 0){
|
||||
$updateOldNation = [
|
||||
'totaltech' => $db->sqleval('`tech`*greatest(10, `gennum`-1)'),
|
||||
'gennum' => $db->sqleval('greatest(10, `gennum`-1)')
|
||||
];
|
||||
|
||||
if($me['gold'] > 1000){
|
||||
$updateOldNation['gold'] = $db->sqleval('`gold` + %i', $me['gold'] - 1000);
|
||||
$updateMe['gold'] = 1000;
|
||||
}
|
||||
if($me['rice'] > 1000){
|
||||
$updateOldNation['rice'] = $db->sqleval('`rice` + %i', $me['rice'] - 1000);
|
||||
$updateMe['rice'] = 1000;
|
||||
}
|
||||
|
||||
$updateMe['betray'] = $db->sqleval('`betray` + 1');
|
||||
$updateMe['dedication'] = $db->sqleval('dedication*(1-0.1*betray)');
|
||||
$updateMe['experience'] = $db->sqleval('experience*(1-0.1*betray)');
|
||||
|
||||
$db->update('nation', $updateOldNation, 'nation = %i', $messageInfo['dest']['nationID']);
|
||||
}
|
||||
else{
|
||||
$updateMe['dedication'] = $db->sqleval('dedication + 100');
|
||||
$updateMe['experience'] = $db->sqleval('experience + 100');
|
||||
}
|
||||
|
||||
if($me['npc'] < 2){
|
||||
$updateMe['killturn'] = $killturn;
|
||||
}
|
||||
|
||||
$db->update('general', $updateMe, 'no = %i', $generalID);
|
||||
|
||||
$db->query('UPDATE nation set '.
|
||||
'gennum = greatest(10, (SELECT count(`id`) from general where `nation` = %i_nation)), '.
|
||||
'totaltech = tech * greatest(10, (SELECT count(`id`) from general where `nation` = %i_nation)) '.
|
||||
'where nation=%i_nation', ['nation'=>$nationID]);
|
||||
|
||||
//태수 군사 시중 해제
|
||||
switch($me['level']) {
|
||||
case 4:
|
||||
$db->query('update city set gen1=0 where gen1=%i', $generalID);
|
||||
break;
|
||||
case 3:
|
||||
$db->query('update city set gen3=0 where gen2=%i', $generalID);
|
||||
break;
|
||||
case 2:
|
||||
$db->query('update city set gen3=0 where gen2=%i', $generalID);
|
||||
break;
|
||||
}
|
||||
|
||||
$db->query('UPDATE general left join troop on troop.troop = general.troop set general.troop = 0 where troop.no = %i', $generalID);
|
||||
$db->query('delete from troop where no = %i', $generalID);
|
||||
|
||||
$db->query('UPDATE `message` SET `valid_until`=\'1234-11-22 11:22:33\' WHERE `id` = %i', $messageInfo['id']);
|
||||
$msg = "{$nationName}(으)로 등용 제의 수락";
|
||||
sendRawMessage('private', false, $general['no'], $messageInfo['src'], $messageInfo['dest'], $msg, null, null, ['parent'=>$messageInfo['id']]);
|
||||
|
||||
pushGenLog($me, $mylog);
|
||||
pushGenLog($you, $youlog);
|
||||
pushGeneralPublicRecord($alllog, $year, $month);
|
||||
pushWorldHistory($alllog, $year, $month);
|
||||
|
||||
return [true, 'success'];
|
||||
}
|
||||
|
||||
function declineScout($messageInfo, $reason=null){
|
||||
$me = [
|
||||
'no'=>$messageInfo['dest']['id'],
|
||||
'name'=>$messageInfo['dest']['name']
|
||||
];
|
||||
$you = ['no'=>$messageInfo['src']['id']];
|
||||
|
||||
$nation = getNationStaticInfo($messageInfo['src']['nationID']);
|
||||
$generalID = $me['no'];
|
||||
$nationID = $nation['nation'];
|
||||
$nationName = $nation['name'];
|
||||
$myName = $me['name'];
|
||||
|
||||
$mylog = [];
|
||||
$youlog = [];
|
||||
|
||||
|
||||
$nationName = $messageInfo['src']['nation'];
|
||||
if($reason){
|
||||
$mylog[] = "<C>●</>{$reason} 등용 수락 불가.";
|
||||
$msg = "{$nationName}(으)로 등용 제의 수락 불가";
|
||||
}
|
||||
else{
|
||||
$youlog[] = "<C>●</><Y>{$me['name']}</>(이)가 등용을 거부했습니다.";
|
||||
$mylog[] = "<C>●</><D>{$nationName}</>(으)로 망명을 거부했습니다.";
|
||||
$msg = "{$nationName}(으)로 등용 제의 거부";
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$db->query('UPDATE `message` SET `valid_until`=\'1234-11-22 11:22:33\' WHERE `id` = %i', $messageInfo['id']);
|
||||
|
||||
sendRawMessage('private', false, $you['no'], $messageInfo['src'], $messageInfo['dest'], $msg, null, null, ['parent'=>$messageInfo['id']]);
|
||||
|
||||
pushGenLog($me, $mylog);
|
||||
pushGenLog($you, $youlog);
|
||||
|
||||
return [true, 'success'];
|
||||
}
|
||||
|
||||
function acceptAlly($messageInfo, $general, $msgResponse){
|
||||
return [false, 'NYI'];
|
||||
}
|
||||
|
||||
function declineAlly($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function acceptBreakAlly($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function declineBreakAlly($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function acceptStopWar($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function declineStopWar($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
|
||||
function acceptMergeNations($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function declineMergeNations($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
|
||||
function acceptSurrender($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
|
||||
function declineSurrender($messageInfo, $general, $msgResponse){
|
||||
|
||||
}
|
||||
+18
-18
@@ -5,7 +5,7 @@ namespace sammo;
|
||||
|
||||
function delStepLog() {
|
||||
$date = date('Y_m_d');
|
||||
@unlink("logs/_{$date}_steplog.txt");
|
||||
@unlink(__dir__."/logs/_{$date}_steplog.txt");
|
||||
}
|
||||
|
||||
function pushRawFileLog($path, $lines){
|
||||
@@ -50,81 +50,81 @@ function eraseTnmtFightLogAll(){
|
||||
}
|
||||
|
||||
function eraseTnmtFightLog(int $group){
|
||||
$filepath = "logs/fight{$group}.txt";
|
||||
$filepath = __dir__."/logs/fight{$group}.txt";
|
||||
if(file_exists($filepath)){
|
||||
@unlink($filepath);
|
||||
}
|
||||
}
|
||||
|
||||
function pushTnmtFightLog(int $group, $log) {
|
||||
pushRawFileLog("logs/fight{$group}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
|
||||
}
|
||||
|
||||
function getTnmtFightLogAll(int $group) {
|
||||
return join('<br>',getFormattedFileLogAll("logs/fight{$group}.txt"));
|
||||
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
|
||||
}
|
||||
|
||||
function pushSabotageLog($log) {
|
||||
pushRawFileLog("logs/_sabotagelog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
|
||||
}
|
||||
|
||||
function getSabotageLogRecent($count) {
|
||||
return join('<br>', getFormattedFileLogRecent("logs/_sabotagelog.txt", $count, 150));
|
||||
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/_sabotagelog.txt", $count, 150));
|
||||
}
|
||||
|
||||
function pushProcessLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog("logs/_{$date}_processlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
|
||||
}
|
||||
|
||||
|
||||
function pushStepLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog("logs/_{$date}_steplog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
|
||||
}
|
||||
|
||||
function pushLockLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog("logs/_{$date}_locklog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAdminLog($log) {
|
||||
pushRawFileLog("logs/_adminlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAuctionLog($log) {
|
||||
pushRawFileLog("logs/_auctionlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
|
||||
}
|
||||
|
||||
function getAuctionLogRecent(int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/_auctionlog.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/_auctionlog.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushGenLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog("logs/gen{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getGenLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/gen{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/gen{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatRes($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog("logs/batres{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatResRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/batres{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batres{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog("logs/batlog{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/batlog{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batlog{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
//DB-based
|
||||
|
||||
+2
-2
@@ -51,8 +51,8 @@ function Submit($url, $msg="", $msg2="") {
|
||||
echo "a"; // 파폭 버그 때문
|
||||
echo "
|
||||
<form method=post name=f1 action='{$url}'>
|
||||
<input type=hidden name=msg value='{$msg}'>
|
||||
<input type=hidden name=msg2 value='{$msg2}'>
|
||||
<input type=hidden name=msg value=\"{$msg}\">
|
||||
<input type=hidden name=msg2 value=\"{$msg2}\">
|
||||
</form>
|
||||
<script>f1.submit();</script>
|
||||
";
|
||||
|
||||
+12
-7
@@ -51,7 +51,7 @@ function getWorldMap($req){
|
||||
}
|
||||
|
||||
$session = Session::getInstance();
|
||||
$generalID = $session->generalID;
|
||||
$userID = $session->userID;
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
@@ -60,13 +60,18 @@ function getWorldMap($req){
|
||||
$year = Util::toInt($game['year']);
|
||||
$month = Util::toInt($game['month']);
|
||||
|
||||
if($generalID && ($req->showMe || !$req->neutralView)){
|
||||
$city = $db->queryFirstRow(
|
||||
'select `city`, `nation` from `general` where `no`=%i',
|
||||
$generalID);
|
||||
$general = $db->queryFirstRow(
|
||||
'select `no`, `city`, `nation` from `general` where `owner`=%i',
|
||||
$userID);
|
||||
|
||||
$myCity = Util::toInt($city['city']);
|
||||
$myNation = Util::toInt($city['nation']);
|
||||
|
||||
if($general && ($req->showMe || !$req->neutralView)){
|
||||
if($session->generalID !== $general['no']){
|
||||
$session->logoutGame()->loginGame();
|
||||
}
|
||||
|
||||
$myCity = Util::toInt($general['city']);
|
||||
$myNation = Util::toInt($general['nation']);
|
||||
|
||||
if(!$req->showMe){
|
||||
$myCity = null;
|
||||
|
||||
@@ -48,58 +48,6 @@ function getMailboxList(){
|
||||
|
||||
//Legacy
|
||||
|
||||
// type : xx,xx(불가침기간,타입)
|
||||
// who : xxxx,xxxx(발신인, 수신인)
|
||||
function DecodeMsg($msg, $type, $who, $date, $bg, $num=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
//FIXME: 폐기
|
||||
$query = "select no,nation,name,picture,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
// 1 : 전메, 2 : 아국->타국, 3 : 타국->아국
|
||||
// 4 : 합병, 5 : 통합, 6 : 불가침, 7 : 종전, 8 : 파기
|
||||
// 9 : 자신->타인, 10 : 타인 -> 자신, 11 : 등용
|
||||
$category = $type % 100;
|
||||
$term = intdiv($type, 100);
|
||||
$from = intdiv($who, 10000);
|
||||
$to = $who % 10000;
|
||||
|
||||
$query = "select name,picture,imgsvr,nation from general where no='$from'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$sndr = MYDB_fetch_array($result);
|
||||
|
||||
$sndrnation = getNationStaticInfo($sndr['nation']);
|
||||
|
||||
switch($bg) {
|
||||
case 2:
|
||||
case 4: $bgcolor = "#CC6600"; break;
|
||||
}
|
||||
|
||||
if($category == 6) {
|
||||
$query = "select reserved from diplomacy where me='{$sndr['nation']}' and you='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
|
||||
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}▶", $sndrnation['color'], $sndr['name'], $sndrnation['color'], $msg, $date, $num, $from, $term, $me['level'], $dip['reserved']);
|
||||
} elseif($category <= 8) {
|
||||
$rcvrnation = getNationStaticInfo($to);
|
||||
|
||||
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}▶", $sndrnation['color'], $rcvrnation['name'], $rcvrnation['color'], $msg, $date, $num, $from, $term, $me['level']);
|
||||
} elseif($category <= 11) {
|
||||
$query = "select name,picture,nation from general where no='$to'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$rcvr = MYDB_fetch_array($result);
|
||||
|
||||
$rcvrnation = getNationStaticInfo($rcvr['nation']);
|
||||
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}▶", $sndrnation['color'], "{$rcvr['name']}:{$rcvrnation['name']}", $rcvrnation['color'], $msg, $date, $num, $from, $term);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -108,78 +56,3 @@ function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $
|
||||
$query = "update {$table} set {$msgtype}{$msgnum}='$msg',{$msgtype}{$msgnum}_type='$type',{$msgtype}{$msgnum}_who='$who',{$msgtype}{$msgnum}_when='$when' where {$column}='$value'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function MsgDip($bg) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$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);
|
||||
|
||||
$query = "select dip0,dip1,dip2,dip3,dip4,dip0_who,dip1_who,dip2_who,dip3_who,dip4_who,dip0_when,dip1_when,dip2_when,dip3_when,dip4_when,dip0_type,dip1_type,dip2_type,dip3_type,dip4_type from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($nation['dip0']) { echo "\n"; DecodeMsg($nation['dip0'], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); }
|
||||
if($nation['dip1']) { echo "\n"; DecodeMsg($nation['dip1'], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); }
|
||||
if($nation['dip2']) { echo "\n"; DecodeMsg($nation['dip2'], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); }
|
||||
if($nation['dip3']) { echo "\n"; DecodeMsg($nation['dip3'], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); }
|
||||
if($nation['dip4']) { echo "\n"; DecodeMsg($nation['dip4'], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); }
|
||||
}
|
||||
|
||||
function ShowMsg($bgcolor, $type, $picture, $imgsvr, $me, $mycolor, $you, $youcolor, $msg, $date, $num=0, $who=0, $when=0, $level=0, $note="") {
|
||||
if($msg == "") return;
|
||||
|
||||
$msg = Tag2Code($msg);
|
||||
|
||||
$site = ""; $form = ""; $form2 = "";
|
||||
if($type == 11 || ($type >= 4 && $type <= 8 && $level >= 5)) {
|
||||
$corebutton = " <input type=submit name=ok value=수락 onclick='return confirm(\"정말 수락하시겠습니까?\")'><input type=submit name=ok value=거절 onclick='return confirm(\"정말 거절하시겠습니까?\")'>";
|
||||
} else {
|
||||
$corebutton = " 【수락】【거절】";
|
||||
}
|
||||
if($type == 6) {
|
||||
$corebutton .= "<br>비고: {$note}";
|
||||
}
|
||||
switch($type) {
|
||||
case 1: $sign = ""; $corebutton = ""; break;
|
||||
case 2: $sign = ""; $corebutton = ""; break;
|
||||
case 3: $sign = ""; $corebutton = ""; break;
|
||||
case 4: $sign = ""; $site = "d_surrender.php"; break;
|
||||
case 5: $sign = ""; $site = "d_merge.php"; break;
|
||||
case 6: $sign = ""; $site = "d_ally.php"; break;
|
||||
case 7: $sign = ""; $site = "d_cease.php"; break;
|
||||
case 8: $sign = ""; $site = "d_cancel.php"; break;
|
||||
case 9: $sign = ""; $corebutton = ""; break;
|
||||
case 10: $sign = ""; $corebutton = ""; break;
|
||||
case 11: $sign = ""; $site = "d_scout.php"; break;
|
||||
}
|
||||
$imageTemp = GetImageURL($imgsvr);
|
||||
$naming = "[<font color=$mycolor>$me</font>{$sign}<font color=$youcolor>$you</font>]";
|
||||
$picture = "<img width='64' height='64' src={$imageTemp}/{$picture}>";
|
||||
if($site != "") {
|
||||
$form = "<form name=scout method=post action={$site}>";
|
||||
$form2 = "</form>";
|
||||
}
|
||||
if($num >= 0) { $num = "<input type=hidden name=num value=$num>"; }
|
||||
else { $num = ""; }
|
||||
if($who > 0) { $who = "<input type=hidden name=gen value=$who>"; }
|
||||
else { $who = ""; }
|
||||
if($when > 0) { $when = "<input type=hidden name=when value=$when>"; }
|
||||
else { $when = ""; }
|
||||
echo "
|
||||
<table width=498 border=1 bordercolordark=gray bordercolorlight=black cellpadding=0 cellspacing=0 bgcolor='$bgcolor' style=font-size:13px;table-layout:fixed;word-break:break-all;>
|
||||
<tr>
|
||||
<td width=64 height=64>$picture</td>
|
||||
$form
|
||||
<td width=434 valign=top><b>$naming</b><font size=1><$date></font> <br>{$msg}{$corebutton}</td>
|
||||
$num
|
||||
$who
|
||||
$when
|
||||
$form2
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
|
||||
+154
-39
@@ -192,7 +192,15 @@ function processAI($no) {
|
||||
|
||||
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nation = MYDB_fetch_array($result)??[
|
||||
'nation'=>0,
|
||||
'color'=>'#000000',
|
||||
'name'=>'재야',
|
||||
'level'=>0,
|
||||
'gold'=>0,
|
||||
'rice'=>0,
|
||||
'tech'=>0,
|
||||
];
|
||||
|
||||
$coreCommand = array();
|
||||
if($general['level'] >= 5) {
|
||||
@@ -261,6 +269,7 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
$tech = getTechCost($nation['tech']);
|
||||
$resrc = $tech * 700;//XXX: 왜 700이지?
|
||||
|
||||
if($general['atmos'] >= 90 && $general['train'] >= 90) {
|
||||
if($general['mode'] == 0) {
|
||||
@@ -276,20 +285,26 @@ function processAI($no) {
|
||||
|
||||
//운영자메시지 출력 하루 6번..?
|
||||
//특별 메세지 있는 경우 출력 하루 4번
|
||||
switch($admin['turnterm']) {
|
||||
case 0: $term = 1; break;
|
||||
case 1: $term = 1; break;
|
||||
case 2: $term = 2; break;
|
||||
case 3: $term = 3; break;
|
||||
case 4: $term = 6; break;
|
||||
case 5: $term = 12; break;
|
||||
case 6: $term = 30; break;
|
||||
case 7: $term = 60; break;
|
||||
}
|
||||
if($general['npcid'] == 2000 && rand()%(24*$term) < 6) {
|
||||
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
|
||||
} elseif($general['npcmsg'] != "" && rand()%(24*$term) < 3) {
|
||||
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
|
||||
$term = $admin['turnterm'];
|
||||
if($general['npcmsg'] && Util::randBool($term / (6*60))) {
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$general['nation'],
|
||||
$nation['name'],
|
||||
$nation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
$msg = new Message(
|
||||
Message::MSGTYPE_PUBLIC,
|
||||
$src,
|
||||
$src,
|
||||
$general['npcmsg'],
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
$msg->send();
|
||||
}
|
||||
|
||||
//재야인경우
|
||||
@@ -571,33 +586,98 @@ function processAI($no) {
|
||||
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
|
||||
else { $type = "rice"; $type2 = 2; }
|
||||
|
||||
if($nation[$type] < 1000) { // 몰수
|
||||
if($nation[$type] < $type2*3000) { // 몰수
|
||||
// 몰수 대상
|
||||
$query = "select no,{$type} from general where nation='{$general['nation']}' and no!='{$general['no']}' and {$type}>3000 order by {$type} desc limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$SelGen = MYDB_fetch_array($result);
|
||||
if($SelGen['no'] != 0) {
|
||||
$amount = intdiv($SelGen[$type], 5000)*10 + 10;
|
||||
if($amount > 100) $amount = 100;
|
||||
list($npcGenID, $npcGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc >= 2 ORDER BY %b DESC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$type
|
||||
);
|
||||
|
||||
list($userGenID, $userGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc < 2 ORDER BY %b DESC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$type
|
||||
);
|
||||
|
||||
if($npcGenID === null && $userGenID === null){
|
||||
$genID = 0;
|
||||
$genValue = 0;
|
||||
}
|
||||
else if($npcGenID === null || $userGenValue > $npcGenValue * 4){
|
||||
$genID = $userGenID;
|
||||
$genValue = $userGenValue;
|
||||
}
|
||||
else{
|
||||
$genID = $npcGenID;
|
||||
$genValue = $npcGenValue;
|
||||
}
|
||||
|
||||
if($genID){
|
||||
$amount = min(100, intdiv($genValue, 5000)*10 + 10);
|
||||
// 몰수
|
||||
$command = EncodeCommand($type2, $SelGen['no'], $amount, 24); // 금,쌀 1000단위 몰수
|
||||
$command = EncodeCommand($type2, $genID, $amount, 24); // 금,쌀 1000단위 몰수
|
||||
}
|
||||
} else { // 포상
|
||||
// 포상 대상
|
||||
$query = "select no from general where nation='{$general['nation']}' and no!='{$general['no']}' and killturn>=5 order by {$type} limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$SelGen = MYDB_fetch_array($result);
|
||||
if($SelGen['no'] != 0) {
|
||||
$amount = intdiv(($nation[$type]-GameConst::$baserice), 5000)*10 + 10;
|
||||
if($amount > 100) $amount = 100;
|
||||
list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList(
|
||||
'SELECT `no`, %b, leader FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$resrc,
|
||||
$type
|
||||
);
|
||||
|
||||
list($userGenID, $userGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND npc < 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
($type=='gold')?21000:3000,
|
||||
$type
|
||||
);
|
||||
|
||||
if($npcGenID === null && $userGenID === null){
|
||||
$genID = 0;
|
||||
}
|
||||
else if($npcGenID === null || ($userGenValue !== null && $userGenValue < $npcGenValue * 3)){
|
||||
$genID = $userGenID;
|
||||
}
|
||||
else{
|
||||
$genID = $npcGenID;
|
||||
}
|
||||
|
||||
if ($genID) {
|
||||
if($genID === $npcGenID){
|
||||
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||
if($npcLeadership < 40){
|
||||
$amount = min($amount, intdiv($resrc, 1000)*10 + 10);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 2000)*10 + 10);
|
||||
}
|
||||
|
||||
// 포상
|
||||
$command = EncodeCommand($type2, $SelGen['no'], $amount, 23); // 금 1000단위 포상
|
||||
$command = EncodeCommand($type2, $genID, $amount, 23); // 금,쌀 1000단위 포상
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
if(isset($command)){
|
||||
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,6 +715,41 @@ function processAI($no) {
|
||||
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader'] < 40){
|
||||
//무지장인데
|
||||
|
||||
if(
|
||||
(($nation['rice'] - GameConst::$baserice) * 3 <= $general['rice'] && $general['rice'] >= $resrc + 2100) ||
|
||||
($general['rice'] >= 11000)
|
||||
){
|
||||
//쌀을 많이 들고 있다면
|
||||
$amount = $general['rice'] * 0.9;
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
|
||||
|
||||
$command = EncodeCommand(0, 2, $amount, 44); //헌납
|
||||
$db->update('general', [
|
||||
'turn0'=>$command
|
||||
], 'no=%i',$general['no']);
|
||||
return;
|
||||
}
|
||||
|
||||
if(
|
||||
(($nation['gold'] - GameConst::$basegold) * 3 <= $general['gold'] && $general['gold'] >= $resrc + 2100) ||
|
||||
($general['gold'] >= 12000)
|
||||
){
|
||||
//금을 많이 들고 있다면
|
||||
$amount = $general['gold'] * 0.9;
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
|
||||
|
||||
$command = EncodeCommand(0, 1, $amount, 44); //헌납
|
||||
$db->update('general', [
|
||||
'turn0'=>$command
|
||||
], 'no=%i',$general['no']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//국가 병량이 없을때 바로 헌납
|
||||
if($nation['rice'] < 2000 && $general['rice'] > 200) {
|
||||
$amount = intdiv($general['rice'] - 200, 100) + 1;
|
||||
@@ -653,7 +768,7 @@ function processAI($no) {
|
||||
// ┃조┃ ┃쌀삼
|
||||
// 0┗━┻━━━━┻━━━> G
|
||||
// 100 700
|
||||
$resrc = $tech * 700;
|
||||
|
||||
$target = array();
|
||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||
@@ -663,11 +778,11 @@ function processAI($no) {
|
||||
if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
|
||||
elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
|
||||
elseif($general['gold'] < 100) { //금없으면 쌀팜
|
||||
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 1, $amount, 49); //팜
|
||||
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
|
||||
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 2, $amount, 49); //삼
|
||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||
else {
|
||||
@@ -743,12 +858,12 @@ function processAI($no) {
|
||||
else { $command = EncodeCommand(0, 0, 0, 1); }
|
||||
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
|
||||
//금이 더 많으면 매매
|
||||
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['gold'] - $general['rice']) / 2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
|
||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
|
||||
//쌀이 더 많으면 매매
|
||||
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['rice'] - $general['gold']) / 2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
|
||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||
//자원, 병사 모두 충족
|
||||
@@ -777,11 +892,11 @@ function processAI($no) {
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
|
||||
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||
} elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
|
||||
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
|
||||
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||
|
||||
+37
-19
@@ -13,6 +13,9 @@ namespace sammo;
|
||||
* @return int|float 계산된 능력치
|
||||
*/
|
||||
function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||
if($general === null){
|
||||
return 0;
|
||||
}
|
||||
$leadership = $general['leader'];
|
||||
if($withInjury){
|
||||
$leadership *= (100 - $general['injury']) / 100;
|
||||
@@ -47,6 +50,9 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
|
||||
* @return int|float 계산된 능력치
|
||||
*/
|
||||
function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||
if($general === null){
|
||||
return 0;
|
||||
}
|
||||
$power = $general['power'];
|
||||
if($withInjury){
|
||||
$power *= (100 - $general['injury']) / 100;
|
||||
@@ -78,6 +84,10 @@ function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $us
|
||||
* @return int|float 계산된 능력치
|
||||
*/
|
||||
function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||
if($general === null){
|
||||
return 0;
|
||||
}
|
||||
|
||||
$intel = $general['intel'];
|
||||
if($withInjury){
|
||||
$intel *= (100 - $general['injury']) / 100;
|
||||
@@ -521,7 +531,7 @@ function process_5(&$general, $type) {
|
||||
// 태수 보정
|
||||
if($general['level'] == 4 && $general['no'] == $city['gen1']) { $score *= 1.05; }
|
||||
|
||||
$rd = randF();
|
||||
$rd = Util::randF();
|
||||
$r = CriticalRatioDomestic($general, 1);
|
||||
// 특기보정 : 수비, 축성
|
||||
if($type == 1 && $general['special'] == 11) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
|
||||
@@ -1006,7 +1016,7 @@ function process_11(&$general, $type) {
|
||||
$exp = $crew;
|
||||
$ded = $crew;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $armtype, $crew);
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $armtype, $crew);
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1075,7 +1085,7 @@ function process_13(&$general) {
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], Util::round($general['crew']/100));
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1139,14 +1149,14 @@ function process_14(&$general) {
|
||||
// } 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::$trainAtmos);
|
||||
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
||||
$gold = $general['gold'] - Util::round($general['crew']/100);
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:사기치가 <C>$score</> 상승했습니다. <1>$date</>";
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], Util::round($general['crew']/100));
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1221,7 +1231,7 @@ function process_15(&$general) {
|
||||
$exp = 100 * 3;
|
||||
$ded = 70 * 3;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], Util::round($general['crew']/100 * 3));
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100 * 3));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1309,7 +1319,7 @@ function process_16(&$general) {
|
||||
$query = "update city set state=43,term=3 where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], Util::round($general['crew']/100));
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 전투 처리
|
||||
$dead = processWar($general, $destcity);
|
||||
|
||||
@@ -1673,7 +1683,16 @@ function process_31(&$general) {
|
||||
$typecount = [];
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
if($gen['crew'] != 0) { $typecount[$gen['crewtype']]++; $crew += $gen['crew']; }
|
||||
if($gen['crew'] != 0) {
|
||||
if(!key_exists($gen['crewtype'], $typecount)){
|
||||
$typecount[$gen['crewtype']] = 1;
|
||||
}
|
||||
else{
|
||||
$typecount[$gen['crewtype']]+=1;
|
||||
}
|
||||
|
||||
$crew += $gen['crew'];
|
||||
}
|
||||
}
|
||||
if(!key_exists($destination, $dist)) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
||||
@@ -1689,13 +1708,9 @@ function process_31(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
|
||||
$msg[] = "【<S>병종</>】";
|
||||
|
||||
foreach(GameUnitConst::all() as $unit){
|
||||
if($typecount[$unit->id] == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
$unitStr = mb_substr($unit->name, 0, 2);
|
||||
$msg[] = "{$unitStr}:{$typecount[$unit->id]}";
|
||||
foreach($typecount as $crewtype=>$cnt){
|
||||
$crewtypeText = mb_substr(GameUnitConst::byID($crewtype)->name, 0, 2);
|
||||
$msg[] = "{$crewtypeText}:{$cnt}";
|
||||
}
|
||||
|
||||
$log[] = join(' ', $msg);
|
||||
@@ -1743,6 +1758,9 @@ function process_31(&$general) {
|
||||
{
|
||||
$cities = array_map('intval', explode("|", $nation['spy']));
|
||||
}
|
||||
else{
|
||||
$cities = [];
|
||||
}
|
||||
$exist = 0;
|
||||
for($i=0; $i < count($cities); $i++) {
|
||||
if(intdiv($cities[$i], 10) == $destination) {
|
||||
@@ -1803,7 +1821,7 @@ function process_41(&$general) {
|
||||
} elseif($crewexp == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
||||
} else {
|
||||
$type = intdiv($general['crewtype'], 10) * 10;
|
||||
$type = intdiv($general['crewtype'], 10);
|
||||
switch($type) {
|
||||
case 0: $crewstr = '보병'; break;
|
||||
case 1: $crewstr = '궁병'; break;
|
||||
@@ -1814,17 +1832,17 @@ function process_41(&$general) {
|
||||
|
||||
if($ratio < 33) {
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], $crewexp);
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도 향상이 <span class='ev_failed'>지지부진</span>했습니다. <1>$date</>";
|
||||
} elseif($ratio < 66) {
|
||||
$exp = $exp * 2;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], $crewexp * 2);
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp * 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 향상되었습니다. <1>$date</>";
|
||||
} else {
|
||||
$exp = $exp * 3;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxatmos, GameConst::$maxtrain, $general['crewtype'], $crewexp * 3);
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp * 3);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 <S>일취월장</>했습니다. <1>$date</>";
|
||||
}
|
||||
|
||||
|
||||
+427
-312
@@ -173,7 +173,24 @@ function process_24(&$general) {
|
||||
case 4: $str = "몰수로 인한 사기 저하는 몰수로 얻은 물자보다 더 손해란걸 모른단 말인가!"; break;
|
||||
}
|
||||
|
||||
PushMsg(1, 0, $gen['picture'], $gen['imgsvr'], "{$gen['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
|
||||
$src = new MessageTarget(
|
||||
$gen['no'],
|
||||
$gen['name'],
|
||||
$gen['nation'],
|
||||
$nation['name'],
|
||||
$nation['color'],
|
||||
GetImageURL($gen['imgsvr'], $gen['picture'])
|
||||
);
|
||||
$msg = new Message(
|
||||
Message::MSGTYPE_PUBLIC,
|
||||
$src,
|
||||
$src,
|
||||
$str,
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
$msg->send();
|
||||
}
|
||||
|
||||
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
|
||||
@@ -291,72 +308,87 @@ function process_27(&$general) {
|
||||
|
||||
|
||||
function process_51(&$general) {
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
|
||||
$which = $command[1];
|
||||
|
||||
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$younation = MYDB_fetch_array($result);
|
||||
|
||||
if($younation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 권고 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$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</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
|
||||
$deleted = 4;
|
||||
for($i=0; $i < 5; $i++) {
|
||||
if($younation["dip{$i}"] == "") { $deleted = $i; }
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set dip0='{$nation['name']}의 항복 권고 서신',dip0_type='4',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($general, $log);
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 권고 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
|
||||
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
|
||||
|
||||
$command = DecodeCommand($myTurn);
|
||||
$which = $command[1];
|
||||
|
||||
$srcNation = getNationStaticInfo($general['nation']);
|
||||
$destNation = getNationStaticInfo($which);
|
||||
|
||||
if($destNation['nation'] == 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 권고 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === null) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 권고 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 권고 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$srcNation['nation'],
|
||||
$srcNation['name'],
|
||||
$srcNation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$destNation['nation'],
|
||||
$destNation['name'],
|
||||
$destNation['color']
|
||||
);
|
||||
|
||||
$now = new \DateTime($date);
|
||||
$validUntil = new \DateTime($date);
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
$dest,
|
||||
"{$srcNation['name']}의 항복 권고 서신",
|
||||
$now,
|
||||
$validUntil,
|
||||
['action'=>DiplomaticMessage::TYPE_SURRENDER]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
function process_52(&$general) {
|
||||
@@ -473,155 +505,186 @@ function process_52(&$general) {
|
||||
|
||||
function process_53(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
|
||||
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
|
||||
$command = DecodeCommand($myTurn);
|
||||
$which = $command[1];
|
||||
|
||||
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$younation = MYDB_fetch_array($result);
|
||||
$srcNation = getNationStaticInfo($general['nation']);
|
||||
$destNation = getNationStaticInfo($which);
|
||||
|
||||
if($younation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$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</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>(으)로 통합 제의 서신을 보냈습니다.<1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
|
||||
$deleted = 4;
|
||||
for($i=0; $i < 5; $i++) {
|
||||
if($younation["dip{$i}"] == "") { $deleted = $i; }
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set dip0='{$nation['name']}의 통합 제의 서신',dip0_type='5',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($general, $log);
|
||||
if($destNation['nation'] == 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === null) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
|
||||
if($supply === 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$srcNation['nation'],
|
||||
$srcNation['name'],
|
||||
$srcNation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$destNation['nation'],
|
||||
$destNation['name'],
|
||||
$destNation['color']
|
||||
);
|
||||
|
||||
$now = new \DateTime($date);
|
||||
$validUntil = new \DateTime($date);
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
$dest,
|
||||
"{$srcNation['name']}의 통합 제의 서신",
|
||||
$now,
|
||||
$validUntil,
|
||||
['action'=>DiplomaticMessage::TYPE_MERGE]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
|
||||
function process_61(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
|
||||
$query = "select year,month,develcost,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gold,rice,name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
|
||||
$when = $command[2];
|
||||
$which = $command[1];
|
||||
|
||||
if($when < 1) { $when = 1; }
|
||||
elseif($when > 20) { $when = 20; }
|
||||
|
||||
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$younation = MYDB_fetch_array($result);
|
||||
|
||||
if($younation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$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</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
|
||||
$deleted = 4;
|
||||
for($i=0; $i < 5; $i++) {
|
||||
if($younation["dip{$i}"] == "") { $deleted = $i; }
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
$type = $when * 100 + 6;
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set dip0='{$nation['name']}의 {$when}년 불가침 제의 서신',dip0_type='$type',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 3턴후
|
||||
$date = addTurn($date, $admin['turnterm'], 3);
|
||||
//조건 표시기한 설정
|
||||
$query = "update diplomacy set showing='{$date}' where me='{$general['nation']}' and you='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $admin['develcost']*10씩 차감
|
||||
// $amount = $admin['develcost'];
|
||||
// $query = "update nation set gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
||||
// MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($general, $log);
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
|
||||
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
|
||||
|
||||
$command = DecodeCommand($myTurn);
|
||||
$which = $command[1];
|
||||
$when = Util::valueFit($command[2], 1, 20);
|
||||
|
||||
$srcNation = getNationStaticInfo($general['nation']);
|
||||
$destNation = getNationStaticInfo($which);
|
||||
|
||||
if($destNation['nation'] == 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === null) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$srcNation['nation'],
|
||||
$srcNation['name'],
|
||||
$srcNation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$destNation['nation'],
|
||||
$destNation['name'],
|
||||
$destNation['color']
|
||||
);
|
||||
|
||||
$now = new \DateTime($date);
|
||||
$validUntil = new \DateTime($date);
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
//FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다.
|
||||
//XXX: 으악.
|
||||
//TODO: 커맨드 처리 방식을 json으로 변경
|
||||
$option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
$dest,
|
||||
"{$srcNation['name']}의 {$when}년 불가침 제의 서신",
|
||||
$now,
|
||||
$validUntil,
|
||||
[
|
||||
'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION,
|
||||
'year'=>$when,
|
||||
'option'=>$option
|
||||
]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
//NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다.
|
||||
//FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록.
|
||||
$db->update('diplomacy', [
|
||||
'showing'=>$validUntil->format('Y-m-d H:i:s')
|
||||
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
// 3턴후
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
function process_62(&$general) {
|
||||
@@ -710,11 +773,33 @@ function process_62(&$general) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//국메로 저장
|
||||
$msg = "【외교】{$admin['year']}년 {$admin['month']}월:{$younation['name']}에 선전포고";
|
||||
$youmsg = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 선전포고";
|
||||
$text = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
|
||||
|
||||
PushMsg(2, $nation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}▶", $nation['color'], $younation['name'], $younation['color'], $msg);
|
||||
PushMsg(3, $younation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}▶", $nation['color'], $younation['name'], $younation['color'], $youmsg);
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$general['nation'],
|
||||
$nation['name'],
|
||||
$nation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$younation['nation'],
|
||||
$younation['name'],
|
||||
$younation['color']
|
||||
);
|
||||
$msg = new Message(
|
||||
Message::MSGTYPE_NATIONAL,
|
||||
$src,
|
||||
$dest,
|
||||
$text,
|
||||
new \DateTime($general['turntime']),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
$msg->send();
|
||||
}
|
||||
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
@@ -724,138 +809,168 @@ function process_62(&$general) {
|
||||
|
||||
function process_63(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
|
||||
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
|
||||
|
||||
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
|
||||
$command = DecodeCommand($myTurn);
|
||||
$which = $command[1];
|
||||
|
||||
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$younation = MYDB_fetch_array($result);
|
||||
$srcNation = getNationStaticInfo($general['nation']);
|
||||
$destNation = getNationStaticInfo($which);
|
||||
|
||||
if($younation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$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</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
|
||||
$deleted = 4;
|
||||
for($i=0; $i < 5; $i++) {
|
||||
if($younation["dip{$i}"] == "") { $deleted = $i; }
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set dip0='{$nation['name']}의 종전 제의 서신',dip0_type='7',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($general, $log);
|
||||
if($destNation['nation'] == 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === null) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
|
||||
if($supply === 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$srcNation['nation'],
|
||||
$srcNation['name'],
|
||||
$srcNation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$destNation['nation'],
|
||||
$destNation['name'],
|
||||
$destNation['color']
|
||||
);
|
||||
|
||||
$now = new \DateTime($date);
|
||||
$validUntil = new \DateTime($date);
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
$dest,
|
||||
"{$srcNation['name']}의 종전 제의 서신",
|
||||
$now,
|
||||
$validUntil,
|
||||
['action'=>DiplomaticMessage::TYPE_STOP_WAR]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>"]);
|
||||
}
|
||||
|
||||
function process_64(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
|
||||
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
|
||||
|
||||
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
|
||||
$command = DecodeCommand($myTurn);
|
||||
$which = $command[1];
|
||||
|
||||
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$younation = MYDB_fetch_array($result);
|
||||
$srcNation = getNationStaticInfo($general['nation']);
|
||||
$destNation = getNationStaticInfo($which);
|
||||
|
||||
if($younation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$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</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 파기 제의 서신을 보냈습니다. <1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
|
||||
$deleted = 4;
|
||||
for($i=0; $i < 5; $i++) {
|
||||
if($younation["dip{$i}"] == "") { $deleted = $i; }
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set dip0='{$nation['name']}의 불가침 파기 서신',dip0_type='8',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($general, $log);
|
||||
if($destNation['nation'] == 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($supply === null) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
|
||||
if($supply === 0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
$general['name'],
|
||||
$srcNation['nation'],
|
||||
$srcNation['name'],
|
||||
$srcNation['color'],
|
||||
GetImageURL($general['imgsvr'], $general['picture'])
|
||||
);
|
||||
|
||||
$dest = new MessageTarget(
|
||||
0,
|
||||
'',
|
||||
$destNation['nation'],
|
||||
$destNation['name'],
|
||||
$destNation['color']
|
||||
);
|
||||
|
||||
$now = new \DateTime($date);
|
||||
$validUntil = new \DateTime($date);
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
$dest,
|
||||
"{$srcNation['name']}의 불가침 파기 제의 서신",
|
||||
$now,
|
||||
$validUntil,
|
||||
['action'=>DiplomaticMessage::TYPE_CANCEL_NA]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
function process_65(&$general) {
|
||||
|
||||
@@ -46,14 +46,9 @@ function process_22(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
sendScoutMsg([
|
||||
'id' => $general['no'],
|
||||
'nation_id' => Util::array_get($general['nation'], 0)
|
||||
],[
|
||||
'id' => $you['no'],
|
||||
'nation_id' => Util::array_get($you['nation'], 0)
|
||||
],$date);
|
||||
|
||||
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
|
||||
$msg->send(true);
|
||||
|
||||
$general['intel2']++;
|
||||
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -573,7 +568,7 @@ function process_46(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select nation from nation where name='{$general['makenation']}'";
|
||||
$query = "select nation from nation where nation!={$general['nation']} AND name='{$general['makenation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ function process_32(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$intelgen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100);
|
||||
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
@@ -93,8 +93,8 @@ function process_32(&$general) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(이)가 불타고 있습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 성공했습니다. <1>$date</>";
|
||||
|
||||
$destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount;
|
||||
$destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount;
|
||||
$destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
if($destcity['agri'] < 0) { $destcity['agri'] = 0; }
|
||||
if($destcity['comm'] < 0) { $destcity['comm'] = 0; }
|
||||
$query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}' where city='$destination'";
|
||||
@@ -187,7 +187,7 @@ function process_33(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$powergen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100);
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
@@ -224,8 +224,8 @@ function process_33(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 성공했습니다. <1>$date</>";
|
||||
|
||||
// 탈취 최대 400 * 8
|
||||
$gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount) * $destcity['level'];
|
||||
$rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount) * $destcity['level'];
|
||||
$gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
||||
$rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
||||
|
||||
$nation['gold'] -= $gold;
|
||||
$nation['rice'] -= $rice;
|
||||
@@ -334,7 +334,7 @@ function process_34(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$powergen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100);
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
@@ -371,8 +371,8 @@ function process_34(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 성공했습니다. <1>$date</>";
|
||||
|
||||
// 파괴
|
||||
$destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount;
|
||||
$destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$defaultSabotageAmount;
|
||||
$destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
if($destcity['def'] < 100) { $destcity['def'] = 100; }
|
||||
if($destcity['wall'] < 100) { $destcity['wall'] = 100; }
|
||||
$query = "update city set state=34,def='{$destcity['def']}',wall='{$destcity['wall']}' where city='$destination'";
|
||||
@@ -462,7 +462,7 @@ function process_35(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$defaultSabotageProb)*100);
|
||||
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
@@ -499,8 +499,8 @@ function process_35(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 성공했습니다. <1>$date</>";
|
||||
|
||||
// 선동 최대 10
|
||||
$destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$defaultSabotageAmount;
|
||||
$destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$defaultSabotageAmount/50;
|
||||
$destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$sabotageDefaultAmount/50;
|
||||
if($destcity['secu'] < 0) { $destcity['secu'] = 0; }
|
||||
if($destcity['rate'] < 0) { $destcity['rate'] = 0; }
|
||||
$query = "update city set state=32,rate='{$destcity['rate']}',secu='{$destcity['secu']}' where city='$destination'";
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ function Tag2Code(string $str) {
|
||||
function BadTag2Code(string $str) {
|
||||
/* FIXME: 제대로된 tag 변환 코드 사용 */
|
||||
$str = str_replace("<script", "<sorry", $str);
|
||||
$str = str_replace("<embed", "<sorry", $str);
|
||||
$str = str_replace("</script", "</sorry", $str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
+49
-5
@@ -75,7 +75,13 @@ function allButton() {
|
||||
$call = "설문조사";
|
||||
}
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
if(\file_exists("d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine('d_setting/templates');
|
||||
}
|
||||
else{
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
}
|
||||
|
||||
|
||||
return $templates->render('allButton', [
|
||||
'call' => $call,
|
||||
@@ -95,10 +101,12 @@ function commandButton() {
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
|
||||
|
||||
$nation = $db->queryFirstRow("select nation,color,secretlimit from nation where nation=%i",$me['nation']);
|
||||
|
||||
if($nation['color'] == "") { $nation['color'] = "#000000"; }
|
||||
|
||||
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
|
||||
'nation'=>0,
|
||||
'level'=>0,
|
||||
'secretlimit'=>99,
|
||||
'color'=>'#000000'
|
||||
];
|
||||
|
||||
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
||||
$fgColor = newColor($bgColor);
|
||||
@@ -108,6 +116,9 @@ function commandButton() {
|
||||
if($me['level'] >= 2){
|
||||
$showSecret = true;
|
||||
}
|
||||
else if($me['level']== 0){
|
||||
$showSecret = false;
|
||||
}
|
||||
else if($me['belong'] >= $nation['secretlimit']){
|
||||
$showSecret = true;
|
||||
}
|
||||
@@ -116,11 +127,44 @@ function commandButton() {
|
||||
'bgColor'=>$bgColor,
|
||||
'fgColor'=>$fgColor,
|
||||
'meLevel'=>$me['level'],
|
||||
'nationLevel'=>$nation['level'],
|
||||
'showSecret'=>$showSecret
|
||||
]);
|
||||
}
|
||||
|
||||
function formatWounded(int $value, int $wound): string{
|
||||
if($wound == 0){
|
||||
return "$value";
|
||||
}
|
||||
$woundedValue = intdiv($value * (100 - $wound), 100);
|
||||
return "<font color=red>$woundedValue</font>";
|
||||
}
|
||||
|
||||
function formatDefenceMode(int $value): string{
|
||||
switch($value) {
|
||||
case 0: return "×"; break;
|
||||
case 1: return "○"; break;
|
||||
case 2: return "◎"; break;
|
||||
}
|
||||
return '??';
|
||||
}
|
||||
|
||||
function formatLeadershipBonus(int $value): string{
|
||||
if($value == 0){
|
||||
return '';
|
||||
}
|
||||
return "<font color=cyan>+{$value}</font>";
|
||||
}
|
||||
|
||||
function formatName(string $name, int $npc): string{
|
||||
if($npc==1){
|
||||
$name = "<font color='skyblue'>$name</font>";
|
||||
}
|
||||
else if($npc>1){
|
||||
$name = "<font color='cyan'>$name</font>";
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
|
||||
@@ -117,6 +117,7 @@ function getTournamentTerm() {
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
switch($admin['tnmt_auto']) {
|
||||
case 0: $str = ''; break;
|
||||
case 1: $str = "경기당 12분"; break;
|
||||
case 2: $str = "경기당 7분"; break;
|
||||
case 3: $str = "경기당 3분"; break;
|
||||
|
||||
+21
-11
@@ -18,7 +18,7 @@ if (!$userID) {
|
||||
}
|
||||
|
||||
$me = $db->queryFirstRow(
|
||||
'SELECT no,con,turntime,newmsg,newvote,map from general where owner = %i',
|
||||
'SELECT no,con,turntime,newmsg,newvote,`level` from general where owner = %i',
|
||||
$userID
|
||||
);
|
||||
|
||||
@@ -58,7 +58,7 @@ $scenario = $admin['scenario_text'];
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>메인</title>
|
||||
<title><?=UniqueConst::$serverName?>: 메인</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
@@ -74,6 +74,10 @@ $(function(){
|
||||
reloadWorldMap({
|
||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
||||
});
|
||||
|
||||
setInterval(function(){
|
||||
refreshMsg();
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<link href="css/normalize.css" rel="stylesheet">
|
||||
@@ -211,6 +215,14 @@ if ($session->userGrade >= 5) {
|
||||
</td></tr>
|
||||
";
|
||||
}
|
||||
else if($session->userGrade == 4){
|
||||
echo "
|
||||
<tr><td colspan=5>
|
||||
<input type=button value=시뮬 onclick=window.open('_simul.php')>
|
||||
<input type=button value=119 onclick=window.open('_119.php')>
|
||||
</td></tr>
|
||||
";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -249,7 +261,7 @@ if ($session->userGrade >= 5) {
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
<?php commandTable(); ?>
|
||||
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로그아웃' onclick=location.replace('logout_process.php')><br>
|
||||
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로비로' onclick=location.replace('../')><br>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
@@ -282,25 +294,23 @@ if ($session->userGrade >= 5) {
|
||||
|
||||
</select>
|
||||
<input type="textarea" id="msg_input" maxlength="99">
|
||||
<button id="msg_submit">서신전달&갱신</button>
|
||||
<button id="msg_submit">서신전달&갱신</button><br>
|
||||
내용 없이 '서신전달&갱신'을 누르면 메세지창이 갱신됩니다.
|
||||
</div>
|
||||
<div id="message_board">
|
||||
<div class="board_side">
|
||||
<div><?=allButton()?></div>
|
||||
<div id="message_board"><div style="left:0;" class="board_side bg0">
|
||||
<div class="board_header bg0">전체 메시지(최고99자)</div>
|
||||
<section class="public_message"></section>
|
||||
<div class="board_header bg0">개인 메시지(최고99자)</div>
|
||||
<section class="private_message"></section>
|
||||
</div>
|
||||
<div class="board_side">
|
||||
</div><div style="right:0;" class="board_side bg0">
|
||||
<section class="diplomacy_message">
|
||||
|
||||
</section>
|
||||
<div class="board_header bg0">국가 메시지(최고99자)</div>
|
||||
<section class="national_message"></section>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
|
||||
<?php PrintElapsedTime(); ?>
|
||||
</div>
|
||||
<?php
|
||||
if ($con == 1) {
|
||||
|
||||
+41
-2
@@ -155,15 +155,54 @@ if($session->userGrade < 5){
|
||||
<input type="radio" name="show_img_level" value="1">전콘
|
||||
</label>
|
||||
<label class="btn btn-secondary active">
|
||||
<input type="radio" name="show_img_level" value="2" checked>전콘, 병종
|
||||
<input type="radio" name="show_img_level" value="2">전콘, 병종
|
||||
</label>
|
||||
<label class="btn btn-secondary">
|
||||
<input type="radio" name="show_img_level" value="3">전콘, 병종, NPC
|
||||
<input type="radio" name="show_img_level" value="3" checked>전콘, 병종, NPC
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="tournament_trig" class="col-sm-3 col-form-label">토너먼트 자동 시작<br>경기 단위</label>
|
||||
<div class="col-sm-9" id="tournament_trig">
|
||||
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-toggle="buttons">
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="0">안함
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="1">12분(총 5일)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="2">7분(총 10시간)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="3">3분(총 4시간)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25 active">
|
||||
<input type="radio" name="tournament_trig" value="4" checked>1분(총 82분)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="5">30초(총 41분)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="6">15초(총 21분)
|
||||
</label>
|
||||
<label class="btn btn-secondary w-25">
|
||||
<input type="radio" name="tournament_trig" value="7">5초(총 7분)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="reserve_open" class="col-sm-3 col-form-label">오픈 예약</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="reserve_open" id="reserve_open" placeholder="YYYY-MM-DD hh:mm" value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-9">
|
||||
|
||||
@@ -9,7 +9,7 @@ $userID = Session::getUserID();
|
||||
$rootDB = RootDB::db();
|
||||
$db = DB::db();
|
||||
|
||||
$image = $rootDB->queryFirstRow('SELECT picture, imgsvr FROM `MEMBER` WHERE no = %i', $userID);
|
||||
$image = $rootDB->queryFirstRow('SELECT picture, imgsvr FROM `member` WHERE no = %i', $userID);
|
||||
|
||||
if(!$image){
|
||||
Json::die([
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include 'lib.php';
|
||||
include "func.php";
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
|
||||
|
||||
if(!$reserved){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'affected'=>0,
|
||||
'status'=>'no_reserved'
|
||||
]);
|
||||
}
|
||||
|
||||
$reservedDate = new \DateTime($reserved['date']);
|
||||
$now = new \DateTime();
|
||||
|
||||
|
||||
$status = 'not_yet';
|
||||
|
||||
if ($db->queryFirstField("SHOW TABLES LIKE 'game'")) {
|
||||
list($isUnited, $lastTurn) = $db->queryFirstList('SELECT isUnited, turntime FROM game LIMIT 1');
|
||||
}
|
||||
else{
|
||||
$isUnited = 2;
|
||||
$lastTurn = '2000-01-01';
|
||||
}
|
||||
|
||||
if($lastTurn !== null){
|
||||
$lastTurn = new \DateTime($lastTurn);
|
||||
}
|
||||
|
||||
if($lastTurn === null){
|
||||
//이미 리셋된 상태임
|
||||
}
|
||||
else if(file_exists(__dir__.'/.htaccess')){
|
||||
//일단 서버는 닫혀 있음
|
||||
}
|
||||
else if(
|
||||
$isUnited == 2 &&
|
||||
$now->getTimestamp() - $lastTurn->getTimestamp() > $reservedDate->getTimestamp() - $now->getTimestamp()
|
||||
){
|
||||
//정지 상태 & 중간 넘음
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
else if(
|
||||
$isUnited > 0 &&
|
||||
$now->getTimestamp() - $lastTurn->getTimestamp() > ($reservedDate->getTimestamp() - $now->getTimestamp()) * 2
|
||||
){
|
||||
//천통 & 비정지 상태 & 2/3 넘음
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
else if($reservedDate->getTimestamp() - $now->getTimestamp() <= 60*10){
|
||||
//어쨌든 간에 10분 남았다면.
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
|
||||
if($now < $reservedDate){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'affected'=>0,
|
||||
'status'=>$status
|
||||
]);
|
||||
}
|
||||
|
||||
$options = Json::decode($reserved['options']);
|
||||
|
||||
$result = ResetHelper::buildScenario(
|
||||
$options['turnterm'],
|
||||
$options['sync'],
|
||||
$options['scenario'],
|
||||
$options['fiction'],
|
||||
$options['extend'],
|
||||
$options['npcmode'],
|
||||
$options['show_img_level'],
|
||||
$options['tournament_trig']
|
||||
);
|
||||
|
||||
$result['affected']=1;
|
||||
|
||||
$prefix = DB::prefix();
|
||||
AppConf::getList()[$prefix]->openServer();
|
||||
|
||||
Json::die($result);
|
||||
@@ -19,5 +19,6 @@ if(!$generalInfo){
|
||||
$result['generalID'] = $generalInfo['no'];
|
||||
$result['myNationID'] = $generalInfo['nation'];
|
||||
$result['isChief'] = ($generalInfo['level'] == 12);
|
||||
$result['generalLevel'] = $generalInfo['level'];
|
||||
|
||||
Json::die($result);
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
const VALID_SECOND = 90;
|
||||
const PICK_MORE_SECOND = 10;
|
||||
const KEEP_CNT = 3;
|
||||
|
||||
|
||||
$refresh = Util::getReq('refresh', 'bool', false);
|
||||
$keepResult = Util::getReq('keep', 'array_int', []);
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
|
||||
$oNow = new \DateTimeImmutable();
|
||||
|
||||
$now = $oNow->format('Y-m-d H:i:s');
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||
if($oldGeneral !== null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'이미 장수가 생성되었습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
list(
|
||||
$maxgeneral,
|
||||
$turnterm,
|
||||
$npcmode
|
||||
) = $db->queryFirstList('SELECT maxgeneral,turnterm,npcmode from game limit 1');
|
||||
|
||||
if(!$npcmode){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'빙의 가능한 서버가 아닙니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$token = $db->queryFirstRow('SELECT * FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
||||
$pickResult = [];
|
||||
|
||||
|
||||
if($token && $refresh){
|
||||
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
|
||||
$nowT = $oNow->getTimestamp();
|
||||
|
||||
if($nowT >= $pickMoreFrom){
|
||||
$oldPickResult = Json::decode($token['pick_result']);
|
||||
|
||||
foreach($keepResult as $keepId){
|
||||
if(\key_exists($keepId, $oldPickResult) && $oldPickResult[$keepId]['keepCnt'] > 0){
|
||||
$pickResult[$keepId] = $oldPickResult[$keepId];
|
||||
$pickResult[$keepId]['keepCnt']-=1;
|
||||
}
|
||||
}
|
||||
|
||||
if(count($pickResult) == count($oldPickResult)){
|
||||
$refresh = false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'아직 다시 뽑을 수 없습니다',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if($token && !$refresh){
|
||||
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
|
||||
$nowT = $oNow->getTimestamp();
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>Json::decode($token['pick_result']),
|
||||
'pickMoreFrom'=>$token['pick_more_from'],
|
||||
'pickMoreSeconds'=>$pickMoreFrom-$nowT,
|
||||
'validUntil'=>$token['valid_until']
|
||||
]);
|
||||
}
|
||||
|
||||
$candidates = [];
|
||||
|
||||
$weight = [];
|
||||
foreach($db->query('SELECT `no`, `name`, leader, power, intel, imgsvr, picture, special, special2 FROM general WHERE npc=2') as $general){
|
||||
$general['special'] = \sammo\SpecialityConst::DOMESTIC[$general['special']][0]??'-';
|
||||
$general['special2'] = \sammo\SpecialityConst::WAR[$general['special2']][0]??'-';
|
||||
$candidates[$general['no']] = $general + ['keepCnt'=>KEEP_CNT];
|
||||
$allStat = $general['leader'] + $general['power'] + $general['intel'];
|
||||
$weight[$general['no']] = pow($allStat, 1.5);
|
||||
}
|
||||
|
||||
foreach($db->queryFirstColumn('SELECT pick_result FROM select_npc_token WHERE `owner`!=%i AND valid_until >=%s', $userID, $now) as $reserved){
|
||||
$reserved = Json::decode($reserved);
|
||||
foreach(array_keys($reserved) as $reservedNPC){
|
||||
if(key_exists($reservedNPC, $weight)){
|
||||
unset($candidates[$reservedNPC]);
|
||||
unset($weight[$reservedNPC]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pickLimit = min(count($candidates), 5);
|
||||
|
||||
while(count($pickResult) < $pickLimit){
|
||||
$generalID = Util::choiceRandomUsingWeight($weight);
|
||||
if(!key_exists($generalID, $pickResult)){
|
||||
$pickResult[$generalID] = $candidates[$generalID];
|
||||
}
|
||||
}
|
||||
|
||||
$newNonce = mt_rand(0, 0xfffffff);
|
||||
|
||||
$validSecond = max(VALID_SECOND, $turnterm*40);
|
||||
$pickMoreSecond = max(PICK_MORE_SECOND, $turnterm*10);
|
||||
|
||||
$validUntil = $oNow->add(new \DateInterval(sprintf('PT%dS', $validSecond)));
|
||||
$pickMoreFrom = $oNow->add(new \DateInterval(sprintf('PT%dS', $pickMoreSecond)));
|
||||
|
||||
$db->delete('select_npc_token', 'valid_until < %s', $now);
|
||||
|
||||
$inserted = 0;
|
||||
|
||||
if($token){
|
||||
$db->update('select_npc_token', [
|
||||
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
|
||||
'pick_more_from'=>$pickMoreFrom->format('Y-m-d H:i:s'),
|
||||
'pick_result'=>Json::encode($pickResult),
|
||||
'nonce'=>$newNonce
|
||||
], 'owner = %i AND nonce = %i', $userID, $token['nonce']);
|
||||
if($db->affectedRows()){
|
||||
$inserted = -1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$db->insertIgnore('select_npc_token', [
|
||||
'owner'=>$userID,
|
||||
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
|
||||
'pick_more_from'=>'2000-01-01 01:00:00',
|
||||
'pick_result'=>Json::encode($pickResult),
|
||||
'nonce'=>$newNonce
|
||||
]);
|
||||
|
||||
if($db->affectedRows()){
|
||||
$inserted = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if($inserted === 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'중복 요청, 다시 랜덤 토큰을 확인해주세요'
|
||||
]);
|
||||
}
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>$pickResult,
|
||||
'pickMoreFrom'=>($inserted===-1)?$pickMoreFrom->format('Y-m-d H:i:s'):'2000-01-01 01:00:00',
|
||||
'pickMoreSeconds'=>($inserted===-1)?$pickMoreSecond:0,
|
||||
'validUntil'=>$validUntil->format('Y-m-d H:i:s')
|
||||
]);
|
||||
+44
-160
@@ -28,7 +28,8 @@ $v->rule('required', [
|
||||
'fiction',
|
||||
'extend',
|
||||
'npcmode',
|
||||
'show_img_level'
|
||||
'show_img_level',
|
||||
'tournament_trig'
|
||||
]);
|
||||
if(!$v->validate()){
|
||||
Json::die([
|
||||
@@ -44,173 +45,56 @@ $fiction = (int)$_POST['fiction'];
|
||||
$extend = (int)$_POST['extend'];
|
||||
$npcmode = (int)$_POST['npcmode'];
|
||||
$show_img_level = (int)$_POST['show_img_level'];
|
||||
$tournament_trig = (int)$_POST['tournament_trig'];
|
||||
|
||||
if(120 % $turnterm != 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'turnterm은 120의 약수여야 합니다.'
|
||||
]);
|
||||
}
|
||||
$reserve_open = Util::getReq('reserve_open');
|
||||
if($reserve_open){
|
||||
$reserve_open = new \DateTime($reserve_open);
|
||||
$db = DB::db();
|
||||
|
||||
if(!file_exists(__dir__.'/logs') || !file_exists(__dir__.'/data')){
|
||||
if(!is_writable(__dir__)){
|
||||
if (!$db->queryFirstField("SHOW TABLES LIKE 'game'")) {
|
||||
$clearResult = ResetHelper::clearDB();
|
||||
if(!$clearResult['result']){
|
||||
Json::die($clearResult);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'logs, data 디렉토리를 생성할 권한이 없습니다.'
|
||||
'reason'=>'예약 테이블이 없음!'
|
||||
]);
|
||||
}
|
||||
mkdir(__dir__.'/logs', 0644);
|
||||
mkdir(__dir__.'/data', 0644);
|
||||
}
|
||||
|
||||
if(!is_writable(__dir__.'/logs')){
|
||||
$scenarioObj = new Scenario($scenario, true);
|
||||
$db->delete('reserved_open', true);
|
||||
$db->insert('reserved_open', [
|
||||
'options'=>Json::encode([
|
||||
'turnterm'=>$turnterm,
|
||||
'sync'=>$sync,
|
||||
'scenario'=>$scenario,
|
||||
'scenarioName'=>$scenarioObj->getTitle(),
|
||||
'fiction'=>$fiction,
|
||||
'extend'=>$extend,
|
||||
'npcmode'=>$npcmode,
|
||||
'show_img_level'=>$show_img_level,
|
||||
'tournament_trig'=>$tournament_trig
|
||||
]),
|
||||
'date'=>$reserve_open->format('Y-m-d H:i:s')
|
||||
]);
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'logs 디렉토리의 쓰기 권한이 없습니다'
|
||||
'result'=>true,
|
||||
'reason'=>'예약'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!is_writable(__dir__.'/data')){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'data 디렉토리의 쓰기 권한이 없습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!is_writable(__dir__.'/d_setting')){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!file_exists(__dir__.'/logs/.htaccess')){
|
||||
@file_put_contents(__dir__.'/logs/.htaccess', 'Deny from all');
|
||||
}
|
||||
|
||||
if(!file_exists(__dir__.'/data/.htaccess')){
|
||||
@file_put_contents(__dir__.'/data/.htaccess', 'Deny from all');
|
||||
}
|
||||
|
||||
|
||||
$db = DB::db();
|
||||
$mysqli_obj = $db->get();
|
||||
|
||||
|
||||
$scenarioObj = new Scenario($scenario, false);
|
||||
$startyear = $scenarioObj->getYear();
|
||||
|
||||
FileUtil::delInDir("logs");
|
||||
FileUtil::delInDir("data");
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__DIR__.'/d_setting/UniqueConst.orig.php',
|
||||
__DIR__.'/d_setting/UniqueConst.php',[
|
||||
'serverID'=>DB::prefix().'_'.Util::randomStr(8)
|
||||
], true
|
||||
);
|
||||
|
||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||
while(true){
|
||||
if (!$mysqli_obj->more_results()) {
|
||||
break;
|
||||
}
|
||||
if(!$mysqli_obj->next_result()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
|
||||
while(true){
|
||||
if (!$mysqli_obj->more_results()) {
|
||||
break;
|
||||
}
|
||||
if(!$mysqli_obj->next_result()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$db->insert('plock', [
|
||||
'plock'=>1
|
||||
]);
|
||||
|
||||
CityConst::build();
|
||||
|
||||
|
||||
|
||||
|
||||
$turntime = date('Y-m-d H:i:s');
|
||||
$time = substr($turntime, 11, 2);
|
||||
if($sync == 0) {
|
||||
// 현재 시간을 1월로 맞춤
|
||||
$starttime = cutTurn($turntime, $turnterm);
|
||||
$month = 1;
|
||||
$year = $startyear;
|
||||
} else {
|
||||
// 현재 시간과 동기화
|
||||
list($starttime, $yearPulled, $month) = cutDay($turntime, $turnterm);
|
||||
if($yearPulled){
|
||||
$year = $startyear-1;
|
||||
}
|
||||
else{
|
||||
$year = $startyear;
|
||||
}
|
||||
}
|
||||
|
||||
$killturn = 4800 / $turnterm;
|
||||
if($npcmode == 1) { $killturn = intdiv($killturn, 3); }
|
||||
|
||||
$env = [
|
||||
'scenario'=>$scenario,
|
||||
'scenario_text'=>$scenarioObj->getTitle(),
|
||||
'startyear'=>$startyear,
|
||||
'year'=> $year,
|
||||
'month'=> $month,
|
||||
'msg'=>'공지사항',//TODO:공지사항
|
||||
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
||||
'maxnation'=>GameConst::$defaultMaxNation,
|
||||
'conlimit'=>300,
|
||||
'gold_rate'=>100,
|
||||
'rice_rate'=>100,
|
||||
'turntime'=>$turntime,
|
||||
'starttime'=>$starttime,
|
||||
'turnterm'=>$turnterm,
|
||||
'killturn'=>$killturn,
|
||||
'genius'=>GameConst::$defaultMaxGenius,
|
||||
'show_img_level'=>$show_img_level,
|
||||
'npcmode'=>$npcmode,
|
||||
'extended_general'=>$extend,
|
||||
'fiction'=>$fiction
|
||||
];
|
||||
|
||||
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
|
||||
$db->insert('general', [
|
||||
'owner'=>$admin['no'],
|
||||
'name'=>$admin['name'],
|
||||
'picture'=>$admin['picture'],
|
||||
'imgsvr'=>$admin['imgsvr'],
|
||||
'turntime'=>$turntime,
|
||||
'killturn'=>null
|
||||
]);
|
||||
}
|
||||
|
||||
$db->insert('game', $env);
|
||||
|
||||
$scenarioObj->build($env);
|
||||
|
||||
$db->update('plock', [
|
||||
'plock'=>0
|
||||
], true);
|
||||
|
||||
LogHistory(1);
|
||||
|
||||
$prefix = DB::prefix();
|
||||
AppConf::getList()[$prefix]->closeServer();
|
||||
|
||||
Json::die([
|
||||
'result'=>true
|
||||
]);
|
||||
Json::die(ResetHelper::buildScenario(
|
||||
$turnterm,
|
||||
$sync,
|
||||
$scenario,
|
||||
$fiction,
|
||||
$extend,
|
||||
$npcmode,
|
||||
$show_img_level,
|
||||
$tournament_trig
|
||||
));
|
||||
@@ -93,6 +93,8 @@ if($result !== true){
|
||||
]);
|
||||
}
|
||||
|
||||
ResetHelper::clearDB();
|
||||
|
||||
AppConf::getList()[$prefix]->closeServer();
|
||||
|
||||
Json::die([
|
||||
|
||||
+10
-81
@@ -29,13 +29,6 @@ if ($msgID === null || !is_bool($msgResponse)) {
|
||||
]);
|
||||
}
|
||||
|
||||
$msg = Message::getMessageByID($msgID);
|
||||
if($msg === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 메시지'
|
||||
]);
|
||||
}
|
||||
$general = DB::db()->queryFirstRow('select `no`, `name`, `nation`, `nations`, `level`, `npc`, `gold`, `rice`, `troop` from `general` where `no` = %i', $generalID);
|
||||
if(!$general){
|
||||
Json::die([
|
||||
@@ -44,87 +37,23 @@ if(!$general){
|
||||
]);
|
||||
}
|
||||
|
||||
list($result, $messageInfo) = getSingleMessage($msgID);
|
||||
|
||||
if (!$result) {
|
||||
$msg = Message::getMessageByID($msgID);
|
||||
if($msg === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$messageInfo
|
||||
'reason'=>'올바르지 않은 메시지'
|
||||
]);
|
||||
}
|
||||
|
||||
'@phan-var-force mixed[] $messageInfo';
|
||||
|
||||
$msgType = $messageInfo['type'];
|
||||
|
||||
$validUntil = $messageInfo['valid_until'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
if ($validUntil < $date) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'만료된 메시지'
|
||||
]);
|
||||
$reason = 'success';
|
||||
if($msgResponse){
|
||||
$result = $msg->agreeMessage($general['no'], $reason);
|
||||
}
|
||||
|
||||
$msgOption = Json::decode(Util::array_get($messageInfo['option'], '{}'));
|
||||
$msgAction = Util::array_get($msgOption['action'], null);
|
||||
$messageInfo['option'] = $msgOption;
|
||||
|
||||
$msgSrc = Json::decode($messageInfo['src']);
|
||||
$messageInfo['src'] = $msgSrc;
|
||||
$msgDest = Json::decode($messageInfo['dest']);
|
||||
$messageInfo['dest'] = $msgDest;
|
||||
|
||||
if (!$msgAction) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'응답 대상 메시지 아님'
|
||||
]);
|
||||
}
|
||||
|
||||
if ($msgType == 'diplomacy' && $msgSrc['nation_id'] != $msgDest['nation_id']) {
|
||||
//여기로 올일이 있나?
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'(버그) 외교 대상 동일'
|
||||
]);
|
||||
}
|
||||
|
||||
if($msgType == 'diplomacy'){
|
||||
if($general['level'] < 6){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'외교 권한 없음'
|
||||
]);
|
||||
}
|
||||
|
||||
if($general['nation'] != $msgDest['nation_id']){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 소속 국가'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
switch ($msgAction) {
|
||||
case 'scout':
|
||||
//TODO: 등용장 받음. 함수 호출
|
||||
$result = acceptScout($messageInfo, $general, $msgResponse);
|
||||
break;
|
||||
case 'ally':
|
||||
$result = acceptAlly($messageInfo, $general, $msgResponse);
|
||||
break;
|
||||
//TODO:기타 등등
|
||||
case '':
|
||||
Json::die([]);
|
||||
break;
|
||||
default:
|
||||
//구현이 정상적으로 된 경우 이쪽으로 오지 않음
|
||||
$result = [false, '처리 대상 아님'];
|
||||
else{
|
||||
$result = $msg->declineMessage($general['no'], $reason);
|
||||
}
|
||||
|
||||
|
||||
Json::die([
|
||||
'result' => $result[0],
|
||||
'reason' => $result[1]
|
||||
'result' => $result===DiplomaticMessage::ACCEPTED,
|
||||
'reason' => $reason
|
||||
]);
|
||||
@@ -20,7 +20,7 @@ list($generalID, $nationID) = DB::db()->queryFirstList(
|
||||
if($nationID === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'소속 국가가 없습니다'
|
||||
'reason'=>'장수가 사망했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ if($mailbox == Message::MAILBOX_PUBLIC) {
|
||||
if($mailbox >= Message::MAILBOX_NATIONAL) {
|
||||
|
||||
if($me['level'] < 5){
|
||||
$destNationID = $me['nation_id'];
|
||||
$destNationID = $me['nation'];
|
||||
}
|
||||
else{
|
||||
$destNationID = $mailbox - Message::MAILBOX_NATIONAL;
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$pick = Util::getReq('pick', 'int');
|
||||
|
||||
if(!$pick){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수를 선택하지 않았습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$session = Session::requireLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$rootDB = RootDB::db();
|
||||
|
||||
$oNow = new \DateTimeImmutable();
|
||||
$now = $oNow->format('Y-m-d H:i:s');
|
||||
|
||||
$userNick = RootDB::db()->queryFirstField('SELECT `NAME` FROM member WHERE `NO`=%i',$userID);
|
||||
if(!$userNick){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'멤버 정보를 가져오지 못했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
||||
if(!$pickResult){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'유효한 장수 목록이 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$pickResult = Json::decode($pickResult);
|
||||
if(!key_exists($pick, $pickResult)){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'선택한 장수가 목록에 없습니다.'
|
||||
]);
|
||||
}
|
||||
$pickedNPC = $pickResult[$pick];
|
||||
|
||||
|
||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||
list(
|
||||
$year,
|
||||
$month,
|
||||
$maxgeneral,
|
||||
$npcmode
|
||||
) = $db->queryFirstList('SELECT year,month,maxgeneral,npcmode from game limit 1');
|
||||
|
||||
if(!$npcmode){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'빙의 가능한 서버가 아닙니다'
|
||||
]);
|
||||
}
|
||||
|
||||
if ($gencount >= $maxgeneral) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'더 이상 등록 할 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
//등록 시작
|
||||
$db->update('general', [
|
||||
'name2'=>$userNick,
|
||||
'npc'=>1,
|
||||
'killturn'=>6,
|
||||
'mode'=>2,
|
||||
'owner'=>$userID,
|
||||
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
|
||||
|
||||
if(!$db->affectedRows()){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수 등록에 실패했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$db->delete('select_npc_token', 'owner=%i or valid_until < %s', $userID, $now);
|
||||
|
||||
pushGeneralHistory($pickedNPC, "<C>●</>{$year}년 {$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>(이)가 빙의되다.");
|
||||
//pushGenLog($me, $mylog);
|
||||
pushGeneralPublicRecord(["<C>●</>{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>(이)가 <S>빙의</>됩니다!"], $year, $month);
|
||||
|
||||
pushAdminLog(["가입 : {$userID} // {$session->userName} // {$pick} // ".getenv("REMOTE_ADDR")]);
|
||||
|
||||
$rootDB->insert('member_log', [
|
||||
'member_no' => $userID,
|
||||
'date'=>date('Y-m-d H:i:s'),
|
||||
'action_type'=>'make_general',
|
||||
'action'=>Json::encode([
|
||||
'server'=>DB::prefix(),
|
||||
'type'=>'npc',
|
||||
'generalID'=>$npc['no'],
|
||||
'generalName'=>$npc['name']
|
||||
])
|
||||
]);
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
@@ -4,13 +4,48 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
|
||||
$session = Session::requireLogin([
|
||||
'game'=>'x',
|
||||
'game'=>null,
|
||||
'me'=>null
|
||||
])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
if(!class_exists('\\sammo\\DB')){
|
||||
Json::die([
|
||||
'game'=>null,
|
||||
'me'=>null
|
||||
]);
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
if(file_exists(__dir__.'/.htaccess')){
|
||||
$reserved = $db->queryFirstRow(
|
||||
'SELECT * FROM reserved_open ORDER BY `date` ASC LIMIT 1'
|
||||
);
|
||||
if(!$reserved){
|
||||
Json::die([
|
||||
'game'=>null,
|
||||
'me'=>null
|
||||
]);
|
||||
}
|
||||
|
||||
$options = Json::decode($reserved['options']);
|
||||
|
||||
Json::die([
|
||||
'reserved'=>[
|
||||
'scenarioName'=>$options['scenarioName'],
|
||||
'turnterm'=>$options['turnterm'],
|
||||
'fictionMode'=>($options['fiction']?'가상':'사실'),
|
||||
'npcMode'=>($options['npcmode']?'가능':'불가'),
|
||||
'openDatetime'=>$reserved['date']
|
||||
],
|
||||
'game'=>null,
|
||||
'me'=>null
|
||||
]);
|
||||
}
|
||||
|
||||
//TODO: 천통시에도 예약 오픈 알림이 필요..?
|
||||
|
||||
$game = $db->queryFirstRow('SELECT isUnited, npcMode, year, month, scenario, scenario_text, maxgeneral as maxUserCnt, turnTerm from game where `no`=1');
|
||||
|
||||
$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@ if (!$userID) {
|
||||
}
|
||||
|
||||
//회원 테이블에서 정보확인
|
||||
$member = RootDB::db()->queryFirstRow("select no,name,picture,imgsvr,grade from MEMBER where no= %i", $userID);
|
||||
$member = RootDB::db()->queryFirstRow("select no,name,picture,imgsvr,grade from member where no= %i", $userID);
|
||||
|
||||
if (!$member) {
|
||||
MessageBox("잘못된 접근입니다!!!");
|
||||
@@ -29,7 +29,7 @@ $connect=$db->get();
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>장수생성</title>
|
||||
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link rel='stylesheet' href="css/common.css">
|
||||
@@ -71,10 +71,10 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($nationresult);
|
||||
if ($nation['scoutmsg'] == "") {
|
||||
echo "
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:{newColor({$nation['color']})};background-color:{$nation['color']}>-</td></tr>";
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
|
||||
} else {
|
||||
echo "
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:{newColor({$nation['color']})};background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+5
-5
@@ -8,7 +8,6 @@ $v = new Validator($_POST + $_GET);
|
||||
$v
|
||||
->rule('required', [
|
||||
'name',
|
||||
'pic',
|
||||
'leader',
|
||||
'power',
|
||||
'intel'
|
||||
@@ -18,7 +17,6 @@ $v
|
||||
'power',
|
||||
'intel',
|
||||
'character',
|
||||
'pic'
|
||||
])
|
||||
->rule('lengthBetween', 'name', 1, 6)
|
||||
->rule('min', [
|
||||
@@ -46,18 +44,20 @@ $userID = Session::getUserID();
|
||||
|
||||
$name = Util::getReq('name');
|
||||
$name = StringUtil::removeSpecialCharacter($name);
|
||||
$pic = Util::getReq('pic', 'int', 0);
|
||||
$pic = (int)Util::getReq('pic', 'bool', 0);
|
||||
$character = Util::getReq('character', 'int', 0);
|
||||
|
||||
$leader = Util::getReq('leader', 'int', 50);
|
||||
$power = Util::getReq('power', 'int', 50);
|
||||
$intel = Util::getReq('intel', 'int', 50);
|
||||
|
||||
$join = Util::getReq('join'); //쓸모 없음
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$rootDB = RootDB::db();
|
||||
//회원 테이블에서 정보확인
|
||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name` FROM MEMBER WHERE no=%i', $userID);
|
||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
||||
|
||||
if (!$member) {
|
||||
MessageBox("잘못된 접근입니다!!!");
|
||||
@@ -68,7 +68,7 @@ if (!$member) {
|
||||
$db = DB::db();
|
||||
########## 동일 정보 존재여부 확인. ##########
|
||||
|
||||
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,turnterm,genius,npcmode from game limit 1');
|
||||
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,scenario,show_img_level,turnterm,genius,npcmode from game limit 1');
|
||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
|
||||
|
||||
@@ -118,4 +118,14 @@ var TemplateEngine = function (html, options) {
|
||||
try { result = new Function('obj', code).apply(options, [options]); }
|
||||
catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
|
||||
return result;
|
||||
}
|
||||
|
||||
function getIconPath(imgsvr, picture){
|
||||
// ../d_shared/common_path.js 필요
|
||||
if(!imgsvr){
|
||||
return pathConfig.sharedIcon+'/'+picture;
|
||||
}
|
||||
else{
|
||||
return pathConfig.root+'/d_pic/'+picture;
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -113,6 +113,7 @@ function formSetup(){
|
||||
extend:"required",
|
||||
npcmode:"required",
|
||||
show_img_level:"required",
|
||||
tournament_trig:"required"
|
||||
},
|
||||
errorElement: "div",
|
||||
errorPlacement: function ( error, element ) {
|
||||
@@ -149,7 +150,9 @@ function formSetup(){
|
||||
fiction:$('#fiction input:radio:checked').val(),
|
||||
extend:$('#extend input:radio:checked').val(),
|
||||
npcmode:$('#npcmode input:radio:checked').val(),
|
||||
show_img_level:$('#show_img_level input:radio:checked').val()
|
||||
show_img_level:$('#show_img_level input:radio:checked').val(),
|
||||
tournament_trig:$('#tournament_trig input:radio:checked').val(),
|
||||
reserve_open:$('#reserve_open').val()
|
||||
}
|
||||
}).then(function(result){
|
||||
var deferred = $.Deferred();
|
||||
|
||||
+2
-71
@@ -84,7 +84,7 @@ function reloadWorldMap(option){
|
||||
else if(month <= 6){
|
||||
$world_map.addClass('map_summer');
|
||||
}
|
||||
else if(month <= 6){
|
||||
else if(month <= 9){
|
||||
$world_map.addClass('map_fall');
|
||||
}
|
||||
else{
|
||||
@@ -366,65 +366,8 @@ function reloadWorldMap(option){
|
||||
|
||||
var $map_body = $('.world_map .map_body');
|
||||
|
||||
//터치스크린 탭
|
||||
|
||||
$objs.on('touchstart', function(e){
|
||||
var $this = $(this);
|
||||
|
||||
var touchMode = $this.data('touchMode');
|
||||
if($tooltip_city.data('target') != $this.data('id')){
|
||||
$this.data('touchMode', 1);
|
||||
}
|
||||
else if(touchMode === undefined){
|
||||
$this.data('touchMode', 1);
|
||||
}
|
||||
else{
|
||||
$this.data('touchMode', touchMode + 1);
|
||||
}
|
||||
$map_body.data('touchMode', 1);
|
||||
|
||||
$tooltip_city.data('target', $this.data('id'));
|
||||
|
||||
|
||||
});
|
||||
|
||||
$objs.on('touchend', function(e){
|
||||
var $this = $(this);
|
||||
var position = $this.parent().position();
|
||||
$tooltip_city.html($this.data('text'));
|
||||
|
||||
var nation_text = $this.data('nation');
|
||||
if(nation_text){
|
||||
$tooltip_nation.html(nation_text).show();
|
||||
}
|
||||
else{
|
||||
$tooltip_nation.html('').hide();
|
||||
}
|
||||
|
||||
$tooltip.css({'top': position.top + 25, 'left': position.left + 35}).show();
|
||||
|
||||
var touchMode = $this.data('touchMode');
|
||||
if(touchMode <= 1){
|
||||
return false;
|
||||
}
|
||||
|
||||
//xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다.
|
||||
$this.data('touchMode', 0);
|
||||
});
|
||||
|
||||
$map_body.on('touchend',function(e){
|
||||
|
||||
//위의 touchend bind에 해당하지 않는 경우 -> 빈 지도 터치
|
||||
$tooltip.hide();
|
||||
});
|
||||
|
||||
//Mouse over 모드 작동
|
||||
|
||||
$map_body.on('mousemove', function(e){
|
||||
if($(this).data('touchMode')){
|
||||
return true;
|
||||
}
|
||||
|
||||
var parentOffset = $map_body.offset();
|
||||
var relX = e.pageX - parentOffset.left;
|
||||
var relY = e.pageY - parentOffset.top;
|
||||
@@ -433,10 +376,6 @@ function reloadWorldMap(option){
|
||||
});
|
||||
|
||||
$objs.on('mouseenter', function(e){
|
||||
if($map_body.data('touchMode')){
|
||||
return true;
|
||||
}
|
||||
|
||||
var $this = $(this);
|
||||
|
||||
$tooltip_city.data('target', $this.data('id'));
|
||||
@@ -457,15 +396,7 @@ function reloadWorldMap(option){
|
||||
});
|
||||
|
||||
$objs.on('click', function(e){
|
||||
//xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다.
|
||||
var touchMode = $(this).data('touchMode');
|
||||
if(touchMode === undefined){
|
||||
return;
|
||||
}
|
||||
|
||||
if(touchMode === 1){
|
||||
return false;
|
||||
}
|
||||
return;
|
||||
});
|
||||
|
||||
|
||||
|
||||
+28
-6
@@ -12,7 +12,7 @@ function hexToRgb(hex) {
|
||||
|
||||
function isBrightColor(color){
|
||||
color = hexToRgb(color);
|
||||
if ((color.r*0.299 + color.g*0.587 + color.b*0.114) > 186){
|
||||
if ((color.r*0.299 + color.g*0.587 + color.b*0.114) > 140){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
@@ -31,7 +31,7 @@ var generalList = {};
|
||||
|
||||
function responseMessage(msgID, response){
|
||||
$.ajax({
|
||||
url: 'j_decide_opt.php',
|
||||
url: 'j_msg_decide_opt.php',
|
||||
type: 'post',
|
||||
dataType:'json',
|
||||
contentType: 'application/json',
|
||||
@@ -42,7 +42,10 @@ function responseMessage(msgID, response){
|
||||
}).then(refreshMsg);
|
||||
}
|
||||
|
||||
function refreshMsg(){
|
||||
function refreshMsg(result){
|
||||
if(result && !result.result){
|
||||
alert(result.reason);
|
||||
}
|
||||
return redrawMsg(fetchMsg());
|
||||
}
|
||||
|
||||
@@ -59,8 +62,6 @@ function fetchMsg(){
|
||||
}
|
||||
|
||||
function redrawMsg(deferred){
|
||||
|
||||
console.log(deferred);
|
||||
|
||||
function registerSequence(obj){
|
||||
if(!obj.result){
|
||||
@@ -216,7 +217,8 @@ function refreshMailboxList(obj){
|
||||
|
||||
generalList = {};
|
||||
|
||||
//TODO:수뇌인 경우 각국에 대해 외교 국메를 넣을 수 있어야함.
|
||||
|
||||
|
||||
|
||||
$.each(obj.nation, function(){
|
||||
var nation = this;
|
||||
@@ -284,6 +286,25 @@ function refreshMailboxList(obj){
|
||||
$favorite.append($lastContact);
|
||||
//TODO:운영자를 추가하는 코드도 넣을 것.
|
||||
|
||||
if(myGeneralLevel >= 5){
|
||||
$.each(obj.nation, function(){
|
||||
var nation = this;
|
||||
//console.log(nation);
|
||||
var $nation = $('<option value="{0}">{1}</option>'.format(nation.mailbox,nation.name));
|
||||
$nation.css('background-color', nation.color);
|
||||
|
||||
if(isBrightColor(nation.color)){
|
||||
$nation.css('color', 'black');
|
||||
}
|
||||
else{
|
||||
$nation.css('color', 'white');
|
||||
}
|
||||
$favorite.append($nation);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$mailboxList.prepend($favorite);
|
||||
|
||||
if(!oldSelected){
|
||||
@@ -307,6 +328,7 @@ function registerGlobal(basicInfo){
|
||||
};
|
||||
myGeneralID = basicInfo.generalID;
|
||||
isChief = basicInfo.isChief;
|
||||
myGeneralLevel = basicInfo.generalLevel;
|
||||
}
|
||||
|
||||
function activateMessageForm(){
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
var templateGeneralCard =
|
||||
'<div class="general_card">\
|
||||
<h4 class="bg1 with_border"><%name%></h4>\
|
||||
<h4><img src="<%iconPath%>" height=64 width=64></h4>\
|
||||
<p><%leader%> / <%power%> / <%intel%><br>\
|
||||
<%special%> / <%special2%></p>\
|
||||
<button type="subject" class="with_skin with_border select_btn" value="<%no%>" name="pick">빙의하기</button>\
|
||||
<label><input <%keepCnt?"":disabled="disabled"%> type="checkbox" value="<%no%>" name="keep[]" class="keep_select">보관(<%keepCnt%>회)</label>\
|
||||
</div>';
|
||||
|
||||
function pickGeneral(){
|
||||
$btn = $(this);
|
||||
|
||||
$.post({
|
||||
url:'j_select_npc.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
pick:$btn.val()
|
||||
}
|
||||
}).then(function(result){
|
||||
if(!result.result){
|
||||
alert(result.reason);
|
||||
location.refresh();
|
||||
}
|
||||
|
||||
alert('빙의에 성공했습니다.');
|
||||
location.href = './';
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateOutdateTimer(){
|
||||
var $validUntilText = $('#valid_until_text');
|
||||
var now = Date.now();
|
||||
var validUntil = $validUntilText.data('until');
|
||||
if(validUntil <= 0){
|
||||
return;
|
||||
}
|
||||
else if(validUntil < now){
|
||||
$validUntilText.data('until',0);
|
||||
$('#valid_until').hide();
|
||||
$('#outdate_token').show();
|
||||
return;
|
||||
}
|
||||
else if(validUntil - now <= 30000){
|
||||
$validUntilText.css('color', "rgb(255, {0}, {0})".format(255*(validUntil - now)/30000));
|
||||
}
|
||||
|
||||
setTimeout(updateOutdateTimer, 1000);
|
||||
}
|
||||
|
||||
function updatePickMoreTimer(){
|
||||
var $btn = $('#btn_pick_more');
|
||||
|
||||
var now = Date.now();
|
||||
var remain = ($btn.data('available') - now) / 1000;
|
||||
if(remain <= 0){
|
||||
$btn.prop('disabled', false)
|
||||
$btn.html('다른 장수 보기');
|
||||
return;
|
||||
}
|
||||
|
||||
$btn.html('다른 장수 보기({0}초)'.format(Math.ceil(remain)));
|
||||
|
||||
setTimeout(updatePickMoreTimer, 250);
|
||||
}
|
||||
|
||||
function printGenerals(value){
|
||||
$('.card_holder').empty();
|
||||
$('#valid_until').show();
|
||||
$('#valid_until_text').html(value.validUntil).data('until', (new Date(value.validUntil)).getTime()).css('color','white');
|
||||
$('#outdate_token').hide();
|
||||
var time = Date.now() + value.pickMoreSeconds*1000;
|
||||
$('#btn_pick_more').data('available', time).prop('disabled',true);
|
||||
|
||||
var pick = $.map(value.pick, function(value, key) {
|
||||
return value;
|
||||
});
|
||||
|
||||
pick.sort(function(lhs, rhs){
|
||||
var lsum = lhs.leader+lhs.power+lhs.intel;
|
||||
var rsum = rhs.leader+rhs.power+rhs.intel;
|
||||
return lsum - rsum;
|
||||
});
|
||||
|
||||
$.each(pick, function(idx, cardData){
|
||||
cardData.iconPath = getIconPath(cardData.imgsvr, cardData.picture);
|
||||
|
||||
var $card = $(TemplateEngine(templateGeneralCard, cardData));
|
||||
console.log($card);
|
||||
|
||||
$('.card_holder').append($card);
|
||||
$card.find('.select_btn').click(pickGeneral);
|
||||
});
|
||||
|
||||
updatePickMoreTimer();
|
||||
updateOutdateTimer();
|
||||
}
|
||||
|
||||
$(function($){
|
||||
|
||||
$.post('j_get_select_npc_token.php').then(function(value){
|
||||
if(!value.result){
|
||||
alert(value.reason);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(value);
|
||||
printGenerals(value);
|
||||
});
|
||||
|
||||
$('#btn_pick_more').click(function(){
|
||||
var generals = $.map($('.keep_select:checked'), function(value){
|
||||
return $(value).val();
|
||||
});
|
||||
console.log(generals);
|
||||
$.post({
|
||||
url:'j_get_select_npc_token.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
refresh:true,
|
||||
keep:generals
|
||||
}
|
||||
}).then(function(result){
|
||||
if(!result.result){
|
||||
alert(result.reason);
|
||||
location.refresh();
|
||||
}
|
||||
console.log(result);
|
||||
printGenerals(result);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -32,7 +32,4 @@
|
||||
<%if(this.option && this.option.action) {%>
|
||||
<div class="msg_prompt">
|
||||
<button class="prompt_yes btn_prompt">수락</button> <button class="prompt_no btn_prompt">거절</button>
|
||||
</div>
|
||||
<%} %>
|
||||
</div>
|
||||
</div>
|
||||
</div><%} %></div></div>
|
||||
@@ -26,7 +26,6 @@ include "MYDB.php";
|
||||
// 각종 변수
|
||||
define('STEP_LOG', true);
|
||||
define('PROCESS_LOG', true);
|
||||
$_startTime = microtime(true);
|
||||
|
||||
ob_start();
|
||||
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
|
||||
@@ -55,13 +54,6 @@ function MessageBox($str)
|
||||
echo "<script>alert('$str');</script>";
|
||||
}
|
||||
|
||||
function PrintElapsedTime()
|
||||
{
|
||||
global $_startTime;
|
||||
$_endTime = round(microtime(true) - $_startTime, 3);
|
||||
echo "<table width=1000 align=center style=font-size:10px;><tr><td align=right>경과시간 : {$_endTime}초</td></tr></table>";
|
||||
}
|
||||
|
||||
function LogText($prefix, $variable)
|
||||
{
|
||||
$text = sprintf('%s : %s'."\n", $prefix, var_export($variable, true));
|
||||
|
||||
+1
-15
@@ -19,24 +19,10 @@ extractMissingPostToGlobals();
|
||||
increaseRefresh("턴입력", 1);
|
||||
|
||||
if(!$turn || $commandtype === null){
|
||||
header('location:./');
|
||||
header('location:commandlist.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,con from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
if($con >= 2) {
|
||||
header('location:./');
|
||||
exit();
|
||||
}
|
||||
|
||||
$count = count($turn);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
if($turn[$i] == 100 || $turn[$i] == 99 || $turn[$i] == 98) {
|
||||
|
||||
+3
-1
@@ -4,8 +4,10 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::getInstance()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("자동", 2);
|
||||
//increaseRefresh("자동", 2);
|
||||
checkTurn();
|
||||
|
||||
+5
-4
@@ -1159,7 +1159,7 @@ function processWar($general, $city) {
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->defence; //회피율
|
||||
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->avoid; //회피율
|
||||
$ratio2 = Util::round($ratio2 * $oppose['train'] / 100); //훈련 반영
|
||||
// 특기보정 : 돌격, 궁병
|
||||
if($general['special2'] == 60) { $ratio2 -= 100; }
|
||||
@@ -1775,13 +1775,14 @@ function ConquerCity($game, $general, $city, $nation, $destnation) {
|
||||
|| $nation['name'] == "왜족") {
|
||||
//등용장 미발부
|
||||
} elseif(Util::randBool(0.5)) {
|
||||
sendScoutMsg([
|
||||
//TODO:등용장 보낼것
|
||||
/*sendScoutMsg([
|
||||
'id' => $ruler['no'],
|
||||
'nation_id' => $ruler['nation']
|
||||
],[
|
||||
'id' => $gen['no'],
|
||||
'nation_id' => $gen['nation']
|
||||
],$general['turntime']);
|
||||
],$general['turntime']);*/
|
||||
}
|
||||
|
||||
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
|
||||
@@ -1853,7 +1854,7 @@ function ConquerCity($game, $general, $city, $nation, $destnation) {
|
||||
], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]);
|
||||
|
||||
//수도였으면 긴급 천도
|
||||
if(!isset($destnation['capital']) && $destnation['capital'] == $city['city']) {
|
||||
if(isset($destnation['capital']) && $destnation['capital'] == $city['city']) {
|
||||
$minCity = findNextCapital($city['city'], $destnation['nation']);
|
||||
|
||||
$minCityName = CityConst::byID($minCity)->name;
|
||||
|
||||
+37
-31
@@ -58,7 +58,7 @@ switch($commandtype) {
|
||||
case 17: command_Single($turn, 17); break; //소집해제
|
||||
|
||||
case 21: command_21( $turn, 21); break; //이동
|
||||
//case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인
|
||||
case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인
|
||||
case 23: command_23( $turn, 23); break; //포상
|
||||
case 24: command_24( $turn, 24); break; //몰수
|
||||
case 25: command_25( $turn, 25); break; //임관
|
||||
@@ -166,11 +166,7 @@ function ender($type=0) {
|
||||
echo banner();
|
||||
echo "
|
||||
</td></tr>
|
||||
</table>";
|
||||
|
||||
PrintElapsedTime();
|
||||
|
||||
echo "
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
";
|
||||
@@ -594,7 +590,7 @@ function calc(cost, formnum) {
|
||||
<form name=form{$i} action=c_double.php>
|
||||
<td valign=center>
|
||||
<input type=text name=double maxlength=3 size=3 value=$crew style=text-align:right;color:white;background-color:black>00명<input type=button value=계산 onclick='calc($baseCost, $i)'><br>
|
||||
<input type=text name=cost maxlength=5 size=5 readonly style=text-align:right;color:white;background-color:black>원 <input type=submit value=징병>
|
||||
<input type=text name=cost maxlength=5 size=5 readonly style=text-align:right;color:white;background-color:black>원 <input type=submit value=모병>
|
||||
<input type=hidden name=third value={$i}>
|
||||
<input type=hidden name=command value=$command>";
|
||||
|
||||
@@ -860,7 +856,10 @@ function command_23($turn, $command) {
|
||||
<option value=8>800</option>
|
||||
<option value=9>900</option>
|
||||
<option value=10>1000</option>
|
||||
<option value=12>1200</option>
|
||||
<option value=15>1500</option>
|
||||
<option value=20>2000</option>
|
||||
<option value=25>2500</option>
|
||||
<option value=30>3000</option>
|
||||
<option value=40>4000</option>
|
||||
<option value=50>5000</option>
|
||||
@@ -935,7 +934,10 @@ function command_24($turn, $command) {
|
||||
<option value=8>800</option>
|
||||
<option value=9>900</option>
|
||||
<option value=10>1000</option>
|
||||
<option value=12>1200</option>
|
||||
<option value=15>1500</option>
|
||||
<option value=20>2000</option>
|
||||
<option value=25>2500</option>
|
||||
<option value=30>3000</option>
|
||||
<option value=40>4000</option>
|
||||
<option value=50>5000</option>
|
||||
@@ -1448,7 +1450,10 @@ function command_43($turn, $command) {
|
||||
<option value=8>800</option>
|
||||
<option value=9>900</option>
|
||||
<option value=10>1000</option>
|
||||
<option value=12>1200</option>
|
||||
<option value=15>1500</option>
|
||||
<option value=20>2000</option>
|
||||
<option value=25>2500</option>
|
||||
<option value=30>3000</option>
|
||||
<option value=40>4000</option>
|
||||
<option value=50>5000</option>
|
||||
@@ -1496,7 +1501,10 @@ function command_44($turn, $command) {
|
||||
<option value=8>800</option>
|
||||
<option value=9>900</option>
|
||||
<option value=10>1000</option>
|
||||
<option value=12>1200</option>
|
||||
<option value=15>1500</option>
|
||||
<option value=20>2000</option>
|
||||
<option value=25>2500</option>
|
||||
<option value=30>3000</option>
|
||||
<option value=40>4000</option>
|
||||
<option value=50>5000</option>
|
||||
@@ -1540,7 +1548,7 @@ function command_46($turn, $command) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isset($nationcolor[$nation['color']])){
|
||||
if(!isset($nationcolor[$nation['color']])){
|
||||
$nationcolor[$nation['color']] = 1;
|
||||
}
|
||||
else{
|
||||
@@ -1597,22 +1605,22 @@ function command_46($turn, $command) {
|
||||
?>
|
||||
</select>
|
||||
성향 : <select name=third size=1>
|
||||
<option value=1 style=background-color:black;color:white;>".getNationType(1)."</option>
|
||||
<option value=2 style=background-color:black;color:white;>".getNationType(2)."</option>
|
||||
<option value=10 style=background-color:black;color:white;>".getNationType(10)."</option>
|
||||
<option value=3 style=background-color:black;color:white;>".getNationType(3)."</option>
|
||||
<option value=4 style=background-color:black;color:white;>".getNationType(4)."</option>
|
||||
<option value=5 style=background-color:black;color:white;>".getNationType(5)."</option>
|
||||
<option value=6 style=background-color:black;color:white;>".getNationType(6)."</option>
|
||||
<option value=7 style=background-color:black;color:white;>".getNationType(7)."</option>
|
||||
<option value=8 style=background-color:black;color:white;>".getNationType(8)."</option>
|
||||
<option selected value=9 style=background-color:black;color:white;>".getNationType(9)."</option>
|
||||
<option value=11 style=background-color:black;color:white;>".getNationType(11)."</option>
|
||||
<option value=12 style=background-color:black;color:white;>".getNationType(12)."</option>
|
||||
<option value=13 style=background-color:black;color:white;>".getNationType(13)."</option>
|
||||
<option value=1 style=background-color:black;color:white;><?=getNationType(1)?></option>
|
||||
<option value=2 style=background-color:black;color:white;><?=getNationType(2)?></option>
|
||||
<option value=10 style=background-color:black;color:white;><?=getNationType(10)?></option>
|
||||
<option value=3 style=background-color:black;color:white;><?=getNationType(3)?></option>
|
||||
<option value=4 style=background-color:black;color:white;><?=getNationType(4)?></option>
|
||||
<option value=5 style=background-color:black;color:white;><?=getNationType(5)?></option>
|
||||
<option value=6 style=background-color:black;color:white;><?=getNationType(6)?></option>
|
||||
<option value=7 style=background-color:black;color:white;><?=getNationType(7)?></option>
|
||||
<option value=8 style=background-color:black;color:white;><?=getNationType(8)?></option>
|
||||
<option selected value=9 style=background-color:black;color:white;><?=getNationType(9)?></option>
|
||||
<option value=11 style=background-color:black;color:white;><?=getNationType(11)?></option>
|
||||
<option value=12 style=background-color:black;color:white;><?=getNationType(12)?></option>
|
||||
<option value=13 style=background-color:black;color:white;><?=getNationType(13)?></option>
|
||||
</select>
|
||||
<input type=submit value=건국>
|
||||
<input type=hidden name=command value=$command>
|
||||
<input type=hidden name=command value=<?=$command?>>
|
||||
<?php
|
||||
for($i=0; $i < count($turn); $i++) {
|
||||
echo "<input type=hidden name=turn[] value=$turn[$i]>";
|
||||
@@ -1720,7 +1728,10 @@ function command_49($turn, $command) {
|
||||
<option value=8>800</option>
|
||||
<option value=9>900</option>
|
||||
<option value=10>1000</option>
|
||||
<option value=12>1200</option>
|
||||
<option value=15>1500</option>
|
||||
<option value=20>2000</option>
|
||||
<option value=25>2500</option>
|
||||
<option value=30>3000</option>
|
||||
<option value=40>4000</option>
|
||||
<option value=50>5000</option>
|
||||
@@ -1774,7 +1785,7 @@ function command_51($turn, $command) {
|
||||
for($i=1; $i <= $count; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($myNation['power'] / $nation['power'] <= 3 || !isClose($me['nation'], $nation['nation'])) {
|
||||
if($myNation['power'] <= $nation['power'] * 3 || !isClose($me['nation'], $nation['nation'])) {
|
||||
echo "<option style=color:{$nation['color']};background-color:red; value={$nation['nation']}>【 {$nation['name']} 】</option>";
|
||||
} else {
|
||||
echo "<option style=color:{$nation['color']} value={$nation['nation']}>【 {$nation['name']} 】</option>";
|
||||
@@ -2758,13 +2769,8 @@ function command_81($turn, $command) {
|
||||
if($nation['level'] <= 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isset($nationcolor[$nation['color']])){
|
||||
$nationcolor[$nation['color']] = 1;
|
||||
}
|
||||
else{
|
||||
$nationcolor[$nation['color']]++;
|
||||
}
|
||||
|
||||
$colorUsed[$nation['color']]+=1;
|
||||
}
|
||||
|
||||
$colorUsedCnt = 0;
|
||||
@@ -2787,7 +2793,7 @@ function command_81($turn, $command) {
|
||||
<form name=form1 action=c_double.php method=post>
|
||||
색깔 : <select name=double size=1>";
|
||||
foreach(GetNationColors() as $idx=>$color) {
|
||||
if($colorUsed[$color] > 0){
|
||||
if($colorUsed[$color]>0){
|
||||
continue;
|
||||
}
|
||||
echo "<option value={$idx} style=background-color:{$color};color:".newColor($color).";>국가명</option>";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user