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 | ||
|
|
c2298efaf0 |
@@ -30,6 +30,7 @@ d_pic/*.png
|
|||||||
|
|
||||||
d_setting/*.php
|
d_setting/*.php
|
||||||
*/d_setting/*.php
|
*/d_setting/*.php
|
||||||
|
*/d_setting/templates/*.php
|
||||||
|
|
||||||
**/old/*
|
**/old/*
|
||||||
test.php
|
test.php
|
||||||
|
|||||||
+22
-39
@@ -1,14 +1,16 @@
|
|||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
|
|
||||||
* { margin: 0px; padding: 0px; }
|
body {
|
||||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
color:white; background-color:black; font-family: '맑은 고딕';
|
||||||
table {
|
}
|
||||||
|
|
||||||
|
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;
|
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;
|
padding: 0px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: '맑은 고딕'; line-height: 110%;
|
font-family: '맑은 고딕';
|
||||||
}
|
}
|
||||||
th, td {
|
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;
|
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;
|
font-size: 13px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: '맑은 고딕'; line-height: 110%;
|
font-family: '맑은 고딕';
|
||||||
}
|
}
|
||||||
|
|
||||||
a.just_link {
|
a.just_link {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
|
||||||
margin:0px;
|
|
||||||
padding: 0px;
|
|
||||||
word-break: break-all;
|
|
||||||
font-family: '맑은 고딕';
|
|
||||||
}
|
|
||||||
|
|
||||||
.with_border{
|
.with_border{
|
||||||
|
margin:0;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
border-collapse: separate;
|
border-collapse: separate;
|
||||||
@@ -45,6 +41,8 @@ div {
|
|||||||
line-height:50px;
|
line-height:50px;
|
||||||
font-size: 30px; font-weight: bold;
|
font-size: 30px; font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
color:white;
|
||||||
|
padding:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.legacy_layout div {
|
.legacy_layout div {
|
||||||
@@ -53,20 +51,9 @@ div {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-align: center;
|
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{
|
.obj_fill{
|
||||||
display:block;
|
display:block;
|
||||||
width:100%;
|
width:100%;
|
||||||
@@ -77,28 +64,20 @@ button.with_skin {
|
|||||||
background-color: black; color: white;
|
background-color: black; color: white;
|
||||||
font-family: '맑은 고딕';
|
font-family: '맑은 고딕';
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 110%;
|
}
|
||||||
|
|
||||||
|
button.with_skin:disabled {
|
||||||
|
background-color:#333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.with_skin {
|
input.with_skin {
|
||||||
background-color: black; color: white;
|
background-color: black; color: white;
|
||||||
font-family: '맑은 고딕';
|
font-family: '맑은 고딕';
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 110%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
input.with_skin:disabled {
|
||||||
width: 100px; height: 18px;
|
background-color: #333333;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.font0 { font-size: 10px; }
|
.font0 { font-size: 10px; }
|
||||||
@@ -106,4 +85,8 @@ button {
|
|||||||
.font2 { font-size: 15px; }
|
.font2 { font-size: 15px; }
|
||||||
.font3 { font-size: 20px; }
|
.font3 { font-size: 20px; }
|
||||||
.font4 { font-size: 30px; }
|
.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";
|
@charset "utf-8";
|
||||||
|
|
||||||
|
body{
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
#server_notice {
|
#server_notice {
|
||||||
margin:10px 0;
|
margin:10px 0;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -55,77 +59,6 @@
|
|||||||
text-align:center;
|
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 {
|
.Entrance_ServerList {
|
||||||
width: 800px; height: 64px;
|
width: 800px; height: 64px;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -197,25 +130,4 @@
|
|||||||
|
|
||||||
.Entrance_Hwe {
|
.Entrance_Hwe {
|
||||||
color: red; font-size: 15px; font-weight: bold;
|
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{
|
.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 {
|
.vertical-center {
|
||||||
@@ -72,4 +85,32 @@ input::-webkit-input-placeholder {
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
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;
|
right: 6px;
|
||||||
margin:6px;
|
margin:6px;
|
||||||
height:40px;
|
height:40px;
|
||||||
|
line-height:40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#btn_delete_me{
|
#btn_delete_me{
|
||||||
@@ -37,15 +38,15 @@
|
|||||||
|
|
||||||
#image_upload_filename{
|
#image_upload_filename{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
height:16px;
|
height:20px;
|
||||||
left:10px;
|
left:10px;
|
||||||
width:130px;
|
width:130px;
|
||||||
top:16px;
|
top:12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#image_upload_fake_btn{
|
#image_upload_fake_btn{
|
||||||
top:16px;
|
top:12px;
|
||||||
height:20px;
|
height:22px;
|
||||||
right:10px;
|
right:10px;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
}
|
}
|
||||||
@@ -53,8 +54,7 @@
|
|||||||
#image_upload{
|
#image_upload{
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top:16px;
|
top:12px;
|
||||||
height:22px;
|
|
||||||
left:0;
|
left:0;
|
||||||
height:20px;
|
height:20px;
|
||||||
width:100%;
|
width:100%;
|
||||||
@@ -70,7 +70,6 @@
|
|||||||
bottom:0;
|
bottom:0;
|
||||||
left:0;
|
left:0;
|
||||||
width:50%;
|
width:50%;
|
||||||
height:20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#btn_remove_icon{
|
#btn_remove_icon{
|
||||||
@@ -78,171 +77,10 @@
|
|||||||
bottom:0;
|
bottom:0;
|
||||||
right:0;
|
right:0;
|
||||||
width:50%;
|
width:50%;
|
||||||
height:20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#EntranceManage_00 {
|
#third_use_disallow{
|
||||||
width: 500px; height: 409px;
|
display:none;
|
||||||
z-index: 2;
|
margin-left:10px;
|
||||||
}
|
width:40px;
|
||||||
|
}
|
||||||
#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;
|
|
||||||
}
|
|
||||||
+5
-1
@@ -2,11 +2,14 @@
|
|||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
define('ROOT', realpath(__dir__.'/..'));
|
define('ROOT', realpath(__dir__.'/..'));
|
||||||
|
date_default_timezone_set('Asia/Seoul');
|
||||||
mb_internal_encoding("UTF-8");
|
mb_internal_encoding("UTF-8");
|
||||||
mb_http_output('UTF-8');
|
mb_http_output('UTF-8');
|
||||||
mb_regex_encoding('UTF-8');
|
mb_regex_encoding('UTF-8');
|
||||||
|
|
||||||
|
ini_set("session.cache_expire", 10080); // minutes
|
||||||
|
ini_set("session.gc_maxlifetime", 604800); // seconds
|
||||||
|
|
||||||
function getFriendlyErrorType($type)
|
function getFriendlyErrorType($type)
|
||||||
{
|
{
|
||||||
switch($type)
|
switch($type)
|
||||||
@@ -79,6 +82,7 @@ function logExceptionByCustomHandler(\Throwable $e){
|
|||||||
], Json::PRETTY);
|
], Json::PRETTY);
|
||||||
|
|
||||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
||||||
|
echo $e->getTraceAsString();
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
||||||
@@ -216,6 +216,13 @@ $result = Util::generateFileUsingSimpleTemplate(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$result = Util::generateFileUsingSimpleTemplate(
|
||||||
|
__dir__.'/templates/menu.orig.js',
|
||||||
|
ROOT.'/d_shared/menu.js',
|
||||||
|
[],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
DROP TABLE IF EXISTS `system`;
|
DROP TABLE IF EXISTS `system`;
|
||||||
DROP TABLE IF EXISTS `member`;
|
DROP TABLE IF EXISTS `member`;
|
||||||
DROP TABLE IF EXISTS `member_log`;
|
DROP TABLE IF EXISTS `member_log`;
|
||||||
|
DROP TABLE IF EXISTS `config`;
|
||||||
|
|
||||||
-- 시스템 테이블
|
-- 시스템 테이블
|
||||||
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
|
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
|
||||||
@@ -25,6 +26,7 @@ CREATE TABLE `member` (
|
|||||||
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
|
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
|
||||||
`PW` CHAR(128) NOT NULL,
|
`PW` CHAR(128) NOT NULL,
|
||||||
`salt` CHAR(16) NOT NULL,
|
`salt` CHAR(16) NOT NULL,
|
||||||
|
`third_use` INT(1) NOT NULL DEFAULT '0',
|
||||||
`NAME` VARCHAR(64) NOT NULL,
|
`NAME` VARCHAR(64) NOT NULL,
|
||||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||||
@@ -53,4 +55,13 @@ CREATE TABLE `member_log` (
|
|||||||
INDEX `action` (`member_no`, `action_type`, `date`),
|
INDEX `action` (`member_no`, `action_type`, `date`),
|
||||||
INDEX `member` (`member_no`, `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;
|
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
@@ -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";
|
include "func.php";
|
||||||
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
if($session->userGrade < 5) {
|
if($session->userGrade < 4) {
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ include "func.php";
|
|||||||
|
|
||||||
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
if($session->userGrade < 5){
|
if($session->userGrade < 4){
|
||||||
header('location:_119.php');
|
header('location:_119.php');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-21
@@ -24,6 +24,8 @@ if(!$generalID){
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
$src = MessageTarget::buildQuick($session->generalID);
|
||||||
|
|
||||||
switch($btn) {
|
switch($btn) {
|
||||||
case "전체 접속허용":
|
case "전체 접속허용":
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
@@ -96,12 +98,10 @@ switch($btn) {
|
|||||||
break;
|
break;
|
||||||
case "특기 부여":
|
case "특기 부여":
|
||||||
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
|
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
|
||||||
|
|
||||||
$src = MessageTarget::buildQuick($session->generalID);
|
|
||||||
$text = "특기 부여!";
|
$text = "특기 부여!";
|
||||||
|
|
||||||
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
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 = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
|
|
||||||
$specialWar = SpecialityConst::pickSpecialWar($general);
|
$specialWar = SpecialityConst::pickSpecialWar($general);
|
||||||
@@ -116,10 +116,9 @@ switch($btn) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "경험치1000":
|
case "경험치1000":
|
||||||
$src = MessageTarget::buildQuick($session->generalID);
|
|
||||||
$text = $btn." 지급!";
|
$text = $btn." 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -128,10 +127,9 @@ switch($btn) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "공헌치1000":
|
case "공헌치1000":
|
||||||
$src = MessageTarget::buildQuick($session->generalID);
|
|
||||||
$text = $btn." 지급!";
|
$text = $btn." 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -140,10 +138,9 @@ switch($btn) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case "보숙10000":
|
case "보숙10000":
|
||||||
$src = MessageTarget::buildQuick($session->generalID);
|
|
||||||
$text = "보병숙련도+10000 지급!";
|
$text = "보병숙련도+10000 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -151,10 +148,9 @@ switch($btn) {
|
|||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "궁숙10000":
|
case "궁숙10000":
|
||||||
$src = MessageTarget::buildQuick($session->generalID);
|
|
||||||
$text = "궁병숙련도+10000 지급!";
|
$text = "궁병숙련도+10000 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -165,7 +161,7 @@ switch($btn) {
|
|||||||
$src = MessageTarget::buildQuick($session->generalID);
|
$src = MessageTarget::buildQuick($session->generalID);
|
||||||
$text = "기병숙련도+10000 지급!";
|
$text = "기병숙련도+10000 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -176,7 +172,7 @@ switch($btn) {
|
|||||||
$src = MessageTarget::buildQuick($session->generalID);
|
$src = MessageTarget::buildQuick($session->generalID);
|
||||||
$text = "귀병숙련도+10000 지급!";
|
$text = "귀병숙련도+10000 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -187,7 +183,7 @@ switch($btn) {
|
|||||||
$src = MessageTarget::buildQuick($session->generalID);
|
$src = MessageTarget::buildQuick($session->generalID);
|
||||||
$text = "차병숙련도+10000 지급!";
|
$text = "차병숙련도+10000 지급!";
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
$db->update('general',[
|
$db->update('general',[
|
||||||
@@ -195,19 +191,19 @@ switch($btn) {
|
|||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "접속 허용":
|
case "접속 허용":
|
||||||
$db->update('genera',[
|
$db->update('general',[
|
||||||
'con'=>0
|
'con'=>0
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "접속 제한":
|
case "접속 제한":
|
||||||
$db->update('genera',[
|
$db->update('general',[
|
||||||
'con'=>1000
|
'con'=>1000
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "메세지 전달":
|
case "메세지 전달":
|
||||||
$text = $msg;
|
$text = $msg;
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -221,7 +217,7 @@ switch($btn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,7 +241,7 @@ switch($btn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +265,7 @@ switch($btn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,7 +289,7 @@ switch($btn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($genlist as $generalID){
|
foreach($genlist as $generalID){
|
||||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
|
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1630,7 +1630,6 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
|||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if ($con >= 2) {
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||||
|
|
||||||
@@ -344,7 +344,6 @@ for ($i=0; $i < 4; $i++) {
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -41,7 +41,7 @@ if ($type <= 0 || $type > 15) {
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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>
|
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||||
@@ -194,7 +194,6 @@ echo "
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("#viewType").val("<?=$type?>").attr("selected", "selected");
|
$("#viewType").val("<?=$type?>").attr("selected", "selected");
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ increaseRefresh("명예의전당", 2);
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -15,13 +15,13 @@ $userID = Session::getUserID();
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
increaseRefresh("연감", 5);
|
increaseRefresh("연감", 2);
|
||||||
|
|
||||||
$query = "select startyear,year,month,conlimit from game limit 1";
|
$query = "select startyear,year,month,conlimit from game limit 1";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$admin = MYDB_fetch_array($result);
|
$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), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ if ($month <= 0) {
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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="../e_lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="../d_shared/common_path.js"></script>
|
<script src="../d_shared/common_path.js"></script>
|
||||||
<script src="js/common.js"></script>
|
<script src="js/common.js"></script>
|
||||||
@@ -159,6 +159,5 @@ reloadWorldMap({
|
|||||||
neutralView:true
|
neutralView:true
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-2
@@ -26,7 +26,7 @@ $sel[$type] = "selected";
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$admin = MYDB_fetch_array($result);
|
$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="../e_lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="../d_shared/common_path.js"></script>
|
<script src="../d_shared/common_path.js"></script>
|
||||||
<script src="js/common.js"></script>
|
<script src="js/common.js"></script>
|
||||||
@@ -67,7 +67,7 @@ $(function(){
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 valign=top>
|
<td colspan=2 valign=top>
|
||||||
<?php getWorldHistoryRecent(34); ?>
|
<?=getWorldHistoryRecent(34)?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -75,7 +75,6 @@ $(function(){
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+11
-12
@@ -22,15 +22,15 @@ $refresh = [];
|
|||||||
$online = [];
|
$online = [];
|
||||||
|
|
||||||
$curonline = getOnlineNum();
|
$curonline = getOnlineNum();
|
||||||
$visibleLogs = min(11, count($log));
|
foreach($log as $i=>$value){
|
||||||
for ($i=0; $i < $visibleLogs; $i++) {
|
$parse = Json::decode($value);
|
||||||
$parse = explode("|", $log[count($log)-$visibleLogs+$i]);
|
$date[$i] = $parse[0];
|
||||||
$date[$i] = trim($parse[0]);
|
$year[$i] = $parse[1];
|
||||||
$year[$i] = trim($parse[1]);
|
$month[$i] = $parse[2];
|
||||||
$month[$i] = trim($parse[2]);
|
$refresh[$i] = $parse[3];
|
||||||
$refresh[$i] = trim($parse[3]);
|
$online[$i] = $parse[4];
|
||||||
$online[$i] = trim($parse[4]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($game['maxrefresh'] == 0) {
|
if ($game['maxrefresh'] == 0) {
|
||||||
$game['maxrefresh'] = 1;
|
$game['maxrefresh'] = 1;
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ if ($game['maxonline'] < $curonline) {
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>트래픽정보</title>
|
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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>
|
<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>
|
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
|
||||||
<?php
|
<?php
|
||||||
for ($i=0; $i < $visibleLogs; $i++) {
|
foreach($log as $i=>$value){
|
||||||
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
|
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
|
||||||
if ($w >= 100) {
|
if ($w >= 100) {
|
||||||
$w -= 0.1;
|
$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>
|
<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>
|
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
|
||||||
<?php
|
<?php
|
||||||
for ($i=0; $i < $visibleLogs; $i++) {
|
foreach($log as $i=>$value){
|
||||||
$w = round($online[$i] / $game['maxonline'] * 100, 1);
|
$w = round($online[$i] / $game['maxonline'] * 100, 1);
|
||||||
if ($w >= 100) {
|
if ($w >= 100) {
|
||||||
$w -= 0.1;
|
$w -= 0.1;
|
||||||
@@ -264,7 +264,6 @@ for ($i=0; $i < $count; $i++) {
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+22
-18
@@ -28,7 +28,7 @@ if ($vote[0] == "") {
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>설문조사</title>
|
<title><?=UniqueConst::$serverName?>: 설문조사</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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>
|
<tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$memCount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
|
||||||
if ($memCount == 0) {
|
|
||||||
$memCount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$totalVote = [];
|
$totalVote = [];
|
||||||
$nationVoteCount = [[0]];
|
$nationVoteCount = [];
|
||||||
$nationVote = [[]];
|
$nationVote = [];
|
||||||
|
|
||||||
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
|
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
|
||||||
$nation = $row['nation'];
|
$nation = $row['nation'];
|
||||||
$vote = $row['vote'];
|
$ownVote = $row['vote'];
|
||||||
$cnt = $row['cnt'];
|
$cnt = $row['cnt'];
|
||||||
|
|
||||||
if (!isset($totalVote[$vote])) {
|
if (!isset($totalVote[$ownVote])) {
|
||||||
$totalVote[$vote] = 0;
|
$totalVote[$ownVote] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($nationVoteCount[$nation])) {
|
if (!isset($nationVoteCount[$nation])) {
|
||||||
@@ -221,20 +218,20 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
|||||||
$nationVote[$nation] = [];
|
$nationVote[$nation] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($nationVote[$nation][$vote])) {
|
if (!isset($nationVote[$nation][$ownVote])) {
|
||||||
$nationVote[$nation][$vote] = 0;
|
$nationVote[$nation][$ownVote] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$totalVote[$vote] += $cnt;
|
$totalVote[$ownVote] += $cnt;
|
||||||
$nationVoteCount[$nation] += $cnt;
|
$nationVoteCount[$nation] += $cnt;
|
||||||
$nationVote[$nation][$vote] += $cnt;
|
$nationVote[$nation][$ownVote] += $cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0; $i < $voteTypeCount; $i++) {
|
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'] = " "; }
|
// if($per < 5) { $vote['cnt'] = " "; }
|
||||||
echo "
|
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), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$memCount = MYDB_num_rows($result);
|
$memCount = MYDB_num_rows($result);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
|
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
|
||||||
$percentage = round($voteCount / $memCount * 100, 1);
|
if($memCount == 0){
|
||||||
|
$percentage = 100;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$percentage = round($voteCount / $memCount * 100, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<tr>
|
<tr>
|
||||||
@@ -328,7 +333,6 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -58,7 +58,7 @@ if ($msg2 == "") {
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>거래장</title>
|
<title><?=UniqueConst::$serverName?>: 거래장</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+22
-7
@@ -75,7 +75,7 @@ $sel[$type] = "selected";
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>감찰부</title>
|
<title><?=UniqueConst::$serverName?>: 감찰부</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||||
@@ -100,20 +100,23 @@ $sel[$type] = "selected";
|
|||||||
<?php
|
<?php
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
default:
|
default:
|
||||||
case 0: $query = "select no,name from general where nation='{$me['nation']}' order by turntime 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 from general where nation='{$me['nation']}' order by recwar 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 from general where nation='{$me['nation']}' order by npc,binary(name)"; 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 from general where nation='{$me['nation']}' order by warnum desc"; 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), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$gencount = MYDB_num_rows($result);
|
$gencount = MYDB_num_rows($result);
|
||||||
|
$npc = 0;
|
||||||
for ($i=0; $i < $gencount; $i++) {
|
for ($i=0; $i < $gencount; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
// 선택 없으면 맨 처음 장수
|
// 선택 없으면 맨 처음 장수
|
||||||
if ($gen == 0) {
|
if ($gen == 0) {
|
||||||
$gen = $general['no'];
|
$gen = $general['no'];
|
||||||
}
|
}
|
||||||
|
if($gen == $general['no']){
|
||||||
|
$npc = $general['npc'];
|
||||||
|
}
|
||||||
if ($gen == $general['no']) {
|
if ($gen == $general['no']) {
|
||||||
echo "
|
echo "
|
||||||
<option selected value={$general['no']}>{$general['name']}</option>";
|
<option selected value={$general['no']}>{$general['name']}</option>";
|
||||||
@@ -153,11 +156,23 @@ for ($i=0; $i < $gencount; $i++) {
|
|||||||
<?=getBatResRecent($gen, 24)?>
|
<?=getBatResRecent($gen, 24)?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
||||||
<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; id=bg0>
|
||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+41
-14
@@ -37,7 +37,13 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
|||||||
|
|
||||||
$str1 = getTournament($admin['tournament']);
|
$str1 = getTournament($admin['tournament']);
|
||||||
$str2 = getTournamentTime();
|
$str2 = getTournamentTime();
|
||||||
|
if($str2){
|
||||||
|
$str2 = ', '.$str2;
|
||||||
|
}
|
||||||
$str3 = getTournamentTerm();
|
$str3 = getTournamentTerm();
|
||||||
|
if($str3){
|
||||||
|
$str3 = ', '.$str3;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -47,13 +53,13 @@ $str3 = getTournamentTerm();
|
|||||||
} ?>
|
} ?>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||||
<title>베팅장</title>
|
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||||
<style>
|
<style>
|
||||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
table { font-family:'맑은 고딕';}
|
||||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
font { font-family:'맑은 고딕';}
|
||||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
input { font-family:'맑은 고딕';height:20px }
|
||||||
select { font-family:'굴림'; line-height:100%; }
|
select { font-family:'굴림'; }
|
||||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||||
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
|
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
|
||||||
@@ -67,7 +73,7 @@ select { font-family:'굴림'; line-height:100%; }
|
|||||||
</table>
|
</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>
|
<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><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>
|
<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>
|
||||||
<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>
|
<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";
|
$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), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
for ($i=0; $i < 1; $i++) {
|
for ($i=0; $i < 1; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result)??[
|
||||||
|
'npc'=>0,
|
||||||
|
'name'=>'',
|
||||||
|
'win'=>0
|
||||||
|
];
|
||||||
if ($general['name'] == "") {
|
if ($general['name'] == "") {
|
||||||
$general['name'] = "-";
|
$general['name'] = "-";
|
||||||
}
|
}
|
||||||
@@ -102,7 +112,11 @@ for ($i=0; $i < 1; $i++) {
|
|||||||
$cent[$i] = "<font color=white>";
|
$cent[$i] = "<font color=white>";
|
||||||
}
|
}
|
||||||
for ($i=0; $i < 2; $i++) {
|
for ($i=0; $i < 2; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result)??[
|
||||||
|
'npc'=>0,
|
||||||
|
'name'=>'',
|
||||||
|
'win'=>0
|
||||||
|
];
|
||||||
if ($general['name'] == "") {
|
if ($general['name'] == "") {
|
||||||
$general['name'] = "-";
|
$general['name'] = "-";
|
||||||
}
|
}
|
||||||
@@ -143,7 +157,11 @@ for ($i=0; $i < 2; $i++) {
|
|||||||
$cent[$i] = "<font color=white>";
|
$cent[$i] = "<font color=white>";
|
||||||
}
|
}
|
||||||
for ($i=0; $i < 4; $i++) {
|
for ($i=0; $i < 4; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result)??[
|
||||||
|
'npc'=>0,
|
||||||
|
'name'=>'',
|
||||||
|
'win'=>0
|
||||||
|
];
|
||||||
if ($general['name'] == "") {
|
if ($general['name'] == "") {
|
||||||
$general['name'] = "-";
|
$general['name'] = "-";
|
||||||
}
|
}
|
||||||
@@ -184,7 +202,11 @@ for ($i=0; $i < 4; $i++) {
|
|||||||
$cent[$i] = "<font color=white>";
|
$cent[$i] = "<font color=white>";
|
||||||
}
|
}
|
||||||
for ($i=0; $i < 8; $i++) {
|
for ($i=0; $i < 8; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result)??[
|
||||||
|
'npc'=>0,
|
||||||
|
'name'=>'',
|
||||||
|
'win'=>0
|
||||||
|
];
|
||||||
if ($general['name'] == "") {
|
if ($general['name'] == "") {
|
||||||
$general['name'] = "-";
|
$general['name'] = "-";
|
||||||
}
|
}
|
||||||
@@ -225,7 +247,11 @@ for ($i=0; $i < 8; $i++) {
|
|||||||
$cent[$i] = "<font color=white>";
|
$cent[$i] = "<font color=white>";
|
||||||
}
|
}
|
||||||
for ($i=0; $i < 16; $i++) {
|
for ($i=0; $i < 16; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result)??[
|
||||||
|
'npc'=>0,
|
||||||
|
'name'=>'',
|
||||||
|
'win'=>0
|
||||||
|
];
|
||||||
if ($general['name'] == "") {
|
if ($general['name'] == "") {
|
||||||
$general['name'] = "-";
|
$general['name'] = "-";
|
||||||
}
|
}
|
||||||
@@ -268,10 +294,12 @@ for ($i=0; $i < 16; $i++) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0; $i < 16; $i++) {
|
for ($i=0; $i < 16; $i++) {
|
||||||
$bet[$i] = @round($admin['bet'] / $admin["bet{$i}"], 2);
|
if($admin["bet{$i}"] == 0){
|
||||||
if ($bet[$i] == 0) {
|
|
||||||
$bet[$i] = "∞";
|
$bet[$i] = "∞";
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$bet[$i] = round($admin['bet'] / $admin["bet{$i}"], 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=0; $i < 16; $i++) {
|
for ($i=0; $i < 16; $i++) {
|
||||||
@@ -405,6 +433,5 @@ for ($i=0; $i < 4; $i++) {
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if($me['level'] < 5) {
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>기밀실</title>
|
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+14
-11
@@ -58,13 +58,24 @@ $nation = MYDB_fetch_array($result);
|
|||||||
|
|
||||||
$lv = getNationChiefLevel($nation['level']);
|
$lv = getNationChiefLevel($nation['level']);
|
||||||
$turn = [];
|
$turn = [];
|
||||||
$gen = [[],[],[],[],[],[],[],[],[],[],[],[]];
|
|
||||||
for($i=12; $i >= $lv; $i--) {
|
for($i=12; $i >= $lv; $i--) {
|
||||||
$turn[$i] = getCoreTurn($nation, $i);
|
$turn[$i] = getCoreTurn($nation, $i);
|
||||||
|
|
||||||
$query = "select name,turntime,npc from general where level={$i} and nation='{$me['nation']}'";
|
$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),"");
|
$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>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -110,13 +121,6 @@ for($i=12; $i >= $lv; $i--) {
|
|||||||
for($k=0; $k < 2; $k++) {
|
for($k=0; $k < 2; $k++) {
|
||||||
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $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>"; }
|
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>"; }
|
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>"; }
|
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".($gen[$l3]['name']??'')."</font>"; }
|
||||||
@@ -188,7 +192,6 @@ for($k=0; $k < 2; $k++) {
|
|||||||
<tr><td><?=backButton()?></td></tr>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+143
-119
@@ -25,24 +25,39 @@ $query = "select nation,level,spy from nation where nation='{$me['nation']}'";
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$myNation = MYDB_fetch_array($result);
|
$myNation = MYDB_fetch_array($result);
|
||||||
|
|
||||||
|
$templates = new \League\Plates\Engine('templates');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>도시정보</title>
|
<title><?=UniqueConst::$serverName?>: 도시정보</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||||
<link href="../d_shared/common.css" rel="stylesheet">
|
<link href="../d_shared/common.css" rel="stylesheet">
|
||||||
<link href="css/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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<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>
|
<tr><td>도 시 정 보<br><?=backButton()?></td></tr>
|
||||||
</table>
|
</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>
|
<tr>
|
||||||
<td width=998>
|
<td width=998>
|
||||||
<form name=cityselect method=get>도시선택 :
|
<form name=cityselect method=get>도시선택 :
|
||||||
@@ -160,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>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
</table>
|
</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>
|
<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>
|
<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>
|
||||||
<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=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=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=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=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=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>
|
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center id=bg1>민심</td>
|
<td align=center class=bg1>민심</td>
|
||||||
<td align=center><?=$city['rate']?></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><?=$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><?=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><?=$gen1['name']??'-'?></td>
|
||||||
<td align=center id=bg1>군사</td>
|
<td align=center class=bg1>군사</td>
|
||||||
<td align=center><?=$gen2['name']??'-'?></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>
|
<td align=center><?=$gen3['name']??'-'?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center id=bg1>장수</td>
|
<td align=center class=bg1>장수</td>
|
||||||
<td colspan=11>
|
<td colspan=11>
|
||||||
<?php
|
<?php
|
||||||
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
|
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
|
||||||
@@ -212,6 +227,26 @@ if($city['trade'] == 0) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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
|
<?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"; // 장수 목록
|
$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),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -224,127 +259,116 @@ foreach(getAllNationStaticInfo() as $nation){
|
|||||||
$nationlevel[$nation['nation']] = $nation['level'];
|
$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++) {
|
for($j=0; $j < $gencount; $j++) {
|
||||||
$general = MYDB_fetch_array($genresult);
|
$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) {
|
if($general['level'] == 12) {
|
||||||
$lbonus = $nationlevel[$general['nation']] * 2;
|
$leadershipBonus = $nationInfo['level'] * 2;
|
||||||
} elseif($general['level'] >= 5) {
|
} elseif($general['level'] >= 5) {
|
||||||
$lbonus = $nationlevel[$general['nation']];
|
$leadershipBonus = $nationInfo['level'];
|
||||||
} else {
|
} else {
|
||||||
$lbonus = 0;
|
$leadershipBonus = 0;
|
||||||
}
|
}
|
||||||
if($lbonus > 0) {
|
$leadershipBonusText = formatLeadershipBonus($leadershipBonus);
|
||||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
|
||||||
} else {
|
if($ourGeneral){
|
||||||
$lbonus = "";
|
$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) {
|
$nation = $general['nation'];
|
||||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
$nationName = $nationInfo['name'];
|
||||||
$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']}";
|
|
||||||
}
|
|
||||||
|
|
||||||
if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>{$general['name']}</font>"; }
|
if($ourGeneral && !$isNPC){
|
||||||
elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>{$general['name']}</font>"; }
|
$turnText = [];
|
||||||
$imageTemp = GetImageURL($general['imgsvr']);
|
foreach(getTurn($general, 1) as $turnRawIdx=>$turn){
|
||||||
echo "
|
$turnIdx = $turnRawIdx+1;
|
||||||
<tr>
|
$turnText[] = "{$turnIdx} : $turn";
|
||||||
<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;
|
|
||||||
}
|
}
|
||||||
|
$turnText = join('<br>', $turnText);
|
||||||
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> 재 야";
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
echo "
|
$turnText = '';
|
||||||
</td>
|
}
|
||||||
</tr>";
|
|
||||||
|
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>
|
||||||
|
|
||||||
<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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+43
-47
@@ -48,27 +48,27 @@ if ($me['level'] >= 5) {
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<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>
|
<tr><td>내 무 부<br><?=backButton()?></td></tr>
|
||||||
</table>
|
</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 colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=100 align=center id=bg1>국 가 명</td>
|
<td width=100 align=center class=bg1>국 가 명</td>
|
||||||
<td width=50 align=center id=bg1>국력</td>
|
<td width=50 align=center class=bg1>국력</td>
|
||||||
<td width=40 align=center id=bg1>장수</td>
|
<td width=40 align=center class=bg1>장수</td>
|
||||||
<td width=40 align=center id=bg1>속령</td>
|
<td width=40 align=center class=bg1>속령</td>
|
||||||
<td width=80 align=center id=bg1>상태</td>
|
<td width=80 align=center class=bg1>상태</td>
|
||||||
<td width=60 align=center id=bg1>기간</td>
|
<td width=60 align=center class=bg1>기간</td>
|
||||||
<td width=100 align=center id=bg1>종 료 시 점</td>
|
<td width=100 align=center class=bg1>종 료 시 점</td>
|
||||||
<td align=center id=bg1>비 고</td>
|
<td align=center class=bg1>비 고</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$query = "select year,month from game limit 1";
|
$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>
|
<form name=form1 method=post action=c_dipcenter.php>
|
||||||
<tr><td colspan=2 height=10></td></tr>
|
<tr><td colspan=2 height=10></td></tr>
|
||||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</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 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 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>임관 권유 <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>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||||
<tr><td colspan=2 height=10></td></tr>
|
<tr><td colspan=2 height=10></td></tr>
|
||||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<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>
|
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||||
<?php
|
|
||||||
echo "
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 align=center id=bg1>자금 예산</td>
|
<td colspan=2 align=center class=bg1>자금 예산</td>
|
||||||
<td colspan=2 align=center id=bg1>병량 예산</td>
|
<td colspan=2 align=center class=bg1>병량 예산</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=248 align=right id=bg1>현 재 </td>
|
<td width=248 align=right class=bg1>현 재 </td>
|
||||||
<td width=248 align=center>{$nation['gold']}</td>
|
<td width=248 align=center><?=$nation['gold']?></td>
|
||||||
<td width=248 align=right id=bg1>현 재 </td>
|
<td width=248 align=right class=bg1>현 재 </td>
|
||||||
<td width=248 align=center>{$nation['rice']}</td>
|
<td width=248 align=center><?=$nation['rice']?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=right id=bg1>단기수입 </td>
|
<td align=right class=bg1>단기수입 </td>
|
||||||
<td align=center>+$deadIncome</td>
|
<td align=center>+<?=$deadIncome?></td>
|
||||||
<td align=right id=bg1>둔전수입 </td>
|
<td align=right class=bg1>둔전수입 </td>
|
||||||
<td align=center>+$riceincomeList[1]</td>
|
<td align=center>+<?=$riceincomeList[1]?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=right id=bg1>세 금 </td>
|
<td align=right class=bg1>세 금 </td>
|
||||||
<td align=center>+$goldincomeList[0]</td>
|
<td align=center>+<?=$goldincomeList[0]?></td>
|
||||||
<td align=right id=bg1>세 곡 </td>
|
<td align=right class=bg1>세 곡 </td>
|
||||||
<td align=center>+$riceincomeList[0]</td>
|
<td align=center>+<?=$riceincomeList[0]?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=right id=bg1>수입 / 지출 </td>
|
<td align=right class=bg1>수입 / 지출 </td>
|
||||||
<td align=center>+$goldincome / -$goldoutcome</td>
|
<td align=center>+<?=$goldincome?> / -<?=$goldoutcome?></td>
|
||||||
<td align=right id=bg1>수입 / 지출 </td>
|
<td align=right class=bg1>수입 / 지출 </td>
|
||||||
<td align=center>+$riceincome / -$riceoutcome</td>
|
<td align=center>+<?=$riceincome?> / -<?=$riceoutcome?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=right id=bg1>국고 예산 </td>
|
<td align=right class=bg1>국고 예산 </td>
|
||||||
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
|
<td align=center><?=$budgetgold?> (<?=$budgetgolddiff?>)</td>
|
||||||
<td align=right id=bg1>병량 예산 </td>
|
<td align=right class=bg1>병량 예산 </td>
|
||||||
<td align=center>{$budgetrice} ({$budgetricediff})</td>
|
<td align=center><?=$budgetrice?> (<?=$budgetricediff?>)</td>
|
||||||
</tr>";
|
</tr>
|
||||||
?>
|
|
||||||
<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=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>
|
<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>
|
||||||
<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=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>
|
<td align=center>무제한</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -307,10 +304,9 @@ if ($nation['war'] == 0) {
|
|||||||
<tr><td colspan=2 height=10></td></tr>
|
<tr><td colspan=2 height=10></td></tr>
|
||||||
</form>
|
</form>
|
||||||
</table>
|
</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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+4
-5
@@ -16,7 +16,7 @@ $query = "select turnterm from game limit 1";
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$admin = MYDB_fetch_array($result);
|
$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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="../e_lib/jquery-3.2.1.min.js"></script>
|
||||||
<script src="../d_shared/common_path.js"></script>
|
<script src="../d_shared/common_path.js"></script>
|
||||||
<script src="js/common.js"></script>
|
<script src="js/common.js"></script>
|
||||||
@@ -236,10 +236,10 @@ for($i=0; $i < $nationcount; $i++) {
|
|||||||
<td width=698 height=420>
|
<td width=698 height=420>
|
||||||
<?=getMapHtml()?>
|
<?=getMapHtml()?>
|
||||||
</td>
|
</td>
|
||||||
<td width=98 valign=top><?=$nationStr?></td>
|
<td width=101 valign=top><?=$nationStr?></td>
|
||||||
<td width=78 valign=top><?=$powerStr?></td>
|
<td width=78 valign=top><?=$powerStr?></td>
|
||||||
<td width=58 valign=top><?=$genStr?></td>
|
<td width=58 valign=top><?=$genStr?></td>
|
||||||
<td width=58 valign=top><?=$cityStr?></td>
|
<td width=55 valign=top><?=$cityStr?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
@@ -248,6 +248,5 @@ for($i=0; $i < $nationcount; $i++) {
|
|||||||
<tr><td><?=backButton()?></td></tr>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-2
@@ -54,7 +54,7 @@ $sel[$type] = "selected";
|
|||||||
} ?>
|
} ?>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ if($meLevel == 0) {
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -205,7 +205,10 @@ if($meLevel >= 5 && $nation['l11set'] == 0) {
|
|||||||
$query = "select name,city from general where nation='{$me['nation']}' and level='11'";
|
$query = "select name,city from general where nation='{$me['nation']}' and level='11'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
if($general){
|
||||||
|
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
echo "
|
echo "
|
||||||
</td>
|
</td>
|
||||||
@@ -257,7 +260,9 @@ for($i=10; $i >= $lv; $i--) {
|
|||||||
$query = "select name,city from general where nation='{$me['nation']}' and level={$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$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>";
|
echo "</td></form>";
|
||||||
if($i % 2 == 1) { echo "</tr>"; }
|
if($i % 2 == 1) { echo "</tr>"; }
|
||||||
@@ -504,6 +509,5 @@ for($j=0; $j < $citycount; $j++) {
|
|||||||
<tr><td><?=backButton()?></td></tr>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-2
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if($me['level'] == 0) {
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+33
-34
@@ -5,16 +5,12 @@ include "lib.php";
|
|||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
$btn = Util::getReq('btn');
|
$btn = Util::getReq('btn');
|
||||||
$map = Util::getReq('map', 'int', 0);
|
|
||||||
$mode = Util::getReq('mode', 'int', 2);
|
$mode = Util::getReq('mode', 'int', 2);
|
||||||
$tnmt = Util::getReq('tnmt', 'int', 1);
|
$tnmt = Util::getReq('tnmt', 'int', 1);
|
||||||
|
$detachNPC = Util::getReq('detachNPC', 'bool');
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
extractMissingPostToGlobals();
|
||||||
|
|
||||||
if($map < 0 || $map > 2){
|
|
||||||
$map = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($mode < 0 || $mode > 2){
|
if($mode < 0 || $mode > 2){
|
||||||
$mode = 2;
|
$mode = 2;
|
||||||
}
|
}
|
||||||
@@ -32,50 +28,57 @@ $connect=$db->get();
|
|||||||
|
|
||||||
increaseRefresh("내정보", 1);
|
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), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
|
|
||||||
if ($me['myset'] > 0) {
|
if ($me['myset'] > 0) {
|
||||||
$submit = 'submit';
|
$submit = 'submit';
|
||||||
} else {
|
} else {
|
||||||
$submit = 'hidden';
|
$submit = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($btn == "설정저장" && $me['myset'] > 0) {
|
if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||||
if ($me['myset'] > 1) {
|
if ($me['myset'] > 1) {
|
||||||
$submit = 'submit';
|
$submit = 'submit';
|
||||||
} else {
|
} else {
|
||||||
$submit = 'hidden';
|
$submit = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$me['myset'] -= 1;
|
||||||
|
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'myset'=>$db->sqleval('myset-1'),
|
'myset'=>$db->sqleval('myset-1'),
|
||||||
'map'=>$map,
|
|
||||||
'mode'=>$mode,
|
'mode'=>$mode,
|
||||||
'tnmt'=>$tnmt
|
'tnmt'=>$tnmt
|
||||||
], 'owner=%i', $userID);
|
], 'owner=%i', $userID);
|
||||||
}
|
|
||||||
|
|
||||||
$query = "select no,map,mode,tnmt,myset from general where owner='{$userID}'";
|
if($me['npc'] == 1 && $detachNPC){
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
|
||||||
$me = MYDB_fetch_array($result);
|
|
||||||
|
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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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 href="../d_shared/common.css" rel="stylesheet">
|
||||||
<link rel=stylesheet href="css/common.css">
|
<link rel=stylesheet href="css/common.css">
|
||||||
<script type="text/javascript">
|
|
||||||
function go(type) {
|
|
||||||
if(type == 0){
|
|
||||||
location.replace('c_vacation.php');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -89,28 +92,25 @@ function go(type) {
|
|||||||
<?php myInfo(); ?>
|
<?php myInfo(); ?>
|
||||||
<?php myInfo2(); ?>
|
<?php myInfo2(); ?>
|
||||||
</td>
|
</td>
|
||||||
<td width=50% valign=top>
|
<td width=50% valign=top style="padding-left:4ch;">
|
||||||
<form name=form1 action=b_myPage.php method=post>
|
<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=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
|
||||||
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
|
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
|
||||||
】<br>
|
】<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=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
|
||||||
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
|
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
|
||||||
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
|
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
|
||||||
】<br><br>
|
】<br><br>
|
||||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><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>
|
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||||
</form>
|
</form>
|
||||||
휴 가 신 청<br>
|
휴 가 신 청<br>
|
||||||
<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=휴가신청 onclick='go(0)'>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -142,7 +142,6 @@ function go(type) {
|
|||||||
<tr><td><?=backButton()?></td></tr>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?></td></tr>
|
<tr><td><?=banner()?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ $me = MYDB_fetch_array($result);
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>회의실</title>
|
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ increaseRefresh("국법", 1);
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>국법</title>
|
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+11
-6
@@ -43,12 +43,12 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
|||||||
} ?>
|
} ?>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||||
<title>토너먼트</title>
|
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
|
||||||
<style>
|
<style>
|
||||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
table { font-family:'맑은 고딕'; }
|
||||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
font { font-family:'맑은 고딕'; }
|
||||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
input { font-family:'맑은 고딕'; height:20px }
|
||||||
select { font-family:'굴림'; line-height:100%; }
|
select { font-family:'굴림'; line-height:100%; }
|
||||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||||
@@ -176,10 +176,16 @@ if ($session->userGrade >= 5) {
|
|||||||
|
|
||||||
$str1 = getTournament($admin['tournament']);
|
$str1 = getTournament($admin['tournament']);
|
||||||
$str2 = getTournamentTime();
|
$str2 = getTournamentTime();
|
||||||
|
if($str2){
|
||||||
|
$str2 = ', '.$str2;
|
||||||
|
}
|
||||||
$str3 = getTournamentTerm();
|
$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>운영자 메세지 : <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 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>
|
<tr><td height=10 colspan=8 align=center></td></tr>
|
||||||
<?php
|
<?php
|
||||||
@@ -504,6 +510,5 @@ if ($admin['tournament'] == 2 || $admin['tournament'] == 3) {
|
|||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+4
-3
@@ -25,7 +25,7 @@ $troopcount = MYDB_num_rows($result);
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<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='../d_shared/common.css' type='text/css'>
|
||||||
<link rel='stylesheet' href='css/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"
|
echo"
|
||||||
<input type=submit name=btn value='부 대 가 입'>";
|
<input type=submit name=btn value='부 대 가 입'>";
|
||||||
} else {
|
} else {
|
||||||
@@ -158,7 +160,6 @@ echo "
|
|||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
+26
-20
@@ -32,37 +32,43 @@ if($me['level'] < 5) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "국가방침") {
|
if($btn == "국가방침") {
|
||||||
$msg = BadTag2Code(addslashes(SQ2DQ($msg)));
|
$msg == mb_substr($msg, 0, 1000);
|
||||||
$query = "update nation set msg='$msg' where nation='{$me['nation']}'";
|
//$msg = StringUtil::
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->update('nation', [
|
||||||
|
'msg'=>BadTag2Code($msg)
|
||||||
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "임관권유") {
|
} elseif($btn == "임관권유") {
|
||||||
$scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg)));
|
$scoutmsg == mb_substr($msg, 0, 500);
|
||||||
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
|
$db->update('nation', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'scoutmsg'=>BadTag2Code($scoutmsg)
|
||||||
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "세율") {
|
} elseif($btn == "세율") {
|
||||||
if($rate < 5) { $rate = 5; }
|
if($rate < 5) { $rate = 5; }
|
||||||
if($rate > 30) { $rate = 30; }
|
if($rate > 30) { $rate = 30; }
|
||||||
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
} elseif($btn == "지급율") {
|
} elseif($btn == "지급율") {
|
||||||
if($bill < 20) { $bill = 20; }
|
$bill = Util::valueFit($bill, 20, 200);
|
||||||
if($bill > 200) { $bill = 200; }
|
$db->update('nation', [
|
||||||
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
|
'bill'=>$bill
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "기밀권한") {
|
} elseif($btn == "기밀권한") {
|
||||||
if($secretlimit < 1) { $secretlimit = 1; }
|
$secretlimit = Util::valueFit($secretlimit, 1, 99);
|
||||||
if($secretlimit > 99) { $secretlimit = 99; }
|
$db->update('nation', [
|
||||||
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
|
'secretlimit'=>$secretlimit
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "임관 금지") {
|
} elseif($btn == "임관 금지") {
|
||||||
$query = "update nation set scout='1' where nation='{$me['nation']}'";
|
$db->update('nation', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'scout'=>1
|
||||||
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "임관 허가") {
|
} elseif($btn == "임관 허가") {
|
||||||
$query = "update nation set scout='0' where nation='{$me['nation']}'";
|
$db->update('nation', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'scout'=>0
|
||||||
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "전쟁 금지") {
|
} elseif($btn == "전쟁 금지") {
|
||||||
$query = "update nation set war='1' where nation='{$me['nation']}'";
|
$db->update('nation', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'war'=>1
|
||||||
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "전쟁 허가") {
|
} elseif($btn == "전쟁 허가") {
|
||||||
$query = "update nation set war='0' where nation='{$me['nation']}'";
|
$query = "update nation set war='0' where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
+31
-11
@@ -20,7 +20,7 @@ $userID = Session::getUserID();
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$admin = MYDB_fetch_array($result);
|
$admin = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -41,17 +41,20 @@ if($meLevel < 5){
|
|||||||
|
|
||||||
|
|
||||||
if($btn == "임명") {
|
if($btn == "임명") {
|
||||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
if($genlist !== 0){
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||||
$general = MYDB_fetch_array($result);
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
$general = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if(!$general){
|
if(!$general){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php');
|
||||||
exit();
|
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');
|
header('location:b_myBossInfo.php');
|
||||||
exit();
|
exit();
|
||||||
@@ -74,13 +77,13 @@ if($btn == "임명") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//나와 대상 장수는 국가가 같아야 함
|
//나와 대상 장수는 국가가 같아야 함
|
||||||
if($me['nation'] != $general['nation']){
|
if($genlist != 0 && $me['nation'] != $general['nation']){
|
||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "추방") {
|
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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$nation = MYDB_fetch_array($result);
|
$nation = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -165,7 +168,24 @@ if($btn == "추방") {
|
|||||||
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
|
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');
|
$title = Util::getReq('title');
|
||||||
$msg = Util::getReq('msg');
|
$msg = Util::getReq('msg');
|
||||||
$num = Util::getReq('num', 'int');
|
$num = Util::getReq('num', 'int');
|
||||||
|
$reply = Util::getReq('reply');
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
extractMissingPostToGlobals();
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ if($btn == '참가') {
|
|||||||
}
|
}
|
||||||
$map = [];
|
$map = [];
|
||||||
for($i=0; $i < 8; $i++) {
|
for($i=0; $i < 8; $i++) {
|
||||||
if($occupied[$i] == 0) {
|
if(!Util::array_get($occupied[$i])) {
|
||||||
$map[] = $i;
|
$map[] = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}'";
|
$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
if(!$me){
|
||||||
|
echo "로그인 되어있지 않습니다.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
$turn = getTurn($me, 2);
|
$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>
|
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{
|
html, body{
|
||||||
background-color:black;
|
background-color:black;
|
||||||
color:white;
|
color:white;
|
||||||
|
line-height:1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
table { font-family:'맑은 고딕'; line-height:110%; }
|
table { font-family:'맑은 고딕'; }
|
||||||
font { font-family:'맑은 고딕'; line-height:110%; }
|
font { font-family:'맑은 고딕'; }
|
||||||
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
|
input { font-family:'맑은 고딕'; font-size:13px; }
|
||||||
select { font-family:'굴림'; line-height:100%; }
|
select { font-family:'굴림'; line-height:100%; }
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
+20
-2
@@ -9,6 +9,11 @@
|
|||||||
}
|
}
|
||||||
/*임시용 끝*/
|
/*임시용 끝*/
|
||||||
|
|
||||||
|
#message_board{
|
||||||
|
height:1370px;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
|
||||||
#message_board section{
|
#message_board section{
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
overflow-x:hidden;
|
overflow-x:hidden;
|
||||||
@@ -70,19 +75,32 @@
|
|||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message_input_form{
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
|
||||||
#msg_input{
|
#msg_input{
|
||||||
color:white;
|
color:white;
|
||||||
background-color:black;
|
background-color:black;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
width:720px;
|
width:715px;
|
||||||
|
margin:0 2px;
|
||||||
height:15px;
|
height:15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#msg_submit{
|
||||||
|
position:absolute;
|
||||||
|
right:0;
|
||||||
|
margin-right:2px;
|
||||||
|
}
|
||||||
|
|
||||||
#mailbox_list{
|
#mailbox_list{
|
||||||
|
float:left;
|
||||||
color:white;
|
color:white;
|
||||||
background-color:black;
|
background-color:black;
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
width:160px;
|
width:160px;
|
||||||
|
height:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.board_header{
|
.board_header{
|
||||||
@@ -91,10 +109,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.board_side{
|
.board_side{
|
||||||
|
position:absolute;
|
||||||
height:1370px;
|
height:1370px;
|
||||||
width:498px;
|
width:498px;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
display:inline-block;
|
|
||||||
border-left:groove 1px;
|
border-left:groove 1px;
|
||||||
border-right:groove 1px;
|
border-right:groove 1px;
|
||||||
border-bottom:groove 1px;
|
border-bottom:groove 1px;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ namespace sammo;
|
|||||||
|
|
||||||
class UniqueConst{
|
class UniqueConst{
|
||||||
public static $serverID = '_tK_serverID_';
|
public static $serverID = '_tK_serverID_';
|
||||||
|
public static $serverName = '_tK_serverName_';
|
||||||
|
|
||||||
private function __construct(){}
|
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
-76
@@ -556,15 +556,13 @@ function commandTable() {
|
|||||||
} else {
|
} else {
|
||||||
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
||||||
}
|
}
|
||||||
//TODO:등용장 재 디자인
|
|
||||||
//xxx:등용장 일단 끔
|
|
||||||
/*
|
|
||||||
if($me['level'] >= 1 && $city['supply'] != 0) {
|
if($me['level'] >= 1 && $city['supply'] != 0) {
|
||||||
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
||||||
} else {
|
} else {
|
||||||
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
if($me['no'] == $troop['no'] && $citycount > 0 && $city['supply'] != 0 && $city['nation'] == $me['nation']) {
|
if($me['no'] == $troop['no'] && $citycount > 0 && $city['supply'] != 0 && $city['nation'] == $me['nation']) {
|
||||||
addCommand("집합(통솔경험)", 26);
|
addCommand("집합(통솔경험)", 26);
|
||||||
} else {
|
} else {
|
||||||
@@ -646,7 +644,13 @@ function commandTable() {
|
|||||||
if($me['level'] == 12) {
|
if($me['level'] == 12) {
|
||||||
addCommand("선양", 54);
|
addCommand("선양", 54);
|
||||||
if($citycount != 0) {
|
if($citycount != 0) {
|
||||||
addCommand("방랑", 47);
|
if ($admin['year'] + 3 < $admin['startyear']) {
|
||||||
|
addCommand("방랑", 47, 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
addCommand("방랑", 47);
|
||||||
|
}
|
||||||
|
|
||||||
addCommand("해산", 56, 0);
|
addCommand("해산", 56, 0);
|
||||||
} else {
|
} else {
|
||||||
addCommand("방랑", 47, 0);
|
addCommand("방랑", 47, 0);
|
||||||
@@ -998,11 +1002,17 @@ function generalInfo2($no) {
|
|||||||
if($dex30 > 100) { $dex30 = 100; }
|
if($dex30 > 100) { $dex30 = 100; }
|
||||||
if($dex40 > 100) { $dex40 = 100; }
|
if($dex40 > 100) { $dex40 = 100; }
|
||||||
|
|
||||||
$general['dex0'] = getDexCall($general['dex0']);
|
$general['dex0_text'] = getDexCall($general['dex0']);
|
||||||
$general['dex10'] = getDexCall($general['dex10']);
|
$general['dex10_text'] = getDexCall($general['dex10']);
|
||||||
$general['dex20'] = getDexCall($general['dex20']);
|
$general['dex20_text'] = getDexCall($general['dex20']);
|
||||||
$general['dex30'] = getDexCall($general['dex30']);
|
$general['dex30_text'] = getDexCall($general['dex30']);
|
||||||
$general['dex40'] = getDexCall($general['dex40']);
|
$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>
|
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>
|
<tr><td align=center colspan=6 id=bg1><b>추 가 정 보</b></td></tr>
|
||||||
@@ -1038,30 +1048,35 @@ function generalInfo2($no) {
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
<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>
|
<tr height=16>
|
||||||
<td width=64 align=center id=bg1><b>보병</b></td>
|
<td width=64 align=center id=bg1><b>보병</b></td>
|
||||||
<td width=64> {$general['dex0']}</td>
|
<td width=40> {$general['dex0_text']}</td>
|
||||||
<td width=366 align=center>".bar($dex0, 16)."</td>
|
<td width=60 align=right>{$general['dex0_short']} </td>
|
||||||
|
<td width=330 align=center>".bar($dex0, 16)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height=16>
|
<tr height=16>
|
||||||
<td align=center id=bg1><b>궁병</b></td>
|
<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>
|
<td align=center>".bar($dex10, 16)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height=16>
|
<tr height=16>
|
||||||
<td align=center id=bg1><b>기병</b></td>
|
<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>
|
<td align=center>".bar($dex20, 16)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height=16>
|
<tr height=16>
|
||||||
<td align=center id=bg1><b>귀병</b></td>
|
<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>
|
<td align=center>".bar($dex30, 16)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height=16>
|
<tr height=16>
|
||||||
<td align=center id=bg1><b>차병</b></td>
|
<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>
|
<td align=center>".bar($dex40, 16)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>";
|
</table>";
|
||||||
@@ -1128,23 +1143,6 @@ function nationMsg() {
|
|||||||
echo "<font color=orange>".$nation['msg']."</font>";
|
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) {
|
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
@@ -1264,6 +1262,7 @@ function cutDay($date, int $turnterm) {
|
|||||||
function increaseRefresh($type="", $cnt=1) {
|
function increaseRefresh($type="", $cnt=1) {
|
||||||
//FIXME: 로그인, 비로그인 시 처리가 명확하지 않음
|
//FIXME: 로그인, 비로그인 시 처리가 명확하지 않음
|
||||||
$session = Session::getInstance();
|
$session = Session::getInstance();
|
||||||
|
$userID = $session->userID;
|
||||||
$generalID = $session->generalID;
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
@@ -1280,14 +1279,14 @@ function increaseRefresh($type="", $cnt=1) {
|
|||||||
'connect'=>$db->sqleval('connect + %i', $cnt),
|
'connect'=>$db->sqleval('connect + %i', $cnt),
|
||||||
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
|
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
|
||||||
'refresh'=>$db->sqleval('refresh + %i', $cnt)
|
'refresh'=>$db->sqleval('refresh + %i', $cnt)
|
||||||
], 'owner=%i', $generalID);
|
], 'owner=%i', $userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = date('Y_m_d H:i:s');
|
$date = date('Y_m_d H:i:s');
|
||||||
$date2 = substr($date, 0, 10);
|
$date2 = substr($date, 0, 10);
|
||||||
$online = getOnlineNum();
|
$online = getOnlineNum();
|
||||||
file_put_contents(
|
file_put_contents(
|
||||||
"logs/_{$date2}_refresh.txt",
|
__dir__."/logs/_{$date2}_refresh.txt",
|
||||||
sprintf(
|
sprintf(
|
||||||
"%s, %s, %s, %s, %s, %d\n",
|
"%s, %s, %s, %s, %s, %d\n",
|
||||||
$date,
|
$date,
|
||||||
@@ -1324,7 +1323,7 @@ function increaseRefresh($type="", $cnt=1) {
|
|||||||
}
|
}
|
||||||
if($str != "") {
|
if($str != "") {
|
||||||
file_put_contents(
|
file_put_contents(
|
||||||
"logs/_{$date2}_ipcheck.txt",
|
__dir__."/logs/_{$date2}_ipcheck.txt",
|
||||||
sprintf(
|
sprintf(
|
||||||
"%s, %s, %s%s\n",
|
"%s, %s, %s%s\n",
|
||||||
$session->userName,
|
$session->userName,
|
||||||
@@ -1361,19 +1360,21 @@ function updateTraffic() {
|
|||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
//일시|년|월|총갱신|접속자|최다갱신자
|
//일시|년|월|총갱신|접속자|최다갱신자
|
||||||
file_put_contents(__dir__."/logs/_traffic.txt",
|
file_put_contents(__dir__."/logs/_traffic.txt",
|
||||||
StringUtil::padStringAlignRight($date,20," ")
|
Json::encode([
|
||||||
."|".StringUtil::padStringAlignRight($game['year'],3," ")
|
$date,
|
||||||
."|".StringUtil::padStringAlignRight($game['month'],2," ")
|
$game['year'],
|
||||||
."|".StringUtil::padStringAlignRight($game['refresh'],8," ")
|
$game['month'],
|
||||||
."|".StringUtil::padStringAlignRight($online,5," ")
|
$game['refresh'],
|
||||||
."|".StringUtil::padStringAlignRight($user['name']."(".$user['refresh'].")",20," ")
|
$online,
|
||||||
|
$user['name']."(".$user['refresh'].")"
|
||||||
|
])."\n"
|
||||||
, FILE_APPEND);
|
, FILE_APPEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckOverhead() {
|
function CheckOverhead() {
|
||||||
//서버정보
|
//서버정보
|
||||||
$db = DB::db();
|
$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;
|
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
|
||||||
|
|
||||||
@@ -1523,7 +1524,7 @@ function checkTurn() {
|
|||||||
|
|
||||||
// 파일락 획득
|
// 파일락 획득
|
||||||
//FIXME:이미 DB 테이블로 lock을 시도하는데 이게 따로 필요한가?
|
//FIXME:이미 DB 테이블로 lock을 시도하는데 이게 따로 필요한가?
|
||||||
$fp = fopen('lock.txt', 'r');
|
$fp = fopen(__dir__.'/lock.txt', 'r');
|
||||||
if(!flock($fp, LOCK_EX)) {
|
if(!flock($fp, LOCK_EX)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1786,25 +1787,27 @@ function addAge() {
|
|||||||
|
|
||||||
function turnDate($curtime) {
|
function turnDate($curtime) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$query = "select startyear,starttime,turnterm,year,month from game limit 1";
|
$admin = $db->queryFirstRow('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);
|
|
||||||
|
|
||||||
$turn = $admin['starttime'];
|
$turn = $admin['starttime'];
|
||||||
$curturn = cutTurn($curtime, $admin['turnterm']);
|
$curturn = cutTurn($curtime, $admin['turnterm']);
|
||||||
$num = 0;
|
$term = $admin['turnterm'];
|
||||||
$term = $admin['turnterm']*60;
|
|
||||||
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term);
|
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term*60);
|
||||||
|
|
||||||
$year = $admin['startyear'] + intdiv($num, 12);
|
$date = $admin['startyear'] * 12;
|
||||||
$month = 1 + (12+$num) % 12;
|
$date += $num;
|
||||||
|
|
||||||
|
$year = intdiv($date, 12);
|
||||||
|
$month = 1 + $date % 12;
|
||||||
|
|
||||||
// 바뀐 경우만 업데이트
|
// 바뀐 경우만 업데이트
|
||||||
if($admin['month'] != $month || $admin['year'] != $year) {
|
if($admin['month'] != $month || $admin['year'] != $year) {
|
||||||
$query = "update game set year='$year',month='$month'";
|
$db->update('game', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'year'=>$year,
|
||||||
|
'month'=>$month
|
||||||
|
], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [$year, $month];
|
return [$year, $month];
|
||||||
@@ -1821,8 +1824,8 @@ function triggerTournament() {
|
|||||||
|
|
||||||
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
||||||
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
|
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
|
||||||
$type = rand() % 6; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||||
//전력전 50%, 통, 일, 설 각 17%
|
//전력전 40%, 통, 일, 설 각 20%
|
||||||
if($type > 3) { $type = 0; }
|
if($type > 3) { $type = 0; }
|
||||||
startTournament($admin['tnmt_trig'], $type);
|
startTournament($admin['tnmt_trig'], $type);
|
||||||
}
|
}
|
||||||
@@ -2204,11 +2207,11 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$occupied[$gen[$type]] = 1;
|
$occupied[$gen[$type]] = 1;
|
||||||
}
|
}
|
||||||
for($i=7; $i <= 26; $i++) {
|
for($i=7; $i <= 26; $i++) {
|
||||||
if($occupied[$i] == 0) {
|
if(!Util::array_get($occupied[$i])) {
|
||||||
$item[] = $i;
|
$item[] = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$it = $item[rand() % count($item)];
|
$it = $item[rand() % count($item)]??0;
|
||||||
|
|
||||||
$query = "update general set {$type}='$it' where no='{$general['no']}'";
|
$query = "update general set {$type}='$it' where no='{$general['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -2221,13 +2224,13 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
|
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
|
||||||
if($vote == 0) {
|
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) {
|
} 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) {
|
} 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) {
|
} 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;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2235,13 +2238,13 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
|
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
|
||||||
if($vote == 0) {
|
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) {
|
} 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) {
|
} 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) {
|
} 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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -2249,13 +2252,13 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
|
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
|
||||||
if($vote == 0) {
|
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) {
|
} 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) {
|
} 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) {
|
} 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;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
@@ -2263,13 +2266,13 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
|
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
|
||||||
if($vote == 0) {
|
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) {
|
} 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) {
|
} 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) {
|
} 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;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-10
@@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
function getTurn($general, $type, $font=1) {
|
function getTurn(array $general, $type, $font=1) {
|
||||||
|
//TODO: 왜 'Type' 인가. 그냥 count로 하자.
|
||||||
$str = [];
|
$str = [];
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
@@ -532,13 +533,15 @@ function processCommand($no) {
|
|||||||
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
|
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']}'";
|
$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),"");
|
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']}'";
|
$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),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
} else {
|
} else {
|
||||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$admin['killturn']}' where no='{$general['no']}'";
|
$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),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
|
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
|
||||||
|
|
||||||
//연속턴 아닌경우 텀 리셋
|
//연속턴 아닌경우 텀 리셋
|
||||||
if($general['term']%100 != $command[0]) {
|
if($general['term']%100 != $command[0]) {
|
||||||
$query = "update general set term=0 where no='{$general['no']}'";
|
$query = "update general set term=0 where no='{$general['no']}'";
|
||||||
@@ -570,7 +573,7 @@ function processCommand($no) {
|
|||||||
case 17: process_17($general); break; //소집해제
|
case 17: process_17($general); break; //소집해제
|
||||||
|
|
||||||
case 21: process_21($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 25: process_25($general); break; //임관
|
||||||
case 26: process_26($general); break; //집합
|
case 26: process_26($general); break; //집합
|
||||||
case 28: process_28($general); break; //귀환
|
case 28: process_28($general); break; //귀환
|
||||||
@@ -681,19 +684,21 @@ where nation='{$general['nation']}'
|
|||||||
|
|
||||||
|
|
||||||
function command_Single($turn, $command) {
|
function command_Single($turn, $command) {
|
||||||
|
if(!$turn){
|
||||||
|
header('location:commandlist.php');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
$command = EncodeCommand(0, 0, 0, $command);
|
$command = EncodeCommand(0, 0, 0, $command);
|
||||||
|
|
||||||
$count = count($turn);
|
$setValues = [];
|
||||||
$str = "con=con";
|
foreach($turn as $turnIdx){
|
||||||
for($i=0; $i < $count; $i++) {
|
$setValues["turn{$turnIdx}"] = $command;
|
||||||
$str .= ",turn{$turn[$i]}='{$command}'";
|
|
||||||
}
|
}
|
||||||
$query = "update general set {$str} where owner='{$userID}'";
|
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
header('location:commandlist.php');
|
header('location:commandlist.php');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -397,9 +397,6 @@ function getBill(int $dedication) : int{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCost(int $armtype) : int {
|
function getCost(int $armtype) : int {
|
||||||
//FIXME: 정말로 side effect가 없으려면 query는 밖으로 이동해야함.
|
|
||||||
//TODO: 병종 값이 column으로 들어있는건 전혀 옳지 않음. key->value 형태로 바꿔야함
|
|
||||||
|
|
||||||
return GameUnitConst::byID($armtype)->cost;
|
return GameUnitConst::byID($armtype)->cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -5,7 +5,7 @@ namespace sammo;
|
|||||||
|
|
||||||
function delStepLog() {
|
function delStepLog() {
|
||||||
$date = date('Y_m_d');
|
$date = date('Y_m_d');
|
||||||
@unlink("logs/_{$date}_steplog.txt");
|
@unlink(__dir__."/logs/_{$date}_steplog.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushRawFileLog($path, $lines){
|
function pushRawFileLog($path, $lines){
|
||||||
@@ -50,81 +50,81 @@ function eraseTnmtFightLogAll(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function eraseTnmtFightLog(int $group){
|
function eraseTnmtFightLog(int $group){
|
||||||
$filepath = "logs/fight{$group}.txt";
|
$filepath = __dir__."/logs/fight{$group}.txt";
|
||||||
if(file_exists($filepath)){
|
if(file_exists($filepath)){
|
||||||
@unlink($filepath);
|
@unlink($filepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushTnmtFightLog(int $group, $log) {
|
function pushTnmtFightLog(int $group, $log) {
|
||||||
pushRawFileLog("logs/fight{$group}.txt", $log);
|
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTnmtFightLogAll(int $group) {
|
function getTnmtFightLogAll(int $group) {
|
||||||
return join('<br>',getFormattedFileLogAll("logs/fight{$group}.txt"));
|
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushSabotageLog($log) {
|
function pushSabotageLog($log) {
|
||||||
pushRawFileLog("logs/_sabotagelog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSabotageLogRecent($count) {
|
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) {
|
function pushProcessLog($log) {
|
||||||
$date = date('Y_m_d');
|
$date = date('Y_m_d');
|
||||||
pushRawFileLog("logs/_{$date}_processlog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function pushStepLog($log) {
|
function pushStepLog($log) {
|
||||||
$date = date('Y_m_d');
|
$date = date('Y_m_d');
|
||||||
pushRawFileLog("logs/_{$date}_steplog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushLockLog($log) {
|
function pushLockLog($log) {
|
||||||
$date = date('Y_m_d');
|
$date = date('Y_m_d');
|
||||||
pushRawFileLog("logs/_{$date}_locklog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushAdminLog($log) {
|
function pushAdminLog($log) {
|
||||||
pushRawFileLog("logs/_adminlog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushAuctionLog($log) {
|
function pushAuctionLog($log) {
|
||||||
pushRawFileLog("logs/_auctionlog.txt", $log);
|
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAuctionLogRecent(int $count) {
|
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) {
|
function pushGenLog($general, $log) {
|
||||||
$no = Util::toInt($general['no']);
|
$no = Util::toInt($general['no']);
|
||||||
pushRawFileLog("logs/gen{$no}.txt", $log);
|
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGenLogRecent(int $no, int $count) {
|
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) {
|
function pushBatRes($general, $log) {
|
||||||
$no = Util::toInt($general['no']);
|
$no = Util::toInt($general['no']);
|
||||||
pushRawFileLog("logs/batres{$no}.txt", $log);
|
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBatResRecent(int $no, int $count) {
|
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) {
|
function pushBatLog($general, $log) {
|
||||||
$no = Util::toInt($general['no']);
|
$no = Util::toInt($general['no']);
|
||||||
pushRawFileLog("logs/batlog{$no}.txt", $log);
|
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBatLogRecent(int $no, int $count) {
|
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
|
//DB-based
|
||||||
|
|||||||
+12
-7
@@ -51,7 +51,7 @@ function getWorldMap($req){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$session = Session::getInstance();
|
$session = Session::getInstance();
|
||||||
$generalID = $session->generalID;
|
$userID = $session->userID;
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
@@ -60,13 +60,18 @@ function getWorldMap($req){
|
|||||||
$year = Util::toInt($game['year']);
|
$year = Util::toInt($game['year']);
|
||||||
$month = Util::toInt($game['month']);
|
$month = Util::toInt($game['month']);
|
||||||
|
|
||||||
if($generalID && ($req->showMe || !$req->neutralView)){
|
$general = $db->queryFirstRow(
|
||||||
$city = $db->queryFirstRow(
|
'select `no`, `city`, `nation` from `general` where `owner`=%i',
|
||||||
'select `city`, `nation` from `general` where `no`=%i',
|
$userID);
|
||||||
$generalID);
|
|
||||||
|
|
||||||
$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){
|
if(!$req->showMe){
|
||||||
$myCity = null;
|
$myCity = null;
|
||||||
|
|||||||
+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']}'";
|
$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),"");
|
$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();
|
$coreCommand = array();
|
||||||
if($general['level'] >= 5) {
|
if($general['level'] >= 5) {
|
||||||
@@ -261,6 +269,7 @@ function processAI($no) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tech = getTechCost($nation['tech']);
|
$tech = getTechCost($nation['tech']);
|
||||||
|
$resrc = $tech * 700;//XXX: 왜 700이지?
|
||||||
|
|
||||||
if($general['atmos'] >= 90 && $general['train'] >= 90) {
|
if($general['atmos'] >= 90 && $general['train'] >= 90) {
|
||||||
if($general['mode'] == 0) {
|
if($general['mode'] == 0) {
|
||||||
@@ -276,20 +285,26 @@ function processAI($no) {
|
|||||||
|
|
||||||
//운영자메시지 출력 하루 6번..?
|
//운영자메시지 출력 하루 6번..?
|
||||||
//특별 메세지 있는 경우 출력 하루 4번
|
//특별 메세지 있는 경우 출력 하루 4번
|
||||||
switch($admin['turnterm']) {
|
$term = $admin['turnterm'];
|
||||||
case 0: $term = 1; break;
|
if($general['npcmsg'] && Util::randBool($term / (6*60))) {
|
||||||
case 1: $term = 1; break;
|
$src = new MessageTarget(
|
||||||
case 2: $term = 2; break;
|
$general['no'],
|
||||||
case 3: $term = 3; break;
|
$general['name'],
|
||||||
case 4: $term = 6; break;
|
$general['nation'],
|
||||||
case 5: $term = 12; break;
|
$nation['name'],
|
||||||
case 6: $term = 30; break;
|
$nation['color'],
|
||||||
case 7: $term = 60; break;
|
GetImageURL($general['imgsvr'], $general['picture'])
|
||||||
}
|
);
|
||||||
if($general['npcid'] == 2000 && rand()%(24*$term) < 6) {
|
$msg = new Message(
|
||||||
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
|
Message::MSGTYPE_PUBLIC,
|
||||||
} elseif($general['npcmsg'] != "" && rand()%(24*$term) < 3) {
|
$src,
|
||||||
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
|
$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; }
|
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
|
||||||
else { $type = "rice"; $type2 = 2; }
|
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";
|
list($npcGenID, $npcGenValue) = $db->queryFirstList(
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc >= 2 ORDER BY %b DESC LIMIT 1',
|
||||||
$SelGen = MYDB_fetch_array($result);
|
$type,
|
||||||
if($SelGen['no'] != 0) {
|
$general['nation'],
|
||||||
$amount = intdiv($SelGen[$type], 5000)*10 + 10;
|
$general['no'],
|
||||||
if($amount > 100) $amount = 100;
|
$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 { // 포상
|
} else { // 포상
|
||||||
// 포상 대상
|
// 포상 대상
|
||||||
$query = "select no from general where nation='{$general['nation']}' and no!='{$general['no']}' and killturn>=5 order by {$type} limit 0,1";
|
list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList(
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
'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',
|
||||||
$SelGen = MYDB_fetch_array($result);
|
$type,
|
||||||
if($SelGen['no'] != 0) {
|
$general['nation'],
|
||||||
$amount = intdiv(($nation[$type]-GameConst::$baserice), 5000)*10 + 10;
|
$general['no'],
|
||||||
if($amount > 100) $amount = 100;
|
$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']}'";
|
if(isset($command)){
|
||||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
$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),"");
|
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
|
||||||
return;
|
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) {
|
if($nation['rice'] < 2000 && $general['rice'] > 200) {
|
||||||
$amount = intdiv($general['rice'] - 200, 100) + 1;
|
$amount = intdiv($general['rice'] - 200, 100) + 1;
|
||||||
@@ -653,7 +768,7 @@ function processAI($no) {
|
|||||||
// ┃조┃ ┃쌀삼
|
// ┃조┃ ┃쌀삼
|
||||||
// 0┗━┻━━━━┻━━━> G
|
// 0┗━┻━━━━┻━━━> G
|
||||||
// 100 700
|
// 100 700
|
||||||
$resrc = $tech * 700;
|
|
||||||
$target = array();
|
$target = array();
|
||||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||||
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 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
|
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['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
|
||||||
elseif($general['gold'] < 100) { //금없으면 쌀팜
|
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); //팜
|
$command = EncodeCommand(0, 1, $amount, 49); //팜
|
||||||
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||||
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
|
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); //삼
|
$command = EncodeCommand(0, 2, $amount, 49); //삼
|
||||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||||
else {
|
else {
|
||||||
@@ -743,12 +858,12 @@ function processAI($no) {
|
|||||||
else { $command = EncodeCommand(0, 0, 0, 1); }
|
else { $command = EncodeCommand(0, 0, 0, 1); }
|
||||||
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
|
} 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); }//삼
|
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
|
||||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||||
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
|
} 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); }//팜
|
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
|
||||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
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'] < 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['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||||
elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
|
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); }// 팜
|
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
|
||||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||||
} elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
|
} 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); }// 팜
|
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
|
||||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||||
|
|||||||
+27
-9
@@ -13,6 +13,9 @@ namespace sammo;
|
|||||||
* @return int|float 계산된 능력치
|
* @return int|float 계산된 능력치
|
||||||
*/
|
*/
|
||||||
function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||||
|
if($general === null){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
$leadership = $general['leader'];
|
$leadership = $general['leader'];
|
||||||
if($withInjury){
|
if($withInjury){
|
||||||
$leadership *= (100 - $general['injury']) / 100;
|
$leadership *= (100 - $general['injury']) / 100;
|
||||||
@@ -47,6 +50,9 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
|
|||||||
* @return int|float 계산된 능력치
|
* @return int|float 계산된 능력치
|
||||||
*/
|
*/
|
||||||
function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||||
|
if($general === null){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
$power = $general['power'];
|
$power = $general['power'];
|
||||||
if($withInjury){
|
if($withInjury){
|
||||||
$power *= (100 - $general['injury']) / 100;
|
$power *= (100 - $general['injury']) / 100;
|
||||||
@@ -78,6 +84,10 @@ function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $us
|
|||||||
* @return int|float 계산된 능력치
|
* @return int|float 계산된 능력치
|
||||||
*/
|
*/
|
||||||
function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
|
||||||
|
if($general === null){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$intel = $general['intel'];
|
$intel = $general['intel'];
|
||||||
if($withInjury){
|
if($withInjury){
|
||||||
$intel *= (100 - $general['injury']) / 100;
|
$intel *= (100 - $general['injury']) / 100;
|
||||||
@@ -1673,7 +1683,16 @@ function process_31(&$general) {
|
|||||||
$typecount = [];
|
$typecount = [];
|
||||||
for($i=0; $i < $gencount; $i++) {
|
for($i=0; $i < $gencount; $i++) {
|
||||||
$gen = MYDB_fetch_array($result);
|
$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)) {
|
if(!key_exists($destination, $dist)) {
|
||||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
$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</>";
|
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
|
||||||
$msg[] = "【<S>병종</>】";
|
$msg[] = "【<S>병종</>】";
|
||||||
|
|
||||||
foreach(GameUnitConst::all() as $unit){
|
foreach($typecount as $crewtype=>$cnt){
|
||||||
if($typecount[$unit->id] == 0){
|
$crewtypeText = mb_substr(GameUnitConst::byID($crewtype)->name, 0, 2);
|
||||||
continue;
|
$msg[] = "{$crewtypeText}:{$cnt}";
|
||||||
}
|
|
||||||
|
|
||||||
$unitStr = mb_substr($unit->name, 0, 2);
|
|
||||||
$msg[] = "{$unitStr}:{$typecount[$unit->id]}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[] = join(' ', $msg);
|
$log[] = join(' ', $msg);
|
||||||
@@ -1743,6 +1758,9 @@ function process_31(&$general) {
|
|||||||
{
|
{
|
||||||
$cities = array_map('intval', explode("|", $nation['spy']));
|
$cities = array_map('intval', explode("|", $nation['spy']));
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$cities = [];
|
||||||
|
}
|
||||||
$exist = 0;
|
$exist = 0;
|
||||||
for($i=0; $i < count($cities); $i++) {
|
for($i=0; $i < count($cities); $i++) {
|
||||||
if(intdiv($cities[$i], 10) == $destination) {
|
if(intdiv($cities[$i], 10) == $destination) {
|
||||||
@@ -1803,7 +1821,7 @@ function process_41(&$general) {
|
|||||||
} elseif($crewexp == 0) {
|
} elseif($crewexp == 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
||||||
} else {
|
} else {
|
||||||
$type = intdiv($general['crewtype'], 10) * 10;
|
$type = intdiv($general['crewtype'], 10);
|
||||||
switch($type) {
|
switch($type) {
|
||||||
case 0: $crewstr = '보병'; break;
|
case 0: $crewstr = '보병'; break;
|
||||||
case 1: $crewstr = '궁병'; break;
|
case 1: $crewstr = '궁병'; break;
|
||||||
|
|||||||
@@ -173,7 +173,24 @@ function process_24(&$general) {
|
|||||||
case 4: $str = "몰수로 인한 사기 저하는 몰수로 얻은 물자보다 더 손해란걸 모른단 말인가!"; break;
|
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}을 몰수 당했습니다.";
|
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
|
||||||
@@ -644,7 +661,7 @@ function process_61(&$general) {
|
|||||||
Message::MSGTYPE_DIPLOMACY,
|
Message::MSGTYPE_DIPLOMACY,
|
||||||
$src,
|
$src,
|
||||||
$dest,
|
$dest,
|
||||||
"{$srcNation['name']}의 불가침 제의 서신",
|
"{$srcNation['name']}의 {$when}년 불가침 제의 서신",
|
||||||
$now,
|
$now,
|
||||||
$validUntil,
|
$validUntil,
|
||||||
[
|
[
|
||||||
@@ -756,11 +773,33 @@ function process_62(&$general) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
//국메로 저장
|
//국메로 저장
|
||||||
$msg = "【외교】{$admin['year']}년 {$admin['month']}월:{$younation['name']}에 선전포고";
|
$text = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
|
||||||
$youmsg = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 선전포고";
|
|
||||||
|
|
||||||
PushMsg(2, $nation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}▶", $nation['color'], $younation['name'], $younation['color'], $msg);
|
$src = new MessageTarget(
|
||||||
PushMsg(3, $younation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}▶", $nation['color'], $younation['name'], $younation['color'], $youmsg);
|
$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']);
|
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||||
|
|||||||
@@ -47,16 +47,8 @@ function process_22(&$general) {
|
|||||||
$ded = CharDedication($ded, $general['personal']);
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
|
|
||||||
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
|
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
|
||||||
|
$msg->send(true);
|
||||||
|
|
||||||
/*
|
|
||||||
sendScoutMsg([
|
|
||||||
'id' => $general['no'],
|
|
||||||
'nation_id' => Util::array_get($general['nation'], 0)
|
|
||||||
],[
|
|
||||||
'id' => $you['no'],
|
|
||||||
'nation_id' => Util::array_get($you['nation'], 0)
|
|
||||||
],$date);
|
|
||||||
*/
|
|
||||||
$general['intel2']++;
|
$general['intel2']++;
|
||||||
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
$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),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -576,7 +568,7 @@ function process_46(&$general) {
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($result);
|
$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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$nationcount = MYDB_num_rows($result);
|
$nationcount = MYDB_num_rows($result);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ function Tag2Code(string $str) {
|
|||||||
function BadTag2Code(string $str) {
|
function BadTag2Code(string $str) {
|
||||||
/* FIXME: 제대로된 tag 변환 코드 사용 */
|
/* FIXME: 제대로된 tag 변환 코드 사용 */
|
||||||
$str = str_replace("<script", "<sorry", $str);
|
$str = str_replace("<script", "<sorry", $str);
|
||||||
$str = str_replace("<embed", "<sorry", $str);
|
$str = str_replace("</script", "</sorry", $str);
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+46
-5
@@ -75,7 +75,13 @@ function allButton() {
|
|||||||
$call = "설문조사";
|
$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', [
|
return $templates->render('allButton', [
|
||||||
'call' => $call,
|
'call' => $call,
|
||||||
@@ -95,10 +101,12 @@ function commandButton() {
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
|
$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']);
|
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
|
||||||
|
'nation'=>0,
|
||||||
if($nation['color'] == "") { $nation['color'] = "#000000"; }
|
'level'=>0,
|
||||||
|
'secretlimit'=>99,
|
||||||
|
'color'=>'#000000'
|
||||||
|
];
|
||||||
|
|
||||||
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
||||||
$fgColor = newColor($bgColor);
|
$fgColor = newColor($bgColor);
|
||||||
@@ -119,11 +127,44 @@ function commandButton() {
|
|||||||
'bgColor'=>$bgColor,
|
'bgColor'=>$bgColor,
|
||||||
'fgColor'=>$fgColor,
|
'fgColor'=>$fgColor,
|
||||||
'meLevel'=>$me['level'],
|
'meLevel'=>$me['level'],
|
||||||
|
'nationLevel'=>$nation['level'],
|
||||||
'showSecret'=>$showSecret
|
'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(){
|
function getMapHtml(){
|
||||||
//NOTE: 필요한가?
|
//NOTE: 필요한가?
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ function getTournamentTerm() {
|
|||||||
$admin = MYDB_fetch_array($result);
|
$admin = MYDB_fetch_array($result);
|
||||||
|
|
||||||
switch($admin['tnmt_auto']) {
|
switch($admin['tnmt_auto']) {
|
||||||
case 0: $str = '설정 안됨'; break;
|
case 0: $str = ''; break;
|
||||||
case 1: $str = "경기당 12분"; break;
|
case 1: $str = "경기당 12분"; break;
|
||||||
case 2: $str = "경기당 7분"; break;
|
case 2: $str = "경기당 7분"; break;
|
||||||
case 3: $str = "경기당 3분"; break;
|
case 3: $str = "경기당 3분"; break;
|
||||||
|
|||||||
+17
-6
@@ -18,7 +18,7 @@ if (!$userID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$me = $db->queryFirstRow(
|
$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
|
$userID
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ $scenario = $admin['scenario_text'];
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>메인</title>
|
<title><?=UniqueConst::$serverName?>: 메인</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||||
@@ -74,6 +74,10 @@ $(function(){
|
|||||||
reloadWorldMap({
|
reloadWorldMap({
|
||||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
hrefTemplate:'b_currentCity.php?citylist={0}'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setInterval(function(){
|
||||||
|
refreshMsg();
|
||||||
|
}, 10000);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<link href="css/normalize.css" rel="stylesheet">
|
<link href="css/normalize.css" rel="stylesheet">
|
||||||
@@ -211,6 +215,14 @@ if ($session->userGrade >= 5) {
|
|||||||
</td></tr>
|
</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>
|
<tr>
|
||||||
<td width=646 align=right>
|
<td width=646 align=right>
|
||||||
<?php commandTable(); ?>
|
<?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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
@@ -286,12 +298,12 @@ if ($session->userGrade >= 5) {
|
|||||||
내용 없이 '서신전달&갱신'을 누르면 메세지창이 갱신됩니다.
|
내용 없이 '서신전달&갱신'을 누르면 메세지창이 갱신됩니다.
|
||||||
</div>
|
</div>
|
||||||
<div><?=allButton()?></div>
|
<div><?=allButton()?></div>
|
||||||
<div id="message_board"><div class="board_side bg0">
|
<div id="message_board"><div style="left:0;" class="board_side bg0">
|
||||||
<div class="board_header bg0">전체 메시지(최고99자)</div>
|
<div class="board_header bg0">전체 메시지(최고99자)</div>
|
||||||
<section class="public_message"></section>
|
<section class="public_message"></section>
|
||||||
<div class="board_header bg0">개인 메시지(최고99자)</div>
|
<div class="board_header bg0">개인 메시지(최고99자)</div>
|
||||||
<section class="private_message"></section>
|
<section class="private_message"></section>
|
||||||
</div><div class="board_side bg0">
|
</div><div style="right:0;" class="board_side bg0">
|
||||||
<section class="diplomacy_message">
|
<section class="diplomacy_message">
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
@@ -299,7 +311,6 @@ if ($session->userGrade >= 5) {
|
|||||||
<section class="national_message"></section>
|
<section class="national_message"></section>
|
||||||
</div></div>
|
</div></div>
|
||||||
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
|
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
|
||||||
<?php PrintElapsedTime(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if ($con == 1) {
|
if ($con == 1) {
|
||||||
|
|||||||
+41
-2
@@ -155,15 +155,54 @@ if($session->userGrade < 5){
|
|||||||
<input type="radio" name="show_img_level" value="1">전콘
|
<input type="radio" name="show_img_level" value="1">전콘
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-secondary active">
|
<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>
|
||||||
<label class="btn btn-secondary">
|
<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>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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="form-group row">
|
||||||
<div class="col-sm-3"></div>
|
<div class="col-sm-3"></div>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
|
|||||||
@@ -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['generalID'] = $generalInfo['no'];
|
||||||
$result['myNationID'] = $generalInfo['nation'];
|
$result['myNationID'] = $generalInfo['nation'];
|
||||||
$result['isChief'] = ($generalInfo['level'] == 12);
|
$result['isChief'] = ($generalInfo['level'] == 12);
|
||||||
|
$result['generalLevel'] = $generalInfo['level'];
|
||||||
|
|
||||||
Json::die($result);
|
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',
|
'fiction',
|
||||||
'extend',
|
'extend',
|
||||||
'npcmode',
|
'npcmode',
|
||||||
'show_img_level'
|
'show_img_level',
|
||||||
|
'tournament_trig'
|
||||||
]);
|
]);
|
||||||
if(!$v->validate()){
|
if(!$v->validate()){
|
||||||
Json::die([
|
Json::die([
|
||||||
@@ -44,173 +45,56 @@ $fiction = (int)$_POST['fiction'];
|
|||||||
$extend = (int)$_POST['extend'];
|
$extend = (int)$_POST['extend'];
|
||||||
$npcmode = (int)$_POST['npcmode'];
|
$npcmode = (int)$_POST['npcmode'];
|
||||||
$show_img_level = (int)$_POST['show_img_level'];
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
|
$tournament_trig = (int)$_POST['tournament_trig'];
|
||||||
|
|
||||||
if(120 % $turnterm != 0){
|
$reserve_open = Util::getReq('reserve_open');
|
||||||
Json::die([
|
if($reserve_open){
|
||||||
'result'=>false,
|
$reserve_open = new \DateTime($reserve_open);
|
||||||
'reason'=>'turnterm은 120의 약수여야 합니다.'
|
$db = DB::db();
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!file_exists(__dir__.'/logs') || !file_exists(__dir__.'/data')){
|
if (!$db->queryFirstField("SHOW TABLES LIKE 'game'")) {
|
||||||
if(!is_writable(__dir__)){
|
$clearResult = ResetHelper::clearDB();
|
||||||
|
if(!$clearResult['result']){
|
||||||
|
Json::die($clearResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'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([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>true,
|
||||||
'reason'=>'logs 디렉토리의 쓰기 권한이 없습니다'
|
'reason'=>'예약'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable(__dir__.'/data')){
|
Json::die(ResetHelper::buildScenario(
|
||||||
Json::die([
|
$turnterm,
|
||||||
'result'=>false,
|
$sync,
|
||||||
'reason'=>'data 디렉토리의 쓰기 권한이 없습니다'
|
$scenario,
|
||||||
]);
|
$fiction,
|
||||||
}
|
$extend,
|
||||||
|
$npcmode,
|
||||||
if(!is_writable(__dir__.'/d_setting')){
|
$show_img_level,
|
||||||
Json::die([
|
$tournament_trig
|
||||||
'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()??GameConst::$defaultStartYear;
|
|
||||||
|
|
||||||
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
|
|
||||||
]);
|
|
||||||
@@ -93,6 +93,8 @@ if($result !== true){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResetHelper::clearDB();
|
||||||
|
|
||||||
AppConf::getList()[$prefix]->closeServer();
|
AppConf::getList()[$prefix]->closeServer();
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ if($msg === null){
|
|||||||
'reason'=>'올바르지 않은 메시지'
|
'reason'=>'올바르지 않은 메시지'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
$reason = 'success';
|
||||||
if($msgResponse){
|
if($msgResponse){
|
||||||
$result = $msg->agreeMessage($general['no']);
|
$result = $msg->agreeMessage($general['no'], $reason);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$result = $msg->declineMessage($general['no']);
|
$result = $msg->declineMessage($general['no'], $reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => $result===DiplomaticMessage::ACCEPTED,
|
'result' => $result===DiplomaticMessage::ACCEPTED,
|
||||||
'reason' => 'result'
|
'reason' => $reason
|
||||||
]);
|
]);
|
||||||
@@ -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";
|
include "lib.php";
|
||||||
|
|
||||||
$session = Session::requireLogin([
|
$session = Session::requireLogin([
|
||||||
'game'=>'x',
|
'game'=>null,
|
||||||
'me'=>null
|
'me'=>null
|
||||||
])->setReadOnly();
|
])->setReadOnly();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
|
if(!class_exists('\\sammo\\DB')){
|
||||||
|
Json::die([
|
||||||
|
'game'=>null,
|
||||||
|
'me'=>null
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$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');
|
$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');
|
$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
|
||||||
|
|||||||
+3
-3
@@ -29,7 +29,7 @@ $connect=$db->get();
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>장수생성</title>
|
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
||||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||||
<link href="../d_shared/common.css" rel="stylesheet">
|
<link href="../d_shared/common.css" rel="stylesheet">
|
||||||
<link rel='stylesheet' href="css/common.css">
|
<link rel='stylesheet' href="css/common.css">
|
||||||
@@ -71,10 +71,10 @@ for ($i=0; $i < $nationcount; $i++) {
|
|||||||
$nation = MYDB_fetch_array($nationresult);
|
$nation = MYDB_fetch_array($nationresult);
|
||||||
if ($nation['scoutmsg'] == "") {
|
if ($nation['scoutmsg'] == "") {
|
||||||
echo "
|
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 {
|
} else {
|
||||||
echo "
|
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>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
+3
-5
@@ -8,7 +8,6 @@ $v = new Validator($_POST + $_GET);
|
|||||||
$v
|
$v
|
||||||
->rule('required', [
|
->rule('required', [
|
||||||
'name',
|
'name',
|
||||||
'pic',
|
|
||||||
'leader',
|
'leader',
|
||||||
'power',
|
'power',
|
||||||
'intel'
|
'intel'
|
||||||
@@ -18,7 +17,6 @@ $v
|
|||||||
'power',
|
'power',
|
||||||
'intel',
|
'intel',
|
||||||
'character',
|
'character',
|
||||||
'pic'
|
|
||||||
])
|
])
|
||||||
->rule('lengthBetween', 'name', 1, 6)
|
->rule('lengthBetween', 'name', 1, 6)
|
||||||
->rule('min', [
|
->rule('min', [
|
||||||
@@ -46,7 +44,7 @@ $userID = Session::getUserID();
|
|||||||
|
|
||||||
$name = Util::getReq('name');
|
$name = Util::getReq('name');
|
||||||
$name = StringUtil::removeSpecialCharacter($name);
|
$name = StringUtil::removeSpecialCharacter($name);
|
||||||
$pic = Util::getReq('pic', 'int', 0);
|
$pic = (int)Util::getReq('pic', 'bool', 0);
|
||||||
$character = Util::getReq('character', 'int', 0);
|
$character = Util::getReq('character', 'int', 0);
|
||||||
|
|
||||||
$leader = Util::getReq('leader', 'int', 50);
|
$leader = Util::getReq('leader', 'int', 50);
|
||||||
@@ -59,7 +57,7 @@ extractMissingPostToGlobals();
|
|||||||
|
|
||||||
$rootDB = RootDB::db();
|
$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) {
|
if (!$member) {
|
||||||
MessageBox("잘못된 접근입니다!!!");
|
MessageBox("잘못된 접근입니다!!!");
|
||||||
@@ -70,7 +68,7 @@ if (!$member) {
|
|||||||
$db = DB::db();
|
$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');
|
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||||
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
|
$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]); }
|
try { result = new Function('obj', code).apply(options, [options]); }
|
||||||
catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
|
catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
|
||||||
return result;
|
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",
|
extend:"required",
|
||||||
npcmode:"required",
|
npcmode:"required",
|
||||||
show_img_level:"required",
|
show_img_level:"required",
|
||||||
|
tournament_trig:"required"
|
||||||
},
|
},
|
||||||
errorElement: "div",
|
errorElement: "div",
|
||||||
errorPlacement: function ( error, element ) {
|
errorPlacement: function ( error, element ) {
|
||||||
@@ -149,7 +150,9 @@ function formSetup(){
|
|||||||
fiction:$('#fiction input:radio:checked').val(),
|
fiction:$('#fiction input:radio:checked').val(),
|
||||||
extend:$('#extend input:radio:checked').val(),
|
extend:$('#extend input:radio:checked').val(),
|
||||||
npcmode:$('#npcmode 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){
|
}).then(function(result){
|
||||||
var deferred = $.Deferred();
|
var deferred = $.Deferred();
|
||||||
|
|||||||
+2
-71
@@ -84,7 +84,7 @@ function reloadWorldMap(option){
|
|||||||
else if(month <= 6){
|
else if(month <= 6){
|
||||||
$world_map.addClass('map_summer');
|
$world_map.addClass('map_summer');
|
||||||
}
|
}
|
||||||
else if(month <= 6){
|
else if(month <= 9){
|
||||||
$world_map.addClass('map_fall');
|
$world_map.addClass('map_fall');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -366,65 +366,8 @@ function reloadWorldMap(option){
|
|||||||
|
|
||||||
var $map_body = $('.world_map .map_body');
|
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 모드 작동
|
//Mouse over 모드 작동
|
||||||
|
|
||||||
$map_body.on('mousemove', function(e){
|
$map_body.on('mousemove', function(e){
|
||||||
if($(this).data('touchMode')){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var parentOffset = $map_body.offset();
|
var parentOffset = $map_body.offset();
|
||||||
var relX = e.pageX - parentOffset.left;
|
var relX = e.pageX - parentOffset.left;
|
||||||
var relY = e.pageY - parentOffset.top;
|
var relY = e.pageY - parentOffset.top;
|
||||||
@@ -433,10 +376,6 @@ function reloadWorldMap(option){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$objs.on('mouseenter', function(e){
|
$objs.on('mouseenter', function(e){
|
||||||
if($map_body.data('touchMode')){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
$tooltip_city.data('target', $this.data('id'));
|
$tooltip_city.data('target', $this.data('id'));
|
||||||
@@ -457,15 +396,7 @@ function reloadWorldMap(option){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$objs.on('click', function(e){
|
$objs.on('click', function(e){
|
||||||
//xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다.
|
return;
|
||||||
var touchMode = $(this).data('touchMode');
|
|
||||||
if(touchMode === undefined){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(touchMode === 1){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-4
@@ -42,7 +42,10 @@ function responseMessage(msgID, response){
|
|||||||
}).then(refreshMsg);
|
}).then(refreshMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshMsg(){
|
function refreshMsg(result){
|
||||||
|
if(result && !result.result){
|
||||||
|
alert(result.reason);
|
||||||
|
}
|
||||||
return redrawMsg(fetchMsg());
|
return redrawMsg(fetchMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +62,6 @@ function fetchMsg(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function redrawMsg(deferred){
|
function redrawMsg(deferred){
|
||||||
|
|
||||||
console.log(deferred);
|
|
||||||
|
|
||||||
function registerSequence(obj){
|
function registerSequence(obj){
|
||||||
if(!obj.result){
|
if(!obj.result){
|
||||||
@@ -216,7 +217,8 @@ function refreshMailboxList(obj){
|
|||||||
|
|
||||||
generalList = {};
|
generalList = {};
|
||||||
|
|
||||||
//TODO:수뇌인 경우 각국에 대해 외교 국메를 넣을 수 있어야함.
|
|
||||||
|
|
||||||
|
|
||||||
$.each(obj.nation, function(){
|
$.each(obj.nation, function(){
|
||||||
var nation = this;
|
var nation = this;
|
||||||
@@ -284,6 +286,25 @@ function refreshMailboxList(obj){
|
|||||||
$favorite.append($lastContact);
|
$favorite.append($lastContact);
|
||||||
//TODO:운영자를 추가하는 코드도 넣을 것.
|
//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);
|
$mailboxList.prepend($favorite);
|
||||||
|
|
||||||
if(!oldSelected){
|
if(!oldSelected){
|
||||||
@@ -307,6 +328,7 @@ function registerGlobal(basicInfo){
|
|||||||
};
|
};
|
||||||
myGeneralID = basicInfo.generalID;
|
myGeneralID = basicInfo.generalID;
|
||||||
isChief = basicInfo.isChief;
|
isChief = basicInfo.isChief;
|
||||||
|
myGeneralLevel = basicInfo.generalLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
function activateMessageForm(){
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -26,7 +26,6 @@ include "MYDB.php";
|
|||||||
// 각종 변수
|
// 각종 변수
|
||||||
define('STEP_LOG', true);
|
define('STEP_LOG', true);
|
||||||
define('PROCESS_LOG', true);
|
define('PROCESS_LOG', true);
|
||||||
$_startTime = microtime(true);
|
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
|
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
|
||||||
@@ -55,13 +54,6 @@ function MessageBox($str)
|
|||||||
echo "<script>alert('$str');</script>";
|
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)
|
function LogText($prefix, $variable)
|
||||||
{
|
{
|
||||||
$text = sprintf('%s : %s'."\n", $prefix, var_export($variable, true));
|
$text = sprintf('%s : %s'."\n", $prefix, var_export($variable, true));
|
||||||
|
|||||||
+1
-15
@@ -19,24 +19,10 @@ extractMissingPostToGlobals();
|
|||||||
increaseRefresh("턴입력", 1);
|
increaseRefresh("턴입력", 1);
|
||||||
|
|
||||||
if(!$turn || $commandtype === null){
|
if(!$turn || $commandtype === null){
|
||||||
header('location:./');
|
header('location:commandlist.php');
|
||||||
die();
|
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);
|
$count = count($turn);
|
||||||
for($i=0; $i < $count; $i++) {
|
for($i=0; $i < $count; $i++) {
|
||||||
if($turn[$i] == 100 || $turn[$i] == 99 || $turn[$i] == 98) {
|
if($turn[$i] == 100 || $turn[$i] == 99 || $turn[$i] == 98) {
|
||||||
|
|||||||
+3
-1
@@ -4,8 +4,10 @@ namespace sammo;
|
|||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
$session = Session::getInstance()->setReadOnly();
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
increaseRefresh("자동", 2);
|
//increaseRefresh("자동", 2);
|
||||||
checkTurn();
|
checkTurn();
|
||||||
|
|||||||
+1
-1
@@ -1159,7 +1159,7 @@ function processWar($general, $city) {
|
|||||||
}
|
}
|
||||||
//회피
|
//회피
|
||||||
$ratio = rand() % 100; // 0 ~ 99
|
$ratio = rand() % 100; // 0 ~ 99
|
||||||
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->defence; //회피율
|
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->avoid; //회피율
|
||||||
$ratio2 = Util::round($ratio2 * $oppose['train'] / 100); //훈련 반영
|
$ratio2 = Util::round($ratio2 * $oppose['train'] / 100); //훈련 반영
|
||||||
// 특기보정 : 돌격, 궁병
|
// 특기보정 : 돌격, 궁병
|
||||||
if($general['special2'] == 60) { $ratio2 -= 100; }
|
if($general['special2'] == 60) { $ratio2 -= 100; }
|
||||||
|
|||||||
+23
-17
@@ -58,7 +58,7 @@ switch($commandtype) {
|
|||||||
case 17: command_Single($turn, 17); break; //소집해제
|
case 17: command_Single($turn, 17); break; //소집해제
|
||||||
|
|
||||||
case 21: command_21( $turn, 21); 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 23: command_23( $turn, 23); break; //포상
|
||||||
case 24: command_24( $turn, 24); break; //몰수
|
case 24: command_24( $turn, 24); break; //몰수
|
||||||
case 25: command_25( $turn, 25); break; //임관
|
case 25: command_25( $turn, 25); break; //임관
|
||||||
@@ -166,11 +166,7 @@ function ender($type=0) {
|
|||||||
echo banner();
|
echo banner();
|
||||||
echo "
|
echo "
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>";
|
</table>
|
||||||
|
|
||||||
PrintElapsedTime();
|
|
||||||
|
|
||||||
echo "
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
";
|
";
|
||||||
@@ -594,7 +590,7 @@ function calc(cost, formnum) {
|
|||||||
<form name=form{$i} action=c_double.php>
|
<form name=form{$i} action=c_double.php>
|
||||||
<td valign=center>
|
<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=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=third value={$i}>
|
||||||
<input type=hidden name=command value=$command>";
|
<input type=hidden name=command value=$command>";
|
||||||
|
|
||||||
@@ -860,7 +856,10 @@ function command_23($turn, $command) {
|
|||||||
<option value=8>800</option>
|
<option value=8>800</option>
|
||||||
<option value=9>900</option>
|
<option value=9>900</option>
|
||||||
<option value=10>1000</option>
|
<option value=10>1000</option>
|
||||||
|
<option value=12>1200</option>
|
||||||
|
<option value=15>1500</option>
|
||||||
<option value=20>2000</option>
|
<option value=20>2000</option>
|
||||||
|
<option value=25>2500</option>
|
||||||
<option value=30>3000</option>
|
<option value=30>3000</option>
|
||||||
<option value=40>4000</option>
|
<option value=40>4000</option>
|
||||||
<option value=50>5000</option>
|
<option value=50>5000</option>
|
||||||
@@ -935,7 +934,10 @@ function command_24($turn, $command) {
|
|||||||
<option value=8>800</option>
|
<option value=8>800</option>
|
||||||
<option value=9>900</option>
|
<option value=9>900</option>
|
||||||
<option value=10>1000</option>
|
<option value=10>1000</option>
|
||||||
|
<option value=12>1200</option>
|
||||||
|
<option value=15>1500</option>
|
||||||
<option value=20>2000</option>
|
<option value=20>2000</option>
|
||||||
|
<option value=25>2500</option>
|
||||||
<option value=30>3000</option>
|
<option value=30>3000</option>
|
||||||
<option value=40>4000</option>
|
<option value=40>4000</option>
|
||||||
<option value=50>5000</option>
|
<option value=50>5000</option>
|
||||||
@@ -1448,7 +1450,10 @@ function command_43($turn, $command) {
|
|||||||
<option value=8>800</option>
|
<option value=8>800</option>
|
||||||
<option value=9>900</option>
|
<option value=9>900</option>
|
||||||
<option value=10>1000</option>
|
<option value=10>1000</option>
|
||||||
|
<option value=12>1200</option>
|
||||||
|
<option value=15>1500</option>
|
||||||
<option value=20>2000</option>
|
<option value=20>2000</option>
|
||||||
|
<option value=25>2500</option>
|
||||||
<option value=30>3000</option>
|
<option value=30>3000</option>
|
||||||
<option value=40>4000</option>
|
<option value=40>4000</option>
|
||||||
<option value=50>5000</option>
|
<option value=50>5000</option>
|
||||||
@@ -1496,7 +1501,10 @@ function command_44($turn, $command) {
|
|||||||
<option value=8>800</option>
|
<option value=8>800</option>
|
||||||
<option value=9>900</option>
|
<option value=9>900</option>
|
||||||
<option value=10>1000</option>
|
<option value=10>1000</option>
|
||||||
|
<option value=12>1200</option>
|
||||||
|
<option value=15>1500</option>
|
||||||
<option value=20>2000</option>
|
<option value=20>2000</option>
|
||||||
|
<option value=25>2500</option>
|
||||||
<option value=30>3000</option>
|
<option value=30>3000</option>
|
||||||
<option value=40>4000</option>
|
<option value=40>4000</option>
|
||||||
<option value=50>5000</option>
|
<option value=50>5000</option>
|
||||||
@@ -1540,7 +1548,7 @@ function command_46($turn, $command) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($nationcolor[$nation['color']])){
|
if(!isset($nationcolor[$nation['color']])){
|
||||||
$nationcolor[$nation['color']] = 1;
|
$nationcolor[$nation['color']] = 1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -1720,7 +1728,10 @@ function command_49($turn, $command) {
|
|||||||
<option value=8>800</option>
|
<option value=8>800</option>
|
||||||
<option value=9>900</option>
|
<option value=9>900</option>
|
||||||
<option value=10>1000</option>
|
<option value=10>1000</option>
|
||||||
|
<option value=12>1200</option>
|
||||||
|
<option value=15>1500</option>
|
||||||
<option value=20>2000</option>
|
<option value=20>2000</option>
|
||||||
|
<option value=25>2500</option>
|
||||||
<option value=30>3000</option>
|
<option value=30>3000</option>
|
||||||
<option value=40>4000</option>
|
<option value=40>4000</option>
|
||||||
<option value=50>5000</option>
|
<option value=50>5000</option>
|
||||||
@@ -1774,7 +1785,7 @@ function command_51($turn, $command) {
|
|||||||
for($i=1; $i <= $count; $i++) {
|
for($i=1; $i <= $count; $i++) {
|
||||||
$nation = MYDB_fetch_array($result);
|
$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>";
|
echo "<option style=color:{$nation['color']};background-color:red; value={$nation['nation']}>【 {$nation['name']} 】</option>";
|
||||||
} else {
|
} else {
|
||||||
echo "<option style=color:{$nation['color']} value={$nation['nation']}>【 {$nation['name']} 】</option>";
|
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){
|
if($nation['level'] <= 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($nationcolor[$nation['color']])){
|
$colorUsed[$nation['color']]+=1;
|
||||||
$nationcolor[$nation['color']] = 1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$nationcolor[$nation['color']]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$colorUsedCnt = 0;
|
$colorUsedCnt = 0;
|
||||||
@@ -2787,7 +2793,7 @@ function command_81($turn, $command) {
|
|||||||
<form name=form1 action=c_double.php method=post>
|
<form name=form1 action=c_double.php method=post>
|
||||||
색깔 : <select name=double size=1>";
|
색깔 : <select name=double size=1>";
|
||||||
foreach(GetNationColors() as $idx=>$color) {
|
foreach(GetNationColors() as $idx=>$color) {
|
||||||
if($colorUsed[$color] > 0){
|
if($colorUsed[$color]>0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
echo "<option value={$idx} style=background-color:{$color};color:".newColor($color).";>국가명</option>";
|
echo "<option value={$idx} style=background-color:{$color};color:".newColor($color).";>국가명</option>";
|
||||||
|
|||||||
@@ -29,13 +29,14 @@ class CityHelper{
|
|||||||
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
|
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
|
||||||
$id = $city['id'];
|
$id = $city['id'];
|
||||||
$name = $city['name'];
|
$name = $city['name'];
|
||||||
|
$nationID = $city['nation'];
|
||||||
$list[$id] = $city;
|
$list[$id] = $city;
|
||||||
$listInv[$city['name']] = $city;
|
$listInv[$city['name']] = $city;
|
||||||
|
|
||||||
if(!key_exists($id, $listByNation)){
|
if(!key_exists($nationID, $listByNation)){
|
||||||
$listByNation[$id] = [];
|
$listByNation[$nationID] = [];
|
||||||
}
|
}
|
||||||
$listByNation[$id][] = $city;
|
$listByNation[$nationID][] = $city;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$list = $list;
|
self::$list = $list;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class DiplomaticMessage extends Message{
|
|||||||
|
|
||||||
protected $diplomaticType = '';
|
protected $diplomaticType = '';
|
||||||
protected $diplomacyName = '';
|
protected $diplomacyName = '';
|
||||||
|
protected $diplomacyDetail = '';
|
||||||
protected $validDiplomacy = true;
|
protected $validDiplomacy = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@@ -77,18 +78,20 @@ class DiplomaticMessage extends Message{
|
|||||||
return [self::INVALID, '올바르지 않은 불가침 서신입니다.'];
|
return [self::INVALID, '올바르지 않은 불가침 서신입니다.'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->diplomacyDetail = "{$year}년";
|
||||||
|
|
||||||
$helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID);
|
$helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID);
|
||||||
$chk = $helper->noAggression($year, $option);
|
$chk = $helper->noAggression($year, $option);
|
||||||
if($chk[0] !== self::ACCEPTED){
|
if($chk[0] !== self::ACCEPTED){
|
||||||
return $chk;
|
return $chk;
|
||||||
}
|
}
|
||||||
|
|
||||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 <C>$when</>년 불가침에 성공했습니다.";
|
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 <C>$year</>년 불가침에 성공했습니다.";
|
||||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 <C>$when</>년 불가침에 합의했습니다.";
|
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 <C>$year</>년 불가침에 합의했습니다.";
|
||||||
pushGenLog(['no'=>$this->dest->generalID], $mylog);
|
pushGenLog(['no'=>$this->dest->generalID], $mylog);
|
||||||
pushGenLog(['no'=>$this->src->generalID], $youlog);
|
pushGenLog(['no'=>$this->src->generalID], $youlog);
|
||||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$when}년 불가침 성공");
|
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$year}년 불가침 성공");
|
||||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$when}년 불가침 수락");
|
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$year}년 불가침 수락");
|
||||||
|
|
||||||
return $chk;
|
return $chk;
|
||||||
}
|
}
|
||||||
@@ -212,7 +215,7 @@ class DiplomaticMessage extends Message{
|
|||||||
/**
|
/**
|
||||||
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
||||||
*/
|
*/
|
||||||
public function agreeMessage(int $receiverID):int{
|
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||||
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
||||||
|
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
@@ -294,7 +297,7 @@ class DiplomaticMessage extends Message{
|
|||||||
self::MSGTYPE_NATIONAL,
|
self::MSGTYPE_NATIONAL,
|
||||||
$this->dest,
|
$this->dest,
|
||||||
$this->src,
|
$this->src,
|
||||||
"【외교】{$year}년 {$month}월: {$this->src->nationName}이 {$this->dest->nationName}에게 제안한 {$this->diplomacyName} 동의.",
|
"【외교】{$year}년 {$month}월: {$this->src->nationName}(이)가 {$this->dest->nationName}에게 제안한 {$this->diplomacyDetail}{$this->diplomacyName} 동의.",
|
||||||
new \DateTime(),
|
new \DateTime(),
|
||||||
new \DateTime('9999-12-31'),
|
new \DateTime('9999-12-31'),
|
||||||
[
|
[
|
||||||
@@ -315,7 +318,7 @@ class DiplomaticMessage extends Message{
|
|||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function declineMessage(int $receiverID):int{
|
public function declineMessage(int $receiverID, string &$reason):int{
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ class Diplomacy{
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$db->update('diplomacy',[
|
$db->update('diplomacy',[
|
||||||
'state'=>7,
|
'state'=>7,
|
||||||
'term'=>$when,
|
'term'=>$when*12,
|
||||||
'fixed'=>$option
|
'fixed'=>$option
|
||||||
],
|
],
|
||||||
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
|
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use \sammo\ScoutMessage;
|
|||||||
class Personnel{
|
class Personnel{
|
||||||
|
|
||||||
protected $nation = null;//TODO: 상속체로 변경.
|
protected $nation = null;//TODO: 상속체로 변경.
|
||||||
|
protected $senderID = null;
|
||||||
public $valid = false;
|
public $valid = false;
|
||||||
|
|
||||||
public $startYear = 0;
|
public $startYear = 0;
|
||||||
@@ -18,7 +19,7 @@ class Personnel{
|
|||||||
public $month = 0;
|
public $month = 0;
|
||||||
public $killturn = 0;
|
public $killturn = 0;
|
||||||
|
|
||||||
public function __construct(int $nationID){
|
public function __construct(int $nationID, int $senderID){
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$nation = $db->queryFirstRow(
|
$nation = $db->queryFirstRow(
|
||||||
'SELECT nation, `name`, `level`, capital, scout FROM nation WHERE nation=%i',
|
'SELECT nation, `name`, `level`, capital, scout FROM nation WHERE nation=%i',
|
||||||
@@ -29,6 +30,7 @@ class Personnel{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->senderID = $senderID;
|
||||||
$this->nation = $nation;
|
$this->nation = $nation;
|
||||||
$this->valid = true;
|
$this->valid = true;
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ class Personnel{
|
|||||||
return [ScoutMessage::INVALID, '초반제한 중입니다.'];
|
return [ScoutMessage::INVALID, '초반제한 중입니다.'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->nation['scout']){
|
if($this->nation['scout']){
|
||||||
return [ScoutMessage::INVALID, '현재 임관금지 중인 국가입니다.'];
|
return [ScoutMessage::INVALID, '현재 임관금지 중인 국가입니다.'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ class Personnel{
|
|||||||
return [ScoutMessage::DECLINED, '군주는 등용장을 수락할 수 없습니다.'];
|
return [ScoutMessage::DECLINED, '군주는 등용장을 수락할 수 없습니다.'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($general['nations'], ",{$this->nation['nation']},") >= 0){
|
if(strpos($general['nations'], ",{$this->nation['nation']},") !== false){
|
||||||
return [ScoutMessage::DECLINED, '이미 임관했었던 국가입니다.'];
|
return [ScoutMessage::DECLINED, '이미 임관했었던 국가입니다.'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +102,7 @@ class Personnel{
|
|||||||
$isTroopLeader = false;
|
$isTroopLeader = false;
|
||||||
if($general['troop']){
|
if($general['troop']){
|
||||||
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop = %i', $general['troop']);
|
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop = %i', $general['troop']);
|
||||||
if($troopLeader == $receiverID){
|
if($troopLeader == $generalID){
|
||||||
$isTroopLeader = true;
|
$isTroopLeader = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,12 +181,12 @@ class Personnel{
|
|||||||
$setValues['dedication'] = $db->sqleval('experience + %i', 100);//XXX: 상수
|
$setValues['dedication'] = $db->sqleval('experience + %i', 100);//XXX: 상수
|
||||||
}
|
}
|
||||||
|
|
||||||
if($me['npc'] < 2){
|
if($general['npc'] < 2){
|
||||||
$setValues['killturn'] = $killturn;
|
$setValues['killturn'] = $this->killturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('general', $setValues, 'no=%i', $receiverID);
|
$db->update('general', $setValues, 'no=%i', $generalID);
|
||||||
$db->update('general', $setSenderValues, 'no=%i', $this->src->generalID);
|
$db->update('general', $setSenderValues, 'no=%i', $this->senderID);
|
||||||
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
|
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
|
||||||
$db->update('nation', $setScoutNationValues, 'nation=%i', $this->nation['nation']);
|
$db->update('nation', $setScoutNationValues, 'nation=%i', $this->nation['nation']);
|
||||||
if($setOriginalCityValues){
|
if($setOriginalCityValues){
|
||||||
|
|||||||
@@ -50,13 +50,15 @@ class Date extends \sammo\Event\Condition{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$lhs = [
|
$lhs = [
|
||||||
$this->year,
|
|
||||||
$this->month
|
|
||||||
];
|
|
||||||
$rhs = [
|
|
||||||
$this->year!==null?(int)$env['year']:null,
|
$this->year!==null?(int)$env['year']:null,
|
||||||
$this->month!==null?(int)$env['month']:null
|
$this->month!==null?(int)$env['month']:null
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$rhs = [
|
||||||
|
$this->year,
|
||||||
|
$this->month
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
$value = false;
|
$value = false;
|
||||||
switch($this->cmp){
|
switch($this->cmp){
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class GameUnitConst{
|
|||||||
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true, ['저렴하고 튼튼합니다.']],
|
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true, ['저렴하고 튼튼합니다.']],
|
||||||
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true, ['저렴하고 강력합니다.']],
|
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true, ['저렴하고 강력합니다.']],
|
||||||
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true, ['백병전에도 능숙합니다.']],
|
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true, ['백병전에도 능숙합니다.']],
|
||||||
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 0, false, ['전투를 포기하고 계략에 몰두합니다.']],
|
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 1000, false, ['전투를 포기하고 계략에 몰두합니다.']],
|
||||||
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true, ['고도로 훈련된 귀병입니다.']],
|
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true, ['고도로 훈련된 귀병입니다.']],
|
||||||
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true, ['갑주를 두른 귀병입니다.']],
|
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true, ['갑주를 두른 귀병입니다.']],
|
||||||
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true, ['날카로운 무기를 가진 귀병입니다.']],
|
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true, ['날카로운 무기를 가진 귀병입니다.']],
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class GameUnitDetail{
|
|||||||
if(!key_exists($this->recruitCondition, $ownCities)){
|
if(!key_exists($this->recruitCondition, $ownCities)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($cityLevel == '특'){
|
if($cityLevel == CityConst::$levelMap['특']){
|
||||||
if ($tech < 3000) {
|
if ($tech < 3000) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,214 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class ResetHelper{
|
||||||
|
private function __construct(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function clearDB(){
|
||||||
|
$servRoot = realpath(__dir__.'/../');
|
||||||
|
|
||||||
|
if(!file_exists($servRoot.'/logs') || !file_exists($servRoot.'/data')){
|
||||||
|
if(!is_writable($servRoot)){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'logs, data 디렉토리를 생성할 권한이 없습니다.'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
mkdir($servRoot.'/logs', 0644);
|
||||||
|
mkdir($servRoot.'/data', 0644);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_writable($servRoot.'/logs')){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'logs 디렉토리의 쓰기 권한이 없습니다'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_writable($servRoot.'/data')){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'data 디렉토리의 쓰기 권한이 없습니다'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_writable($servRoot.'/d_setting')){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!file_exists($servRoot.'/logs/.htaccess')){
|
||||||
|
@file_put_contents($servRoot.'/logs/.htaccess', 'Deny from all');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!file_exists($servRoot.'/data/.htaccess')){
|
||||||
|
@file_put_contents($servRoot.'/data/.htaccess', 'Deny from all');
|
||||||
|
}
|
||||||
|
|
||||||
|
$prefix = DB::prefix();
|
||||||
|
AppConf::getList()[$prefix]->closeServer();
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$mysqli_obj = $db->get();
|
||||||
|
|
||||||
|
FileUtil::delInDir($servRoot."/logs");
|
||||||
|
FileUtil::delInDir($servRoot."/data");
|
||||||
|
|
||||||
|
$result = Util::generateFileUsingSimpleTemplate(
|
||||||
|
$servRoot.'/d_setting/UniqueConst.orig.php',
|
||||||
|
$servRoot.'/d_setting/UniqueConst.php',[
|
||||||
|
'serverID'=>DB::prefix().'_'.Util::randomStr(8),
|
||||||
|
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
|
||||||
|
], true
|
||||||
|
);
|
||||||
|
|
||||||
|
if($mysqli_obj->multi_query(file_get_contents($servRoot.'/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($servRoot.'/sql/schema.sql'))){
|
||||||
|
while(true){
|
||||||
|
if (!$mysqli_obj->more_results()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!$mysqli_obj->next_result()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'result'=>true
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function buildScenario(
|
||||||
|
int $turnterm,
|
||||||
|
int $sync,
|
||||||
|
int $scenario,
|
||||||
|
int $fiction,
|
||||||
|
int $extend,
|
||||||
|
int $npcmode,
|
||||||
|
int $show_img_level,
|
||||||
|
int $tournament_trig
|
||||||
|
):array{
|
||||||
|
//FIXME: 분리할 것
|
||||||
|
if(120 % $turnterm != 0){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'turnterm은 120의 약수여야 합니다.'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($tournament_trig < 0 || $tournament_trig > 7){
|
||||||
|
return [
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'올바르지 않은 토너먼트 주기입니다.'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$clearResult = self::clearDB();
|
||||||
|
if(!$clearResult['result']){
|
||||||
|
return $clearResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
$scenarioObj = new Scenario($scenario, false);
|
||||||
|
$startyear = $scenarioObj->getYear()??GameConst::$defaultStartYear;
|
||||||
|
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$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,
|
||||||
|
'tnmt_trig'=>$tournament_trig
|
||||||
|
];
|
||||||
|
|
||||||
|
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'=>9999
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->insert('game', $env);
|
||||||
|
|
||||||
|
$scenarioObj->build($env);
|
||||||
|
|
||||||
|
$db->update('plock', [
|
||||||
|
'plock'=>0
|
||||||
|
], true);
|
||||||
|
|
||||||
|
LogHistory(1);
|
||||||
|
|
||||||
|
$prefix = DB::prefix();
|
||||||
|
AppConf::getList()[$prefix]->closeServer();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'result'=>true
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,7 +64,7 @@ class Scenario{
|
|||||||
|
|
||||||
list(
|
list(
|
||||||
$affinity, $name, $pictureID, $nationID, $locatedCity,
|
$affinity, $name, $pictureID, $nationID, $locatedCity,
|
||||||
$leadership, $power, $intel, $birth, $death, $ego,
|
$leadership, $power, $intel, $level, $birth, $death, $ego,
|
||||||
$char, $text
|
$char, $text
|
||||||
) = $rawGeneral;
|
) = $rawGeneral;
|
||||||
|
|
||||||
@@ -83,6 +83,7 @@ class Scenario{
|
|||||||
$leadership,
|
$leadership,
|
||||||
$power,
|
$power,
|
||||||
$intel,
|
$intel,
|
||||||
|
$level,
|
||||||
$birth,
|
$birth,
|
||||||
$death,
|
$death,
|
||||||
$ego,
|
$ego,
|
||||||
@@ -117,7 +118,7 @@ class Scenario{
|
|||||||
$leadership,
|
$leadership,
|
||||||
$power,
|
$power,
|
||||||
$intel,
|
$intel,
|
||||||
$level,
|
$level,
|
||||||
$birth,
|
$birth,
|
||||||
$death,
|
$death,
|
||||||
$ego,
|
$ego,
|
||||||
@@ -279,12 +280,14 @@ class Scenario{
|
|||||||
private function buildDiplomacy($env){
|
private function buildDiplomacy($env){
|
||||||
$this->initFull();
|
$this->initFull();
|
||||||
|
|
||||||
|
$monthDiff = ($env['year'] * 12) + ($env['month'] - 1) - ($env['startyear'] * 12);
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
foreach($this->diplomacy as $diplomacy){
|
foreach($this->diplomacy as $diplomacy){
|
||||||
list($me, $you, $state, $remain) = $diplomacy;
|
list($me, $you, $state, $remain) = $diplomacy;
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>$state,
|
'state'=>$state,
|
||||||
'term'=>$remain
|
'term'=>$remain - $monthDiff
|
||||||
], '(me = %i AND you = %i) OR (me = %i AND you = %i)', $me, $you, $you, $me);
|
], '(me = %i AND you = %i) OR (me = %i AND you = %i)', $me, $you, $you, $me);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,6 +315,8 @@ class Scenario{
|
|||||||
|
|
||||||
$nation->build($env);
|
$nation->build($env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshNationStaticInfo();
|
||||||
CityHelper::flushCache();
|
CityHelper::flushCache();
|
||||||
|
|
||||||
$remainGenerals = $this->buildGenerals($env);
|
$remainGenerals = $this->buildGenerals($env);
|
||||||
@@ -321,7 +326,7 @@ class Scenario{
|
|||||||
|
|
||||||
$actions[] = ['DeleteEvent'];
|
$actions[] = ['DeleteEvent'];
|
||||||
$this->events[] = [
|
$this->events[] = [
|
||||||
'cond'=>['Date', '==', $targetYear, '1'],
|
'cond'=>['Date', '>=', $targetYear, '1'],
|
||||||
'action'=>$actions
|
'action'=>$actions
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-17
@@ -53,22 +53,41 @@ class NPC{
|
|||||||
$this->ego = $ego;
|
$this->ego = $ego;
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
|
|
||||||
$char = \sammo\SpecCall($char);
|
$general = [
|
||||||
if($char < 40){
|
'leader'=>$leadership,
|
||||||
$this->charDomestic = $char;
|
'power'=>$power,
|
||||||
|
'intel'=>$intel
|
||||||
|
];
|
||||||
|
|
||||||
|
if($char === '랜덤전특'){
|
||||||
|
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
|
||||||
|
}
|
||||||
|
else if($char === '랜덤내특'){
|
||||||
|
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
|
||||||
|
}
|
||||||
|
else if($char === '랜덤'){
|
||||||
|
if(Util::randBool(2/3)){
|
||||||
|
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$this->charWar = $char;
|
$char = \sammo\SpecCall($char);
|
||||||
}
|
if($char < 40){
|
||||||
|
$this->charDomestic = $char;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->charWar = $char;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function build($env=[]){
|
public function build($env=[]){
|
||||||
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
|
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
|
||||||
$nationID = $this->nationID;
|
|
||||||
if(!\sammo\getNationStaticInfo($nationID)){
|
$isFictionMode = (Util::array_get($env['fiction'], 0)!=0);
|
||||||
$nationID = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
$year = $env['year'];
|
$year = $env['year'];
|
||||||
$month = $env['month'];
|
$month = $env['month'];
|
||||||
@@ -82,19 +101,45 @@ class NPC{
|
|||||||
return false; //예약.
|
return false; //예약.
|
||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$isNewGeneral = ($age == \sammo\GameConst::$adultAge);
|
||||||
|
|
||||||
if($age == \sammo\GameConst::$adultAge && $month == 1){
|
$nationID = $this->nationID;
|
||||||
\sammo\pushWorldHistory(["<C>●</>1월:<Y>$name</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
|
if($isFictionMode && $isNewGeneral){
|
||||||
|
$nationID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->ego == null){
|
if(!\sammo\getNationStaticInfo($nationID)){
|
||||||
|
$nationID = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
|
||||||
|
if($isNewGeneral){
|
||||||
|
\sammo\pushWorldHistory(["<C>●</>{$month}월:<Y>{$name}</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->ego == null || $isFictionMode){
|
||||||
$ego = mt_rand(0, 9);//TODO: 나중에 성격을 따로 분리할 경우 클래스를 참조.
|
$ego = mt_rand(0, 9);//TODO: 나중에 성격을 따로 분리할 경우 클래스를 참조.
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$ego = \sammo\CharCall($this->ego);
|
$ego = \sammo\CharCall($this->ego);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$affinity = $this->affinity;
|
||||||
|
|
||||||
|
$charWar = $this->charWar;
|
||||||
|
$charDomestic = $this->charDomestic;
|
||||||
|
|
||||||
|
if($affinity === 0 || $isFictionMode){
|
||||||
|
$affinity = mt_rand(1, 150);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($isFictionMode){
|
||||||
|
$charWar = 0;
|
||||||
|
$charDomestic = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$name = 'ⓝ'.$this->name;
|
$name = 'ⓝ'.$this->name;
|
||||||
|
|
||||||
$pictureID = $this->pictureID;
|
$pictureID = $this->pictureID;
|
||||||
@@ -137,7 +182,7 @@ class NPC{
|
|||||||
'npcid'=>$npcID,
|
'npcid'=>$npcID,
|
||||||
'npc'=>2,
|
'npc'=>2,
|
||||||
'npc_org'=>2,
|
'npc_org'=>2,
|
||||||
'affinity'=>$this->affinity,
|
'affinity'=>$affinity,
|
||||||
'name'=>$name,
|
'name'=>$name,
|
||||||
'picture'=>$picture,
|
'picture'=>$picture,
|
||||||
'nation'=>$nationID,
|
'nation'=>$nationID,
|
||||||
@@ -162,9 +207,9 @@ class NPC{
|
|||||||
'age'=>$age,
|
'age'=>$age,
|
||||||
'belong'=>1,
|
'belong'=>1,
|
||||||
'personal'=>$ego,
|
'personal'=>$ego,
|
||||||
'special'=>$this->charDomestic,
|
'special'=>$charDomestic,
|
||||||
'specage'=>$specage,
|
'specage'=>$specage,
|
||||||
'special2'=>$this->charWar,
|
'special2'=>$charWar,
|
||||||
'specage2'=>$specage2,
|
'specage2'=>$specage2,
|
||||||
'npcmsg'=>$this->text,
|
'npcmsg'=>$this->text,
|
||||||
'makelimit'=>0,
|
'makelimit'=>0,
|
||||||
|
|||||||
+19
-12
@@ -32,7 +32,7 @@ class ScoutMessage extends Message{
|
|||||||
$this->validScout = false;
|
$this->validScout = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->validUntil <= new DateTime()){
|
if($this->validUntil <= new \DateTime()){
|
||||||
$this->validScout = false;
|
$this->validScout = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ class ScoutMessage extends Message{
|
|||||||
/**
|
/**
|
||||||
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
||||||
*/
|
*/
|
||||||
public function agreeMessage(int $receiverID):int{
|
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||||
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
||||||
|
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
@@ -72,7 +72,7 @@ class ScoutMessage extends Message{
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$helper = new Engine\Personnel($this->src->nationID);
|
$helper = new Engine\Personnel($this->src->nationID, $this->src->generalID);
|
||||||
|
|
||||||
list($result, $reason) = $helper->scoutGeneral($receiverID);
|
list($result, $reason) = $helper->scoutGeneral($receiverID);
|
||||||
|
|
||||||
@@ -96,6 +96,13 @@ class ScoutMessage extends Message{
|
|||||||
['no'=>$this->src->generalID],
|
['no'=>$this->src->generalID],
|
||||||
["<C>●</><Y>{$this->dest->generalName}</> 등용에 성공했습니다."]
|
["<C>●</><Y>{$this->dest->generalName}</> 등용에 성공했습니다."]
|
||||||
);
|
);
|
||||||
|
pushGeneralHistory(
|
||||||
|
['no'=>$this->src->generalID],
|
||||||
|
"<C>●</>{$helper->year}년 {$helper->month}월:<Y>{$this->dest->generalName}</> 등용에 성공");
|
||||||
|
pushGeneralHistory(
|
||||||
|
['no'=>$this->dest->generalID],
|
||||||
|
"<C>●</>{$helper->year}년 {$helper->month}월:<D>{$this->src->nationName}</>(으)로 망명"
|
||||||
|
);
|
||||||
pushGeneralPublicRecord(
|
pushGeneralPublicRecord(
|
||||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 <S>망명</>하였습니다."],
|
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 <S>망명</>하였습니다."],
|
||||||
$helper->year,
|
$helper->year,
|
||||||
@@ -106,12 +113,12 @@ class ScoutMessage extends Message{
|
|||||||
self::MSGTYPE_PRIVATE,
|
self::MSGTYPE_PRIVATE,
|
||||||
$this->src,
|
$this->src,
|
||||||
$this->dest,
|
$this->dest,
|
||||||
"{$scoutNation['name']}(으)로 등용 제의 수락",
|
"{$this->src->nationName}(으)로 등용 제의 수락",
|
||||||
new \DateTime(),
|
new \DateTime(),
|
||||||
new \DateTime('9999-12-31'),
|
new \DateTime('9999-12-31'),
|
||||||
Json::encode([
|
[
|
||||||
'delete'=>$this->id
|
'delete'=>$this->id
|
||||||
])
|
]
|
||||||
);
|
);
|
||||||
$newMsg->send(true);
|
$newMsg->send(true);
|
||||||
|
|
||||||
@@ -127,19 +134,19 @@ class ScoutMessage extends Message{
|
|||||||
self::MSGTYPE_PRIVATE,
|
self::MSGTYPE_PRIVATE,
|
||||||
$this->src,
|
$this->src,
|
||||||
$this->dest,
|
$this->dest,
|
||||||
"{$scoutNation['name']}(으)로 등용 제의 거부",
|
"{$this->src->nationName}(으)로 등용 제의 거부",
|
||||||
new \DateTime(),
|
new \DateTime(),
|
||||||
new \DateTime('9999-12-31'),
|
new \DateTime('9999-12-31'),
|
||||||
Json::encode([
|
[
|
||||||
'delete'=>$this->id
|
'delete'=>$this->id
|
||||||
])
|
]
|
||||||
);
|
);
|
||||||
$newMsg->send(true);
|
$newMsg->send(true);
|
||||||
|
|
||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function declineMessage(int $receiverID):int{
|
public function declineMessage(int $receiverID, string &$reason):int{
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
||||||
}
|
}
|
||||||
@@ -167,8 +174,8 @@ class ScoutMessage extends Message{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$srcGeneral = $db->queryFirstRow('SELECT `name`, nation FROM nation WHERE `no`=%i', $srcGeneralID);
|
$srcGeneral = $db->queryFirstRow('SELECT `name`, nation FROM general WHERE `no`=%i', $srcGeneralID);
|
||||||
$destGeneral = $db->queryFirstRow('SELECT `name`, nation, `level` FROM nation WHERE `no`=%i', $destGeneralID);
|
$destGeneral = $db->queryFirstRow('SELECT `name`, nation, `level` FROM general WHERE `no`=%i', $destGeneralID);
|
||||||
if($date === null){
|
if($date === null){
|
||||||
$date = new \DateTime();
|
$date = new \DateTime();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,45 +26,58 @@ class SpecialityConst{
|
|||||||
|
|
||||||
//음수 : 절대값 %, 양수 : 상대적 비중
|
//음수 : 절대값 %, 양수 : 상대적 비중
|
||||||
const DOMESTIC = [
|
const DOMESTIC = [
|
||||||
1 => ['경작', 1, self::STAT_INTEL],
|
1 => ['경작', 1, [self::STAT_INTEL]],
|
||||||
2 => ['상재', 1, self::STAT_INTEL],
|
2 => ['상재', 1, [self::STAT_INTEL]],
|
||||||
3 => ['발명', 1, self::STAT_INTEL],
|
3 => ['발명', 1, [self::STAT_INTEL]],
|
||||||
|
|
||||||
10 => ['축성', 1, self::STAT_POWER],
|
10 => ['축성', 1, [self::STAT_POWER]],
|
||||||
11 => ['수비', 1, self::STAT_POWER],
|
11 => ['수비', 1, [self::STAT_POWER]],
|
||||||
12 => ['통찰', 1, self::STAT_POWER],
|
12 => ['통찰', 1, [self::STAT_POWER]],
|
||||||
|
|
||||||
20 => ['인덕', 1, self::STAT_LEADERSHIP],
|
20 => ['인덕', 1, [self::STAT_LEADERSHIP]],
|
||||||
|
|
||||||
30 => ['거상', -2.5, self::DISABLED],
|
30 => ['거상', -2.5, [self::DISABLED]],
|
||||||
31 => ['귀모', -2.5, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
31 => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
];
|
];
|
||||||
|
|
||||||
const WAR = [
|
const WAR = [
|
||||||
40 => ['귀병', 1, self::STAT_INTEL | self::ARMY_WIZARD | self::REQ_DEXTERITY],
|
40 => ['귀병', 1, [self::STAT_INTEL | self::ARMY_WIZARD | self::REQ_DEXTERITY]],
|
||||||
|
|
||||||
41 => ['신산', 1, self::STAT_INTEL | self::ARMY_WIZARD],
|
41 => ['신산', 1, [self::STAT_INTEL]],
|
||||||
42 => ['환술', -5, self::STAT_INTEL | self::ARMY_WIZARD],
|
42 => ['환술', -5, [self::STAT_INTEL]],
|
||||||
43 => ['집중', 1, self::STAT_INTEL | self::ARMY_WIZARD],
|
43 => ['집중', 1, [self::STAT_INTEL]],
|
||||||
44 => ['신중', 1, self::STAT_INTEL | self::ARMY_WIZARD],
|
44 => ['신중', 1, [self::STAT_INTEL]],
|
||||||
45 => ['반계', 1, self::STAT_INTEL | self::ARMY_WIZARD],
|
45 => ['반계', 1, [self::STAT_INTEL]],
|
||||||
|
|
||||||
50 => ['보병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_FOOTMAN],
|
50 => ['보병', 1, [
|
||||||
51 => ['궁병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_ARCHER],
|
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_FOOTMAN,
|
||||||
52 => ['기병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_CAVALRY],
|
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_FOOTMAN
|
||||||
53 => ['공성', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_SIEGE],
|
]],
|
||||||
|
51 => ['궁병', 1, [
|
||||||
|
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_ARCHER,
|
||||||
|
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_ARCHER
|
||||||
|
]],
|
||||||
|
52 => ['기병', 1, [
|
||||||
|
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_CAVALRY,
|
||||||
|
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_CAVALRY
|
||||||
|
]],
|
||||||
|
53 => ['공성', 1, [
|
||||||
|
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_SIEGE,
|
||||||
|
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_SIEGE,
|
||||||
|
self::STAT_INTEL | self::REQ_DEXTERITY | self::ARMY_SIEGE
|
||||||
|
]],
|
||||||
|
|
||||||
60 => ['돌격', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
|
60 => ['돌격', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
|
||||||
61 => ['무쌍', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
|
61 => ['무쌍', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
|
||||||
62 => ['견고', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
|
62 => ['견고', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
|
||||||
63 => ['위압', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
|
63 => ['위압', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
|
||||||
|
|
||||||
70 => ['저격', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
70 => ['저격', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
71 => ['필살', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
71 => ['필살', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
72 => ['징병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
72 => ['징병', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
73 => ['의술', -2, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
73 => ['의술', -2, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
74 => ['격노', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
74 => ['격노', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
75 => ['척사', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
|
75 => ['척사', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function getInvDomestic(string $name){
|
public static function getInvDomestic(string $name){
|
||||||
@@ -101,15 +114,19 @@ class SpecialityConst{
|
|||||||
|
|
||||||
private static function calcCondGeneric(array $general) : int {
|
private static function calcCondGeneric(array $general) : int {
|
||||||
$myCond = 0;
|
$myCond = 0;
|
||||||
|
|
||||||
|
$leader = $general['leader']??50;
|
||||||
|
$power = $general['power']??50;
|
||||||
|
$intel = $general['intel']??50;
|
||||||
|
|
||||||
if ($leader * 0.95 > $power && $leader * 0.95 > $intel) {
|
if ($leader * 0.95 > $power && $leader * 0.95 > $intel) {
|
||||||
$myCond |= STAT_LEADERSHIP;
|
$myCond |= self::STAT_LEADERSHIP;
|
||||||
}
|
}
|
||||||
else if($power >= $intel){
|
else if($power >= $intel){
|
||||||
$myCond |= STAT_POWER;
|
$myCond |= self::STAT_POWER;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$myCond |= STAT_INTEL;
|
$myCond |= self::STAT_INTEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $myCond;
|
return $myCond;
|
||||||
@@ -117,11 +134,11 @@ class SpecialityConst{
|
|||||||
|
|
||||||
private static function calcCondDexterity(array $general) : int {
|
private static function calcCondDexterity(array $general) : int {
|
||||||
$dex = [
|
$dex = [
|
||||||
static::ARMY_FOOTMAN => $general['dex0'],
|
static::ARMY_FOOTMAN => $general['dex0']??0,
|
||||||
static::ARMY_ARCHER => $general['dex10'],
|
static::ARMY_ARCHER => $general['dex10']??0,
|
||||||
static::ARMY_CAVALRY => $general['dex20'],
|
static::ARMY_CAVALRY => $general['dex20']??0,
|
||||||
static::ARMY_WIZARD => $general['dex30'],
|
static::ARMY_WIZARD => $general['dex30']??0,
|
||||||
static::ARMY_SIEGE => $general['dex40'],
|
static::ARMY_SIEGE => $general['dex40']??0,
|
||||||
];
|
];
|
||||||
|
|
||||||
$dexSum = array_sum($dex);
|
$dexSum = array_sum($dex);
|
||||||
@@ -135,7 +152,7 @@ class SpecialityConst{
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($dexSum){
|
if(!$dexSum){
|
||||||
return array_rand($dex);
|
return array_rand($dex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,10 +165,18 @@ class SpecialityConst{
|
|||||||
|
|
||||||
$myCond = static::calcCondGeneric($general);
|
$myCond = static::calcCondGeneric($general);
|
||||||
|
|
||||||
foreach(self::DOMESTIC as $id=>list($name, $weight, $cond)){
|
foreach(self::DOMESTIC as $id=>list($name, $weight, $conds)){
|
||||||
if(!($cond & $myCond)){
|
$valid = false;
|
||||||
|
foreach($conds as $cond){
|
||||||
|
if($cond === ($cond & $myCond)){
|
||||||
|
$valid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$valid){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($weight < 0){
|
if($weight < 0){
|
||||||
$pAbs[$id] = -$weight;
|
$pAbs[$id] = -$weight;
|
||||||
@@ -162,14 +187,21 @@ class SpecialityConst{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($pAbs){
|
if($pAbs){
|
||||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
if($pRel){
|
||||||
|
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||||
|
}
|
||||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||||
if($id){
|
if($id){
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Util::choiceRandomUsingWeight($pRel);
|
$id = Util::choiceRandomUsingWeight($pRel);
|
||||||
|
if($id){
|
||||||
|
return $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return static::pickStatickWar($general);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function pickSpecialWar(array $general) : int{
|
public static function pickSpecialWar(array $general) : int{
|
||||||
@@ -180,8 +212,15 @@ class SpecialityConst{
|
|||||||
$myCond = static::calcCondGeneric($general);
|
$myCond = static::calcCondGeneric($general);
|
||||||
$myCond |= static::calcCondDexterity($general);
|
$myCond |= static::calcCondDexterity($general);
|
||||||
|
|
||||||
foreach(self::WAR as $id=>list($name, $weight, $cond)){
|
foreach(self::WAR as $id=>list($name, $weight, $conds)){
|
||||||
if(!($cond & $myCond)){
|
$valid = false;
|
||||||
|
foreach($conds as $cond){
|
||||||
|
if($cond === ($cond & $myCond)){
|
||||||
|
$valid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$valid){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,13 +240,21 @@ class SpecialityConst{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($pAbs){
|
if($pAbs){
|
||||||
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
if($pRel){
|
||||||
|
$pAbs[0] = max(0, 100 - array_sum($pAbs));
|
||||||
|
}
|
||||||
|
|
||||||
$id = Util::choiceRandomUsingWeight($pAbs);
|
$id = Util::choiceRandomUsingWeight($pAbs);
|
||||||
if($id){
|
if($id){
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Util::choiceRandomUsingWeight($pRel);
|
$id = Util::choiceRandomUsingWeight($pRel);
|
||||||
|
if($id){
|
||||||
|
return $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return static::pickStatickWar($general);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"title":"【역사모드1】 황건적의 난",
|
"title":"【역사모드1】 황건적의 난",
|
||||||
"startYear":184,
|
"startYear":181,
|
||||||
"life":1,
|
"life":1,
|
||||||
"fiction":0,
|
"fiction":0,
|
||||||
"nation":[
|
"nation":[
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"title":"【역사모드10】 칠종칠금",
|
"title":"【역사모드10】 칠종칠금",
|
||||||
"startYear":225,
|
"startYear":222,
|
||||||
"life":1,
|
"life":1,
|
||||||
"fiction":0,
|
"fiction":0,
|
||||||
"nation":[
|
"nation":[
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user