Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccbef236d3 | ||
|
|
d7b9e8b2e0 | ||
|
|
deaf77d3d0 | ||
|
|
5c738f97ed | ||
|
|
c9f7f7ab08 | ||
|
|
746977d5d0 | ||
|
|
acb09bfe71 | ||
|
|
e2a1203b43 | ||
|
|
124036cea6 | ||
|
|
2ac1d82826 | ||
|
|
fa4e0c1948 | ||
|
|
735427ead0 | ||
|
|
4fa99a7e1b | ||
|
|
2f963a205a | ||
|
|
1f03f7e7c3 | ||
|
|
31689fb6ba | ||
|
|
cf7ebbd314 | ||
|
|
40a953aed5 | ||
|
|
c4d999ada7 | ||
|
|
fff6b4e155 | ||
|
|
380e08d89f | ||
|
|
96c8199092 | ||
|
|
54870cf067 | ||
|
|
8654447aac | ||
|
|
28a690cbba | ||
|
|
52d1a48c0b | ||
|
|
f45333db5e | ||
|
|
c920e45934 | ||
|
|
dd86ef4591 | ||
|
|
b9fb00f042 | ||
|
|
355d9fd995 | ||
|
|
b68c13c4f2 | ||
|
|
f2803291ab | ||
|
|
54df034c77 | ||
|
|
7317b8bc18 | ||
|
|
2f030a6dd6 | ||
|
|
ef0dec32ee | ||
|
|
e7f5850c31 | ||
|
|
d1d81e03d1 | ||
|
|
c65d6565df | ||
|
|
a2d40ecf4a | ||
|
|
7291c828c0 | ||
|
|
01caa625bd | ||
|
|
6cad6f45fe | ||
|
|
a6936ac8d7 | ||
|
|
eb9ae00d24 | ||
|
|
b8c8321757 | ||
|
|
41235bed5d | ||
|
|
7367eb1c45 | ||
|
|
f9d90c38ef | ||
|
|
275d9b1c25 | ||
|
|
663c24b31f | ||
|
|
beb501354d | ||
|
|
ba165239c3 | ||
|
|
e64ef5de84 | ||
|
|
c6bbbe081d | ||
|
|
66dcefc844 | ||
|
|
93d580e74e | ||
|
|
9eb35b55c6 | ||
|
|
d2e052dfa3 | ||
|
|
ddd889c42c | ||
|
|
70da3909a9 | ||
|
|
c398b55f3c | ||
|
|
317c42b384 | ||
|
|
a95903ceff | ||
|
|
98c386622a | ||
|
|
398f54cced | ||
|
|
c337ff2f67 | ||
|
|
d9f6f7956e | ||
|
|
30e2432fc3 | ||
|
|
8238f27dfa | ||
|
|
b00d8f2ebd | ||
|
|
98168c61b3 | ||
|
|
6627797cc6 | ||
|
|
30e54c3d0e | ||
|
|
ee3764f5f5 | ||
|
|
a86e4cf64b | ||
|
|
78ea405e40 | ||
|
|
f99583dc99 | ||
|
|
b9e5ddce94 | ||
|
|
1d28f22577 | ||
|
|
90235660db | ||
|
|
8e12aea3ff | ||
|
|
280ff18526 | ||
|
|
9e88b03438 | ||
|
|
14213ea3cd | ||
|
|
5352a507b2 | ||
|
|
3b382199fc | ||
|
|
67dea49a9b | ||
|
|
8bdca87bf9 | ||
|
|
8085e96fdd | ||
|
|
86b40695e6 | ||
|
|
676f98659a | ||
|
|
2fbf8bc2e2 | ||
|
|
bf233f7552 | ||
|
|
2c3e577c4e | ||
|
|
7270de6775 | ||
|
|
e45f3a7d03 | ||
|
|
742e2e8003 | ||
|
|
4cdec6c393 | ||
|
|
a2d273bdc9 | ||
|
|
a163fbef7f | ||
|
|
ec226ede65 | ||
|
|
771fcbec6a | ||
|
|
ae62669fe8 | ||
|
|
4823795c50 | ||
|
|
a80442399d | ||
|
|
913b308892 | ||
|
|
21837d0869 | ||
|
|
5706fcfb7d | ||
|
|
5bc3b55400 | ||
|
|
ffbe2844e4 | ||
|
|
7776b35cab | ||
|
|
c39794c086 | ||
|
|
6aaa50364b | ||
|
|
d0778550ab | ||
|
|
8cba6ac16a | ||
|
|
0516007130 | ||
|
|
af9df325f0 | ||
|
|
4dd69db652 | ||
|
|
316d466795 | ||
|
|
3fb5b99af3 | ||
|
|
1764504ea3 | ||
|
|
fab0495a39 | ||
|
|
166eafe4ee | ||
|
|
9d6181ede1 | ||
|
|
67ecd514a4 | ||
|
|
52f4b79fdf | ||
|
|
5e74a34d3e | ||
|
|
288be33eac | ||
|
|
451a759cca | ||
|
|
a9052705a8 | ||
|
|
5490e74f04 | ||
|
|
ab5768998b | ||
|
|
b71ae96d66 | ||
|
|
e3528ac82f | ||
|
|
bad5a3c0ef | ||
|
|
bb49e6dec7 | ||
|
|
2d24ba659f | ||
|
|
29ce47251a | ||
|
|
d02a84e87e | ||
|
|
c5d008ec47 | ||
|
|
798be5fd5c | ||
|
|
ab6bb54eae | ||
|
|
ae24d18adb | ||
|
|
dcfb49d927 | ||
|
|
d82ab51d58 | ||
|
|
5166001956 | ||
|
|
aa46fc9668 | ||
|
|
beea13ff4b | ||
|
|
766d0b3ad5 | ||
|
|
64e279d859 | ||
|
|
a3f6a8e8ab | ||
|
|
330853c98d | ||
|
|
776e16b58b | ||
|
|
70b1f23a49 | ||
|
|
5e4493b49a | ||
|
|
dec24e09cf | ||
|
|
95445d8f8a | ||
|
|
683a844a08 | ||
|
|
a75eb5b74e | ||
|
|
5dfb844c7e | ||
|
|
20f991a205 | ||
|
|
3c1c339498 | ||
|
|
5974028c4d | ||
|
|
a534b8f812 | ||
|
|
cb2fbf1a32 | ||
|
|
a1392652ae | ||
|
|
69af23b60a | ||
|
|
063b3d37a6 | ||
|
|
ebf9b4b75d | ||
|
|
45fd06c195 | ||
|
|
7db3675e71 | ||
|
|
a19661199e | ||
|
|
953196ec78 | ||
|
|
d5be6e3e08 | ||
|
|
551b79d8c2 | ||
|
|
95a22f228c | ||
|
|
a242b9a20e | ||
|
|
19e91b2de0 | ||
|
|
eac92293fc |
@@ -38,6 +38,8 @@ test.php
|
||||
/che
|
||||
/kwe
|
||||
/pwe
|
||||
/nya
|
||||
/pya
|
||||
/twe
|
||||
|
||||
phpinfo.php
|
||||
|
||||
Vendored
+4
@@ -10,6 +10,8 @@
|
||||
"/che":true,
|
||||
"/kwe":true,
|
||||
"/pwe":true,
|
||||
"/nya":true,
|
||||
"/pya":true,
|
||||
"/twe":true,
|
||||
|
||||
},
|
||||
@@ -19,6 +21,8 @@
|
||||
"/che":true,
|
||||
"/kwe":true,
|
||||
"/pwe":true,
|
||||
"/nya":true,
|
||||
"/pya":true,
|
||||
"/twe":true,
|
||||
},
|
||||
}
|
||||
+2
-1
@@ -16,7 +16,8 @@
|
||||
"firephp/firephp-core": "^0.4.0",
|
||||
"vlucas/valitron": "^1.4",
|
||||
"php-extended/php-tail": "^2.1",
|
||||
"pguardiario/phpuri": "^1.0"
|
||||
"pguardiario/phpuri": "^1.0",
|
||||
"symfony/lock": "^3.4"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+170
-1
@@ -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": "1753c2c2ad9fe40ecc5c6ae541dd2e78",
|
||||
"content-hash": "a329d39be5161c87438d41f9adf4417b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brandonwamboldt/utilphp",
|
||||
@@ -454,6 +454,54 @@
|
||||
],
|
||||
"time": "2017-06-19T01:22:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v2.0.12",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
|
||||
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*|5.*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/random.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paragon Initiative Enterprises",
|
||||
"email": "security@paragonie.com",
|
||||
"homepage": "https://paragonie.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
||||
"keywords": [
|
||||
"csprng",
|
||||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"time": "2018-04-04T21:24:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pguardiario/phpuri",
|
||||
"version": "1.0",
|
||||
@@ -702,6 +750,127 @@
|
||||
],
|
||||
"time": "2014-06-16T22:40:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/lock",
|
||||
"version": "v3.4.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/lock.git",
|
||||
"reference": "3a707193326d31603824706e34a95af899a59788"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/3a707193326d31603824706e34a95af899a59788",
|
||||
"reference": "3a707193326d31603824706e34a95af899a59788",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/polyfill-php70": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"predis/predis": "~1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Lock\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Jérémy Derussé",
|
||||
"email": "jeremy@derusse.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Lock Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"cas",
|
||||
"flock",
|
||||
"locking",
|
||||
"mutex",
|
||||
"redlock",
|
||||
"semaphore"
|
||||
],
|
||||
"time": "2018-04-29T14:44:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php70",
|
||||
"version": "v1.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php70.git",
|
||||
"reference": "77454693d8f10dd23bb24955cffd2d82db1007a6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6",
|
||||
"reference": "77454693d8f10dd23bb24955cffd2d82db1007a6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"paragonie/random_compat": "~1.0|~2.0",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php70\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2018-04-26T10:06:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/valitron",
|
||||
"version": "v1.4.2",
|
||||
|
||||
+19
-24
@@ -1,8 +1,10 @@
|
||||
@charset "utf-8";
|
||||
|
||||
* { margin: 0px; padding: 0px; }
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table {
|
||||
body {
|
||||
color:white; background-color:black; font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
table {
|
||||
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
@@ -23,14 +25,8 @@ a.just_link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div {
|
||||
margin:0px;
|
||||
padding: 0px;
|
||||
word-break: break-all;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.with_border{
|
||||
margin:0;
|
||||
border: solid 1px;
|
||||
border-spacing: 0px;
|
||||
border-collapse: separate;
|
||||
@@ -45,6 +41,8 @@ div {
|
||||
line-height:50px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
text-align: center;
|
||||
color:white;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.legacy_layout div {
|
||||
@@ -56,8 +54,6 @@ div {
|
||||
font-family: '맑은 고딕';;
|
||||
}
|
||||
|
||||
font { font-family: '맑은 고딕';}
|
||||
|
||||
.obj_fill{
|
||||
display:block;
|
||||
width:100%;
|
||||
@@ -70,23 +66,18 @@ button.with_skin {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
button.with_skin:disabled {
|
||||
background-color:#333333;
|
||||
}
|
||||
|
||||
input.with_skin {
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100px; height: 18px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
}
|
||||
button {
|
||||
width: 100px; height: 20px;
|
||||
background-color: black; color: white;
|
||||
font-family: '맑은 고딕';
|
||||
font-size: 13px;
|
||||
input.with_skin:disabled {
|
||||
background-color: #333333;
|
||||
}
|
||||
|
||||
.font0 { font-size: 10px; }
|
||||
@@ -94,4 +85,8 @@ button {
|
||||
.font2 { font-size: 15px; }
|
||||
.font3 { font-size: 20px; }
|
||||
.font4 { font-size: 30px; }
|
||||
.font5 { font-size: 50px; }
|
||||
.font5 { font-size: 50px; }
|
||||
|
||||
caption.section_title {
|
||||
caption-side:top;
|
||||
}
|
||||
+13
-93
@@ -1,5 +1,9 @@
|
||||
@charset "utf-8";
|
||||
|
||||
body{
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
#server_notice {
|
||||
margin:10px 0;
|
||||
border: none;
|
||||
@@ -55,77 +59,6 @@
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/*Legacy*/
|
||||
|
||||
|
||||
#Entrance_00 {
|
||||
width: 800px;
|
||||
position: absolute; top: 50px; left: 50%;
|
||||
margin-left: -400px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#Entrance_0004 {
|
||||
width: 52px; height: 52px;
|
||||
position: absolute; top: 0px; left: -62px;
|
||||
border: 1px solid white;
|
||||
}
|
||||
|
||||
#Entrance_0005 {
|
||||
width: 160px; height: 600px;
|
||||
position: absolute; top: 62px; left: -170px;
|
||||
}
|
||||
|
||||
#Entrance_0006 {
|
||||
width: 160px; height: 600px;
|
||||
position: absolute; top: 62px; left: 810px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#Entrance_0000 {
|
||||
width: 800px; height: 134px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_000000 {
|
||||
width: 798px; height: 50px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_000001 {
|
||||
width: 798px; height: 20px;
|
||||
position: absolute; top: 52px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#Entrance_00000000 {
|
||||
width: 98px; height: 20px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_00000001 {
|
||||
width: 398px; height: 20px;
|
||||
position: absolute; top: 0px; left: 100px;
|
||||
}
|
||||
|
||||
#Entrance_00000002 {
|
||||
width: 178px; height: 20px;
|
||||
position: absolute; top: 0px; left: 500px;
|
||||
}
|
||||
|
||||
#Entrance_00000003 {
|
||||
width: 118px; height: 20px;
|
||||
position: absolute; top: 0px; left: 680px;
|
||||
}
|
||||
|
||||
#Entrance_000002 {
|
||||
width: 798px; height: 64px;
|
||||
position: absolute; top: 74px; left: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.Entrance_ServerList {
|
||||
width: 800px; height: 64px;
|
||||
border: none;
|
||||
@@ -195,27 +128,14 @@
|
||||
color: magenta; font-size: 15px; font-weight: bold;
|
||||
}
|
||||
|
||||
.Entrance_Nya {
|
||||
color: #e67e22; font-size: 15px; font-weight: bold;
|
||||
}
|
||||
|
||||
.Entrance_Pya {
|
||||
color: #9b59b6; font-size: 15px; font-weight: bold;
|
||||
}
|
||||
|
||||
.Entrance_Hwe {
|
||||
color: red; font-size: 15px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_0001 {
|
||||
width: 800px; height: 130px;
|
||||
position: absolute; top: 154px; left: 0px;
|
||||
}
|
||||
|
||||
#Entrance_000100 {
|
||||
width: 798px; height: 50px;
|
||||
position: absolute; top: 0px; left: 0px;
|
||||
font-size: 30px; font-weight: bold;
|
||||
}
|
||||
|
||||
#Entrance_000101 {
|
||||
width: 200px; height: 50px;
|
||||
position: absolute; top: 65px; left: 150px;
|
||||
}
|
||||
|
||||
#Entrance_000102 {
|
||||
width: 200px; height: 50px;
|
||||
position: absolute; top: 65px; left: 450px;
|
||||
}
|
||||
}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
+6
-8
@@ -21,6 +21,7 @@
|
||||
right: 6px;
|
||||
margin:6px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
}
|
||||
|
||||
#btn_delete_me{
|
||||
@@ -37,15 +38,15 @@
|
||||
|
||||
#image_upload_filename{
|
||||
position:absolute;
|
||||
height:16px;
|
||||
height:20px;
|
||||
left:10px;
|
||||
width:130px;
|
||||
top:16px;
|
||||
top:12px;
|
||||
}
|
||||
|
||||
#image_upload_fake_btn{
|
||||
top:16px;
|
||||
height:20px;
|
||||
top:12px;
|
||||
height:22px;
|
||||
right:10px;
|
||||
position:absolute;
|
||||
}
|
||||
@@ -53,8 +54,7 @@
|
||||
#image_upload{
|
||||
opacity: 0;
|
||||
position:absolute;
|
||||
top:16px;
|
||||
height:22px;
|
||||
top:12px;
|
||||
left:0;
|
||||
height:20px;
|
||||
width:100%;
|
||||
@@ -70,7 +70,6 @@
|
||||
bottom:0;
|
||||
left:0;
|
||||
width:50%;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
#btn_remove_icon{
|
||||
@@ -78,7 +77,6 @@
|
||||
bottom:0;
|
||||
right:0;
|
||||
width:50%;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
#third_use_disallow{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
namespace sammo;
|
||||
|
||||
define('ROOT', realpath(__dir__.'/..'));
|
||||
setlocale(LC_ALL, 'ko_KR.UTF-8');
|
||||
date_default_timezone_set('Asia/Seoul');
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_http_output('UTF-8');
|
||||
@@ -82,6 +83,7 @@ function logExceptionByCustomHandler(\Throwable $e){
|
||||
], Json::PRETTY);
|
||||
|
||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
||||
echo $e->getTraceAsString();
|
||||
throw $e;
|
||||
}
|
||||
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
|
||||
@@ -10,13 +10,13 @@ require(__dir__.'/../vendor/autoload.php');
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>설치</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../e_lib/bootstrap.bundle.min.js"></script>
|
||||
<script src="../e_lib/jquery.validate.min.js"></script>
|
||||
<script src="../e_lib/sha512.min.js"></script>
|
||||
<script src="../js/install.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="../e_lib/bootstrap.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="../css/install.css">
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.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/install.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../css/install.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
@@ -216,6 +216,13 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
true
|
||||
);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/menu.orig.js',
|
||||
ROOT.'/d_shared/menu.js',
|
||||
[],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
DROP TABLE IF EXISTS `system`;
|
||||
DROP TABLE IF EXISTS `member`;
|
||||
DROP TABLE IF EXISTS `member_log`;
|
||||
DROP TABLE IF EXISTS `config`;
|
||||
|
||||
-- 시스템 테이블
|
||||
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
|
||||
@@ -30,6 +29,7 @@ CREATE TABLE `member` (
|
||||
`NAME` VARCHAR(64) NOT NULL,
|
||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||
`acl` text NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||
`GRADE` INT(1) NULL DEFAULT '1',
|
||||
`REG_NUM` INT(3) NULL DEFAULT '0',
|
||||
`REG_DATE` DATETIME NOT NULL,
|
||||
@@ -57,11 +57,16 @@ CREATE TABLE `member_log` (
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `config` (
|
||||
###################
|
||||
# KV storage
|
||||
###################
|
||||
CREATE TABLE if not exists `storage` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`key` VARCHAR(50) NOT NULL,
|
||||
`value` VARCHAR(100) NULL DEFAULT NULL,
|
||||
`namespace` VARCHAR(40) NOT NULL,
|
||||
`key` VARCHAR(40) NOT NULL,
|
||||
`value` TEXT NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `key` (`key`)
|
||||
UNIQUE INDEX `key` (`namespace`, `key`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
COLLATE='utf8mb4_general_ci'
|
||||
ENGINE=MyISAM
|
||||
@@ -0,0 +1,8 @@
|
||||
window.sammo_menu = [
|
||||
['/bbs/board', '삼모게시판', '_blank'],
|
||||
['/bbs/tip', '팁/강좌', '_blank'],
|
||||
['/bbs/news', '삼국 일보', '_blank'],
|
||||
['/bbs/history2', '개인 열전', '_blank'],
|
||||
['/bbs/history3', '국가 열전', '_blank'],
|
||||
['/bbs/patch', '패치 내역', '_blank']
|
||||
];
|
||||
+9
-10
@@ -6,14 +6,14 @@ include "func.php";
|
||||
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
if($session->userGrade < 4) {
|
||||
?><!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
@@ -25,11 +25,10 @@ if($session->userGrade < 4) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select turntime,tnmt_time from game";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
list($turntime, $tnmt_time) = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
|
||||
$query = "select plock from plock";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -40,13 +39,13 @@ $plock = MYDB_fetch_array($result);
|
||||
<head>
|
||||
<title>삼국지 모의전투 HiDCHe</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<form action=_119_b.php method=post>
|
||||
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$admin['turntime']?><br>
|
||||
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$admin['tnmt_time']?><br>
|
||||
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$turntime?><br>
|
||||
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$tnmt_time?><br>
|
||||
봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br>
|
||||
락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock['plock']>0?"동결중":"가동중"?><br>
|
||||
</form>
|
||||
|
||||
+39
-22
@@ -27,32 +27,51 @@ $minute2 = Util::getReq('minute2', 'int');
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
switch($btn) {
|
||||
case "분당김":
|
||||
$query = "update game set turntime=DATE_SUB(turntime, INTERVAL $minute MINUTE),starttime=DATE_SUB(starttime, INTERVAL $minute MINUTE),tnmt_time=DATE_SUB(tnmt_time, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set turntime=DATE_SUB(turntime, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update auction set expire=DATE_SUB(expire, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
||||
$turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M"));
|
||||
$starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M"));
|
||||
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
|
||||
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s');
|
||||
$gameStor->starttime = $starttime->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
$db->update('auction', [
|
||||
'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
break;
|
||||
case "분지연":
|
||||
$query = "update game set turntime=DATE_ADD(turntime, INTERVAL $minute MINUTE),starttime=DATE_ADD(starttime, INTERVAL $minute MINUTE),tnmt_time=DATE_ADD(tnmt_time, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set turntime=DATE_ADD(turntime, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update auction set expire=DATE_ADD(expire, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
||||
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
|
||||
$starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
|
||||
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
|
||||
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s');
|
||||
$gameStor->starttime = $starttime->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
$db->update('auction', [
|
||||
'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
break;
|
||||
case "토너분당김":
|
||||
$query = "update game set tnmt_time=DATE_SUB(tnmt_time, INTERVAL $minute2 MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$tnmt_time = new \DateTime($gameStor->tnmt_time);
|
||||
$tnmt_time->sub(new \DateInterval("PT{$minute2}M"));
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
break;
|
||||
case "토너분지연":
|
||||
$query = "update game set tnmt_time=DATE_ADD(tnmt_time, INTERVAL $minute2 MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$tnmt_time = new \DateTimeImmutable($gameStor->tnmt_time);
|
||||
$tnmt_time->add(new \DateInterval("PT{$minute2}M"));
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
break;
|
||||
case "금지급":
|
||||
processGoldIncome();
|
||||
@@ -61,12 +80,10 @@ case "쌀지급":
|
||||
processRiceIncome();
|
||||
break;
|
||||
case "락걸기":
|
||||
$query = "update plock set plock=1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('plock', ['plock'=>1], true);
|
||||
break;
|
||||
case "락풀기":
|
||||
$query = "update plock set plock=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('plock', ['plock'=>0], true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+12
-13
@@ -7,22 +7,21 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -36,15 +35,15 @@ $admin = getAdmin();
|
||||
<head>
|
||||
<title>게임관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td>게 임 관 리<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=_admin1_submit.php>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td width=110 align=right>운영자메세지</td>
|
||||
<td colspan=3><input type=textarea size=90 style=color:white;background-color:black; name=msg value='<?=$admin['msg']?>'><input type=submit name=btn value=변경></td></td>
|
||||
</tr>
|
||||
@@ -81,7 +80,7 @@ $admin = getAdmin();
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+8
-13
@@ -33,15 +33,14 @@ $startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear);
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = getAdmin();
|
||||
|
||||
switch ($btn) {
|
||||
case "변경":
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$query = "update game set msg='$msg'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->msg = $msg;
|
||||
break;
|
||||
case "로그쓰기":
|
||||
$lognum = $admin['historyindex'] + 1;
|
||||
@@ -51,20 +50,16 @@ switch ($btn) {
|
||||
pushWorldHistory(["<R>★</><S>{$log}</>"]);
|
||||
break;
|
||||
case "변경1":
|
||||
$query = "update game set starttime='$starttime'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->starttime = (new \DateTime($starttime))->format('Y-m-d H:i:s');
|
||||
break;
|
||||
case "변경2":
|
||||
$query = "update game set maxgeneral='$maxgeneral'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->maxgeneral = $maxgeneral;
|
||||
break;
|
||||
case "변경3":
|
||||
$query = "update game set maxnation='$maxnation'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->maxnation = $maxnation;
|
||||
break;
|
||||
case "변경4":
|
||||
$query = "update game set startyear='$startyear'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->startyear = $startyear;
|
||||
break;
|
||||
case "1분턴":
|
||||
case "2분턴":
|
||||
@@ -88,8 +83,8 @@ switch ($btn) {
|
||||
$turn = ($admin['year'] - $admin['startyear']) * 12 + $admin['month'] - 1;
|
||||
$starttime = date("Y-m-d H:i:s", strtotime($admin['turntime']) - $turn * $unit);
|
||||
$starttime = cutTurn($starttime, $turnterm);
|
||||
$query = "update game set turnterm='$turnterm',starttime='$starttime'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gameStor->turnterm = $turnterm;
|
||||
$gameStor->starttime = $starttime;
|
||||
// 턴시간이 길어지는 경우 랜덤턴 배정
|
||||
if ($turnterm < $admin['turnterm']) {
|
||||
$query = "select no from general";
|
||||
|
||||
+15
-24
@@ -7,52 +7,47 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>회원관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>회 원 관 리<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=_admin2_submit.php>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 align=center>접속제한</td>
|
||||
<td width=713 align=center><input type=submit name=btn value='전체 접속허용'><input type=submit name=btn value='전체 접속제한'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 align=center rowspan=12>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
|
||||
<td width=105 rowspan=12>
|
||||
@@ -60,13 +55,9 @@ $admin = MYDB_fetch_array($result);
|
||||
|
||||
echo "
|
||||
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
|
||||
$generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)');
|
||||
|
||||
$query = "select no,name,npc,block from general order by npc,binary(name)";
|
||||
$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($generalList as $general){
|
||||
$style = "style=;";
|
||||
if($general['block'] > 0) { $style .= "background-color:red;"; }
|
||||
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
|
||||
@@ -131,7 +122,7 @@ for($i=0; $i < 27; $i++) {
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
@@ -19,9 +19,11 @@ if($session->userGrade < 5) {
|
||||
$generalID = $session->generalID;
|
||||
if(!$generalID){
|
||||
header('location:_admin2.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
@@ -97,7 +99,7 @@ switch($btn) {
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "특기 부여":
|
||||
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
|
||||
list($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){
|
||||
@@ -110,8 +112,9 @@ switch($btn) {
|
||||
'special2'=>$specialWar
|
||||
], 'no=%i', $general['no']);
|
||||
$specialWarName = SpecialityConst::WAR[$specialWar][0];
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:특기 【<b><C>{$specialWarName}</></b>】(을)를 습득");
|
||||
pushGenLog($general, ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】(을)를 익혔습니다!"]);
|
||||
$josaUl = JosaUtil::pick($specialWarName, '을');
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:특기 【<b><C>{$specialWarName}</></b>】{$josaUl} 습득");
|
||||
pushGenLog($general, ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】{$josaUl} 익혔습니다!"]);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -191,12 +194,12 @@ switch($btn) {
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "접속 허용":
|
||||
$db->update('genera',[
|
||||
$db->update('general',[
|
||||
'con'=>0
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "접속 제한":
|
||||
$db->update('genera',[
|
||||
$db->update('general',[
|
||||
'con'=>1000
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
@@ -326,7 +329,7 @@ switch($btn) {
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "00턴":
|
||||
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
$turntime = getRandTurn($turnterm);
|
||||
|
||||
+16
-18
@@ -7,46 +7,44 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$conlimit = $gameStor->conlimit;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>멀티관리</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>멀 티 관 리<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=_admin4_submit.php>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 align=center rowspan=3>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
|
||||
<td width=105 rowspan=3>
|
||||
@@ -65,7 +63,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
if($general['block'] > 0) { $style .= "background-color:red;"; }
|
||||
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
|
||||
elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
|
||||
if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; }
|
||||
if($general['con'] > $conlimit) { $style .= "color:red;"; }
|
||||
|
||||
echo "
|
||||
<option value={$general['no']} $style>{$general['name']}</option>";
|
||||
@@ -90,7 +88,7 @@ echo "
|
||||
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td align=center width=100>장수명</td>
|
||||
<td align=center width=180>최근로그인</td>
|
||||
@@ -137,7 +135,7 @@ echo "
|
||||
//NOTE: password의 md5 해시가 같은지 확인하는 방식으로는 앞으로 잡아낼 수 없다. 폐기
|
||||
?>
|
||||
</form>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+14
-18
@@ -20,22 +20,21 @@ extractMissingPostToGlobals();
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -47,20 +46,17 @@ $sel2 = [];
|
||||
$sel[$type] = "selected";
|
||||
$sel2[$type2] = "selected";
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>일제정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>일 제 정 보<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
<form name=form1 method=post>정렬순서 :
|
||||
@@ -115,7 +111,7 @@ for($i=1; $i <= $count; $i++) {
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1600 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px; id=bg0>
|
||||
<table align=center width=1600 class="tb_layout bg0">
|
||||
<tr id=bg1>
|
||||
<td align=center>국명</td>
|
||||
<td align=center>접률</td>
|
||||
@@ -262,11 +258,11 @@ for($i=0; $i < $nationCount; $i++) {
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=getSabotageLogRecent(20)?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1760 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px; id=bg0>
|
||||
<table align=center width=1760 class="tb_layout bg0">
|
||||
<tr id=bg1>
|
||||
<td width=30 align=center>년</td>
|
||||
<td width=30 align=center>월</td>
|
||||
@@ -317,7 +313,7 @@ for($i=0; $i < $count; $i++) {
|
||||
?>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+12
-13
@@ -14,22 +14,21 @@ extractMissingPostToGlobals();
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -44,11 +43,11 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<title>접속정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>접 속 정 보<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
@@ -61,7 +60,7 @@ $sel[$type] = "selected";
|
||||
<input type=submit value='정렬하기'></form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr id=bg1>
|
||||
<td align=center width=120>장수명</td>
|
||||
<td align=center width=50>접속률</td>
|
||||
@@ -100,7 +99,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+12
-13
@@ -18,22 +18,21 @@ extractMissingPostToGlobals();
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -51,11 +50,11 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<title>로그정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>로 그 정 보<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
<form name=form1 method=post>
|
||||
@@ -99,7 +98,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
</form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 align=center class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=50% align=center id=bg1><font color=skyblue size=3>장 수 정 보</font></td>
|
||||
<td width=50% align=center id=bg1><font color=orange size=3>-</font></td>
|
||||
@@ -136,7 +135,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+14
-15
@@ -14,22 +14,21 @@ extractMissingPostToGlobals();
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if ($session->userGrade < 5) {
|
||||
echo "<!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>관리메뉴</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
관리자가 아닙니다.<br>
|
||||
";
|
||||
echo banner();
|
||||
echo "
|
||||
<?=banner()?>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -47,11 +46,11 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<title>외교정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>외 교 정 보<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
<form name=form1 method=post>
|
||||
@@ -63,11 +62,11 @@ $sel[$type] = "selected";
|
||||
</form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 align=center class='tb_layout bg0'>
|
||||
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
|
||||
<tr>
|
||||
<td width=100 align=center id=bg1>국 가 명</td>
|
||||
<td width=100 align=center id=bg1>국 가 명</td>
|
||||
<td width=130 align=center id=bg1>국 가 명</td>
|
||||
<td width=130 align=center id=bg1>국 가 명</td>
|
||||
<td width=80 align=center id=bg1>상 태</td>
|
||||
<td width=60 align=center id=bg1>기 간</td>
|
||||
<td align=center id=bg1>비 고</td>
|
||||
@@ -155,7 +154,7 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+30
-28
@@ -74,6 +74,7 @@ $dec = 0;
|
||||
$rice = 0;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
increaseRefresh("시뮬", 2);
|
||||
|
||||
@@ -81,11 +82,9 @@ $query = "select no,tournament,con,turntime from general where owner='{$userID}'
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select * from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getAll();
|
||||
|
||||
$con = checkLimit($me['con'], $game['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
|
||||
if($session->userGrade < 3) {
|
||||
@@ -173,7 +172,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
$opposecount = 0;
|
||||
}
|
||||
|
||||
$warphase = getRate($game, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
|
||||
$warphase = getRate($admin, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
|
||||
|
||||
// 우선 스케일링
|
||||
$city['def'] *= 10;
|
||||
@@ -189,7 +188,8 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
while($phase < $warphase) {
|
||||
// 장수가 없어서 도시 공격
|
||||
if($opposecount == 0) {
|
||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."(으)로 성을 <M>공격</>합니다.<br>";
|
||||
$josaRo = JosaUtil::pick(GameUnitConst::byID($general['crewtype'])->name, '로');
|
||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."{$josaRo} 성을 <M>공격</>합니다.<br>";
|
||||
|
||||
$mykillnum = 0; $mydeathnum = 0;
|
||||
while($phase < $warphase) {
|
||||
@@ -301,7 +301,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $avoid == 1) {
|
||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
||||
$myCrew /= 10; // 10%만 소모
|
||||
@@ -379,7 +379,9 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
// 장수 대결
|
||||
} else {
|
||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."(으)로 <Y>수비장수</>의 ".GameUnitConst::byID($oppose['crewtype'])->name."(을)를 공격합니다.<br>";
|
||||
$josaUl = JosaUtil::pick(GameUnitConst::byID($oppose['crewtype'])->name, '을');
|
||||
$josaRo = JosaUtil::pick(GameUnitConst::byID($general['crewtype'])->name, '로');
|
||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."{$josaRo} <Y>수비장수</>의 ".GameUnitConst::byID($oppose['crewtype'])->name."{$josaUl} 공격합니다.<br>";
|
||||
|
||||
$mykillnum = 0; $mydeathnum = 0;
|
||||
while($phase < $warphase) {
|
||||
@@ -665,7 +667,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $myAvoid == 1) {
|
||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
||||
$myCrew /= 10; // 10%만 소모
|
||||
@@ -673,7 +675,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game, $oppose['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $oppose['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $opAvoid == 1) {
|
||||
$msg .= "<C>●</>상대가 <R>회피</>했다!</><br>";
|
||||
$opCrew /= 10; // 10%만 소모
|
||||
@@ -802,8 +804,8 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
|
||||
$def = 7000;
|
||||
$wall = 7000;
|
||||
$train3 = $game['city_rate'];
|
||||
$atmos3 = $game['city_rate'];
|
||||
$train3 = $admin['city_rate'];
|
||||
$atmos3 = $admin['city_rate'];
|
||||
}
|
||||
|
||||
switch($level1) {
|
||||
@@ -1140,8 +1142,8 @@ switch($dex240) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title>전투시뮬레이션</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style type="text/css">
|
||||
select { background-color:black;color:white; }
|
||||
input { background-color:black;color:white; }
|
||||
@@ -1151,7 +1153,7 @@ input { background-color:black;color:white; }
|
||||
|
||||
<body>
|
||||
<form method=post action=_simul.php>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr id=bg1>
|
||||
<td>공격장수</td>
|
||||
<td>상대장수</td>
|
||||
@@ -1584,7 +1586,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
?>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr id=bg1>
|
||||
<td align=right></td>
|
||||
<td align=center>공격</td>
|
||||
@@ -1598,31 +1600,31 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
|
||||
<?php
|
||||
for($i=0; $i <= 5; $i++) {
|
||||
printSimul($game, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=10; $i <= 14; $i++) {
|
||||
printSimul($game, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=20; $i <= 27; $i++) {
|
||||
printSimul($game, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=30; $i <= 38; $i++) {
|
||||
printSimul($game, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=40; $i <= 43; $i++) {
|
||||
printSimul($game, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
@@ -1633,13 +1635,13 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
</html>
|
||||
<?php
|
||||
|
||||
function printSimul($game, $i) {
|
||||
$att = $game["att{$i}"];
|
||||
$def = $game["def{$i}"];
|
||||
$spd = $game["spd{$i}"];
|
||||
$avd = $game["avd{$i}"];
|
||||
$cst = $game["cst{$i}"];
|
||||
$ric = $game["ric{$i}"];
|
||||
function printSimul($admin, $i) {
|
||||
$att = $admin["att{$i}"];
|
||||
$def = $admin["def{$i}"];
|
||||
$spd = $admin["spd{$i}"];
|
||||
$avd = $admin["avd{$i}"];
|
||||
$cst = $admin["cst{$i}"];
|
||||
$ric = $admin["ric{$i}"];
|
||||
echo "
|
||||
<tr>
|
||||
<td align=right>".GameUnitConst::byId($i)->name."</td>
|
||||
|
||||
+16
-18
@@ -13,19 +13,16 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("명장일람", 2);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -37,16 +34,16 @@ if ($con >= 2) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 명장일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>명 장 일 람<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form name=form1 action=a_bestGeneral.php method=post>
|
||||
<tr><td align=center>
|
||||
<input type=submit name=btn value='유저 보기'>
|
||||
@@ -54,7 +51,7 @@ if ($con >= 2) {
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<?php
|
||||
if (isset($btn) && $btn == "NPC 보기") {
|
||||
//FIXME: query가 너무 적나라.
|
||||
@@ -101,6 +98,7 @@ for ($i=0; $i < 21; $i++) {
|
||||
$color = [];
|
||||
$pic = [];
|
||||
|
||||
//FIXME: 쿼리에 index를 사용할 수 없는 녀석들이 있다. 그냥 모두 받아서 일괄 처리하는게 더 나을 수도 있음.
|
||||
switch ($i) {
|
||||
case 0: $query = "select nation,no,name,picture,imgsvr,experience as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 1: $query = "select nation,no,name,picture,imgsvr,dedication as data from general where $sel order by data desc limit 0,10"; break;
|
||||
@@ -173,13 +171,13 @@ for ($i=0; $i < 21; $i++) {
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
@@ -202,7 +200,7 @@ for ($i=0; $i < 21; $i++) {
|
||||
echo "
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
";
|
||||
|
||||
$type = array(
|
||||
@@ -274,13 +272,13 @@ for ($i=0; $i < 4; $i++) {
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=26; $k > 16; $k--) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=26; $k > 16; $k--) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
@@ -326,13 +324,13 @@ for ($i=0; $i < 4; $i++) {
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=16; $k > 6; $k--) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=16; $k > 6; $k--) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
@@ -340,7 +338,7 @@ for ($i=0; $i < 4; $i++) {
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+22
-22
@@ -19,13 +19,13 @@ increaseRefresh("왕조일람", 2);
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style="font-size:13px;word-break:break-all;color:white;background-color:black" id=bg0>
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
</td></tr>
|
||||
@@ -43,7 +43,7 @@ if ($select == 0) {
|
||||
|
||||
echo "
|
||||
<form action=a_emperior.php method=post>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13px;word-break:break-all;color:white;' id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
@@ -57,24 +57,24 @@ if ($select == 0) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center width=123>국 력</td>
|
||||
<td align=center width=123>{$emperior['power']}</td>
|
||||
<td id=bg1 align=center width=123>장 수</td>
|
||||
<td align=center width=123>{$emperior['gennum']}</td>
|
||||
<td id=bg1 align=center width=123>속 령</td>
|
||||
<td align=center width=123>{$emperior['citynum']}</td>
|
||||
<td id=bg1 align=center width=123>성 향</td>
|
||||
<td align=center width=123>{$emperior['type']}</td>
|
||||
<td id=bg1 align=center width=80>국 력</td>
|
||||
<td align=center width=170>{$emperior['power']}</td>
|
||||
<td id=bg1 align=center width=80>장 수</td>
|
||||
<td align=center width=170>{$emperior['gennum']}</td>
|
||||
<td id=bg1 align=center width=80>속 령</td>
|
||||
<td align=center width=170>{$emperior['citynum']}</td>
|
||||
<td id=bg1 align=center width=80>성 향</td>
|
||||
<td align=center width=170>{$emperior['type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=123 align=center>황 제</td>
|
||||
<td width=123 align=center>{$emperior['l12name']}</td>
|
||||
<td id=bg1 width=123 align=center>승 상</td>
|
||||
<td width=123 align=center>{$emperior['l11name']}</td>
|
||||
<td id=bg1 width=123 align=center>위 장 군</td>
|
||||
<td width=123 align=center>{$emperior['l10name']}</td>
|
||||
<td id=bg1 width=123 align=center>사 공</td>
|
||||
<td width=123 align=center>{$emperior['l9name']}</td>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td align=center>{$emperior['l12name']}</td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td align=center>{$emperior['l11name']}</td>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td align=center>{$emperior['l10name']}</td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td align=center>{$emperior['l9name']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
@@ -85,7 +85,7 @@ if ($select == 0) {
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13px;word-break:break-all;color:white;' id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
@@ -197,7 +197,7 @@ if ($select == 0) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all;color:white; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+22
-22
@@ -19,13 +19,13 @@ increaseRefresh("왕조일람", 2);
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
</td></tr>
|
||||
@@ -43,7 +43,7 @@ if ($select == 0) {
|
||||
|
||||
echo "
|
||||
<form action=a_emperior2.php method=post>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
@@ -57,24 +57,24 @@ if ($select == 0) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center width=123>국 력</td>
|
||||
<td align=center width=123>{$emperior['power']}</td>
|
||||
<td id=bg1 align=center width=123>장 수</td>
|
||||
<td align=center width=123>{$emperior['gennum']}</td>
|
||||
<td id=bg1 align=center width=123>속 령</td>
|
||||
<td align=center width=123>{$emperior['citynum']}</td>
|
||||
<td id=bg1 align=center width=123>성 향</td>
|
||||
<td align=center width=123>{$emperior['type']}</td>
|
||||
<td id=bg1 align=center width=80>국 력</td>
|
||||
<td align=center width=170>{$emperior['power']}</td>
|
||||
<td id=bg1 align=center width=80>장 수</td>
|
||||
<td align=center width=170>{$emperior['gennum']}</td>
|
||||
<td id=bg1 align=center width=80>속 령</td>
|
||||
<td align=center width=170>{$emperior['citynum']}</td>
|
||||
<td id=bg1 align=center width=80>성 향</td>
|
||||
<td align=center width=170>{$emperior['type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=123 align=center>황 제</td>
|
||||
<td width=123 align=center>{$emperior['l12name']}</td>
|
||||
<td id=bg1 width=123 align=center>승 상</td>
|
||||
<td width=123 align=center>{$emperior['l11name']}</td>
|
||||
<td id=bg1 width=123 align=center>위 장 군</td>
|
||||
<td width=123 align=center>{$emperior['l10name']}</td>
|
||||
<td id=bg1 width=123 align=center>사 공</td>
|
||||
<td width=123 align=center>{$emperior['l9name']}</td>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td align=center>{$emperior['l12name']}</td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td align=center>{$emperior['l11name']}</td>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td align=center>{$emperior['l10name']}</td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td align=center>{$emperior['l9name']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
@@ -86,7 +86,7 @@ if ($select == 0) {
|
||||
|
||||
echo "
|
||||
<form action=a_emperior2.php method=post>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
@@ -198,7 +198,7 @@ if ($select == 0) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+19
-21
@@ -13,19 +13,16 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("장수일람", 2);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -42,14 +39,15 @@ if ($type <= 0 || $type > 15) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 장수일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>장 수 일 람<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select id='viewType' name='type' size=1>
|
||||
@@ -103,23 +101,23 @@ $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect)
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=64 align=center id=bg1>얼 굴</td>
|
||||
<td width=100 align=center id=bg1>이 름</td>
|
||||
<td width=50 align=center id=bg1>연령</td>
|
||||
<td width=50 align=center id=bg1>성격</td>
|
||||
<td width=90 align=center id=bg1>특기</td>
|
||||
<td width=50 align=center id=bg1>레 벨</td>
|
||||
<td width=100 align=center id=bg1>국 가</td>
|
||||
<td width=60 align=center id=bg1>명 성</td>
|
||||
<td width=60 align=center id=bg1>계 급</td>
|
||||
<td width=80 align=center id=bg1>관 직</td>
|
||||
<td width=140 align=center id=bg1>이 름</td>
|
||||
<td width=45 align=center id=bg1>연령</td>
|
||||
<td width=45 align=center id=bg1>성격</td>
|
||||
<td width=80 align=center id=bg1>특기</td>
|
||||
<td width=45 align=center id=bg1>레 벨</td>
|
||||
<td width=140 align=center id=bg1>국 가</td>
|
||||
<td width=55 align=center id=bg1>명 성</td>
|
||||
<td width=55 align=center id=bg1>계 급</td>
|
||||
<td width=75 align=center id=bg1>관 직</td>
|
||||
<td width=45 align=center id=bg1>통솔</td>
|
||||
<td width=45 align=center id=bg1>무력</td>
|
||||
<td width=45 align=center id=bg1>지력</td>
|
||||
<td width=45 align=center id=bg1>삭턴</td>
|
||||
<td width=84 align=center id=bg1>벌점</td>
|
||||
<td width=70 align=center id=bg1>벌점</td>
|
||||
</tr>";
|
||||
for ($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
@@ -190,7 +188,7 @@ echo "
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -15,16 +15,16 @@ increaseRefresh("명예의전당", 2);
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<?php
|
||||
$type = array(
|
||||
"명 성",
|
||||
@@ -90,13 +90,13 @@ for ($i=0; $i < 21; $i++) {
|
||||
// echo "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
@@ -114,7 +114,7 @@ for ($i=0; $i < 21; $i++) {
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+18
-19
@@ -13,19 +13,18 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("연감", 2);
|
||||
|
||||
$query = "select startyear,year,month,conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
||||
|
||||
$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);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -78,20 +77,20 @@ if ($month <= 0) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 연감</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/base_map.js"></script>
|
||||
<script src="js/map.js"></script>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<link href="css/map.css" rel="stylesheet">
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>연 감<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
<form name=form1 method=post>
|
||||
@@ -124,16 +123,16 @@ $history = MYDB_fetch_array($result);
|
||||
</form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 height=520 class='tb_layout bg0'>
|
||||
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
||||
<tr height=520>
|
||||
<td width=698>
|
||||
<?=getMapHtml();?>
|
||||
|
||||
<td width=98 valign=top><?=$history['nation']?></td>
|
||||
<td width=78 valign=top><?=$history['power']?></td>
|
||||
<td width=58 valign=top><?=$history['gen']?></td>
|
||||
<td width=58 valign=top><?=$history['city']?></td>
|
||||
<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>
|
||||
<td width=43 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>장수</div><?=$history['gen']?></td>
|
||||
<td width=40 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>속령</div><?=$history['city']?></td>
|
||||
</tr>
|
||||
<tr><td colspan=5 align=center id=bg1>중 원 정 세</td></tr>
|
||||
<tr>
|
||||
@@ -148,7 +147,7 @@ $history = MYDB_fetch_array($result);
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+16
-19
@@ -8,19 +8,16 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력일람", 2);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -29,13 +26,13 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>세 력 일 람<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<?php
|
||||
@@ -127,19 +124,19 @@ for($i=1; $i <= $count; $i++) {
|
||||
else { $l5 = $level5['name']; }
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=8 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 {$nation['name']} 】</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=123 align=center id=bg1>성 향</td>
|
||||
<td width=123 align=center><font color=yellow>".getNationType($nation['type'])."</font></td>
|
||||
<td width=123 align=center id=bg1>작 위</td>
|
||||
<td width=123 align=center>".getNationLevel($nation['level'])."</td>
|
||||
<td width=123 align=center id=bg1>국 력</td>
|
||||
<td width=123 align=center>{$nation['power']}</td>
|
||||
<td width=123 align=center id=bg1>장수 / 속령</td>
|
||||
<td width=123 align=center>{$gencount} / {$citycount}</td>
|
||||
<td width=80 align=center id=bg1>성 향</td>
|
||||
<td width=170 align=center><font color=yellow>".getNationType($nation['type'])."</font></td>
|
||||
<td width=80 align=center id=bg1>작 위</td>
|
||||
<td width=170 align=center>".getNationLevel($nation['level'])."</td>
|
||||
<td width=80 align=center id=bg1>국 력</td>
|
||||
<td width=170 align=center>{$nation['power']}</td>
|
||||
<td width=80 align=center id=bg1>장수 / 속령</td>
|
||||
<td width=170 align=center>{$gencount} / {$citycount}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>".getLevel(12, $nation['level'])."</td>
|
||||
@@ -209,7 +206,7 @@ $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=5 align=center>【 재 야 】</td>
|
||||
</tr>
|
||||
@@ -244,7 +241,7 @@ echo"
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+5
-5
@@ -27,13 +27,13 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>빙 의 일 람<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
@@ -71,7 +71,7 @@ $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect)
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=102 align=center id=bg1>희생된 장수</td>
|
||||
<td width=102 align=center id=bg1>악령 이름</td>
|
||||
@@ -120,7 +120,7 @@ echo "
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+14
-17
@@ -8,20 +8,17 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -30,11 +27,11 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/base_map.js"></script>
|
||||
<script src="js/map.js"></script>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -45,18 +42,18 @@ $(function(){
|
||||
|
||||
});
|
||||
</script>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link href="css/normalize.css" rel="stylesheet">
|
||||
<link href="css/common.css" rel="stylesheet">
|
||||
<link href="css/map.css" rel="stylesheet">
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1200 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1200 class='tb_layout bg0'>
|
||||
<tr><td>세 력 도<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1200 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1200 height=520 class='tb_layout bg0'>
|
||||
<tr height=520>
|
||||
<td width=498 valign=top>
|
||||
<?=getGeneralPublicRecordRecent(34)?>
|
||||
@@ -71,7 +68,7 @@ $(function(){
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1200 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1200 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+89
-164
@@ -5,13 +5,12 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("갱신정보", 2);
|
||||
|
||||
$query = "select year,month,refresh,maxrefresh,maxonline from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$game = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
|
||||
|
||||
$log = getRawFileLogRecent(__dir__.'/logs/_traffic.txt', 11, 100);
|
||||
|
||||
@@ -30,18 +29,21 @@ foreach($log as $i=>$value){
|
||||
$refresh[$i] = $parse[3];
|
||||
$online[$i] = $parse[4];
|
||||
}
|
||||
$year[] = $admin['year'];
|
||||
$month[] = $admin['month'];
|
||||
$date[] = date('Y-m-d H:i:s');
|
||||
|
||||
if ($game['maxrefresh'] == 0) {
|
||||
$game['maxrefresh'] = 1;
|
||||
if ($admin['maxrefresh'] == 0) {
|
||||
$admin['maxrefresh'] = 1;
|
||||
}
|
||||
if ($game['maxrefresh'] < $game['refresh']) {
|
||||
$game['maxrefresh'] = $game['refresh'];
|
||||
if ($admin['maxrefresh'] < $admin['refresh']) {
|
||||
$admin['maxrefresh'] = $admin['refresh'];
|
||||
}
|
||||
if ($game['maxonline'] == 0) {
|
||||
$game['maxonline'] = 1;
|
||||
if ($admin['maxonline'] == 0) {
|
||||
$admin['maxonline'] = 1;
|
||||
}
|
||||
if ($game['maxonline'] < $curonline) {
|
||||
$game['maxonline'] = $curonline;
|
||||
if ($admin['maxonline'] < $curonline) {
|
||||
$admin['maxonline'] = $curonline;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -49,218 +51,141 @@ if ($game['maxonline'] < $curonline) {
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
.big_bar{
|
||||
float:left;
|
||||
position:relative;
|
||||
height:30px;
|
||||
}
|
||||
.big_bar span{
|
||||
float:right;
|
||||
padding:0;
|
||||
margin:0;
|
||||
line-height:30px;
|
||||
padding-right:1ch;
|
||||
}
|
||||
|
||||
.little_bar{
|
||||
float:left;
|
||||
position:relative;
|
||||
height:17px;
|
||||
}
|
||||
|
||||
span.out_bar{
|
||||
line-height:30px;
|
||||
margin-left:1ch;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>트 래 픽 정 보<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1016 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all;>
|
||||
<table align=center width=1016>
|
||||
<tr><td align=left>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
|
||||
<?php
|
||||
foreach($log as $i=>$value){
|
||||
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($refresh[$i] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($refresh[$i] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($refresh[$i] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$refresh[] = $admin['refresh'];
|
||||
foreach($refresh as $i=>$value){
|
||||
$w = round($value / $admin['maxrefresh'] * 100, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$refresh[$i]?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<td width=320>
|
||||
<?php if($w == 0): ?>
|
||||
<span class="out_bar"><?=$value?></span>
|
||||
<?php elseif($w < 10): ?>
|
||||
<div class='big_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'></div><span class="out_bar"><?=$value?></span>
|
||||
<?php else:?>
|
||||
<div class='big_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'><span><?=$value?></span></div>
|
||||
<?php endif;?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$w = round($game['refresh'] / $game['maxrefresh'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($game['refresh'] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($game['refresh'] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($game['refresh'] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = date('H:i');
|
||||
?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center><?=$game['year']?>년 <?=$game['month']?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$game['refresh']?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
|
||||
<tr>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$game['maxrefresh']?></td>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$admin['maxrefresh']?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
<td align=right>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
|
||||
<?php
|
||||
foreach($log as $i=>$value){
|
||||
$w = round($online[$i] / $game['maxonline'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($online[$i] < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($online[$i] < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($online[$i] < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$online[] = $curonline;
|
||||
foreach($online as $i=>$value){
|
||||
$w = round($value / $admin['maxonline'] * 100, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
|
||||
<td width=60 align=center id=bg2><?=$dt?></td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$online[$i]?> </td>
|
||||
<td width=<?=$w2?>% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
<td width=320>
|
||||
<?php if($w == 0): ?>
|
||||
<span class="out_bar"><?=$value?></span>
|
||||
<?php elseif($w < 10): ?>
|
||||
<div class='big_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'></div><span class="out_bar"><?=$value?></span>
|
||||
<?php else:?>
|
||||
<div class='big_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'><span><?=$value?></span></div>
|
||||
<?php endif;?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$w = round($curonline / $game['maxonline'] * 100, 1);
|
||||
if ($w >= 100) {
|
||||
$w -= 0.1;
|
||||
}
|
||||
if ($curonline < 10 && $w < 3) {
|
||||
$w = 3;
|
||||
} elseif ($curonline < 100 && $w < 6) {
|
||||
$w = 6;
|
||||
} elseif ($curonline < 1000 && $w < 9) {
|
||||
$w = 9;
|
||||
}
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = date('H:i');
|
||||
echo "
|
||||
<tr height=30>
|
||||
<td width=100 align=center>{$game['year']}년 {$game['month']}월</td>
|
||||
<td width=60 align=center id=bg2>{$dt}</td>
|
||||
<td width=2 align=center id=bg1></td>
|
||||
<td width=320 align=center>
|
||||
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color} align=right>{$curonline} </td>
|
||||
<td width={$w2}% id=bg0><font size=1> </font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
?>
|
||||
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
|
||||
<tr>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game['maxonline']}</td>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$admin['maxonline']?></td>
|
||||
</tr>
|
||||
";
|
||||
?>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr><td colspan=3 align=center id=bg2><font size=5>주 의 대 상 자 (순간과도갱신)</font></td></tr>
|
||||
<?php
|
||||
$query = "select sum(refresh) as refresh,sum(connect) as connect from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$user = MYDB_fetch_array($result);
|
||||
$user['connect'] = round($user['connect'], 1);
|
||||
$maxrefresh = $user['refresh'];
|
||||
$max_refresh = $db->queryFirstRow('SELECT sum(refresh) as refresh, sum(`connect`) as `connect` from general');
|
||||
$max_refresh['name'] = '접속자 총합';
|
||||
|
||||
$w = round($maxrefresh / $maxrefresh * 100, 1);
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getTrafficColor($w);
|
||||
echo "
|
||||
<tr id=bg2>
|
||||
<td width=98 align=center>주의대상자</td>
|
||||
<td width=98 align=center>벌점(순간갱신)</td>
|
||||
<td width=798 align=center>전체 대비</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>접속자 총합</td>
|
||||
<td align=center>{$user['connect']}({$maxrefresh})</td>
|
||||
<td align=center>
|
||||
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color}> </td>
|
||||
<td width={$w2}%> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
$refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5'));
|
||||
|
||||
$query = "select name,refresh,connect from general order by refresh desc limit 0,5";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$user = MYDB_fetch_array($result);
|
||||
|
||||
$w = round($user['refresh'] / $maxrefresh * 100, 1);
|
||||
foreach ($refresh_result as $i=>$user) {
|
||||
$w = round($user['refresh'] / $max_refresh['refresh'] * 100, 1);
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getTrafficColor($w);
|
||||
echo "
|
||||
?>
|
||||
<tr>
|
||||
<td width=98 align=center>{$user['name']}</td>
|
||||
<td width=98 align=center>{$user['connect']}({$user['refresh']})</td>
|
||||
<td width=798 align=center>
|
||||
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width={$w}% bgcolor={$color}> </td>
|
||||
<td width={$w2}%> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<td width=98 align=center><?=$user['name']?></td>
|
||||
<td width=98 align=center><?=$user['connect']?>(<?=$user['refresh']?>)</td>
|
||||
<td width=798>
|
||||
<?php if($w == 0): ?>
|
||||
<?php elseif($w < 10): ?>
|
||||
<div class='little_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'></div>
|
||||
<?php else:?>
|
||||
<div class='little_bar' style='width:<?=$w?>%;background-color:<?=$color?>;'></div>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
@@ -273,7 +198,7 @@ function getTrafficColor($per)
|
||||
$r = getHex($per);
|
||||
$b = getHex(100 - $per);
|
||||
$color = $r . "00" . $b;
|
||||
return $color;
|
||||
return '#'.$color;
|
||||
}
|
||||
|
||||
function getHex($dec)
|
||||
|
||||
+98
-57
@@ -7,22 +7,21 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("설문조사", 1);
|
||||
|
||||
$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()]??[]);
|
||||
$isVoteAdmin |= $session->userGrade >= 5;
|
||||
|
||||
$query = "select no,vote from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select develcost,voteopen,vote,votecomment from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$vote = explode("|", $admin['vote']);
|
||||
if ($vote[0] == "") {
|
||||
$vote[0] = "-";
|
||||
}
|
||||
$admin = $gameStor->getValues(['develcost','voteopen','vote_title','vote','votecomment']);
|
||||
$vote_title = $admin['vote_title']??'-';
|
||||
$vote = $admin['vote']?:['-'];
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -30,8 +29,17 @@ if ($vote[0] == "") {
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 설문조사</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
.little_bar{
|
||||
float:left;
|
||||
position:relative;
|
||||
height:17px;
|
||||
line-height:17px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function captureKey(e) {
|
||||
if(e.keyCode == 13 && e.srcElement.type == 'text') {
|
||||
@@ -44,15 +52,15 @@ function captureKey(e) {
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>설 문 조 사<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form name=form1 action=c_vote.php method=post>
|
||||
<tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin['develcost']*5?>금과 추첨으로 유니크템 증정!)</font></td></tr>
|
||||
<?php
|
||||
|
||||
if ($session->userGrade >= 5) {
|
||||
if ($isVoteAdmin) {
|
||||
echo "
|
||||
<tr>
|
||||
<td width=48 align=center><input type=submit name=btn value='알림'></td>
|
||||
@@ -62,11 +70,11 @@ if ($session->userGrade >= 5) {
|
||||
";
|
||||
}
|
||||
|
||||
$vote[0] = Tag2Code($vote[0]);
|
||||
$vote_title = Tag2Code($vote_title);
|
||||
echo "
|
||||
<tr>
|
||||
<td colspan=2 width=148 align=center id=bg1>제 목</td>
|
||||
<td width=848 align=left> {$vote[0]}</td>
|
||||
<td width=848 align=left> {$vote_title}</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
@@ -91,7 +99,7 @@ for ($i=1; $i < $voteTypeCount; $i++) {
|
||||
echo "
|
||||
<input type=radio name=sel value={$i}>
|
||||
";
|
||||
} elseif ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
} elseif ($admin['voteopen'] >= 1 || $isVoteAdmin) {
|
||||
$query = "select no from general where vote='{$i}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$vCount = MYDB_num_rows($result);
|
||||
@@ -127,7 +135,7 @@ echo "
|
||||
</tr>
|
||||
";
|
||||
|
||||
if ($session->userGrade >= 5) {
|
||||
if ($isVoteAdmin) {
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center><input type=submit name=btn value='리셋'></td>
|
||||
@@ -137,49 +145,49 @@ if ($session->userGrade >= 5) {
|
||||
";
|
||||
}
|
||||
|
||||
if ($admin['votecomment'] != "") {
|
||||
$comment = explode("|", $admin['votecomment']);
|
||||
if ($admin['votecomment']) {
|
||||
$comment = $admin['votecomment'];
|
||||
$commentCount = count($comment);
|
||||
} else {
|
||||
$commentCount = 0;
|
||||
}
|
||||
echo "
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td colspan=4 align=center id=bg1>댓 글</td>
|
||||
</tr>
|
||||
";
|
||||
for ($i=0; $i < $commentCount; $i++) {
|
||||
$cmt = explode(":", $comment[$i]);
|
||||
$cmt = $comment[$i];
|
||||
$cmt[2] = Tag2Code($cmt[2]);
|
||||
$j = $i+1;
|
||||
echo "
|
||||
<tr>
|
||||
<td width=28 align=center>{$j}.</td>
|
||||
<td width=83 align=center>{$cmt[0]}</td>
|
||||
<td width=83 align=center>{$cmt[1]}</td>
|
||||
<td width=788 align=left> {$cmt[2]}</td>
|
||||
<td width=130 align=center>{$cmt[0]}</td>
|
||||
<td width=130 align=center>{$cmt[1]}</td>
|
||||
<td width=712 align=left> {$cmt[2]}</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
if ($me['no'] > 0) {
|
||||
echo "
|
||||
<tr>
|
||||
<td width=108 colspan=2 align=center>-</td>
|
||||
<td width=83 align=center><input type=submit name=btn value='댓글'></td>
|
||||
<td align=left><input type=text name=comment maxlength=60 style=width:798px; onkeydown='return captureKey(event)'></td>
|
||||
<td width=158 colspan=2 align=center>-</td>
|
||||
<td width=130 align=center><input type=submit name=btn value='댓글'></td>
|
||||
<td align=left><input type=text name=comment maxlength=60 style=width:700px; onkeydown='return captureKey(event)'></td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=3 align=center id=bg2><font size=5>
|
||||
전 체 통 계
|
||||
<?php
|
||||
if ($session->userGrade >= 5) {
|
||||
if ($isVoteAdmin) {
|
||||
echo "
|
||||
<input type=submit name=btn value='숨김'>
|
||||
<input type=submit name=btn value='전체통계만'>
|
||||
@@ -188,14 +196,12 @@ if ($session->userGrade >= 5) {
|
||||
echo "
|
||||
</font></td></tr>";
|
||||
|
||||
if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
if ($admin['voteopen'] >= 1 || $isVoteAdmin) {
|
||||
echo "
|
||||
<tr>
|
||||
<td width=98 align=center>전 체</td>
|
||||
<td width=130 align=center>전 체</td>
|
||||
<td width=128 align=center>{$voteCount} / {$allCount} ({$percentage} %)</td>
|
||||
<td width=768 align=center>
|
||||
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=742>
|
||||
";
|
||||
|
||||
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
|
||||
@@ -227,23 +233,35 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
$nationVote[$nation][$ownVote] += $cnt;
|
||||
}
|
||||
|
||||
$totalPer = 0;
|
||||
for ($i=0; $i < $voteTypeCount; $i++) {
|
||||
$per = round(($totalVote[$i]??0) * 100 / $memCount, 1);
|
||||
if($i == $voteTypeCount-1){
|
||||
$per = 100-$totalPer;
|
||||
}
|
||||
else{
|
||||
$totalPer += $per;
|
||||
}
|
||||
|
||||
|
||||
// if($per < 5) { $vote['cnt'] = " "; }
|
||||
echo "
|
||||
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
|
||||
";
|
||||
?>
|
||||
<?php if($per == 0): ?>
|
||||
<?php elseif($per < 10): ?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($i)?>;background-color:<?=getVoteColor($i)?>;'></div>
|
||||
<?php else:?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($i)?>;background-color:<?=getVoteColor($i)?>;'><?=$totalVote[$i]?></div>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
if ($admin['voteopen'] >= 2 || $isVoteAdmin) {
|
||||
$query = "select no from general where nation=0 and npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$memCount = MYDB_num_rows($result);
|
||||
@@ -260,22 +278,30 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
<tr>
|
||||
<td align=center bgcolor=black>재 야</td>
|
||||
<td align=center>{$nationVoteCount[0]} / {$memCount} ({$percentage} %)</td>
|
||||
<td align=center>
|
||||
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td>
|
||||
";
|
||||
|
||||
$totalPer = 0;
|
||||
for ($i=0; $i < $voteTypeCount; $i++) {
|
||||
$per = round(Util::array_get($nationVote[0][$i], 0) / $memCount * 100, 1);
|
||||
if($i == $voteTypeCount-1){
|
||||
$per = 100-$totalPer;
|
||||
}
|
||||
else{
|
||||
$totalPer += $per;
|
||||
}
|
||||
// if($per < 5) { $vote['cnt'] = " "; }
|
||||
echo "
|
||||
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$nationVote[0][$i]}</td>
|
||||
";
|
||||
?>
|
||||
<?php if($per == 0): ?>
|
||||
<?php elseif($per < 10): ?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($i)?>;background-color:<?=getVoteColor($i)?>;'></div>
|
||||
<?php else:?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($i)?>;background-color:<?=getVoteColor($i)?>;'><?=$nationVote[0][$i]?></div>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
@@ -306,21 +332,36 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
<td align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>{$nation['name']}</td>
|
||||
<td align=center>{$voteCount} / {$memCount} ({$percentage} %)</td>
|
||||
<td align=center>
|
||||
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
";
|
||||
|
||||
$totalPer = 0;
|
||||
for ($k=0; $k < $voteTypeCount; $k++) {
|
||||
$per = round($nationVote[$nation['nation']][$k] / $memCount * 100, 1);
|
||||
if($memCount == 0){
|
||||
$per = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
$per = round($nationVote[$nation['nation']][$k]??0 / $memCount * 100, 1);
|
||||
|
||||
if($i == $voteTypeCount-1){
|
||||
$per = 100-$totalPer;
|
||||
}
|
||||
else{
|
||||
$totalPer += $per;
|
||||
}
|
||||
|
||||
// if($per < 5) { $vote['cnt'] = " "; }
|
||||
echo "
|
||||
<td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getVoteColor($k).">{$nationVote[$nation['nation']][$k]}</td>
|
||||
";
|
||||
?>
|
||||
<?php if($per == 0): ?>
|
||||
<?php elseif($per < 10): ?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($k)?>;background-color:<?=getVoteColor($k)?>;'></div>
|
||||
<?php else:?>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($k)?>;background-color:<?=getVoteColor($k)?>;'><?=$nationVote[$nation['nation']][$k]??0?></div>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
@@ -329,7 +370,7 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
?>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+8
-12
@@ -14,6 +14,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("거래장", 2);
|
||||
@@ -22,11 +23,7 @@ $query = "select no,special,con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -60,16 +57,15 @@ if ($msg2 == "") {
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 거래장</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>거 래 장<br><?=closeButton()?></td></tr>
|
||||
<tr><td align=center id=bg2><font color=orange size=6><b>거 래 장</b></font><input type=button value='갱신' onclick=location.replace('b_auction.php')></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form method=post action=c_auction.php>
|
||||
<tr><td colspan=11 align=center bgcolor=orange><font size=5>팝 니 다</font></td></tr>
|
||||
<tr align=center id=bg1>
|
||||
@@ -167,7 +163,7 @@ for ($i=0; $i < $count; $i++) {
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form method=post action=c_auction.php>
|
||||
<tr><td colspan=11 align=center bgcolor=skyblue><font size=5>삽 니 다</font></td></tr>
|
||||
<tr align=center id=bg1>
|
||||
@@ -265,7 +261,7 @@ for ($i=0; $i < $count; $i++) {
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td align=center id=bg2><font size=5>최 근 기 록</font></td></tr>
|
||||
<tr><td>
|
||||
<?=getAuctionLogRecent(20)?>
|
||||
|
||||
+8
-10
@@ -23,15 +23,13 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("감찰부", 2);
|
||||
//전투 추진을 위해 갱신
|
||||
checkTurn();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$gameStor->resetCache();
|
||||
|
||||
$query = "select nation from general where no='$gen'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -45,7 +43,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -77,13 +75,13 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 감찰부</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>감 찰 부<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
<form name=form1 method=post>
|
||||
@@ -131,7 +129,7 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
</form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 align=center class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=50% align=center id=bg1><font color=skyblue size=3>장 수 정 보</font></td>
|
||||
<td width=50% align=center id=bg1><font color=orange size=3>장 수 열 전</font></td>
|
||||
@@ -170,7 +168,7 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+16
-22
@@ -8,6 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("베팅장", 1);
|
||||
@@ -17,11 +18,13 @@ $query = "select no,tournament,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+b
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select conlimit,tournament,phase,tnmt_type,develcost,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_type','develcost','bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$admin['bet'] =
|
||||
$admin['bet0'] + $admin['bet1'] + $admin['bet2'] + $admin['bet3'] + $admin['bet4'] +
|
||||
$admin['bet5'] + $admin['bet6'] + $admin['bet7'] + $admin['bet8'] + $admin['bet9'] +
|
||||
$admin['bet10'] + $admin['bet11'] + $admin['bet12'] + $admin['bet13'] + $admin['bet14'] + $admin['bet15'];
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -54,29 +57,20 @@ if($str3){
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||
<style>
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table { font-family:'맑은 고딕';}
|
||||
font { font-family:'맑은 고딕';}
|
||||
input { font-family:'맑은 고딕';height:20px }
|
||||
select { font-family:'굴림'; }
|
||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
|
||||
</style>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr><td>베 팅 장<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
|
||||
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
|
||||
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet']?> / 내 투자 금액 : <?=$me['bet']?>)</font></td></tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='mimic_flex bg0' style='border:solid 1px gray;font-size:10px;'>
|
||||
<tr align=center><td height=10 colspan=16></td></tr>
|
||||
<tr align=center>
|
||||
<?php
|
||||
@@ -308,7 +302,7 @@ for ($i=0; $i < 16; $i++) {
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr align=center><td height=10 colspan=16></td></tr>
|
||||
<?php
|
||||
echo "
|
||||
@@ -387,7 +381,7 @@ if ($admin['tournament'] == 6) {
|
||||
</tr>
|
||||
<tr align=center><td height=10 colspan=16></td></tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr align=center><td height=50 colspan=4 id=bg2><font color=yellow size=6>토너먼트 랭킹</font></td></tr>
|
||||
<tr align=center><td colspan=4 id=bg2><font color=skyblue size=3>순위 / 장수명 / 능력치 / 경기수 / 승리 / 무승부 / 패배 / 집계점수 / 우승횟수</font></td></tr>
|
||||
<tr align=center>
|
||||
@@ -402,7 +396,7 @@ for ($i=0; $i < 4; $i++) {
|
||||
$grp = $i;
|
||||
echo "
|
||||
<td>
|
||||
<table align=center width=280 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=280 class='tb_layout bg0'>
|
||||
<tr><td colspan=9 align=center style=color:white;background-color:black;><font size=4>{$type1[$i]}</font></td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$type2[$i]}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>勝</td></tr>";
|
||||
|
||||
@@ -429,7 +423,7 @@ for ($i=0; $i < 4; $i++) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -27,13 +27,14 @@ if($me['level'] < 5) {
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<div style='width:1000px;margin:auto'>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>기 밀 실<br><?=backButton()?></td></tr>
|
||||
<form name=form1 method=post action=c_chiefboard.php>
|
||||
<tr><td align=center>
|
||||
@@ -65,10 +66,11 @@ for($i=0; $i < 20; $i++) {
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+18
-23
@@ -8,14 +8,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("사령부", 1);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -24,7 +21,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
|
||||
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
@@ -38,9 +35,7 @@ else { $btn = "hidden"; $btn2 = "hidden"; }
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// 명령 목록
|
||||
$query = "select year,month,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','turnterm']);
|
||||
|
||||
$query = "
|
||||
select nation,level,
|
||||
@@ -84,8 +79,8 @@ for($i= $lv - 1; $i>=5; $i--){
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
function turn(type) {
|
||||
if(type == 0) location.replace('turn_push_core.php');
|
||||
@@ -96,10 +91,10 @@ function turn(type) {
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>사 령 부<input type=button value='갱신' onclick=location.replace('b_chiefcenter.php')><br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=10 align=center bgcolor=skyblue>수뇌부 일정</td></tr>
|
||||
<tr><td colspan=10 align=center>
|
||||
<?php
|
||||
@@ -157,16 +152,16 @@ for($k=0; $k < 2; $k++) {
|
||||
$tn1 = $turn[$l1][$i]??"-";
|
||||
echo "
|
||||
<tr>
|
||||
<td width=28 align=center id=bg0><b>$j</b></td>
|
||||
<td width=58 align=center bgcolor=black><b>$td4</b></td>
|
||||
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn4</td>
|
||||
<td width=58 align=center bgcolor=black><b>$td3</b></td>
|
||||
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn3</td>
|
||||
<td width=58 align=center bgcolor=black><b>$td2</b></td>
|
||||
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn2</td>
|
||||
<td width=58 align=center bgcolor=black><b>$td1</b></td>
|
||||
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn1</td>
|
||||
<td width=28 align=center id=bg0><b>$j</b></td>
|
||||
<td width=20 align=center id=bg0><b>$j</b></td>
|
||||
<td width=43 align=center bgcolor=black><b>$td4</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn4</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td3</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn3</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td2</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn2</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td1</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn1</td>
|
||||
<td width=20 align=center id=bg0><b>$j</b></td>
|
||||
</tr>
|
||||
";
|
||||
if($totaldate[$l4]??'') { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
|
||||
@@ -188,7 +183,7 @@ for($k=0; $k < 2; $k++) {
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+22
-22
@@ -34,8 +34,8 @@ $templates = new \League\Plates\Engine('templates');
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 도시정보</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link href="css/common.css" rel="stylesheet">
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
#general_list tr td{
|
||||
text-align:center;
|
||||
@@ -53,11 +53,11 @@ $templates = new \League\Plates\Engine('templates');
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>도 시 정 보<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=998>
|
||||
<form name=cityselect method=get>도시선택 :
|
||||
@@ -175,27 +175,27 @@ if($city['trade'] == 0) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg2>
|
||||
<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=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>
|
||||
<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>
|
||||
@@ -230,11 +230,11 @@ if($city['trade'] == 0) {
|
||||
|
||||
|
||||
<br>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 align=center class=bg1>얼 굴</td>
|
||||
<td width=98 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>
|
||||
@@ -244,7 +244,7 @@ if($city['trade'] == 0) {
|
||||
<td width=78 align=center class=bg1>병 사</td>
|
||||
<td width=48 align=center class=bg1>훈련</td>
|
||||
<td width=48 align=center class=bg1>사기</td>
|
||||
<td width=310 align=center class=bg1>명 령</td>
|
||||
<td width=280 align=center class=bg1>명 령</td>
|
||||
</tr></thead><tbody class='bg0' id='general_list'>
|
||||
|
||||
<?php
|
||||
@@ -365,7 +365,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+13
-20
@@ -8,14 +8,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("내무부", 1);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -24,7 +21,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -49,19 +46,19 @@ if ($me['level'] >= 5) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>내 무 부<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
|
||||
<tr>
|
||||
<td width=100 align=center class=bg1>국 가 명</td>
|
||||
<td width=130 align=center class=bg1>국 가 명</td>
|
||||
<td width=50 align=center class=bg1>국력</td>
|
||||
<td width=40 align=center class=bg1>장수</td>
|
||||
<td width=40 align=center class=bg1>속령</td>
|
||||
@@ -71,9 +68,7 @@ if ($me['level'] >= 5) {
|
||||
<td align=center class=bg1>비 고</td>
|
||||
</tr>
|
||||
<?php
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation,name,color,power,gennum from nation order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -190,9 +185,7 @@ $query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,scoutm
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['gold_rate','rice_rate']);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
|
||||
@@ -220,18 +213,18 @@ if ($budgetricediff > 0) {
|
||||
}
|
||||
|
||||
?>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form name=form1 method=post action=c_dipcenter.php>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</td></tr>
|
||||
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=1000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
||||
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
|
||||
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||
<tr><td colspan=2>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table width=998 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td colspan=2 align=center class=bg1>자금 예산</td>
|
||||
<td colspan=2 align=center class=bg1>병량 예산</td>
|
||||
@@ -304,7 +297,7 @@ if ($nation['war'] == 0) {
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+26
-47
@@ -8,14 +8,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("중원정보", 1);
|
||||
|
||||
$query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -42,9 +39,9 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
$nationname[$nation['nation']] = $nation['name'];
|
||||
|
||||
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
|
||||
$powerStr .= "국력 {$nation['power']}<br>";
|
||||
$genStr .= "장수 {$nation['gennum']}<br>";
|
||||
$cityStr .= "속령 $citycount<br>";
|
||||
$powerStr .= "{$nation['power']}<br>";
|
||||
$genStr .= "{$nation['gennum']}<br>";
|
||||
$cityStr .= "$citycount<br>";
|
||||
}
|
||||
|
||||
$realConflict = [];
|
||||
@@ -79,11 +76,11 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/base_map.js"></script>
|
||||
<script src="js/map.js"></script>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -94,24 +91,24 @@ $(function(){
|
||||
|
||||
});
|
||||
</script>
|
||||
<link href="css/normalize.css" rel="stylesheet">
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link href="css/common.css" rel="stylesheet">
|
||||
<link href="css/map.css" rel="stylesheet">
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>중 원 정 보<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=<?=$nationcount+1?> align=center bgcolor=blue>외 교 현 황</td></tr>
|
||||
<?php
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center width=108 style=background-color:".GameConst::$basecolor2.";> </td>";
|
||||
<td align=center width=130 style=background-color:".GameConst::$basecolor2.";> </td>";
|
||||
|
||||
if($nationcount != 0) {
|
||||
$width = intdiv(888, $nationcount);
|
||||
@@ -179,35 +176,17 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<?php if ($realConflict) : ?>
|
||||
|
||||
<br>
|
||||
<table
|
||||
align='center'
|
||||
width=1000
|
||||
border=1
|
||||
cellspacing=0
|
||||
cellpadding=0
|
||||
bordercolordark='gray'
|
||||
bordercolorlight='black'
|
||||
style='font-size:13px;word-break:break-all;'
|
||||
class='bg0'
|
||||
>
|
||||
<table align='center' width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=2 align=center bgcolor=magenta>분 쟁 현 황</td></tr>
|
||||
<?php foreach($realConflict as list($cityID, $cityName, $conflict)): ?>
|
||||
<tr>
|
||||
<td align=center width=48><?=$cityName?></td>
|
||||
<td width=948>
|
||||
<table
|
||||
border=0
|
||||
cellspacing=0
|
||||
cellpadding=0
|
||||
bordercolordark='gray'
|
||||
bordercolorlight='black'
|
||||
style='font-size:13px;word-break:break-all;width:100%;'
|
||||
class='bg0'
|
||||
>
|
||||
<td style='width:948px;position:relative;'>
|
||||
<table class='tb_layout bg0' style='width:100%;'>
|
||||
<?php foreach($conflict as $item): ?>
|
||||
<tr>
|
||||
<td
|
||||
width=98
|
||||
width=130
|
||||
align=right
|
||||
style='color:<?=newColor($item['color'])?>;background-color:<?=$item['color']?>;'
|
||||
><?=$item['name']?> </td>
|
||||
@@ -228,7 +207,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<?php endif; ?>
|
||||
|
||||
<br>
|
||||
<table class="bg0" align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style="font-size:13px;word-break:break-all;">
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td colspan=5 align=center bgcolor=green><font size=3>중 원 지 도</font></td>
|
||||
</tr>
|
||||
@@ -236,15 +215,15 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<td width=698 height=420>
|
||||
<?=getMapHtml()?>
|
||||
</td>
|
||||
<td width=101 valign=top><?=$nationStr?></td>
|
||||
<td width=78 valign=top><?=$powerStr?></td>
|
||||
<td width=58 valign=top><?=$genStr?></td>
|
||||
<td width=55 valign=top><?=$cityStr?></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>
|
||||
<td width=43 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>장수</div><?=$genStr?></td>
|
||||
<td width=40 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>속령</div><?=$cityStr?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<table class="bg0" align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style="font-size:13px;word-break:break-all;">
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+7
-10
@@ -16,14 +16,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("암행부", 2);
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -32,7 +29,7 @@ $query = "select level,secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -55,13 +52,13 @@ $sel[$type] = "selected";
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 암행부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>암 행 부<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
@@ -101,7 +98,7 @@ $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect)
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>이 름</td>
|
||||
<td width=98 align=center id=bg1>통무지</td>
|
||||
@@ -206,7 +203,7 @@ echo "
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+18
-18
@@ -31,8 +31,8 @@ if($meLevel == 0) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
function out() {
|
||||
return confirm('정말 추방하시겠습니까?');
|
||||
@@ -42,7 +42,7 @@ function out() {
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>인 사 부<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@@ -72,7 +72,7 @@ $query = "select name,picture,firenum from general where nation='{$nation['natio
|
||||
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']} colspan=6>
|
||||
<font size=5>【 {$nation['name']} 】</font>
|
||||
@@ -131,7 +131,7 @@ echo "
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<form method=post action=c_myBossInfo.php>
|
||||
<tr><td colspan=6 height=5></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=red>추 방</td></tr>
|
||||
@@ -144,14 +144,14 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
|
||||
echo "
|
||||
<select name=outlist size=1 style=color:white;background-color:black;>";
|
||||
|
||||
$query = "select no,name,level from general where nation='{$me['nation']}' and level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
||||
$query = "select no,name,level,leader,power,intel,killturn from general where nation='{$me['nation']}' and level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
||||
$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);
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']}</option>";
|
||||
<option value={$general['no']}>{$general['name']} <small>({$general['leader']}/{$general['power']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||
}
|
||||
|
||||
echo "
|
||||
@@ -167,7 +167,7 @@ echo "
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=4 height=5></td></tr>
|
||||
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
|
||||
<tr>
|
||||
@@ -217,12 +217,12 @@ echo "
|
||||
";
|
||||
|
||||
$queries = [];
|
||||
$queries[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)";
|
||||
$queries[9] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)";
|
||||
$queries[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)";
|
||||
$queries[7] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)";
|
||||
$queries[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)";
|
||||
$queries[5] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)";
|
||||
$queries[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[9] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[7] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[5] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
|
||||
for($i=10; $i >= $lv; $i--) {
|
||||
if($i % 2 == 0) { echo "<tr>"; }
|
||||
@@ -270,7 +270,7 @@ for($i=10; $i >= $lv; $i--) {
|
||||
echo "
|
||||
<tr><td colspan=4>※ <font color=red>빨간색</font>은 현재 임명중인 장수, <font color=orange>노란색</font>은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.</td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=5 height=5></td></tr>
|
||||
";
|
||||
if($meLevel >= 5) {
|
||||
@@ -309,7 +309,7 @@ if($meLevel >= 5) {
|
||||
<option value=0>____공석____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)";
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
@@ -363,7 +363,7 @@ if($meLevel >= 5) {
|
||||
<option value=0>____공석____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)";
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
@@ -505,7 +505,7 @@ for($j=0; $j < $citycount; $j++) {
|
||||
<tr><td colspan=5>※ <font color=orange>노란색</font>은 변경 불가능, 하얀색은 변경 가능 관직입니다.</td></tr>
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+17
-17
@@ -38,13 +38,13 @@ $sel = [$type => "selected"];
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>세 력 도 시<br><?=backButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
@@ -123,23 +123,23 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
}
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=12 style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=2>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=48 id=bg1>주민</td>
|
||||
<td align=center width=112>{$city['pop']}/{$city['pop2']}</td>
|
||||
<td align=center width=48 id=bg1>농업</td>
|
||||
<td align=center width=108>{$city['agri']}/{$city['agri2']}</td>
|
||||
<td align=center width=48 id=bg1>상업</td>
|
||||
<td align=center width=108>{$city['comm']}/{$city['comm2']}</td>
|
||||
<td align=center width=48 id=bg1>치안</td>
|
||||
<td align=center width=108>{$city['secu']}/{$city['secu2']}</td>
|
||||
<td align=center width=48 id=bg1>수비</td>
|
||||
<td align=center width=108>{$city['def']}/{$city['def2']}</td>
|
||||
<td align=center width=48 id=bg1>성벽</td>
|
||||
<td align=center width=108>{$city['wall']}/{$city['wall2']}</td>
|
||||
<td align=center width=46 id=bg1>주민</td>
|
||||
<td align=center width=140>{$city['pop']}/{$city['pop2']}</td>
|
||||
<td align=center width=46 id=bg1>농업</td>
|
||||
<td align=center width=140>{$city['agri']}/{$city['agri2']}</td>
|
||||
<td align=center width=46 id=bg1>상업</td>
|
||||
<td align=center width=140>{$city['comm']}/{$city['comm2']}</td>
|
||||
<td align=center width=46 id=bg1>치안</td>
|
||||
<td align=center width=140>{$city['secu']}/{$city['secu2']}</td>
|
||||
<td align=center width=46 id=bg1>수비</td>
|
||||
<td align=center width=140>{$city['def']}/{$city['def2']}</td>
|
||||
<td align=center width=46 id=bg1>성벽</td>
|
||||
<td align=center width=140>{$city['wall']}/{$city['wall2']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>민심</td>
|
||||
@@ -188,7 +188,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+5
-5
@@ -38,13 +38,13 @@ $sel = [$type => "selected"];
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 세력장수</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>세 력 장 수<br><?=backButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
@@ -114,7 +114,7 @@ $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect)
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
echo"
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=64 align=center id=bg1>얼 굴</td>
|
||||
<td width=98 align=center id=bg1>이 름</td>
|
||||
@@ -191,7 +191,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -8,6 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력정보", 1);
|
||||
@@ -27,13 +28,13 @@ if($me['level'] == 0) {
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>세 력 정 보<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@@ -65,9 +66,7 @@ $query = "select sum(crew) as totcrew,sum(leader)*100 as maxcrew from general wh
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['gold_rate','rice_rate']);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
|
||||
@@ -89,7 +88,7 @@ if($budgetricediff > 0) { $budgetricediff = "+{$budgetricediff}"; }
|
||||
else { $budgetricediff = "$budgetricediff"; }
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=8 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 ";echo $me['nation']==0?"공 백 지":"{$nation['name']}";echo " 】</td>
|
||||
</tr>
|
||||
@@ -156,7 +155,7 @@ echo"
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
+39
-26
@@ -7,6 +7,8 @@ include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$mode = Util::getReq('mode', 'int', 2);
|
||||
$tnmt = Util::getReq('tnmt', 'int', 1);
|
||||
//$detachNPC = Util::getReq('detachNPC', 'bool');
|
||||
$detachNPC = false;
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -23,37 +25,53 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("내정보", 1);
|
||||
|
||||
$query = "select myset from general where owner='{$userID}'";
|
||||
$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
if ($me['myset'] > 0) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
if ($btn == "설정저장" && $me['myset'] > 0) {
|
||||
if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
if ($me['myset'] > 1) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
$me['myset'] -= 1;
|
||||
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'mode'=>$mode,
|
||||
'tnmt'=>$tnmt
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$query = "select no,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
if($me['npc'] == 1 && $detachNPC){
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
if($turnterm < 10){
|
||||
$targetKillTurn = 30 / $turnterm;
|
||||
}
|
||||
else{
|
||||
$targetKillTurn = 60 / $turnterm;
|
||||
}
|
||||
$db->update('general', [
|
||||
'killturn'=>$targetKillTurn
|
||||
], 'owner=%i AND npc=1', $userID);
|
||||
|
||||
$me['killturn']=$targetKillTurn;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -61,45 +79,40 @@ $me = MYDB_fetch_array($result);
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link rel=stylesheet href="css/common.css">
|
||||
<script type="text/javascript">
|
||||
function go(type) {
|
||||
if(type == 0){
|
||||
location.replace('c_vacation.php');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>내 정 보<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=50%>
|
||||
<?php myInfo(); ?>
|
||||
<?php myInfo2(); ?>
|
||||
</td>
|
||||
<td width=50% valign=top>
|
||||
<td width=50% valign=top style="padding-left:4ch;">
|
||||
<form name=form1 action=b_myPage.php method=post>
|
||||
토너먼트 【
|
||||
토너먼트 【
|
||||
<input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
|
||||
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
|
||||
】<br>
|
||||
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
|
||||
수비 【
|
||||
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
|
||||
수비 【
|
||||
<input type=radio name=mode value=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
|
||||
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
|
||||
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
|
||||
】<br><br>
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
</form>
|
||||
휴 가 신 청<br>
|
||||
<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=휴가신청 onclick='go(0)'>
|
||||
휴 가 신 청<br>
|
||||
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
|
||||
<!--빙의 해제용 삭턴 조절<br>
|
||||
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -127,7 +140,7 @@ function go(type) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -22,13 +22,14 @@ $me = MYDB_fetch_array($result);
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<div style='width:1000px;margin:auto'>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td>회 의 실<br><?=backButton()?></td></tr>
|
||||
<form name=form1 method=post action=c_nationboard.php>
|
||||
<tr><td align=center>
|
||||
@@ -60,10 +61,11 @@ for($i=0; $i < 20; $i++) {
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ increaseRefresh("국법", 1);
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>국 법<br><?=backButton()?></td></tr>
|
||||
<tr><td>
|
||||
|
||||
|
||||
+16
-24
@@ -8,6 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("토너먼트", 1);
|
||||
@@ -17,11 +18,9 @@ $query = "select no,tournament,con,turntime from general where owner='{$userID}'
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select conlimit,tournament,phase,tnmt_msg,tnmt_type,develcost,tnmt_trig from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_msg','tnmt_type','develcost','tnmt_trig']);
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
@@ -44,24 +43,15 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
|
||||
<style>
|
||||
body { color:white; background-color:black; border-width:1px; border-color:gray; }
|
||||
table { font-family:'맑은 고딕'; }
|
||||
font { font-family:'맑은 고딕'; }
|
||||
input { font-family:'맑은 고딕'; height:20px }
|
||||
select { font-family:'굴림'; line-height:100%; }
|
||||
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
|
||||
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
|
||||
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
|
||||
</style>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=2000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=2000 class='tb_layout bg0'>
|
||||
<tr><td>삼모전 토너먼트<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<?php
|
||||
if ($session->userGrade >= 5) {
|
||||
$sel = [];
|
||||
@@ -193,7 +183,7 @@ if($str3){
|
||||
echo "
|
||||
<tr>
|
||||
<td colspan=8>
|
||||
<table align=center width=2000 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=2000 class='bg0 mimic_flex'>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
|
||||
@@ -403,9 +393,11 @@ for ($i=0; $i < 16; $i++) {
|
||||
echo"
|
||||
</tr>";
|
||||
|
||||
$query = "select tournament,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$betting = MYDB_fetch_array($result);
|
||||
$betting = $gameStor->getValues(['tournament','bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$betting['bet'] = 0;
|
||||
for($i=0;$i<16;$i+=1){
|
||||
$betting['bet'] += $betting['bet'.$i];
|
||||
}
|
||||
$bet = [];
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
if($betting['bet'] == 0){
|
||||
@@ -444,7 +436,7 @@ for ($i=0; $i < 8; $i++) {
|
||||
$grp = $i + 10;
|
||||
echo "
|
||||
<td>
|
||||
<table align=center width=250 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=250 class='tb_layout bg0'>
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
@@ -470,7 +462,7 @@ for ($i=0; $i < 8; $i++) {
|
||||
$grp = $i;
|
||||
echo "
|
||||
<td>
|
||||
<table align=center width=250 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=250 class='tb_layout bg0'>
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
@@ -506,7 +498,7 @@ if ($admin['tournament'] == 2 || $admin['tournament'] == 3) {
|
||||
</font>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table align=center width=2000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=2000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+18
-17
@@ -26,23 +26,23 @@ $troopcount = MYDB_num_rows($result);
|
||||
<head>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<div style="width:1000px;margin:auto;">
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=c_troop.php>
|
||||
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td align=center width=64 id=bg1>선 택</td>
|
||||
<td align=center width=98 id=bg1>부 대 정 보</td>
|
||||
<td align=center width=64 id=bg1>부 대 장</td>
|
||||
<td align=center width=662 id=bg1 style=table-layout:fixed;word-break:break-all;>장 수</td>
|
||||
<td align=center width=98 id=bg1 style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
||||
<td width=64 class='bg1 center'>선 택</td>
|
||||
<td width=130 class='bg1 center'>부 대 정 보</td>
|
||||
<td width=100 class='bg1 center'>부 대 장</td>
|
||||
<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>
|
||||
<?php
|
||||
for($i=0; $i < $troopcount; $i++) {
|
||||
@@ -83,7 +83,7 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
<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=662>$genlist</td>
|
||||
<td rowspan=2 width=62>$genlist</td>
|
||||
<td rowspan=2>$turn</td>
|
||||
</tr>
|
||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
||||
@@ -94,7 +94,7 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
<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=662>$genlist</td>
|
||||
<td rowspan=2 width=576>$genlist</td>
|
||||
<td rowspan=2>";
|
||||
|
||||
if($troop['no'] == $me['no']) {
|
||||
@@ -102,7 +102,7 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($genresult);
|
||||
echo "
|
||||
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:98px;>";
|
||||
<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 "
|
||||
@@ -110,7 +110,7 @@ for($i=0; $i < $troopcount; $i++) {
|
||||
}
|
||||
echo "
|
||||
</select><br>
|
||||
<input type=submit name=btn value='부 대 추 방' style=width:100px;height:25px;>";
|
||||
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>";
|
||||
} else {
|
||||
echo $turn;
|
||||
}
|
||||
@@ -139,10 +139,10 @@ echo "
|
||||
<br>";
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 id=bg1>부 대 명</td>
|
||||
<td width=100><input type=text style=color:white;background-color:black; size=12 maxlength=6 name=name></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>";
|
||||
@@ -155,11 +155,12 @@ echo "
|
||||
</table>";
|
||||
|
||||
?>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+3
-4
@@ -34,13 +34,12 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("입찰", 1);
|
||||
|
||||
$query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
$query = "select no,name,gold,rice,special from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -56,7 +55,7 @@ $bidCount = MYDB_num_rows($result);
|
||||
|
||||
$btCount = $tradeCount + $bidCount;
|
||||
|
||||
$unit = $admin['turnterm'] * 60;
|
||||
$unit = $turnterm * 60;
|
||||
|
||||
$amount = Util::round($amount / 10) * 10;
|
||||
$cost = Util::round($cost / 10) * 10;
|
||||
|
||||
+4
-4
@@ -38,10 +38,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("베팅", 1);
|
||||
|
||||
$tournament = $db->queryFirstField('SELECT tournament FROM game LIMIT 1');
|
||||
$tournament = $gameStor->tournament;
|
||||
if($tournament != 6) {
|
||||
header('Location: b_betting.php');
|
||||
exit();
|
||||
@@ -59,9 +60,8 @@ if($betGold + 500 <= $myGold && $betGold + $oldBet <= 1000 && $betGold + $totalB
|
||||
"bet{$betTarget}"=>$db->sqleval("bet{$betTarget} + %i", $betGold),
|
||||
'betgold'=>$db->sqleval('betgold + %i', $betGold)
|
||||
], 'owner = %i', $userID);
|
||||
$db->update('game', [
|
||||
"bet{$betTarget}"=>$db->sqleval("bet{$betTarget} + %i", $betGold)
|
||||
], true);
|
||||
|
||||
$gameStor->setValue("bet{$betTarget}", $gameStor->getValue("bet{$betTarget}") + $betGold);//TODO: +로 증가하는 storage값은 별도로 분리
|
||||
}
|
||||
|
||||
header('location: b_betting.php');
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ if($command == 46) {
|
||||
$name = str_replace(" ", "", $name);
|
||||
$name = str_replace(" ", "뷁", $name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
$name = StringUtil::subStringForWidth($name, 0, 12);
|
||||
$name = StringUtil::subStringForWidth($name, 0, 18);
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$name
|
||||
@@ -77,7 +77,7 @@ if($command == 53) {
|
||||
$nationname = str_replace(" ", "", $nationname);
|
||||
$nationname = str_replace(" ", "뷁", $nationname);
|
||||
if($nationname == "") { $nationname = "무명"; }
|
||||
$nationname = StringUtil::subStringForWidth($nationname, 0, 12);
|
||||
$nationname = StringUtil::subStringForWidth($nationname, 0, 18);
|
||||
|
||||
$query = "update general set makenation='{$nationname}' where level>=5 and nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+35
-30
@@ -18,11 +18,10 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','scenario']);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -39,19 +38,20 @@ if($meLevel < 5){
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if($btn == "임명") {
|
||||
if($genlist !== 0){
|
||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
if(!$genlist){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
|
||||
@@ -60,6 +60,10 @@ if($btn == "임명") {
|
||||
exit();
|
||||
}
|
||||
} elseif($btn == "추방") {
|
||||
if(!$outlist){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr from general where no='$outlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -112,21 +116,24 @@ if($btn == "추방") {
|
||||
}
|
||||
|
||||
if($dipcount1 > 0) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:통합에 반대하던 <Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:통합에 반대하던 <Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
$log[] = "<C>●</>통합에 반대하다가 <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
|
||||
// 재야로, 국가 무소속으로
|
||||
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($dipcount2 > 0) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:합병에 반대하던 <Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:합병에 반대하던 <Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
$log[] = "<C>●</>합병에 반대하다가 <D><b>{$nation['name']}</b></>에서 <R>숙청</>당했습니다.";
|
||||
|
||||
// 재야로, 국가 무소속으로
|
||||
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
||||
$log[] = "<C>●</><D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
||||
|
||||
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
|
||||
@@ -193,7 +200,7 @@ if($btn == "추방") {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$nation['chemi'] -= 1;
|
||||
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
|
||||
@@ -211,13 +218,11 @@ if($btn == "추방") {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D>{$nation['name']}</>에서 추방됨");
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year','month']);
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:<D>{$nation['name']}</>에서 추방됨");
|
||||
|
||||
pushGenLog($general, $log);
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGeneralPublicRecord($alllog, $year, $month);
|
||||
}
|
||||
header('location:b_myBossInfo.php');
|
||||
die();
|
||||
@@ -245,12 +250,12 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
|
||||
if($genlist != 0) {
|
||||
$valid = 0;
|
||||
switch($level) {
|
||||
case 10: if($general['power'] >= GameConst::$goodgenpower) { $valid = 1; } break;
|
||||
case 9: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
||||
case 8: if($general['power'] >= GameConst::$goodgenpower) { $valid = 1; } break;
|
||||
case 7: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
||||
case 6: if($general['power'] >= GameConst::$goodgenpower) { $valid = 1; } break;
|
||||
case 5: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
||||
case 10: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 9: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 8: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 7: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 6: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 5: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
default: $valid = 1; break;
|
||||
}
|
||||
if($valid == 1) {
|
||||
@@ -302,8 +307,8 @@ if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
|
||||
if($genlist != 0) {
|
||||
$valid = 0;
|
||||
switch($level) {
|
||||
case 4: if($general['power'] >= GameConst::$goodgenpower) { $valid = 1; } break;
|
||||
case 3: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
||||
case 4: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 3: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
default: $valid = 1; break;
|
||||
}
|
||||
|
||||
|
||||
+17
-21
@@ -21,11 +21,10 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,phase,tnmt_type,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_type','develcost']);
|
||||
|
||||
$query = "select no,name,tournament from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -80,8 +79,8 @@ if($btn == '참가') {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
if($grpCount >= 8) {
|
||||
$query = "update game set tournament=2, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = 2;
|
||||
$gameStor->phase = 0;
|
||||
}
|
||||
header('location:b_tournament.php');
|
||||
die();
|
||||
@@ -93,15 +92,13 @@ if($session->userGrade < 5) {
|
||||
}
|
||||
|
||||
if($btn == "자동개최설정") {
|
||||
$db->update('game', ['tnmt_trig'=>$trig], true);
|
||||
$gameStor->tnmt_trig = $trig;
|
||||
} elseif($btn == "개최") {
|
||||
startTournament($auto, $type);
|
||||
} elseif($btn == "중단") {
|
||||
$db->update('game', [
|
||||
'tnmt_auto'=>0,
|
||||
'tournament'=>0,
|
||||
'phase'=>0
|
||||
], true);
|
||||
$gameStor->tnmt_auto = 0;
|
||||
$gameStor->tournament = 0;
|
||||
$gameStor->phase = 0;
|
||||
} elseif($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") {
|
||||
if($btn == "투입") {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
|
||||
@@ -164,7 +161,7 @@ if($btn == "자동개최설정") {
|
||||
}
|
||||
$map = [];
|
||||
for($i=0; $i < 8; $i++) {
|
||||
if($occupied[$i] == 0) {
|
||||
if(!isset($occupied[$i]) || $occupied[$i] == 0) {
|
||||
$map[] = $i;
|
||||
}
|
||||
}
|
||||
@@ -184,8 +181,8 @@ if($btn == "자동개최설정") {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
if($grpCount >= 8) {
|
||||
$query = "update game set tournament=2, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament=2;
|
||||
$gameStor->phase=0;
|
||||
}
|
||||
|
||||
} elseif($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") {
|
||||
@@ -241,8 +238,8 @@ if($btn == "자동개최설정") {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
$query = "update game set tournament=2, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = 2;
|
||||
$gameStor->phase = 0;
|
||||
} elseif($btn == "무명전부투입") {
|
||||
fillLowGenAll();
|
||||
} elseif($btn == "예선") {
|
||||
@@ -261,8 +258,9 @@ if($btn == "자동개최설정") {
|
||||
final16set();
|
||||
} elseif($btn == "베팅마감") {
|
||||
$dt = date("Y-m-d H:i:s", time() + 60);
|
||||
$query = "update game set tournament='7',phase='0',tnmt_time='$dt'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament=7;
|
||||
$gameStor->phase=0;
|
||||
$gameStor->tnmt_time = $dt;
|
||||
} elseif($btn == "16강") {
|
||||
finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
|
||||
} elseif($btn == "8강") {
|
||||
@@ -276,9 +274,7 @@ if($btn == "자동개최설정") {
|
||||
} elseif($btn == "회수") {
|
||||
setRefund();
|
||||
} elseif($btn == "메시지") {
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$query = "update game set tnmt_msg='$msg'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tnmt_msg = $msg;
|
||||
}
|
||||
|
||||
header('location:b_tournament.php');
|
||||
+3
-8
@@ -8,16 +8,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$query = "select killturn from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$killturn = $gameStor->killturn;
|
||||
|
||||
$admin['killturn'] *= 3;
|
||||
|
||||
$query = "update general set killturn='{$admin['killturn']}' where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', ['killturn'=>$killturn*3], 'owner=%i', $userID);
|
||||
|
||||
|
||||
header('location:b_myPage.php');
|
||||
|
||||
+25
-33
@@ -16,12 +16,14 @@ extractMissingPostToGlobals();
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()]??[]);
|
||||
$isVoteAdmin |= $session->userGrade >= 5;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select develcost,vote,votecomment from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['develcost', 'cost', 'vote_title', 'vote', 'votecomment']);
|
||||
|
||||
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -36,25 +38,19 @@ if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
|
||||
$log = uniqueItem($me, $log, 1);
|
||||
pushGenLog($me, $log);
|
||||
}
|
||||
else if($btn == "댓글" && $comment != "") {
|
||||
$comment = str_replace("|", " ", $comment);
|
||||
$comment = str_replace(":", " ", $comment);
|
||||
else if($btn == "댓글" && trim($comment) != "") {
|
||||
$comment = trim($comment);
|
||||
$comment = addslashes(SQ2DQ($comment));
|
||||
|
||||
$nation = getNationStaticInfo($me['nation']);
|
||||
|
||||
if($admin['votecomment'] != "") { $admin['votecomment'] .= "|"; }
|
||||
$admin['votecomment'] .= "{$nation['name']}:{$me['name']}:{$comment}";
|
||||
|
||||
$query = "update game set votecomment='{$admin['votecomment']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
|
||||
|
||||
if(!$admin['votecomment']){
|
||||
$admin['votecomment'] = [];
|
||||
}
|
||||
$admin['votecomment'][] = [$nation['name'],$me['name'],$comment];
|
||||
$gameStor->votecomment = $admin['votecomment'];
|
||||
}
|
||||
|
||||
if($session->userGrade < 5){
|
||||
if(!$isVoteAdmin){
|
||||
header('location:a_vote.php');
|
||||
die();
|
||||
}
|
||||
@@ -62,22 +58,21 @@ if($session->userGrade < 5){
|
||||
|
||||
if($btn == "수정") {
|
||||
if($title != "") {
|
||||
$vote = explode("|", $admin['vote']);
|
||||
$vote[0] = addslashes(SQ2DQ($title));
|
||||
$admin['vote'] = implode("|", $vote);
|
||||
$query = "update game set vote='{$admin['vote']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->vote_title = $title;
|
||||
}
|
||||
} elseif($btn == "추가") {
|
||||
if($str != "") {
|
||||
$str = addslashes(SQ2DQ($str));
|
||||
$admin['vote'] .= "|{$str}";
|
||||
$query = "update game set vote='{$admin['vote']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if(!$admin['vote']){
|
||||
$admin['vote'] = [];
|
||||
}
|
||||
$admin['vote'][] = $str;
|
||||
$gameStor->vote=$admin['vote'];
|
||||
}
|
||||
} elseif($btn == "리셋") {
|
||||
$query = "update game set voteopen=1,vote='',votecomment=''";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->voteopen=1;
|
||||
$gameStor->vote=['-'];
|
||||
$gameStor->vote_title = '-';
|
||||
$gameStor->votecomment=[];
|
||||
|
||||
$query = "update general set vote='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -85,14 +80,11 @@ if($btn == "수정") {
|
||||
$query = "update general set newvote='1' where vote=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($btn == "숨김") {
|
||||
$query = "update game set voteopen=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->voteopen = 0;
|
||||
} elseif($btn == "전체통계만") {
|
||||
$query = "update game set voteopen=1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->voteopen = 1;
|
||||
} elseif($btn == "전부") {
|
||||
$query = "update game set voteopen=2";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->voteopen = 2;
|
||||
}
|
||||
|
||||
header('location:a_vote.php');
|
||||
+12
-17
@@ -4,10 +4,9 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$session = Session::getInstance()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -15,11 +14,11 @@ $connect=$db->get();
|
||||
<head>
|
||||
<title>커맨드리스트</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if(!$session->isLoggedIn()){
|
||||
if(!$session->isGameLoggedIn()){
|
||||
echo 'window.parent.location.href = "../";';
|
||||
}
|
||||
?>
|
||||
@@ -67,26 +66,22 @@ myCommandList();
|
||||
|
||||
function myCommandList() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// 명령 목록
|
||||
$query = "select year,month,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','turnterm']);
|
||||
|
||||
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow("SELECT `no`,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 FROM general WHERE `owner`=%s", $userID);
|
||||
if(!$me){
|
||||
echo "로그인 되어있지 않습니다.";
|
||||
return;
|
||||
}
|
||||
$turn = getTurn($me, 2);
|
||||
|
||||
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
echo "<table width=300 height=700 class='tb_layout bg2'>
|
||||
<form name=clock>
|
||||
<tr>
|
||||
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
|
||||
@@ -109,10 +104,10 @@ function myCommandList() {
|
||||
$turndate = substr($totaldate,11, 5);
|
||||
echo "
|
||||
<tr height=28>
|
||||
<td width=30 align=center height=24 id=bg0><b>$j</b></td>
|
||||
<td width=75 align=center height=24 id=bg1><b>{$year}年 {$month}月</b></td>
|
||||
<td width=45 align=center bgcolor=black><b>$turndate</b></td>
|
||||
<td width=137 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
|
||||
<td width=24 align=center height=24 id=bg0><b>$j</b></td>
|
||||
<td width=71 align=center height=24 id=bg1><b>{$year}年 {$month}月</b></td>
|
||||
<td width=42 align=center bgcolor=black><b>$turndate</b></td>
|
||||
<td width=150 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
|
||||
</tr>";
|
||||
$month++;
|
||||
$totaldate = addTurn($totaldate, $admin['turnterm']);
|
||||
|
||||
+56
-1
@@ -3,13 +3,67 @@
|
||||
html, body{
|
||||
background-color:black;
|
||||
color:white;
|
||||
line-height:1.3;
|
||||
}
|
||||
|
||||
table { font-family:'맑은 고딕'; }
|
||||
font { font-family:'맑은 고딕'; }
|
||||
input { font-family:'맑은 고딕'; height:20px }
|
||||
input { font-family:'맑은 고딕'; font-size:13px; }
|
||||
select { font-family:'굴림'; line-height:100%; }
|
||||
|
||||
.center{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
table.mimic_flex{
|
||||
border-collapse: collapse;
|
||||
border:none;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.mimic_flex td, .mimic_flex th {
|
||||
border:none !important;
|
||||
padding: 0px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
|
||||
table.tb_layout {
|
||||
border-collapse: collapse;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.tb_layout td, .tb_layout th {
|
||||
border:solid 1px gray;
|
||||
padding: 0px;
|
||||
word-break: break-all;
|
||||
font-family: '맑은 고딕';;
|
||||
}
|
||||
|
||||
div.bar_out{
|
||||
position:relative;
|
||||
border-top:solid 1px #888888;
|
||||
border-bottom:solid 1px #333333;
|
||||
padding:0;
|
||||
margin:0;
|
||||
width:100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.bar_out div{
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
div.bar_out div.bar_in{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
.ev_warning{
|
||||
@@ -76,6 +130,7 @@ select { font-family:'굴림'; line-height:100%; }
|
||||
|
||||
.small_war_log .crew_plate{
|
||||
color:orangered;
|
||||
font-size:90%;
|
||||
}
|
||||
|
||||
.t_date{
|
||||
|
||||
@@ -63,4 +63,8 @@ color:white;
|
||||
font-size:13px;
|
||||
margin:0;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.nation_info td{
|
||||
height:18px;
|
||||
}
|
||||
+19
-8
@@ -22,9 +22,9 @@
|
||||
|
||||
.msg_plate{
|
||||
width:100%;
|
||||
border-bottom:groove 0.1em;
|
||||
border-left:groove 0.1em;
|
||||
border-right:groove 0.1em;
|
||||
border-bottom:solid 1px gray;
|
||||
border-left:solid 1px gray;
|
||||
border-right:solid 1px gray;
|
||||
height:64px;
|
||||
font-size:12px;
|
||||
word-break:break-all;
|
||||
@@ -35,6 +35,10 @@
|
||||
background-color:#5d1e1a;
|
||||
}
|
||||
|
||||
.msg_plate_private.msg_plate_dest{
|
||||
background-color:#5d461a;
|
||||
}
|
||||
|
||||
.msg_plate_public{
|
||||
background-color:#141c65;
|
||||
|
||||
@@ -42,7 +46,14 @@
|
||||
|
||||
.msg_plate_national, .msg_plate_diplomacy{
|
||||
background-color:#00582c;
|
||||
}
|
||||
|
||||
.msg_plate_national.msg_plate_dest, .msg_plate_diplomacy.msg_plate_dest {
|
||||
background-color:#704615;
|
||||
}
|
||||
|
||||
.msg_plate_national.msg_plate_src, .msg_plate_diplomacy.msg_plate_src {
|
||||
background-color:#70153b;
|
||||
}
|
||||
|
||||
.public_message{
|
||||
@@ -61,7 +72,7 @@
|
||||
float:left;
|
||||
width:64px;
|
||||
height:64px;
|
||||
border-right:groove 0.1em;
|
||||
border-right:solid 1px gray;
|
||||
}
|
||||
|
||||
.msg_time{
|
||||
@@ -105,7 +116,7 @@
|
||||
|
||||
.board_header{
|
||||
color:white;
|
||||
border:groove 0.1em;
|
||||
border:solid 1px gray;
|
||||
}
|
||||
|
||||
.board_side{
|
||||
@@ -113,9 +124,9 @@
|
||||
height:1370px;
|
||||
width:498px;
|
||||
overflow-y: hidden;
|
||||
border-left:groove 1px;
|
||||
border-right:groove 1px;
|
||||
border-bottom:groove 1px;
|
||||
border-left:solid 1px;
|
||||
border-right:solid 1px;
|
||||
border-bottom:solid 1px;
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
.container{
|
||||
width:1000px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.card_holder{
|
||||
text-align:center;
|
||||
}
|
||||
.general_card{
|
||||
width:125px;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.general_card h4 {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.general_card p {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
|
||||
.general_card .select_btn {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.general_card label {
|
||||
display: block;
|
||||
padding-left: 15px;
|
||||
text-indent: -15px;
|
||||
}
|
||||
|
||||
.general_card input {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
padding: 0;
|
||||
margin:0;
|
||||
vertical-align: bottom;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
*overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
#outdate_token{
|
||||
color:red;
|
||||
display:none;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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_;
|
||||
}
|
||||
+419
-420
@@ -89,20 +89,19 @@ function GetImageURL($imgsvr, $filepath='') {
|
||||
* @param null|int $con 장수의 벌점
|
||||
* @param null|int $conlimit 최대 벌점
|
||||
*/
|
||||
function checkLimit($con = null, $conlimit = null) {
|
||||
function checkLimit($con = null) {
|
||||
$session = Session::getInstance();
|
||||
if($session->userGrade>=4){
|
||||
return 0;
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if($con === null){
|
||||
$con = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', Session::getUserID());
|
||||
}
|
||||
if($conlimit === null){
|
||||
$conlimit = $db->queryFirstField('SELECT conlimit FROM game LIMIT 1');
|
||||
}
|
||||
$conlimit = $gameStor->conlimit;
|
||||
|
||||
if($con > $conlimit) {
|
||||
return 2;
|
||||
@@ -173,9 +172,9 @@ function cityInfo() {
|
||||
}
|
||||
|
||||
if($nation['color'] == "" ) { $nation['color'] = "#000000"; }
|
||||
echo "<table width=640 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<tr><td colspan=8 align=center style=height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}</td></tr>
|
||||
<tr><td colspan=8 align=center style=height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']}><b>";
|
||||
echo "<table style='width:100%;' class='tb_layout bg2'>
|
||||
<tr><td colspan=8 style=text-align:center;height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}</td></tr>
|
||||
<tr><td colspan=8 style=text-align:center;height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']}><b>";
|
||||
|
||||
if($city['nation'] == 0) {
|
||||
echo "공 백 지";
|
||||
@@ -211,46 +210,46 @@ function cityInfo() {
|
||||
</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=2 align=center id=bg1><b>주민</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>주민</b></td>
|
||||
<td height=7 colspan=3>".bar($pop)."</td>
|
||||
<td rowspan=2 align=center id=bg1><b>민심</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>민심</b></td>
|
||||
<td height=7>".bar($rate)."</td>
|
||||
<td rowspan=2 align=center id=bg1><b>태수</b></td>
|
||||
<td rowspan=2 align=center>{$gen1['name']}</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>태수</b></td>
|
||||
<td rowspan=2 style='text-align:center;'>{$gen1['name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=3 align=center>{$city['pop']}/{$city['pop2']}</td>
|
||||
<td align=center>{$city['rate']}</td>
|
||||
<td colspan=3 style='text-align:center;'>{$city['pop']}/{$city['pop2']}</td>
|
||||
<td style='text-align:center;'>{$city['rate']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=50 rowspan=2 align=center id=bg1><b>농업</b></td>
|
||||
<td width=50 rowspan=2 style='text-align:center;' class='bg1'><b>농업</b></td>
|
||||
<td width=100 height=7>".bar($agri)."</td>
|
||||
<td width=50 rowspan=2 align=center id=bg1><b>상업</b></td>
|
||||
<td width=50 rowspan=2 style='text-align:center;' class='bg1'><b>상업</b></td>
|
||||
<td width=100 height=7>".bar($comm)."</td>
|
||||
<td width=50 rowspan=2 align=center id=bg1><b>치안</b></td>
|
||||
<td width=50 rowspan=2 style='text-align:center;' class='bg1'><b>치안</b></td>
|
||||
<td width=100 height=7>".bar($secu)."</td>
|
||||
<td width=50 rowspan=2 align=center id=bg1><b>군사</b></td>
|
||||
<td rowspan=2 align=center>{$gen2['name']}</td>
|
||||
<td width=50 rowspan=2 style='text-align:center;' class='bg1'><b>군사</b></td>
|
||||
<td rowspan=2 style='text-align:center;'>{$gen2['name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>{$city['agri']}/{$city['agri2']}</td>
|
||||
<td align=center>{$city['comm']}/{$city['comm2']}</td>
|
||||
<td align=center>{$city['secu']}/{$city['secu2']}</td>
|
||||
<td style='text-align:center;'>{$city['agri']}/{$city['agri2']}</td>
|
||||
<td style='text-align:center;'>{$city['comm']}/{$city['comm2']}</td>
|
||||
<td style='text-align:center;'>{$city['secu']}/{$city['secu2']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=2 align=center id=bg1><b>수비</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>수비</b></td>
|
||||
<td height=7>".bar($def)."</td>
|
||||
<td rowspan=2 align=center id=bg1><b>성벽</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>성벽</b></td>
|
||||
<td height=7>".bar($wall)."</td>
|
||||
<td rowspan=2 align=center id=bg1><b>시세</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시세</b></td>
|
||||
<td height=7>".bar($trade)."</td>
|
||||
<td rowspan=2 align=center id=bg1><b>시중</b></td>
|
||||
<td rowspan=2 align=center>{$gen3['name']}</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시중</b></td>
|
||||
<td rowspan=2 style='text-align:center;'>{$gen3['name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>{$city['def']}/{$city['def2']}</td>
|
||||
<td align=center>{$city['wall']}/{$city['wall2']}</td>
|
||||
<td align=center>{$tradeStr}</td>
|
||||
<td style='text-align:center;'>{$city['def']}/{$city['def2']}</td>
|
||||
<td style='text-align:center;'>{$city['wall']}/{$city['wall2']}</td>
|
||||
<td style='text-align:center;'>{$tradeStr}</td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
@@ -258,12 +257,11 @@ function cityInfo() {
|
||||
|
||||
function myNationInfo() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$query = "select startyear,year from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year']);
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -289,43 +287,43 @@ function myNationInfo() {
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level11 = MYDB_fetch_array($genresult);
|
||||
|
||||
echo "<table width=498 height=190 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
echo "<table width=498 class='tb_layout bg2 nation_info'>
|
||||
<tr>
|
||||
<td colspan=4 align=center ";
|
||||
<td colspan=4 ";
|
||||
|
||||
if($me['nation'] == 0) { echo "style=color:white;background-color:000000;font-weight:bold;font-size:13px;>【재 야】"; }
|
||||
else { echo "style=color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>국가【 {$nation['name']} 】"; }
|
||||
if($me['nation'] == 0) { echo "style='color:white;background-color:000000;font-weight:bold;font-size:13px;text-align:center;'>【재 야】"; }
|
||||
else { echo "style='color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;text-align:center'>국가【 {$nation['name']} 】"; }
|
||||
|
||||
echo "
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>성 향</b></td>
|
||||
<td align=center colspan=3><font color=\"yellow\">".getNationType($nation['type'])."</font> (".getNationType2($nation['type']).")</td>
|
||||
<td class='bg1 center'><b>성 향</b></td>
|
||||
<td colspan=3 class='center'><font color=\"yellow\">".getNationType($nation['type'])."</font> (".getNationType2($nation['type']).")</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=68 align=center id=bg1><b>".getLevel(12, $nation['level'])."</b></td>
|
||||
<td width=178 align=center>";echo $level12?$level12['name']:"-"; echo "</td>
|
||||
<td width=68 align=center id=bg1><b>".getLevel(11, $nation['level'])."</b></td>
|
||||
<td width=178 align=center>";echo $level11?$level11['name']:"-"; echo "</td>
|
||||
<td width=68 class='bg1 center'><b>".getLevel(12, $nation['level'])."</b></td>
|
||||
<td width=178 class='center'>";echo $level12?$level12['name']:"-"; echo "</td>
|
||||
<td width=68 class='bg1 center'><b>".getLevel(11, $nation['level'])."</b></td>
|
||||
<td width=178 class='center'>";echo $level11?$level11['name']:"-"; echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>총주민</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"해당 없음":"{$city['totpop']}/{$city['maxpop']}";echo "</td>
|
||||
<td align=center id=bg1><b>총병사</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"해당 없음":"{$general['totcrew']}/{$general['maxcrew']}"; echo "</td>
|
||||
<td class='bg1 center'><b>총주민</b></td>
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$city['totpop']}/{$city['maxpop']}";echo "</td>
|
||||
<td class='bg1 center'><b>총병사</b></td>
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$general['totcrew']}/{$general['maxcrew']}"; echo "</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>국 고</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"해당 없음":"{$nation['gold']}";echo "</td>
|
||||
<td align=center id=bg1><b>병 량</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"해당 없음":"{$nation['rice']}";echo "</td>
|
||||
<td class='bg1 center'><b>국 고</b></td>
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$nation['gold']}";echo "</td>
|
||||
<td class='bg1 center'><b>병 량</b></td>
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$nation['rice']}";echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>지급율</b></td>
|
||||
<td align=center>";
|
||||
<td class='bg1 center'><b>지급율</b></td>
|
||||
<td class='center'>";
|
||||
if($me['nation'] == 0) {
|
||||
echo "해당 없음";
|
||||
} else {
|
||||
@@ -333,8 +331,8 @@ function myNationInfo() {
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
<td align=center id=bg1><b>세 율</b></td>
|
||||
<td align=center>";
|
||||
<td class='bg1 center'><b>세 율</b></td>
|
||||
<td class='center'>";
|
||||
if($me['nation'] == 0) {
|
||||
echo "해당 없음";
|
||||
} else {
|
||||
@@ -374,28 +372,28 @@ function myNationInfo() {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>속 령</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"-":"{$city['cnt']}"; echo "</td>
|
||||
<td align=center id=bg1><b>장 수</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"-":"{$general['cnt']}"; echo "</td>
|
||||
<td style='text-align:center;' class='bg1'><b>속 령</b></td>
|
||||
<td style='text-align:center;'>";echo $me['nation']==0?"-":"{$city['cnt']}"; echo "</td>
|
||||
<td style='text-align:center;' class='bg1'><b>장 수</b></td>
|
||||
<td style='text-align:center;'>";echo $me['nation']==0?"-":"{$general['cnt']}"; echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>국 력</b></td>
|
||||
<td align=center>{$nation['power']}</td>
|
||||
<td align=center id=bg1><b>기술력</b></td>
|
||||
<td align=center>";echo $me['nation']==0?"-":"{$nation['tech']}"; echo "</td>
|
||||
<td style='text-align:center;' class='bg1'><b>국 력</b></td>
|
||||
<td style='text-align:center;'>{$nation['power']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>기술력</b></td>
|
||||
<td style='text-align:center;'>";echo $me['nation']==0?"-":"{$nation['tech']}"; echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>전 략</b></td>
|
||||
<td align=center>{$nation['sabotagelimit']}</td>
|
||||
<td align=center id=bg1><b>외 교</b></td>
|
||||
<td align=center>{$nation['surlimit']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>전 략</b></td>
|
||||
<td style='text-align:center;'>{$nation['sabotagelimit']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>외 교</b></td>
|
||||
<td style='text-align:center;'>{$nation['surlimit']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>임 관</b></td>
|
||||
<td align=center>{$nation['scout']}</td>
|
||||
<td align=center id=bg1><b>전 쟁</b></td>
|
||||
<td align=center>{$nation['war']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>임 관</b></td>
|
||||
<td style='text-align:center;'>{$nation['scout']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>전 쟁</b></td>
|
||||
<td style='text-align:center;'>{$nation['war']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
@@ -435,12 +433,11 @@ function commandGroup($typename, $type=0) {
|
||||
|
||||
function commandTable() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$query = "select startyear,year,develcost,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario']);
|
||||
|
||||
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -675,12 +672,11 @@ function commandTable() {
|
||||
|
||||
function CoreCommandTable() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$develcost = $gameStor->develcost;
|
||||
|
||||
$query = "select no,nation,city,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -727,8 +723,8 @@ function CoreCommandTable() {
|
||||
commandGroup("", 1);
|
||||
commandGroup("====== 특 수 ======");
|
||||
addCommand("초토화", 65, $valid);
|
||||
addCommand("천도/3턴(금쌀{$admin['develcost']}0)", 66, $valid);
|
||||
$cost = $admin['develcost'] * 500 + 60000; // 7만~13만
|
||||
addCommand("천도/3턴(금쌀{$develcost}0)", 66, $valid);
|
||||
$cost = $develcost * 500 + 60000; // 7만~13만
|
||||
addCommand("증축/6턴(금쌀{$cost})", 67, $valid);
|
||||
addCommand("감축/6턴", 68, $valid);
|
||||
commandGroup("", 1);
|
||||
@@ -777,11 +773,10 @@ function myInfo() {
|
||||
|
||||
function generalInfo($no) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select show_img_level from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$show_img_level = $gameStor->show_img_level;
|
||||
|
||||
$query = "select block,no,name,picture,imgsvr,injury,nation,city,troop,leader,leader2,power,power2,intel,intel2,explevel,experience,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,killturn,age,personal,special,specage,special2,specage2,mode,con,connect from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -877,77 +872,77 @@ function generalInfo($no) {
|
||||
else { $general['mode'] = "<font color=red>수비 안함</font>"; }
|
||||
|
||||
$weapImage = ServConfig::$gameImagePath."/weap{$general['crewtype']}.png";
|
||||
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; };
|
||||
if($show_img_level < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; };
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
echo "<table width=498 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td width=64 height=64 align=center rowspan=3 style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;'> </td>
|
||||
<td align=center colspan=9 height=16 style=color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>{$general['name']} 【 {$level} | {$call} | {$color}{$injury}</font> 】 ".substr($general['turntime'], 11)."</td>
|
||||
<td width=64 height=64 rowspan=3 style='text-align:center;background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;'> </td>
|
||||
<td colspan=9 height=16 style=text-align:center;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>{$general['name']} 【 {$level} | {$call} | {$color}{$injury}</font> 】 ".substr($general['turntime'], 11)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>통솔</b></td>
|
||||
<td align=center> {$color}{$leader}</font>{$lbonus} </td>
|
||||
<td align=center width=45>".bar(expStatus($general['leader2']), 20)."</td>
|
||||
<td align=center id=bg1><b>무력</b></td>
|
||||
<td align=center> {$color}{$power}</font> </td>
|
||||
<td align=center width=45>".bar(expStatus($general['power2']), 20)."</td>
|
||||
<td align=center id=bg1><b>지력</b></td>
|
||||
<td align=center> {$color}{$intel}</font> </td>
|
||||
<td align=center width=45>".bar(expStatus($general['intel2']), 20)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>통솔</b></td>
|
||||
<td style='text-align:center;'> {$color}{$leader}</font>{$lbonus} </td>
|
||||
<td style='text-align:center;' width=45>".bar(expStatus($general['leader2']), 20)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>무력</b></td>
|
||||
<td style='text-align:center;'> {$color}{$power}</font> </td>
|
||||
<td style='text-align:center;' width=45>".bar(expStatus($general['power2']), 20)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>지력</b></td>
|
||||
<td style='text-align:center;'> {$color}{$intel}</font> </td>
|
||||
<td style='text-align:center;' width=45>".bar(expStatus($general['intel2']), 20)."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>명마</b></td>
|
||||
<td align=center colspan=2><font size=1>$horsename</font></td>
|
||||
<td align=center id=bg1><b>무기</b></td>
|
||||
<td align=center colspan=2><font size=1>$weapname</font></td>
|
||||
<td align=center id=bg1><b>서적</b></td>
|
||||
<td align=center colspan=2><font size=1>$bookname</font></td>
|
||||
<td style='text-align:center;' class='bg1'><b>명마</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$horsename</font></td>
|
||||
<td style='text-align:center;' class='bg1'><b>무기</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$weapname</font></td>
|
||||
<td style='text-align:center;' class='bg1'><b>서적</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$bookname</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center height=64 rowspan=3 style='background:no-repeat center url(\"{$weapImage}\");background-size:64px;'></td>
|
||||
<td align=center id=bg1><b>자금</b></td>
|
||||
<td align=center colspan=2>{$general['gold']}</td>
|
||||
<td align=center id=bg1><b>군량</b></td>
|
||||
<td align=center colspan=2>{$general['rice']}</td>
|
||||
<td align=center id=bg1><b>도구</b></td>
|
||||
<td align=center colspan=2><font size=1>$itemname</font></td>
|
||||
<td height=64 rowspan=3 style='text-align:center;background:no-repeat center url(\"{$weapImage}\");background-size:64px;'></td>
|
||||
<td style='text-align:center;' class='bg1'><b>자금</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['gold']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>군량</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['rice']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>도구</b></td>
|
||||
<td style='text-align:center;' colspan=2><font size=1>$itemname</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>병종</b></td>
|
||||
<td align=center colspan=2>$typename</td>
|
||||
<td align=center id=bg1><b>병사</b></td>
|
||||
<td align=center colspan=2>{$general['crew']}</td>
|
||||
<td align=center id=bg1><b>성격</b></td>
|
||||
<td align=center colspan=2>".getGenChar($general['personal'])."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>병종</b></td>
|
||||
<td style='text-align:center;' colspan=2>$typename</td>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>훈련</b></td>
|
||||
<td align=center colspan=2>$train</td>
|
||||
<td align=center id=bg1><b>사기</b></td>
|
||||
<td align=center colspan=2>$atmos</td>
|
||||
<td align=center id=bg1><b>특기</b></td>
|
||||
<td align=center colspan=2>$special / $special2</td>
|
||||
<td style='text-align:center;' class='bg1'><b>훈련</b></td>
|
||||
<td style='text-align:center;' colspan=2>$train</td>
|
||||
<td style='text-align:center;' class='bg1'><b>사기</b></td>
|
||||
<td style='text-align:center;' colspan=2>$atmos</td>
|
||||
<td style='text-align:center;' class='bg1'><b>특기</b></td>
|
||||
<td style='text-align:center;' colspan=2>$special / $special2</td>
|
||||
</tr>
|
||||
<tr height=20>
|
||||
<td align=center id=bg1><b>Lv</b></td>
|
||||
<td align=center> {$general['explevel']} </td>
|
||||
<td align=center colspan=5>".bar(getLevelPer($general['experience'], $general['explevel']), 20)."</td>
|
||||
<td align=center id=bg1><b>연령</b></td>
|
||||
<td align=center colspan=2>{$general['age']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>Lv</b></td>
|
||||
<td style='text-align:center;'> {$general['explevel']} </td>
|
||||
<td style='text-align:center;' colspan=5>".bar(getLevelPer($general['experience'], $general['explevel']), 20)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>연령</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['age']}</td>
|
||||
</tr>
|
||||
<tr height=20>
|
||||
<td align=center id=bg1><b>수비</b></td>
|
||||
<td align=center colspan=3>{$general['mode']}</td>
|
||||
<td align=center id=bg1><b>삭턴</b></td>
|
||||
<td align=center colspan=2>{$general['killturn']} 턴</td>
|
||||
<td align=center id=bg1><b>실행</b></td>
|
||||
<td align=center colspan=2>$remaining 분 남음</td>
|
||||
<td style='text-align:center;' class='bg1'><b>수비</b></td>
|
||||
<td style='text-align:center;' colspan=3>{$general['mode']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>삭턴</b></td>
|
||||
<td style='text-align:center;' colspan=2>{$general['killturn']} 턴</td>
|
||||
<td style='text-align:center;' class='bg1'><b>실행</b></td>
|
||||
<td style='text-align:center;' colspan=2>$remaining 분 남음</td>
|
||||
</tr>
|
||||
<tr height=20>
|
||||
<td align=center id=bg1><b>부대</b></td>
|
||||
<td align=center colspan=3>{$troop['name']}</td>
|
||||
<td align=center id=bg1><b>벌점</b></td>
|
||||
<td align=center colspan=5>".getConnect($general['connect'])." {$general['connect']}({$general['con']})</td>
|
||||
<td style='text-align:center;' class='bg1'><b>부대</b></td>
|
||||
<td style='text-align:center;' colspan=3>{$troop['name']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>벌점</b></td>
|
||||
<td style='text-align:center;' colspan=5>".getConnect($general['connect'])." {$general['connect']}({$general['con']})</td>
|
||||
</tr>
|
||||
</table>";
|
||||
}
|
||||
@@ -1002,104 +997,107 @@ function generalInfo2($no) {
|
||||
if($dex30 > 100) { $dex30 = 100; }
|
||||
if($dex40 > 100) { $dex40 = 100; }
|
||||
|
||||
$general['dex0'] = getDexCall($general['dex0']);
|
||||
$general['dex10'] = getDexCall($general['dex10']);
|
||||
$general['dex20'] = getDexCall($general['dex20']);
|
||||
$general['dex30'] = getDexCall($general['dex30']);
|
||||
$general['dex40'] = getDexCall($general['dex40']);
|
||||
$general['dex0_text'] = getDexCall($general['dex0']);
|
||||
$general['dex10_text'] = getDexCall($general['dex10']);
|
||||
$general['dex20_text'] = getDexCall($general['dex20']);
|
||||
$general['dex30_text'] = getDexCall($general['dex30']);
|
||||
$general['dex40_text'] = getDexCall($general['dex40']);
|
||||
|
||||
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<tr><td align=center colspan=6 id=bg1><b>추 가 정 보</b></td></tr>
|
||||
$general['dex0_short'] = sprintf('%.1fK', $general['dex0']/1000);
|
||||
$general['dex10_short'] = sprintf('%.1fK', $general['dex10']/1000);
|
||||
$general['dex20_short'] = sprintf('%.1fK', $general['dex20']/1000);
|
||||
$general['dex30_short'] = sprintf('%.1fK', $general['dex30']/1000);
|
||||
$general['dex40_short'] = sprintf('%.1fK', $general['dex40']/1000);
|
||||
|
||||
echo "<table width=498 class='tb_layout bg2'>
|
||||
<tr><td style='text-align:center;' colspan=6 class='bg1'><b>추 가 정 보</b></td></tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>명성</b></td>
|
||||
<td align=center>$experience</td>
|
||||
<td align=center id=bg1><b>계급</b></td>
|
||||
<td align=center colspan=3>$dedication</td>
|
||||
<td style='text-align:center;' class='bg1'><b>명성</b></td>
|
||||
<td style='text-align:center;'>$experience</td>
|
||||
<td style='text-align:center;' class='bg1'><b>계급</b></td>
|
||||
<td style='text-align:center;' colspan=3>$dedication</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=64 align=center id=bg1><b>전투</b></td>
|
||||
<td width=132 align=center>{$general['warnum']}</td>
|
||||
<td width=48 align=center id=bg1><b>계략</b></td>
|
||||
<td width=98 align=center>{$general['firenum']}</td>
|
||||
<td width=48 align=center id=bg1><b>사관</b></td>
|
||||
<td width=98 align=center>{$general['belong']}년</td>
|
||||
<td width=64 style='text-align:center;' class='bg1'><b>전투</b></td>
|
||||
<td width=132 style='text-align:center;'>{$general['warnum']}</td>
|
||||
<td width=48 style='text-align:center;' class='bg1'><b>계략</b></td>
|
||||
<td width=98 style='text-align:center;'>{$general['firenum']}</td>
|
||||
<td width=48 style='text-align:center;' class='bg1'><b>사관</b></td>
|
||||
<td width=98 style='text-align:center;'>{$general['belong']}년</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>승률</b></td>
|
||||
<td align=center>{$general['winrate']} %</td>
|
||||
<td align=center id=bg1><b>승리</b></td>
|
||||
<td align=center>{$general['killnum']}</td>
|
||||
<td align=center id=bg1><b>패배</b></td>
|
||||
<td align=center>{$general['deathnum']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>승률</b></td>
|
||||
<td style='text-align:center;'>{$general['winrate']} %</td>
|
||||
<td style='text-align:center;' class='bg1'><b>승리</b></td>
|
||||
<td style='text-align:center;'>{$general['killnum']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>패배</b></td>
|
||||
<td style='text-align:center;'>{$general['deathnum']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1><b>살상률</b></td>
|
||||
<td align=center>{$general['killrate']} %</td>
|
||||
<td align=center id=bg1><b>사살</b></td>
|
||||
<td align=center>{$general['killcrew']}</td>
|
||||
<td align=center id=bg1><b>피살</b></td>
|
||||
<td align=center>{$general['deathcrew']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>살상률</b></td>
|
||||
<td style='text-align:center;'>{$general['killrate']} %</td>
|
||||
<td style='text-align:center;' class='bg1'><b>사살</b></td>
|
||||
<td style='text-align:center;'>{$general['killcrew']}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>피살</b></td>
|
||||
<td style='text-align:center;'>{$general['deathcrew']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<tr><td align=center colspan=3 id=bg1><b>숙 련 도</b></td></tr>
|
||||
<table width=498 class='tb_layout bg2'>
|
||||
<tr><td style='text-align:center;' colspan=4 class='bg1'><b>숙 련 도</b></td></tr>
|
||||
<tr height=16>
|
||||
<td width=64 align=center id=bg1><b>보병</b></td>
|
||||
<td width=64> {$general['dex0']}</td>
|
||||
<td width=366 align=center>".bar($dex0, 16)."</td>
|
||||
<td width=64 style='text-align:center;' class='bg1'><b>보병</b></td>
|
||||
<td width=40> {$general['dex0_text']}</td>
|
||||
<td width=60 align=right>{$general['dex0_short']} </td>
|
||||
<td width=330 style='text-align:center;'>".bar($dex0, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>궁병</b></td>
|
||||
<td> {$general['dex10']}</td>
|
||||
<td align=center>".bar($dex10, 16)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>궁병</b></td>
|
||||
<td> {$general['dex10_text']}</td>
|
||||
<td align=right>{$general['dex10_short']} </td>
|
||||
<td style='text-align:center;'>".bar($dex10, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>기병</b></td>
|
||||
<td> {$general['dex20']}</td>
|
||||
<td align=center>".bar($dex20, 16)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>기병</b></td>
|
||||
<td> {$general['dex20_text']}</td>
|
||||
<td align=right>{$general['dex20_short']} </td>
|
||||
<td style='text-align:center;'>".bar($dex20, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>귀병</b></td>
|
||||
<td> {$general['dex30']}</td>
|
||||
<td align=center>".bar($dex30, 16)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>귀병</b></td>
|
||||
<td> {$general['dex30_text']}</td>
|
||||
<td align=right>{$general['dex30_short']} </td>
|
||||
<td style='text-align:center;'>".bar($dex30, 16)."</td>
|
||||
</tr>
|
||||
<tr height=16>
|
||||
<td align=center id=bg1><b>차병</b></td>
|
||||
<td> {$general['dex40']}</td>
|
||||
<td align=center>".bar($dex40, 16)."</td>
|
||||
<td style='text-align:center;' class='bg1'><b>차병</b></td>
|
||||
<td> {$general['dex40_text']}</td>
|
||||
<td align=right>{$general['dex40_short']} </td>
|
||||
<td style='text-align:center;'>".bar($dex40, 16)."</td>
|
||||
</tr>
|
||||
</table>";
|
||||
}
|
||||
|
||||
function adminMsg() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$msg = $gameStor->msg;
|
||||
|
||||
$query = "select msg from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
echo "운영자 메세지 : <font color=yellow>";
|
||||
echo $admin['msg']."</font>";
|
||||
return "운영자 메세지 : <span style='color:yellow;'>$msg</span>";
|
||||
}
|
||||
|
||||
function getOnlineNum() {
|
||||
return DB::db()->queryFirstField('select `online` from `game` where `no`=1');
|
||||
return KVStorage::getStorage(DB::db(), 'game_env')->online;
|
||||
}
|
||||
|
||||
function onlinegen() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$onlinegen = "";
|
||||
$generalID = Session::getInstance()->generalID;
|
||||
$nationID = DB::db()->queryFirstField('select `nation` from `general` where `no` = %i', $generalID);
|
||||
if($nationID === null || Util::toInt($nationID) === 0) {
|
||||
$query = "select onlinegen from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
|
||||
$onlinegen = $game['onlinegen'];
|
||||
$onlinegen = $gameStor->onlinegen;
|
||||
} else {
|
||||
$onlinegen = DB::db()->queryFirstField('select onlinegen from nation where nation=%i',$nationID);
|
||||
}
|
||||
@@ -1108,12 +1106,9 @@ function onlinegen() {
|
||||
|
||||
function onlineNation() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$query = "select onlinenation from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
return $game['onlinenation'];
|
||||
return $gameStor->onlinenation;
|
||||
}
|
||||
|
||||
function nationMsg() {
|
||||
@@ -1148,15 +1143,15 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
|
||||
$imageTemp = GetImageURL($imgsvr);
|
||||
echo "
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table style='text-align:center;' width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=64 align=center id=bg1><font size=1>$name</font></td>
|
||||
<td width=772 align=center id=bg1><font size=4><b>$message[0]</b></font></td>
|
||||
<td width=148 align=center id=bg1>$when</td>
|
||||
<td width=90 style='text-align:center;' class='bg1'><font size=1>$name</font></td>
|
||||
<td width=746 style='text-align:center;' class='bg1'><font size=4><b>$message[0]</b></font></td>
|
||||
<td width=148 style='text-align:center;' class='bg1'>$when</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=64 height=64 valign=top><img width='64' height='64' src={$imageTemp}/{$picture} border=0></td>
|
||||
<td width=932 colspan=2>$message[1]</td>
|
||||
<td width=90 height=64 valign=top><img width='64' height='64' src={$imageTemp}/{$picture} border='0'></td>
|
||||
<td width=906 colspan=2>$message[1]</td>
|
||||
</tr>";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$who = Tag2Code($message[2+$i*2]);
|
||||
@@ -1166,16 +1161,16 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$regen = MYDB_fetch_array($result);
|
||||
echo "
|
||||
<tr>
|
||||
<td width=64 align=center><font size=1>{$regen['name']}</font></td>
|
||||
<td width=932 colspan=2>$reply</td>
|
||||
<td width=90 style='text-align:center;'><font size=1>{$regen['name']}</font></td>
|
||||
<td width=906 colspan=2>$reply</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
<tr>
|
||||
<form name=reply_form{$num} method=post action=$board>
|
||||
<td width=64 align=center>댓글달기</td>
|
||||
<td width=932 colspan=2>
|
||||
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:830px;>
|
||||
<td width=90 style='text-align:center;'>댓글달기</td>
|
||||
<td width=906 colspan=2>
|
||||
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:804px;>
|
||||
<input type=submit value=댓글달기>
|
||||
<input type=hidden name=num value=$num>
|
||||
</td>
|
||||
@@ -1257,9 +1252,8 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
$db = DB::db();
|
||||
$db->update('game', [
|
||||
'refresh'=>$db->sqleval('refresh+%i', $cnt)
|
||||
], true);
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->refresh = $gameStor->refresh+$cnt; //TODO: +로 증가하는 값은 별도로 분리
|
||||
|
||||
if($generalID) {
|
||||
$db->update('general', [
|
||||
@@ -1327,22 +1321,21 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
function updateTraffic() {
|
||||
$online = getOnlineNum();
|
||||
$db = DB::db();
|
||||
$game = $db->queryFirstRow('SELECT year,month,refresh,maxonline,maxrefresh from game limit 1');
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxonline','maxrefresh']);
|
||||
|
||||
//최다갱신자
|
||||
$user = $db->queryFirstRow('select name,refresh from general order by refresh desc limit 1');
|
||||
|
||||
if($game['maxrefresh'] < $game['refresh']) {
|
||||
$game['maxrefresh'] = $game['refresh'];
|
||||
if($admin['maxrefresh'] < $admin['refresh']) {
|
||||
$admin['maxrefresh'] = $admin['refresh'];
|
||||
}
|
||||
if($game['maxonline'] < $online) {
|
||||
$game['maxonline'] = $online;
|
||||
if($admin['maxonline'] < $online) {
|
||||
$admin['maxonline'] = $online;
|
||||
}
|
||||
$db->update('game',[
|
||||
'refresh'=>0,
|
||||
'maxrefresh'=>$game['maxrefresh'],
|
||||
'maxonline'=>$game['maxonline']
|
||||
], true);
|
||||
$gameStor->refresh = 0;
|
||||
$gameStor->maxrefresh = $admin['maxrefresh'];
|
||||
$gameStor->maxonline = $admin['maxonline'];
|
||||
|
||||
$db->update('general', ['refresh'=>0], true);
|
||||
|
||||
@@ -1351,9 +1344,9 @@ function updateTraffic() {
|
||||
file_put_contents(__dir__."/logs/_traffic.txt",
|
||||
Json::encode([
|
||||
$date,
|
||||
$game['year'],
|
||||
$game['month'],
|
||||
$game['refresh'],
|
||||
$admin['year'],
|
||||
$admin['month'],
|
||||
$admin['refresh'],
|
||||
$online,
|
||||
$user['name']."(".$user['refresh'].")"
|
||||
])."\n"
|
||||
@@ -1363,15 +1356,14 @@ function updateTraffic() {
|
||||
function CheckOverhead() {
|
||||
//서버정보
|
||||
$db = DB::db();
|
||||
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
list($turnterm, $conlimit) = $gameStor->getValuesAsArray(['turnterm', 'conlimit']);
|
||||
|
||||
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
|
||||
$con = Util::round(pow($turnterm, 0.6) * 3) * 10;
|
||||
|
||||
|
||||
if($con != $admin['conlimit']){
|
||||
$db->update('game', [
|
||||
'conlimit' => $con
|
||||
], true);
|
||||
if($con != $conlimit){
|
||||
$gameStor->conlimit = $con;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1409,27 +1401,30 @@ function unlock() {
|
||||
}
|
||||
|
||||
function timeover() {
|
||||
$admin = DB::db()->queryFirstRow(
|
||||
'SELECT turnterm,TIMESTAMPDIFF(SECOND,turntime,now()) as diff from game limit 1'
|
||||
);
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$t = min($admin['turnterm'], 5);
|
||||
list($turnterm, $turntime) = $gameStor->getValuesAsArray(['turnterm', 'turntime']);
|
||||
$diff = (new \DateTime())->getTimestamp() - (new \DateTime($turntime))->getTimestamp();
|
||||
|
||||
$term = $admin['diff'];
|
||||
$t = min($turnterm, 5);
|
||||
|
||||
$term = $diff;
|
||||
if($term >= $t || $term < 0) { return 1; }
|
||||
else { return 0; }
|
||||
}
|
||||
|
||||
function checkDelay() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
//서버정보
|
||||
$query = "select turnterm,now() as now,TIMESTAMPDIFF(MINUTE,turntime,now()) as offset from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$now = new \DateTimeImmutable();
|
||||
$turntime = new \DateTimeImmutable($gameStor->turntime);
|
||||
$timeMinDiff = intdiv($now->getTimestamp() - $turntime->getTimestamp(), 60);
|
||||
|
||||
// 1턴이상 갱신 없었으면 서버 지연
|
||||
$term = $admin['turnterm'];
|
||||
$term = $gameStor->turnterm;
|
||||
if($term >= 20){
|
||||
$threshold = 1;
|
||||
}
|
||||
@@ -1440,20 +1435,28 @@ function checkDelay() {
|
||||
$threshold = 3;
|
||||
}
|
||||
//지연 해야할 밀린 턴 횟수
|
||||
$iter = intdiv($admin['offset'], $term);
|
||||
$iter = intdiv($timeMinDiff, $term);
|
||||
if($iter > $threshold) {
|
||||
$minute = $iter * $term;
|
||||
$query = "update game set turntime=DATE_ADD(turntime, INTERVAL $minute MINUTE),starttime=DATE_ADD(starttime, INTERVAL $minute MINUTE),tnmt_time=DATE_ADD(tnmt_time, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set turntime=DATE_ADD(turntime, INTERVAL $minute MINUTE) where turntime<=DATE_ADD(turntime, INTERVAL $term MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update auction set expire=DATE_ADD(expire, INTERVAL $minute MINUTE)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$newTurntime = $turntime->add(new \DateInterval("PT{$minute}M"));
|
||||
$newNextTurntime = $turntime->add(new \DateInterval("PT{$term}M"));
|
||||
$gameStor->turntime = $newTurntime->format('Y-m-d H:i:s');
|
||||
$gameStor->starttime = (new \DateTimeImmutable($gameStor->starttime))
|
||||
->add(new \DateInterval("PT{$minute}M"))
|
||||
->format('Y-m-d H:i:s');
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=> $db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
], 'turntime<=DATE_ADD(turntime, INTERVAL %i MINUTE)', $term);
|
||||
$db->update('auction', [
|
||||
'expire'=> $db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
}
|
||||
}
|
||||
|
||||
function updateOnline() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$nationname = ["재야"];
|
||||
|
||||
@@ -1487,8 +1490,7 @@ function updateOnline() {
|
||||
$onnationstr .= "【{$nationname[$key]}】, ";
|
||||
|
||||
if($key == 0) {
|
||||
$query = "update game set onlinegen='$onnation[0]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->onlinegen = $onnation[0];
|
||||
} else {
|
||||
$query = "update nation set onlinegen='$onnation[$key]' where nation='$key'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1497,12 +1499,13 @@ function updateOnline() {
|
||||
}
|
||||
|
||||
//접속중인 국가
|
||||
$query = "update game set online='$onlinenum',onlinenation='$onnationstr'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->online = $onlinenum;
|
||||
$gameStor->onlinenation = $onnationstr;
|
||||
}
|
||||
|
||||
function checkTurn() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$alllog = [];
|
||||
@@ -1537,14 +1540,11 @@ function checkTurn() {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', 진입');
|
||||
|
||||
//천통시에는 동결
|
||||
$query = "select turntime from game where isUnited=2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$down = MYDB_num_rows($result);
|
||||
if($down > 0) {
|
||||
$query = "update plock set plock=1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if($gameStor->isunited == 2) {
|
||||
$db->update('plock', ['plock'=>1], true);
|
||||
return;
|
||||
}
|
||||
$gameStor->cacheAll();
|
||||
// 1턴이상 갱신 없었으면 서버 지연
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
|
||||
checkDelay();
|
||||
@@ -1555,14 +1555,11 @@ function checkTurn() {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', CheckOverhead');
|
||||
CheckOverhead();
|
||||
//서버정보
|
||||
$query = "select * from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
// 최종 처리 월턴의 다음 월턴시간 구함
|
||||
$prevTurn = cutTurn($admin['turntime'], $admin['turnterm']);
|
||||
$nextTurn = addTurn($prevTurn, $admin['turnterm']);
|
||||
$prevTurn = cutTurn($gameStor->turntime, $gameStor->turnterm);
|
||||
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
|
||||
// 현재 턴 이전 월턴까지 모두처리.
|
||||
//최종 처리 이후 다음 월턴이 현재 시간보다 전이라면
|
||||
while($nextTurn <= $date) {
|
||||
@@ -1600,15 +1597,15 @@ function checkTurn() {
|
||||
|
||||
// 잡금 해제
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
|
||||
$gameStor->resetCache(true);
|
||||
unlock();
|
||||
return false;
|
||||
}
|
||||
|
||||
// 그 시각 년도,월 저장
|
||||
$dt = turnDate($nextTurn);
|
||||
$admin['year'] = $dt[0]; $admin['month'] = $dt[1];
|
||||
list($gameStor->year, $gameStor->month) = turnDate($nextTurn);
|
||||
|
||||
pushLockLog(["-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$session->userName]);
|
||||
pushLockLog(["-- checkTurn() ".$gameStor->month."월 : ".date('Y-m-d H:i:s')." : ".$session->userName]);
|
||||
|
||||
// 이벤트 핸들러 동작
|
||||
foreach (DB::db()->query('SELECT * from event') as $rawEvent) {
|
||||
@@ -1617,13 +1614,12 @@ function checkTurn() {
|
||||
$action = Json::decode($rawEvent['action']);
|
||||
$event = new Event\EventHandler($cond, $action);
|
||||
|
||||
$event->tryRunEvent(['currentEventID'=>$eventID] + $admin);
|
||||
$event->tryRunEvent(['currentEventID'=>$eventID] + $gameStor->getAll(true));
|
||||
}
|
||||
|
||||
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
||||
if($admin['month'] == 1) {
|
||||
if($gameStor->month == 1) {
|
||||
// NPC 등장
|
||||
//if($admin['scenario'] > 0 && $admin['scenario'] < 20) { RegNPC(); }
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processGoldIncome');
|
||||
processGoldIncome();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processSpring');
|
||||
@@ -1639,14 +1635,14 @@ function checkTurn() {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', addAge');
|
||||
addAge();
|
||||
// 새해 알림
|
||||
$alllog[] = "<C>◆</>{$admin['month']}월:<C>{$admin['year']}</>년이 되었습니다.";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
} elseif($admin['month'] == 4) {
|
||||
$alllog[] = "<C>◆</>{$gameStor->month}월:<C>{$gameStor->year}</>년이 되었습니다.";
|
||||
pushGeneralPublicRecord($alllog, $gameStor->year, $gameStor->month);
|
||||
} elseif($gameStor->month == 4) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
disaster();
|
||||
} elseif($admin['month'] == 7) {
|
||||
} elseif($gameStor->month == 7) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processRiceIncome');
|
||||
processRiceIncome();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processFall');
|
||||
@@ -1657,7 +1653,7 @@ function checkTurn() {
|
||||
disaster();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', tradeRate');
|
||||
tradeRate();
|
||||
} elseif($admin['month'] == 10) {
|
||||
} elseif($gameStor->month == 10) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
@@ -1668,18 +1664,16 @@ function checkTurn() {
|
||||
|
||||
// 다음달로 넘김
|
||||
$prevTurn = $nextTurn;
|
||||
$nextTurn = addTurn($prevTurn, $admin['turnterm']);
|
||||
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
|
||||
}
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
|
||||
|
||||
// 이시각 정각 시까지 업데이트 완료했음
|
||||
$query = "update game set turntime='$prevTurn'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->turntime = $prevTurn;
|
||||
|
||||
// 그 시각 년도,월 저장
|
||||
$dt = turnDate($prevTurn);
|
||||
$admin['year'] = $dt[0]; $admin['month'] = $dt[1];
|
||||
list($gameStor->year, $gameStor->month) = turnDate($prevTurn);
|
||||
// 현재시간의 월턴시간 이후 분단위 장수 처리
|
||||
do {
|
||||
$query = "select no,name,turntime,turn0,npc from general where turntime<='$date' order by turntime";
|
||||
@@ -1707,8 +1701,7 @@ function checkTurn() {
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
|
||||
|
||||
$query = "update game set turntime='$date'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->turntime = $date;
|
||||
|
||||
// 부상 과도 제한
|
||||
$query = "update general set injury='80' where injury>'80'";
|
||||
@@ -1721,6 +1714,7 @@ function checkTurn() {
|
||||
processAuction();
|
||||
// 잡금 해제
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
|
||||
$gameStor->resetCache(true);
|
||||
unlock();
|
||||
|
||||
pushLockLog(["- checkTurn() 출 : ".date('Y-m-d H:i:s')." : ".$session->userName]);
|
||||
@@ -1732,15 +1726,14 @@ function checkTurn() {
|
||||
|
||||
function addAge() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
//나이와 호봉 증가
|
||||
$query = "update general set age=age+1,belong=belong+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
if($admin['year'] >= $admin['startyear']+3) {
|
||||
$query = "select no,name,nation,leader,power,intel from general where specage<=age and special='0'";
|
||||
@@ -1753,8 +1746,9 @@ function addAge() {
|
||||
$query = "update general set special='$special' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special)."</></b>】(을)를 습득");
|
||||
pushGenLog($general, "<C>●</>특기 【<b><L>".getGenSpecial($special)."</></b>】(을)를 익혔습니다!");
|
||||
$josaUl = JosaUtil::pick($special, '을');
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special)."</></b>】{$josaUl} 습득");
|
||||
pushGenLog($general, "<C>●</>특기 【<b><L>".getGenSpecial($special)."</></b>】{$josaUl} 익혔습니다!");
|
||||
}
|
||||
|
||||
$query = "select no,name,nation,leader,power,intel,npc,dex0,dex10,dex20,dex30,dex40 from general where specage2<=age and special2='0'";
|
||||
@@ -1768,16 +1762,17 @@ function addAge() {
|
||||
$query = "update general set special2='$special2' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득");
|
||||
pushGenLog($general, "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!");
|
||||
$josaUl = JosaUtil::pick($special2, '을');
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:특기 【<b><C>".getGenSpecial($special2)."</></b>】{$josaUl} 습득");
|
||||
pushGenLog($general, "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】{$josaUl} 익혔습니다!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function turnDate($curtime) {
|
||||
$db = DB::db();
|
||||
|
||||
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$admin = $gameStor->getValues(['startyear', 'starttime', 'turnterm', 'year', 'month']);
|
||||
|
||||
$turn = $admin['starttime'];
|
||||
$curturn = cutTurn($curtime, $admin['turnterm']);
|
||||
@@ -1793,10 +1788,8 @@ function turnDate($curtime) {
|
||||
|
||||
// 바뀐 경우만 업데이트
|
||||
if($admin['month'] != $month || $admin['year'] != $year) {
|
||||
$db->update('game', [
|
||||
'year'=>$year,
|
||||
'month'=>$month
|
||||
], true);
|
||||
$gameStor->year = $year;
|
||||
$gameStor->month = $month;
|
||||
}
|
||||
|
||||
return [$year, $month];
|
||||
@@ -1805,11 +1798,9 @@ function turnDate($curtime) {
|
||||
|
||||
function triggerTournament() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$query = "select tournament,tnmt_trig from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['tournament', 'tnmt_trig']);
|
||||
|
||||
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
|
||||
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
|
||||
@@ -1856,7 +1847,8 @@ function PreprocessCommand($no) {
|
||||
$query = "update general set injury=0 where no='{$patient['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushGenLog($patient, "<C>●</><Y>{$general['name']}</>(이)가 <C>의술</>로써 치료해줍니다!");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
pushGenLog($patient, "<C>●</><Y>{$general['name']}</>{$josaYi} <C>의술</>로써 치료해줍니다!");
|
||||
|
||||
if($patientName == "") {
|
||||
$patientName = $patient['name'];
|
||||
@@ -1864,7 +1856,8 @@ function PreprocessCommand($no) {
|
||||
}
|
||||
|
||||
if($patientCount == 1) {
|
||||
pushGenLog($general, "<C>●</><C>의술</>을 펼쳐 도시의 장수 <Y>{$patientName}</>(을)를 치료합니다!");
|
||||
$josaUl = JosaUtil::pick($patientName, '을');
|
||||
pushGenLog($general, "<C>●</><C>의술</>을 펼쳐 도시의 장수 <Y>{$patientName}</>{$josaUl} 치료합니다!");
|
||||
} else {
|
||||
$patientCount -= 1;
|
||||
pushGenLog($general, "<C>●</><C>의술</>을 펼쳐 도시의 장수들 <Y>{$patientName}</> 외 <C>{$patientCount}</>명을 치료합니다!");
|
||||
@@ -1878,7 +1871,8 @@ function PreprocessCommand($no) {
|
||||
$query = "update general set injury=0 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log[0] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용하여 치료합니다!";
|
||||
$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)) {
|
||||
//환약 사용
|
||||
@@ -1902,13 +1896,12 @@ function PreprocessCommand($no) {
|
||||
|
||||
function updateTurntime($no) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$alllog = [];
|
||||
$log = [];
|
||||
|
||||
$query = "select year,month,isUnited,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'isunited', 'turnterm']);
|
||||
|
||||
$query = "select no,name,name2,nation,troop,age,turntime,killturn,level,deadyear,npc,npc_org,affinity,npcid from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1923,10 +1916,11 @@ function updateTurntime($no) {
|
||||
$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),"");
|
||||
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>(이)가 <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
|
||||
$josaYi = JosaUtil::pick($general['name2'], '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>{$josaYi} <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
|
||||
if($admin['isUnited'] == 0) {
|
||||
if($admin['isunited'] == 0) {
|
||||
CheckHall($no);
|
||||
}
|
||||
} else {
|
||||
@@ -1968,72 +1962,73 @@ function updateTurntime($no) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 병, 요절, 객사, 번개, 사채, 일확천금, 호랑이, 곰, 수영, 처형, 발견
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
switch(rand()%42) {
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 역병에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <R>요절</>하고 말았습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 거리에서 갑자기 <R>객사</>하고 말았습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 안타깝게도 번개에 맞아 <R>죽고</> 말았습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 고리대금에 시달리다가 <R>자살</>하고 말았습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 일확천금에 놀라 심장마비로 <R>죽고</> 말았습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 산속에서 호랑이에게 물려 <R>죽고</> 말았습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 산책중 곰에게 할퀴어 <R>죽고</> 말았습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 수영을 하다 <R>익사</>하고 말았습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 황제를 모독하다가 <R>처형</>당하고 말았습니다."; break;
|
||||
case 10: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 이튿날 침실에서 <R>죽은채로</>발견되었습니다."; break;
|
||||
case 11: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 색에 빠져 기력이 쇠진해 <R>죽고</>말았습니다."; break;
|
||||
case 12: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 미녀를 보고 심장마비로 <R>죽고</>말았습니다."; break;
|
||||
case 13: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 우울증에 걸려 <R>자살</>하고 말았습니다."; break;
|
||||
case 14: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 천하 정세를 비관하며 <R>분신</>하고 말았습니다."; break;
|
||||
case 15: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 어떤 관심도 못받고 쓸쓸히 <R>죽고</>말았습니다."; break;
|
||||
case 16: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 유산 상속 문제로 다투다가 <R>살해</>당했습니다."; break;
|
||||
case 17: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 누군가의 사주로 자객에게 <R>암살</>당했습니다."; break;
|
||||
case 18: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 바람난 배우자에게 <R>독살</>당하고 말았습니다."; break;
|
||||
case 19: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 농약을 술인줄 알고 마셔 <R>죽고</>말았습니다."; break;
|
||||
case 20: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 아무 이유 없이 <R>죽고</>말았습니다."; break;
|
||||
case 21: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 전재산을 잃고 화병으로 <R>죽고</>말았습니다."; break;
|
||||
case 22: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 단식운동을 하다가 굶어 <R>죽고</>말았습니다."; break;
|
||||
case 23: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 귀신에게 홀려 시름 앓다가 <R>죽고</>말았습니다."; break;
|
||||
case 24: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 사람들에게 집단으로 맞아서 <R>죽고</>말았습니다."; break;
|
||||
case 25: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 갑자기 성벽에서 뛰어내려 <R>죽고</>말았습니다."; break;
|
||||
case 26: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 농사중 호미에 머리를 맞아 <R>죽고</>말았습니다."; break;
|
||||
case 27: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 저세상이 궁금하다며 <R>자살</>하고 말았습니다."; break;
|
||||
case 28: $alllog[0] = "<C>●</>{$admin['month']}월:운좋기로 소문난 <Y>{$general['name']}</>(이)가 불운하게도 <R>죽고</>말았습니다."; break;
|
||||
case 29: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 무리하게 단련을 하다가 <R>죽고</>말았습니다."; break;
|
||||
case 30: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 생활고를 비관하며 <R>자살</>하고 말았습니다."; break;
|
||||
case 31: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 평생 결혼도 못해보고 <R>죽고</> 말았습니다."; break;
|
||||
case 32: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 과식하다 배가 터져 <R>죽고</> 말았습니다."; break;
|
||||
case 33: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 웃다가 숨이 넘어가 <R>죽고</> 말았습니다."; break;
|
||||
case 34: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 추녀를 보고 놀라서 <R>죽고</> 말았습니다."; break;
|
||||
case 35: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 물에 빠진 사람을 구하려다 같이 <R>죽고</> 말았습니다."; break;
|
||||
case 36: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 독살을 준비하다 독에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 37: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 뒷간에서 너무 힘을 주다가 <R>죽고</> 말았습니다."; break;
|
||||
case 38: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 돌팔이 의사에게 치료받다가 <R>죽고</> 말았습니다."; break;
|
||||
case 39: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 남의 보약을 훔쳐먹다 부작용으로 <R>죽고</> 말았습니다."; break;
|
||||
case 40: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 사기꾼 <Y>{$general['name']}</>(이)가 <R>사망</>했습니다."; break;
|
||||
case 41: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 호색한 <Y>{$general['name']}</>(이)가 <R>사망</>했습니다."; break;
|
||||
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <R>사망</>했습니다."; break;
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 역병에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>요절</>하고 말았습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 거리에서 갑자기 <R>객사</>하고 말았습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 안타깝게도 번개에 맞아 <R>죽고</> 말았습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 고리대금에 시달리다가 <R>자살</>하고 말았습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 일확천금에 놀라 심장마비로 <R>죽고</> 말았습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 산속에서 호랑이에게 물려 <R>죽고</> 말았습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 산책중 곰에게 할퀴어 <R>죽고</> 말았습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 수영을 하다 <R>익사</>하고 말았습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 황제를 모독하다가 <R>처형</>당하고 말았습니다."; break;
|
||||
case 10: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 이튿날 침실에서 <R>죽은채로</>발견되었습니다."; break;
|
||||
case 11: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 색에 빠져 기력이 쇠진해 <R>죽고</>말았습니다."; break;
|
||||
case 12: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 미녀를 보고 심장마비로 <R>죽고</>말았습니다."; break;
|
||||
case 13: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 우울증에 걸려 <R>자살</>하고 말았습니다."; break;
|
||||
case 14: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 천하 정세를 비관하며 <R>분신</>하고 말았습니다."; break;
|
||||
case 15: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 어떤 관심도 못받고 쓸쓸히 <R>죽고</>말았습니다."; break;
|
||||
case 16: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 유산 상속 문제로 다투다가 <R>살해</>당했습니다."; break;
|
||||
case 17: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 누군가의 사주로 자객에게 <R>암살</>당했습니다."; break;
|
||||
case 18: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 바람난 배우자에게 <R>독살</>당하고 말았습니다."; break;
|
||||
case 19: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 농약을 술인줄 알고 마셔 <R>죽고</>말았습니다."; break;
|
||||
case 20: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 아무 이유 없이 <R>죽고</>말았습니다."; break;
|
||||
case 21: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 전재산을 잃고 화병으로 <R>죽고</>말았습니다."; break;
|
||||
case 22: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 단식운동을 하다가 굶어 <R>죽고</>말았습니다."; break;
|
||||
case 23: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 귀신에게 홀려 시름 앓다가 <R>죽고</>말았습니다."; break;
|
||||
case 24: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 사람들에게 집단으로 맞아서 <R>죽고</>말았습니다."; break;
|
||||
case 25: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 갑자기 성벽에서 뛰어내려 <R>죽고</>말았습니다."; break;
|
||||
case 26: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 농사중 호미에 머리를 맞아 <R>죽고</>말았습니다."; break;
|
||||
case 27: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 저세상이 궁금하다며 <R>자살</>하고 말았습니다."; break;
|
||||
case 28: $alllog[0] = "<C>●</>{$admin['month']}월:운좋기로 소문난 <Y>{$general['name']}</>{$josaYi} 불운하게도 <R>죽고</>말았습니다."; break;
|
||||
case 29: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 무리하게 단련을 하다가 <R>죽고</>말았습니다."; break;
|
||||
case 30: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 생활고를 비관하며 <R>자살</>하고 말았습니다."; break;
|
||||
case 31: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 평생 결혼도 못해보고 <R>죽고</> 말았습니다."; break;
|
||||
case 32: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 과식하다 배가 터져 <R>죽고</> 말았습니다."; break;
|
||||
case 33: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 웃다가 숨이 넘어가 <R>죽고</> 말았습니다."; break;
|
||||
case 34: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 추녀를 보고 놀라서 <R>죽고</> 말았습니다."; break;
|
||||
case 35: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 물에 빠진 사람을 구하려다 같이 <R>죽고</> 말았습니다."; break;
|
||||
case 36: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 독살을 준비하다 독에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 37: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 뒷간에서 너무 힘을 주다가 <R>죽고</> 말았습니다."; break;
|
||||
case 38: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 돌팔이 의사에게 치료받다가 <R>죽고</> 말았습니다."; break;
|
||||
case 39: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 남의 보약을 훔쳐먹다 부작용으로 <R>죽고</> 말았습니다."; break;
|
||||
case 40: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 사기꾼 <Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
case 41: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 호색한 <Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
}
|
||||
// 엔피씨,엠피씨,의병 사망로그
|
||||
if($general['npc'] == 2) {
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <R>사망</>했습니다.";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
|
||||
} elseif($general['npc'] >= 3) {
|
||||
switch(rand()%10) {
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 푸대접에 실망하여 떠났습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 갑자기 화를 내며 떠났습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 의견차이를 좁히지 못하고 떠났습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 판단 착오였다며 떠났습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 생활고가 나아지지 않는다며 떠났습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 기대가 너무 컸다며 떠났습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 아무 이유 없이 떠났습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 자기 목적은 달성했다며 떠났습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 자기가 없어도 될것 같다며 떠났습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 처자식이 그립다며 떠났습니다."; break;
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 푸대접에 실망하여 떠났습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 갑자기 화를 내며 떠났습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 의견차이를 좁히지 못하고 떠났습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 판단 착오였다며 떠났습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 생활고가 나아지지 않는다며 떠났습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 기대가 너무 컸다며 떠났습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 아무 이유 없이 떠났습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 자기 목적은 달성했다며 떠났습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 자기가 없어도 될것 같다며 떠났습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 처자식이 그립다며 떠났습니다."; break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2044,14 +2039,15 @@ function updateTurntime($no) {
|
||||
}
|
||||
|
||||
if($general['age'] >= 80 && $general['npc'] == 0) {
|
||||
if($admin['isUnited'] == 0) {
|
||||
if($admin['isunited'] == 0) {
|
||||
CheckHall($no);
|
||||
}
|
||||
|
||||
$query = "update general set leader=leader*0.85,power=power*0.85,intel=intel*0.85,injury=0,experience=experience*0.5,dedication=dedication*0.5,firenum=0,warnum=0,killnum=0,deathnum=0,killcrew=0,deathcrew=0,age=20,specage=0,specage2=0,crew=crew*0.85,dex0=dex0*0.5,dex10=dex10*0.5,dex20=dex20*0.5,dex30=dex30*0.5,dex40=dex40*0.5 where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <R>은퇴</>하고 그 자손이 유지를 이어받았습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>은퇴</>하고 그 자손이 유지를 이어받았습니다.";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
|
||||
$log[0] = "<C>●</>나이가 들어 <R>은퇴</>하고 자손에게 자리를 물려줍니다.";
|
||||
@@ -2152,6 +2148,7 @@ function CheckHall($no) {
|
||||
|
||||
function uniqueItem($general, $log, $vote=0) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2161,15 +2158,13 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
if($general['npc'] >= 2) { return $log; }
|
||||
if($general['weap'] > 6 || $general['book'] > 6 || $general['horse'] > 6 || $general['item'] > 6) { return $log; }
|
||||
|
||||
$query = "select year,month,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'scenario']);
|
||||
|
||||
$query = "select count(*) as cnt from general where npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if($game['scenario'] == 0) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
if($admin['scenario'] == 0) { $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개 등장
|
||||
@@ -2209,64 +2204,72 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
|
||||
switch($sel) {
|
||||
case 0:
|
||||
$log[] = "<C>●</><C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
|
||||
$josaUl = JosaUtil::pick(getWeapName($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getWeapName($it)."</>{$josaUl} 습득");
|
||||
if($vote == 0) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
$log[] = "<C>●</><C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
|
||||
$josaUl = JosaUtil::pick(getBookName($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getBookName($it)."</>{$josaUl} 습득");
|
||||
if($vote == 0) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
$log[] = "<C>●</><C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
|
||||
$josaUl = JosaUtil::pick(getHorseName($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getHorseName($it)."</>{$josaUl} 습득");
|
||||
if($vote == 0) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
$log[] = "<C>●</><C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game['year']}년 {$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
|
||||
$josaUl = JosaUtil::pick(getItemName($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getItemName($it)."</>{$josaUl} 습득");
|
||||
if($vote == 0) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 1) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 2) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
} elseif($vote == 3) {
|
||||
$history[] = "<C>●</>{$game['year']}년 {$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $game['year'], $game['month']);
|
||||
pushWorldHistory($history, $game['year'], $game['month']);
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
}
|
||||
return $log;
|
||||
@@ -2331,11 +2334,13 @@ function checkDedication($general, $log) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 승급했다면
|
||||
$josaRoDed = JosaUtil::pick(getDed($general['dedication']), '로');
|
||||
$josaRoBill = JosaUtil::pick(getBill($general['dedication']), '로');
|
||||
if($general['dedlevel'] < $dedlevel) {
|
||||
$log[] = "<C>●</><Y>".getDed($general['dedication'])."</>(으)로 <C>승급</>하여 봉록이 <C>".getBill($general['dedication'])."</>(으)로 <C>상승</>했습니다!";
|
||||
$log[] = "<C>●</><Y>".getDed($general['dedication'])."</>{$josaRoDed} <C>승급</>하여 봉록이 <C>".getBill($general['dedication'])."</>{$josaRoBill} <C>상승</>했습니다!";
|
||||
// 강등했다면
|
||||
} elseif($general['dedlevel'] > $dedlevel) {
|
||||
$log[] = "<C>●</><Y>".getDed($general['dedication'])."</>(으)로 <R>강등</>되어 봉록이 <C>".getBill($general['dedication'])."</>(으)로 <R>하락</>했습니다!";
|
||||
$log[] = "<C>●</><Y>".getDed($general['dedication'])."</>{$josaRoDed} <R>강등</>되어 봉록이 <C>".getBill($general['dedication'])."</>{$josaRoBill} <R>하락</>했습니다!";
|
||||
}
|
||||
|
||||
return $log;
|
||||
@@ -2363,13 +2368,8 @@ function checkExperience($general, $log) {
|
||||
|
||||
function getAdmin() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select * from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
return $admin;
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
return $gameStor->getAll();
|
||||
}
|
||||
|
||||
function getMe() {
|
||||
@@ -2419,18 +2419,18 @@ function getNation($nation) {
|
||||
|
||||
function deleteNation($general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【멸망】</b></><D><b>{$nation['name']}</b></>은(는) <R>멸망</>했습니다.";
|
||||
$josaUn = JosaUtil::pick($nation['name'], '은');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【멸망】</b></><D><b>{$nation['name']}</b></>{$josaUn} <R>멸망</>했습니다.";
|
||||
|
||||
// 전 장수 재야로 // 전 장수 소속 무소속으로
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
|
||||
@@ -2454,11 +2454,10 @@ function deleteNation($general) {
|
||||
|
||||
function nextRuler($general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select nation,name from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2514,10 +2513,11 @@ function nextRuler($general) {
|
||||
$query = "update city set gen3=0 where gen3='{$nextruler['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【유지】</b></><Y>{$nextruler['name']}</>(이)가 <D><b>{$nation['name']}</b></>의 유지를 이어 받았습니다"];
|
||||
$josaYi = JosaUtil::pick($nextruler['name'], '이');
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【유지】</b></><Y>{$nextruler['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>의 유지를 이어 받았습니다"];
|
||||
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【유지】</b></><Y>{$nextruler['name']}</>(이)가 <D><b>{$nation['name']}</b></>의 유지를 이어 받음.");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【유지】</b></><Y>{$nextruler['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>의 유지를 이어 받음.");
|
||||
// 장수 삭제 및 부대처리는 checkTurn에서
|
||||
}
|
||||
|
||||
@@ -2568,7 +2568,7 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
|
||||
}
|
||||
}
|
||||
|
||||
function isClose(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
||||
function isNeighbor(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
||||
$db = DB::db();
|
||||
|
||||
$nation1Cities = [];
|
||||
@@ -2661,12 +2661,11 @@ function CharCritical($rate, $personal) {
|
||||
|
||||
function SabotageInjury($city, $type=0) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$log = [];
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select no,name,nation from general where city='$city'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+55
-28
@@ -18,11 +18,10 @@ function GetStuffName($stuff) {
|
||||
|
||||
function registerAuction() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'turnterm']);
|
||||
|
||||
$unit = 60 * $admin['turnterm'];
|
||||
|
||||
@@ -83,8 +82,10 @@ function registerAuction() {
|
||||
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ암시장상인', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<C>".GetStuffName($stuff)."</>(이)가 거래장에 등장했습니다!";
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>(이)가 <C>".GetStuffName($stuff)."</>(을)를 판다는 소문이 돌고 있습니다!";
|
||||
$josaYi = JosaUtil::pick(GetStuffName($stuff), '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<C>".GetStuffName($stuff)."</>{$josaYi} 거래장에 등장했습니다!";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($stuff), '을');
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>이 <C>".GetStuffName($stuff)."</>{$josaUl} 판다는 소문이 돌고 있습니다!";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
@@ -142,6 +143,7 @@ function registerAuction() {
|
||||
|
||||
function processAuction() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$trader = [];
|
||||
@@ -153,9 +155,7 @@ function processAuction() {
|
||||
|
||||
$date = date("Y-m-d H:i:s");
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select * from auction where expire<='$date'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -164,10 +164,14 @@ function processAuction() {
|
||||
for($i=0; $i < $count2; $i++) {
|
||||
$auction = MYDB_fetch_array($result2);
|
||||
|
||||
$josaYi1 = JosaUtil::pick($auction['name1'], '이');
|
||||
$josaYi2 = JosaUtil::pick($auction['name2'], '이');
|
||||
|
||||
// 유닉템 처리
|
||||
if($auction['stuff'] != 0) {
|
||||
if($auction['no2'] == 0) {
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, 그러나 입찰자 부재";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>{$josaUl} 판매, 그러나 입찰자 부재";
|
||||
pushAuctionLog($auctionLog);
|
||||
} else {
|
||||
$trader['no'] = 0;
|
||||
@@ -196,7 +200,9 @@ function processAuction() {
|
||||
if($count > 0) {
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 아이템 이미 매진!";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 아이템 이미 매진!";
|
||||
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
@@ -206,18 +212,23 @@ function processAuction() {
|
||||
|
||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, <C>".GetStuffName($auction['stuff'])."</> 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 구매";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, <C>".GetStuffName($auction['stuff'])."</> 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||
$auctionLog[0] .= " <M>★ 아이템 거래 ★</>";
|
||||
|
||||
$query = "update general set gold=gold-'{$auction['value']}',{$type}='$sel2' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$auction['name2']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 구매했습니다!";
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>{$auction['name2']}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 구매했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$auction['name2']}</>{$josaYi2} <C>".GetStuffName($auction['stuff'])."</>$josaUl 구매했습니다!";
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>{$auction['name2']}</>{$josaYi2} <C>".GetStuffName($auction['stuff'])."</>$josaUl 구매했습니다!";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
@@ -236,9 +247,11 @@ function processAuction() {
|
||||
|
||||
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
if($auction['type'] == 0) {
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, 그러나 입찰자 부재";
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 그러나 입찰자 부재";
|
||||
} else {
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, 그러나 입찰자 부재";
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, 그러나 입찰자 부재";
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
@@ -267,9 +280,11 @@ function processAuction() {
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
@@ -277,13 +292,18 @@ function processAuction() {
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, 쌀 <C>{$auction['amount']}</>(을)를 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 구매";
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] >= $auction['topv']) {
|
||||
@@ -308,9 +328,11 @@ function processAuction() {
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $trader['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$trader['gold'] -= $gold;
|
||||
@@ -318,13 +340,18 @@ function processAuction() {
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, 쌀 <C>{$auction['amount']}</>(을)를 구입!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction['name2']}</>(이)가 금 <C>{$auction['value']}</>(으)로 판매";
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 판매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||
|
||||
+50
-40
@@ -79,7 +79,8 @@ function getTurn(array $general, $type, $font=1) {
|
||||
case 16: //전쟁
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 출병";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$str[$i] = "【{$city['name']}】{$josaRo} 출병";
|
||||
break;
|
||||
case 17: //소집해제
|
||||
$str[$i] = "소집 해제";
|
||||
@@ -88,7 +89,8 @@ function getTurn(array $general, $type, $font=1) {
|
||||
case 21: //이동
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 이동";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$str[$i] = "【{$city['name']}】{$josaRo} 이동";
|
||||
break;
|
||||
case 22: //등용
|
||||
$double = $command[1];
|
||||
@@ -97,7 +99,8 @@ function getTurn(array $general, $type, $font=1) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
$str[$i] = "【{$general['name']}】(을)를 등용";
|
||||
$josaUl = JosaUtil::pick($general['name'], '을');
|
||||
$str[$i] = "【{$general['name']}】{$josaUl} 등용";
|
||||
break;
|
||||
case 25: //임관
|
||||
$double = $command[1];
|
||||
@@ -106,7 +109,8 @@ function getTurn(array $general, $type, $font=1) {
|
||||
|
||||
if(!$nation['name']) { $nation['name'] = '????'; }
|
||||
|
||||
$str[$i] = "【{$nation['name']}】(으)로 임관";
|
||||
$josaRo = JosaUtil::pick($nation['name'], '로');
|
||||
$str[$i] = "【{$nation['name']}】{$josaRo} 임관";
|
||||
break;
|
||||
case 26: //집합
|
||||
$str[$i] = "집합";
|
||||
@@ -120,7 +124,8 @@ function getTurn(array $general, $type, $font=1) {
|
||||
case 30: //강행
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 강행";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$str[$i] = "【{$city['name']}】{$josaRo} 강행";
|
||||
break;
|
||||
|
||||
case 31: //첩보
|
||||
@@ -178,11 +183,10 @@ function getTurn(array $general, $type, $font=1) {
|
||||
$str[$i] = "하야";
|
||||
break;
|
||||
case 46: //건국
|
||||
$query = "select makenation from general where no='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$nationName = $db->queryFirstField('SELECT makenation FROM general WHERE `no`=%i', $general['no'])??'';
|
||||
|
||||
$str[$i] = "【{$general['makenation']}】(을)를 건국";
|
||||
$josaUl = JosaUtil::pick($nationName, '을');
|
||||
$str[$i] = "【{$nationName}】{$josaUl} 건국";
|
||||
break;
|
||||
case 47: //방랑
|
||||
$str[$i] = "방랑";
|
||||
@@ -198,13 +202,17 @@ function getTurn(array $general, $type, $font=1) {
|
||||
} elseif($double == 300) {
|
||||
$str[$i] = "도구를 판매";
|
||||
} elseif($double < 100) {
|
||||
$str[$i] = "【".getWeapName($double)."】(을)를 구입";
|
||||
$josaUl = JosaUtil::pick(getWeapName($double), '을');
|
||||
$str[$i] = "【".getWeapName($double)."】{$josaUl} 구입";
|
||||
} elseif($double < 200) {
|
||||
$str[$i] = "【".getBookName($double-100)."】(을)를 구입";
|
||||
$josaUl = JosaUtil::pick(getBookName($double-100), '을');
|
||||
$str[$i] = "【".getBookName($double-100)."】{$josaUl} 구입";
|
||||
} elseif($double < 300) {
|
||||
$str[$i] = "【".getHorseName($double-200)."】(을)를 구입";
|
||||
$josaUl = JosaUtil::pick(getHorseName($double-200), '을');
|
||||
$str[$i] = "【".getHorseName($double-200)."】{$josaUl} 구입";
|
||||
} elseif($double < 400) {
|
||||
$str[$i] = "【".getItemName($double-300)."】(을)를 구입";
|
||||
$josaUl = JosaUtil::pick(getItemName($double-300), '을');
|
||||
$str[$i] = "【".getItemName($double-300)."】{$josaUl} 구입";
|
||||
}
|
||||
break;
|
||||
case 49: //군량 매매
|
||||
@@ -287,8 +295,8 @@ function getCoreTurn($nation, $level) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if($fourth == 1) { $str[$i] = "【{$general['name']}】에게 금 {$double}00을 포상"; }
|
||||
else { $str[$i] = "【{$general['name']}】에게 쌀 {$double}00을 포상"; }
|
||||
if($fourth == 1) { $str[$i] = "【{$general['name']}】에게 금 {$double}00 포상"; }
|
||||
else { $str[$i] = "【{$general['name']}】에게 쌀 {$double}00 포상"; }
|
||||
break;
|
||||
case 24: //몰수
|
||||
$fourth = $command[3];
|
||||
@@ -299,8 +307,8 @@ function getCoreTurn($nation, $level) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if($fourth == 1) { $str[$i] = "【{$general['name']}】에게서 금 {$double}00을 몰수"; }
|
||||
else { $str[$i] = "【{$general['name']}】에게서 쌀 {$double}00을 몰수"; }
|
||||
if($fourth == 1) { $str[$i] = "【{$general['name']}】의 금 {$double}00 몰수"; }
|
||||
else { $str[$i] = "【{$general['name']}】의 쌀 {$double}00 몰수"; }
|
||||
break;
|
||||
case 27: //발령
|
||||
$third = $command[2];
|
||||
@@ -310,8 +318,8 @@ function getCoreTurn($nation, $level) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$city = getCity($double, "name");
|
||||
|
||||
$str[$i] = "【{$general['name']}】【{$city['name']}】(으)로 발령";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$str[$i] = "【{$general['name']}】【{$city['name']}】{$josaRo} 발령";
|
||||
break;
|
||||
case 51: //항복권고
|
||||
$double = (int)$command[1];
|
||||
@@ -332,15 +340,13 @@ function getCoreTurn($nation, $level) {
|
||||
$str[$i] = "【{$nation['name']}】에게 국고 {$third} 병량 {$fourth} 원조";
|
||||
break;
|
||||
case 53: //통합제의
|
||||
$query = "select makenation from general where level='$level' and nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$nationName = $db->queryFirstField('SELECT makenation FROM general WHERE `level`=%i AND `nation`=%i', $level, $nation['nation'])??'';
|
||||
|
||||
$double = (int)$command[1];
|
||||
|
||||
$nation = getNationStaticInfo($double);
|
||||
|
||||
$str[$i] = "【{$nation['name']}】에 【{$general['makenation']}】(으)로 통합 제의";
|
||||
$josaRo = JosaUtil::pick($nationName, '로');
|
||||
$str[$i] = "【{$nation['name']}】에 【{$nationName}】{$josaRo} 통합 제의";
|
||||
break;
|
||||
case 61: //불가침제의
|
||||
$third = $command[2];
|
||||
@@ -374,22 +380,26 @@ function getCoreTurn($nation, $level) {
|
||||
case 65: //초토
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 초토화";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$str[$i] = "【{$city['name']}】{$josaUl} 초토화";
|
||||
break;
|
||||
case 66: //천도
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 천도";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$str[$i] = "【{$city['name']}】{$josaRo} 천도";
|
||||
break;
|
||||
case 67: //증축
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 증축";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$str[$i] = "【{$city['name']}】{$josaUl} 증축";
|
||||
break;
|
||||
case 68: //감축
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 감축";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$str[$i] = "【{$city['name']}】{$josaUl} 감축";
|
||||
break;
|
||||
case 71: //필사즉생
|
||||
$str[$i] = "필사즉생";
|
||||
@@ -402,7 +412,8 @@ function getCoreTurn($nation, $level) {
|
||||
case 73: //수몰
|
||||
$double = $command[1];
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 수몰";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$str[$i] = "【{$city['name']}】{$josaUl} 수몰";
|
||||
break;
|
||||
case 74: //허보
|
||||
$double = $command[1];
|
||||
@@ -457,28 +468,27 @@ function getCoreTurn($nation, $level) {
|
||||
function processCommand($no) {
|
||||
$session = Session::getInstance();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,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 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select month,killturn from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
list($month, $killturn) = $gameStor->getValuesAsArray(['month', 'killturn']);
|
||||
$log = [];
|
||||
|
||||
// 블럭자는 미실행. 삭턴 감소
|
||||
if($general['block'] == 2) {
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 멀티, 또는 비매너로 인한<R>블럭</> 대상자입니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$month}월:현재 멀티, 또는 비매너로 인한<R>블럭</> 대상자입니다. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$query = "update general set recturn='',resturn='BLOCK_2',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($general['block'] == 3) {
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 악성유저로 분류되어 <R>블럭, 발언권 무효</> 대상자입니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$month}월:현재 악성유저로 분류되어 <R>블럭, 발언권 무효</> 대상자입니다. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
|
||||
$query = "update general set recturn='',resturn='BLOCK_3',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
@@ -523,21 +533,21 @@ function processCommand($no) {
|
||||
}
|
||||
|
||||
//장수정보 재로드
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,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 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
//삭턴 처리
|
||||
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
|
||||
if($general['npc'] >= 2 || $general['killturn'] > $killturn) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($command[0] == 0) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$admin['killturn']}' where no='{$general['no']}'";
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$killturn}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
|
||||
@@ -551,7 +561,7 @@ function processCommand($no) {
|
||||
switch($command[0]) {
|
||||
case 0: //휴식
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$log[] = "<C>●</>{$admin['month']}월:아무것도 실행하지 않았습니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$month}월:아무것도 실행하지 않았습니다. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
break;
|
||||
case 1: process_1($general, 1); break; //농업
|
||||
|
||||
@@ -284,19 +284,19 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
function getCall($leader, $power, $intel) {
|
||||
$call = '평범';
|
||||
if($leader >= GameConst::$goodgenleader && $power >= GameConst::$goodgenpower && $intel >= GameConst::$goodgenintel) {
|
||||
if($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '만능';
|
||||
} elseif($leader >= GameConst::$goodgenleader && $power >= GameConst::$goodgenpower) {
|
||||
} elseif($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin) {
|
||||
$call = '용장';
|
||||
} elseif($leader >= GameConst::$goodgenleader && $intel >= GameConst::$goodgenintel) {
|
||||
} elseif($leader >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '지장';
|
||||
} elseif($power >= GameConst::$goodgenpower && $intel >= GameConst::$goodgenintel) {
|
||||
} elseif($power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
||||
$call = '명장';
|
||||
} elseif($leader >= GameConst::$goodgenleader) {
|
||||
} elseif($leader >= GameConst::$chiefStatMin) {
|
||||
$call = '명사';
|
||||
} elseif($power >= GameConst::$goodgenpower) {
|
||||
} elseif($power >= GameConst::$chiefStatMin) {
|
||||
$call = '용맹';
|
||||
} elseif($intel >= GameConst::$goodgenintel) {
|
||||
} elseif($intel >= GameConst::$chiefStatMin) {
|
||||
$call = '현명';
|
||||
}
|
||||
return $call;
|
||||
|
||||
+91
-150
@@ -5,77 +5,8 @@ namespace sammo;
|
||||
* 게임 룰에 해당하는 함수 모음
|
||||
*/
|
||||
|
||||
// 37.5 ~ 75
|
||||
function abilityRand() {
|
||||
$total = 150;
|
||||
$leader = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$power = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$intel = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$rate = $leader + $power + $intel;
|
||||
$leader = intdiv($leader * $total, $rate);
|
||||
$power = intdiv($power * $total, $rate);
|
||||
$intel = intdiv($intel * $total, $rate);
|
||||
|
||||
while($leader+$power+$intel < 150) {
|
||||
$leader++;
|
||||
}
|
||||
|
||||
return array('leader' => $leader, 'power' => $power, 'intel' => $intel);
|
||||
}
|
||||
|
||||
// 14 ~ 75
|
||||
function abilityLeadpow() {
|
||||
$total = 150;
|
||||
$leader = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$power = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$intel = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$rate = $leader + $power + $intel;
|
||||
$leader = intdiv($leader * $total, $rate);
|
||||
$power = intdiv($power * $total, $rate);
|
||||
$intel = intdiv($intel * $total, $rate);
|
||||
|
||||
while($leader+$power+$intel < 150) {
|
||||
$leader++;
|
||||
}
|
||||
|
||||
return array('leader' => $leader, 'power' => $power, 'intel' => $intel);
|
||||
}
|
||||
|
||||
function abilityLeadint() {
|
||||
$total = 150;
|
||||
$leader = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$power = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$intel = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$rate = $leader + $power + $intel;
|
||||
$leader = intdiv($leader * $total, $rate);
|
||||
$power = intdiv($power * $total, $rate);
|
||||
$intel = intdiv($intel * $total, $rate);
|
||||
|
||||
while($leader+$power+$intel < 150) {
|
||||
$leader++;
|
||||
}
|
||||
|
||||
return array('leader' => $leader, 'power' => $power, 'intel' => $intel);
|
||||
}
|
||||
|
||||
function abilityPowint() {
|
||||
$total = 150;
|
||||
$leader = (rand()%100 + 1) / 100.0 + 1.0;
|
||||
$power = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$intel = (rand()%100 + 1) / 100.0 + 6.0;
|
||||
$rate = $leader + $power + $intel;
|
||||
$leader = intdiv($leader * $total, $rate);
|
||||
$power = intdiv($power * $total, $rate);
|
||||
$intel = intdiv($intel * $total, $rate);
|
||||
|
||||
while($leader+$power+$intel < 150) {
|
||||
$leader++;
|
||||
}
|
||||
|
||||
return array('leader' => $leader, 'power' => $power, 'intel' => $intel);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 게임 내부에 사용하는 유틸리티 함수들을 분리
|
||||
*/
|
||||
|
||||
@@ -245,45 +176,47 @@ function SetNationFront($nationNo) {
|
||||
|
||||
function checkSupply() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$cities = [];
|
||||
foreach($db->query('SELECT city, nation FROM city WHERE nation != 0') as $city){
|
||||
$cities[$city['city']] = [
|
||||
'id'=>$city['city'],
|
||||
'nation'=>$city['nation'],
|
||||
'supply'=>false
|
||||
];
|
||||
$newCity = new \stdClass();
|
||||
$newCity->id = Util::toInt($city['city']);
|
||||
$newCity->nation = Util::toInt($city['nation']);
|
||||
$newCity->supply = false;
|
||||
|
||||
$cities[$newCity->id] = $newCity;
|
||||
}
|
||||
|
||||
$queue = new \SplQueue();
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
$capitalID = $nation['capital'];
|
||||
if(!$capitalID){
|
||||
foreach($db->queryAllLists('SELECT capital, nation FROM nation WHERE `level` > 0') as list($capitalID, $nationID)){
|
||||
if(!key_exists($capitalID, $cities)){
|
||||
continue;
|
||||
}
|
||||
$city = &$cities[$capitalID];
|
||||
$city['supply'] = true;
|
||||
$queue->enqueue($city['id']);
|
||||
$city = $cities[$capitalID];
|
||||
if($nationID != $city->nation){
|
||||
continue;
|
||||
}
|
||||
$city->supply = true;
|
||||
$queue->enqueue($city);
|
||||
}
|
||||
|
||||
while(!$queue->isEmpty()){
|
||||
$cityID = $queue->dequeue();
|
||||
$city = &$cities[$cityID];
|
||||
$cityLink = $queue->dequeue();
|
||||
$city = CityConst::byID($cityLink->id);
|
||||
|
||||
foreach(array_keys(CityConst::byID($cityID)->path) as $connCityID){
|
||||
foreach(array_keys($city->path) as $connCityID){
|
||||
if(!key_exists($connCityID, $cities)){
|
||||
continue;
|
||||
}
|
||||
$connCity = &$cities[$connCityID];
|
||||
if($connCity['nation'] != $city['nation']){
|
||||
$connCity = $cities[$connCityID];
|
||||
if($connCity->nation != $cityLink->nation){
|
||||
continue;
|
||||
}
|
||||
if($connCity['supply']){
|
||||
if($connCity->supply){
|
||||
continue;
|
||||
}
|
||||
$connCity['supply'] = true;
|
||||
$queue->enqueue($connCity['id']);
|
||||
$connCity->supply = true;
|
||||
$queue->enqueue($connCity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,15 +224,15 @@ function checkSupply() {
|
||||
'supply'=>1
|
||||
], 'nation=0');
|
||||
|
||||
$db->update('city',[
|
||||
'supply'=>0
|
||||
], 'nation!=0');
|
||||
|
||||
$supply = [];
|
||||
$unsupply = [];
|
||||
|
||||
foreach($cities as $city){
|
||||
if($city['supply']){
|
||||
$supply[] = $city['id'];
|
||||
}
|
||||
else{
|
||||
$unsupply[] = $city['id'];
|
||||
if($city->supply){
|
||||
$supply[] = $city->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,11 +242,6 @@ function checkSupply() {
|
||||
], 'city IN %li', $supply);
|
||||
}
|
||||
|
||||
if($unsupply){
|
||||
$db->update('city', [
|
||||
'supply'=>0
|
||||
], 'city IN %li', $unsupply);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -338,6 +266,7 @@ function updateQuaterly() {
|
||||
// 벌점 감소와 건국제한-1 전턴제한-1 외교제한-1, 1달마다 실행, 병사 있는 장수의 군량 감소, 수입비율 조정
|
||||
function preUpdateMonthly() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
//연감 월결산
|
||||
@@ -346,9 +275,7 @@ function preUpdateMonthly() {
|
||||
|
||||
if($result == false) { return false; }
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
//배신 횟수 최대 10회 미만
|
||||
$query = "update general set betray=9 where betray>9";
|
||||
@@ -379,7 +306,8 @@ function preUpdateMonthly() {
|
||||
$query = "update general set level=1 where no='{$city['gen1']}' or no='{$city['gen2']}' or no='{$city['gen3']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【고립】</b></><G><b>{$city['name']}</b></>(이)가 보급이 끊겨 <R>미지배</> 도시가 되었습니다.";
|
||||
$josaYi = JosaUtil::pick($city['name'], '이');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【고립】</b></><G><b>{$city['name']}</b></>{$josaYi} 보급이 끊겨 <R>미지배</> 도시가 되었습니다.";
|
||||
}
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
//민심30이하 공백지 처리
|
||||
@@ -428,8 +356,10 @@ function preUpdateMonthly() {
|
||||
$ratio = 100;
|
||||
// 20 ~ 140원
|
||||
$develcost = ($admin['year'] - $admin['startyear'] + 10) * 2;
|
||||
$query = "update game set gold_rate='$ratio',rice_rate='$ratio',city_rate='$rate',develcost='$develcost'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->gold_rate = $ratio;
|
||||
$gameStor->rice_rate = $ratio;
|
||||
$gameStor->city_rate = $rate;
|
||||
$gameStor->develcost = $develcost;
|
||||
|
||||
//매달 사망자 수입 결산
|
||||
processDeadIncome($ratio);
|
||||
@@ -490,11 +420,10 @@ function preUpdateMonthly() {
|
||||
// 외교 로그처리, 외교 상태 처리
|
||||
function postUpdateMonthly() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario']);
|
||||
|
||||
$history = [];
|
||||
|
||||
@@ -582,7 +511,10 @@ group by A.nation
|
||||
$name1 = $nation1['name'];
|
||||
$nation2 = getNationStaticInfo($dip['you']);
|
||||
$name2 = $nation2['name'];
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【개전】</b></><D><b>$name1</b></>(와)과 <D><b>$name2</b></>(이)가 <R>전쟁</>을 시작합니다.";
|
||||
|
||||
$josaYi = JosaUtil::pick($name2, '이');
|
||||
$josaWa = JosaUtil::pick($name1, '와');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【개전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <R>전쟁</>을 시작합니다.";
|
||||
}
|
||||
//휴전국 로그
|
||||
$query = "select A.me as me,A.you as you,A.term as term1,B.term as term2 from diplomacy A, diplomacy B where A.me=B.you and A.you=B.me and A.state='0' and A.me<A.you";
|
||||
@@ -597,7 +529,10 @@ group by A.nation
|
||||
$name1 = $nation1['name'];
|
||||
$nation2 = getNationStaticInfo($dip['you']);
|
||||
$name2 = $nation2['name'];
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【휴전】</b></><D><b>$name1</b></>(와)과 <D><b>$name2</b></>(이)가 <S>휴전</>합니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($name1, '와');
|
||||
$josaYi = JosaUtil::pick($name2, '이');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.";
|
||||
//기한 되면 휴전으로
|
||||
$query = "update diplomacy set state='2',term='0' where (me='{$dip['me']}' and you='{$dip['you']}') or (me='{$dip['you']}' and you='{$dip['me']}')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -644,11 +579,10 @@ group by A.nation
|
||||
|
||||
function checkWander() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$needRefresh = false;
|
||||
|
||||
@@ -675,15 +609,14 @@ function checkWander() {
|
||||
|
||||
function checkMerge() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$mylog = [];
|
||||
$youlog = [];
|
||||
$history = [];
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select * from diplomacy where state='3' and term='0'";
|
||||
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -722,29 +655,34 @@ function checkMerge() {
|
||||
$query = "select no,name,nation from general where nation='{$you['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$genlog = ["<C>●</><D><b>{$mynation['name']}</b></>(와)과 통합에 성공했습니다."];
|
||||
$josaWa = JosaUtil::pick($mynation['name'], '와');
|
||||
$genlog = ["<C>●</><D><b>{$mynation['name']}</b></>{$josaWa} 통합에 성공했습니다."];
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>과 <D><b>{$you['makenation']}</b></>로 통합에 성공");
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaWa} <D><b>{$you['makenation']}</b></>로 통합에 성공");
|
||||
}
|
||||
//항복국 장수들 역사 기록 및 로그 전달
|
||||
$query = "select no,name,nation from general where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount2 = MYDB_num_rows($result);
|
||||
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 통합에 성공했습니다.";
|
||||
$josaWa = JosaUtil::pick($younation['name'], '와');
|
||||
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>{$josaWa} 통합에 성공했습니다.";
|
||||
for($i=0; $i < $gencount2; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>과 <D><b>{$you['makenation']}</b></>로 통합에 성공");
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>{$josaWa} <D><b>{$you['makenation']}</b></>로 통합에 성공");
|
||||
}
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통합】</b></><D><b>{$mynation['name']}</b></>(와)과 <D><b>{$younation['name']}</b></>(이)가 <D><b>{$you['makenation']}</b></>(으)로 통합하였습니다.";
|
||||
$josaRo = JosaUtil::pick($you['makenation'], '로');
|
||||
$josaYi = JosaUtil::pick($younation['name'], '이');
|
||||
$josaWa = JosaUtil::pick($mynation['name'], '와');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통합】</b></><D><b>{$mynation['name']}</b></>{$josaWa} <D><b>{$younation['name']}</b></>{$josaYi} <D><b>{$you['makenation']}</b></>{$josaRo} 통합하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>【혼란】</b></>통합에 반대하는 세력들로 인해 <D><b>{$you['makenation']}</b></>에 혼란이 일고 있습니다.";
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>과 <D><b>{$you['makenation']}</b></>로 통합");
|
||||
|
||||
$newGenCount = $gencount + $gencount2;
|
||||
if($newGenCount < 10) { $newGenCount = 10; }
|
||||
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
|
||||
$newTotalTech = $younation['totaltech'] + $mynation['totaltech'];
|
||||
$newTech = Util::round($newTotalTech / $newGenCount);
|
||||
// 자금 통합, 외교제한 5년, 기술유지
|
||||
@@ -797,11 +735,10 @@ function checkMerge() {
|
||||
|
||||
function checkSurrender() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select * from diplomacy where state='5' and term='0'";
|
||||
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -849,23 +786,26 @@ function checkSurrender() {
|
||||
pushGenLog($gen, $genlog);
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></> 합병에 성공");
|
||||
}
|
||||
$josaRo = JosaUtil::pick($younation['name'], '로');
|
||||
//항복국 장수들 역사 기록 및 로그 전달
|
||||
$query = "select no,name,nation from general where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount2 = MYDB_num_rows($result);
|
||||
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>(으)로 항복하여 수도로 이동합니다.";
|
||||
$genlog[0] = "<C>●</><D><b>{$younation['name']}</b></>{$josaRo} 항복하여 수도로 이동합니다.";
|
||||
for($i=0; $i < $gencount2; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>가 <D><b>{$younation['name']}</b></>(으)로 항복");
|
||||
pushGeneralHistory($gen, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>가 <D><b>{$younation['name']}</b></>{$josaRo} 항복");
|
||||
}
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【투항】</b></><D><b>{$mynation['name']}</b></> (이)가 <D><b>{$younation['name']}</b></>(으)로 항복하였습니다.";
|
||||
$josaYi = JosaUtil::pick($mynation['name'], '이');
|
||||
$josaWa = JosaUtil::pick($mynation['name'], '와');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【투항】</b></><D><b>{$mynation['name']}</b></>{$josaYi} <D><b>{$younation['name']}</b></>{$josaRo} 항복하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>【혼란】</b></>통합에 반대하는 세력들로 인해 <D><b>{$younation['name']}</b></>에 혼란이 일고 있습니다.";
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 합병");
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaWa} 합병");
|
||||
|
||||
$newGenCount = $gencount + $gencount2;
|
||||
if($newGenCount < 10) { $newGenCount = 10; }
|
||||
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
|
||||
$newTotalTech = $younation['totaltech'] + $mynation['totaltech'];
|
||||
$newTech = Util::round($newTotalTech / $newGenCount);
|
||||
// 자금 통합, 외교제한 5년, 기술유지
|
||||
@@ -921,12 +861,11 @@ function checkSurrender() {
|
||||
|
||||
function updateNationState() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$history = array();
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select nation,name,level from nation";
|
||||
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -966,8 +905,9 @@ function updateNationState() {
|
||||
|
||||
switch($nationlevel) {
|
||||
case 7:
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【작위】</b></><D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>(을)를 자칭하였습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>(을)를 자칭");
|
||||
$josaUl = JosaUtil::pick(getNationLevel($nationlevel), '을');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【작위】</b></><D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>{$josaUl} 자칭하였습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>{$josaUl} 자칭");
|
||||
break;
|
||||
case 6:
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【작위】</b></><D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>에 등극하였습니다.";
|
||||
@@ -992,7 +932,7 @@ function updateNationState() {
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
//기술 및 변경횟수 업데이트
|
||||
$query = "update nation set tech=totaltech/'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1002,11 +942,10 @@ function updateNationState() {
|
||||
|
||||
function checkStatistic() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nationHists = [];
|
||||
$specialHists = [];
|
||||
@@ -1158,17 +1097,16 @@ function checkStatistic() {
|
||||
|
||||
function checkEmperior() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,isUnited from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'isunited']);
|
||||
|
||||
$query = "select nation,name from nation where level>0";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
if($count == 1 && $admin['isUnited'] == 0) {
|
||||
if($count == 1 && $admin['isunited'] == 0) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
@@ -1180,10 +1118,13 @@ function checkEmperior() {
|
||||
$allcount = MYDB_num_rows($result);
|
||||
|
||||
if($count == $allcount) {
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>(이)가 전토를 통일");
|
||||
|
||||
$query = "update game set isUnited=2,conlimit=conlimit*100";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaYi = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일");
|
||||
|
||||
$gameStor->isunited = 2;
|
||||
$gameStor->conlimit = $gameStor->conlimit*100;
|
||||
|
||||
$query = "select no from general where npc<2 and age>=45";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1259,7 +1200,7 @@ function checkEmperior() {
|
||||
}
|
||||
}
|
||||
|
||||
$log = ["<C>●</>{$admin['year']}년 {$admin['month']}월: <D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
|
||||
$log = ["<C>●</>{$admin['year']}년 {$admin['month']}월: <D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
|
||||
|
||||
$query = "select no,name from general where nation='{$nation['nation']}' order by dedication desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1337,7 +1278,7 @@ function checkEmperior() {
|
||||
'history'=>$nationHistory
|
||||
]);
|
||||
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
|
||||
//연감 월결산
|
||||
|
||||
+9
-10
@@ -151,10 +151,9 @@ function pushWorldHistory(array $history, $year=null, $month=null) {
|
||||
return;
|
||||
}
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($year === null || $month === null){
|
||||
$game = $db->queryFirstRow('SELECT year, month FROM game LIMIT 1');
|
||||
$year = $game['year'];
|
||||
$month = $game['month'];
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
}
|
||||
$request = array_map(function($text) use ($year, $month) {
|
||||
return ['year'=>$year, 'month'=>$month, 'text'=>$text];
|
||||
@@ -199,10 +198,9 @@ function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
|
||||
return;
|
||||
}
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($year === null || $month === null){
|
||||
$game = $db->queryFirstRow('SELECT year, month FROM game LIMIT 1');
|
||||
$year = $game['year'];
|
||||
$month = $game['month'];
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
}
|
||||
$request = array_map(function($text) use ($year, $month) {
|
||||
return ['year'=>$year, 'month'=>$month, 'text'=>$text];
|
||||
@@ -249,7 +247,8 @@ function LogHistory($isFirst=0) {
|
||||
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', LogHistory Start');
|
||||
|
||||
$db = DB::db();
|
||||
$obj = $db->queryFirstRow('SELECT year, month, startyear FROM game limit 1');
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$obj = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
//TODO: 새롭게 추가할 지도 값 받아오는 함수를 이용하여 재구성
|
||||
$map = getWorldMap([
|
||||
@@ -291,9 +290,9 @@ function LogHistory($isFirst=0) {
|
||||
$cityCount = $db->queryFirstField('select count(*) from city where nation = %i',$nation['nation']);
|
||||
|
||||
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
|
||||
$powerStr .= "국력 {$nation['power']}<br>";
|
||||
$genStr .= "장수 {$nation['gennum']}<br>";
|
||||
$cityStr .= "속령 $cityCount<br>";
|
||||
$powerStr .= "{$nation['power']}<br>";
|
||||
$genStr .= "{$nation['gennum']}<br>";
|
||||
$cityStr .= "$cityCount<br>";
|
||||
}
|
||||
|
||||
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
|
||||
|
||||
+9
-14
@@ -9,8 +9,8 @@ function printLimitMsg($turntime) {
|
||||
<head>
|
||||
<title>접속제한</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
|
||||
<link rel='stylesheet' href='css/common.css' type='text/css'>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<font size=4><b>
|
||||
@@ -28,15 +28,11 @@ function bar($per, $h=7) {
|
||||
else { $bd = 1; $h = 12; $h2 = 8; }
|
||||
|
||||
$per = round($per, 1);
|
||||
if($per < 1 || $per > 99) { $per = Util::round($per); }
|
||||
$str1 = "<td width='{$per}%' background=".ServConfig::$gameImagePath."/pb{$h2}.gif></td>";
|
||||
$str2 = "<td width='*%' background=".ServConfig::$gameImagePath."/pr{$h2}.gif></td>";
|
||||
if($per <= 0) { $str1 = ""; }
|
||||
elseif($per >= 100) { $str2 = ""; }
|
||||
$str = "
|
||||
<table width=100% height={$h} border={$bd} cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black>
|
||||
<tr>{$str1}{$str2}</tr>
|
||||
</table>";
|
||||
|
||||
$str = "<div class='bar_out' style='height:{$h2}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>";
|
||||
return $str;
|
||||
}
|
||||
|
||||
@@ -110,11 +106,10 @@ function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1) {
|
||||
|
||||
function info($type=0) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,turnterm,maxgeneral from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'turnterm', 'maxgeneral']);
|
||||
|
||||
$termtype = "{$admin['turnterm']}분 턴";
|
||||
|
||||
|
||||
+5
-4
@@ -54,11 +54,12 @@ function getWorldMap($req){
|
||||
$userID = $session->userID;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$game = $db->queryFirstRow('select `startyear`, `year`, `month` from `game` where `no` = 1');
|
||||
$startYear = Util::toInt($game['startyear']);
|
||||
$year = Util::toInt($game['year']);
|
||||
$month = Util::toInt($game['month']);
|
||||
list($startYear, $year, $month) = $gameStor->getValuesAsArray(['startyear', 'year', 'month']);
|
||||
$startYear = Util::toInt($startYear);
|
||||
$year = Util::toInt($year);
|
||||
$month = Util::toInt($month);
|
||||
|
||||
$general = $db->queryFirstRow(
|
||||
'select `no`, `city`, `nation` from `general` where `owner`=%i',
|
||||
|
||||
+42
-59
@@ -165,11 +165,10 @@ function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city
|
||||
|
||||
function processAI($no) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,turnterm,scenario,gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI00 ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate']);
|
||||
// 초반 여부
|
||||
if($admin['startyear']+2 > $admin['year'] || ($admin['startyear']+2 == $admin['year'] && $admin['month'] < 5)) {
|
||||
$isStart = 1;
|
||||
@@ -310,12 +309,11 @@ function processAI($no) {
|
||||
//재야인경우
|
||||
if($general['npc'] == 5 && $general['level'] == 0) {
|
||||
// 오랑캐는 바로 임관
|
||||
$query = "select nation from general where level=12 and npc=5 and nation not in (0{$general['nations']}0) order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$rulerCount = MYDB_num_rows($result);
|
||||
if($rulerCount > 0) {
|
||||
$ruler = MYDB_fetch_array($result);
|
||||
$command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
|
||||
|
||||
$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']));
|
||||
|
||||
if($ruler) {
|
||||
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
|
||||
} else {
|
||||
$command = EncodeCommand(0, 0, 0, 42); //견문
|
||||
}
|
||||
@@ -323,55 +321,38 @@ function processAI($no) {
|
||||
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
||||
return;
|
||||
} elseif($general['npc'] < 5 && $general['level'] == 0) {
|
||||
switch(rand()%5) {
|
||||
//임관 40%
|
||||
case 0: case 1:
|
||||
if($admin['scenario'] == 0 || $admin['scenario'] >= 20) {
|
||||
// 가상모드엔 랜덤임관, 초반엔 부상 적은 군주 우선 70%
|
||||
if($admin['startyear']+3 > $admin['year'] && rand()%100 < 70) {
|
||||
$query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by injury,rand() limit 0,1";
|
||||
} else {
|
||||
$query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by rand() limit 0,1";
|
||||
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
|
||||
//임관 10%
|
||||
case 0:
|
||||
|
||||
$available = true;
|
||||
|
||||
if($admin['startyear']+3 > $admin['year']){
|
||||
//초기 임관 기간에서는 국가가 적을수록 임관 시도가 적음
|
||||
$nationCnt = $db->queryFirstField('SELECT count(nation) FROM nation');
|
||||
$notFullNationCnt = $db->queryFirstField('SELECT count(nation) FROM nation WHERE gennum < %i', GameConst::$initialNationGenLimit);
|
||||
if($nationCnt == 0 || $notFullNationCnt == 0){
|
||||
$available = false;
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$rulerCount = MYDB_num_rows($result);
|
||||
if($rulerCount > 0 && $general['affinity'] != 999 && $general['makelimit'] == 0) {
|
||||
$ruler = MYDB_fetch_array($result);
|
||||
$command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
|
||||
} else {
|
||||
$command = EncodeCommand(0, 0, 0, 42); //견문
|
||||
}
|
||||
} else {
|
||||
$query = "select nation from general where level=12 and npc=0";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$nonCount = MYDB_num_rows($result);
|
||||
$query = "select nation from general where level=12 and npc>0";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$npcCount = MYDB_num_rows($result);
|
||||
$ratio = Util::round($npcCount / ($nonCount + $npcCount) * 100);
|
||||
$ratio = Util::round($ratio * 1.0);
|
||||
//NPC우선임관
|
||||
$query = "select nation,ABS(IF(ABS(affinity-'{$general['affinity']}')>75,150-ABS(affinity-'{$general['affinity']}'),ABS(affinity-'{$general['affinity']}'))) as npcmatch2 from general where level=12 and npc>0 and nation not in (0{$general['nations']}0) order by npcmatch2,rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$rulerCount = MYDB_num_rows($result);
|
||||
if($rulerCount > 0 && $general['affinity'] != 999 && rand()%100 < $ratio && $general['makelimit'] == 0) { // 엔국 비율대로 임관(50% : 50%)
|
||||
$ruler = MYDB_fetch_array($result);
|
||||
$command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
|
||||
} elseif($general['affinity'] != 999 && $general['makelimit'] == 0) { // NPC국가 없으면 유저국 임관
|
||||
$query = "select nation from general where level=12 and npc=0 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
|
||||
$ruler = MYDB_fetch_array($result);
|
||||
$command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
|
||||
} else {
|
||||
$command = EncodeCommand(0, 0, 0, 42); //견문
|
||||
else if(Util::randBool(pow(1 / $nationCnt / pow($notFullNationCnt, 3), 1/4))){
|
||||
//국가가 1개일 경우에는 '임관하지 않음'
|
||||
$available = false;
|
||||
}
|
||||
}
|
||||
|
||||
if($general['affinity'] == 999 || !$available){
|
||||
$command = EncodeCommand(0, 0, 0, 42); //견문
|
||||
}
|
||||
else{
|
||||
//랜임 커맨드 입력.
|
||||
$command = EncodeCommand(0, 0, 99, 25); //임관
|
||||
}
|
||||
break;
|
||||
case 2: case 3: //거병이나 견문 40%
|
||||
// 초반이면서 능력이 좋은놈 위주로 1%확률로 거병 (300명 재야시 2년간 약 10개 거병 예상)
|
||||
$prop = rand() % 100;
|
||||
$ratio = Util::round(($general['leader'] + $general['power'] + $general['intel']) / 3);
|
||||
if($admin['startyear']+2 > $admin['year'] && $prop < $ratio && rand()%100 < 1 && $general['makelimit'] == 0) {
|
||||
case 1: //거병이나 견문 40%
|
||||
// 초반이면서 능력이 좋은놈 위주로 1.4%확률로 거병
|
||||
$prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2;
|
||||
$ratio = ($general['leader'] + $general['power'] + $general['intel']) / 3;
|
||||
if($admin['startyear']+2 > $admin['year'] && $prop < $ratio && Util::randBool(0.014) && $general['makelimit'] == 0) {
|
||||
//거병
|
||||
$command = EncodeCommand(0, 0, 0, 55);
|
||||
} else {
|
||||
@@ -379,10 +360,13 @@ function processAI($no) {
|
||||
$command = EncodeCommand(0, 0, 0, 42);
|
||||
}
|
||||
break;
|
||||
case 4: //이동 20%
|
||||
case 2: //이동 20%
|
||||
$paths = explode("|", $city['path']);
|
||||
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
|
||||
break;
|
||||
default:
|
||||
$command = EncodeCommand(0, 0, 0, 42);
|
||||
break;
|
||||
}
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
||||
@@ -479,7 +463,7 @@ function processAI($no) {
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$youNation = MYDB_fetch_array($result);
|
||||
|
||||
if(isClose($general['nation'], $youNation['nation'])) {
|
||||
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),"");
|
||||
@@ -1045,13 +1029,12 @@ function processAI($no) {
|
||||
|
||||
function Promotion($nation, $level) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$lv = getNationChiefLevel($level);
|
||||
|
||||
$query = "select scenario,killturn from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI00 ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['scenario', 'killturn']);
|
||||
|
||||
//우선 수뇌 해제 (승상 뺴고)
|
||||
$query = "update general set level=1 where level<11 and level>4 and nation='$nation'";
|
||||
|
||||
+102
-110
@@ -187,6 +187,7 @@ function CriticalScore($score, $type) {
|
||||
|
||||
function process_1(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -194,9 +195,7 @@ function process_1(&$general, $type) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
if($type == 1) { $dtype = "농지 개간"; $atype = "을"; $btype = "은"; $stype = "agri"; }
|
||||
elseif($type == 2) { $dtype = "상업 투자"; $atype = "를"; $btype = "는"; $stype = "comm"; }
|
||||
@@ -288,6 +287,7 @@ function process_1(&$general, $type) {
|
||||
|
||||
function process_3(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -295,9 +295,7 @@ function process_3(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
$dtype = "기술 연구";
|
||||
|
||||
@@ -368,7 +366,7 @@ function process_3(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
// 내정 상승
|
||||
$query = "update nation set totaltech=totaltech+'$score',tech=totaltech/'$gencount' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -388,6 +386,7 @@ function process_3(&$general) {
|
||||
|
||||
function process_4(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -395,9 +394,7 @@ function process_4(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
$query = "select * from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -479,6 +476,7 @@ function process_4(&$general) {
|
||||
|
||||
function process_5(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -486,9 +484,7 @@ function process_5(&$general, $type) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
if($type == 1) { $dtype = "수비 강화"; $stype = "def"; }
|
||||
elseif($type == 2) { $dtype = "성벽 보수"; $stype = "wall"; }
|
||||
@@ -580,6 +576,7 @@ function process_5(&$general, $type) {
|
||||
|
||||
function process_7(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -587,9 +584,7 @@ function process_7(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
$query = "select * from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -671,6 +666,7 @@ function process_7(&$general) {
|
||||
|
||||
function process_8(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -678,9 +674,7 @@ function process_8(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost']);
|
||||
|
||||
$dtype = "치안"; $stype = "secu";
|
||||
|
||||
@@ -770,6 +764,7 @@ function process_8(&$general) {
|
||||
|
||||
function process_9(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -777,9 +772,7 @@ function process_9(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -860,6 +853,7 @@ function process_9(&$general) {
|
||||
|
||||
function process_11(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -870,9 +864,7 @@ function process_11(&$general, $type) {
|
||||
if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; }
|
||||
else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; }
|
||||
|
||||
$query = "select year,month,startyear from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select level,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1046,6 +1038,7 @@ function process_11(&$general, $type) {
|
||||
|
||||
function process_13(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1053,9 +1046,7 @@ function process_13(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -1115,6 +1106,7 @@ function process_13(&$general) {
|
||||
|
||||
function process_14(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1122,9 +1114,7 @@ function process_14(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -1177,6 +1167,7 @@ function process_14(&$general) {
|
||||
|
||||
function process_15(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1184,9 +1175,7 @@ function process_15(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select nation,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1250,6 +1239,7 @@ function process_15(&$general) {
|
||||
|
||||
function process_16(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1257,9 +1247,7 @@ function process_16(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select nation,war,sabotagelimit,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1291,26 +1279,27 @@ function process_16(&$general) {
|
||||
$nearCity = false;
|
||||
}
|
||||
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
if($admin['year'] < $admin['startyear']+3) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 초반 제한중입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 초반 제한중입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
// } elseif($city['supply'] == 0) {
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif(!$nearCity) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['crew'] <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['rice'] <= Util::round($general['crew']/100)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($dip['state'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:교전중인 국가가 아닙니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:교전중인 국가가 아닙니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != $city['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국에서만 출병가능합니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국에서만 출병가능합니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($nation['war'] == 1) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 전쟁 금지입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 전쟁 금지입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
process_21($general);
|
||||
return;
|
||||
@@ -1343,6 +1332,7 @@ function process_16(&$general) {
|
||||
|
||||
function process_17(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1350,9 +1340,7 @@ function process_17(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
if($general['crew'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 소집해제 실패. <1>$date</>";
|
||||
@@ -1384,6 +1372,7 @@ function process_17(&$general) {
|
||||
|
||||
function process_21(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1393,19 +1382,20 @@ function process_21(&$general) {
|
||||
|
||||
|
||||
$db = DB::db();
|
||||
$admin = $db->queryFirstRow('SELECT year, month, develcost FROM game limit 1');
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
$city = CityConst::byID($general['city']);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
$destCity = CityConst::byID($destination);
|
||||
|
||||
|
||||
$josaRo = JosaUtil::pick($destCity->name, '로');
|
||||
if(!key_exists($destCity->id, $city->path)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. <G><b>{$destCity->name}</b></>(으)로 이동 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. <G><b>{$destCity->name}</b></>{$josaRo} 이동 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 부족합니다. <G><b>{$destCity->name}</b></>(으)로 이동 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 부족합니다. <G><b>{$destCity->name}</b></>{$josaRo} 이동 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destCity->name}</b></>(으)로 이동했습니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destCity->name}</b></>{$josaRo} 이동했습니다. <1>$date</>";
|
||||
$exp = 50;
|
||||
|
||||
// 성격 보정
|
||||
@@ -1431,7 +1421,7 @@ function process_21(&$general) {
|
||||
'city'=>$destCity->id
|
||||
], 'nation = %i', $general['nation']);
|
||||
|
||||
$genlog = ["<C>●</>방랑군 세력이 <G><b>{$destCity->name}</b></>(으)로 이동했습니다."];
|
||||
$genlog = ["<C>●</>방랑군 세력이 <G><b>{$destCity->name}</b></>{$josaRo} 이동했습니다."];
|
||||
foreach($db->query('SELECT `no` FROM general WHERE nation=%i and `level`<12', $general['nation']) as $follower){
|
||||
pushGenLog($follower, $genlog);
|
||||
}
|
||||
@@ -1445,6 +1435,7 @@ function process_21(&$general) {
|
||||
|
||||
function process_26(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1454,9 +1445,7 @@ function process_26(&$general) {
|
||||
|
||||
$troop = getTroop($general['troop']);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select nation,name,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1484,7 +1473,8 @@ function process_26(&$general) {
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
//부대원에게 로그 전달
|
||||
$genlog = ["<C>●</><S>{$troop['name']}</>의 부대원들은 <G><b>{$city['name']}</b></>(으)로 집합되었습니다."];
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$genlog = ["<C>●</><S>{$troop['name']}</>의 부대원들은 <G><b>{$city['name']}</b></>{$josaRo} 집합되었습니다."];
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$troopgen = MYDB_fetch_array($result);
|
||||
@@ -1511,6 +1501,7 @@ function process_26(&$general) {
|
||||
|
||||
function process_28(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1520,9 +1511,7 @@ function process_28(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -1551,7 +1540,8 @@ function process_28(&$general) {
|
||||
$city = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G>{$city['name']}</>(으)로 귀환했습니다. <1>$date</>";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G>{$city['name']}</>{$josaRo} 귀환했습니다. <1>$date</>";
|
||||
$exp = 70;
|
||||
$ded = 100;
|
||||
|
||||
@@ -1577,6 +1567,7 @@ function process_28(&$general) {
|
||||
|
||||
function process_30(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1584,9 +1575,7 @@ function process_30(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$query = "select path from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1602,14 +1591,15 @@ function process_30(&$general) {
|
||||
|
||||
$cost = $admin['develcost'] * 5;
|
||||
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
if($destination == $general['city']){
|
||||
$log[] = "<C>●</>{$admin['month']}월:같은 도시입니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:같은 도시입니다. <G><b>{$destcity['name']}</b></>{$josaRo} 강행 실패. <1>$date</>";
|
||||
} elseif(!key_exists($destination, $dist)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:거리가 멉니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:거리가 멉니다. <G><b>{$destcity['name']}</b></>{$josaRo} 강행 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $cost) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 부족합니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 부족합니다. <G><b>{$destcity['name']}</b></>{$josaRo} 강행 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(으)로 강행했습니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 강행했습니다. <1>$date</>";
|
||||
$exp = 100;
|
||||
|
||||
// 성격 보정
|
||||
@@ -1630,7 +1620,7 @@ function process_30(&$general) {
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and level<'12'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$genlog = ["<C>●</>방랑군 세력이 <G><b>{$destcity['name']}</b></>(으)로 강행했습니다."];
|
||||
$genlog = ["<C>●</>방랑군 세력이 <G><b>{$destcity['name']}</b></>{$josaRo} 강행했습니다."];
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
@@ -1645,6 +1635,7 @@ function process_30(&$general) {
|
||||
|
||||
function process_31(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1653,9 +1644,7 @@ function process_31(&$general) {
|
||||
$date = substr($general['turntime'],11,5);
|
||||
$msg = [];
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$dist = searchDistance($general['city'], 2, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
@@ -1695,16 +1684,19 @@ function process_31(&$general) {
|
||||
}
|
||||
}
|
||||
if(!key_exists($destination, $dist)) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>{$josaUl} 살피는 것 같습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 소문만 들을 수 있었습니다. <1>$date</>";
|
||||
$log[] = "【<G>{$city['name']}</>】주민:{$city['pop']}, 민심:{$city['rate']}, 장수:$gencount, 병력:$crew";
|
||||
} elseif($dist[$destination] == 2) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>{$josaUl} 살피는 것 같습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 어느정도 정보를 얻었습니다. <1>$date</>";
|
||||
$log[] = "【<M>첩보</>】농업:{$city['agri']}, 상업:{$city['comm']}, 치안:{$city['secu']}, 수비:{$city['def']}, 성벽:{$city['wall']}";
|
||||
$log[] = "【<G>{$city['name']}</>】주민:{$city['pop']}, 민심:{$city['rate']}, 장수:$gencount, 병력:$crew";
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>{$josaUl} 살피는 것 같습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
|
||||
$msg[] = "【<S>병종</>】";
|
||||
|
||||
@@ -1786,6 +1778,7 @@ function process_31(&$general) {
|
||||
|
||||
function process_41(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1793,9 +1786,7 @@ function process_41(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$ratio = rand() % 100;
|
||||
$exp = $general['crew'] / 400;
|
||||
@@ -1855,6 +1846,7 @@ function process_41(&$general) {
|
||||
|
||||
function process_42(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1862,9 +1854,7 @@ function process_42(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$type = rand() % 27 + 1;
|
||||
$exp = 30;
|
||||
@@ -2076,6 +2066,7 @@ function process_42(&$general) {
|
||||
|
||||
function process_43(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$genlog = [];
|
||||
@@ -2084,9 +2075,7 @@ function process_43(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$what = $command[3];
|
||||
@@ -2167,6 +2156,7 @@ function process_43(&$general) {
|
||||
|
||||
function process_44(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2174,9 +2164,7 @@ function process_44(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "select name,gold,rice from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2258,6 +2246,7 @@ function process_44(&$general) {
|
||||
|
||||
function process_48(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2265,9 +2254,7 @@ function process_48(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$city = getCity($general['city']);
|
||||
|
||||
@@ -2305,45 +2292,53 @@ function process_48(&$general) {
|
||||
} else {
|
||||
if($isweap == 0) {
|
||||
if($type != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getWeapName($type)."</>(을)를 구입했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getWeapName($type), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getWeapName($type)."</>{$josaUl} 구입했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',weap='$type',gold=gold-'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$cost = Util::round(getItemCost($general['weap']) / 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getWeapName($general['weap'])."</>(을)를 판매했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getWeapName($general['weap']), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getWeapName($general['weap'])."</>{$josaUl} 판매했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',weap='0',gold=gold+'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
} elseif($isweap == 1) {
|
||||
if($type != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getBookName($type)."</>(을)를 구입했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getBookName($type), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getBookName($type)."</>{$josaUl} 구입했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',book='$type',gold=gold-'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$cost = Util::round(getItemCost($general['book']) / 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getBookName($general['book'])."</>(을)를 판매했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getBookName($general['book']), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getBookName($general['book'])."</>{$josaUl} 판매했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',book='0',gold=gold+'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
} elseif($isweap == 2) {
|
||||
if($type != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getHorseName($type)."</>(을)를 구입했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getHorseName($type), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getHorseName($type)."</>{$josaUl} 구입했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',horse='$type',gold=gold-'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$cost = Util::round(getItemCost($general['horse']) / 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getHorseName($general['horse'])."</>(을)를 판매했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getHorseName($general['horse']), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getHorseName($general['horse'])."</>{$josaUl} 판매했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',horse='0',gold=gold+'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
} elseif($isweap == 3) {
|
||||
if($type != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getItemName($type)."</>(을)를 구입했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getItemName($type), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getItemName($type)."</>{$josaUl} 구입했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',item='$type',gold=gold-'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$cost = Util::round(getItemCost2($general['item']) / 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getItemName($general['item'])."</>(을)를 판매했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick(getItemName($general['item']), '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<C>".getItemName($general['item'])."</>{$josaUl} 판매했습니다. <1>$date</>";
|
||||
$query = "update general set resturn='SUCCESS',item='0',gold=gold+'$cost' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
@@ -2366,6 +2361,7 @@ function process_48(&$general) {
|
||||
|
||||
function process_49(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2374,9 +2370,7 @@ function process_49(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -2503,6 +2497,7 @@ function process_49(&$general) {
|
||||
|
||||
function process_50(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2510,11 +2505,9 @@ function process_50(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$month = $gameStor->month;
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:건강 회복을 위해 요양합니다. <1>$date</>";
|
||||
$log[] = "<C>●</>{$month}월:건강 회복을 위해 요양합니다. <1>$date</>";
|
||||
// 경험치 상승 // 공헌도, 명성 상승
|
||||
$exp = 10;
|
||||
$ded = 7;
|
||||
@@ -2530,6 +2523,7 @@ function process_50(&$general) {
|
||||
|
||||
function process_99(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2537,9 +2531,7 @@ function process_99(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:아직 구현되지 않았습니다. <1>$date</>";
|
||||
|
||||
|
||||
+222
-185
@@ -3,6 +3,7 @@ namespace sammo;
|
||||
|
||||
function process_23(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$genlog = [];
|
||||
@@ -12,9 +13,7 @@ function process_23(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -105,6 +104,7 @@ function process_23(&$general) {
|
||||
|
||||
function process_24(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$genlog = [];
|
||||
@@ -113,9 +113,7 @@ function process_24(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,scenario,startyear from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','scenario','startyear']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -233,6 +231,7 @@ function process_24(&$general) {
|
||||
|
||||
function process_27(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -249,9 +248,7 @@ function process_27(&$general) {
|
||||
$who = $command[2];
|
||||
$where = $command[1];
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -282,8 +279,10 @@ function process_27(&$general) {
|
||||
} elseif($general['nation'] != $you['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국 장수가 아닙니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$you['name']}</>(을)를 <G><b>{$destcity['name']}</b></>(으)로 발령했습니다. <1>$date</>";
|
||||
$youlog[] = "<C>●</><Y>{$general['name']}</>에 의해 <G><b>{$destcity['name']}</b></>(으)로 발령됐습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick($you['name'], '을');
|
||||
$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;
|
||||
|
||||
@@ -310,8 +309,9 @@ function process_27(&$general) {
|
||||
function process_51(&$general) {
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
list($year, $month, $turnterm) = $gameStor->getValuesAsArray(['year','month','turnterm']);
|
||||
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 권고 실패. <1>$date</>"]);
|
||||
@@ -393,6 +393,7 @@ function process_51(&$general) {
|
||||
|
||||
function process_52(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -401,9 +402,7 @@ function process_52(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -463,14 +462,15 @@ function process_52(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
$genlog = ["<C>●</><D><b>{$younation['name']}</b></>(으)로 금<C>$gold</> 쌀<C>$rice</>을 지원했습니다."];
|
||||
$josaRo = JosaUtil::pick($younation['name'], '로');
|
||||
$genlog = ["<C>●</><D><b>{$younation['name']}</b></>{$josaRo} 금<C>$gold</> 쌀<C>$rice</>을 지원했습니다."];
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>(으)로 금<C>$gold</> 쌀<C>$rice</>을 지원");
|
||||
pushNationHistory($mynation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>(으)로 금<C>$gold</> 쌀<C>$rice</>을 지원");
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>(으)로부터 금<C>$gold</> 쌀<C>$rice</>을 지원 받음");
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>{$josaRo} 금<C>$gold</> 쌀<C>$rice</>을 지원");
|
||||
pushNationHistory($mynation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>{$josaRo} 금<C>$gold</> 쌀<C>$rice</>을 지원");
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaRo}부터 금<C>$gold</> 쌀<C>$rice</>을 지원 받음");
|
||||
|
||||
//상대국 수뇌부에게 로그 전달
|
||||
$query = "select no,name,nation from general where nation='$which' and level>='9'";
|
||||
@@ -483,8 +483,8 @@ function process_52(&$general) {
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【원조】</b></><D><b>{$mynation['name']}</b></>에서 <D><b>{$younation['name']}</b></>(으)로 물자를 지원합니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>(으)로 물자를 지원합니다. <1>$date</>";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【원조】</b></><D><b>{$mynation['name']}</b></>에서 <D><b>{$younation['name']}</b></>{$josaRo} 물자를 지원합니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>{$josaRo} 물자를 지원합니다. <1>$date</>";
|
||||
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
@@ -505,8 +505,9 @@ function process_52(&$general) {
|
||||
|
||||
function process_53(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
list($year, $month, $turnterm) = $gameStor->getValuesAsArray(['year','month','turnterm']);
|
||||
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
@@ -583,14 +584,16 @@ function process_53(&$general) {
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
|
||||
function process_61(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
list($year, $month, $turnterm) = $gameStor->getValuesAsArray(['year','month','turnterm']);
|
||||
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
@@ -689,6 +692,7 @@ function process_61(&$general) {
|
||||
|
||||
function process_62(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -696,9 +700,7 @@ function process_62(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','startyear']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -744,7 +746,7 @@ function process_62(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국과 불가침중입니다. 선포 실패. <1>$date</>";
|
||||
} elseif($dipcount != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:상대국이 외교 진행중입니다. 선포 실패. <1>$date</>";
|
||||
} elseif(!isClose($nation['nation'], $younation['nation'])) {
|
||||
} elseif(!isNeighbor($nation['nation'], $younation['nation'])) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:인접하지 않았습니다. 선포 실패. <1>$date</>";
|
||||
} elseif($admin['year'] <= $admin['startyear']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:초반제한 해제 2년전부터 가능합니다. 선포 실패. <1>$date</>";
|
||||
@@ -757,11 +759,14 @@ function process_62(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$younation['name']}</b></>에 <M>선전 포고</> 하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【선포】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$younation['name']}</b></>에 선전 포고 하였습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$younation['name']}</b></>에 <M>선전 포고</> 하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【선포】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$younation['name']}</b></>에 선전 포고 하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$younation['name']}</b></>에 선전 포고");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$younation['name']}</b></>에 선전 포고");
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 선전 포고");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$younation['name']}</b></>에 선전 포고");
|
||||
pushNationHistory($younation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국에 선전 포고");
|
||||
|
||||
//외교 변경
|
||||
$query = "update diplomacy set state='1',term='24' where me='{$nation['nation']}' and you='{$younation['nation']}'";
|
||||
@@ -809,8 +814,9 @@ function process_62(&$general) {
|
||||
|
||||
function process_63(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
list($year, $month, $turnterm) = $gameStor->getValuesAsArray(['year','month','turnterm']);
|
||||
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
@@ -892,8 +898,9 @@ function process_63(&$general) {
|
||||
|
||||
function process_64(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$date = substr($general['turntime'],11,5);
|
||||
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
|
||||
list($year, $month, $turnterm) = $gameStor->getValuesAsArray(['year','month','turnterm']);
|
||||
|
||||
if($general['level'] < 5 || $general['nation']==0) {
|
||||
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
|
||||
@@ -970,11 +977,13 @@ function process_64(&$general) {
|
||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
function process_65(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -982,9 +991,7 @@ function process_65(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1027,7 +1034,8 @@ function process_65(&$general) {
|
||||
} elseif($nation['surlimit'] > 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:제한 턴이 있습니다. 초토화 실패. <1>$date</>";
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(을)를 초토화했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 초토화했습니다. <1>$date</>";
|
||||
$exp = 5;
|
||||
$ded = 5;
|
||||
|
||||
@@ -1035,10 +1043,13 @@ function process_65(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>의 <R>초토화</>를 명령하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【초토화】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>(을)를 <R>초토화</>하였습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>의 <R>초토화</>를 명령하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【초토화】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>{$josaUl} <R>초토화</>하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>의 <R>초토화</>를 명령");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>의 <R>초토화</>를 명령");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>의 <R>초토화</>를 명령");
|
||||
|
||||
//외교제한 24
|
||||
$amount = Util::round($destcity['pop'] * 0.1);
|
||||
@@ -1069,6 +1080,7 @@ function process_65(&$general) {
|
||||
|
||||
function process_66(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1077,9 +1089,7 @@ function process_66(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1128,7 +1138,8 @@ function process_66(&$general) {
|
||||
$query = "update nation set l{$general['level']}term={$code} where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(으)로 천도했습니다. <1>$date</>";
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 천도했습니다. <1>$date</>";
|
||||
$exp = 15;
|
||||
$ded = 15;
|
||||
|
||||
@@ -1136,10 +1147,13 @@ function process_66(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(으)로 <R>천도</>를 명령하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<S><b>【천도】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>(으)로 천도하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>(으)로 천도 명령");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(으)로 천도 명령");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaRo} <R>천도</>를 명령하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<S><b>【천도】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>{$josaRo} 천도하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 천도 명령");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaRo} 천도 명령");
|
||||
|
||||
//수도 변경
|
||||
$query = "update nation set l{$general['level']}term='0',capital='{$destcity['city']}',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
||||
@@ -1159,6 +1173,7 @@ function process_66(&$general) {
|
||||
|
||||
function process_67(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1167,9 +1182,7 @@ function process_67(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1217,7 +1230,8 @@ function process_67(&$general) {
|
||||
$query = "update nation set l{$general['level']}term={$code} where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(을)를 증축했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 증축했습니다. <1>$date</>";
|
||||
$exp = 5 * 6;
|
||||
$ded = 5 * 6;
|
||||
|
||||
@@ -1225,10 +1239,13 @@ function process_67(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(을)를 <C>증축</>하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【증축】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>(을)를 증축하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>(을)를 증축");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(을)를 증축");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaUl} <C>증축</>하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【증축】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>{$josaUl} 증축하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 증축");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaUl} 증축");
|
||||
|
||||
//물자 감소
|
||||
$query = "update nation set l{$general['level']}term='0',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
||||
@@ -1250,6 +1267,7 @@ function process_67(&$general) {
|
||||
|
||||
function process_68(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1258,9 +1276,7 @@ function process_68(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1308,7 +1324,8 @@ function process_68(&$general) {
|
||||
$query = "update nation set l{$general['level']}term={$code} where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(을)를 감축했습니다. <1>$date</>";
|
||||
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 감축했습니다. <1>$date</>";
|
||||
$exp = 5 * 6;
|
||||
$ded = 5 * 6;
|
||||
|
||||
@@ -1316,10 +1333,13 @@ function process_68(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(을)를 <M>감축</>하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<M><b>【감축】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>(을)를 감축하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>(을)를 감축");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>(을)를 감축");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaUl} <M>감축</>하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<M><b>【감축】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>{$josaUl} 감축하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 감축");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>{$josaUl} 감축");
|
||||
|
||||
//물자 증가
|
||||
$query = "update nation set l{$general['level']}term='0',capset='1',gold=gold+'$amount',rice=rice+'$amount' where nation='{$general['nation']}'";
|
||||
@@ -1353,6 +1373,7 @@ function process_68(&$general) {
|
||||
|
||||
function process_71(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1362,9 +1383,7 @@ function process_71(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1381,7 +1400,7 @@ function process_71(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 10);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -1419,20 +1438,23 @@ function process_71(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <M>필사즉생</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>필사즉생</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>필사즉생</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <M>필사즉생</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <M>필사즉생</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>필사즉생</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>필사즉생</>을 발동");
|
||||
|
||||
//전장수 훈사100
|
||||
$query = "update general set atmos=100,train=100 where nation='{$general['nation']}'";
|
||||
@@ -1459,6 +1481,7 @@ function process_71(&$general) {
|
||||
|
||||
function process_72(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1468,9 +1491,7 @@ function process_72(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1494,7 +1515,7 @@ function process_72(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 20);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -1534,20 +1555,23 @@ function process_72(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>백성동원</>을 발동");
|
||||
|
||||
//도시 성수 80%
|
||||
$query = "update city set def=def2*0.8,wall=wall2*0.8 where city='{$destcity['city']}'";
|
||||
@@ -1574,6 +1598,7 @@ function process_72(&$general) {
|
||||
|
||||
function process_73(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1583,9 +1608,7 @@ function process_73(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1613,7 +1636,7 @@ function process_73(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 20);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -1655,10 +1678,13 @@ function process_73(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
@@ -1673,12 +1699,12 @@ function process_73(&$general) {
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>을 발동");
|
||||
|
||||
//도시 성수 80% 감소
|
||||
$query = "update city set def=def*0.2,wall=wall*0.2 where city='{$destcity['city']}'";
|
||||
@@ -1705,6 +1731,7 @@ function process_73(&$general) {
|
||||
|
||||
function process_74(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1714,9 +1741,7 @@ function process_74(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1744,7 +1769,7 @@ function process_74(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 20);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -1786,21 +1811,24 @@ function process_74(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국의 <G><b>{$destcity['name']}</b></>에 <M>허보</>를 발동");
|
||||
|
||||
//상대국 도시 전부 검색
|
||||
$query = "select city from city where nation='{$destcity['nation']}' and supply=1";
|
||||
@@ -1849,6 +1877,7 @@ function process_74(&$general) {
|
||||
|
||||
function process_75(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1858,9 +1887,7 @@ function process_75(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1884,7 +1911,7 @@ function process_75(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 40);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -1924,10 +1951,13 @@ function process_75(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
@@ -1942,12 +1972,12 @@ function process_75(&$general) {
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>피장파장</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>피장파장</>을 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국에 <M>피장파장</>을 발동");
|
||||
|
||||
//전략기한+60
|
||||
$query = "update nation set sabotagelimit=sabotagelimit+60 where nation='{$destnation['nation']}'";
|
||||
@@ -1975,6 +2005,7 @@ function process_75(&$general) {
|
||||
|
||||
function process_76(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -1984,9 +2015,7 @@ function process_76(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost,npccount,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1999,7 +2028,7 @@ function process_76(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
//$term2 = Util::round($genCount / 10);
|
||||
//if($term2 == 0) { $term2 = 1; }
|
||||
@@ -2037,20 +2066,23 @@ function process_76(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <M>의병모집</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>의병모집</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>의병모집</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <M>의병모집</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <M>의병모집</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<M>의병모집</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>의병모집</>을 발동");
|
||||
|
||||
$query = "select avg(gennum) as gennum from nation";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2069,34 +2101,34 @@ function process_76(&$general) {
|
||||
$type = rand() % 10;
|
||||
switch($type) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
$leader = 65 + rand()%11;
|
||||
$intel = 10 + rand()%6;
|
||||
$power = 150 - $leader - $intel;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatTotal - $leader - $intel;
|
||||
break;
|
||||
case 4: case 5: case 6: case 7:
|
||||
$leader = 65 + rand()%11;
|
||||
$power = 10 + rand()%6;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$power = GameConst::$defaultStatMin + rand()%6;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
case 8: case 9:
|
||||
$leader = 10 + rand()%6;
|
||||
$power = 65 + rand()%11;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
}
|
||||
// 국내 최고능치 기준으로 랜덤성 스케일링
|
||||
if($avgGen['lpi'] > 210) {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
} elseif($avgGen['lpi'] > 180) {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
} else {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
}
|
||||
$over1 = 0;
|
||||
$over2 = 0;
|
||||
@@ -2121,14 +2153,14 @@ function process_76(&$general) {
|
||||
$power = $power + $over1 + $over2 + $over3;
|
||||
}
|
||||
// 너무 높은 능치는 제한
|
||||
if($leader > 95) {
|
||||
$leader = 95;
|
||||
if($leader > GameConst::$defaultStatNPCMax) {
|
||||
$leader = GameConst::$defaultStatNPCMax;
|
||||
}
|
||||
if($power > 95) {
|
||||
$power = 95;
|
||||
if($power > GameConst::$defaultStatNPCMax) {
|
||||
$power = GameConst::$defaultStatNPCMax;
|
||||
}
|
||||
if($intel > 95) {
|
||||
$intel = 95;
|
||||
if($intel > GameConst::$defaultStatNPCMax) {
|
||||
$intel = GameConst::$defaultStatNPCMax;
|
||||
}
|
||||
|
||||
$npccount = 10000 + $npcid;
|
||||
@@ -2163,15 +2195,14 @@ function process_76(&$general) {
|
||||
$npcid++;
|
||||
}
|
||||
//npccount
|
||||
$query = "update game set npccount={$npcid}";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->npccount=$npcid;
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
// 국가보정
|
||||
if($nation['type'] == 11) { $term3 = Util::round($term3 / 2); }
|
||||
@@ -2194,6 +2225,7 @@ function process_76(&$general) {
|
||||
|
||||
function process_77(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2203,9 +2235,7 @@ function process_77(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2229,7 +2259,7 @@ function process_77(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
$term2 = 1;
|
||||
$term3 = Util::round(sqrt($genCount*16)*10);
|
||||
@@ -2267,10 +2297,13 @@ function process_77(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
@@ -2285,12 +2318,12 @@ function process_77(&$general) {
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>이호경식</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>이호경식</>을 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국에 <M>이호경식</>을 발동");
|
||||
|
||||
//선포+3개월
|
||||
if($dip['state'] == 0) {
|
||||
@@ -2322,6 +2355,7 @@ function process_77(&$general) {
|
||||
|
||||
function process_78(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2331,9 +2365,7 @@ function process_78(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2357,7 +2389,7 @@ function process_78(&$general) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
if($genCount < 10) { $genCount = 10; }
|
||||
if($genCount < GameConst::$initialNationGenLimit) { $genCount = GameConst::$initialNationGenLimit; }
|
||||
|
||||
$term2 = 1;
|
||||
$term3 = Util::round(sqrt($genCount*16)*10);
|
||||
@@ -2397,10 +2429,13 @@ function process_78(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
|
||||
$alllog[0] = "<C>●</><Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동하였습니다.";
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $alllog);
|
||||
@@ -2415,12 +2450,12 @@ function process_78(&$general) {
|
||||
pushGenLog($gen, $alllog);
|
||||
}
|
||||
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>급습</>(을)를 발동");
|
||||
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동하였습니다.";
|
||||
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동하였습니다.";
|
||||
$sabotagelog[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$destnation['name']}</b></>에 <M>급습</>을 발동");
|
||||
pushNationHistory($destnation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} 아국에 <M>급습</>을 발동");
|
||||
|
||||
//선포-3개월
|
||||
$query = "update diplomacy set term=term-3 where (me='{$general['nation']}' and you='{$destnation['nation']}') or (you='{$general['nation']}' and me='{$destnation['nation']}')";
|
||||
@@ -2447,6 +2482,7 @@ function process_78(&$general) {
|
||||
|
||||
function process_81(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -2455,9 +2491,7 @@ function process_81(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2488,19 +2522,22 @@ function process_81(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
$query = "select no,name from general where nation='{$general['nation']}' and no!='{$general['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cnt = MYDB_num_rows($result);
|
||||
$genlog = ["<C>●</><Y>{$general['name']}</>(이)가 <font color={$color}><b>국기</b></font>를 변경합니다."];
|
||||
$genlog = ["<C>●</><Y>{$general['name']}</>{$josaYi} <font color={$color}><b>국기</b></font>를 변경합니다."];
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <font color={$color}><b>국기</b></font>를 변경하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【국기변경】</b></><D><b>{$nation['name']}</b></>(이)가 <font color={$color}><b>국기</b></font>를 변경하였습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <font color={$color}><b>국기</b></font>를 변경하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【국기변경】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <font color={$color}><b>국기</b></font>를 변경하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<font color={$color}><b>국기</b></font>를 변경");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <font color={$color}><b>국기</b></font>를 변경");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <font color={$color}><b>국기</b></font>를 변경");
|
||||
|
||||
//국기변경
|
||||
$query = "update nation set color='$color',can_change_flag=can_change_flag-1 where nation='{$nation['nation']}'";
|
||||
|
||||
+207
-135
@@ -3,6 +3,7 @@ namespace sammo;
|
||||
|
||||
function process_22(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -10,9 +11,7 @@ function process_22(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -47,7 +46,10 @@ function process_22(&$general) {
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
|
||||
$msg->send(true);
|
||||
if($msg){
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
|
||||
$general['intel2']++;
|
||||
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
@@ -60,6 +62,7 @@ function process_22(&$general) {
|
||||
|
||||
function process_25(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -67,9 +70,7 @@ function process_25(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction']);
|
||||
|
||||
$query = "select nation from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -78,66 +79,118 @@ function process_25(&$general) {
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$where = $command[1];
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($where == 99) {
|
||||
// 초반시 10명이하, 임관금지없음 국가
|
||||
if($admin['year'] < $admin['startyear']+3) {
|
||||
$query = "select name,nation,scout,level from nation where nation not in (0{$general['nations']}0) and gennum<10 and scout=0 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
} else {
|
||||
$query = "select name,nation,scout,level from nation where nation not in (0{$general['nations']}0) and scout=0 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
}
|
||||
} elseif($where == 98) {
|
||||
// 초반시 10명이하, 임관금지없음 국가, 방랑군 제외
|
||||
if($admin['year'] < $admin['startyear']+3) {
|
||||
$query = "select name,nation,scout,level from nation where nation not in (0{$general['nations']}0) and gennum<10 and scout=0 and level>0 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
} else {
|
||||
$query = "select name,nation,scout,level from nation where nation not in (0{$general['nations']}0) and scout=0 and level>0 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
}
|
||||
} else {
|
||||
$query = "select name,nation,scout,level from nation where nation='$where'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
}
|
||||
$query = "select no from general where nation='{$nation['nation']}'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
$nation = null;
|
||||
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] == 0 || $admin['scenario'] >= 20 || !$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',
|
||||
$joinedNations,
|
||||
($admin['year'] < $admin['startyear']+3)?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
|
||||
);
|
||||
shuffle($nations);
|
||||
|
||||
$allGen = array_sum(array_map(function($item) {
|
||||
return $item['gennum'];
|
||||
}, $nations));
|
||||
|
||||
$maxScore = 1<<30;
|
||||
|
||||
foreach($nations as $testNation){
|
||||
$affinity = abs($general['affinity'] - $testNation['affinity']);
|
||||
$affinity = min($affinity, abs($affinity - 150));
|
||||
|
||||
$score = log($affinity + 1, 2);//0~
|
||||
|
||||
//쉐킷쉐킷
|
||||
$score += Util::randF();
|
||||
|
||||
$score += sqrt($testNation['gennum']/$allGen);
|
||||
|
||||
if($score < $maxScore){
|
||||
$maxScore = $score;
|
||||
$nation = $testNation;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if($where >= 98) {
|
||||
//랜임
|
||||
$generals = [];
|
||||
foreach($db->queryAllLists('SELECT count(no), nation FROM general WHERE npc <= 2 AND nation > 0 GROUP BY nation') as list($cnt, $nation)){
|
||||
$generals[$nation] = $cnt;
|
||||
}
|
||||
|
||||
$allGen = array_sum($generals);
|
||||
|
||||
$nations = $db->query(
|
||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`injury` 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',
|
||||
$joinedNations,
|
||||
($admin['year'] < $admin['startyear']+3)?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
|
||||
);
|
||||
shuffle($nations);
|
||||
|
||||
$randVals = [];
|
||||
foreach($nations as $idx=>$testNation){
|
||||
// 임관금지없음 국가, 방랑군 제외
|
||||
if($where == 98 && $testNation['level'] == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
$score = 1;
|
||||
if($admin['startyear']+3 > $admin['year'] && $general['npc'] > 2){
|
||||
$score *= sqrt((100-max(30, $testNation['injury']))/100);
|
||||
}
|
||||
|
||||
$score *= sqrt($allGen/$generals[$testNation['nation']]);
|
||||
$randVals[$idx] = $score;
|
||||
}
|
||||
|
||||
if($randVals){
|
||||
$nation = $nations[Util::choiceRandomUsingWeight($randVals)];
|
||||
}
|
||||
|
||||
} else {
|
||||
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
|
||||
}
|
||||
|
||||
if($nation){
|
||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE nation=%i', $nation['nation']);
|
||||
$josaUn = JosaUtil::pick($nation['name'], '은');
|
||||
}
|
||||
|
||||
if(!$nation) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
|
||||
} elseif($general['nation'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야가 아닙니다. 임관 실패. <1>$date</>";
|
||||
} elseif($nation['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 국가입니다. 임관 실패. <1>$date</>";
|
||||
} elseif($nation['level'] == 0 && $gencount >= 10) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 제한되고 있습니다. 임관 실패.";
|
||||
} elseif($admin['year'] < $admin['startyear']+3 && $gencount >= 10) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 제한되고 있습니다. 임관 실패.";
|
||||
} elseif($nation['level'] == 0 && $gencount >= GameConst::$initialNationGenLimit) {
|
||||
$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) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 임관이 금지되어 있습니다. 임관 실패.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 금지되어 있습니다. 임관 실패.";
|
||||
} elseif($general['makelimit'] > 0 && $general['npc'] < 5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야가 된지 12턴이 지나야 합니다. 임관 실패. <1>$date</>";
|
||||
} elseif(strpos($general['nations'], ",{$nation['nation']},") > 0) {
|
||||
} elseif(in_array($nation['nation'], $joinedNations)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
|
||||
} else {
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
if($where == 99 || $where == 98) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 어쩌다보니 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 어쩌다보니 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 랜덤으로 임관했습니다. <1>$date</>";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 임관했습니다. <1>$date</>";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
|
||||
}
|
||||
|
||||
if($gencount < 10) { $exp = 700; }
|
||||
if($gencount < GameConst::$initialNationGenLimit) { $exp = 700; }
|
||||
else { $exp = 100; }
|
||||
$ded = 0;
|
||||
|
||||
@@ -150,22 +203,30 @@ function process_25(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$king = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
// NPC초반시 임관기록 추가 안함
|
||||
if($general['npc'] > 1 && $admin['year'] < $admin['startyear']+3) {
|
||||
} else {
|
||||
$general['nations'] .= "{$nation['nation']},";
|
||||
$joinedNations[] = $nation['nation'];
|
||||
}
|
||||
|
||||
// 국적 바꾸고 등급 일반으로 // 명성 상승
|
||||
$query = "update general set resturn='SUCCESS',nation='{$nation['nation']}',nations='{$general['nations']}',level='1',experience=experience+'$exp',city='{$king['city']}',belong=1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'nation'=>$nation['nation'],
|
||||
'nations'=>Json::encode($joinedNations),
|
||||
'level'=>1,
|
||||
'experience'=>$db->sqleval('experience + %i', $exp),
|
||||
'city'=>$king['city'],
|
||||
'belong'=>1
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "select no from general where nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -183,6 +244,7 @@ function process_25(&$general) {
|
||||
|
||||
function process_29(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -190,20 +252,19 @@ function process_29(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month,develcost,npccount,turnterm,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario']);
|
||||
|
||||
$query = "select nation,name,level,gennum,scout from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$josaUn = JosaUtil::pick($nation['name'], '은');
|
||||
if($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 인재탐색 실패. <1>$date</>";
|
||||
} elseif($nation['level'] <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:방랑군입니다. 인재탐색 실패. <1>$date</>";
|
||||
} elseif($admin['year'] < $admin['startyear']+3 && $nation['gennum'] >= 10) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>은(는) 탐색이 제한되고 있습니다. 인재탐색 실패.";
|
||||
} elseif($admin['year'] < $admin['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 탐색이 제한되고 있습니다. 인재탐색 실패.";
|
||||
} elseif($general['gold'] < $admin['develcost']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 인재탐색 실패. <1>$date</>";
|
||||
} else {
|
||||
@@ -265,9 +326,11 @@ function process_29(&$general) {
|
||||
$scoutNation = $nation['nation'];
|
||||
}
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>$name</>(이)라는 <C>인재</>를 {$scoutType}하였습니다! <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <Y>$name</>(이)라는 <C>인재</>를 {$scoutType}하였습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>$name</>(이)라는 <C>인재</>를 {$scoutType}");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaRa = JosaUtil::pick($name, '라');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다! <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}하였습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>$name</>{$josaRa}는 <C>인재</>를 {$scoutType}");
|
||||
|
||||
$query = "select max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0) as dex0, avg(dex10) as dex10, avg(dex20) as dex20, avg(dex30) as dex30, avg(dex40) as dex40 from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -279,53 +342,53 @@ function process_29(&$general) {
|
||||
if($admin['scenario'] == 0) {
|
||||
switch($type) {
|
||||
case 0: case 1:
|
||||
$leader = 65 + rand()%11;
|
||||
$intel = 10 + rand()%6;
|
||||
$power = 150 - $leader - $intel;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatTotal - $leader - $intel;
|
||||
break;
|
||||
case 2: case 3:
|
||||
$leader = 65 + rand()%11;
|
||||
$power = 10 + rand()%6;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$power = GameConst::$defaultStatMin + rand()%6;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
case 4: case 5: case 6: case 7: case 8: case 9:
|
||||
$leader = 10 + rand()%6;
|
||||
$power = 65 + rand()%11;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch($type) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
$leader = 65 + rand()%11;
|
||||
$intel = 10 + rand()%6;
|
||||
$power = 150 - $leader - $intel;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatTotal - $leader - $intel;
|
||||
break;
|
||||
case 4: case 5: case 6: case 7:
|
||||
$leader = 65 + rand()%11;
|
||||
$power = 10 + rand()%6;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$power = GameConst::$defaultStatMin + rand()%6;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
case 8: case 9:
|
||||
$leader = 10 + rand()%6;
|
||||
$power = 65 + rand()%11;
|
||||
$intel = 150 - $leader - $power;
|
||||
$leader = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 국내 최고능치 기준으로 랜덤성 스케일링
|
||||
if($avgGen['lpi'] > 210) {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (60+rand()%31)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
} elseif($avgGen['lpi'] > 180) {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (75+rand()%21)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (75+rand()%21)/100);
|
||||
} else {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / 150 * (90+rand()%11)/100);
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
$power = Util::round($power * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
$intel = Util::round($intel * $avgGen['lpi'] / GameConst::$defaultStatTotal * (90+rand()%11)/100);
|
||||
}
|
||||
$over1 = 0;
|
||||
$over2 = 0;
|
||||
@@ -400,15 +463,14 @@ function process_29(&$general) {
|
||||
$npcid++;
|
||||
|
||||
//npccount
|
||||
$query = "update game set npccount={$npcid}";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->npccount=$npcid;
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
|
||||
@@ -437,6 +499,7 @@ function process_29(&$general) {
|
||||
|
||||
function process_45(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -444,9 +507,7 @@ function process_45(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select name,chemi from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -481,23 +542,28 @@ function process_45(&$general) {
|
||||
}
|
||||
|
||||
if($dipcount1 > 0) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 통합에 반대하며 <D><b>{$nation['name']}</b></>(을)를 <R>떠났</>습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaUl = JosaUtil::pick($nation['name'], '을');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 통합에 반대하며 <D><b>{$nation['name']}</b></>{$josaUl} <R>떠났</>습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:통합에 반대하며 <D><b>{$nation['name']}</b></>에서 떠났습니다. <1>$date</>";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:통합에 반대하며 <D><b>{$nation['name']}</b></>(을)를 떠남");
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:통합에 반대하며 <D><b>{$nation['name']}</b></>{$josaUl} 떠남");
|
||||
|
||||
// 국적 바꾸고 등급 재야로
|
||||
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($dipcount2 > 0) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 합병에 반대하며 <D><b>{$nation['name']}</b></>(을)를 <R>떠났</>습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaUl = JosaUtil::pick($nation['name'], '을');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 합병에 반대하며 <D><b>{$nation['name']}</b></>{$josaUl} <R>떠났</>습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:합병에 반대하며 <D><b>{$nation['name']}</b></>에서 떠났습니다. <1>$date</>";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:합병에 반대하며 <D><b>{$nation['name']}</b></>(을)를 떠남");
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:합병에 반대하며 <D><b>{$nation['name']}</b></>{$josaUl} 떠남");
|
||||
|
||||
// 국적 바꾸고 등급 재야로
|
||||
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에서 <R>하야</>했습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>에서 <R>하야</>했습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$nation['name']}</b></>에서 하야했습니다. <1>$date</>";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>에서 하야");
|
||||
|
||||
@@ -535,7 +601,7 @@ function process_45(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$nation['chemi'] -= 1;
|
||||
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
|
||||
@@ -549,6 +615,7 @@ function process_45(&$general) {
|
||||
|
||||
function process_46(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -556,9 +623,7 @@ function process_46(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select * from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -608,11 +673,15 @@ function process_46(&$general) {
|
||||
$query = "update city set nation='{$nation['nation']}',conflict='{}' where city='{$general['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$nation['name']}</b></>(을)를 건국하였습니다. <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$city['name']}</b></>에 국가를 건설하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【건국】</b></>".getNationType($type)." <D><b>{$nation['name']}</b></>(이)가 새로이 등장하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>(을)를 건국");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>(을)를 건국");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaUl = JosaUtil::pick($nation['name'], '을');
|
||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaUl} 건국하였습니다. <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$city['name']}</b></>에 국가를 건설하였습니다.";
|
||||
$josaYi = JosaUtil::pick($nation['name'], '이');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【건국】</b></>".getNationType($type)." <D><b>{$nation['name']}</b></>{$josaYi} 새로이 등장하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaUl} 건국");
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>{$josaUl} 건국");
|
||||
|
||||
$exp = 1000;
|
||||
$ded = 1000;
|
||||
@@ -637,6 +706,7 @@ function process_46(&$general) {
|
||||
|
||||
function process_47(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -644,9 +714,7 @@ function process_47(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -665,11 +733,14 @@ function process_47(&$general) {
|
||||
} elseif($nation['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 방랑군입니다. 방랑 실패.";
|
||||
} else {
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</>{$admin['month']}월:영토를 버리고 방랑의 길을 떠납니다. <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 방랑의 길을 떠납니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>(을)를 버리고 방랑");
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 방랑의 길을 떠납니다.";
|
||||
$josaUl = JosaUtil::pick($nation['name'], '을');
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaUl} 버리고 방랑");
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【방랑】</b></><D><b>{$general['name']}</b></>은(는) <R>방랑</>의 길을 떠납니다.";
|
||||
$josaUn = JosaUtil::pick($general['name'], '은');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【방랑】</b></><D><b>{$general['name']}</b></>{$josaUn} <R>방랑</>의 길을 떠납니다.";
|
||||
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($general['nation']);
|
||||
@@ -702,6 +773,7 @@ function process_47(&$general) {
|
||||
|
||||
function process_54(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -710,9 +782,7 @@ function process_54(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$who = $command[1];
|
||||
@@ -753,13 +823,14 @@ function process_54(&$general) {
|
||||
$query = "update general set resturn='SUCCESS',level='1',experience=experience*0.7 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【선양】</b></><Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>의 군주 자리를 <Y>{$nextruler['name']}</>에게 선양했습니다.";
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【선양】</b></><Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>의 군주 자리를 <Y>{$nextruler['name']}</>에게 선양했습니다.";
|
||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$nextruler['name']}</>에게 군주의 자리를 물려줍니다. <1>$date</>";
|
||||
$youlog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>에게서 군주의 자리를 물려받습니다.";
|
||||
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 군주자리를 <Y>{$nextruler['name']}</>에게 선양");
|
||||
pushGeneralHistory($nextruler, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>의 군주자리를 물려 받음");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <Y>{$nextruler['name']}</>에게 선양");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>{$nextruler['name']}</>에게 선양");
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
pushGenLog($nextruler, $youlog);
|
||||
@@ -768,6 +839,7 @@ function process_54(&$general) {
|
||||
|
||||
function process_55(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -776,9 +848,7 @@ function process_55(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select name from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -829,11 +899,12 @@ function process_55(&$general) {
|
||||
$query = "update general set resturn='SUCCESS',belong=1,level=12,nation='{$nation['nation']}',dedication=dedication+'$ded', experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</>{$admin['month']}월:거병에 성공하였습니다. <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$city['name']}</b></>에서 거병하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【거병】</b></><D><b>{$general['name']}</b></>(이)가 세력을 결성하였습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$city['name']}</b></>에서 거병하였습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【거병】</b></><D><b>{$general['name']}</b></>{$josaYi} 세력을 결성하였습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<G><b>{$city['name']}</b></>에서 거병");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$city['name']}</b></>에서 거병");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <G><b>{$city['name']}</b></>에서 거병");
|
||||
|
||||
// 외교테이블 추가
|
||||
|
||||
@@ -857,6 +928,7 @@ function process_55(&$general) {
|
||||
|
||||
function process_56(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -864,9 +936,7 @@ function process_56(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
@@ -879,9 +949,11 @@ function process_56(&$general) {
|
||||
} elseif($citycount != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:방랑군이 아닙니다. <1>$date</>";
|
||||
} else {
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</>{$admin['month']}월:세력을 해산했습니다. <1>$date</>";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 세력을 해산했습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>(을)를 해산");
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 세력을 해산했습니다.";
|
||||
$josaUl = JosaUtil::pick($nation['name'], '을');
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaUl} 해산");
|
||||
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -910,6 +982,7 @@ function process_56(&$general) {
|
||||
|
||||
function process_57(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -918,9 +991,7 @@ function process_57(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,killturn from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'killturn']);
|
||||
|
||||
$query = "select nation,name from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -963,14 +1034,15 @@ function process_57(&$general) {
|
||||
$query = "update general set level='1',experience=experience*0.7 where no='{$ruler['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</>{$admin['month']}월:모반에 성공했습니다. <1>$date</>";
|
||||
$youlog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>에게서 군주의 자리를 뺏겼습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>모반</>에 성공했습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【모반】</b></><Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>의 군주 자리를 찬탈했습니다.";
|
||||
$youlog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>에게 군주의 자리를 뺏겼습니다.";
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <M>모반</>에 성공했습니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【모반】</b></><Y>{$general['name']}</>{$josaYi} <D><b>{$nation['name']}</b></>의 군주 자리를 찬탈했습니다.";
|
||||
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:모반으로 <D><b>{$nation['name']}</b></>의 군주자리를 찬탈");
|
||||
pushGeneralHistory($ruler, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$general['name']}</b></>의 모반으로 인해 <D><b>{$nation['name']}</b></>의 군주자리를 박탈당함");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>(이)가 <Y>{$ruler['name']}</>에게서 군주자리를 찬탈");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <Y>{$ruler['name']}</>에게서 군주자리를 찬탈");
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
pushGenLog($ruler, $youlog);
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace sammo;
|
||||
|
||||
function process_32(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -12,9 +13,7 @@ function process_32(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
@@ -65,14 +64,16 @@ function process_32(&$general) {
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$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),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -90,7 +91,8 @@ function process_32(&$general) {
|
||||
$ratio /= Util::array_get($dist[$destination], 99);
|
||||
|
||||
if($ratio > $ratio2) {
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(이)가 불타고 있습니다.";
|
||||
$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;
|
||||
@@ -129,6 +131,7 @@ function process_32(&$general) {
|
||||
|
||||
function process_33(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -138,9 +141,7 @@ function process_33(&$general) {
|
||||
//탈취는 0까지 무제한
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
@@ -195,14 +196,16 @@ function process_33(&$general) {
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$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),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -281,6 +284,7 @@ function process_33(&$general) {
|
||||
|
||||
function process_34(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -289,9 +293,7 @@ function process_34(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
@@ -342,14 +344,16 @@ function process_34(&$general) {
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$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),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -407,6 +411,7 @@ function process_34(&$general) {
|
||||
|
||||
function process_35(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
@@ -415,9 +420,7 @@ function process_35(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
||||
|
||||
$dist = searchDistance($general['city'], 5, false);
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
@@ -470,14 +473,16 @@ function process_35(&$general) {
|
||||
$ratio += 10;
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$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),"");
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
||||
// 육도, 삼략 사용
|
||||
|
||||
+10
-9
@@ -66,7 +66,9 @@ function CoreTurnTable() {
|
||||
|
||||
|
||||
function allButton() {
|
||||
$npcmode = DB::db()->queryFirstField("select npcmode from game limit 1");
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$npcmode = $gameStor->npcmode;
|
||||
if($npcmode == 1) {
|
||||
$site = "a_npcList.php";
|
||||
$call = "빙의일람";
|
||||
@@ -75,11 +77,11 @@ function allButton() {
|
||||
$call = "설문조사";
|
||||
}
|
||||
|
||||
if(\file_exists("d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine('d_setting/templates');
|
||||
if(\file_exists(__dir__."/d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/d_setting/templates');
|
||||
}
|
||||
else{
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
}
|
||||
|
||||
|
||||
@@ -93,11 +95,10 @@ function allButton() {
|
||||
function commandButton() {
|
||||
$session = Session::getInstance();
|
||||
$userID = Session::getUserID();
|
||||
$generalID = $session->generalID;
|
||||
|
||||
if($generalID === null){
|
||||
if(!$session->isGameLoggedIn()){
|
||||
return '';
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
|
||||
|
||||
@@ -111,7 +112,7 @@ function commandButton() {
|
||||
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
||||
$fgColor = newColor($bgColor);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$showSecret = false;
|
||||
if($me['level'] >= 2){
|
||||
$showSecret = true;
|
||||
@@ -168,7 +169,7 @@ function formatName(string $name, int $npc): string{
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('map');
|
||||
}
|
||||
+8
-12
@@ -8,6 +8,7 @@ namespace sammo;
|
||||
//1월마다 실행
|
||||
function processSpring() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
//인구 증가
|
||||
@@ -37,9 +38,7 @@ function processSpring() {
|
||||
$query = "update nation set gold=gold*0.95 where gold>100000";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
pushWorldHistory(["<R>★</>{$admin['year']}년 {$admin['month']}월: <S>모두들 즐거운 게임 하고 계신가요? ^^ <Y>삼국일보</> 애독해 주시고, <M>훼접</>은 삼가주세요~</>"], $admin['year'], $admin['month']);
|
||||
}
|
||||
@@ -47,10 +46,9 @@ function processSpring() {
|
||||
function processGoldIncome() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = new KVStorage($db, 'game_env');
|
||||
|
||||
$query = "select year,month,gold_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','gold_rate']);
|
||||
$adminLog = [];
|
||||
|
||||
$query = "select name,nation,gold,rate_tmp,bill,type from nation";
|
||||
@@ -369,11 +367,10 @@ function processFall() {
|
||||
|
||||
function processRiceIncome() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year','month','rice_rate']);
|
||||
$adminLog = [];
|
||||
|
||||
$query = "select name,nation,rice,rate_tmp,bill,type from nation";
|
||||
@@ -570,11 +567,10 @@ function tradeRate() {
|
||||
|
||||
function disaster() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
//재난표시 초기화
|
||||
$query = "update city set state=0 where state<=10";
|
||||
|
||||
+149
-97
@@ -4,11 +4,13 @@ namespace sammo;
|
||||
|
||||
function processTournament() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,phase,tnmt_type,tnmt_auto,tnmt_time,now() as now,TIMESTAMPDIFF(SECOND,tnmt_time,now()) as offset from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time']);
|
||||
$now = new \DateTime();
|
||||
$admin['now'] = $now->format('Y-m-d H:i:s');
|
||||
$admin['offset'] = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
||||
|
||||
//수동일땐 무시
|
||||
if($admin['tnmt_auto'] == 0) { return; }
|
||||
@@ -83,8 +85,9 @@ function processTournament() {
|
||||
if($betTerm > 3600) { $betTerm = 3600; }
|
||||
//처리 초 더한 날짜
|
||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
||||
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = $tnmt;
|
||||
$gameStor->phase = $phase;
|
||||
$gameStor->tnmt_time = $dt;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,28 +98,29 @@ function processTournament() {
|
||||
//지정시간대 넘어가면 중단 20~24시
|
||||
if($hr < 20) {
|
||||
$dt = substr($dt, 0, 11)."20:00:00";
|
||||
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = $tnmt;
|
||||
$gameStor->phase = $phase;
|
||||
$gameStor->tnmt_time = $dt;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$second = $unit * $iter;
|
||||
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time=DATE_ADD(tnmt_time, INTERVAL {$second} SECOND)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = $tnmt;
|
||||
$gameStor->phase = $phase;
|
||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
|
||||
function getTournamentTerm() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tnmt_auto from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$tnmt_auto = $gameStor->tnmt_auto;
|
||||
|
||||
switch($admin['tnmt_auto']) {
|
||||
switch($tnmt_auto) {
|
||||
case 0: $str = ''; break;
|
||||
case 1: $str = "경기당 12분"; break;
|
||||
case 2: $str = "경기당 7분"; break;
|
||||
@@ -131,14 +135,11 @@ function getTournamentTerm() {
|
||||
|
||||
function getTournamentTime() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,tnmt_time from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$tnmt = $admin['tournament'];
|
||||
$dt = substr($admin['tnmt_time'], 11, 5);
|
||||
list($tnmt, $tnmt_time) = $gameStor->getValuesAsArray(['tournament', 'tnmt_time']);
|
||||
$dt = substr($tnmt_time, 11, 5);
|
||||
switch($tnmt) {
|
||||
case 1: $tnmt = "개막시간 {$dt}"; break;
|
||||
case 2: $tnmt = "다음경기 {$dt}"; break;
|
||||
@@ -170,11 +171,11 @@ function getTournament($tnmt) {
|
||||
return $tnmt;
|
||||
}
|
||||
|
||||
function printRow($k, $npc, $name, $abil, $game, $win, $draw, $lose, $gd, $gl, $prmt) {
|
||||
function printRow($k, $npc, $name, $abil, $tgame, $win, $draw, $lose, $gd, $gl, $prmt) {
|
||||
if($prmt > 0) { $name = "<font color=orange>".$name."</font>"; }
|
||||
elseif($npc >= 2) { $name = "<font color=cyan>".$name."</font>"; }
|
||||
elseif($npc == 1) { $name = "<font color=skyblue>".$name."</font>"; }
|
||||
echo "<tr align=center><td id=bg2>$k</td><td>$name</td><td>$abil</td><td>$game</td><td>$win</td><td>$draw</td><td>$lose</td><td>$gd</td><td>$gl</td></tr>";
|
||||
echo "<tr align=center><td id=bg2>$k</td><td style='font-size:80%;'>$name</td><td>$abil</td><td>$tgame</td><td>$win</td><td>$draw</td><td>$lose</td><td>$gd</td><td>$gl</td></tr>";
|
||||
}
|
||||
|
||||
function printFighting($tournament, $phase) {
|
||||
@@ -231,6 +232,7 @@ function printFighting($tournament, $phase) {
|
||||
|
||||
function startTournament($auto, $type) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
eraseTnmtFightLogAll();
|
||||
@@ -246,12 +248,16 @@ function startTournament($auto, $type) {
|
||||
default:$unit = 60; break;
|
||||
}
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$query = "update game set tnmt_auto='$auto',tnmt_time=DATE_ADD(now(), INTERVAL {$unit} MINUTE),tournament=1,tnmt_type='$type',phase=0,bet0=0,bet1=0,bet2=0,bet3=0,bet4=0,bet5=0,bet6=0,bet7=0,bet8=0,bet9=0,bet10=0,bet11=0,bet12=0,bet13=0,bet14=0,bet15=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tnmt_auto = $auto;
|
||||
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
||||
$gameStor->tournament = 1;
|
||||
$gameStor->tnmt_type = $type;
|
||||
$gameStor->phase = 0;
|
||||
for($i=0;$i<16;$i+=1){
|
||||
$gameStor->setValue("bet{$i}", 0);
|
||||
}
|
||||
$query = "update general set tournament=0,bet0=0,bet1=0,bet2=0,bet3=0,bet4=0,bet5=0,bet6=0,bet7=0,bet8=0,bet9=0,bet10=0,bet11=0,bet12=0,bet13=0,bet14=0,bet15=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "truncate tournament";
|
||||
@@ -269,14 +275,13 @@ function startTournament($auto, $type) {
|
||||
|
||||
function fillLowGenAll() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$general = [];
|
||||
$grpCount = [];
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$develcost = $gameStor->develcost;
|
||||
|
||||
$general['no'] = 0;
|
||||
$general['name'] = "무명장수";
|
||||
@@ -293,7 +298,7 @@ function fillLowGenAll() {
|
||||
}
|
||||
|
||||
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
||||
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='{$admin['develcost']}' order by rand() limit 0,64";
|
||||
$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";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
|
||||
@@ -308,7 +313,7 @@ function fillLowGenAll() {
|
||||
if($genCount > 0) {
|
||||
$genCount--;
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$query = "update general set gold=gold-'{$admin['develcost']}',tournament='1' where no='{$gen['no']}'";
|
||||
$query = "update general set gold=gold-'{$develcost}',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]')";
|
||||
@@ -327,8 +332,8 @@ function fillLowGenAll() {
|
||||
}
|
||||
}
|
||||
|
||||
$query = "update game set tournament=2, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = 2;
|
||||
$gameStor->phase = 0;
|
||||
}
|
||||
|
||||
//0 경기없음
|
||||
@@ -376,6 +381,7 @@ function getTwo($tournament, $phase) {
|
||||
|
||||
function qualify($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$cand = getTwo($tnmt, $phase);
|
||||
@@ -385,11 +391,10 @@ function qualify($tnmt_type, $tnmt, $phase) {
|
||||
fight($tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
}
|
||||
if($phase < 55) {
|
||||
$query = "update game set phase=phase+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->phase+=1;
|
||||
} else {
|
||||
$query = "update game set tournament=3, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->phase=0;
|
||||
$gameStor->tournament=3;
|
||||
|
||||
for($i=0; $i < 8; $i++) {
|
||||
$query = "select grp,grp_no,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$i' order by gd desc, gl desc, seq limit 0,4";
|
||||
@@ -416,6 +421,7 @@ function qualifyAll($tnmt_type, $tnmt, $phase) {
|
||||
|
||||
function selection($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
//시드1 배정
|
||||
@@ -444,18 +450,14 @@ function selection($tnmt_type, $tnmt, $phase) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($phase < 31) {
|
||||
$query = "update game set phase=phase+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->phase+=1;
|
||||
} else {
|
||||
$query = "update game set tournament=4, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournamemt = 4;
|
||||
$gameStor->phase=0;
|
||||
}
|
||||
}
|
||||
|
||||
function selectionAll($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$start = $phase;
|
||||
$end = $phase - ($phase % 8) + 8;
|
||||
for($i=$start; $i < $end; $i++) {
|
||||
@@ -465,6 +467,7 @@ function selectionAll($tnmt_type, $tnmt, $phase) {
|
||||
|
||||
function finallySingle($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$cand = getTwo($tnmt, $phase);
|
||||
@@ -474,11 +477,10 @@ function finallySingle($tnmt_type, $tnmt, $phase) {
|
||||
fight($tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
}
|
||||
if($phase < 5) {
|
||||
$query = "update game set phase=phase+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->phase+=1;
|
||||
} else {
|
||||
$query = "update game set tournament=5, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament=5;
|
||||
$gameStor->phase=0;
|
||||
|
||||
for($i=10; $i < 18; $i++) {
|
||||
$query = "select grp,grp_no,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$i' order by gd desc, gl desc, seq limit 0,2";
|
||||
@@ -493,9 +495,6 @@ function finallySingle($tnmt_type, $tnmt, $phase) {
|
||||
}
|
||||
|
||||
function finallyAll($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$start = $phase;
|
||||
$end = $phase - ($phase % 2) + 2;
|
||||
for($i=$start; $i < $end; $i++) {
|
||||
@@ -505,6 +504,7 @@ function finallyAll($tnmt_type, $tnmt, $phase) {
|
||||
|
||||
function final16set() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
//1조1-5조2, 2조1-6조2, 3조1-7조2, 4조1-8조2, 5조1-1조2, 6조1-2조2, 7조1-3조2, 8조1-4조2
|
||||
@@ -523,12 +523,13 @@ function final16set() {
|
||||
$query = "update tournament set prmt=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "update game set tournament=6, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament=6;
|
||||
$gameStor->phase=0;
|
||||
}
|
||||
|
||||
function finalFight($tnmt_type, $tnmt, $phase, $type) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
switch($type) {
|
||||
@@ -541,8 +542,7 @@ function finalFight($tnmt_type, $tnmt, $phase, $type) {
|
||||
$grp = $phase + $offset;
|
||||
fight($tnmt_type, $tnmt, $phase, $grp, 0, 1, 1);
|
||||
|
||||
$query = "update game set phase=phase+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->phase+=1;
|
||||
|
||||
$query = "select * from tournament where grp='$grp' and win>0 and (grp_no=0 or grp_no=1)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -554,18 +554,17 @@ function finalFight($tnmt_type, $tnmt, $phase, $type) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($phase >= $turn) {
|
||||
$query = "update game set tournament='$next', phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tournament = $next;
|
||||
$gameStor->phase = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function setGift($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$genNo = [];
|
||||
$genName = [];
|
||||
@@ -656,8 +655,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
||||
$general2 = MYDB_fetch_array($result);
|
||||
|
||||
//자동진행 끝
|
||||
$query = "update game set tnmt_auto=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tnmt_auto = 0;
|
||||
|
||||
//장수열전 기록
|
||||
$query = "select no from general where no={$general['no']}";
|
||||
@@ -671,8 +669,11 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
||||
|
||||
$cost = $admin['develcost'] * 20;
|
||||
$cost2 = $admin['develcost'] * 12;
|
||||
|
||||
$josaYi1 = JosaUtil::pick($general['name'], '이');
|
||||
$josaYi2 = JosaUtil::pick($general2['name'], '이');
|
||||
$history = [
|
||||
"<S>◆</>{$admin['year']}년 {$admin['month']}월: <C>{$tp}</> 대회에서 <Y>{$general['name']}</>(이)가 <C>우승</>, <Y>{$general2['name']}</>(이)가 <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!",
|
||||
"<S>◆</>{$admin['year']}년 {$admin['month']}월: <C>{$tp}</> 대회에서 <Y>{$general['name']}</>{$josaYi1} <C>우승</>, <Y>{$general2['name']}</>{$josaYi2} <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!",
|
||||
"<S>◆</>{$admin['year']}년 {$admin['month']}월: <C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$cost}</>, <S>준우승자</>에겐 <C>{$cost2}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!"
|
||||
];
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
@@ -693,9 +694,9 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$no = ($general['grp'] - 20) * 2 + $general['grp_no'];
|
||||
|
||||
$query = "select bet{$no},bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$admin = $gameStor->getValues(['bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$admin['bet'] = array_sum($admin);
|
||||
$bet = @round($admin['bet'] / $admin["bet{$no}"], 2);
|
||||
|
||||
//당첨칸에 베팅한 사람들만
|
||||
@@ -715,14 +716,11 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
||||
|
||||
function setRefund() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
//16강자 명성 돈
|
||||
$cost = $admin['develcost'];
|
||||
$cost = $gameStor->develcost;
|
||||
$query = "select no from tournament where grp<10";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
@@ -733,8 +731,7 @@ function setRefund() {
|
||||
}
|
||||
|
||||
//자동진행 끝
|
||||
$query = "update game set tnmt_auto=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gameStor->tnmt_auto = 0;
|
||||
//베팅금 환수
|
||||
$query = "update general set gold=gold+bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -781,50 +778,105 @@ function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
|
||||
//아이템 로그
|
||||
if($gen1['h'] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>(이)가 포효합니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>(이)가 그 위용을 뽐냅니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getHorseName($gen1['h'])."</>(을)를 타고 있습니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>(이)가 갈기를 휘날립니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen1['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>{$josaYi} 포효합니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen1['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>{$josaYi} 그 위용을 뽐냅니다!"; break;
|
||||
case 2:
|
||||
$josaYi = JosaUtil::pick($gen1['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getHorseName($gen1['h']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>{$josaYi} <S>".getHorseName($gen1['h'])."</>{$josaUl} 타고 있습니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen1['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1['h'])."</>{$josaYi} 갈기를 휘날립니다!"; break;
|
||||
}
|
||||
}
|
||||
if($gen1['w'] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>(이)가 번뜩입니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>(이)가 푸르게 빛납니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>에서 살기가 느껴집니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getWeapName($gen1['w'])."</>(이)가 쥐어져 있습니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen1['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>{$josaYi} 번뜩입니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen1['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>{$josaYi} 푸르게 빛납니다!"; break;
|
||||
case 2:
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1['w'])."</>에서 살기가 느껴집니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen1['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getWeapName($gen1['w'])."</>{$josaYi} 쥐어져 있습니다!"; break;
|
||||
}
|
||||
}
|
||||
if($gen1['b'] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1['b'])."</>(을)를 펼쳐듭니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1['b'])."</>(을)를 품에서 꺼냅니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1['b'])."</>(을)를 들고 있습니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getBookName($gen1['b'])."</>(이)가 쥐어져 있습니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick($gen1['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen1['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>{$josaYi} <S>".getBookName($gen1['b'])."</>{$josaUl} 펼쳐듭니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick($gen1['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen1['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>{$josaYi} <S>".getBookName($gen1['b'])."</>{$josaUl} 품에서 꺼냅니다!"; break;
|
||||
case 2:
|
||||
$josaYi = JosaUtil::pick($gen1['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen1['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>{$josaYi} <S>".getBookName($gen1['b'])."</>{$josaUl} 들고 있습니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getBookName($gen1['b']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getBookName($gen1['b'])."</>{$josaYi} 쥐어져 있습니다!"; break;
|
||||
}
|
||||
}
|
||||
if($gen2['h'] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
|
||||
$josaUl = JosaUtil::pick($gen2['h'], '을');
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>(이)가 포효합니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>(이)가 그 위용을 뽐냅니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getHorseName($gen2['h'])."</>(을)를 타고 있습니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>(이)가 갈기를 휘날립니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen2['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>{$josaYi} 포효합니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen2['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>{$josaYi} 그 위용을 뽐냅니다!"; break;
|
||||
case 2:
|
||||
$josaYi = JosaUtil::pick($gen2['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getHorseName($gen2['h']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>{$josaYi} <S>".getHorseName($gen2['h'])."</>{$josaUl} 타고 있습니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getHorseName($gen2['h']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2['h'])."</>{$josaYi} 갈기를 휘날립니다!"; break;
|
||||
}
|
||||
}
|
||||
if($gen2['w'] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>(이)가 번뜩입니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>(이)가 푸르게 빛납니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>에서 살기가 느껴집니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getWeapName($gen2['w'])."</>(이)가 쥐어져 있습니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen2['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>{$josaYi} 번뜩입니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen2['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>{$josaYi} 푸르게 빛납니다!"; break;
|
||||
case 2:
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2['w'])."</>에서 살기가 느껴집니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getWeapName($gen2['w']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getWeapName($gen2['w'])."</>{$josaYi} 쥐어져 있습니다!"; break;
|
||||
}
|
||||
}
|
||||
if($gen2['b'] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
|
||||
switch(rand()%4) {
|
||||
case 0: $log[] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2['b'])."</>(을)를 펼쳐듭니다!"; break;
|
||||
case 1: $log[] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2['b'])."</>(을)를 품에서 꺼냅니다!"; break;
|
||||
case 2: $log[] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2['b'])."</>(을)를 들고 있습니다!"; break;
|
||||
case 3: $log[] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getBookName($gen2['b'])."</>(이)가 쥐어져 있습니다!"; break;
|
||||
case 0:
|
||||
$josaYi = JosaUtil::pick($gen2['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen2['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>{$josaYi} <S>".getBookName($gen2['b'])."</>{$josaUl} 펼쳐듭니다!"; break;
|
||||
case 1:
|
||||
$josaYi = JosaUtil::pick($gen2['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen2['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>{$josaYi} <S>".getBookName($gen2['b'])."</>{$josaUl} 품에서 꺼냅니다!"; break;
|
||||
case 2:
|
||||
$josaYi = JosaUtil::pick($gen2['name'], '이');
|
||||
$josaUl = JosaUtil::pick(getBookName($gen2['b']), '을');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>{$josaYi} <S>".getBookName($gen2['b'])."</>{$josaUl} 들고 있습니다!"; break;
|
||||
case 3:
|
||||
$josaYi = JosaUtil::pick(getBookName($gen2['b']), '이');
|
||||
$log[] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getBookName($gen2['b'])."</>{$josaYi} 쥐어져 있습니다!"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+85
-87
@@ -10,7 +10,7 @@ $userID = Session::getUserID();
|
||||
increaseRefresh("메인", 1);
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if (!$userID) {
|
||||
header('Location:..');
|
||||
@@ -25,6 +25,11 @@ $me = $db->queryFirstRow(
|
||||
//턴 실행.
|
||||
checkTurn();
|
||||
|
||||
if(!$session->isGameLoggedIn()){
|
||||
header('Location:..');
|
||||
die();
|
||||
}
|
||||
|
||||
//그새 사망이면
|
||||
if ($me === null) {
|
||||
$session->logoutGame();
|
||||
@@ -39,65 +44,18 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$query = "select develcost,online,conlimit,tournament,tnmt_type,turnterm,scenario,scenario_text,extended_general,fiction,npcmode,vote from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote']);
|
||||
|
||||
$query = "select plock from plock limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$plock = MYDB_fetch_array($result);
|
||||
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
||||
|
||||
$con = checkLimit($me['con'], $admin['conlimit']);
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$scenario = $admin['scenario_text'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 메인</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../e_lib/jquery.redirect.js"></script>
|
||||
<script src="../d_shared/common_path.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
<script src="js/base_map.js"></script>
|
||||
<script src="js/map.js"></script>
|
||||
<script src="js/msg.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
reloadWorldMap({
|
||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
||||
});
|
||||
|
||||
setInterval(function(){
|
||||
refreshMsg();
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<link href="css/normalize.css" rel="stylesheet">
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link href="css/common.css" rel="stylesheet">
|
||||
<link href="css/main.css" rel="stylesheet">
|
||||
<link href="css/map.css" rel="stylesheet">
|
||||
<link href="css/msg.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
<body class="img_back">
|
||||
|
||||
<div id="container">
|
||||
<div><?=allButton()?></div>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr height=50>
|
||||
<td colspan=5 align=center><font size=4>삼국지 모의전투 HiDCHe (<font color=cyan><?=$scenario?></font>)</font></td>
|
||||
</tr>
|
||||
<?php
|
||||
$valid = 0;
|
||||
if ($admin['extended_general'] == 0) {
|
||||
$extend = "표준";
|
||||
@@ -118,27 +76,69 @@ if ($admin['npcmode'] == 0) {
|
||||
$valid = 1;
|
||||
}
|
||||
$color = "cyan";
|
||||
if ($valid == 1) {
|
||||
echo "
|
||||
<tr height=30>
|
||||
<td width=398 colspan=2 align=center><font color={$color}>{$scenario}</font></td>
|
||||
<td width=198 align=center><font color={$color}>NPC수 : {$extend}</font></td>
|
||||
<td width=198 align=center><font color={$color}>NPC상성 : {$fiction}</font></td>
|
||||
<td width=198 align=center><font color={$color}>NPC선택 : {$npcmode}</font></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<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')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.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('js/map.js')?>
|
||||
<?=WebUtil::printJS('js/msg.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
reloadWorldMap({
|
||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
||||
});
|
||||
|
||||
setInterval(function(){
|
||||
refreshMsg();
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/main.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
<?=WebUtil::printCSS('css/msg.css')?>
|
||||
|
||||
|
||||
</head>
|
||||
<body class="img_back">
|
||||
|
||||
<div id="container">
|
||||
<div><?=allButton()?></div>
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr height=50>
|
||||
<td colspan=5 align=center><font size=4>삼국지 모의전투 HiDCHe (<font color=cyan><?=$scenario?></font>)</font></td>
|
||||
</tr>
|
||||
<?php if ($valid == 1): ?>
|
||||
<tr height=30>
|
||||
<td width=398 colspan=2 align=center><font color=<?=$color?>><?=$scenario?></font></td>
|
||||
<td width=198 align=center><font color=<?=$color?>>NPC수 : <?=$extend?></font></td>
|
||||
<td width=198 align=center><font color=<?=$color?>>NPC상성 : <?=$fiction?></font></td>
|
||||
<td width=198 align=center><font color=<?=$color?>>NPC선택 : <?=$npcmode?></font></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr height=30>
|
||||
<td width=198 align=center><?=info(2)?></td>
|
||||
<td width=198 align=center>전체 접속자 수 : <?=$admin['online']?> 명</td>
|
||||
<td width=198 align=center>턴당 갱신횟수 : <?=$admin['conlimit']?>회</td>
|
||||
<td width=398 colspan=2 align=center><?=info(3)?></td>
|
||||
<td width=198><?=info(2)?></td>
|
||||
<td width=198>전체 접속자 수 : <?=$admin['online']?> 명</td>
|
||||
<td width=198>턴당 갱신횟수 : <?=$admin['conlimit']?>회</td>
|
||||
<td width=398 colspan=2><?=info(3)?></td>
|
||||
</tr>
|
||||
<tr height=30>
|
||||
<td align=center>
|
||||
<td>
|
||||
<?php
|
||||
if ($plock['plock'] == 0) {
|
||||
if (!$plock) {
|
||||
echo "<marquee scrollamount=2><font color=cyan>서버 가동중</font></marquee>";
|
||||
} else {
|
||||
echo "<font color=magenta>서버 동결중</font>";
|
||||
@@ -168,9 +168,7 @@ echo "
|
||||
<td align=center>
|
||||
";
|
||||
|
||||
$query = "select no from auction";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$auctionCount = MYDB_num_rows($result);
|
||||
$auctionCount = $db->queryFirstField('SELECT count(`no`) FROM auction');
|
||||
if ($auctionCount > 0) {
|
||||
echo "<marquee scrollamount=2><font color=cyan>{$auctionCount}건</font> 거래 진행중</marquee>";
|
||||
} else {
|
||||
@@ -182,7 +180,7 @@ echo "
|
||||
<td colspan=2 align=center>
|
||||
";
|
||||
|
||||
$vote = explode("|", $admin['vote']);
|
||||
$vote = $admin['vote']?:[''];
|
||||
$vote[0] = Tag2Code($vote[0]);
|
||||
if ($vote[0] == "") {
|
||||
echo "<font color=magenta>진행중 설문 없음</font>";
|
||||
@@ -195,10 +193,10 @@ echo "
|
||||
</td>
|
||||
</tr>";
|
||||
?>
|
||||
<tr><td colspan=5>접속중인 국가: <?=onlinenation()?></td></tr>
|
||||
<tr><td colspan=5><?php adminMsg(); ?></td></tr>
|
||||
<tr><td colspan=5>【 국가방침 】<?php nationMsg(); ?></td></tr>
|
||||
<tr><td colspan=5>【 접속자 】<?=onlinegen()?></td></tr>
|
||||
<tr><td colspan=5 style="text-align:left;">접속중인 국가: <?=onlinenation()?></td></tr>
|
||||
<tr><td colspan=5 style="text-align:left;"><?=adminMsg()?></td></tr>
|
||||
<tr><td colspan=5 style="text-align:left;">【 국가방침 】<?php nationMsg(); ?></td></tr>
|
||||
<tr><td colspan=5 style="text-align:left;">【 접속자 】<?=onlinegen()?></td></tr>
|
||||
<?php
|
||||
if ($session->userGrade >= 5) {
|
||||
echo "
|
||||
@@ -227,7 +225,7 @@ else if($session->userGrade == 4){
|
||||
?>
|
||||
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr>
|
||||
<td width=698 height=520 colspan=2>
|
||||
<?=getMapHtml()?>
|
||||
@@ -237,7 +235,7 @@ else if($session->userGrade == 4){
|
||||
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
||||
<tr>
|
||||
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
||||
<td width=646><?php cityInfo(); ?></td>
|
||||
<td width=646 style="border:none;text-align:center;"><?php cityInfo(); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
@@ -259,31 +257,31 @@ else if($session->userGrade == 4){
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
<td width=646 align=right style="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>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr>
|
||||
<td width=498><?php myNationInfo(); ?></td>
|
||||
<td width=498><?php myInfo(); ?></td>
|
||||
<td width=498 style="border:none;"><?php myNationInfo(); ?></td>
|
||||
<td width=498 style="border:none;"><?php myInfo(); ?></td>
|
||||
</tr>
|
||||
<tr><td colspan=2><?=commandButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table class="tb_layout bg0">
|
||||
<tr>
|
||||
<td width=498 align=center id=bg1><b>장수 동향</b></td>
|
||||
<td width=498 align=center id=bg1><b>개인 기록</b></td>
|
||||
<td width=498 class='bg1 center'><b>장수 동향</b></td>
|
||||
<td width=498 class='bg1 center'><b>개인 기록</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=498 ><?=getGeneralPublicRecordRecent(15)?></td>
|
||||
<td width=498 ><?=getGenLogRecent($me['no'], 15)?></td>
|
||||
<td width=498 style="text-align:left;"><?=getGeneralPublicRecordRecent(15)?></td>
|
||||
<td width=498 style="text-align:left;"><?=getGenLogRecent($me['no'], 15)?></td>
|
||||
</tr>
|
||||
<tr><td width=998 colspan=2 align=center id=bg1><b>중원 정세</b></td></tr>
|
||||
<tr><td width=998 colspan=2><?=getWorldHistoryRecent(15)?></td></tr>
|
||||
<tr><td width=998 colspan=2 class='bg1 center'><b>중원 정세</b></td></tr>
|
||||
<tr><td width=998 colspan=2 style="text-align:left;"><?=getWorldHistoryRecent(15)?></td></tr>
|
||||
</table>
|
||||
<div class="message_input_form bg0">
|
||||
<select id="mailbox_list" size="1">
|
||||
|
||||
+18
-11
@@ -9,7 +9,14 @@ if(!class_exists('\sammo\DB')){
|
||||
}
|
||||
|
||||
$session = Session::requireLogin();
|
||||
if($session->userGrade < 5){
|
||||
|
||||
$serverName = DB::prefix();
|
||||
$serverAcl = $session->acl[$serverName]??[];
|
||||
$allowReset = in_array('reset', $serverAcl);
|
||||
$allowFullReset = in_array('fullReset',$serverAcl);
|
||||
$allowReset |= $allowFullReset;
|
||||
|
||||
if($session->userGrade < 5 && !$allowReset){
|
||||
die('관리자 아님');
|
||||
}
|
||||
|
||||
@@ -20,14 +27,14 @@ if($session->userGrade < 5){
|
||||
<title>설치</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../e_lib/bootstrap.bundle.min.js"></script>
|
||||
<script src="../e_lib/jquery.validate.min.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/install.js"></script>
|
||||
<link rel="stylesheet" href="css/normalize.css" >
|
||||
<link rel="stylesheet" href="../e_lib/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/install.css" >
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/install.js')?>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('css/install.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" style="min-width:720px;">
|
||||
@@ -154,10 +161,10 @@ if($session->userGrade < 5){
|
||||
<label class="btn btn-secondary">
|
||||
<input type="radio" name="show_img_level" value="1">전콘
|
||||
</label>
|
||||
<label class="btn btn-secondary active">
|
||||
<label class="btn btn-secondary">
|
||||
<input type="radio" name="show_img_level" value="2">전콘, 병종
|
||||
</label>
|
||||
<label class="btn btn-secondary">
|
||||
<label class="btn btn-secondary active">
|
||||
<input type="radio" name="show_img_level" value="3" checked>전콘, 병종, NPC
|
||||
</label>
|
||||
</div>
|
||||
|
||||
+8
-8
@@ -20,14 +20,14 @@ if($session->userGrade == 5){
|
||||
<title>설치</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script src="../e_lib/bootstrap.bundle.min.js"></script>
|
||||
<script src="../e_lib/jquery.validate.min.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="js/install_db.js"></script>
|
||||
<link rel="stylesheet" href="css/normalize.css" >
|
||||
<link rel="stylesheet" href="../e_lib/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/install.css" >
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/install_db.js')?>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('css/install.css')?>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" style="min-width:720px;">
|
||||
|
||||
+56
-6
@@ -5,16 +5,66 @@ include 'lib.php';
|
||||
include "func.php";
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$reserved = $db->queryFirstRow(
|
||||
'SELECT * FROM reserved_open WHERE `date` <= %s LIMIT 1',
|
||||
(new \DateTime())->format('Y-m-d H:i:s')
|
||||
);
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
|
||||
|
||||
if(!$reserved){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'affected'=>0
|
||||
'affected'=>0,
|
||||
'status'=>'no_reserved'
|
||||
]);
|
||||
}
|
||||
|
||||
$reservedDate = new \DateTime($reserved['date']);
|
||||
$now = new \DateTime();
|
||||
|
||||
|
||||
$status = 'not_yet';
|
||||
|
||||
list($isUnited, $lastTurn) = $gameStor->getValuesAsArray(['isunited', 'turntime']);
|
||||
if($isUnited === null || $lastTurn === null){
|
||||
$isUnited = 2;
|
||||
$lastTurn = '2000-01-01';
|
||||
}
|
||||
|
||||
if($lastTurn !== null){
|
||||
$lastTurn = new \DateTime($lastTurn);
|
||||
}
|
||||
|
||||
if($lastTurn === null){
|
||||
//이미 리셋된 상태임
|
||||
}
|
||||
else if(file_exists(__dir__.'/.htaccess')){
|
||||
//일단 서버는 닫혀 있음
|
||||
}
|
||||
else if(
|
||||
$isUnited == 2 &&
|
||||
$now->getTimestamp() - $lastTurn->getTimestamp() > $reservedDate->getTimestamp() - $now->getTimestamp()
|
||||
){
|
||||
//정지 상태 & 중간 넘음
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
else if(
|
||||
$isUnited > 0 &&
|
||||
$now->getTimestamp() - $lastTurn->getTimestamp() > ($reservedDate->getTimestamp() - $now->getTimestamp()) * 2
|
||||
){
|
||||
//천통 & 비정지 상태 & 2/3 넘음
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
else if($reservedDate->getTimestamp() - $now->getTimestamp() <= 60*10){
|
||||
//어쨌든 간에 10분 남았다면.
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
$status = 'closed';
|
||||
}
|
||||
|
||||
if($now < $reservedDate){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'affected'=>0,
|
||||
'status'=>$status
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
const VALID_SECOND = 90;
|
||||
const PICK_MORE_SECOND = 10;
|
||||
const KEEP_CNT = 3;
|
||||
|
||||
|
||||
$refresh = Util::getReq('refresh', 'bool', false);
|
||||
$keepResult = Util::getReq('keep', 'array_int', []);
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
|
||||
$oNow = new \DateTimeImmutable();
|
||||
|
||||
$now = $oNow->format('Y-m-d H:i:s');
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||
if($oldGeneral !== null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'이미 장수가 생성되었습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
list(
|
||||
$maxgeneral,
|
||||
$turnterm,
|
||||
$npcmode
|
||||
) = $gameStor->getValuesAsArray(['maxgeneral', 'turnterm', 'npcmode']);
|
||||
|
||||
if(!$npcmode){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'빙의 가능한 서버가 아닙니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$token = $db->queryFirstRow('SELECT * FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
||||
$pickResult = [];
|
||||
|
||||
|
||||
if($token && $refresh){
|
||||
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
|
||||
$nowT = $oNow->getTimestamp();
|
||||
|
||||
if($nowT >= $pickMoreFrom){
|
||||
$oldPickResult = Json::decode($token['pick_result']);
|
||||
|
||||
foreach($keepResult as $keepId){
|
||||
if(\key_exists($keepId, $oldPickResult) && $oldPickResult[$keepId]['keepCnt'] > 0){
|
||||
$pickResult[$keepId] = $oldPickResult[$keepId];
|
||||
$pickResult[$keepId]['keepCnt']-=1;
|
||||
}
|
||||
}
|
||||
|
||||
if(count($pickResult) == count($oldPickResult)){
|
||||
$refresh = false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'아직 다시 뽑을 수 없습니다',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if($token && !$refresh){
|
||||
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
|
||||
$nowT = $oNow->getTimestamp();
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>Json::decode($token['pick_result']),
|
||||
'pickMoreFrom'=>$token['pick_more_from'],
|
||||
'pickMoreSeconds'=>$pickMoreFrom-$nowT,
|
||||
'validUntil'=>$token['valid_until']
|
||||
]);
|
||||
}
|
||||
|
||||
$candidates = [];
|
||||
|
||||
$weight = [];
|
||||
foreach($db->query('SELECT `no`, `name`, leader, power, intel, imgsvr, picture, special, special2 FROM general WHERE npc=2') as $general){
|
||||
$general['special'] = \sammo\SpecialityConst::DOMESTIC[$general['special']][0]??'-';
|
||||
$general['special2'] = \sammo\SpecialityConst::WAR[$general['special2']][0]??'-';
|
||||
$candidates[$general['no']] = $general + ['keepCnt'=>KEEP_CNT];
|
||||
$allStat = $general['leader'] + $general['power'] + $general['intel'];
|
||||
$weight[$general['no']] = pow($allStat, 1.5);
|
||||
}
|
||||
|
||||
foreach($db->queryFirstColumn('SELECT pick_result FROM select_npc_token WHERE `owner`!=%i AND valid_until >=%s', $userID, $now) as $reserved){
|
||||
$reserved = Json::decode($reserved);
|
||||
foreach(array_keys($reserved) as $reservedNPC){
|
||||
if(key_exists($reservedNPC, $weight)){
|
||||
unset($candidates[$reservedNPC]);
|
||||
unset($weight[$reservedNPC]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pickLimit = min(count($candidates), 5);
|
||||
|
||||
while(count($pickResult) < $pickLimit){
|
||||
$generalID = Util::choiceRandomUsingWeight($weight);
|
||||
if(!key_exists($generalID, $pickResult)){
|
||||
$pickResult[$generalID] = $candidates[$generalID];
|
||||
}
|
||||
}
|
||||
|
||||
$newNonce = mt_rand(0, 0xfffffff);
|
||||
|
||||
$validSecond = max(VALID_SECOND, $turnterm*40);
|
||||
$pickMoreSecond = max(PICK_MORE_SECOND, Util::round(pow($turnterm, 0.672)*8));
|
||||
|
||||
$validUntil = $oNow->add(new \DateInterval(sprintf('PT%dS', $validSecond)));
|
||||
$pickMoreFrom = $oNow->add(new \DateInterval(sprintf('PT%dS', $pickMoreSecond)));
|
||||
|
||||
$db->delete('select_npc_token', 'valid_until < %s', $now);
|
||||
|
||||
$inserted = 0;
|
||||
|
||||
if($token){
|
||||
$db->update('select_npc_token', [
|
||||
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
|
||||
'pick_more_from'=>$pickMoreFrom->format('Y-m-d H:i:s'),
|
||||
'pick_result'=>Json::encode($pickResult),
|
||||
'nonce'=>$newNonce
|
||||
], 'owner = %i AND nonce = %i', $userID, $token['nonce']);
|
||||
if($db->affectedRows()){
|
||||
$inserted = -1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$db->insertIgnore('select_npc_token', [
|
||||
'owner'=>$userID,
|
||||
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
|
||||
'pick_more_from'=>'2000-01-01 01:00:00',
|
||||
'pick_result'=>Json::encode($pickResult),
|
||||
'nonce'=>$newNonce
|
||||
]);
|
||||
|
||||
if($db->affectedRows()){
|
||||
$inserted = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if($inserted === 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'중복 요청, 다시 랜덤 토큰을 확인해주세요'
|
||||
]);
|
||||
}
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>$pickResult,
|
||||
'pickMoreFrom'=>($inserted===-1)?$pickMoreFrom->format('Y-m-d H:i:s'):'2000-01-01 01:00:00',
|
||||
'pickMoreSeconds'=>($inserted===-1)?$pickMoreSecond:0,
|
||||
'validUntil'=>$validUntil->format('Y-m-d H:i:s')
|
||||
]);
|
||||
+54
-5
@@ -5,7 +5,21 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
if($session->userGrade < 5){
|
||||
|
||||
if(!class_exists('\\sammo\\DB')){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'DB리셋 필요'
|
||||
]);
|
||||
}
|
||||
|
||||
$serverName = DB::prefix();
|
||||
$serverAcl = $session->acl[$serverName]??[];
|
||||
$allowReset = in_array('reset', $serverAcl);
|
||||
$allowFullReset = in_array('fullReset',$serverAcl);
|
||||
$allowReset |= $allowFullReset;
|
||||
|
||||
if($session->userGrade < 5 && !$allowReset){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'관리자 아님'
|
||||
@@ -38,6 +52,30 @@ if(!$v->validate()){
|
||||
]);
|
||||
}
|
||||
|
||||
$allowReset = true;
|
||||
if($session->userGrade < 5 && !$allowFullReset){
|
||||
//리셋 가능한 조건인지 테스트
|
||||
$allowReset = false;
|
||||
|
||||
if(file_exists(__dir__.'/.htaccess')){
|
||||
$allowReset = true;
|
||||
}
|
||||
else{
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
$allowReset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$allowReset){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'부족한 권한: 서버가 닫혀있거나, 천통되어 있을 경우에만 리셋 가능합니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$turnterm = (int)$_POST['turnterm'];
|
||||
$sync = (int)$_POST['sync'];
|
||||
$scenario = (int)$_POST['scenario'];
|
||||
@@ -51,10 +89,19 @@ $reserve_open = Util::getReq('reserve_open');
|
||||
if($reserve_open){
|
||||
$reserve_open = new \DateTime($reserve_open);
|
||||
$db = DB::db();
|
||||
|
||||
if (!$db->queryFirstField("SHOW TABLES LIKE 'storage'")) {
|
||||
$clearResult = ResetHelper::clearDB();
|
||||
if(!$clearResult['result']){
|
||||
Json::die($clearResult);
|
||||
}
|
||||
}
|
||||
|
||||
$clearResult = ResetHelper::clearDB();
|
||||
if(!$clearResult['result']){
|
||||
Json::die($clearResult);
|
||||
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'예약 테이블이 없음!'
|
||||
]);
|
||||
}
|
||||
|
||||
$scenarioObj = new Scenario($scenario, true);
|
||||
@@ -69,10 +116,12 @@ if($reserve_open){
|
||||
'extend'=>$extend,
|
||||
'npcmode'=>$npcmode,
|
||||
'show_img_level'=>$show_img_level,
|
||||
'tournament_trig'=>$tournament_trig
|
||||
'tournament_trig'=>$tournament_trig,
|
||||
'gameConf'=>$scenarioObj->getGameConf()
|
||||
]),
|
||||
'date'=>$reserve_open->format('Y-m-d H:i:s')
|
||||
]);
|
||||
AppConf::getList()[DB::prefix()]->closeServer();
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'예약'
|
||||
|
||||
@@ -4,7 +4,14 @@ namespace sammo;
|
||||
require "lib.php";
|
||||
require "func.php";
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
if($session->userGrade < 5){
|
||||
|
||||
$serverName = DB::prefix();
|
||||
$serverAcl = $session->acl[$serverName]??[];
|
||||
$allowReset = in_array('reset', $serverAcl);
|
||||
$allowFullReset = in_array('fullReset',$serverAcl);
|
||||
$allowReset |= $allowFullReset;
|
||||
|
||||
if($session->userGrade < 5 && !$allowReset){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'관리자가 아닙니다.'
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ $defaultPost = [
|
||||
];
|
||||
$post = WebUtil::parseJsonPost() + $defaultPost;
|
||||
|
||||
if(!$session->isLoggedIn() || !$session->generalID){
|
||||
if(!$session->isGameLoggedIn()){
|
||||
$post['neutralView'] = true;
|
||||
$post['showMe'] = false;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ $jsonPost = WebUtil::parseJsonPost();
|
||||
$reqSequence = (int)Util::array_get($jsonPost['sequence'], 0);
|
||||
|
||||
|
||||
list($generalID, $nationID) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation` from `general` where owner = %i',
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation`, `name` from `general` where owner = %i',
|
||||
$userID
|
||||
);
|
||||
|
||||
@@ -58,5 +58,6 @@ $result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence){
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 10, 0));
|
||||
|
||||
$result['sequence'] = $nextSequence;
|
||||
|
||||
$result['nationID'] = $nationID;
|
||||
$result['generalName'] = $generalName;
|
||||
Json::die($result);
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$pick = Util::getReq('pick', 'int');
|
||||
|
||||
if(!$pick){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수를 선택하지 않았습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$session = Session::requireLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$rootDB = RootDB::db();
|
||||
|
||||
$oNow = new \DateTimeImmutable();
|
||||
$now = $oNow->format('Y-m-d H:i:s');
|
||||
|
||||
$userNick = RootDB::db()->queryFirstField('SELECT `NAME` FROM member WHERE `NO`=%i',$userID);
|
||||
if(!$userNick){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'멤버 정보를 가져오지 못했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
|
||||
if(!$pickResult){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'유효한 장수 목록이 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$pickResult = Json::decode($pickResult);
|
||||
if(!key_exists($pick, $pickResult)){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'선택한 장수가 목록에 없습니다.'
|
||||
]);
|
||||
}
|
||||
$pickedNPC = $pickResult[$pick];
|
||||
|
||||
|
||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||
list(
|
||||
$year,
|
||||
$month,
|
||||
$maxgeneral,
|
||||
$npcmode
|
||||
) = $gameStor->getValuesAsArray(['year', 'month', 'maxgeneral', 'npcmode']);
|
||||
|
||||
if(!$npcmode){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'빙의 가능한 서버가 아닙니다'
|
||||
]);
|
||||
}
|
||||
|
||||
if ($gencount >= $maxgeneral) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'더 이상 등록 할 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
//등록 시작
|
||||
$db->update('general', [
|
||||
'name2'=>$userNick,
|
||||
'npc'=>1,
|
||||
'killturn'=>6,
|
||||
'mode'=>2,
|
||||
'owner'=>$userID,
|
||||
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
|
||||
|
||||
if(!$db->affectedRows()){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수 등록에 실패했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$db->delete('select_npc_token', 'owner=%i or valid_until < %s', $userID, $now);
|
||||
|
||||
$josaYi = JosaUtil::pick($userNick, '이');
|
||||
pushGeneralHistory($pickedNPC, "<C>●</>{$year}년 {$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>{$josaYi} 빙의되다.");
|
||||
//pushGenLog($me, $mylog);
|
||||
pushGeneralPublicRecord(["<C>●</>{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>{$josaYi} <S>빙의</>됩니다!"], $year, $month);
|
||||
|
||||
pushAdminLog(["가입 : {$userID} // {$session->userName} // {$pick} // ".getenv("REMOTE_ADDR")]);
|
||||
|
||||
$rootDB->insert('member_log', [
|
||||
'member_no' => $userID,
|
||||
'date'=>date('Y-m-d H:i:s'),
|
||||
'action_type'=>'make_general',
|
||||
'action'=>Json::encode([
|
||||
'server'=>DB::prefix(),
|
||||
'type'=>'npc',
|
||||
'generalID'=>$pickedNPC['no'],
|
||||
'generalName'=>$pickedNPC['name']
|
||||
])
|
||||
]);
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
@@ -17,6 +17,7 @@ if(!class_exists('\\sammo\\DB')){
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if(file_exists(__dir__.'/.htaccess')){
|
||||
$reserved = $db->queryFirstRow(
|
||||
@@ -37,7 +38,8 @@ if(file_exists(__dir__.'/.htaccess')){
|
||||
'turnterm'=>$options['turnterm'],
|
||||
'fictionMode'=>($options['fiction']?'가상':'사실'),
|
||||
'npcMode'=>($options['npcmode']?'가능':'불가'),
|
||||
'openDatetime'=>$reserved['date']
|
||||
'openDatetime'=>$reserved['date'],
|
||||
'gameConf'=>$options['gameConf']
|
||||
],
|
||||
'game'=>null,
|
||||
'me'=>null
|
||||
@@ -46,16 +48,24 @@ if(file_exists(__dir__.'/.htaccess')){
|
||||
|
||||
//TODO: 천통시에도 예약 오픈 알림이 필요..?
|
||||
|
||||
$game = $db->queryFirstRow('SELECT isUnited, npcMode, year, month, scenario, scenario_text, maxgeneral as maxUserCnt, turnTerm from game where `no`=1');
|
||||
$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm']);
|
||||
$admin['maxUserCnt'] = $admin['maxgeneral'];
|
||||
$admin['npcMode'] = $admin['npcmode'];
|
||||
$admin['turnTerm'] = $admin['turnterm'];
|
||||
$admin['isUnited'] = $admin['isunited'];
|
||||
unset($admin['npcmode']);
|
||||
unset($admin['maxgeneral']);
|
||||
unset($admin['turnterm']);
|
||||
unset($admin['isunited']);
|
||||
|
||||
$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
|
||||
$genCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` < 2');
|
||||
$npcCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` >= 2');
|
||||
|
||||
$game['scenario'] = $game['scenario_text'];
|
||||
$game['userCnt'] = $genCnt;
|
||||
$game['npcCnt'] = $npcCnt;
|
||||
$game['nationCnt'] = $nationCnt;
|
||||
$admin['scenario'] = $admin['scenario_text'];
|
||||
$admin['userCnt'] = $genCnt;
|
||||
$admin['npcCnt'] = $npcCnt;
|
||||
$admin['nationCnt'] = $nationCnt;
|
||||
|
||||
$me = [];
|
||||
|
||||
@@ -72,6 +82,6 @@ if($general){
|
||||
|
||||
//TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것.
|
||||
Json::die([
|
||||
'game'=>$game,
|
||||
'game'=>$admin,
|
||||
'me'=>$me?:null
|
||||
]);
|
||||
+21
-16
@@ -23,6 +23,7 @@ if (!$member) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
?>
|
||||
@@ -31,23 +32,27 @@ $connect=$db->get();
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link href="../d_shared/common.css" rel="stylesheet">
|
||||
<link rel='stylesheet' href="css/common.css">
|
||||
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="js/join.js"></script>
|
||||
<script>
|
||||
var defaultStatTotal = <?=GameConst::$defaultStatTotal?>;
|
||||
var defaultStatMin = <?=GameConst::$defaultStatMin?>;
|
||||
var defaultStatMax = <?=GameConst::$defaultStatMax?>;
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/join.js')?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>장 수 생 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td align=center><?=info(0)?></td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select show_img_level,maxgeneral from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect), "");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
$admin = $gameStor->getValues(['show_img_level','maxgeneral']);
|
||||
|
||||
$query = "select no from general where npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect), "");
|
||||
@@ -60,7 +65,7 @@ if ($gencount >= $admin['maxgeneral']) {
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
|
||||
<?php
|
||||
$query = "select name,scoutmsg,color from nation";
|
||||
@@ -81,14 +86,14 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
</table>
|
||||
|
||||
<form name=form1 method=post action=join_post.php>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td colspan=3 align=center id=bg1>장수 생성</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=498 align=right id=bg1>장수명</td>
|
||||
<td colspan=2>
|
||||
<input type=text name=name maxlength=6 size=12 style=color:white;background-color:black; value=<?=$member['name']?>>(6글자 이내)
|
||||
<input type=text name=name maxlength=9 size=18 style=color:white;background-color:black; value=<?=$member['name']?>>(9글자 이내)
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@@ -98,7 +103,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
<tr>
|
||||
<td align=right id=bg1>전콘 사용 여부</td>
|
||||
<td width=64 height=64>
|
||||
<img width='64' height='64' src='{$imageTemp}/{$member['picture']}' border=0>
|
||||
<img width='64' height='64' src='{$imageTemp}/{$member['picture']}' border='0'>
|
||||
</td>
|
||||
<td>
|
||||
<input type=checkbox name=pic value=1 checked>사용
|
||||
@@ -156,13 +161,13 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center colspan=3>
|
||||
<font color=orange>모든 능력치는 ( 10 <= 능력치 <= 75 ) 사이로 잡으셔야 합니다.<br>
|
||||
<font color=orange>모든 능력치는 ( 10 <= 능력치 <= <?=GameConst::$defaultStatMax?> ) 사이로 잡으셔야 합니다.<br>
|
||||
그 외의 능력치는 가입되지 않습니다.</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center colspan=3>
|
||||
능력치의 총합은 150입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
|
||||
능력치의 총합은 <?=GameConst::$defaultStatTotal?>입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
|
||||
임의의 도시에서 재야로 시작하며 건국과 임관은 게임 내에서 실행합니다.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -172,7 +177,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+21
-19
@@ -18,17 +18,17 @@ $v
|
||||
'intel',
|
||||
'character',
|
||||
])
|
||||
->rule('lengthBetween', 'name', 1, 6)
|
||||
->rule('lengthBetween', 'name', 1, 9)
|
||||
->rule('min', [
|
||||
'leader',
|
||||
'power',
|
||||
'intel'
|
||||
], 10)
|
||||
], GameConst::$defaultStatMin)
|
||||
->rule('max', [
|
||||
'leader',
|
||||
'power',
|
||||
'intel'
|
||||
], 75)
|
||||
], GameConst::$defaultStatMax)
|
||||
->rule('min', 'character', 0)
|
||||
->rule('max', 'character', 11);
|
||||
|
||||
@@ -66,9 +66,10 @@ if (!$member) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','genius','npcmode']);
|
||||
########## 동일 정보 존재여부 확인. ##########
|
||||
|
||||
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,scenario,show_img_level,turnterm,genius,npcmode from game limit 1');
|
||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
|
||||
@@ -87,7 +88,7 @@ if ($oldName) {
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if ($admin['maxgeneral'] <= $gencount) {
|
||||
if ($gameStor->maxgeneral <= $gencount) {
|
||||
echo("<script>
|
||||
window.alert('더이상 등록할 수 없습니다!')
|
||||
history.go(-1)
|
||||
@@ -101,16 +102,16 @@ if (mb_strlen($name) < 1) {
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if (mb_strlen($name) > 6) {
|
||||
if (mb_strlen($name) > 9) {
|
||||
echo("<script>
|
||||
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
}
|
||||
if ($leader + $power + $intel > 150) {
|
||||
if ($leader + $power + $intel > GameConst::$defaultStatTotal) {
|
||||
echo("<script>
|
||||
window.alert('능력치가 150을 넘어섰습니다. 다시 가입해주세요!')
|
||||
window.alert('능력치가 ".GameConst::$defaultStatTotal."을 넘어섰습니다. 다시 가입해주세요!')
|
||||
history.go(-1)
|
||||
</script>");
|
||||
exit;
|
||||
@@ -118,10 +119,8 @@ if ($leader + $power + $intel > 150) {
|
||||
|
||||
$genius = Util::randBool(0.01);
|
||||
// 현재 1%
|
||||
if ($genius && $admin['genius'] > 0) {
|
||||
$db->update('game', [
|
||||
'genius'=>$db->sqleval('genius-1')
|
||||
], true);
|
||||
if ($genius && $gameStor->genius > 0) {
|
||||
$gameStor->genius = $gameStor->genius-1;
|
||||
} else {
|
||||
$genius = false;
|
||||
}
|
||||
@@ -166,6 +165,8 @@ if ($genius) {
|
||||
$specage = Util::round((80 - $age)/12) + $age;
|
||||
$special = 0;
|
||||
|
||||
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level']);
|
||||
|
||||
if ($admin['scenario'] > 0) {
|
||||
$specage2 = $age + 3;
|
||||
$specage = $age + 3;
|
||||
@@ -238,15 +239,16 @@ $me = [
|
||||
$log = [];
|
||||
$mylog = [];
|
||||
|
||||
$josaRa = JosaUtil::pick($name, '라');
|
||||
if ($genius) {
|
||||
$log[0] = "<C>●</>{$admin['month']}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
|
||||
$log[1] = "<C>●</>{$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.";
|
||||
$log[1] = "<C>●</>{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
|
||||
|
||||
pushWorldHistory(["<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $admin['year'], $admin['month']);
|
||||
pushWorldHistory(["<C>●</>{$gameStor->year}년 {$gameStor->month}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $gameStor->year, $gameStor->month);
|
||||
} else {
|
||||
$log[0] = "<C>●</>{$admin['month']}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 호걸이 천하에 이름을 알립니다.";
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.";
|
||||
}
|
||||
pushGeneralHistory($me, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
|
||||
pushGeneralHistory($me, "<C>●</>{$gameStor->year}년 {$gameStor->month}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
|
||||
$mylog[] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
|
||||
$mylog[] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,";
|
||||
$mylog[] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~";
|
||||
@@ -255,10 +257,10 @@ $mylog[] = "<C>●</>통솔 <C>$pleader</> 무력 <C>$ppower</> 지력 <C>$pinte
|
||||
$mylog[] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
|
||||
if ($genius) {
|
||||
$mylog[] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
|
||||
pushGeneralHistory($me, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
|
||||
pushGeneralHistory($me, "<C>●</>{$gameStor->year}년 {$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
|
||||
}
|
||||
pushGenLog($me, $mylog);
|
||||
pushGeneralPublicRecord($log, $admin['year'], $admin['month']);
|
||||
pushGeneralPublicRecord($log, $gameStor->year, $gameStor->month);
|
||||
|
||||
pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR")]);
|
||||
|
||||
|
||||
@@ -118,4 +118,14 @@ var TemplateEngine = function (html, options) {
|
||||
try { result = new Function('obj', code).apply(options, [options]); }
|
||||
catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
|
||||
return result;
|
||||
}
|
||||
|
||||
function getIconPath(imgsvr, picture){
|
||||
// ../d_shared/common_path.js 필요
|
||||
if(!imgsvr){
|
||||
return pathConfig.sharedIcon+'/'+picture;
|
||||
}
|
||||
else{
|
||||
return pathConfig.root+'/d_pic/'+picture;
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -39,8 +39,9 @@ function loadScenarios(){
|
||||
|
||||
$.each(result.scenario, function(idx, value){
|
||||
var title = value.title || "-";
|
||||
var titles = title.split(/【|[0-9]*】/);
|
||||
var category = titles.length>2?titles[1]:'-';
|
||||
var pat = /【(.*?)[0-9\-_\.a-zA-Z]*】/;
|
||||
var category = pat.exec(title);
|
||||
category = category?category[1]:'-';
|
||||
|
||||
value.title = title;
|
||||
value.category = category;
|
||||
|
||||
+59
-46
@@ -1,7 +1,5 @@
|
||||
|
||||
jQuery(function($){
|
||||
|
||||
var totalAbil = 150;
|
||||
var $leader = $('#leader');
|
||||
var $power = $('#power');
|
||||
var $intel = $('#intel');
|
||||
@@ -12,16 +10,16 @@ jQuery(function($){
|
||||
var intel = Math.random()*65 + 10;
|
||||
var rate = leader + power + intel;
|
||||
|
||||
leader = Math.floor(leader / rate * totalAbil);
|
||||
power = Math.floor(power / rate * totalAbil);
|
||||
intel = Math.floor(intel / rate * totalAbil);
|
||||
leader = Math.floor(leader / rate * defaultStatTotal);
|
||||
power = Math.floor(power / rate * defaultStatTotal);
|
||||
intel = Math.floor(intel / rate * defaultStatTotal);
|
||||
|
||||
|
||||
while(leader+power+intel < totalAbil){
|
||||
while(leader+power+intel < defaultStatTotal){
|
||||
leader+=1;
|
||||
}
|
||||
|
||||
if(leader > 75 || power > 75 || intel > 75 || leader < 10 || power < 10 || intel < 10){
|
||||
if(leader > defaultStatMax || power > defaultStatMax || intel > defaultStatMax || leader < defaultStatMin || power < defaultStatMin || intel < defaultStatMin){
|
||||
return abilityRand();
|
||||
}
|
||||
|
||||
@@ -37,27 +35,32 @@ jQuery(function($){
|
||||
var intel = Math.random() * 1;
|
||||
var rate = leader + power + intel;
|
||||
|
||||
leader = Math.floor(leader / rate * totalAbil);
|
||||
power = Math.floor(power / rate * totalAbil);
|
||||
intel = Math.floor(intel / rate * totalAbil);
|
||||
leader = Math.floor(leader / rate * defaultStatTotal);
|
||||
power = Math.floor(power / rate * defaultStatTotal);
|
||||
intel = Math.floor(intel / rate * defaultStatTotal);
|
||||
|
||||
while(leader+power+intel < totalAbil){
|
||||
while(leader+power+intel < defaultStatTotal){
|
||||
power+=1;
|
||||
}
|
||||
|
||||
if(intel < 10){
|
||||
leader -= 10 - intel;
|
||||
intel = 10;
|
||||
if(intel < defaultStatMin){
|
||||
leader -= defaultStatMin - intel;
|
||||
intel = defaultStatMin;
|
||||
}
|
||||
|
||||
if(leader > 75){
|
||||
power += leader - 75;
|
||||
leader = 75;
|
||||
if(leader > defaultStatMax){
|
||||
power += leader - defaultStatMax;
|
||||
leader = defaultStatMax;
|
||||
}
|
||||
|
||||
if(power > 75){
|
||||
leader += power - 75;
|
||||
power = 75;
|
||||
if(power > defaultStatMax){
|
||||
leader += power - defaultStatMax;
|
||||
power = defaultStatMax;
|
||||
}
|
||||
|
||||
if(leader > defaultStatMax){
|
||||
intel += leader - defaultStatMax;
|
||||
leader = defaultStatMax;
|
||||
}
|
||||
|
||||
$leader.val(leader);
|
||||
@@ -71,27 +74,32 @@ jQuery(function($){
|
||||
var intel = Math.random() * 6;
|
||||
var rate = leader + power + intel;
|
||||
|
||||
leader = Math.floor(leader / rate * totalAbil);
|
||||
power = Math.floor(power / rate * totalAbil);
|
||||
intel = Math.floor(intel / rate * totalAbil);
|
||||
leader = Math.floor(leader / rate * defaultStatTotal);
|
||||
power = Math.floor(power / rate * defaultStatTotal);
|
||||
intel = Math.floor(intel / rate * defaultStatTotal);
|
||||
|
||||
while(leader+power+intel < totalAbil){
|
||||
while(leader+power+intel < defaultStatTotal){
|
||||
intel+=1;
|
||||
}
|
||||
|
||||
if(power < 10){
|
||||
leader -= 10 - power;
|
||||
power = 10;
|
||||
if(power < defaultStatMin){
|
||||
leader -= defaultStatMin - power;
|
||||
power = defaultStatMin;
|
||||
}
|
||||
|
||||
if(leader > 75){
|
||||
intel += leader - 75;
|
||||
leader = 75;
|
||||
if(leader > defaultStatMax){
|
||||
intel += leader - defaultStatMax;
|
||||
leader = defaultStatMax;
|
||||
}
|
||||
|
||||
if(intel > 75){
|
||||
leader += intel - 75;
|
||||
intel = 75;
|
||||
if(intel > defaultStatMax){
|
||||
leader += intel - defaultStatMax;
|
||||
intel = defaultStatMax;
|
||||
}
|
||||
|
||||
if(leader > defaultStatMax){
|
||||
power += leader - defaultStatMax;
|
||||
leader = defaultStatMax;
|
||||
}
|
||||
|
||||
$leader.val(leader);
|
||||
@@ -105,27 +113,32 @@ jQuery(function($){
|
||||
var intel = Math.random() * 6;
|
||||
var rate = leader + power + intel;
|
||||
|
||||
leader = Math.floor(leader / rate * totalAbil);
|
||||
power = Math.floor(power / rate * totalAbil);
|
||||
intel = Math.floor(intel / rate * totalAbil);
|
||||
leader = Math.floor(leader / rate * defaultStatTotal);
|
||||
power = Math.floor(power / rate * defaultStatTotal);
|
||||
intel = Math.floor(intel / rate * defaultStatTotal);
|
||||
|
||||
while(leader+power+intel < totalAbil){
|
||||
while(leader+power+intel < defaultStatTotal){
|
||||
intel+=1;
|
||||
}
|
||||
|
||||
if(leader < 10){
|
||||
power -= 10 - leader;
|
||||
leader = 10;
|
||||
if(leader < defaultStatMin){
|
||||
power -= defaultStatMin - leader;
|
||||
leader = defaultStatMin;
|
||||
}
|
||||
|
||||
if(power > 75){
|
||||
intel += power - 75;
|
||||
power = 75;
|
||||
if(power > defaultStatMax){
|
||||
intel += power - defaultStatMax;
|
||||
power = defaultStatMax;
|
||||
}
|
||||
|
||||
if(intel > 75){
|
||||
power += intel - 75;
|
||||
intel = 75;
|
||||
if(intel > defaultStatMax){
|
||||
power += intel - defaultStatMax;
|
||||
intel = defaultStatMax;
|
||||
}
|
||||
|
||||
if(power > defaultStatMax){
|
||||
leader += power - defaultStatMax;
|
||||
power = defaultStatMax;
|
||||
}
|
||||
|
||||
$leader.val(leader);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user