Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44eed2c1df | ||
|
|
e83b182e4d | ||
|
|
888a76eda0 | ||
|
|
668364e583 | ||
|
|
35c7a2d1b6 | ||
|
|
79803178cd | ||
|
|
419ee8d8ff | ||
|
|
328b3c9409 | ||
|
|
f097508e87 | ||
|
|
e6791ee8ec | ||
|
|
cfbeba3de1 | ||
|
|
bbc7f5a734 | ||
|
|
e8726f03f3 | ||
|
|
de95c6d698 | ||
|
|
86b57447d8 | ||
|
|
c9d1efc6e7 | ||
|
|
dd1eeaddfa | ||
|
|
7f098db3de | ||
|
|
6468cbbfbd | ||
|
|
a30d61e842 | ||
|
|
e0029fdc87 | ||
|
|
712e2c32a0 | ||
|
|
f28e15b567 | ||
|
|
128e33661f | ||
|
|
3916561c62 | ||
|
|
00638d074a | ||
|
|
ca51b2d83a | ||
|
|
1a879f97a2 | ||
|
|
89d18cb7c5 | ||
|
|
4e14249707 | ||
|
|
41f2c08da8 | ||
|
|
4fca7bcfcf | ||
|
|
232725329a | ||
|
|
88247851f4 | ||
|
|
6efaec6642 | ||
|
|
b9e31e39e2 | ||
|
|
e2cd8ed391 | ||
|
|
8a1641fbfa | ||
|
|
936f069ac3 | ||
|
|
89faad730e | ||
|
|
798ab3e183 | ||
|
|
5508aa4533 | ||
|
|
81b7ebbab6 | ||
|
|
2d06e33e10 | ||
|
|
d8cc820572 | ||
|
|
d0ca46cfde | ||
|
|
513124161e | ||
|
|
7cfd8c7f79 | ||
|
|
c32ce5e795 | ||
|
|
d9c1530651 | ||
|
|
305eb071a9 | ||
|
|
10dab69c63 | ||
|
|
60ed594996 | ||
|
|
e60ddb3ee1 | ||
|
|
26b0992285 | ||
|
|
63f3ac807c | ||
|
|
ed1c33eac0 | ||
|
|
e7b7fd0bcc | ||
|
|
79d2b04721 | ||
|
|
5a8ab2d29c | ||
|
|
ed527ac394 | ||
|
|
bf09f48196 | ||
|
|
2a5af15aef | ||
|
|
1f8fe35e25 | ||
|
|
5979273a64 | ||
|
|
ef8c9e3968 | ||
|
|
baa9fdb660 | ||
|
|
35a860bb38 | ||
|
|
286939dc2c | ||
|
|
dd5b1dbdd8 | ||
|
|
fb8d3a038d | ||
|
|
ea5a25a671 | ||
|
|
d21fc4ab1d | ||
|
|
3ae3974866 | ||
|
|
71ffc3087e | ||
|
|
8f406489d4 | ||
|
|
a08d270968 | ||
|
|
48f13e4b82 | ||
|
|
51060f0e4b | ||
|
|
c583109046 | ||
|
|
cf05b693f1 | ||
|
|
d248c1ab0d | ||
|
|
34623fca94 | ||
|
|
975bdd5897 | ||
|
|
1b3380c2ca | ||
|
|
bb707b4a03 | ||
|
|
acb3b6ac85 | ||
|
|
80f6985f5f | ||
|
|
5e3a9c0579 | ||
|
|
b30d62d483 | ||
|
|
0ea1fdbd19 | ||
|
|
f068586f74 | ||
|
|
463f462e24 | ||
|
|
e0c4e3c58e | ||
|
|
5aa3ef38ba | ||
|
|
827277f6a3 | ||
|
|
46389341db | ||
|
|
a58f05a295 | ||
|
|
c0b0a0fe92 | ||
|
|
e9f471dd6f | ||
|
|
7917c5dddb | ||
|
|
de4541a3d9 | ||
|
|
77a496baa7 | ||
|
|
86e863de09 | ||
|
|
c2cfd217c2 | ||
|
|
f2366a61b0 | ||
|
|
9959393dee | ||
|
|
16facf98f1 | ||
|
|
bc8ce8832a | ||
|
|
20bcf960ef | ||
|
|
5cecd3e995 | ||
|
|
d7ead25ea4 | ||
|
|
75c0c375d1 | ||
|
|
5db4913292 | ||
|
|
a6a53b1d0d | ||
|
|
81a0c0e120 | ||
|
|
0dae71a644 | ||
|
|
f8eedaa3ea | ||
|
|
ce2d97a7e7 | ||
|
|
2cb570eaca | ||
|
|
c8c4352957 | ||
|
|
a311db4555 | ||
|
|
05c515b2da | ||
|
|
c1acf2b0fe | ||
|
|
803a2407eb | ||
|
|
a87945d1fb | ||
|
|
30793e68df | ||
|
|
9c666bf7a9 | ||
|
|
eff1dd7c34 | ||
|
|
e79a33ebb0 | ||
|
|
cb0adfdeaf | ||
|
|
6b135c343c | ||
|
|
6c92db524b | ||
|
|
b8dfd1c041 | ||
|
|
54d6347c1d | ||
|
|
4ea6e90600 | ||
|
|
4c7628a247 | ||
|
|
6c7334155a | ||
|
|
480e3ea974 | ||
|
|
1f639a5bc6 | ||
|
|
ccf3b07c3a | ||
|
|
d8508f2b72 | ||
|
|
5e13961ec8 | ||
|
|
80b1139371 | ||
|
|
635b41765c | ||
|
|
4b03686aa2 | ||
|
|
bfb0d8d639 | ||
|
|
93d4a0211d | ||
|
|
cd31bc69ef | ||
|
|
4a7b84d6de | ||
|
|
3142714c11 | ||
|
|
7ea10416a9 | ||
|
|
3e427db0f1 | ||
|
|
9f7b18d294 | ||
|
|
9af0e351b8 | ||
|
|
5c6aa2340d | ||
|
|
4424ec48cf | ||
|
|
61be34581e | ||
|
|
731978356d | ||
|
|
d5223ad1ab | ||
|
|
7cfdfab198 | ||
|
|
eb70e51ac1 | ||
|
|
1d48e7c7ae | ||
|
|
d6fc9fc8c3 | ||
|
|
8ada0976fe | ||
|
|
389ff5e9a4 | ||
|
|
5179e0228c | ||
|
|
2268526314 | ||
|
|
db4bc0eafe | ||
|
|
6edaf79df1 | ||
|
|
79cead3b59 | ||
|
|
db1b12b85c | ||
|
|
9360b7675a | ||
|
|
9c82fd17fe | ||
|
|
3a4665e473 | ||
|
|
b34f4648ee | ||
|
|
0de786d2ea | ||
|
|
ec7aafa1ff | ||
|
|
30c219716d | ||
|
|
5dd47cb89b | ||
|
|
abe856bd3f | ||
|
|
6ecb009466 | ||
|
|
3b4b2383a8 | ||
|
|
4ddd46c4a2 | ||
|
|
69ec2469b4 | ||
|
|
5789af801a | ||
|
|
7171b6302b | ||
|
|
51d4818b1e | ||
|
|
1c2875e7fc | ||
|
|
5048a88310 | ||
|
|
aef37f4362 | ||
|
|
d04641041b | ||
|
|
67b2ccea86 | ||
|
|
5ff9ca3c99 | ||
|
|
fe55df8b2f | ||
|
|
457f605898 | ||
|
|
0f2625133f | ||
|
|
fa34dbdf6f | ||
|
|
050913b0b4 | ||
|
|
a47e47d42c | ||
|
|
43d994b59a | ||
|
|
e8204d46ce | ||
|
|
fece659cfb | ||
|
|
695265b299 | ||
|
|
b652ed0b33 | ||
|
|
9a641552e4 | ||
|
|
3d18aeb5bc | ||
|
|
b545afce50 | ||
|
|
8fca98c0c9 | ||
|
|
0a98c71dfe | ||
|
|
ed75f39094 | ||
|
|
456245f23a | ||
|
|
b4529c9338 | ||
|
|
0ca7a8ab8a | ||
|
|
02f2209e8f | ||
|
|
fb72d02912 | ||
|
|
665fb25fc1 | ||
|
|
742c3c7156 | ||
|
|
637dbbba0d | ||
|
|
f2a3bc4626 | ||
|
|
e8ffa44544 | ||
|
|
bc09287666 | ||
|
|
392d9055fe | ||
|
|
0ee833d7ae | ||
|
|
3074bc00d7 | ||
|
|
cb6fb590c4 | ||
|
|
a7270b2cd2 | ||
|
|
0d925af065 | ||
|
|
7c7991e8ae | ||
|
|
54461b6ea4 | ||
|
|
6a17497fbd | ||
|
|
84f18aa4b6 | ||
|
|
73ab38563f | ||
|
|
1f2b40e4d4 | ||
|
|
1d920c5935 | ||
|
|
037a1e9c0c | ||
|
|
87e324d4d9 | ||
|
|
d1e9b489e3 | ||
|
|
34f1d538d1 | ||
|
|
fb8d2a2e01 | ||
|
|
837db5183e | ||
|
|
a556877a17 | ||
|
|
bcbd6dc4db | ||
|
|
41f7ad8d75 | ||
|
|
258d4b28da | ||
|
|
31e900c422 | ||
|
|
7b1a76871a | ||
|
|
c6f3e7672f | ||
|
|
540c31903c | ||
|
|
3e5262d7a3 | ||
|
|
2b36ffef45 | ||
|
|
4c25d2275c | ||
|
|
6c66fcdfc3 | ||
|
|
aaa972d767 | ||
|
|
45c8538426 | ||
|
|
95702724a9 | ||
|
|
98c4d3853c | ||
|
|
7c91143f39 | ||
|
|
56e6f57568 | ||
|
|
ccab456679 | ||
|
|
5af000ca43 | ||
|
|
354c8f04ae | ||
|
|
3fbd336b45 | ||
|
|
3c0b86a322 | ||
|
|
fca4b69d5a | ||
|
|
ce62072761 | ||
|
|
93dd7a8478 | ||
|
|
02fb84a312 | ||
|
|
f3e68989e5 | ||
|
|
468050a9ce | ||
|
|
f37a602da3 | ||
|
|
2979691d7e | ||
|
|
72920a0432 | ||
|
|
e81075ef04 | ||
|
|
df1a99d877 | ||
|
|
10e825dc9f | ||
|
|
07ba7933fb | ||
|
|
3059eac0fd | ||
|
|
aa33aa6d4f | ||
|
|
0a1cdeeaa3 | ||
|
|
e4bef47b7e | ||
|
|
f551f994b5 | ||
|
|
4b7a3af691 | ||
|
|
6f88a80118 | ||
|
|
e03715ee46 |
@@ -45,3 +45,4 @@ test.php
|
||||
|
||||
phpinfo.php
|
||||
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
|
||||
*.sqlite3
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
"pguardiario/phpuri": "^1.0",
|
||||
"symfony/lock": "^4.1",
|
||||
"ezyang/htmlpurifier": "^4.10",
|
||||
"xemlock/htmlpurifier-html5": "^0.1.7"
|
||||
"xemlock/htmlpurifier-html5": "^0.1.7",
|
||||
"catfan/medoo": "^1.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "43da7d5e9d8441faa4311f32b16ee1c0",
|
||||
"content-hash": "3fceaf3c2925068c7e757ab12036e29e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brandonwamboldt/utilphp",
|
||||
@@ -52,6 +52,65 @@
|
||||
],
|
||||
"time": "2015-02-02T17:56:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "catfan/medoo",
|
||||
"version": "v1.5.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/catfan/Medoo.git",
|
||||
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/catfan/Medoo/zipball/8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pdo": "*",
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-pdo_dblib": "For MSSQL or Sybase database on Linux/UNIX platform",
|
||||
"ext-pdo_mysql": "For MySQL or MariaDB database",
|
||||
"ext-pdo_oci": "For Oracle database",
|
||||
"ext-pdo_oci8": "For Oracle version 8 database",
|
||||
"ext-pdo_pqsql": "For PostgreSQL database",
|
||||
"ext-pdo_sqlite": "For SQLite database",
|
||||
"ext-pdo_sqlsrv": "For MSSQL database"
|
||||
},
|
||||
"type": "framework",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Medoo\\": "/src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Angel Lai",
|
||||
"email": "angel@catfan.me"
|
||||
}
|
||||
],
|
||||
"description": "The lightest PHP database framework to accelerate development",
|
||||
"homepage": "https://medoo.in",
|
||||
"keywords": [
|
||||
"database",
|
||||
"lightweight",
|
||||
"mariadb",
|
||||
"mssql",
|
||||
"mysql",
|
||||
"oracle",
|
||||
"php framework",
|
||||
"postgresql",
|
||||
"sql",
|
||||
"sqlite"
|
||||
],
|
||||
"time": "2018-06-14T18:59:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ezyang/htmlpurifier",
|
||||
"version": "v4.10.0",
|
||||
@@ -318,16 +377,16 @@
|
||||
},
|
||||
{
|
||||
"name": "leafo/scssphp",
|
||||
"version": "v0.7.6",
|
||||
"version": "v0.7.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/leafo/scssphp.git",
|
||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794"
|
||||
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -366,7 +425,7 @@
|
||||
"scss",
|
||||
"stylesheet"
|
||||
],
|
||||
"time": "2018-05-24T02:18:53+00:00"
|
||||
"time": "2018-07-22T01:22:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/plates",
|
||||
@@ -751,16 +810,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/lock",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/lock.git",
|
||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a"
|
||||
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -808,7 +867,7 @@
|
||||
"redlock",
|
||||
"semaphore"
|
||||
],
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
"time": "2018-06-21T11:15:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/valitron",
|
||||
|
||||
@@ -61,6 +61,7 @@ a.just_link {
|
||||
}
|
||||
|
||||
button.with_skin {
|
||||
padding:0 4px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
@@ -89,4 +90,78 @@ input.with_skin:disabled {
|
||||
|
||||
caption.section_title {
|
||||
caption-side:top;
|
||||
}
|
||||
|
||||
|
||||
.samButton{
|
||||
float:left;
|
||||
display:block;
|
||||
padding:0;
|
||||
margin:0;
|
||||
text-decoration: none;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
a.samButton.disabled {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.samButtonOuter{
|
||||
display: table;
|
||||
border: outset 2px white;
|
||||
box-sizing: border-box;
|
||||
font-weight:bold;
|
||||
padding: 1px 6px;
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#000000;
|
||||
color:#ffffff;
|
||||
}
|
||||
|
||||
.samButtonOuter:active{
|
||||
border: inset 2px white;
|
||||
}
|
||||
|
||||
|
||||
.samButtonInner{
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.samToolbarButton > .samButtonOuter{
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#225500;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.samToolbarButton2 > .samButtonOuter{
|
||||
width:125px;
|
||||
height:30px;
|
||||
background-color:#225500;
|
||||
color:magenta;
|
||||
}
|
||||
|
||||
.samCommandButton > .samButtonOuter{
|
||||
width:111px;
|
||||
height:30px;
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter{
|
||||
background-color:transparent !important;
|
||||
color:gray !important;
|
||||
border-color:transparent !important;
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::before{
|
||||
content:'【'
|
||||
}
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
|
||||
content:'】'
|
||||
}
|
||||
@@ -87,6 +87,17 @@ input::-webkit-input-placeholder {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.full-content {
|
||||
position:fixed;
|
||||
left:0;
|
||||
top:0;
|
||||
width:100%;
|
||||
height:100%;
|
||||
margin:0;
|
||||
padding:0;
|
||||
z-index:800;
|
||||
}
|
||||
|
||||
#btn_kakao_login{
|
||||
cursor: pointer;
|
||||
height:46px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@charset "utf-8";
|
||||
|
||||
#user_info_container{
|
||||
width:500px;
|
||||
width:550px;
|
||||
position:absolute;
|
||||
left:50%;
|
||||
margin-left:-250px;
|
||||
|
||||
|
After Width: | Height: | Size: 341 B |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 386 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@@ -49,40 +49,86 @@ function getFriendlyErrorType($type)
|
||||
return "{$type}";
|
||||
}
|
||||
|
||||
function getExceptionTraceAsString($exception) {
|
||||
//https://gist.github.com/abtris/1437966
|
||||
$rtn = "";
|
||||
$count = 0;
|
||||
$rtn = [];
|
||||
foreach ($exception->getTrace() as $frame) {
|
||||
$args = "";
|
||||
if (isset($frame['args'])) {
|
||||
$args = array();
|
||||
foreach ($frame['args'] as $arg) {
|
||||
if (is_string($arg)) {
|
||||
$args[] = "'" . $arg . "'";
|
||||
} elseif (is_array($arg)) {
|
||||
$args[] = "Array";
|
||||
} elseif (is_null($arg)) {
|
||||
$args[] = 'NULL';
|
||||
} elseif (is_bool($arg)) {
|
||||
$args[] = ($arg) ? "true" : "false";
|
||||
} elseif (is_object($arg)) {
|
||||
$args[] = get_class($arg);
|
||||
} elseif (is_resource($arg)) {
|
||||
$args[] = get_resource_type($arg);
|
||||
} else {
|
||||
$args[] = $arg;
|
||||
}
|
||||
}
|
||||
$args = join(", ", $args);
|
||||
}
|
||||
$rtn[] = sprintf( "#%s %s:%s %s(%s)",
|
||||
$count,
|
||||
isset($frame['file']) ? $frame['file'] : 'unknown file',
|
||||
isset($frame['line']) ? $frame['line'] : 'unknown line',
|
||||
(isset($frame['class'])) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
|
||||
$args );
|
||||
$count++;
|
||||
}
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
function logError(string $err, string $errstr, array $trace){
|
||||
$fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
|
||||
$date = date("Ymd_His");
|
||||
|
||||
$trace = array_map(function(string $text){
|
||||
return str_replace(ROOT, '{ROOT}', $text);
|
||||
}, $trace);
|
||||
|
||||
$fdb->insert('err_log', [
|
||||
'date'=>$date,
|
||||
'err'=>$err,
|
||||
'errstr'=>$errstr,
|
||||
'trace'=>Json::encode($trace)
|
||||
]);
|
||||
}
|
||||
|
||||
function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
|
||||
if (!(error_reporting() & $errno)) {
|
||||
// This error code is not included in error_reporting, so let it fall
|
||||
// through to the standard PHP error handler
|
||||
return false;
|
||||
}
|
||||
|
||||
$date = date("Ymd_His");
|
||||
|
||||
$e = new \Exception();
|
||||
|
||||
$data = Json::encode([
|
||||
'date'=>$date,
|
||||
'err'=>getFriendlyErrorType($errno),
|
||||
'errstr'=>$errstr,
|
||||
'trace'=>explode("\n", $e->getTraceAsString())
|
||||
], Json::PRETTY);
|
||||
|
||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
||||
logError(
|
||||
getFriendlyErrorType($errno),
|
||||
$errstr,
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
}
|
||||
set_error_handler("\sammo\logErrorByCustomHandler");
|
||||
|
||||
|
||||
function logExceptionByCustomHandler(\Throwable $e){
|
||||
|
||||
$date = date("Ymd_His");
|
||||
|
||||
$data = Json::encode([
|
||||
'date'=>$date,
|
||||
'err'=>get_class($e),
|
||||
'errstr'=>$e->getMessage(),
|
||||
'trace'=>explode("\n", $e->getTraceAsString())
|
||||
], Json::PRETTY);
|
||||
|
||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
||||
logError(
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
|
||||
echo $e->getTraceAsString();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ require(__dir__.'/../vendor/autoload.php');
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>설치</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/sha512.min.js')?>
|
||||
<?=WebUtil::printJS('../js/common.js')?>
|
||||
<?=WebUtil::printJS('../js/install.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../css/install.css')?>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE IF NOT EXISTS `err_log` (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`date` TEXT NOT NULL,
|
||||
`err` TEXT NOT NULL,
|
||||
`errstr` TEXT NOT NULL,
|
||||
`trace` TEXT NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
|
||||
`date` DESC
|
||||
);
|
||||
@@ -41,18 +41,86 @@
|
||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_spring .map_body{
|
||||
background: url('_tK_gameImagePath_/map1.jpg') no-repeat;
|
||||
/*체 지도*/
|
||||
.map_theme_che.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_summer .map_body{
|
||||
background: url('_tK_gameImagePath_/map2.jpg') no-repeat;
|
||||
.map_theme_che.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_fall .map_body{
|
||||
background: url('_tK_gameImagePath_/map3.jpg') no-repeat;
|
||||
.map_theme_che.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_winter .map_body{
|
||||
background: url('_tK_gameImagePath_/map4.jpg') no-repeat;
|
||||
.map_theme_che.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_che .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/che_road.png') no-repeat;
|
||||
}
|
||||
|
||||
/*미니체 지도*/
|
||||
.map_theme_miniche.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
/*루드라사움 지도*/
|
||||
.map_theme_ludo_rathowm .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/ludo_rathowm/back.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/ludo_rathowm/road.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_spring .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/spring.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_summer .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/summer.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_fall .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/fall.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_winter .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.world_map.map_theme_ludo_rathowm .map_title .map_title_text::before {
|
||||
color:white;
|
||||
content:'LP';
|
||||
margin-right:1ch;
|
||||
}
|
||||
@@ -11,7 +11,9 @@ if($session->userGrade < 4) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -28,7 +30,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
list($turntime, $tnmt_time) = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
[$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
|
||||
$query = "select plock from plock";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -38,7 +40,9 @@ $plock = MYDB_fetch_array($result);
|
||||
<html>
|
||||
<head>
|
||||
<title>삼국지 모의전투 HiDCHe</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -34,7 +36,9 @@ $admin = getAdmin();
|
||||
<html>
|
||||
<head>
|
||||
<title>게임관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -32,7 +34,9 @@ $db = DB::db();
|
||||
<html>
|
||||
<head>
|
||||
<title>회원관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -54,7 +58,7 @@ $db = DB::db();
|
||||
<?php
|
||||
|
||||
echo "
|
||||
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
|
||||
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
|
||||
$generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)');
|
||||
|
||||
foreach($generalList as $general){
|
||||
@@ -72,7 +76,7 @@ echo "
|
||||
</td>
|
||||
<td width=100 align=center>아이템 지급</td>
|
||||
<td width=504>
|
||||
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
|
||||
<select name=weap size=1 style='color:white;background-color:black;font-size:13px'>";
|
||||
for($i=0; $i < 27; $i++) {
|
||||
echo "
|
||||
<option value={$i}>{$i}</option>";
|
||||
|
||||
@@ -6,6 +6,8 @@ include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$weap = Util::getReq('weap', 'int');
|
||||
$genlist = Util::getReq('genlist', 'array_int');
|
||||
$msg = Util::getReq('msg', 'string');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -93,13 +95,13 @@ switch($btn) {
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$db->update('general', [
|
||||
'turn0'=>0,
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 0),
|
||||
'killturn'=>0,
|
||||
'turntime'=>$date,
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "특기 부여":
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
$text = "특기 부여!";
|
||||
|
||||
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
||||
@@ -314,13 +316,13 @@ switch($btn) {
|
||||
break;
|
||||
case "하야입력":
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000045'
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 45)
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "방랑해산":
|
||||
$db->update('general', [
|
||||
'turn0'=>'00000000000047',
|
||||
'turn1'=>'00000000000056'
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 47),
|
||||
'turn1'=>EncodeCommand(0, 0, 0, 56)
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "NPC설정":
|
||||
|
||||
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -35,7 +37,9 @@ $conlimit = $gameStor->conlimit;
|
||||
<html>
|
||||
<head>
|
||||
<title>멀티관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -51,14 +55,9 @@ $conlimit = $gameStor->conlimit;
|
||||
<?php
|
||||
|
||||
echo "
|
||||
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
|
||||
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
|
||||
|
||||
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
|
||||
$style = "style=;";
|
||||
if($general['block'] > 0) { $style .= "background-color:red;"; }
|
||||
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
|
||||
|
||||
@@ -52,7 +52,7 @@ switch($btn) {
|
||||
break;
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
DB::db()->query('update general set turn0=0,killturn=0,turntime=%s where no IN %li',$date, $genlist);
|
||||
DB::db()->query('update general set turn0=%s,killturn=0,turntime=%s where no IN %li',EncodeCommand(0, 0, 0, 0),$date, $genlist);
|
||||
break;
|
||||
case "메세지 전달":
|
||||
//TODO:새 갠메 시스템으로 변경
|
||||
|
||||
@@ -25,7 +25,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -51,7 +53,9 @@ $sel2[$type2] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>일제정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -19,7 +19,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -42,7 +44,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>접속정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -23,7 +23,9 @@ if($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -49,7 +51,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>로그정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -19,7 +19,9 @@ if ($session->userGrade < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -45,7 +47,9 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
<head>
|
||||
<title>외교정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -1140,7 +1140,9 @@ switch($dex240) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title>전투시뮬레이션</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -22,11 +22,18 @@ increaseRefresh("명장일람", 1);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1136" />
|
||||
<title><?=UniqueConst::$serverName?>: 명장일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -67,22 +74,83 @@ $types = [
|
||||
}],
|
||||
["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }],
|
||||
["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }],
|
||||
["승 률", "percent", function($v){$v['value'] = $v['killnum'] / max(1, $v['warnum']); return $v; }],
|
||||
["승 률", "percent", function($v){
|
||||
if($v['warnum'] < 10){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['killnum'] / max(1, $v['warnum']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
|
||||
["살 상 률", "percent", function($v){$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); return $v; }],
|
||||
["살 상 률", "percent", function($v){
|
||||
if($v['warnum'] < 10){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex0']; return $v; }],
|
||||
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex10']; return $v; }],
|
||||
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex20']; return $v; }],
|
||||
["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex30']; return $v; }],
|
||||
["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex40']; return $v; }],
|
||||
["전 력 전 승 률", "percent", function($v){$v['value'] = $v['ttw']/max(1, $v['ttw']+$v['ttd']+$v['ttl']); return $v; }],
|
||||
["통 솔 전 승 률", "percent", function($v){$v['value'] = $v['tlw']/max(1, $v['tlw']+$v['tld']+$v['tll']); return $v; }],
|
||||
["일 기 토 승 률", "percent", function($v){$v['value'] = $v['tpw']/max(1, $v['tpw']+$v['tpd']+$v['tpl']); return $v; }],
|
||||
["설 전 승 률", "percent", function($v){$v['value'] = $v['tiw']/max(1, $v['tiw']+$v['tid']+$v['til']); return $v; }],
|
||||
["전 력 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['ttw']+$v['ttd']+$v['ttl'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['ttw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["통 솔 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tlw']+$v['tld']+$v['tll'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tlw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["일 기 토 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tpw']+$v['tpd']+$v['tpl'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tpw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
["설 전 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tiw']+$v['tid']+$v['til'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tiw']/max(1, $totalCnt);
|
||||
}
|
||||
|
||||
return $v;
|
||||
}],
|
||||
["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }],
|
||||
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
|
||||
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){$v['value'] = $v['betwingold']/max(1, $v['betgold']); return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){
|
||||
if($v['betgold'] < 1000){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['betwingold']/max(1, $v['betgold']);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
];
|
||||
|
||||
$generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
@@ -112,10 +180,15 @@ $generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc){
|
||||
$validCnt = 0;
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){
|
||||
$general = ($typeFunc)($general);
|
||||
$value = $general['value'];
|
||||
|
||||
if($value > 0){
|
||||
$validCnt+=1;
|
||||
}
|
||||
|
||||
if($typeValue == 'percent'){
|
||||
$general['printValue'] = number_format($value*100, 2).'%';
|
||||
}
|
||||
@@ -130,9 +203,10 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
return -($lhs['value'] <=> $rhs['value']);
|
||||
});
|
||||
|
||||
|
||||
echo $templates->render('hallOfFrame', [
|
||||
'typeName'=>$typeName,
|
||||
'generals'=>array_slice($typeGenerals, 0, 10)
|
||||
'generals'=>array_slice($typeGenerals, 0, min(10, $validCnt))
|
||||
]);
|
||||
}
|
||||
?>
|
||||
@@ -144,7 +218,7 @@ $itemTypes = [
|
||||
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
|
||||
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
|
||||
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return getItemName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return displayItemInfo($v);}, 7, 26, []],
|
||||
];
|
||||
|
||||
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
|
||||
|
||||
@@ -4,12 +4,7 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("왕조일람", 1);
|
||||
?>
|
||||
@@ -17,7 +12,9 @@ increaseRefresh("왕조일람", 1);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -27,35 +24,57 @@ increaseRefresh("왕조일람", 1);
|
||||
<body>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
<button onclick=window.close()>창 닫기</button><br>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
if ($select == 0) {
|
||||
$query = "select * from emperior order by no desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$empcount = MYDB_num_rows($result);
|
||||
$showCurrentNation = true;
|
||||
|
||||
for ($i=0; $i < $empcount; $i++) {
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
$emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC');
|
||||
|
||||
if($emperiors){
|
||||
$serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null);
|
||||
if($serverID == UniqueConst::$serverID){
|
||||
$showCurrentNation = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($showCurrentNation) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td style="background-color:#333333;" align=center colspan=8>
|
||||
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
|
||||
|
||||
<a href="a_emperior_detail.php"><button>자세히</button></a>
|
||||
|
||||
<a href="a_history.php"><button>역사 보기</button></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
foreach($emperiors as $emperior){
|
||||
$serverID = $emperior['server_id']??($emperior['serverID']??null);
|
||||
?>
|
||||
|
||||
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
|
||||
<input type=submit value='자세히'>
|
||||
<input type=hidden name=select value='<?=$emperior['no']?>'>
|
||||
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button>자세히</button></a>
|
||||
|
||||
<?php if($emperior['server_id']): ?>
|
||||
<a href="a_history.php?server_id=<?=$emperior['server_id']?>"><button type="button">역사 보기</button></a>
|
||||
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button>역사 보기</button></a>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -88,132 +107,10 @@ if ($select == 0) {
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
die();
|
||||
}
|
||||
|
||||
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
<input type=submit value='전체보기'>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5><?=$emperior['nation_name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5><?=$emperior['nation_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5><?=$emperior['personal_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5><?=$emperior['special_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2><?=$emperior['pop']?></td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2><?=$emperior['poprate']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2><?=$emperior['gold']?></td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2><?=$emperior['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l11name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l7name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5><?=$emperior['tiger']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5><?=$emperior['eagle']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5><?=$emperior['gen']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -17,7 +17,9 @@ increaseRefresh("왕조일람", 2);
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates->registerFunction('ConvertLog', '\sammo\ConvertLog');
|
||||
$templates->registerFunction('newColor', '\sammo\newColor');
|
||||
increaseRefresh("왕조일람", 1);
|
||||
|
||||
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
|
||||
$serverID = $emperior['server_id']??($emperior['serverID']??null);
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td><?=$emperior?'역 대 왕 조':'현 재 왕 조'?><br>
|
||||
<button onclick=window.close()>창 닫기</button>
|
||||
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
if($emperior):
|
||||
?>
|
||||
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5><?=$emperior['nation_name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5><?=$emperior['nation_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5><?=$emperior['personal_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5><?=$emperior['special_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2><?=$emperior['pop']?></td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2><?=$emperior['poprate']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2><?=$emperior['gold']?></td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2><?=$emperior['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l11name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l7name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5><?=$emperior['tiger']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5><?=$emperior['eagle']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5><?=$emperior['gen']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
$showServers = $serverID || (!$emperior);
|
||||
|
||||
if(!$serverID){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
}
|
||||
|
||||
if($showServers){
|
||||
$nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID);
|
||||
foreach($nations as $nation){
|
||||
if(!$nation['nation']??null){
|
||||
continue;
|
||||
}
|
||||
$nation += Json::decode($nation['data']);
|
||||
|
||||
$nation['typeName'] = getNationType($nation['type']);
|
||||
$nation['levelName'] = getNationLevel($nation['level']);
|
||||
if($nation['generals']){
|
||||
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
|
||||
|
||||
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
|
||||
$liveGenerals = $nation['generals'];
|
||||
foreach($generals as $general){
|
||||
if(in_array($general['general_no'], $nation['generals'])){
|
||||
unset($nation['generals'][$general['general_no']]);
|
||||
}
|
||||
}
|
||||
$liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals);
|
||||
$nation['generalsFull'] = array_merge($liveGenerals, $generals);
|
||||
}
|
||||
else{
|
||||
$nation['generalsFull'] = $generals;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$nation['generalsFull'] = [];
|
||||
}
|
||||
|
||||
if(key_exists('aux', $nation) && !is_array($nation['aux'])){
|
||||
$nation += Json::decode($nation['aux']);
|
||||
}
|
||||
|
||||
echo $templates->render('oldNation', $nation);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -37,12 +37,17 @@ if ($type <= 0 || $type > 15) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 장수일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -80,22 +85,22 @@ foreach (getAllNationStaticInfo() as $nation) {
|
||||
}
|
||||
|
||||
switch ($type) { //FIXME: $query 처리 조심.
|
||||
case 1: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
|
||||
case 2: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
|
||||
case 3: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
|
||||
case 4: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
|
||||
case 5: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 6: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
|
||||
case 7: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
|
||||
case 8: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
|
||||
case 1: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
|
||||
case 2: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
|
||||
case 3: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
|
||||
case 4: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
|
||||
case 5: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 6: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
|
||||
case 7: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
|
||||
case 8: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
|
||||
default:
|
||||
case 9: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
|
||||
case 10: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 11: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
|
||||
case 12: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
|
||||
case 13: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
|
||||
case 14: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
|
||||
case 15: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
|
||||
case 9: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
|
||||
case 10: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 11: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
|
||||
case 12: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
|
||||
case 13: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
|
||||
case 14: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
|
||||
case 15: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
|
||||
}
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
@@ -131,20 +136,20 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$lbonus = 0;
|
||||
}
|
||||
if ($lbonus > 0) {
|
||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
||||
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
$lbonus = "";
|
||||
$lbonusText = "";
|
||||
}
|
||||
|
||||
if ($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonus}";
|
||||
$leader = "{$general['leader']}{$lbonusText}";
|
||||
$power = "{$general['power']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
@@ -161,12 +166,19 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "
|
||||
<tr>
|
||||
<tr data-general-id='{$general['no']}'
|
||||
data-general-wounded='{$general['injury']}'
|
||||
data-general-leadership='{$general['leader']}'
|
||||
data-general-leadership-bonus='{$lbonus}'
|
||||
data-general-power='{$general['power']}'
|
||||
data-general-intel='{$general['intel']}'
|
||||
data-is-npc='".($general['npc']>=2?'true':'false')."'
|
||||
>
|
||||
<td align=center><img width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
|
||||
<td align=center>$name</td>
|
||||
<td align=center>{$general['age']}세</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".getHonor($general['experience'])."</td>
|
||||
|
||||
@@ -12,7 +12,7 @@ $db = DB::db();
|
||||
increaseRefresh("명예의전당", 1);
|
||||
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT distinct(scenario_name) as name, count(scenario) as cnt, scenario from ng_games order by scenario asc') as $scenarioInfo){
|
||||
foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){
|
||||
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
|
||||
}
|
||||
|
||||
@@ -32,13 +32,19 @@ else{
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1136" />
|
||||
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJs('js/hallOfFame.js')?>
|
||||
</head>
|
||||
|
||||
@@ -92,10 +98,15 @@ foreach($types as $idx=>[$typeName, $typeValue]) {
|
||||
$hallResult = array_map(function($general)use($typeValue){
|
||||
$aux = Json::decode($general['aux']);
|
||||
$general += $aux;
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
|
||||
if(!key_exists('bgColor', $general)){
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
}
|
||||
else{
|
||||
$general['bgColor'] = $general['color'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!key_exists('fgColor', $general)){
|
||||
$general['fgColor'] = newColor($general['bgColor']);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ include "lib.php";
|
||||
include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$yearmonth = Util::getReq('yearmonth', 'int');
|
||||
$serverID = Util::getReq('server_id', 'string', null);
|
||||
$serverID = Util::getReq('serverID', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -15,7 +15,6 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
if(!$serverID){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
@@ -25,11 +24,9 @@ if($serverID === UniqueConst::$serverID){
|
||||
increaseRefresh("연감", 1);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','map_theme']);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -42,9 +39,21 @@ if ($con >= 2) {
|
||||
[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
|
||||
$s = $s_year * 12 + $s_month;
|
||||
|
||||
if($s_year === null){
|
||||
echo '인자 에러';
|
||||
exit();
|
||||
}
|
||||
|
||||
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
||||
$e = $e_year * 12 + $e_month;
|
||||
|
||||
if($serverID !== UniqueConst::$serverID){
|
||||
$mapTheme = $db->queryFirstField('SELECT map FROM ng_games WHERE server_id=%s', $serverID)?:'che';
|
||||
}
|
||||
else{
|
||||
$mapTheme = $admin['map_theme']??'che';
|
||||
}
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
||||
$year = $s_year;
|
||||
@@ -84,14 +93,18 @@ if ($month <= 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 연감</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS("js/map/theme_{$mapTheme}.js")?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
@@ -131,7 +144,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
||||
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
||||
<tr height=520>
|
||||
<td width=698>
|
||||
<?=getMapHtml();?>
|
||||
<?=getMapHtml($mapTheme);?>
|
||||
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$history['nation']?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$history['power']?></td>
|
||||
@@ -156,10 +169,15 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
reloadWorldMap({
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&server_id=<?=$serverID?>',
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
|
||||
showMe:false,
|
||||
neutralView:true
|
||||
neutralView:true,
|
||||
useCachedMap:false,
|
||||
year:<?=$year?>,
|
||||
month:<?=$month?>,
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -24,10 +24,14 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -25,11 +25,18 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -104,8 +111,8 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>{$general['name2']}</td>
|
||||
<td align=center>Lv {$general['explevel']}</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['sum']}</td>
|
||||
<td align=center>{$general['leader']}</td>
|
||||
<td align=center>{$general['power']}</td>
|
||||
|
||||
@@ -14,6 +14,8 @@ $connect=$db->get();
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn();
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -26,22 +28,28 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
$(function(){
|
||||
|
||||
reloadWorldMap({
|
||||
neutralView:true,
|
||||
showMe:true
|
||||
showMe:true,
|
||||
useCachedMap:true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -59,7 +67,7 @@ $(function(){
|
||||
<?=getGeneralPublicRecordRecent(34)?>
|
||||
</td>
|
||||
<td width=698>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -50,7 +50,9 @@ if ($admin['maxonline'] < $curonline) {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
|
||||
@@ -28,7 +28,9 @@ $vote = $admin['vote']?:['-'];
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 설문조사</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
|
||||
@@ -56,7 +56,9 @@ if ($msg2 == "") {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 거래장</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
@@ -74,7 +74,9 @@ $sel[$type] = "selected";
|
||||
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 감찰부</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -154,7 +156,7 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
<?=getBatResRecent($gen, 24)?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($npc > 1): ?>
|
||||
<?php if($npc > 1 || $meLevel >= 5): ?>
|
||||
<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>
|
||||
|
||||
@@ -55,7 +55,9 @@ if($str3){
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다!");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -26,7 +26,9 @@ if($me['level'] < 5) {
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ for($i= $lv - 1; $i>=5; $i--){
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -21,9 +21,7 @@ $query = "select no,nation,level,city from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,level,spy from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$myNation = MYDB_fetch_array($result);
|
||||
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
@@ -33,7 +31,9 @@ $templates = new \League\Plates\Engine('templates');
|
||||
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 도시정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
@@ -119,27 +119,34 @@ if($me['level'] == 0) {
|
||||
|
||||
if($myNation['level'] > 0) {
|
||||
// 첩보도시도 목록에 추가
|
||||
$where = 'city=0';
|
||||
$cities = array_map('intval',explode("|", $myNation['spy']));
|
||||
foreach($cities as $citySpy) {
|
||||
$city = intdiv($citySpy, 10);
|
||||
$where .= " or city='{$city}'";
|
||||
|
||||
$rawSpy = $myNation['spy'];
|
||||
|
||||
if($rawSpy == ''){
|
||||
$spyCities = [];
|
||||
}
|
||||
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyCities = array_map(function($val){
|
||||
$val = intval($val);
|
||||
return intdiv($val, 10);
|
||||
}, 'intval',explode('|', $myNation['spy']));
|
||||
}
|
||||
else{
|
||||
$spyCities = array_keys(Json::decode($rawSpy));
|
||||
}
|
||||
|
||||
$query = "select city,name,nation from city where {$where}";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
if($spyCities){
|
||||
foreach ($db->query('SELECT city,name,nation FROM city WHERE city in %li', $spyCities) as $city) {
|
||||
echo "<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -163,7 +170,7 @@ if($valid == 0 && $session->userGrade < 5) {
|
||||
|
||||
|
||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
|
||||
$nation = getNationStaticInfo($city['nation']);
|
||||
$cityNation = getNationStaticInfo($city['nation']);
|
||||
|
||||
//태수, 군사, 시중
|
||||
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
|
||||
@@ -173,81 +180,7 @@ $gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $cit
|
||||
if($city['trade'] == 0) {
|
||||
$city['trade'] = "- ";
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=12 align=center style=color:"<?=newColor($nation['color'])?>"; bgcolor=<?=$nation['color']?>>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=46 class=bg1>주민</td>
|
||||
<td align=center width=140><?=$city['pop']?>/<?=$city['pop2']?></td>
|
||||
<td align=center width=46 class=bg1>농업</td>
|
||||
<td align=center width=140><?=$city['agri']?>/<?=$city['agri2']?></td>
|
||||
<td align=center width=46 class=bg1>상업</td>
|
||||
<td align=center width=140><?=$city['comm']?>/<?=$city['comm2']?></td>
|
||||
<td align=center width=46 class=bg1>치안</td>
|
||||
<td align=center width=140><?=$city['secu']?>/<?=$city['secu2']?></td>
|
||||
<td align=center width=46 class=bg1>수비</td>
|
||||
<td align=center width=140><?=$city['def']?>/<?=$city['def2']?></td>
|
||||
<td align=center width=46 class=bg1>성벽</td>
|
||||
<td align=center width=140><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>민심</td>
|
||||
<td align=center><?=$city['rate']?></td>
|
||||
<td align=center class=bg1>시세</td>
|
||||
<td align=center><?=$city['trade']?>%</td>
|
||||
<td align=center class=bg1>인구</td>
|
||||
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
||||
<td align=center class=bg1>태수</td>
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>장수</td>
|
||||
<td colspan=11>
|
||||
<?php
|
||||
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
if($gencount == 0) echo "-";
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
echo "{$general['name']}, ";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 align=center class=bg1>얼 굴</td>
|
||||
<td width=128 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=280 align=center class=bg1>명 령</td>
|
||||
</tr></thead><tbody class='bg0' id='general_list'>
|
||||
|
||||
<?php
|
||||
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
@@ -259,6 +192,9 @@ foreach(getAllNationStaticInfo() as $nation){
|
||||
$nationlevel[$nation['nation']] = $nation['level'];
|
||||
}
|
||||
|
||||
//도시명 오 적군 0/0(0) 병장(총) 0/0(4) 90병장 0/0 60병장 0/0 수비○ 0/0
|
||||
$generalsFormat = [];
|
||||
|
||||
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
@@ -333,7 +269,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$turnText = '';
|
||||
}
|
||||
|
||||
echo $templates->render('cityGeneral', [
|
||||
$generalsFormat[] = [
|
||||
'ourGeneral'=>$ourGeneral,
|
||||
'isNPC'=>$isNPC,
|
||||
'wounded'=>$wounded,
|
||||
@@ -359,7 +295,159 @@ for($j=0; $j < $gencount; $j++) {
|
||||
'nation'=>$nation,
|
||||
'nationName'=>$nationName,
|
||||
'turnText'=>$turnText
|
||||
]);
|
||||
];
|
||||
}
|
||||
|
||||
$generalsName = array_map(function($gen){return $gen['name'];}, $generalsFormat);
|
||||
|
||||
$enemyCrew = 0;
|
||||
$enemyCnt = 0;
|
||||
$enemyArmedCnt = 0;
|
||||
$crew90 = 0;
|
||||
$gen90 = 0;
|
||||
$crew80 = 0;
|
||||
$gen80 = 0;
|
||||
$crew60 = 0;
|
||||
$gen60 = 0;
|
||||
|
||||
$crewDef = 0;
|
||||
$genDef = 0 ;
|
||||
|
||||
$crewTotal = 0;
|
||||
$armedGenTotal = 0;
|
||||
$genTotal = 0;
|
||||
|
||||
|
||||
foreach($generalsFormat as $general){
|
||||
if($general['nation'] == 0){
|
||||
continue;
|
||||
}
|
||||
if($general['nation'] != $myNation['nation']){
|
||||
$enemyCnt += 1;
|
||||
$enemyCrew += $general['crew'];
|
||||
if($general['crew'] > 0){
|
||||
$enemyArmedCnt += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$crewTotal += $general['crew'];
|
||||
$genTotal += 1;
|
||||
|
||||
if($general['crew'] == 0){
|
||||
continue;
|
||||
}
|
||||
$armedGenTotal += 1;
|
||||
|
||||
if($general['train'] >= 90 && $general['atmos'] >= 90){
|
||||
$crew90 += $general['crew'];
|
||||
$gen90 += 1;
|
||||
}
|
||||
|
||||
$chkDef = false;
|
||||
if($general['train'] >= 80 && $general['atmos'] >= 80){
|
||||
$crew80 += $general['crew'];
|
||||
$gen80 += 1;
|
||||
if($general['defenceMode'] == 2){
|
||||
$crewDef += $general['crew'];
|
||||
$genDef += 1;
|
||||
$chkDef = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($general['train'] >= 60 && $general['atmos'] >= 60){
|
||||
$crew60 += $general['crew'];
|
||||
$gen60 += 1;
|
||||
|
||||
if($general['defenceMode'] == 1 && !$chkDef){
|
||||
$crewDef += $general['crew'];
|
||||
$genDef += 1;
|
||||
$chkDef = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=11 align=center style='color:<?=newColor($cityNation['color'])?>; background:<?=$cityNation['color']?>'>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
|
||||
<td style='color:<?=newColor($cityNation['color'])?>; background:<?=$cityNation['color']?>' class='center'><?=date('m-d H:i:s')?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=48 class=bg1>주민</td>
|
||||
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
|
||||
<td align=center width=48 class=bg1>농업</td>
|
||||
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
|
||||
<td align=center width=48 class=bg1>상업</td>
|
||||
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
|
||||
<td align=center width=48 class=bg1>치안</td>
|
||||
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
|
||||
<td align=center width=48 class=bg1>수비</td>
|
||||
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
|
||||
<td align=center width=48 class=bg1>성벽</td>
|
||||
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>민심</td>
|
||||
<td align=center><?=$city['rate']?></td>
|
||||
<td align=center class=bg1>시세</td>
|
||||
<td align=center><?=$city['trade']?>%</td>
|
||||
<td align=center class=bg1>인구</td>
|
||||
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
||||
<td align=center class=bg1>태수</td>
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>도시명</td>
|
||||
<td align=center><?=$city['name']?></td>
|
||||
<td align=center class=bg1>적군</td>
|
||||
<td align=center><?=number_format($enemyCrew)?>/<?=number_format($enemyArmedCnt)?>(<?=number_format($enemyCnt)?>)</td>
|
||||
<td align=center class=bg1>병장(총)</td>
|
||||
<td align=center><?=number_format($crewTotal)?>/<?=number_format($armedGenTotal)?>(<?=number_format($genTotal)?>)</td>
|
||||
<td align=center class=bg1>90병장</td>
|
||||
<td align=center><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
|
||||
<td align=center class=bg1>60병장</td>
|
||||
<td align=center><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
|
||||
<td align=center class=bg1>수비○</td>
|
||||
<td align=center><?=number_format($crewDef)?>/<?=number_format($genDef)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>장수</td>
|
||||
<td colspan=11><?=join(', ', $generalsName)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 align=center class=bg1>얼 굴</td>
|
||||
<td width=128 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=280 align=center class=bg1>명 령</td>
|
||||
</tr></thead>
|
||||
<tbody class='bg0' id='general_list'>
|
||||
<?php
|
||||
foreach($generalsFormat as $general){
|
||||
echo $templates->render('cityGeneral', $general);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
@@ -44,8 +44,14 @@ if ($me['level'] >= 5) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -219,7 +225,7 @@ if ($budgetricediff > 0) {
|
||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메시지</td></tr>
|
||||
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=16000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
||||
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=1000 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>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||
<tr><td colspan=2>870px x 200px를 넘어서는 내용은 표시되지 않습니다.</td></tr>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||
<tr>
|
||||
|
||||
@@ -13,6 +13,8 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("중원정보", 1);
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -45,11 +47,11 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
}
|
||||
|
||||
$realConflict = [];
|
||||
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as list(
|
||||
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as [
|
||||
$cityID,
|
||||
$cityName,
|
||||
$rawConflict
|
||||
))
|
||||
])
|
||||
{
|
||||
$conflict = Json::decode($rawConflict);
|
||||
if (count($conflict)<2) {
|
||||
@@ -75,23 +77,28 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
$(function(){
|
||||
|
||||
reloadWorldMap({
|
||||
neutralView:true,
|
||||
showMe:true
|
||||
showMe:true,
|
||||
useCachedMap:true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
@@ -213,7 +220,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=698 height=420>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$nationStr?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$powerStr?></td>
|
||||
|
||||
@@ -9,8 +9,6 @@ if ($type <= 0 || $type > 8) {
|
||||
$type = 7;
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -19,7 +17,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("암행부", 2);
|
||||
increaseRefresh("암행부", 1);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -43,6 +41,8 @@ if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretli
|
||||
$sel = [];
|
||||
$sel[$type] = "selected";
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -50,17 +50,22 @@ $sel[$type] = "selected";
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다!");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 암행부</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>암 행 부<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<tr><td><form name=form1 method=get>정렬순서 :
|
||||
<select name=type size=1>
|
||||
<option <?=$sel[1]??''?> value=1>자금</option>
|
||||
<option <?=$sel[2]??''?> value=2>군량</option>
|
||||
@@ -75,50 +80,28 @@ $sel[$type] = "selected";
|
||||
</td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select troop,name from troop where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$troopCount = MYDB_num_rows($result);
|
||||
$troopName = [];
|
||||
for ($i=0; $i < $troopCount; $i++) {
|
||||
$troop = MYDB_fetch_array($result);
|
||||
$troopName[$troop['troop']] = $troop['name'];
|
||||
foreach($db->queryAllLists('SELECT troop, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]){
|
||||
$troopName[$troopID] = $tName;
|
||||
}
|
||||
|
||||
$orderSQL = '';
|
||||
switch ($type) {
|
||||
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by gold desc"; break;
|
||||
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by rice desc"; break;
|
||||
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by city"; break;
|
||||
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by crewtype desc"; break;
|
||||
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by crew desc"; break;
|
||||
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by killturn"; break;
|
||||
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by turntime"; break;
|
||||
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by troop desc"; break;
|
||||
case 1: $orderSQL = "order by gold desc"; break;
|
||||
case 2: $orderSQL = "order by rice desc"; break;
|
||||
case 3: $orderSQL = "order by city"; break;
|
||||
case 4: $orderSQL = "order by crewtype desc"; break;
|
||||
case 5: $orderSQL = "order by crew desc"; break;
|
||||
case 6: $orderSQL = "order by killturn"; break;
|
||||
case 7: $orderSQL = "order by turntime"; break;
|
||||
case 8: $orderSQL = "order by troop desc"; break;
|
||||
}
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>이 름</td>
|
||||
<td width=98 align=center id=bg1>통무지</td>
|
||||
<td width=98 align=center id=bg1>부 대</td>
|
||||
<td width=58 align=center id=bg1>자 금</td>
|
||||
<td width=58 align=center id=bg1>군 량</td>
|
||||
<td width=48 align=center id=bg1>도시</td>
|
||||
<td width=28 align=center id=bg1>守</td>
|
||||
<td width=58 align=center id=bg1>병 종</td>
|
||||
<td width=68 align=center id=bg1>병 사</td>
|
||||
<td width=48 align=center id=bg1>훈련</td>
|
||||
<td width=48 align=center id=bg1>사기</td>
|
||||
<td width=148 align=center id=bg1>명 령</td>
|
||||
<td width=58 align=center id=bg1>삭턴</td>
|
||||
<td width=58 align=center id=bg1>턴</td>
|
||||
</tr>";
|
||||
for ($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
$city = CityConst::byID($general['city'])->name;
|
||||
$troop = $troopName[$general['troop']]??'-';
|
||||
$generals = $db->query('SELECT npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general WHERE nation = %i %l', $me['nation'], $orderSQL);
|
||||
|
||||
foreach ($generals as &$general) {
|
||||
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||
$general['troopText'] = $troopName[$general['troop']]??'-';
|
||||
|
||||
if ($general['level'] == 12) {
|
||||
$lbonus = $nation['level'] * 2;
|
||||
@@ -128,81 +111,129 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$lbonus = 0;
|
||||
}
|
||||
if ($lbonus > 0) {
|
||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
||||
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
$lbonus = "";
|
||||
$lbonusText = "";
|
||||
}
|
||||
$general['lbonus'] = $lbonus;
|
||||
$general['lbonusText'] = $lbonusText;
|
||||
|
||||
if ($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonus}";
|
||||
$leader = "{$general['leader']}{$lbonusText}";
|
||||
$power = "{$general['power']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
|
||||
$general['leaderText'] = $leader;
|
||||
$general['powerText'] = $power;
|
||||
$general['intelText'] = $intel;
|
||||
|
||||
$general['expLevelText'] = getExpLevel($general['experience']);
|
||||
|
||||
if ($general['npc'] >= 2) {
|
||||
$name = "<font color=cyan>{$general['name']}</font>";
|
||||
} elseif ($general['npc'] == 1) {
|
||||
$name = "<font color=skyblue>{$general['name']}</font>";
|
||||
} else {
|
||||
$name = "{$general['name']}";
|
||||
$name = $general['name'];
|
||||
}
|
||||
//TODO: npc 코드를 일원화
|
||||
$general['nameText'] = $name;
|
||||
|
||||
switch ($general['mode']) {
|
||||
case 0: $mode = "×"; break;
|
||||
case 1: $mode = "○"; break;
|
||||
case 2: $mode = "◎"; break;
|
||||
case 0: $mode = "×"; break;
|
||||
case 1: $mode = "○"; break;
|
||||
case 2: $mode = "◎"; break;
|
||||
}
|
||||
$general['modeText'] = $mode;
|
||||
$general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name??'-';
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
|
||||
<td align=center>{$leader}∥{$power}∥{$intel}</td>
|
||||
<td align=center>$troop</td>
|
||||
<td align=center>{$general['gold']}</td>
|
||||
<td align=center>{$general['rice']}</td>
|
||||
<td align=center>$city</td>
|
||||
<td 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>
|
||||
<font size=3>NPC 장수";
|
||||
} else {
|
||||
echo "
|
||||
<td>
|
||||
<font size=1>";
|
||||
|
||||
if ($general['npc'] < 2) {
|
||||
$turntext = [];
|
||||
$turn = getTurn($general, 1, 0);
|
||||
|
||||
for ($i=0; $i < 5; $i++) {
|
||||
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 20);
|
||||
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 41);
|
||||
$k = $i+1;
|
||||
echo "
|
||||
$k : $turn[$i] <br>";
|
||||
$turntext[] = " $k : $turn[$i]";
|
||||
}
|
||||
$general['turntext'] = join("<br>\n", $turntext);
|
||||
}
|
||||
echo "
|
||||
</font>
|
||||
</td>
|
||||
<td align=center>{$general['killturn']}</td>
|
||||
<td align=center>".substr($general['turntime'], 14, 5)."</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
</table>
|
||||
";
|
||||
unset($general);
|
||||
|
||||
$genCnt = count($generals);
|
||||
$totalGold = 0;
|
||||
$totalRice = 0;
|
||||
$crew90 = 0;
|
||||
$gen90 = 0;
|
||||
$crew80 = 0;
|
||||
$gen80 = 0;
|
||||
$crew60 = 0;
|
||||
$gen60 = 0;
|
||||
$crewTotal = 0;
|
||||
//$genTotal = 0;
|
||||
foreach($generals as $general){
|
||||
$totalGold += $general['gold'];
|
||||
$totalRice += $general['rice'];
|
||||
|
||||
$crewTotal += $general['crew'];
|
||||
|
||||
if($general['crew'] == 0){
|
||||
continue;
|
||||
}
|
||||
if($general['train'] >= 90 && $general['atmos'] >= 90){
|
||||
$crew90 += $general['crew'];
|
||||
$gen90 += 1;
|
||||
}
|
||||
|
||||
if($general['train'] >= 80 && $general['atmos'] >= 80){
|
||||
$crew80 += $general['crew'];
|
||||
$gen80 += 1;
|
||||
}
|
||||
|
||||
if($general['train'] >= 60 && $general['atmos'] >= 60){
|
||||
$crew60 += $general['crew'];
|
||||
$gen60 += 1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<table style='width:1000px;margin:5px auto' class='tb_layout bg0'>
|
||||
<thead>
|
||||
<colgroup>
|
||||
<col style="width:120px;"><col>
|
||||
<col style="width:120px;"><col>
|
||||
<col style="width:120px;"><col>
|
||||
<col style="width:120px;"><col>
|
||||
</colgroup>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class='bg1'>전체 금</td><td><?=number_format($totalGold)?></td>
|
||||
<td class='bg1'>전체 쌀</td><td><?=number_format($totalRice)?></td>
|
||||
<td class='bg1'>평균 금</td><td><?=number_format($totalGold/$genCnt, 2)?></td>
|
||||
<td class='bg1'>평균 쌀</td><td><?=number_format($totalRice/$genCnt, 2)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCnt)?></td>
|
||||
<td class='bg1'>훈사 90 병력/장수</td><td><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
|
||||
<td class='bg1'>훈사 80 병력/장수</td><td><?=number_format($crew80)?>/<?=number_format($gen80)?></td>
|
||||
<td class='bg1'>훈사 60 병력/장수</td><td><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?=$templates->render('generalList', ['generals'=>$generals])?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
|
||||
@@ -29,7 +29,9 @@ if($meLevel == 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.expand_city.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -188,11 +194,11 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1000 class='tb_layout bg0 anchor'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
<div id="helper_genlist" style="display:none;"></div>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력장수</title>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -179,8 +185,8 @@ for($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>$intel</td>
|
||||
<td align=center>{$general['gold']}</td>
|
||||
<td align=center>{$general['rice']}</td>
|
||||
<td align=center>".getGenChar($general['personal'])."</td>
|
||||
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['belong']}</td>
|
||||
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
|
||||
</tr>";
|
||||
|
||||
@@ -26,7 +26,9 @@ if($me['level'] == 0) {
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
@@ -77,8 +77,14 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@ $me = MYDB_fetch_array($result);
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ increaseRefresh("국법", 1);
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^");
|
||||
} ?>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -400,7 +402,7 @@ for($i=0;$i<16;$i+=1){
|
||||
}
|
||||
$bet = [];
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
if($betting['bet'] == 0){
|
||||
if($betting["bet{$i}"] == 0){
|
||||
$bet[$i] = '∞';
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -12,22 +12,72 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("부대편성", 1);
|
||||
|
||||
$query = "select no,nation,troop from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no,nation,troop FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$query = "select * from troop where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$troopcount = MYDB_num_rows($result);
|
||||
$troops = [];
|
||||
foreach($db->query('SELECT troop,name,no FROM troop WHERE nation = %i', $me['nation']) as $rawTroop){
|
||||
$troops[$rawTroop['troop']] = [
|
||||
'troop'=>$rawTroop['troop'],
|
||||
'name'=>$rawTroop['name'],
|
||||
'no'=>$rawTroop['no'],
|
||||
'users'=>[]
|
||||
];
|
||||
}
|
||||
|
||||
foreach($db->query(
|
||||
'SELECT no,name,turntime,troop,city FROM general WHERE troop!=0 AND nation = %i ORDER BY turntime ASC',
|
||||
$me['nation']
|
||||
) as $general
|
||||
){
|
||||
if(!key_exists($general['troop'], $troops)){
|
||||
trigger_error("올바르지 않은 부대 소속 {$general['no']}, {$general['name']} : {$general['troop']}");
|
||||
continue;
|
||||
}
|
||||
|
||||
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||
|
||||
$troops[$general['troop']]['users'][] = $general;
|
||||
}
|
||||
|
||||
if($troops){
|
||||
foreach($db->query(
|
||||
'SELECT no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5,troop FROM general WHERE no IN %li',
|
||||
array_column($troops, 'no')
|
||||
) as $troopLeader
|
||||
){
|
||||
$imageTemp = GetImageURL($troopLeader['imgsvr']);
|
||||
|
||||
$troopLeader['pictureFullPath'] = "$imageTemp/{$troopLeader['picture']}";
|
||||
$troopLeader['cityText'] = CityConst::byID($troopLeader['city'])->name;
|
||||
|
||||
$troopLeader['turnText'] = join('<br>', [
|
||||
'1 : '.((DecodeCommand($troopLeader['turn0'])[0] == 26)?'집합':'~'),
|
||||
'2 : '.((DecodeCommand($troopLeader['turn1'])[0] == 26)?'집합':'~'),
|
||||
'3 : '.((DecodeCommand($troopLeader['turn2'])[0] == 26)?'집합':'~'),
|
||||
'4 : '.((DecodeCommand($troopLeader['turn3'])[0] == 26)?'집합':'~'),
|
||||
'5 : '.((DecodeCommand($troopLeader['turn4'])[0] == 26)?'집합':'~'),
|
||||
]);
|
||||
$troops[$troopLeader['troop']]['leader'] = $troopLeader;
|
||||
}
|
||||
}
|
||||
|
||||
uasort($troops, function($lhs, $rhs){
|
||||
return $lhs['leader']['turntime']<=>$rhs['leader']['turntime'];
|
||||
})
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/troops.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -36,7 +86,8 @@ $troopcount = MYDB_num_rows($result);
|
||||
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=c_troop.php>
|
||||
<table class='tb_layout bg0'>
|
||||
<table id="troop_list" class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 class='bg1 center'>선 택</td>
|
||||
<td width=130 class='bg1 center'>부 대 정 보</td>
|
||||
@@ -44,117 +95,98 @@ $troopcount = MYDB_num_rows($result);
|
||||
<td width=576 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
|
||||
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot><tr><td colspan='5'>
|
||||
<?php if(!$troops): ?>
|
||||
<?php elseif($me['troop'] == 0): ?>
|
||||
<input type=submit name=btn value='부 대 가 입'>
|
||||
<?php else: ?>
|
||||
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm(\"정말 부대를 탈퇴하시겠습니까?\")'>
|
||||
<?php endif;?>
|
||||
</td></tr></tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $i < $troopcount; $i++) {
|
||||
$troop = MYDB_fetch_array($result);
|
||||
foreach ($troops as $troopNo=>$troop) {
|
||||
$troopLeader = $troop['leader'];
|
||||
$genlistText = [];
|
||||
$cityText = $troopLeader['cityText'];
|
||||
$cityID = $troopLeader['city'];
|
||||
$leaderID = $troopLeader['no'];
|
||||
|
||||
$genlist = "";
|
||||
$query = "select no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5 from general where troop='{$troop['troop']}'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
$genlist .= $general['name'].", ";
|
||||
if($troop['no'] == $general['no']) {
|
||||
$picture = $general['picture'];
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
$name = $general['name'];
|
||||
$turntime = $general['turntime'];
|
||||
$query = "select name from city where city='{$general['city']}'";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
$cityname = $city['name'];
|
||||
$turn = "";
|
||||
for($k=0; $k < 5; $k++) {
|
||||
$m = $k+1;
|
||||
if($general["turn{$k}"] == 26) {
|
||||
$turn .= " $m : 집합<br>";
|
||||
} else {
|
||||
$turn .= " $m : ∼<br>";
|
||||
}
|
||||
}
|
||||
foreach ($troop['users'] as $troopUser) {
|
||||
$spanClass = 'troopUser';
|
||||
if ($troopUser['city'] !== $cityID) {
|
||||
$spanClass.= ' diffCity';
|
||||
}
|
||||
if ($troopUser['no'] == $leaderID) {
|
||||
$spanClass.= ' leader';
|
||||
}
|
||||
$genlistText[] = "<span class='$spanClass' data-general-id='{$troopUser['no']}'
|
||||
><span class='generalName'>{$troopUser['name']}</span><span class='cityText'>【{$troopUser['cityText']}】</span
|
||||
></span>";
|
||||
}
|
||||
$genlist .= "({$gencount}명)";
|
||||
|
||||
if($me['troop'] == 0) {
|
||||
echo "
|
||||
$genlistText = sprintf('%s (%d명)', join(', ', $genlistText), count($genlistText)); ?>
|
||||
|
||||
<?php if ($me['troop'] == 0): ?>
|
||||
<tr>
|
||||
<td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop['troop']}'></td>
|
||||
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
|
||||
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62>$genlist</td>
|
||||
<td rowspan=2>$turn</td>
|
||||
<td align=center rowspan=2><input type='radio' name='troop' value='<?=$troop['troop']?>'></td>
|
||||
<td align=center><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
|
||||
<td height=64 style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||
<td rowspan=2><?=$troopLeader['turnText']?></td>
|
||||
</tr>
|
||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
||||
<tr><td colspan=5>";
|
||||
} else {
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||
<tr><td colspan=5>
|
||||
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td align=center rowspan=2> </td>
|
||||
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
|
||||
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=576>$genlist</td>
|
||||
<td rowspan=2>";
|
||||
|
||||
if($troop['no'] == $me['no']) {
|
||||
$query = "select no,name from general where troop='{$troop['troop']}' and no!='{$me['no']}' order by binary(name)";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($genresult);
|
||||
echo "
|
||||
<td align=center ><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
|
||||
<td height=64 style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||
<td rowspan=2>
|
||||
<?php if ($me['no'] == $troopLeader['no']): ?>
|
||||
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
|
||||
for($k=0; $k < $genCount; $k++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']}</option>";
|
||||
}
|
||||
echo "
|
||||
<?php foreach ($troop['users'] as $troopUser): ?>
|
||||
<?php if ($troopUser['no'] == $me['no']) {
|
||||
continue;
|
||||
} ?>
|
||||
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
|
||||
<?php endforeach; ?>
|
||||
</select><br>
|
||||
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>";
|
||||
} else {
|
||||
echo $turn;
|
||||
}
|
||||
|
||||
echo "
|
||||
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>
|
||||
<?php else: ?>
|
||||
<?=$troopLeader['turnText']?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
||||
<tr><td colspan=5>";
|
||||
}
|
||||
}
|
||||
<tr><td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||
<tr><td colspan=5></td></tr>
|
||||
<?php endif;
|
||||
|
||||
if ($troopcount == 0) {
|
||||
}
|
||||
else if($me['troop'] == 0) {
|
||||
echo"
|
||||
<input type=submit name=btn value='부 대 가 입'>";
|
||||
} else {
|
||||
echo"
|
||||
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm(\"정말 부대를 탈퇴하시겠습니까?\")'>";
|
||||
}
|
||||
} //foreach ($troops as $troopNo=>$troop) {
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
||||
echo "
|
||||
</td></tr>
|
||||
</table>
|
||||
<br>";
|
||||
|
||||
echo "
|
||||
<br>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 id=bg1>부 대 명</td>
|
||||
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>";
|
||||
if($me['troop'] == 0) {
|
||||
echo "
|
||||
<td><input type=submit name=btn value='부 대 창 설'></td>";
|
||||
} else {
|
||||
echo "
|
||||
<td><input type=submit name=btn value='부 대 변 경'></td>";
|
||||
}
|
||||
echo "
|
||||
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
|
||||
<?php if($me['troop'] == 0): ?>
|
||||
<td><input type=submit name=btn value='부 대 창 설'></td>
|
||||
<?php else: ?>
|
||||
<td><input type=submit name=btn value='부 대 변 경'></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</table>";
|
||||
</table>
|
||||
|
||||
?>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
|
||||
@@ -37,7 +37,6 @@ if($third < 0) { $third = 0; }
|
||||
if($fourth < 0) { $fourth = 0; }
|
||||
if($command > 99) { $command = 0; }
|
||||
if($double > 9999) { $double = 9999; }
|
||||
if($third > 9999) { $third = 9999; }
|
||||
if($fourth > 9999) { $fourth = 9999; }
|
||||
|
||||
$comStr = EncodeCommand($fourth, $third, $double, $command);
|
||||
|
||||
@@ -134,8 +134,25 @@ if($btn == "추방") {
|
||||
$log[] = "<C>●</><D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
||||
|
||||
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
|
||||
$query = "update general set level=0,nation=0,belong=0,betray=betray+1,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if($admin['year'] <= $admin['startyear'] && $general['npc'] < 2){
|
||||
$db->update('general', [
|
||||
'level'=>0,
|
||||
'nation'=>0,
|
||||
'belong'=>0,
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'level'=>0,
|
||||
'nation'=>0,
|
||||
'belong'=>0,
|
||||
'betray'=>$db->sqleval('betray + 1'),
|
||||
'makelimit'=>12,
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'dedication'=>$db->sqleval('dedication * (1 - 0.1*betray)'),
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
}
|
||||
// 부대 처리
|
||||
$query = "select no from troop where troop='{$general['troop']}'";
|
||||
@@ -163,7 +180,7 @@ if($btn == "추방") {
|
||||
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] == 0 || rand()%100 == 0)) {
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] < 100 || rand()%100 == 0)) {
|
||||
switch(rand()%5) {
|
||||
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
|
||||
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
|
||||
|
||||
@@ -38,9 +38,13 @@ case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
|
||||
}
|
||||
|
||||
if($btn == '참가') {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='{$me['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if($db->queryFirstField('SELECT `no` FROM tournament WHERE `no`=%i', $me['no'])){
|
||||
header('location:b_tournament.php');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$general = $db->queryFirstRow('SELECT no,name,npc,leader,power,intel,explevel,gold,horse,weap,book FROM general WHERE `no`=%i', $me['no']);
|
||||
|
||||
//{$admin['develcost']}원 참가비
|
||||
if($general['gold'] < $admin['develcost']) {
|
||||
|
||||
@@ -13,7 +13,9 @@ $db = DB::db();
|
||||
<html>
|
||||
<head>
|
||||
<title>커맨드리스트</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/* font-boostring Block */
|
||||
html * {max-height:1000000px;}
|
||||
|
||||
|
||||
html, body{
|
||||
background-color:black;
|
||||
color:white;
|
||||
line-height:1.3;
|
||||
font-family:'맑은 고딕';
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
table { font-family:'맑은 고딕'; }
|
||||
@@ -182,38 +188,17 @@ div.bar_out div.bar_in{
|
||||
}
|
||||
|
||||
.tooltip{
|
||||
position: relative;
|
||||
font-size:12px;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 120px;
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
margin-left: -60px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
.tooltiptext {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #555 transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.btn-group-xs > .btn, .btn-xs {
|
||||
padding : .25rem .4rem;
|
||||
font-size : .875rem;
|
||||
line-height : .5;
|
||||
border-radius : .2rem;
|
||||
}
|
||||
@@ -27,12 +27,51 @@
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer1{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer2{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bgroad{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_button_stack{
|
||||
position:absolute;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.map_body .map_toggle_cityname::after{
|
||||
content: "끄기"
|
||||
}
|
||||
|
||||
.map_body .map_toggle_cityname.active::after{
|
||||
content: "켜기"
|
||||
}
|
||||
|
||||
.world_map .city_tooltip{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
display:none;
|
||||
width:120px;
|
||||
min-width:120px;
|
||||
border: 0.02em gray solid;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.world_map .city_name{
|
||||
background-color: rgb(30, 164, 255);
|
||||
@@ -63,13 +102,26 @@
|
||||
|
||||
.world_map.map_detail .city_filler{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
width:calc(100% + 2px);
|
||||
height:calc(100% + 2px);
|
||||
left:-1px;
|
||||
top:-1px;
|
||||
background:transparent;
|
||||
}
|
||||
|
||||
.world_map .city_detail_name{
|
||||
background-color:rgba(0,0,0,0.5);
|
||||
font-size:10px;
|
||||
position:absolute;
|
||||
white-space:nowrap;
|
||||
left:70%;
|
||||
bottom:-10px;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.world_map.hide_cityname .city_detail_name{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.city_base{
|
||||
position:absolute;
|
||||
@@ -314,6 +366,8 @@
|
||||
|
||||
/* Basic */
|
||||
|
||||
|
||||
|
||||
.world_map.map_basic .city_filler{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
#message_board section{
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
max-width:498px;
|
||||
}
|
||||
|
||||
.msg_plate{
|
||||
width:100%;
|
||||
border-bottom:solid 1px gray;
|
||||
border-left:solid 1px gray;
|
||||
border-right:solid 1px gray;
|
||||
height:64px;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
min-height:64px;
|
||||
font-size:12px;
|
||||
word-break:break-all;
|
||||
color:white;
|
||||
@@ -96,7 +95,8 @@
|
||||
font-size:12px;
|
||||
width:715px;
|
||||
margin:0 2px;
|
||||
height:15px;
|
||||
height:20px;
|
||||
border:solid 1px gray;
|
||||
}
|
||||
|
||||
#msg_submit{
|
||||
@@ -116,17 +116,19 @@
|
||||
|
||||
.board_header{
|
||||
color:white;
|
||||
border:solid 1px gray;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
}
|
||||
|
||||
.board_side{
|
||||
position:absolute;
|
||||
height:1370px;
|
||||
width:498px;
|
||||
width:50%;
|
||||
overflow-y: hidden;
|
||||
border-left:solid 1px;
|
||||
border-right:solid 1px;
|
||||
border-bottom:solid 1px;
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#troop_list .cityText{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#troop_list .diffCity .cityText{
|
||||
display:inline;
|
||||
}
|
||||
|
||||
#troop_list .diffCity {
|
||||
color:red;
|
||||
}
|
||||
|
||||
#troop_list .leader{
|
||||
color:lightgreen;
|
||||
}
|
||||
|
||||
#troop_list .leader::before{
|
||||
content:'*';
|
||||
}
|
||||
|
||||
#troop_list .leader::after{
|
||||
content:'*';
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
class CityConst extends CityConstBase{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameConst extends GameConstBase
|
||||
{
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameCustomConst
|
||||
{
|
||||
/** @var int 유저 스탯 총합 */
|
||||
public static $defaultStatTotal = _tK_statTotal_;
|
||||
public static $defaultStatMin = _tK_statMin_;
|
||||
public static $defaultStatMax = _tK_statMax_;
|
||||
public static $defaultStatNPCMax = _tK_statNPCMax_;
|
||||
public static $chiefStatMin = _tK_statChiefMin_;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitConst extends GameUnitConstBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Deny from all
|
||||
@@ -424,7 +424,7 @@ function addCommand($typename, $value, $valid = 1, $color=0) {
|
||||
function commandGroup($typename, $type=0) {
|
||||
if($type == 0) {
|
||||
echo "
|
||||
<optgroup label='{$typename}' style=color:skyblue;background-color:black;>";
|
||||
<optgroup label='{$typename}' style='color:skyblue;background-color:black;'>";
|
||||
} else {
|
||||
echo "
|
||||
</optgroup>";
|
||||
@@ -490,7 +490,7 @@ function commandTable() {
|
||||
$develcostE = Util::round($develcostE);
|
||||
|
||||
echo "
|
||||
<select name=commandtype size=1 style=width:260px;color:white;background-color:black;font-size:12px;>";
|
||||
<select name=commandtype size=1 style='height:20px;width:260px;color:white;background-color:black;font-size:12px;'>";
|
||||
addCommand("휴 식", 0);
|
||||
addCommand("요 양", 50);
|
||||
commandGroup("========= 내 정 ==========");
|
||||
@@ -524,7 +524,7 @@ function commandTable() {
|
||||
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31);
|
||||
addCommand("징병(통솔경험)", 11);
|
||||
addCommand("모병(통솔경험, 자금x2)", 12);
|
||||
addCommand("훈련(통솔경험, 사기↓)", 13);
|
||||
addCommand("훈련(통솔경험)", 13);
|
||||
addCommand("사기진작(통솔경험, 자금↓)", 14);
|
||||
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15);
|
||||
addCommand("출병", 16);
|
||||
@@ -532,7 +532,7 @@ function commandTable() {
|
||||
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31, 0);
|
||||
addCommand("징병(통솔경험)", 11, 0);
|
||||
addCommand("모병(통솔경험, 자금x2)", 12, 0);
|
||||
addCommand("훈련(통솔경험, 사기↓)", 13, 0);
|
||||
addCommand("훈련(통솔경험)", 13, 0);
|
||||
addCommand("사기진작(통솔경험, 자금↓)", 14, 0);
|
||||
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15, 0);
|
||||
addCommand("출병", 16, 0);
|
||||
@@ -699,7 +699,8 @@ function CoreCommandTable() {
|
||||
if($city['supply'] == 0) { $valid = 0; }
|
||||
|
||||
echo "
|
||||
<select name=commandtype size=1 style=color:white;background-color:black;font-size:13>";
|
||||
<select name=commandtype size=1 style='height:20px;color:white;background-color:black;font-size:13px;'>";
|
||||
commandGroup("====== 휴 식 ======");
|
||||
addCommand("휴 식", 99);
|
||||
commandGroup("", 1);
|
||||
commandGroup("====== 인 사 ======");
|
||||
@@ -821,7 +822,7 @@ function generalInfo($no) {
|
||||
$weapname = getWeapName($general['weap']);
|
||||
$bookname = getBookName($general['book']);
|
||||
$horsename = getHorseName($general['horse']);
|
||||
$itemname = getItemName($general['item']);
|
||||
$itemname = displayItemInfo($general['item']);
|
||||
if($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
@@ -847,8 +848,8 @@ function generalInfo($no) {
|
||||
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
|
||||
|
||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||
$special = $general['special'] == 0 ? "{$general['specage']}세" : "<font color=limegreen>".getGenSpecial($general['special'])."</font>";
|
||||
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".getGenSpecial($general['special2'])."</font>";
|
||||
$special = $general['special'] == 0 ? "{$general['specage']}세" : "<font color=limegreen>".displaySpecialInfo($general['special'])."</font>";
|
||||
$special2 = $general['special2'] == 0 ? "{$general['specage2']}세" : "<font color=limegreen>".displaySpecialInfo($general['special2'])."</font>";
|
||||
|
||||
switch($general['personal']) {
|
||||
case 2: case 4:
|
||||
@@ -913,7 +914,7 @@ function generalInfo($no) {
|
||||
<td style='text-align:center;' class='bg1'><b>병사</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['crew']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>성격</b></td>
|
||||
<td style='text-align:center;' colspan=2>".getGenChar($general['personal'])."</td>
|
||||
<td style='text-align:center;' colspan=2>".displayCharInfo($general['personal'])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style='text-align:center;' class='bg1'><b>훈련</b></td>
|
||||
@@ -1128,7 +1129,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$message = explode("|", $msg);
|
||||
$message = explode('|', $msg);
|
||||
$count = (count($message) - 2)/2;
|
||||
$message[0] = Tag2Code($message[0]);
|
||||
$message[1] = Tag2Code($message[1]);
|
||||
@@ -1180,11 +1181,10 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
function banner() {
|
||||
|
||||
return sprintf(
|
||||
'<font size=2>%s %s / %s <br> %s</font>',
|
||||
'<font size=2>%s %s / %s</font>',
|
||||
GameConst::$title,
|
||||
VersionGit::$version,
|
||||
GameConst::$banner,
|
||||
GameConst::$helper);
|
||||
GameConst::$banner);
|
||||
}
|
||||
|
||||
function addTurn($date, int $turnterm, int $turn=1) {
|
||||
@@ -1813,7 +1813,7 @@ function PreprocessCommand($no) {
|
||||
$connect=$db->get();
|
||||
$log = [];
|
||||
|
||||
$query = "select no,name,city,injury,special2,item,turn0 from general where no='$no'";
|
||||
$query = "select no,name,city,injury,special2,item,turn0,rice,crew from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1871,7 +1871,7 @@ function PreprocessCommand($no) {
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[0] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용하여 치료합니다!";
|
||||
pushGenLog($general, $log);
|
||||
} elseif($general['injury'] > 10 && $general['item'] == 1 && $general['turn0'] != EncodeCommand(0, 0, 0, 50)) {
|
||||
} elseif($general['injury'] > 10 && $general['item'] == 1 && DecodeCommand($general['turn0'])[0] != 50) {
|
||||
//환약 사용
|
||||
$query = "update general set injury=0,item=0 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1888,6 +1888,27 @@ function PreprocessCommand($no) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($general['crew'] >= 100){
|
||||
$newRice = $general['rice'] - $general['crew'] / 100;
|
||||
if($newRice >= 0){
|
||||
$db->update('general', [
|
||||
'rice'=>Util::round($newRice)
|
||||
], 'no=%i',$general['no']);
|
||||
}
|
||||
else{
|
||||
$db->update('city', [
|
||||
'pop'=>$db->sqleval('pop + %i', $general['crew'])
|
||||
], 'city=%i', $general['city']);
|
||||
$db->update('general', [
|
||||
'crew'=>0,
|
||||
'rice'=>0
|
||||
], 'no=%i',$general['no']);
|
||||
pushGenLog($general, ["<C>●</>군량이 모자라 병사들이 <R>소집해제</>되었습니다!"]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1910,8 +1931,14 @@ function updateTurntime($no) {
|
||||
if($general['npc'] == 1 && $general['deadyear'] > $admin['year']) {
|
||||
$general['killturn'] = ($general['deadyear'] - $admin['year']) * 12;
|
||||
$general['npc'] = $general['npc_org'];
|
||||
$query = "update general set owner=-1,npc='{$general['npc']}',killturn='{$general['killturn']}',mode=2 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$db->update('general', [
|
||||
'owner'=>-1,
|
||||
'npc'=>$general['npc_org'],
|
||||
'killturn'=>$general['killturn'],
|
||||
'mode'=>2,
|
||||
'name2'=>null
|
||||
], 'no=%i',$no);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name2'], '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>{$josaYi} <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
|
||||
@@ -2011,7 +2038,7 @@ function updateTurntime($no) {
|
||||
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
}
|
||||
// 엔피씨,엠피씨,의병 사망로그
|
||||
if($general['npc'] == 2) {
|
||||
if($general['npc'] == 2 || $general['npc'] == 6) {
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
|
||||
} elseif($general['npc'] >= 3) {
|
||||
switch(rand()%10) {
|
||||
@@ -2161,6 +2188,7 @@ function CheckHall($no) {
|
||||
|
||||
|
||||
function uniqueItem($general, $log, $vote=0) {
|
||||
//TODO: uniqueItem 재 구현
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
@@ -2178,7 +2206,7 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if($admin['scenario'] == 0) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
if($admin['scenario'] < 100) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
|
||||
|
||||
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||
@@ -2289,6 +2317,69 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function checkAbilityEx(int $generalID, ActionLogger $actLog){
|
||||
$db = DB::db();
|
||||
$general = $db->queryFirstRow('SELECT leader,leader2,power,power2,intel,intel2 FROM general WHERE no = %i',$generalID);
|
||||
|
||||
if(!$general){
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader2'] < 0){
|
||||
$db->update('general',[
|
||||
'leader2'=>$db->sqleval('leader2 + %i', GameConst::$upgradeLimit),
|
||||
'leader'=>$db->sqleval('leader - 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['power2'] < 0){
|
||||
$db->update('general',[
|
||||
'power2'=>$db->sqleval('power2 + %i', GameConst::$upgradeLimit),
|
||||
'power'=>$db->sqleval('power - 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['intel2'] < 0){
|
||||
$db->update('general',[
|
||||
'intel2'=>$db->sqleval('intel2 + %i', GameConst::$upgradeLimit),
|
||||
'intel'=>$db->sqleval('intel - 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader2'] >= GameConst::$upgradeLimit){
|
||||
$db->update('general',[
|
||||
'leader2'=>$db->sqleval('leader2 - %i', GameConst::$upgradeLimit),
|
||||
'leader'=>$db->sqleval('leader + 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['power2'] >= GameConst::$upgradeLimit){
|
||||
$db->update('general',[
|
||||
'power2'=>$db->sqleval('power2 - %i', GameConst::$upgradeLimit),
|
||||
'power'=>$db->sqleval('power + 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['intel2'] >= GameConst::$upgradeLimit){
|
||||
$db->update('general',[
|
||||
'intel2'=>$db->sqleval('intel2 - %i', GameConst::$upgradeLimit),
|
||||
'intel'=>$db->sqleval('intel + 1')
|
||||
], 'no=%i', $generalID);
|
||||
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function checkAbility($general, $log) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -2449,6 +2540,7 @@ function deleteNation($general) {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $general['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $general['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
// 전 장수 재야로 // 전 장수 소속 무소속으로
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
|
||||
@@ -2594,6 +2686,9 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
|
||||
}
|
||||
|
||||
function isNeighbor(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
||||
if($nation1 === $nation2){
|
||||
return false;
|
||||
}
|
||||
$db = DB::db();
|
||||
|
||||
$nation1Cities = [];
|
||||
@@ -2632,6 +2727,60 @@ function CharExperience($exp, $personal) {
|
||||
return $exp;
|
||||
}
|
||||
|
||||
function getCharExpMultiplier($personal):float{
|
||||
static $table = [
|
||||
0 => 1.1,
|
||||
1 => 1.1,
|
||||
4 => 0.9,
|
||||
5 => 0.9,
|
||||
6 => 1.1,
|
||||
7 => 0.9,
|
||||
10 => 0.9
|
||||
];
|
||||
return $table[$personal] ?? 1;
|
||||
}
|
||||
|
||||
function getNationTechMultiplier($nationType):float{
|
||||
static $table = [
|
||||
3 => 1.1,
|
||||
5 => 0.9,
|
||||
6 => 0.9,
|
||||
7 => 0.9,
|
||||
8 => 0.9,
|
||||
12 => 0.9,
|
||||
13 => 1.1,
|
||||
];
|
||||
return $table[$nationType] ?? 1;
|
||||
}
|
||||
|
||||
function getNationWallMultiplier($nationType):float{
|
||||
static $table = [
|
||||
3 => 1.1,
|
||||
5 => 1.1,
|
||||
10 => 1.1,
|
||||
11 => 1.1,
|
||||
4 => 0.9,
|
||||
7 => 0.9,
|
||||
8 => 0.9,
|
||||
13 => 0.9,
|
||||
];
|
||||
return $table[$nationType] ?? 1;
|
||||
}
|
||||
|
||||
function getNationPeopleMultiplier($nationType):float{
|
||||
static $table = [
|
||||
1 => 0.9,
|
||||
2 => 1.1,
|
||||
3 => 0.9,
|
||||
4 => 1.1,
|
||||
7 => 1.1,
|
||||
9 => 0.9,
|
||||
10 => 1.1,
|
||||
];
|
||||
return $table[$nationType] ?? 1;
|
||||
}
|
||||
|
||||
|
||||
function CharDedication($ded, $personal) {
|
||||
switch($personal) {
|
||||
case 10:
|
||||
@@ -2642,6 +2791,13 @@ function CharDedication($ded, $personal) {
|
||||
return $ded;
|
||||
}
|
||||
|
||||
function getCharDedMultiplier($personal):float{
|
||||
static $table = [
|
||||
10 => 0.9
|
||||
];
|
||||
return $table[$personal] ?? 1;
|
||||
}
|
||||
|
||||
function CharAtmos($atmos, $personal) {
|
||||
switch($personal) {
|
||||
case 2: case 4:
|
||||
@@ -2690,6 +2846,8 @@ function SabotageInjury($city, $type=0) {
|
||||
$connect=$db->get();
|
||||
$log = [];
|
||||
|
||||
$injuryCount = 0;
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select no,name,nation from general where city='$city'";
|
||||
@@ -2711,8 +2869,11 @@ function SabotageInjury($city, $type=0) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushGenLog($general, $log);
|
||||
$injuryCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $injuryCount;
|
||||
}
|
||||
|
||||
function getRandTurn($term) {
|
||||
|
||||
@@ -471,7 +471,7 @@ function processCommand($no) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -533,7 +533,7 @@ function processCommand($no) {
|
||||
}
|
||||
|
||||
//장수정보 재로드
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
}
|
||||
@@ -628,7 +628,7 @@ function updateCommand($no, $type=0) {
|
||||
update general set
|
||||
turn0=turn1,turn1=turn2,turn2=turn3,turn3=turn4,turn4=turn5,turn5=turn6,turn6=turn7,turn7=turn8,turn8=turn9,
|
||||
turn9=turn10,turn10=turn11,turn11=turn12,turn12=turn13,turn13=turn14,turn14=turn15,turn15=turn16,turn16=turn17,
|
||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='00000000000000'
|
||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='{$general['no']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -642,7 +642,7 @@ update nation set
|
||||
{$turn}4={$turn}5,{$turn}5={$turn}6,
|
||||
{$turn}6={$turn}7,{$turn}7={$turn}8,
|
||||
{$turn}8={$turn}9,{$turn}9={$turn}10,
|
||||
{$turn}10={$turn}11,{$turn}11='00000000000099'
|
||||
{$turn}10={$turn}11,{$turn}11='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -672,7 +672,7 @@ turn9=turn8,turn8=turn7,
|
||||
turn7=turn6,turn6=turn5,
|
||||
turn5=turn4,turn4=turn3,
|
||||
turn3=turn2,turn2=turn1,
|
||||
turn1=turn0,turn0='00000000000000'
|
||||
turn1=turn0,turn0='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='$no'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -685,7 +685,7 @@ update nation set
|
||||
{$turn}7={$turn}6,{$turn}6={$turn}5,
|
||||
{$turn}5={$turn}4,{$turn}4={$turn}3,
|
||||
{$turn}3={$turn}2,{$turn}2={$turn}1,
|
||||
{$turn}1={$turn}0,{$turn}0='00000000000099'
|
||||
{$turn}1={$turn}0,{$turn}0='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -747,8 +747,9 @@ function command_Other($turn, $commandtype) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<script>
|
||||
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
||||
</script>
|
||||
@@ -771,19 +772,10 @@ parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
||||
|
||||
|
||||
function EncodeCommand($fourth, $third, $double, $command) {
|
||||
$str = StringUtil::padStringAlignRight((string)$fourth, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$third, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$double, 4, "0");
|
||||
$str .= StringUtil::padStringAlignRight((string)$command, 2, "0");
|
||||
return $str;
|
||||
return Json::encode([$command, $double, $third, $fourth]);
|
||||
}
|
||||
|
||||
function DecodeCommand($str) {
|
||||
$command = [];
|
||||
$command[3] = (int)(substr($str, 0, 4));
|
||||
$command[2] = (int)(substr($str, 4, 4));
|
||||
$command[1] = (int)(substr($str, 8, 4));
|
||||
$command[0] = (int)(substr($str, 12, 2));
|
||||
return $command;
|
||||
return Json::decode($str);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ function CharCall($call) {
|
||||
case '정복'; $type = 4; break;
|
||||
case '패권'; $type = 3; break;
|
||||
case '의협'; $type = 2; break;
|
||||
default:
|
||||
case '대의'; $type = 1; break;
|
||||
case '왕좌'; $type = 0; break;
|
||||
}
|
||||
@@ -135,6 +136,28 @@ function getGenChar($type) {
|
||||
return $call;
|
||||
}
|
||||
|
||||
function getCharInfo(?int $type):?string {
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$infoText = [
|
||||
10=>['은둔', '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%'],
|
||||
9=>['안전', '사기 -5, 징·모병 비용 -20%'],
|
||||
8=>['유지', '훈련 -5, 징·모병 비용 -20%'],
|
||||
7=>['재간', '명성 -10%, 징·모병 비용 -20%'],
|
||||
6=>['출세', '명성 +10%, 징·모병 비용 +20%'],
|
||||
5=>['할거', '명성 -10%, 훈련 +5'],
|
||||
4=>['정복', '명성 -10%, 사기 +5'],
|
||||
3=>['패권', '훈련 +5, 징·모병 비용 +20%'],
|
||||
2=>['의협', '사기 +5, 징·모병 비용 +20%'],
|
||||
1=>['대의', '명성 +10%, 훈련 -5'],
|
||||
0=>['왕좌', '명성 +10%, 사기 -5'],
|
||||
];
|
||||
|
||||
return $infoText[$type][1]??null;
|
||||
}
|
||||
|
||||
function getGenSpecial($type) {
|
||||
switch($type) {
|
||||
case 0: $call = '-'; break;
|
||||
@@ -179,6 +202,55 @@ function getGenSpecial($type) {
|
||||
return $call;
|
||||
}
|
||||
|
||||
function getSpecialInfo(?int $type):?string{
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
//앞칸은 '설명을 위해' '그냥' 적어둠
|
||||
$infoText = [
|
||||
0 => ['-', null],
|
||||
1 => ['경작', '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
2 => ['상재', '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
3 => ['발명', '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
10 => ['축성', '[내정] 성벽 보수 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
11 => ['수비', '[내정] 수비 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
12 => ['통찰', '[내정] 치안 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
20 => ['인덕', '[내정] 주민 선정·정착 장려 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
|
||||
30 => ['거상', '이것 저것'],
|
||||
31 => ['귀모', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
|
||||
40 => ['귀병', '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p'],
|
||||
41 => ['신산', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p '],
|
||||
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
|
||||
43 => ['집중', '[전투] 계략 성공 시 대미지 +50%'],
|
||||
44 => ['신중', '[전투] 계략 성공 확률 100%'],
|
||||
45 => ['반계', '[전투] 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
|
||||
|
||||
50 => ['보병', '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'],
|
||||
51 => ['궁병', '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p'],
|
||||
52 => ['기병', '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%'],
|
||||
53 => ['공성', '[군사] 차병 계통 징·모병비 -10%<br>[전투] 성벽 공격 시 대미지 +100%'],
|
||||
|
||||
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
|
||||
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
|
||||
62 => ['견고', '[전투] 상대 필살 불가, 상대 계략 시도시 성공 확률 -10%p'],
|
||||
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
|
||||
|
||||
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
|
||||
71 => ['필살', '[전투] 필살 확률 +20%p'],
|
||||
72 => ['징병', '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%'],
|
||||
73 => ['의술', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
|
||||
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
|
||||
];
|
||||
|
||||
return $infoText[$type][1]??null;
|
||||
}
|
||||
|
||||
function getNationType($type) {
|
||||
switch($type) {
|
||||
case 13: $call = '명 가'; break;
|
||||
@@ -284,60 +356,43 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
function getCall($leader, $power, $intel) {
|
||||
$call = '평범';
|
||||
if($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '만능';
|
||||
} elseif($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin) {
|
||||
$call = '용장';
|
||||
} elseif($leader >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '지장';
|
||||
} elseif($power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '명장';
|
||||
} elseif($leader >= GameConst::$chiefStatMin) {
|
||||
$call = '명사';
|
||||
} elseif($power >= GameConst::$chiefStatMin) {
|
||||
$call = '용맹';
|
||||
} elseif($intel >= GameConst::$chiefStatMin) {
|
||||
$call = '현명';
|
||||
|
||||
if($leader < 40){
|
||||
if($power + $intel < $leader){
|
||||
return '아둔';
|
||||
}
|
||||
if($intel >= GameConst::$chiefStatMin && $power < $intel * 0.8){
|
||||
return '학자';
|
||||
}
|
||||
if($power >= GameConst::$chiefStatMin && $intel < $power * 0.8){
|
||||
return '장사';
|
||||
}
|
||||
return '명사';
|
||||
}
|
||||
return $call;
|
||||
|
||||
$maxStat = max($leader, $power, $intel);
|
||||
$sum2Stat = min($leader+$power, $power+$intel, $intel+$leader);
|
||||
if($maxStat >= GameConst::$chiefStatMin + GameConst::$statGradeLevel && $sum2Stat >= $maxStat * 1.7){
|
||||
return '만능';
|
||||
}
|
||||
if($power >= GameConst::$chiefStatMin - GameConst::$statGradeLevel && $intel < $power * 0.8){
|
||||
return '용장';
|
||||
}
|
||||
if($intel >= GameConst::$chiefStatMin - GameConst::$statGradeLevel && $power < $intel * 0.8){
|
||||
return '명장';
|
||||
}
|
||||
return '평범';
|
||||
}
|
||||
|
||||
function getDed($dedication) {
|
||||
if($dedication < 1 ) $level2 = '무품관';
|
||||
elseif($dedication < 10*10) $level2 = '30품관';
|
||||
elseif($dedication < 20*20) $level2 = '29품관';
|
||||
elseif($dedication < 30*30) $level2 = '28품관';
|
||||
elseif($dedication < 40*40) $level2 = '27품관';
|
||||
elseif($dedication < 50*50) $level2 = '26품관';
|
||||
elseif($dedication < 60*60) $level2 = '25품관';
|
||||
elseif($dedication < 70*70) $level2 = '24품관';
|
||||
elseif($dedication < 80*80) $level2 = '23품관';
|
||||
elseif($dedication < 90*90) $level2 = '22품관';
|
||||
elseif($dedication < 100*100) $level2 = '21품관';
|
||||
elseif($dedication < 110*110) $level2 = '20품관';
|
||||
elseif($dedication < 120*120) $level2 = '19품관';
|
||||
elseif($dedication < 130*130) $level2 = '18품관';
|
||||
elseif($dedication < 140*140) $level2 = '17품관';
|
||||
elseif($dedication < 150*150) $level2 = '16품관';
|
||||
elseif($dedication < 160*160) $level2 = '15품관';
|
||||
elseif($dedication < 170*170) $level2 = '14품관';
|
||||
elseif($dedication < 180*180) $level2 = '13품관';
|
||||
elseif($dedication < 190*190) $level2 = '12품관';
|
||||
elseif($dedication < 200*200) $level2 = '11품관'; // 40000
|
||||
elseif($dedication < 210*210) $level2 = '10품관'; // 44100
|
||||
elseif($dedication < 220*220) $level2 = '9품관'; // 48400
|
||||
elseif($dedication < 230*230) $level2 = '8품관'; // 52900
|
||||
elseif($dedication < 240*240) $level2 = '7품관'; // 57600
|
||||
elseif($dedication < 250*250) $level2 = '6품관'; // 62500
|
||||
elseif($dedication < 260*260) $level2 = '5품관'; // 67600
|
||||
elseif($dedication < 270*270) $level2 = '4품관'; // 72900
|
||||
elseif($dedication < 280*280) $level2 = '3품관'; // 78400
|
||||
elseif($dedication < 290*290) $level2 = '2품관'; // 84100
|
||||
else {
|
||||
$level2 = '1품관';
|
||||
$dedLevel = getDedLevel($dedication);
|
||||
if($dedLevel == 0){
|
||||
return '무품관';
|
||||
}
|
||||
|
||||
return $level2;
|
||||
//{$maxDedLevel}품관 ~ 1품관
|
||||
$dedInvLevel = GameConst::$maxDedLevel - $dedLevel + 1;
|
||||
return "{$dedInvLevel}품관";
|
||||
}
|
||||
|
||||
|
||||
@@ -364,16 +419,18 @@ function getExpLevel($experience) {
|
||||
if($experience < 1000) {
|
||||
$level = intdiv($experience, 100);
|
||||
} else {
|
||||
for($level = 0; $experience > (($level+1)*($level+1)*10); $level++) {
|
||||
}
|
||||
$level = Util::toInt(sqrt($experience/10));
|
||||
}
|
||||
|
||||
return $level;
|
||||
}
|
||||
|
||||
function getDedLevel($dedication) {
|
||||
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) {
|
||||
}
|
||||
$level = Util::valueFit(
|
||||
ceil(sqrt($dedication) / 10),
|
||||
0,
|
||||
GameConst::$maxDedLevel
|
||||
);
|
||||
|
||||
return $level;
|
||||
}
|
||||
@@ -390,9 +447,7 @@ function getLevelPer($exp, $level) {
|
||||
}
|
||||
|
||||
function getBill(int $dedication) : int{
|
||||
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) {
|
||||
}
|
||||
|
||||
$level = getDedLevel($dedication);
|
||||
return ($level * 200 + 400);
|
||||
}
|
||||
|
||||
@@ -400,72 +455,40 @@ function getCost(int $armtype) : int {
|
||||
return GameUnitConst::byID($armtype)->cost;
|
||||
}
|
||||
|
||||
function TechLimit($startyear, $year, $tech) : int {
|
||||
$limit = 0;
|
||||
if($year < $startyear+ 5 && $tech >= 1000) { $limit = 1; }
|
||||
if($year < $startyear+10 && $tech >= 2000) { $limit = 1; }
|
||||
if($year < $startyear+15 && $tech >= 3000) { $limit = 1; }
|
||||
if($year < $startyear+20 && $tech >= 4000) { $limit = 1; }
|
||||
if($year < $startyear+25 && $tech >= 5000) { $limit = 1; }
|
||||
if($year < $startyear+30 && $tech >= 6000) { $limit = 1; }
|
||||
if($year < $startyear+35 && $tech >= 7000) { $limit = 1; }
|
||||
if($year < $startyear+40 && $tech >= 8000) { $limit = 1; }
|
||||
if($year < $startyear+45 && $tech >= 9000) { $limit = 1; }
|
||||
if($year < $startyear+50 && $tech >= 10000) { $limit = 1; }
|
||||
if($year < $startyear+55 && $tech >= 11000) { $limit = 1; }
|
||||
if($year < $startyear+60 && $tech >= 12000) { $limit = 1; }
|
||||
return $limit;
|
||||
function getTechLevel($tech):int{
|
||||
return Util::valueFit(
|
||||
floor($tech / 1000),
|
||||
0,
|
||||
GameConst::$maxTechLevel
|
||||
);
|
||||
}
|
||||
|
||||
function TechLimit($startYear, $year, $tech) : bool {
|
||||
|
||||
$relYear = $year - $startYear;
|
||||
|
||||
$relMaxTech = Util::valueFit(
|
||||
floor($relYear / 5) + 1,
|
||||
1,
|
||||
GameConst::$maxTechLevel
|
||||
);
|
||||
|
||||
$techLevel = getTechLevel($tech);
|
||||
|
||||
return $techLevel >= $relMaxTech;
|
||||
}
|
||||
|
||||
function getTechAbil($tech) : int{
|
||||
if($tech < 1000) { $abil = 0; }
|
||||
elseif($tech < 2000) { $abil = 25; }
|
||||
elseif($tech < 3000) { $abil = 50; }
|
||||
elseif($tech < 4000) { $abil = 75; }
|
||||
elseif($tech < 5000) { $abil = 100; }
|
||||
elseif($tech < 6000) { $abil = 125; }
|
||||
elseif($tech < 7000) { $abil = 150; }
|
||||
elseif($tech < 8000) { $abil = 175; }
|
||||
elseif($tech < 9000) { $abil = 200; }
|
||||
elseif($tech < 10000) { $abil = 225; }
|
||||
elseif($tech < 11000) { $abil = 250; }
|
||||
elseif($tech < 12000) { $abil = 275; }
|
||||
else { $abil = 300; }
|
||||
return $abil;
|
||||
return getTechLevel($tech) * 25;
|
||||
}
|
||||
|
||||
function getTechCost($tech) : float{
|
||||
if($tech < 1000) { $cost = 1.00; }
|
||||
elseif($tech < 2000) { $cost = 1.15; }
|
||||
elseif($tech < 3000) { $cost = 1.30; }
|
||||
elseif($tech < 4000) { $cost = 1.45; }
|
||||
elseif($tech < 5000) { $cost = 1.60; }
|
||||
elseif($tech < 6000) { $cost = 1.75; }
|
||||
elseif($tech < 7000) { $cost = 1.90; }
|
||||
elseif($tech < 8000) { $cost = 2.05; }
|
||||
elseif($tech < 9000) { $cost = 2.20; }
|
||||
elseif($tech < 10000) { $cost = 2.35; }
|
||||
elseif($tech < 11000) { $cost = 2.50; }
|
||||
elseif($tech < 12000) { $cost = 2.65; }
|
||||
else { $cost = 2.80; }
|
||||
return $cost;
|
||||
return 1 + getTechLevel($tech) * 0.15;
|
||||
}
|
||||
|
||||
function getTechCall($tech) : string {
|
||||
if($tech < 1000) { $str = '0등급'; }
|
||||
elseif($tech < 2000) { $str = '1등급'; }
|
||||
elseif($tech < 3000) { $str = '2등급'; }
|
||||
elseif($tech < 4000) { $str = '3등급'; }
|
||||
elseif($tech < 5000) { $str = '4등급'; }
|
||||
elseif($tech < 6000) { $str = '5등급'; }
|
||||
elseif($tech < 7000) { $str = '6등급'; }
|
||||
elseif($tech < 8000) { $str = '7등급'; }
|
||||
elseif($tech < 9000) { $str = '8등급'; }
|
||||
elseif($tech < 10000) { $str = '9등급'; }
|
||||
elseif($tech < 11000) { $str = '10등급'; }
|
||||
elseif($tech < 12000) { $str = '11등급'; }
|
||||
else { $str = '12등급'; }
|
||||
return $str;
|
||||
$techLevel = getTechLevel($tech);
|
||||
return "{$techLevel}등급";
|
||||
}
|
||||
|
||||
function getDexCall($dex) : string {
|
||||
@@ -544,7 +567,7 @@ function getDexLog($dex1, $dex2) {
|
||||
}
|
||||
|
||||
|
||||
function getWeapName($weap) : string {
|
||||
function getWeapName($weap) : ?string {
|
||||
switch($weap) {
|
||||
case 0: $weapname = '-'; break;
|
||||
case 1: $weapname = '단도(+1)'; break;
|
||||
@@ -578,7 +601,7 @@ function getWeapName($weap) : string {
|
||||
return $weapname;
|
||||
}
|
||||
|
||||
function getWeapEff($weap) : int{
|
||||
function getWeapEff($weap) : ?int{
|
||||
switch($weap) {
|
||||
case 7: $weap = 7; break;
|
||||
case 8: $weap = 7; break;
|
||||
@@ -605,7 +628,7 @@ function getWeapEff($weap) : int{
|
||||
return $weap;
|
||||
}
|
||||
|
||||
function getBookName($book) : string {
|
||||
function getBookName($book) : ?string {
|
||||
switch($book) {
|
||||
case 0: $bookname = '-'; break;
|
||||
case 1: $bookname = '효경전(+1)'; break;
|
||||
@@ -639,7 +662,7 @@ function getBookName($book) : string {
|
||||
return $bookname;
|
||||
}
|
||||
|
||||
function getBookEff($book) : int {
|
||||
function getBookEff($book) : ?int {
|
||||
switch($book) {
|
||||
case 7: $book = 7; break;
|
||||
case 8: $book = 7; break;
|
||||
@@ -666,7 +689,7 @@ function getBookEff($book) : int {
|
||||
return $book;
|
||||
}
|
||||
|
||||
function getHorseName($horse) : string {
|
||||
function getHorseName($horse) : ?string {
|
||||
switch($horse) {
|
||||
case 0: $horsename = '-'; break;
|
||||
case 1: $horsename = '노기(+1)'; break;
|
||||
@@ -700,7 +723,7 @@ function getHorseName($horse) : string {
|
||||
return $horsename;
|
||||
}
|
||||
|
||||
function getHorseEff($horse) : int {
|
||||
function getHorseEff($horse) : ?int {
|
||||
switch($horse) {
|
||||
case 7: $horse = 7; break;
|
||||
case 8: $horse = 7; break;
|
||||
@@ -727,7 +750,7 @@ function getHorseEff($horse) : int {
|
||||
return $horse;
|
||||
}
|
||||
|
||||
function getItemName($item) : string {
|
||||
function getItemName($item) : ?string {
|
||||
switch($item) {
|
||||
case 0: $itemname = '-'; break;
|
||||
case 1: $itemname = '환약(치료)'; break;
|
||||
@@ -757,10 +780,45 @@ function getItemName($item) : string {
|
||||
case 24: $itemname = '태평청령(의술)'; break;
|
||||
case 25: $itemname = '태평요술(회피)'; break;
|
||||
case 26: $itemname = '둔갑천서(회피)'; break;
|
||||
default: $itemname = null;
|
||||
}
|
||||
return $itemname;
|
||||
}
|
||||
|
||||
function getItemInfo(?int $item):?string{
|
||||
$itemInfo = [
|
||||
1=>['환약(치료)', '[군사] 턴 실행 전 부상 회복. 1회용'],
|
||||
2=>['수극(저격)', '[전투] 전투 개시 전 20% 확률로 저격 시도. 1회용'],
|
||||
3=>['탁주(사기)', '[전투] 사기 보정 +3. 1회용'],
|
||||
4=>['청주(훈련)', '[전투] 훈련 보정 +3. 1회용'],
|
||||
5=>['이추(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p. 1회용'],
|
||||
6=>['향낭(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p. 1회용'],
|
||||
|
||||
7=>['오석산(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
8=>['무후행군(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
9=>['도소연명(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
10=>['칠엽청점(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
11=>['정력견혈(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
12=>['과실주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
13=>['이강주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
14=>['의적주(사기)', '[전투] 사기 보정 +5'],
|
||||
15=>['두강주(사기)', '[전투] 사기 보정 +5'],
|
||||
16=>['보령압주(사기)', '[전투] 사기 보정 +5'],
|
||||
17=>['철벽서(훈련)', '[전투] 훈련 보정 +7'],
|
||||
18=>['단결도(훈련)', '[전투] 훈련 보정 +7'],
|
||||
19=>['춘화첩(사기)', '[전투] 사기 보정 +7'],
|
||||
20=>['초선화(사기)', '[전투] 사기 보정 +7'],
|
||||
21=>['육도(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
22=>['삼략(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
23=>['청낭서(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
24=>['태평청령(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
25=>['태평요술(회피)', '[전투] 회피 확률 +20%p'],
|
||||
26=>['둔갑천서(회피)', '[전투] 회피 확률 +20%p'],
|
||||
];
|
||||
|
||||
return $itemInfo[$item][1]??null;
|
||||
}
|
||||
|
||||
function getItemCost2($weap) : int {
|
||||
switch($weap) {
|
||||
case 0: $weapcost = 0; break;
|
||||
|
||||
@@ -115,22 +115,37 @@ function getSpecial2($leader, $power, $intel, $nodex=1, $dex0=0, $dex10=0, $dex2
|
||||
}
|
||||
|
||||
function getGenDex($general, $type) {
|
||||
$type = intdiv($type, 10) * 10;
|
||||
return $general["dex{$type}"];
|
||||
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||
$ntype = GameUnitConst::byId($type)->armType * 10;
|
||||
return $general["dex{$ntype}"]??0;
|
||||
}
|
||||
|
||||
function addGenDex($no, $atmos, $train, $type, $exp) {
|
||||
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$type = intdiv($type, 10) * 10;
|
||||
$dexType = "dex{$type}";
|
||||
if($type == 30) { $exp = Util::round($exp * 0.90); } //귀병은 90%효율
|
||||
elseif($type == 40) { $exp = Util::round($exp * 0.90); } //차병은 90%효율
|
||||
$exp = Util::round($exp * ($atmos+$train) / 200); // 사기 + 훈련 / 200
|
||||
$armType = GameUnitConst::byId($type)->armType;
|
||||
if($armType == GameUnitConst::T_CASTLE){
|
||||
$armType = GameUnitConst::T_SIEGE;
|
||||
}
|
||||
|
||||
$query = "update general set {$dexType}={$dexType}+{$exp} where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if($armType < 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$ntype = $armType*10;
|
||||
$dexType = "dex{$ntype}";
|
||||
if($armType == GameUnitConst::T_WIZARD) {
|
||||
$exp = Util::round($exp * 0.90);
|
||||
}
|
||||
else if($armType == GameUnitConst::T_SIEGE) {
|
||||
$exp = Util::round($exp * 0.90);
|
||||
}
|
||||
$exp = Util::round($exp * ($atmos + $train) / 200); // 사기 + 훈련 / 200
|
||||
|
||||
$db->update('general', [
|
||||
$dexType=>$db->sqleval('%b + %i', $dexType, $exp)
|
||||
], 'no=%i', $no);
|
||||
}
|
||||
|
||||
|
||||
@@ -314,27 +329,6 @@ function preUpdateMonthly() {
|
||||
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='{}',term=0,front=0 where rate<='30' and supply='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 우선 병사수/100 만큼 소비
|
||||
$query = "update general set rice=rice-round(crew/100) where crew>=100";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 쌀이 마이너스인 장수들 소집해제
|
||||
$query = "select no,name,rice,crew,city from general where rice<0";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
// 주민으로 돌아감
|
||||
$query = "update city set pop=pop+'{$general['crew']}' where city='{$general['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set crew=0,rice=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushGenLog($general, ["<C>●</>군량이 모자라 병사들이 <R>소집해제</>되었습니다!"]);
|
||||
}
|
||||
|
||||
//접률감소
|
||||
$query = "update general set connect=floor(connect*0.99)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -395,23 +389,33 @@ function preUpdateMonthly() {
|
||||
}
|
||||
|
||||
//첩보-1
|
||||
$query = "select nation,spy from nation where spy!=''";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$spy = ""; $k = 0;
|
||||
$cities = [];
|
||||
if($nation['spy'] != "") { $cities = explode("|", (string)$nation['spy']); }
|
||||
while(count($cities)) {
|
||||
$cities[$k]--;
|
||||
if($cities[$k]%10 != 0) { $spy .= (string)$cities[$k]; }
|
||||
$k++;
|
||||
if($k >= count($cities)) { break; }
|
||||
if($cities[$k-1]%10 != 0) { $spy .= "|"; }
|
||||
foreach($db->queryAllLists("SELECT nation, spy FROM nation WHERE spy!='' AND spy!='{}'") as [$nationNo, $rawSpy]){
|
||||
if (strpos($rawSpy, '|') !== false || is_numeric($rawSpy)) {
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
$query = "update nation set spy='$spy' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
else{
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
|
||||
foreach($spyInfo as $cityNo => $remainMonth){
|
||||
if($remainMonth <= 1){
|
||||
unset($spyInfo[$cityNo]);
|
||||
}
|
||||
else{
|
||||
$spyInfo[$cityNo] -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
|
||||
], 'nation=%i', $nationNo);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -427,6 +431,15 @@ function postUpdateMonthly() {
|
||||
|
||||
$history = [];
|
||||
|
||||
//도시 수 측정
|
||||
$cityNations = [];
|
||||
foreach($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $cityNation]){
|
||||
if(!key_exists($cityNation, $cityNations)){
|
||||
$cityNations[$cityNation] = [];
|
||||
}
|
||||
$cityNations[$cityNation][] = $cityName;
|
||||
}
|
||||
|
||||
//각 국가 전월 장수수 대비 당월 장수수로 단합도 산정
|
||||
//각 국가 장수수를 구하고 국력 산정
|
||||
// $query = "select nation,gennum from nation where level>0";
|
||||
@@ -438,34 +451,33 @@ function postUpdateMonthly() {
|
||||
// 접속률
|
||||
// 숙련도
|
||||
// 명성,공헌
|
||||
$query = "
|
||||
select
|
||||
A.nation,
|
||||
A.gennum, A.gennum2, A.chemi,
|
||||
round((
|
||||
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
||||
+A.tech
|
||||
+if(A.level=0,0,(
|
||||
select round(
|
||||
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
|
||||
) from city where nation=A.nation and supply=1
|
||||
))
|
||||
+(select sum(leader+power+intel) from general where nation=A.nation)
|
||||
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
|
||||
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
||||
+(select round(avg(connect)) from general where nation=A.nation)
|
||||
)/10)
|
||||
as power
|
||||
from nation A
|
||||
group by A.nation
|
||||
";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
$genNum = [];
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nations = $db->query('SELECT
|
||||
A.nation,
|
||||
A.gennum, A.gennum2, A.chemi, A.aux,
|
||||
round((
|
||||
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
|
||||
+A.tech
|
||||
+if(A.level=0,0,(
|
||||
select round(
|
||||
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
|
||||
) from city where nation=A.nation and supply=1
|
||||
))
|
||||
+(select sum(leader+power+intel) from general where nation=A.nation)
|
||||
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
|
||||
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
|
||||
+(select round(avg(connect)) from general where nation=A.nation)
|
||||
)/10)
|
||||
as power,
|
||||
(select sum(crew) from general where nation=A.nation) as totalCrew
|
||||
from nation A
|
||||
group by A.nation');
|
||||
foreach($nations as $nation) {
|
||||
$genNum[$nation['nation']] = $nation['gennum'];
|
||||
|
||||
$aux = Json::decode($nation['aux']);
|
||||
|
||||
|
||||
|
||||
if($nation['gennum'] > $nation['gennum2']) {
|
||||
// 장수가 증가했을때
|
||||
$nation['chemi'] -= ceil(($nation['gennum'] - $nation['gennum2']) / $nation['gennum'] * 100);
|
||||
@@ -479,9 +491,21 @@ group by A.nation
|
||||
if($nation['chemi'] > 100) { $nation['chemi'] = 100; }
|
||||
|
||||
//약간의 랜덤치 부여 (95% ~ 105%)
|
||||
|
||||
$nation['power'] = Util::round($nation['power'] * (rand()%101 + 950) / 1000);
|
||||
$query = "update nation set power='{$nation['power']}',gennum2='{$nation['gennum']}',chemi='{$nation['chemi']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$aux['maxPower'] = max($aux['maxPower']??0, $nation['power']);
|
||||
$aux['maxCrew'] = max($aux['maxCrew']??0, Util::toInt($nation['totalCrew']));
|
||||
|
||||
if(count($cityNations[$nation['nation']]??[]) > count($aux['maxCities']??[])){
|
||||
$aux['maxCities'] = $cityNations[$nation['nation']];
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'power'=>$nation['power'],
|
||||
'gennum2'=>$nation['gennum'],
|
||||
'chemi'=>$nation['chemi'],
|
||||
'aux'=>Json::encode($aux)
|
||||
], 'nation=%i', $nation['nation']);
|
||||
}
|
||||
|
||||
// 전쟁기한 세팅
|
||||
@@ -690,6 +714,7 @@ function checkMerge() {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
// 자금 통합, 외교제한 5년, 기술유지
|
||||
$query = "update nation set name='{$you['makenation']}',gold=gold+'{$mynation['gold']}',rice=rice+'{$mynation['rice']}',surlimit='24',totaltech='$newTotalTech',tech='$newTech',gennum='{$newGenCount}' where nation='{$younation['nation']}'";
|
||||
@@ -820,6 +845,7 @@ function checkSurrender() {
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
$newGenCount = $gencount + $gencount2;
|
||||
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
|
||||
@@ -1332,6 +1358,7 @@ function checkEmperior() {
|
||||
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
storeOldGenerals(0, $admin['year'], $admin['month']);
|
||||
storeOldGenerals($nation['nation'], $admin['year'], $admin['month']);
|
||||
@@ -1339,7 +1366,6 @@ function checkEmperior() {
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$nation['nation'],
|
||||
'history'=>'',
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
@@ -1359,6 +1385,10 @@ function checkEmperior() {
|
||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||
$serverName = UniqueConst::$serverName;
|
||||
|
||||
$db->update('ng_games', [
|
||||
'winner_nation'=>$nation['nation']
|
||||
], 'server_id=%s', UniqueConst::$serverID);
|
||||
|
||||
$db->insert('emperior', [
|
||||
'phase'=>$serverName.$serverCnt.'기',
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
|
||||
@@ -156,7 +156,10 @@ function pushOldNationStop(int $no, int $nationNo){
|
||||
}
|
||||
|
||||
//DB-based
|
||||
function pushNationHistory($nation, $history) {
|
||||
function pushNationHistory($nation, ?string $history) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
if(!$nation || !$nation['nation']){
|
||||
return;
|
||||
}
|
||||
@@ -164,7 +167,10 @@ function pushNationHistory($nation, $history) {
|
||||
$history.'<br>', $nation['nation']);
|
||||
}
|
||||
|
||||
function pushGeneralHistory($me, $history) {
|
||||
function pushGeneralHistory($me, ?string $history) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
DB::db()->query("UPDATE general set history=concat(%s, history) where no=%i",
|
||||
$history.'<br>', $me['no']);
|
||||
}
|
||||
@@ -174,7 +180,7 @@ function getGeneralHistoryAll(int $no) {
|
||||
return ConvertLog($history);
|
||||
}
|
||||
|
||||
function pushWorldHistory(array $history, $year=null, $month=null) {
|
||||
function pushWorldHistory(?array $history, $year=null, $month=null) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
@@ -221,7 +227,7 @@ function getWorldHistoryWithDate($year, $month) {
|
||||
}
|
||||
|
||||
|
||||
function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
|
||||
function pushGeneralPublicRecord(?array $history, $year=null, $month=null) {
|
||||
if(!$history){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ function printLimitMsg($turntime) {
|
||||
<html>
|
||||
<head>
|
||||
<title>접속제한</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
@@ -29,7 +31,7 @@ function bar($per, $h=7) {
|
||||
|
||||
$per = round($per, 1);
|
||||
|
||||
$str = "<div class='bar_out' style='height:{$h2}px;'>
|
||||
$str = "<div class='bar_out' style='height:{$h}px;'>
|
||||
<div class='bar_in' style='background:url(".ServConfig::$gameImagePath."/pr{$h2}.gif)'></div>
|
||||
<div style='width:{$per}%;background:url(".ServConfig::$gameImagePath."/pb{$h2}.gif)'></div>
|
||||
</div>";
|
||||
|
||||
@@ -60,6 +60,7 @@ function getWorldMap($req){
|
||||
|
||||
$session = Session::getInstance();
|
||||
$userID = $session->userID;
|
||||
$userGrade = $session->userGrade;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
@@ -94,19 +95,29 @@ function getWorldMap($req){
|
||||
$myNation = null;
|
||||
}
|
||||
|
||||
$spyInfo = (object)null;
|
||||
|
||||
if($myNation){
|
||||
$spyList = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
|
||||
$rawSpy = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
|
||||
$myNation);
|
||||
if($spyList){
|
||||
$spyList = array_map('\sammo\Util::toInt', explode("|", $spyList));
|
||||
|
||||
if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//NOTE: 0.8 이전 데이터가 남아있으므로, 0.8버전으로 마이그레이션 이후에도 이곳은 삭제하면 안됨
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$spyList = [];
|
||||
else if($rawSpy != ''){
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$spyList = [];
|
||||
|
||||
if(!$spyInfo){
|
||||
$spyInfo = (object)null;
|
||||
}
|
||||
|
||||
$nationList = [];
|
||||
@@ -136,13 +147,20 @@ function getWorldMap($req){
|
||||
array_map('\\sammo\\Util::toInt', [$r['city'], $r['level'], $r['state'], $r['nation'], $r['region'], $r['supply']]);
|
||||
}
|
||||
|
||||
if(($req->showMe || !$req->neutralView) && $userGrade >= 5){
|
||||
$spyInfo = [];
|
||||
foreach($cityList as $tmpCity){
|
||||
$spyInfo[$tmpCity[0]] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'startYear' => $startYear,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'cityList' => $cityList,
|
||||
'nationList' => $nationList,
|
||||
'spyList' => $spyList,
|
||||
'spyList' => $spyInfo,
|
||||
'shownByGeneralList' => $shownByGeneralList,
|
||||
'myCity' => $myCity,
|
||||
'myNation' => $myNation,
|
||||
|
||||
@@ -80,10 +80,22 @@ function SetDevelop($genType, $no, $city, $tech) {
|
||||
return;
|
||||
}
|
||||
|
||||
function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$cities = [];
|
||||
$regions = [];
|
||||
|
||||
foreach($db->queryAllLists('SELECT city, region FROM city WHERE nation = %i', $nationID) as [$cityID, $regionID]){
|
||||
$cities[$cityID] = true;
|
||||
$regions[$regionID] = true;
|
||||
}
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||
$relYear = Util::valueFit($year-$startyear, 0);
|
||||
|
||||
$type = 0;
|
||||
switch($genType) {
|
||||
case 0: //무장
|
||||
@@ -107,48 +119,52 @@ function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$types = [];
|
||||
switch($sel) {
|
||||
case 0:
|
||||
$type = 0; //보병
|
||||
if($tech >= 3000 && $city == 3) { $type = 4; } //근위병
|
||||
elseif($tech >= 2000 && $city == 64) { $type = 3; } //자객병
|
||||
elseif($tech >= 1000 && $region == 2) { $type = 1; } //청주병
|
||||
elseif($tech >= 1000 && $region == 5) { $type = 5; } //등갑병
|
||||
elseif($tech >= 1000 && $region == 7) { $type = 2; } //수병
|
||||
foreach(GameUnitConst::byType(GameUnitConst::T_FOOTMAN) as $crewtype){
|
||||
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||
$types[] = $crewtype->id;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
$type = 10; //궁병
|
||||
if($tech >= 3000 && $city == 7) { $type = 14; } //석궁병
|
||||
elseif($tech >= 3000 && $city == 6) { $type = 13; } //강궁병
|
||||
elseif($tech >= 1000 && $region == 4) { $type = 12; } //연노병
|
||||
elseif($tech >= 1000 && $region == 8) { $type = 11; } //궁기병
|
||||
foreach(GameUnitConst::byType(GameUnitConst::T_ARCHER) as $crewtype){
|
||||
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||
$types[] = $crewtype->id;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
$type = 20; //기병
|
||||
if($tech >= 3000 && $city == 2) { $type = 27; } //호표기병
|
||||
elseif($tech >= 2000 && $city == 63) { $type = 24; } //철기병
|
||||
elseif($tech >= 2000 && $city == 67) { $type = 25; } //수렵기병
|
||||
elseif($tech >= 2000 && $city == 65) { $type = 23; } //돌격기병
|
||||
elseif($tech >= 2000 && $city == 66) { $type = 26; } //맹수병
|
||||
elseif($tech >= 1000 && $region == 1) { $type = 21; } //백마병
|
||||
elseif($tech >= 1000 && $region == 3) { $type = 22; } //중장기병
|
||||
foreach(GameUnitConst::byType(GameUnitConst::T_CAVALRY) as $crewtype){
|
||||
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||
$types[] = $crewtype->id;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: //지장
|
||||
case 3: //지내정장
|
||||
$type = 30; //귀병
|
||||
if($tech >= 3000 && $city == 4) { $type = 34; } //악귀병
|
||||
elseif($tech >= 3000 && $city == 5) { $type = 37; } //천귀병
|
||||
elseif($tech >= 3000 && $city == 1) { $type = 38; } //마귀병
|
||||
elseif($tech >= 2000 && $city == 69) { $type = 33; } //흑귀병
|
||||
elseif($tech >= 2000 && $city == 68) { $type = 32; } //백귀병
|
||||
elseif($tech >= 1000 && $region == 6) { $type = 31; } //신귀병
|
||||
elseif($tech >= 3000 && $city == 3) { $type = 36; } //황귀병
|
||||
elseif($tech >= 1000 && rand()%100 < 50) { $type = 35; } //남귀병
|
||||
foreach(GameUnitConst::byType(GameUnitConst::T_WIZARD) as $crewtype){
|
||||
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||
$types[] = $crewtype->id;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if($types){
|
||||
$type = Util::choiceRandom($types);
|
||||
}
|
||||
else{
|
||||
$type = GameUnitConst::DEFAULT_CREWTYPE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$gold -= 200; // 사기비용
|
||||
|
||||
$cost = getCost($type) * getTechCost($tech);
|
||||
@@ -181,7 +197,7 @@ function processAI($no) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
// 입력된 턴이 있으면 그것 실행
|
||||
if($general['turn0'] != "00000000000000") {
|
||||
if(DecodeCommand($general['turn0'])[0] != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,12 +224,9 @@ function processAI($no) {
|
||||
$coreCommand = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$attackable = 0;
|
||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($result);
|
||||
$cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front=1', $general['nation']);
|
||||
// 공격가능도시 있으면 1
|
||||
if($cityCount > 0) { $attackable = 1; }
|
||||
$attackable = $cityCount > 0;
|
||||
|
||||
$dipState = 0;
|
||||
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term>8";
|
||||
@@ -307,10 +320,10 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
//재야인경우
|
||||
if($general['npc'] == 5 && $general['level'] == 0) {
|
||||
if($general['npc'] == 9 && $general['level'] == 0) {
|
||||
// 오랑캐는 바로 임관
|
||||
|
||||
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=5 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
|
||||
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
|
||||
|
||||
if($ruler) {
|
||||
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
|
||||
@@ -320,7 +333,7 @@ function processAI($no) {
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
||||
return;
|
||||
} elseif($general['npc'] < 5 && $general['level'] == 0) {
|
||||
} elseif($general['npc'] != 9 && $general['level'] == 0) {
|
||||
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
|
||||
//임관 10%
|
||||
case 0:
|
||||
@@ -361,7 +374,7 @@ function processAI($no) {
|
||||
}
|
||||
break;
|
||||
case 2: //이동 20%
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
|
||||
break;
|
||||
default:
|
||||
@@ -377,7 +390,7 @@ function processAI($no) {
|
||||
//군주가 할일
|
||||
if($general['level'] == 12) {
|
||||
//오랑캐인데 공격 못하면 바로 방랑/해산
|
||||
if($general['npc'] == 5 && $dipState == 0 && $attackable == 0) {
|
||||
if($general['npc'] == 9 && $dipState == 0 && !$attackable) {
|
||||
//방랑군이냐 아니냐
|
||||
if($nation['level'] == 0) {
|
||||
// 해산
|
||||
@@ -429,7 +442,7 @@ function processAI($no) {
|
||||
return;
|
||||
} elseif(rand()%4 > 0) {
|
||||
//이동
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
@@ -443,37 +456,44 @@ function processAI($no) {
|
||||
}
|
||||
} else {
|
||||
//외교 평시에 선포
|
||||
if($dipState == 0 && $attackable == 0) {
|
||||
//전방 체크 먼저
|
||||
|
||||
do{
|
||||
if($dipState != 0){
|
||||
break;
|
||||
}
|
||||
if($attackable){
|
||||
break;
|
||||
}
|
||||
|
||||
SetNationFront($nation['nation']);
|
||||
|
||||
$query = "select city from city where nation='{$general['nation']}' and front=1 limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
|
||||
$frontCount = MYDB_num_rows($result);
|
||||
//근접 공백지 없을때
|
||||
if($frontCount == 0) {
|
||||
$query = "select (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2))*100 as dev from city where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$devRate = MYDB_fetch_array($result);
|
||||
//내정이 80% 이상일때
|
||||
if($devRate['dev'] > 80) {
|
||||
$query = "select nation from nation where level>0 order by rand()";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$youNation = MYDB_fetch_array($result);
|
||||
|
||||
if(isNeighbor($general['nation'], $youNation['nation'])) {
|
||||
$command = EncodeCommand(0, 0, $youNation['nation'], 62);
|
||||
$query = "update nation set l12turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
$rulerCommand = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front=1', $general['nation']);
|
||||
if($frontCount > 0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$devRate = $db->queryFirstField('SELECT (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2)) from city where nation=%i', $general['nation']);
|
||||
if($devRate < 0.8){
|
||||
break;
|
||||
}
|
||||
|
||||
$nations = [];
|
||||
foreach ($db->queryAllLists('SELECT nation, power FROM nation WHERE level>0') as [$youNationID, $youNationPower]) {
|
||||
if(!isNeighbor($general['nation'], $youNationID)){
|
||||
continue;
|
||||
}
|
||||
$nations[$youNationID] = 1/sqrt($youNationPower+1);
|
||||
}
|
||||
if(!$nations){
|
||||
break;
|
||||
}
|
||||
$youNationID = Util::choiceRandomUsingWeight($nations);
|
||||
$command = EncodeCommand(0, 0, $youNationID, 62);
|
||||
$db->update('nation', [
|
||||
'l12turn0'=>$command
|
||||
], 'nation=%i', $general['nation']);
|
||||
$rulerCommand = 1;
|
||||
}while(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,7 +602,7 @@ function processAI($no) {
|
||||
|
||||
$target = array();
|
||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||
if($dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||
$command = EncodeCommand(0, 0, 0, 17); //소집해제
|
||||
} elseif($dipState <= 1 || $isStart == 1) {
|
||||
//평시이거나 선포있어도 초반이면
|
||||
@@ -600,7 +620,7 @@ function processAI($no) {
|
||||
//현도시가 전방이면 공격 가능성 체크
|
||||
if($city['front'] > 0) {
|
||||
//주변도시 체크
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
for($i=0; $i < count($paths); $i++) {
|
||||
$query = "select city,nation from city where city='$paths[$i]'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),"");
|
||||
@@ -766,7 +786,7 @@ function processAI($no) {
|
||||
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달
|
||||
} else {
|
||||
//공격 & 내정
|
||||
$paths = explode("|", $city['path']);
|
||||
$paths = explode('|', $city['path']);
|
||||
for($i=0; $i < count($paths); $i++) {
|
||||
$query = "select city,nation from city where city='$paths[$i]'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI21 ".MYDB_error($connect),"");
|
||||
@@ -824,26 +844,11 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
switch($command) {
|
||||
case "00000000000001": //내정
|
||||
case EncodeCommand(0, 0, 0, 1): //내정
|
||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||
return;
|
||||
case "00000000000011": //징병
|
||||
$query = "select region from city where nation='{$general['nation']}' order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
||||
$selRegion = MYDB_fetch_array($result);
|
||||
|
||||
$selCity['city'] = 0;
|
||||
// 90% 확률로 이민족 또는 특성병
|
||||
if(rand()%100 < 90) {
|
||||
$query = "select city from city where nation='{$general['nation']}' and (level='4' or level='8') order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
}
|
||||
// 특병 없으면 원래대로
|
||||
if($selCity['city'] == 0) {
|
||||
$selCity['city'] = $general['city'];
|
||||
}
|
||||
SetCrew($general['no'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $selRegion['region'], $selCity['city'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
|
||||
case EncodeCommand(0, 0, 0, 11): //징병
|
||||
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
|
||||
return;
|
||||
default:
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
@@ -1008,7 +1013,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$isWarUser = true;
|
||||
break;
|
||||
}
|
||||
if(Util::randF(0.2)){
|
||||
if(Util::randBool(0.2)){
|
||||
$isWarUser = false;
|
||||
break;
|
||||
}
|
||||
@@ -1206,7 +1211,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$score *= 4;
|
||||
}
|
||||
|
||||
if(Util::randF(0.3) && $frontImportantCitiesID){
|
||||
if(Util::randBool(0.3) && $frontImportantCitiesID){
|
||||
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
|
||||
}
|
||||
else{
|
||||
@@ -1262,7 +1267,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
|
||||
continue;
|
||||
}
|
||||
if (Util::randF($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
|
||||
$leadership *= (100 - $general['injury']) / 100;
|
||||
}
|
||||
|
||||
if($withStatAdjust){
|
||||
if($general['special2'] == 72){
|
||||
$leadership *= 1.15;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($general['lbonus'])){
|
||||
$leadership += $general['lbonus'];
|
||||
}
|
||||
@@ -814,8 +820,8 @@ function process_9(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:{$stype}을 <C>$score</> 조달했습니다. <1>$date</>";
|
||||
}
|
||||
|
||||
$exp = $score * 0.7;
|
||||
$ded = $score * 1.0;
|
||||
$exp = $score * 0.7 / 3;
|
||||
$ded = $score * 1.0 / 3;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
@@ -852,188 +858,175 @@ function process_9(&$general) {
|
||||
}
|
||||
|
||||
function process_11(&$general, $type) {
|
||||
if($type == 1){
|
||||
$type = '징병';
|
||||
}
|
||||
else{
|
||||
$type = '모병';
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; }
|
||||
else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; }
|
||||
if($type === '징병') {
|
||||
$defaultatmos = GameConst::$defaultAtmosLow;
|
||||
$defaulttrain = GameConst::$defaultTrainLow;
|
||||
}
|
||||
else {
|
||||
$defaultatmos = GameConst::$defaultAtmosHigh;
|
||||
$defaulttrain = GameConst::$defaultTrainHigh;
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
[$startyear, $year, $month] = $gameStor->getValuesAsArray(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select level,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$lbonus = setLeadershipBonus($general, $nation['level']);
|
||||
|
||||
$query = "select * from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$actLog = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$armtype = $command[2];
|
||||
$crew = $command[1];
|
||||
$crewType = $command[2];
|
||||
$rawCrew = $command[1];
|
||||
|
||||
|
||||
if($armtype != $general['crewtype']) { $general['crew'] = 0; $general['train'] = $defaulttrain; $general['atmos'] = $defaultatmos; }
|
||||
|
||||
if($crew*100 + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
||||
$crew = Util::round(getGeneralLeadership($general, true, true, true) - $general['crew']/100);
|
||||
if($crewType != $general['crewtype']) {
|
||||
$general['crew'] = 0;
|
||||
$general['train'] = $defaulttrain;
|
||||
$general['atmos'] = $defaultatmos;
|
||||
}
|
||||
if($crew < 0) { $crew = 0; }
|
||||
$cost = $crew * getCost($armtype);
|
||||
//기술로 가격
|
||||
$cost *= getTechCost($nation['tech']);
|
||||
|
||||
if($general['crew'] != 0) {
|
||||
$dtype = "추가".$type;
|
||||
}
|
||||
else {
|
||||
$dtype = $type;
|
||||
}
|
||||
|
||||
if(!$general['nation']){
|
||||
$actLog->pushGeneralActionLog("재야입니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $general['city']);
|
||||
|
||||
if($city['nation'] != $general['nation']){
|
||||
$actLog->pushGeneralActionLog("아국이 아닙니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$crewTypeObj = GameUnitConst::byID($crewType);
|
||||
if($crewTypeObj === null){
|
||||
$actLog->pushGeneralActionLog("병종 코드 에러. $type 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
[$nationLevel, $tech] = $db->queryFirstList('SELECT `level`,tech FROM nation WHERE nation=%i', $general['nation']);
|
||||
|
||||
$lbonus = setLeadershipBonus($general, $nationLevel);
|
||||
|
||||
//NOTE: 입력 변수는 100명 단위임
|
||||
$crew = $rawCrew * 100;
|
||||
if($crew + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
||||
$crew = max(0, getGeneralLeadership($general, true, true, true) * 100 - $general['crew']);
|
||||
}
|
||||
|
||||
if($crew <= 0) {
|
||||
$actLog->pushGeneralActionLog("더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$cost = $crewTypeObj->costWithTech($tech, $crew);
|
||||
if($type === '모병') {
|
||||
$cost *= 2;
|
||||
}
|
||||
//성격 보정
|
||||
$cost = CharCost($cost, $general['personal']);
|
||||
$cost = Util::round($cost);
|
||||
$cost = Util::round(CharCost($cost, $general['personal']));
|
||||
|
||||
//특기 보정 : 보병, 궁병, 기병, 귀병, 공성, 징병
|
||||
if(intdiv($armtype, 10) == 0 && $general['special2'] == 50) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 1 && $general['special2'] == 51) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 2 && $general['special2'] == 52) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 3 && $general['special2'] == 40) { $cost *= 0.9; }
|
||||
if(intdiv($armtype, 10) == 4 && $general['special2'] == 43) { $cost *= 0.9; }
|
||||
//특기 보정 : 징병, 보병, 궁병, 기병, 귀병, 공성
|
||||
if($general['special2'] == 72) { $cost *= 0.5; }
|
||||
|
||||
if($type == 1) { $dtype = "징병"; }
|
||||
elseif($type == 2) { $dtype = "모병"; $cost *= 2; }
|
||||
if($general['crew'] != 0) { $dtype = "추가".$dtype; }
|
||||
|
||||
//현재 가능한지 검사
|
||||
switch($armtype) {
|
||||
case 0: case 10: case 20: case 30: case 35: // 보병 궁병 기병 귀병 남귀병
|
||||
$sel = 0; break;
|
||||
|
||||
case 1: $sel = 1; $rg = 2; break; // 청주병(중원)
|
||||
case 2: $sel = 1; $rg = 7; break; // 수병(오월)
|
||||
case 3: $sel = 2; $ct = 64; break; // 자객병(저)
|
||||
case 4: $sel = 2; $ct = 3; break; // 근위병(낙양)
|
||||
case 5: $sel = 1; $rg = 5; break; // 등갑병(남중)
|
||||
|
||||
case 11: $sel = 1; $rg = 8; break; // 궁기병(동이)
|
||||
case 12: $sel = 1; $rg = 4; break; // 연노병(서촉)
|
||||
case 13: $sel = 2; $ct = 6; break; // 강궁병(양양)
|
||||
case 14: $sel = 2; $ct = 7; break; // 석궁병(건업)
|
||||
|
||||
case 21: $sel = 1; $rg = 1; break; // 백마병(하북)
|
||||
case 22: $sel = 1; $rg = 3; break; // 중장기병(서북)
|
||||
case 23: $sel = 2; $ct = 65; break; // 돌격기병(흉노)
|
||||
case 24: $sel = 2; $ct = 63; break; // 철기병(강)
|
||||
case 25: $sel = 2; $ct = 67; break; // 수렵기병(산월)
|
||||
case 26: $sel = 2; $ct = 66; break; // 맹수병(남만)
|
||||
case 27: $sel = 2; $ct = 2; break; // 호표기병(허창)
|
||||
|
||||
case 31: $sel = 1; $rg = 6; break; // 신귀병(초)
|
||||
case 32: $sel = 2; $ct = 68; break; // 백귀병(오환)
|
||||
case 33: $sel = 2; $ct = 69; break; // 흑귀병(왜)
|
||||
case 34: $sel = 2; $ct = 4; break; // 악귀병(장안)
|
||||
case 36: $sel = 2; $ct = 3; break; // 황귀병(낙양)
|
||||
case 37: $sel = 2; $ct = 5; break; // 천귀병(성도)
|
||||
case 38: $sel = 2; $ct = 1; break; // 마귀병(업)
|
||||
|
||||
case 40: $sel = 0; break; // 정란
|
||||
case 41: $sel = 0; break; // 충차
|
||||
case 42: $sel = 2; $ct = 1; break; // 벽력거(업)
|
||||
case 43: $sel = 2; $ct = 5; break; // 목우(성도)
|
||||
|
||||
default: $sel = 0; $armtype = 0; break;
|
||||
}
|
||||
if($sel == 0) {
|
||||
// 남귀병은 기술1등급부터
|
||||
// 충차는 기술1등급부터
|
||||
if($armtype == 35 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
} elseif($armtype == 41 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
} else {
|
||||
$cnt = 1;
|
||||
}
|
||||
} elseif($sel == 1) {
|
||||
$query = "select city,level from city where nation='{$general['nation']}' and region='$rg'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$rgcity = MYDB_fetch_array($result);
|
||||
// 기술 1000 이상부터 지역병
|
||||
if($cnt > 0 && $nation['tech'] < 1000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
} else {
|
||||
$query = "select city,level from city where nation='{$general['nation']}' and city='$ct'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$ctcity = MYDB_fetch_array($result);
|
||||
// 기술 2000 이상부터 이민족병
|
||||
if($cnt > 0 && $ctcity['level'] == 4 && $nation['tech'] < 2000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
// 기술 3000 이상부터 특수병
|
||||
if($cnt > 0 && $ctcity['level'] == 8 && $nation['tech'] < 3000) {
|
||||
$cnt = 0;
|
||||
}
|
||||
}
|
||||
if($cnt > 0) { $valid = 1; }
|
||||
else { $valid = 0; }
|
||||
|
||||
// 초반 제한중 차병 불가
|
||||
if($admin['year'] < $admin['startyear']+3 && intdiv($armtype, 10) == 4) {
|
||||
$valid = 0;
|
||||
else if($general['special2'] == 50 && $crewTypeObj->armType == GameUnitConstBase::T_FOOTMAN) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 51 && $crewTypeObj->armType == GameUnitConstBase::T_ARCHER) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 52 && $crewTypeObj->armType == GameUnitConstBase::T_CAVALRY) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 40 && $crewTypeObj->armType == GameUnitConstBase::T_WIZARD) { $cost *= 0.9; }
|
||||
else if($general['special2'] == 53 && $crewTypeObj->armType == GameUnitConstBase::T_SIEGE) { $cost *= 0.9; }
|
||||
|
||||
if($general['gold'] < $cost){
|
||||
$actLog->pushGeneralActionLog("자금이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. $dtype 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($crew <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $cost) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $crew) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($valid == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['pop']-30000 < $crew*100) { // 주민 30000명 이상만 가능
|
||||
$log[] = "<C>●</>{$admin['month']}월:주민이 모자랍니다. $dtype 실패. <1>$date</>";
|
||||
} elseif($city['rate'] < 20) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:".GameUnitConst::byId($armtype)->name."을(를) <C>{$crew}00</>명 {$dtype}했습니다. <1>$date</>";
|
||||
$exp = $crew;
|
||||
$ded = $crew;
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $armtype, $crew);
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew*100) / ($general['crew'] + $crew*100));
|
||||
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew*100) / ($general['crew'] + $crew*100));
|
||||
$general['crew'] += $crew*100;
|
||||
$general['gold'] -= $cost;
|
||||
// 주민수 감소 // 민심 김소
|
||||
if($type == 1) { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*100); }
|
||||
else { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*50); }
|
||||
if($city['rate'] < 0) { $city['rate'] = 0; }
|
||||
$query = "update city set pop=pop-({$crew}*100),rate='{$city['rate']}' where city='{$general['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
||||
$general['leader2']++;
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',crewtype='$armtype',crew='{$general['crew']}',train='$train',atmos='$atmos',gold='{$general['gold']}',rice=rice-'$crew',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
if($general['rice'] < $crew / 100) {
|
||||
$actLog->pushGeneralActionLog("군량이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
$ownCities = [];
|
||||
$ownRegions = [];
|
||||
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $general['nation']) as $ownCity){
|
||||
$ownCities[$ownCity] = 1;
|
||||
$ownRegions[CityConst::byId($ownCity)->region] = 1;
|
||||
}
|
||||
$valid = $crewTypeObj->isValid($ownCities, $ownRegions, $year - $startyear, $tech);
|
||||
|
||||
if(!$valid) {
|
||||
$actLog->pushGeneralActionLog("현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
if($city['pop']-30000 < $crew) { // 주민 30000명 이상만 가능
|
||||
$actLog->pushGeneralActionLog("주민이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
if($city['rate'] < 20) {
|
||||
$actLog->pushGeneralActionLog("민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$josaUl = JosaUtil::pick($crewTypeObj->name, '을');
|
||||
$actLog->pushGeneralActionLog($crewTypeObj->name."{$josaUl} <C>{$crew}</>명 {$dtype}했습니다. <1>$date</>");
|
||||
$exp = Util::round($crew / 100);
|
||||
$ded = Util::round($crew / 100);
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $crewType, $crew/100);
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew) / ($general['crew'] + $crew));
|
||||
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew) / ($general['crew'] + $crew));
|
||||
$general['crew'] += $crew;
|
||||
$general['gold'] -= $cost;
|
||||
// 주민수 감소 // 민심 감소
|
||||
if($type === '징병') {
|
||||
$city['rate'] -= Util::round(($crew / $city['pop'])*100);
|
||||
}
|
||||
else {
|
||||
$city['rate'] -= Util::round(($crew / 2 / $city['pop'])*100);
|
||||
}
|
||||
if($city['rate'] < 0) { $city['rate'] = 0; }
|
||||
|
||||
$db->update('city', [
|
||||
'pop'=>$db->sqleval('pop-%i', $crew),
|
||||
'rate'=>$city['rate']
|
||||
], 'city = %i', $general['city']);
|
||||
|
||||
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
||||
$general['leader2']++;
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'leader2'=>$general['leader2'],
|
||||
'crewtype'=>$crewTypeObj->id,
|
||||
'crew'=>$general['crew'],
|
||||
'train'=>$train,
|
||||
'atmos'=>$atmos,
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$db->sqleval('rice - %i', Util::round($crew/100)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', $ded),
|
||||
'experience'=>$db->sqleval('experience + %i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $actLog);
|
||||
$log = uniqueItem($general, []);//TODO: uniqueItem 재 구현
|
||||
$actLog->pushGeneralActionLog($log, ActionLogger::RAWTEXT);
|
||||
}
|
||||
|
||||
function process_13(&$general) {
|
||||
@@ -1060,14 +1053,10 @@ function process_13(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 훈련 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($general['crew'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
|
||||
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
|
||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 훈련이 불가능합니다. <1>$date</>";
|
||||
} else {
|
||||
// 훈련시
|
||||
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
|
||||
@@ -1128,16 +1117,12 @@ function process_14(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 사기진작 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['crew'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $general['crew']/100) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
|
||||
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
|
||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 사기 진작이 불가능합니다. <1>$date</>";
|
||||
} else {
|
||||
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
||||
$gold = $general['gold'] - Util::round($general['crew']/100);
|
||||
@@ -1310,20 +1295,7 @@ function process_16(&$general) {
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 전투 처리
|
||||
$dead = processWar($general, $destcity);
|
||||
|
||||
// 기술력 따라서 보정
|
||||
$dead['att'] = Util::round($dead['att'] * getTechCost($nation['tech']));
|
||||
$dead['def'] = Util::round($dead['def'] * getTechCost($dnation['tech']));
|
||||
|
||||
// 사상자 누적
|
||||
if($nation['nation'] > 0 && $dnation['nation'] > 0) {
|
||||
$query = "update diplomacy set dead=dead+'{$dead['att']}' where me='{$nation['nation']}' and you='{$dnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update diplomacy set dead=dead+'{$dead['def']}' where you='{$nation['nation']}' and me='{$dnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
processWar($general, $destcity);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
@@ -1743,32 +1715,32 @@ function process_31(&$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select spy from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
if($nation['spy'] != "")
|
||||
{
|
||||
$cities = array_map('intval', explode("|", $nation['spy']));
|
||||
|
||||
|
||||
$rawSpy = $db->queryFirstField('SELECT spy FROM nation WHERE nation = %i', $general['nation']);
|
||||
|
||||
if($rawSpy == ''){
|
||||
$spyInfo = [];
|
||||
}
|
||||
else{
|
||||
$cities = [];
|
||||
}
|
||||
$exist = 0;
|
||||
for($i=0; $i < count($cities); $i++) {
|
||||
if(intdiv($cities[$i], 10) == $destination) {
|
||||
$exist = 1;
|
||||
break;
|
||||
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyInfo = [];
|
||||
foreach(explode('|', $rawSpy) as $value){
|
||||
$value = intval($value);
|
||||
$cityNo = intdiv($value, 10);
|
||||
$remainMonth = $value % 10;
|
||||
$spyInfo[$cityNo] = $remainMonth;
|
||||
}
|
||||
}
|
||||
// 기존 첩보 목록에 없으면 새로 등록, 있으면 갱신
|
||||
if($exist == 0) {
|
||||
$cities[] = $destination * 10 + 3;
|
||||
} else {
|
||||
$cities[$i] = $destination * 10 + 3;
|
||||
else{
|
||||
$spyInfo = Json::decode($rawSpy);
|
||||
}
|
||||
$spy = implode("|", $cities);
|
||||
$query = "update nation set spy='$spy' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$spyInfo[$destination] = 3;
|
||||
|
||||
$db->update('nation', [
|
||||
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
|
||||
], 'nation=%i', $general['nation']);
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
@@ -1812,14 +1784,7 @@ function process_41(&$general) {
|
||||
} elseif($crewexp == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
||||
} else {
|
||||
$type = intdiv($general['crewtype'], 10);
|
||||
switch($type) {
|
||||
case 0: $crewstr = '보병'; break;
|
||||
case 1: $crewstr = '궁병'; break;
|
||||
case 2: $crewstr = '기병'; break;
|
||||
case 3: $crewstr = '귀병'; break;
|
||||
case 4: $crewstr = '차병'; break;
|
||||
}
|
||||
$crewstr = GameUnitConst::allType()[GameUnitConst::byID($general['crewtype'])->armType];
|
||||
|
||||
if($ratio < 33) {
|
||||
// 숙련도 증가
|
||||
|
||||
@@ -66,12 +66,6 @@ function process_23(&$general) {
|
||||
} else {
|
||||
$genlog[] = "<C>●</>$dtype <C>$amount</>을 포상으로 받았습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게 $dtype <C>$amount</>을 수여했습니다. <1>$date</>";
|
||||
$exp = 1;
|
||||
$ded = 1;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
if($what == 1) {
|
||||
$gen['gold'] += $amount;
|
||||
@@ -91,8 +85,7 @@ function process_23(&$general) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
// 경험치 상승
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($general, $log);
|
||||
@@ -193,12 +186,6 @@ function process_24(&$general) {
|
||||
|
||||
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게서 $dtype <C>$amount</>을 몰수했습니다. <1>$date</>";
|
||||
$exp = 1;
|
||||
$ded = 1;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
if($what == 1) {
|
||||
$gen['gold'] -= $amount;
|
||||
@@ -219,7 +206,7 @@ function process_24(&$general) {
|
||||
}
|
||||
|
||||
// 경험치 상승
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($general, $log);
|
||||
@@ -283,19 +270,13 @@ function process_27(&$general) {
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$you['name']}</>{$josaUl} <G><b>{$destcity['name']}</b></>{$josaRo} 발령했습니다. <1>$date</>";
|
||||
$youlog[] = "<C>●</><Y>{$general['name']}</>에 의해 <G><b>{$destcity['name']}</b></>{$josaRo} 발령됐습니다. <1>$date</>";
|
||||
$exp = 1;
|
||||
$ded = 1;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 발령
|
||||
$query = "update general set city='$where' where no='{$you['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 경험치 상승
|
||||
$query = "update general set resturn='SUCCESS',experience=experience+'$exp',dedication=dedication+'$ded' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($general, $log);
|
||||
@@ -342,13 +323,6 @@ function process_51(&$general) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
@@ -383,11 +357,6 @@ function process_51(&$general) {
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
@@ -538,13 +507,6 @@ function process_53(&$general) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
@@ -579,11 +541,6 @@ function process_53(&$general) {
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
@@ -625,13 +582,6 @@ function process_61(&$general) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
@@ -682,11 +632,6 @@ function process_61(&$general) {
|
||||
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
// 3턴후
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
@@ -752,12 +697,6 @@ function process_62(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:초반제한 해제 2년전부터 가능합니다. 선포 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 선전 포고 했습니다.<1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
@@ -774,9 +713,6 @@ function process_62(&$general) {
|
||||
$query = "update diplomacy set state='1',term='24' where me='{$younation['nation']}' and you='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("ally ".MYDB_error($connect),"");
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//국메로 저장
|
||||
$text = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
|
||||
|
||||
@@ -846,13 +782,6 @@ function process_63(&$general) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
@@ -888,11 +817,6 @@ function process_63(&$general) {
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>"]);
|
||||
}
|
||||
|
||||
@@ -931,13 +855,6 @@ function process_64(&$general) {
|
||||
return;
|
||||
}
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 상대에게 발송
|
||||
$src = new MessageTarget(
|
||||
$general['no'],
|
||||
@@ -972,11 +889,6 @@ function process_64(&$general) {
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
$db->update('general', [
|
||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
@@ -1036,12 +948,6 @@ function process_65(&$general) {
|
||||
} else {
|
||||
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 초토화했습니다. <1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
@@ -1064,10 +970,6 @@ function process_65(&$general) {
|
||||
$query = "update city set pop=pop*0.1,rate=50,agri=agri*0.1,comm=comm*0.1,secu=secu*0.1,nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='{}' where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//경험치, 공헌치
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//전장수 10% 삭감
|
||||
$query = "update general set experience=experience*0.9,dedication=dedication*0.9 where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1140,12 +1042,6 @@ function process_66(&$general) {
|
||||
} else {
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 천도했습니다. <1>$date</>";
|
||||
$exp = 15;
|
||||
$ded = 15;
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
@@ -1159,10 +1055,6 @@ function process_66(&$general) {
|
||||
$query = "update nation set l{$general['level']}term='0',capital='{$destcity['city']}',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//경험치, 공헌치
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ function process_25(&$general) {
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] == 0 || $admin['scenario'] >= 20 || !$admin['fiction'])){
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] < 100 || $admin['scenario'] >= 2000 || !$admin['fiction'])){
|
||||
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
||||
$nations = $db->query(
|
||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
||||
@@ -172,9 +172,9 @@ function process_25(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
||||
} elseif($admin['year'] < $admin['startyear']+3 && $gencount >= GameConst::$initialNationGenLimit) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
||||
} elseif($nation['scout'] == 1 && $general['npc'] < 5) {
|
||||
} elseif($nation['scout'] == 1 && $general['npc'] != 9) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 금지되어 있습니다. 임관 실패.";
|
||||
} elseif($general['makelimit'] > 0 && $general['npc'] < 5) {
|
||||
} elseif($general['makelimit'] > 0 && $general['npc'] != 9) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야가 된지 12턴이 지나야 합니다. 임관 실패. <1>$date</>";
|
||||
} elseif(in_array($nation['nation'], $joinedNations)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
|
||||
@@ -339,7 +339,7 @@ function process_29(&$general) {
|
||||
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
||||
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
||||
$type = rand() % 10;
|
||||
if($admin['scenario'] == 0) {
|
||||
if($admin['scenario'] < 100) {
|
||||
switch($type) {
|
||||
case 0: case 1:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
|
||||
@@ -2,538 +2,709 @@
|
||||
|
||||
namespace sammo;
|
||||
|
||||
function calcSabotageAttackScore(string $statType, array $general, array $nation):array{
|
||||
setLeadershipBonus($general, $nation['level']);
|
||||
|
||||
if($statType === 'leader'){
|
||||
$genScore = getGeneralLeadership($general, true, true, true);
|
||||
}
|
||||
else if($statType === 'power'){
|
||||
$genScore = getGeneralPower($general, true, true, true);
|
||||
}
|
||||
else if($statType === 'intel'){
|
||||
$genScore = getGeneralIntel($general, true, true, true);
|
||||
}
|
||||
else{
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
|
||||
$genScore /= GameConst::$sabotageProbCoefByStat;
|
||||
|
||||
$specialScore = 0;
|
||||
|
||||
if($general['special'] == 31){
|
||||
//귀모
|
||||
$specialScore += 0.2;
|
||||
}
|
||||
if($general['special2'] == 41){
|
||||
//신산
|
||||
$specialScore += 0.1;
|
||||
}
|
||||
|
||||
if($general['item'] == 21){
|
||||
//육도
|
||||
$specialScore += 0.2;
|
||||
}
|
||||
else if($general['item'] == 22){
|
||||
//삼략
|
||||
$specialScore += 0.2;
|
||||
}
|
||||
|
||||
$itemScore = 0;
|
||||
if($general['item'] == 5){
|
||||
//이추
|
||||
$itemScore += 0.1;
|
||||
}
|
||||
else if($general['item'] == 6){
|
||||
//향낭
|
||||
$itemScore += 0.2;
|
||||
}
|
||||
|
||||
|
||||
$nationScore = 0;
|
||||
if($nation['type'] == 9){
|
||||
$nationScore = 0.1;
|
||||
}
|
||||
|
||||
return [
|
||||
$genScore,
|
||||
$specialScore,
|
||||
$itemScore,
|
||||
$nationScore,
|
||||
];
|
||||
}
|
||||
|
||||
function calcSabotageDefendScore(string $statType, array $generalList, array $city, array $nation):array{
|
||||
$maxGenScore = 0;
|
||||
|
||||
foreach ($generalList as $general) {
|
||||
setLeadershipBonus($general, $nation['level']);
|
||||
|
||||
if ($statType === 'leader') {
|
||||
$maxGenScore = max($maxGenScore, getGeneralLeadership($general, true, true, true));
|
||||
} elseif ($statType === 'power') {
|
||||
$maxGenScore = max($maxGenScore, getGeneralPower($general, true, true, true));
|
||||
} elseif ($statType === 'intel') {
|
||||
$maxGenScore = max($maxGenScore, getGeneralIntel($general, true, true, true));
|
||||
} else {
|
||||
throw new MustNotBeReachedException();
|
||||
}
|
||||
}
|
||||
|
||||
$cityScore = $city['secu'] / $city['secu2'] / 5;
|
||||
$supplyScore = $city['supply'] ? 0.1 : 0;
|
||||
|
||||
return [
|
||||
($maxGenScore / GameConst::$sabotageProbCoefByStat),
|
||||
$cityScore,
|
||||
$supplyScore
|
||||
];
|
||||
}
|
||||
|
||||
function checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState):?string{
|
||||
$srcNationID = $general['nation'];
|
||||
$destNationID = $destCity['nation'];
|
||||
|
||||
if(!$destCity){
|
||||
return '없는 도시입니다.';
|
||||
}
|
||||
if($general['level'] == 0){
|
||||
return '재야입니다.';
|
||||
}
|
||||
if($srcNationID != $srcCity['nation']){
|
||||
return '아국이 아닙니다.';
|
||||
}
|
||||
if(!$srcCity['supply']){
|
||||
return '고립된 도시입니다.';
|
||||
}
|
||||
if($destNationID == 0){
|
||||
return '공백지입니다.';
|
||||
}
|
||||
if($general['gold'] < $reqGold){
|
||||
return '자금이 모자랍니다.';
|
||||
}
|
||||
if($general['rice'] < $reqRice){
|
||||
return '군량이 모자랍니다.';
|
||||
}
|
||||
if($srcNationID == $destNationID){
|
||||
return '아국입니다.';
|
||||
}
|
||||
if($dipState >= 7){
|
||||
return '불가침국입니다.';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function process_32(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$sabotageName = '화계';
|
||||
$statType = 'intel';
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
$reqGold = $develCost * 5;
|
||||
$reqRice = $develCost * 5;
|
||||
|
||||
$srcCityID = $general['city'];
|
||||
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||
|
||||
$query = "select * from city where city='$destination'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
$dist = searchDistance($srcCityID, 5, false);
|
||||
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||
$destCity = $db->queryFirstRow('SELECT city,name,nation,supply,agri,comm FROM city WHERE city=%i',$destCityID);
|
||||
$destCityName = $destCity['name']??null;
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
$srcNationID = $general['nation'];
|
||||
$destNationID = $destCity['nation'];
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||
|
||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
|
||||
if(!$destcity) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 화계 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != $city['nation'] && $nation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($city['supply'] == 0 && $nation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($destcity['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} elseif($dip['state'] >= 7) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
||||
} else {
|
||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by intel desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$intelgen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
// 이추 사용
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] == 6) {
|
||||
// 향낭 사용
|
||||
$ratio += 20;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
$ratio += 20;
|
||||
}
|
||||
|
||||
// 특기보정 : 신산, 귀모
|
||||
if($general['special2'] == 41) { $ratio += 10; }
|
||||
if($general['special'] == 31) { $ratio += 20; }
|
||||
|
||||
// 국가보정
|
||||
if($nation['type'] == 9) { $ratio += 10; }
|
||||
|
||||
// 거리보정
|
||||
$ratio /= Util::array_get($dist[$destination], 99);
|
||||
|
||||
if($ratio > $ratio2) {
|
||||
$josaYi = JosaUtil::pick($destcity['name'], '이');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaYi} 불타고 있습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 성공했습니다. <1>$date</>";
|
||||
|
||||
$destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
if($destcity['agri'] < 0) { $destcity['agri'] = 0; }
|
||||
if($destcity['comm'] < 0) { $destcity['comm'] = 0; }
|
||||
$query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}' where city='$destination'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
SabotageInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 실패했습니다. <1>$date</>";
|
||||
$exp = rand() % 100 + 1;
|
||||
$ded = rand() % 70 + 1;
|
||||
}
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$general['intel2']++;
|
||||
$general['gold'] -= $admin['develcost']*5;
|
||||
$general['rice'] -= $admin['develcost']*5;
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||
if($failReason !== null){
|
||||
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||
return;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$destNation = getNationStaticInfo($destNationID);
|
||||
|
||||
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level FROM general WHERE city=%i and nation=%i', $city['city'], $city['nation']);
|
||||
|
||||
[
|
||||
$srcGenScore,
|
||||
$srcSpecialScore,
|
||||
$srcItemScore,
|
||||
$srcNationScore,
|
||||
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||
|
||||
[
|
||||
$destGenScore,
|
||||
$destCityScore,
|
||||
$destSupplyScore
|
||||
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||
|
||||
$sabotageProb = (
|
||||
GameConst::$sabotageDefaultProb
|
||||
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||
);
|
||||
|
||||
// 거리보정
|
||||
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||
|
||||
if(!Util::randBool($sabotageProb)){
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
return;
|
||||
}
|
||||
|
||||
if($srcItemScore){
|
||||
$itemName = getItemName($general['item']);
|
||||
$josaUl = JosaUtil::pick($itemName, '을');
|
||||
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||
$general['item'] = 0;
|
||||
}
|
||||
|
||||
$josaYi = JosaUtil::pick($destCityName, '이');
|
||||
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>{$josaYi} 불타고 있습니다.");
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||
|
||||
$agriAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['agri']);
|
||||
$commAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['comm']);
|
||||
$destCity['agri'] -= $agriAmount;
|
||||
$destCity['comm'] -= $commAmount;
|
||||
|
||||
$db->update('city', [
|
||||
'state'=>32,
|
||||
'agri'=>$destCity['agri'],
|
||||
'comm'=>$destCity['comm']
|
||||
], 'city=%i', $destCityID);
|
||||
|
||||
$injuryCount = SabotageInjury($destCityID);
|
||||
|
||||
$logger->pushGeneralActionLog("도시의 농업이 <C>{$agriAmount}</>, 상업이 <C>{$commAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||
|
||||
$exp = Util::randRangeInt(201, 300);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(141, 210);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
'firenum' => $db->sqleval('firenum + 1'),
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'item'=>$general['item'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
}
|
||||
|
||||
function process_33(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$sabotageName = '탈취';
|
||||
$statType = 'power';
|
||||
|
||||
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$reqGold = $develCost * 5;
|
||||
$reqRice = $develCost * 5;
|
||||
|
||||
$srcCityID = $general['city'];
|
||||
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||
|
||||
$dist = searchDistance($srcCityID, 5, false);
|
||||
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||
$destCity = $db->queryFirstRow('SELECT city,name,level,nation,secu,secu2,supply,agri,comm FROM city WHERE city=%i',$destCityID);
|
||||
$destCityName = $destCity['name']??null;
|
||||
|
||||
$srcNationID = $general['nation'];
|
||||
$destNationID = $destCity['nation'];
|
||||
|
||||
//탈취는 0까지 무제한
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
|
||||
$query = "select name,level,nation,secu,secu2 from city where city='$destination'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gold,rice from nation where nation='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$mynation = getNationStaticInfo($general['nation']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
|
||||
if(!$destcity) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 탈취 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($destcity['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} elseif($dip['state'] >= 7) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
||||
} else {
|
||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$powergen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
// 이추 사용
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] == 6) {
|
||||
// 향낭 사용
|
||||
$ratio += 20;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
$ratio += 20;
|
||||
}
|
||||
|
||||
// 특기보정 : 신산, 귀모
|
||||
if($general['special2'] == 41) { $ratio += 10; }
|
||||
if($general['special'] == 31) { $ratio += 20; }
|
||||
|
||||
// 국가보정
|
||||
if($mynation['type'] == 9) { $ratio += 10; }
|
||||
|
||||
// 거리보정
|
||||
$ratio /= Util::array_get($dist[$destination], 99);
|
||||
|
||||
if($ratio > $ratio2) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에서 금과 쌀을 도둑맞았습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 성공했습니다. <1>$date</>";
|
||||
|
||||
// 탈취 최대 400 * 8
|
||||
$gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
||||
$rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
||||
|
||||
$nation['gold'] -= $gold;
|
||||
$nation['rice'] -= $rice;
|
||||
if($nation['gold'] < GameConst::$minNationalGold) { $gold += ($nation['gold'] - GameConst::$minNationalGold); $nation['gold'] = GameConst::$minNationalGold; }
|
||||
if($nation['rice'] < GameConst::$minNationalRice) { $rice += ($nation['rice'] - GameConst::$minNationalRice); $nation['rice'] = GameConst::$minNationalRice; }
|
||||
$query = "update nation set gold='{$nation['gold']}',rice='{$nation['rice']}' where nation='{$destcity['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set state=34 where city='$destination'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 본국으로 회수, 재야이면 본인이 소유
|
||||
if($general['nation'] != 0) {
|
||||
$query = "select gold,rice from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nation['gold'] += $gold;
|
||||
$nation['rice'] += $rice;
|
||||
$query = "update nation set gold='{$nation['gold']}',rice='{$nation['rice']}' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$general['gold'] += $gold;
|
||||
$general['rice'] += $rice;
|
||||
$query = "update general set gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$log[] = "<C>●</>금<C>$gold</> 쌀<C>$rice</>을 획득했습니다.";
|
||||
|
||||
// SabotageInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 실패했습니다. <1>$date</>";
|
||||
$exp = rand() % 100 + 1;
|
||||
$ded = rand() % 70 + 1;
|
||||
}
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$general['power2']++;
|
||||
$general['gold'] -= $admin['develcost']*5;
|
||||
$general['rice'] -= $admin['develcost']*5;
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||
if($failReason !== null){
|
||||
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||
return;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$destNation = getNationStaticInfo($destNationID);
|
||||
|
||||
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level FROM general WHERE city=%i and nation=%i', $city['city'], $city['nation']);
|
||||
|
||||
[
|
||||
$srcGenScore,
|
||||
$srcSpecialScore,
|
||||
$srcItemScore,
|
||||
$srcNationScore,
|
||||
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||
|
||||
[
|
||||
$destGenScore,
|
||||
$destCityScore,
|
||||
$destSupplyScore
|
||||
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||
|
||||
$sabotageProb = (
|
||||
GameConst::$sabotageDefaultProb
|
||||
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||
);
|
||||
|
||||
// 거리보정
|
||||
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||
|
||||
if(!Util::randBool($sabotageProb)){
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
return;
|
||||
}
|
||||
|
||||
if($srcItemScore){
|
||||
$itemName = getItemName($general['item']);
|
||||
$josaUl = JosaUtil::pick($itemName, '을');
|
||||
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||
$general['item'] = 0;
|
||||
}
|
||||
|
||||
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>에서 금과 쌀을 도둑맞았습니다.");
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||
|
||||
// 탈취 최대 400 * 8
|
||||
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'];
|
||||
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'];
|
||||
|
||||
if($destCity['supply']){
|
||||
[$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID);
|
||||
|
||||
$destNationGold -= $gold;
|
||||
$destNationRice -= $rice;
|
||||
|
||||
if($destNationGold < GameConst::$minNationalGold) {
|
||||
$gold += $destNationGold - GameConst::$minNationalGold;
|
||||
$destNationGold = GameConst::$minNationalGold;
|
||||
}
|
||||
if($destNationRice < GameConst::$minNationalRice) {
|
||||
$rice += $destNationRice - GameConst::$minNationalRice;
|
||||
$destNationRice = GameConst::$minNationalRice;
|
||||
}
|
||||
|
||||
$db->update('nation', [
|
||||
'gold'=>$destNationGold,
|
||||
'rice'=>$destNationRice
|
||||
], 'nation=%i', $destNationID);
|
||||
$db->update('city', [
|
||||
'state'=>34
|
||||
], 'city=%i', $destCityID);
|
||||
}
|
||||
else{
|
||||
$db->update('city', [
|
||||
'comm'=>Util::valueFit($destCity['comm'] - $gold / 12, 0),
|
||||
'agri'=>Util::valueFit($destCity['agri'] - $rice / 12, 0),
|
||||
'state'=>34
|
||||
], 'city=%i', $destCityID);
|
||||
}
|
||||
|
||||
// 본국으로 일부 회수, 재야이면 본인이 전량 소유
|
||||
if($general['nation'] != 0) {
|
||||
$db->update('nation', [
|
||||
'gold' => $db->sqleval('gold + %i', Util::round($gold * 0.7)),
|
||||
'rice' => $db->sqleval('rice + %i', Util::round($rice * 0.7))
|
||||
], 'nation=%i', $srcNationID);
|
||||
$general['gold'] += $gold - Util::round($gold * 0.7);
|
||||
$general['rice'] += $rice - Util::round($rice * 0.7);
|
||||
} else {
|
||||
$general['gold'] += $gold;
|
||||
$general['rice'] += $rice;
|
||||
}
|
||||
|
||||
$logger->pushGeneralActionLog("금<C>{$gold}</> 쌀<C>{$rice}</>을 획득했습니다.", ActionLogger::PLAIN);
|
||||
|
||||
$exp = Util::randRangeInt(201, 300);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(141, 210);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
'firenum' => $db->sqleval('firenum + 1'),
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'item'=>$general['item'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
}
|
||||
|
||||
function process_34(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$sabotageName = '파괴';
|
||||
$statType = 'power';
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
$reqGold = $develCost * 5;
|
||||
$reqRice = $develCost * 5;
|
||||
|
||||
$query = "select name,nation,def,wall,secu,secu2 from city where city='$destination'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
$srcCityID = $general['city'];
|
||||
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||
|
||||
$mynation = getNationStaticInfo($general['nation']);
|
||||
$dist = searchDistance($srcCityID, 5, false);
|
||||
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||
$destCity = $db->queryFirstRow('SELECT city,name,nation,def,wall,secu,secu2,supply FROM city WHERE city=%i',$destCityID);
|
||||
$destCityName = $destCity['name']??null;
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$srcNationID = $general['nation'];
|
||||
$destNationID = $destCity['nation'];
|
||||
|
||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||
|
||||
if(!$destcity) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 파괴 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($destcity['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} elseif($dip['state'] >= 7) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
||||
} else {
|
||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$powergen = MYDB_fetch_array($result);
|
||||
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||
if($failReason !== null){
|
||||
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||
return;
|
||||
}
|
||||
|
||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$destNation = getNationStaticInfo($destNationID);
|
||||
|
||||
if($general['item'] == 5) {
|
||||
// 이추 사용
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] == 6) {
|
||||
// 향낭 사용
|
||||
$ratio += 20;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
$ratio += 20;
|
||||
}
|
||||
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level FROM general WHERE city=%i and nation=%i', $city['city'], $city['nation']);
|
||||
|
||||
// 특기보정 : 신산, 귀모
|
||||
if($general['special2'] == 41) { $ratio += 10; }
|
||||
if($general['special'] == 31) { $ratio += 20; }
|
||||
[
|
||||
$srcGenScore,
|
||||
$srcSpecialScore,
|
||||
$srcItemScore,
|
||||
$srcNationScore,
|
||||
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||
|
||||
// 국가보정
|
||||
if($mynation['type'] == 9) { $ratio += 10; }
|
||||
[
|
||||
$destGenScore,
|
||||
$destCityScore,
|
||||
$destSupplyScore
|
||||
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||
|
||||
// 거리보정
|
||||
$ratio /= Util::array_get($dist[$destination], 99);
|
||||
$sabotageProb = (
|
||||
GameConst::$sabotageDefaultProb
|
||||
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||
);
|
||||
|
||||
if($ratio > $ratio2) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$destcity['name']}</b></>의 성벽을 허물었습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 성공했습니다. <1>$date</>";
|
||||
// 거리보정
|
||||
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||
|
||||
// 파괴
|
||||
$destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
||||
if($destcity['def'] < 100) { $destcity['def'] = 100; }
|
||||
if($destcity['wall'] < 100) { $destcity['wall'] = 100; }
|
||||
$query = "update city set state=34,def='{$destcity['def']}',wall='{$destcity['wall']}' where city='$destination'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if(!Util::randBool($sabotageProb)){
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||
|
||||
SabotageInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 실패했습니다. <1>$date</>";
|
||||
$exp = rand() % 100 + 1;
|
||||
$ded = rand() % 70 + 1;
|
||||
}
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
$general['power2']++;
|
||||
$general['gold'] -= $admin['develcost']*5;
|
||||
$general['rice'] -= $admin['develcost']*5;
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
return;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
|
||||
if($srcItemScore){
|
||||
$itemName = getItemName($general['item']);
|
||||
$josaUl = JosaUtil::pick($itemName, '을');
|
||||
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||
$general['item'] = 0;
|
||||
}
|
||||
|
||||
$logger->pushGlobalActionLog("누군가가 <G><b>{$destCityName}</b></>의 성벽을 허물었습니다.");
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||
|
||||
// 파괴
|
||||
$defAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['def'] - 100);
|
||||
$wallAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['wall'] - 100);
|
||||
if($defAmount < 0){ $defAmount = 0; }
|
||||
if($wallAmount < 0){ $wallAmount = 0; }
|
||||
|
||||
$destCity['def'] -= $defAmount;
|
||||
$destCity['wall'] -= $wallAmount;
|
||||
|
||||
$db->update('city', [
|
||||
'state'=>32,
|
||||
'def'=>$destCity['def'],
|
||||
'wall'=>$destCity['wall']
|
||||
], 'city=%i', $destCityID);
|
||||
|
||||
$injuryCount = SabotageInjury($destCityID);
|
||||
|
||||
$logger->pushGeneralActionLog("도시의 수비가 <C>{$defAmount}</>, 성벽이 <C>{$wallAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||
|
||||
$exp = Util::randRangeInt(201, 300);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(141, 210);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
'firenum' => $db->sqleval('firenum + 1'),
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'item'=>$general['item'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
}
|
||||
|
||||
function process_35(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$sabotageName = '선동';
|
||||
$statType = 'leader';
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
$reqGold = $develCost * 5;
|
||||
$reqRice = $develCost * 5;
|
||||
|
||||
$query = "select name,nation,rate,secu,secu2 from city where city='$destination'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
$srcCityID = $general['city'];
|
||||
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||
|
||||
$mynation = getNationStaticInfo($general['nation']);
|
||||
$dist = searchDistance($srcCityID, 5, false);
|
||||
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||
$destCity = $db->queryFirstRow('SELECT city,name,nation,rate,secu,secu2,supply FROM city WHERE city=%i',$destCityID);
|
||||
$destCityName = $destCity['name']??null;
|
||||
|
||||
$lbonus = setLeadershipBonus($general, $mynation['level']);
|
||||
$srcNationID = $general['nation'];
|
||||
$destNationID = $destCity['nation'];
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||
|
||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
$lbonus = setLeadershipBonus($general, $srcNation['level']);
|
||||
|
||||
if(!$destcity) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 선동 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($destcity['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} elseif($dip['state'] >= 7) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
||||
} else {
|
||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by leader desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
||||
$ratio2 = rand() % 100;
|
||||
|
||||
if($general['item'] == 5) {
|
||||
// 이추 사용
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] == 6) {
|
||||
// 향낭 사용
|
||||
$ratio += 20;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
$ratio += 20;
|
||||
}
|
||||
|
||||
// 특기보정 : 신산, 귀모
|
||||
if($general['special2'] == 41) { $ratio += 10; }
|
||||
if($general['special'] == 31) { $ratio += 20; }
|
||||
|
||||
// 국가보정
|
||||
if($mynation['type'] == 9) { $ratio += 10; }
|
||||
|
||||
// 거리보정
|
||||
$ratio /= Util::array_get($dist[$destination], 99);
|
||||
|
||||
if($ratio > $ratio2) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>의 백성들이 동요하고 있습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 성공했습니다. <1>$date</>";
|
||||
|
||||
// 선동 최대 10
|
||||
$destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$sabotageDefaultAmount;
|
||||
$destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$sabotageDefaultAmount/50;
|
||||
if($destcity['secu'] < 0) { $destcity['secu'] = 0; }
|
||||
if($destcity['rate'] < 0) { $destcity['rate'] = 0; }
|
||||
$query = "update city set state=32,rate='{$destcity['rate']}',secu='{$destcity['secu']}' where city='$destination'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
SabotageInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 실패했습니다. <1>$date</>";
|
||||
$exp = rand() % 100 + 1;
|
||||
$ded = rand() % 70 + 1;
|
||||
}
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$general['leader2']++;
|
||||
$general['gold'] -= $admin['develcost']*5;
|
||||
$general['rice'] -= $admin['develcost']*5;
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($general, $log);
|
||||
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||
if($failReason !== null){
|
||||
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||
return;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$srcNation = getNationStaticInfo($srcNationID);
|
||||
$destNation = getNationStaticInfo($destNationID);
|
||||
|
||||
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level FROM general WHERE city=%i and nation=%i', $city['city'], $city['nation']);
|
||||
|
||||
[
|
||||
$srcGenScore,
|
||||
$srcSpecialScore,
|
||||
$srcItemScore,
|
||||
$srcNationScore,
|
||||
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||
|
||||
[
|
||||
$destGenScore,
|
||||
$destCityScore,
|
||||
$destSupplyScore
|
||||
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||
|
||||
$sabotageProb = (
|
||||
GameConst::$sabotageDefaultProb
|
||||
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||
);
|
||||
|
||||
// 거리보정
|
||||
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||
|
||||
if(!Util::randBool($sabotageProb)){
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||
|
||||
$exp = Util::randRangeInt(1, 100);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(1, 70);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
return;
|
||||
}
|
||||
|
||||
if($srcItemScore){
|
||||
$itemName = getItemName($general['item']);
|
||||
$josaUl = JosaUtil::pick($itemName, '을');
|
||||
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||
$general['item'] = 0;
|
||||
}
|
||||
|
||||
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>의 백성들이 동요하고 있습니다.");
|
||||
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||
|
||||
// 선동 최대 10
|
||||
$secuAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['secu']);
|
||||
$rateAmount = Util::valueFit(
|
||||
Util::round(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) / 50),
|
||||
null,
|
||||
$destCity['rate']
|
||||
);
|
||||
$destCity['secu'] -= $secuAmount;
|
||||
$destCity['rate'] -= $rateAmount;
|
||||
|
||||
$db->update('city', [
|
||||
'state'=>32,
|
||||
'secu'=>$destCity['secu'],
|
||||
'rate'=>$destCity['rate']
|
||||
], 'city=%i', $destCityID);
|
||||
|
||||
$injuryCount = SabotageInjury($destCityID);
|
||||
|
||||
$logger->pushGeneralActionLog("도시의 치안이 <C>{$secuAmount}</>, 민심이 <C>{$rateAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||
|
||||
$exp = Util::randRangeInt(201, 300);
|
||||
$exp *= getCharExpMultiplier($general['personal']);
|
||||
$ded = Util::randRangeInt(141, 210);
|
||||
$ded *= getCharDedMultiplier($general['personal']);
|
||||
|
||||
$general[$statType.'2'] += 1;
|
||||
$general['gold'] -= $reqGold;
|
||||
$general['rice'] -= $reqRice;
|
||||
$db->update('general', [
|
||||
'firenum' => $db->sqleval('firenum + 1'),
|
||||
($statType.'2') => $general[$statType.'2'],
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'item'=>$general['item'],
|
||||
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
checkAbilityEx($general['no'], $logger);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,42 @@ function CoreTurnTable() {
|
||||
";
|
||||
}
|
||||
|
||||
function displayCharInfo(?int $type):string{
|
||||
$info = getCharInfo($type);
|
||||
$text = getGenChar($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
function displaySpecialInfo(?int $type):string{
|
||||
$info = getSpecialInfo($type);
|
||||
$text = getGenSpecial($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
function displayItemInfo(?int $type):string{
|
||||
$info = getItemInfo($type);
|
||||
$text = getItemName($type);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
function allButton() {
|
||||
$db = DB::db();
|
||||
@@ -167,11 +203,18 @@ function formatName(string $name, int $npc): string{
|
||||
return $name;
|
||||
}
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
function getMapHtml(?string $mapTheme=null){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('map');
|
||||
if($mapTheme === null){
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
}
|
||||
|
||||
return $templates->render('map', [
|
||||
'mapTheme'=>$mapTheme
|
||||
]);
|
||||
}
|
||||
|
||||
function getInvitationList(array $nationList){
|
||||
|
||||
@@ -298,7 +298,7 @@ function fillLowGenAll() {
|
||||
}
|
||||
|
||||
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
||||
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='{$develcost}' order by rand() limit 0,64";
|
||||
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' order by rand() limit 0,64";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
|
||||
@@ -313,7 +313,7 @@ function fillLowGenAll() {
|
||||
if($genCount > 0) {
|
||||
$genCount--;
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$query = "update general set gold=gold-'{$develcost}',tournament='1' where no='{$gen['no']}'";
|
||||
$query = "update general set tournament='1' where no='{$gen['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('{$gen['no']}', '{$gen['npc']}', '{$gen['name']}', '{$gen['leader']}', '{$gen['power']}', '{$gen['intel']}', '{$gen['explevel']}', '$i', '$grpCount[$i]')";
|
||||
|
||||
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
|
||||
|
||||
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
||||
|
||||
@@ -76,7 +76,7 @@ if ($admin['npcmode'] == 0) {
|
||||
$valid = 1;
|
||||
}
|
||||
$color = "cyan";
|
||||
|
||||
$mapTheme = $admin['map_theme'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -84,18 +84,23 @@ $color = "cyan";
|
||||
<title><?=UniqueConst::$serverName?>: 메인</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/main.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<?=WebUtil::printJS('js/msg.js')?>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
$(function(){
|
||||
reloadWorldMap({
|
||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
||||
hrefTemplate:'b_currentCity.php?citylist={0}',
|
||||
useCachedMap:true
|
||||
});
|
||||
|
||||
setInterval(function(){
|
||||
@@ -103,7 +108,7 @@ $(function(){
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/main.css')?>
|
||||
@@ -228,18 +233,18 @@ else if($session->userGrade == 4){
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr>
|
||||
<td width=698 height=520 colspan=2>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=298 rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
||||
</tr>
|
||||
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
||||
<tr>
|
||||
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
||||
<td width=646 style="border:none;text-align:center;"><?php cityInfo(); ?></td>
|
||||
<td style="width:650px;border:none;text-align:center;"><?php cityInfo(); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
<font color=cyan><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능 반복&수정<b>→</b></font>
|
||||
<td style='width:650px;' align=right>
|
||||
<font color=cyan><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능 반복&수정<b>→</b></font>
|
||||
<select name=sel size=1 style=color:white;background-color:black;font-size:13px;>
|
||||
<option value=1>1턴</option>
|
||||
<option value=2>2턴</option>
|
||||
@@ -253,11 +258,11 @@ else if($session->userGrade == 4){
|
||||
<option value=10>10턴</option>
|
||||
<option value=11>11턴</option>
|
||||
<option value=12>12턴</option>
|
||||
</select><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:50px;font-size:13px; value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
|
||||
</select><input type=button style='background-color:<?=GameConst::$basecolor2?>;color:white;width:70px;font-size:13px;margin-left:1ch;margin-right:2ch;' value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right style="border:none;">
|
||||
<td align=right style="'width:650px;border:none;">
|
||||
<?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('../')><br>
|
||||
</td>
|
||||
@@ -286,7 +291,7 @@ else if($session->userGrade == 4){
|
||||
<div class="message_input_form bg0">
|
||||
<select id="mailbox_list" size="1">
|
||||
|
||||
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13">
|
||||
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13px">
|
||||
|
||||
|
||||
|
||||
|
||||