Compare commits
183
Commits
v0.6.0-pre
..
v0.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aafe6d8863 | ||
|
|
47005483cd | ||
|
|
378075955a | ||
|
|
2059797904 | ||
|
|
8c711242a9 | ||
|
|
481894c89b | ||
|
|
ba53275322 | ||
|
|
cfe2b4c1bd | ||
|
|
60e83f8324 | ||
|
|
ceac040d82 | ||
|
|
89d400c81a | ||
|
|
4cf7bca399 | ||
|
|
761441622e | ||
|
|
1b814abf0b | ||
|
|
62a2147e33 | ||
|
|
246dff9c87 | ||
|
|
50494beb27 | ||
|
|
ce3b3ebfd8 | ||
|
|
213090c32e | ||
|
|
adb8668197 | ||
|
|
0023677003 | ||
|
|
0b19a37ad4 | ||
|
|
9f34ae5d28 | ||
|
|
6f07b5cf08 | ||
|
|
0f39431157 | ||
|
|
bc1a470e64 | ||
|
|
09e24f5684 | ||
|
|
2f27ea4c8a | ||
|
|
d09aba70b7 | ||
|
|
69b0a80684 | ||
|
|
48f0c56a9e | ||
|
|
83833a3693 | ||
|
|
18429d52d4 | ||
|
|
58cc90083b | ||
|
|
2772161144 | ||
|
|
0e95259b14 | ||
|
|
3d9f38f1e3 | ||
|
|
ba3accd834 | ||
|
|
0786e40ebd | ||
|
|
8a56393159 | ||
|
|
5ca8a6ecfa | ||
|
|
5c82edc4be | ||
|
|
093c04bc24 | ||
|
|
131dd46a38 | ||
|
|
6b1b4fdfbb | ||
|
|
e4ad779b37 | ||
|
|
65d817624e | ||
|
|
66501189c4 | ||
|
|
4303898bb8 | ||
|
|
7d76a9d3ed | ||
|
|
1cc42f341b | ||
|
|
0b41ee0a29 | ||
|
|
66b6c4d04f | ||
|
|
6502843d6c | ||
|
|
5ecfe72e19 | ||
|
|
f28cdefffe | ||
|
|
40494f2cf1 | ||
|
|
f2664c112b | ||
|
|
41d91df355 | ||
|
|
965671dd93 | ||
|
|
c8d08e4b2c | ||
|
|
2897a9b484 | ||
|
|
d190e59d83 | ||
|
|
0bb25e8773 | ||
|
|
37e1903cb1 | ||
|
|
b402846d43 | ||
|
|
c1a6dd385a | ||
|
|
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 | ||
|
|
c39794c086 | ||
|
|
6aaa50364b | ||
|
|
95a22f228c | ||
|
|
eac92293fc |
@@ -15,6 +15,7 @@ d_log/*.txt
|
||||
d_log/*.zip
|
||||
sess_*
|
||||
*/logs/*.txt
|
||||
*/logs/*/*.txt
|
||||
err.txt
|
||||
che/.htaccess
|
||||
kwe/.htaccess
|
||||
@@ -38,6 +39,9 @@ test.php
|
||||
/che
|
||||
/kwe
|
||||
/pwe
|
||||
/nya
|
||||
/pya
|
||||
/twe
|
||||
|
||||
phpinfo.php
|
||||
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
|
||||
|
||||
Vendored
+5
-1
@@ -5,11 +5,13 @@
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/logs/*.txt": true,
|
||||
"**/logs/**/*.txt": true,
|
||||
"**/session/sess*":true,
|
||||
"/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,
|
||||
},
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
* Apache2
|
||||
* <code>mpm_event</code> 권장
|
||||
* PHP 7.0 이상
|
||||
* PHP 7.2 이상
|
||||
* <code>php-fpm</code> 권장
|
||||
* php에서 curl을 실행가능해야 합니다.
|
||||
* MySQL 5.6 이상, 또는 MariaDB 10.0 이상
|
||||
@@ -32,13 +32,13 @@ sudo -u www-data git clone ssh://git@storage.hided.net:2525/devsam/core.git
|
||||
git clone ssh://git@storage.hided.net:2525/devsam/image.git
|
||||
```
|
||||
|
||||
> 이미지는 별도의 업데이트 기능을 제공하지 않습니다. 수동으로 <code>git pull</code>을 해야합니다.
|
||||
> 이미지는 git hook을 이용한 업데이트 기능을 제공하지만 아직 범용성 있는 설계가 되어있진 않습니다.
|
||||
|
||||
### 설치
|
||||
|
||||
이후 해당 경로를 웹 브라우저를 통해 접근하여 설치를 진행할 수 있습니다.
|
||||
|
||||
Database 수는 로그인 관리 서버 1개, 내부 서버 5개로, 총 6개의 Database가 필요합니다. 내부 설정을 고쳐서 서버 수를 늘리거나 줄일 경우 그에 맞는 Database 수가 필요합니다. 또한 Database마다 관리할 별도의 계정을 만드는 것을 추천합니다.
|
||||
Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의 Database가 필요합니다. 내부 설정을 고쳐서 서버 수를 늘리거나 줄일 경우 그에 맞는 Database 수가 필요합니다. 또한 Database마다 관리할 별도의 계정을 만드는 것을 추천합니다.
|
||||
|
||||
설치 이후에는 서버관리 페이지에서 **업데이트** 명령을 통해 원 클릭 업데이트가 가능합니다.
|
||||
|
||||
|
||||
+3
-1
@@ -17,7 +17,9 @@
|
||||
"vlucas/valitron": "^1.4",
|
||||
"php-extended/php-tail": "^2.1",
|
||||
"pguardiario/phpuri": "^1.0",
|
||||
"symfony/lock": "^3.4"
|
||||
"symfony/lock": "^4.1",
|
||||
"ezyang/htmlpurifier": "^4.10",
|
||||
"xemlock/htmlpurifier-html5": "^0.1.7"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Generated
+135
-153
@@ -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": "a329d39be5161c87438d41f9adf4417b",
|
||||
"content-hash": "43da7d5e9d8441faa4311f32b16ee1c0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brandonwamboldt/utilphp",
|
||||
@@ -52,6 +52,53 @@
|
||||
],
|
||||
"time": "2015-02-02T17:56:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ezyang/htmlpurifier",
|
||||
"version": "v4.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ezyang/htmlpurifier.git",
|
||||
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
|
||||
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"simpletest/simpletest": "^1.1"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"HTMLPurifier": "library/"
|
||||
},
|
||||
"files": [
|
||||
"library/HTMLPurifier.composer.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Edward Z. Yang",
|
||||
"email": "admin@htmlpurifier.org",
|
||||
"homepage": "http://ezyang.com"
|
||||
}
|
||||
],
|
||||
"description": "Standards compliant HTML filter written in PHP",
|
||||
"homepage": "http://htmlpurifier.org/",
|
||||
"keywords": [
|
||||
"html"
|
||||
],
|
||||
"time": "2018-02-23T01:58:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firephp/firephp-core",
|
||||
"version": "v0.4.0",
|
||||
@@ -90,16 +137,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.3.2",
|
||||
"version": "6.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90"
|
||||
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90",
|
||||
"reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
|
||||
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -109,7 +156,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-curl": "*",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
||||
"psr/log": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -151,7 +198,7 @@
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2018-03-26T16:33:04+00:00"
|
||||
"time": "2018-04-22T15:46:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@@ -271,16 +318,16 @@
|
||||
},
|
||||
{
|
||||
"name": "leafo/scssphp",
|
||||
"version": "v0.7.5",
|
||||
"version": "v0.7.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/leafo/scssphp.git",
|
||||
"reference": "8b538d828bbb75276974605c4a1a435e939da74e"
|
||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/8b538d828bbb75276974605c4a1a435e939da74e",
|
||||
"reference": "8b538d828bbb75276974605c4a1a435e939da74e",
|
||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -319,7 +366,7 @@
|
||||
"scss",
|
||||
"stylesheet"
|
||||
],
|
||||
"time": "2018-02-09T02:04:21+00:00"
|
||||
"time": "2018-05-24T02:18:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/plates",
|
||||
@@ -454,54 +501,6 @@
|
||||
],
|
||||
"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",
|
||||
@@ -528,16 +527,16 @@
|
||||
},
|
||||
{
|
||||
"name": "php-extended/php-system",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-extended/php-system.git",
|
||||
"reference": "66727d5dc0a665916bd7e08bcfb9820e7be1d20c"
|
||||
"url": "https://gitlab.com/php-extended/php-system.git",
|
||||
"reference": "9e6b3c2009ef56dc123efc43900e40cdf217ace0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-extended/php-system/zipball/66727d5dc0a665916bd7e08bcfb9820e7be1d20c",
|
||||
"reference": "66727d5dc0a665916bd7e08bcfb9820e7be1d20c",
|
||||
"url": "https://gitlab.com/api/v4/projects/php-extended%2Fphp-system/repository/archive.zip?sha=9e6b3c2009ef56dc123efc43900e40cdf217ace0",
|
||||
"reference": "9e6b3c2009ef56dc123efc43900e40cdf217ace0",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
@@ -553,31 +552,31 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anastaszor",
|
||||
"role": "developer"
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A generic way to find informations about the running system",
|
||||
"homepage": "https://github.com/php-extended/php-system",
|
||||
"homepage": "https://gitlab.com/php-extended/php-system",
|
||||
"keywords": [
|
||||
"operating system",
|
||||
"os",
|
||||
"php",
|
||||
"system"
|
||||
],
|
||||
"time": "2017-01-14T11:56:24+00:00"
|
||||
"time": "2018-06-07T06:03:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-extended/php-tail",
|
||||
"version": "2.1.1",
|
||||
"version": "2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-extended/php-tail.git",
|
||||
"reference": "eabf7bee64f8c30fe9b9e1176562fdb903c54ae7"
|
||||
"url": "https://gitlab.com/php-extended/php-tail.git",
|
||||
"reference": "19fbd3a79ccc071954f28296b2c44754335304a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-extended/php-tail/zipball/eabf7bee64f8c30fe9b9e1176562fdb903c54ae7",
|
||||
"reference": "eabf7bee64f8c30fe9b9e1176562fdb903c54ae7",
|
||||
"url": "https://gitlab.com/api/v4/projects/php-extended%2Fphp-tail/repository/archive.zip?sha=19fbd3a79ccc071954f28296b2c44754335304a0",
|
||||
"reference": "19fbd3a79ccc071954f28296b2c44754335304a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -596,11 +595,11 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anastaszor",
|
||||
"role": "developer"
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A smart way to tail files depending of the environment",
|
||||
"homepage": "https://github.com/php-extended/php-tail",
|
||||
"homepage": "https://gitlab.com/php-extended/php-tail",
|
||||
"keywords": [
|
||||
"cheat",
|
||||
"mighty",
|
||||
@@ -608,7 +607,7 @@
|
||||
"php",
|
||||
"tail"
|
||||
],
|
||||
"time": "2017-07-25T13:52:42+00:00"
|
||||
"time": "2018-06-07T06:04:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
@@ -752,22 +751,21 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/lock",
|
||||
"version": "v3.4.9",
|
||||
"version": "v4.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/lock.git",
|
||||
"reference": "3a707193326d31603824706e34a95af899a59788"
|
||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/3a707193326d31603824706e34a95af899a59788",
|
||||
"reference": "3a707193326d31603824706e34a95af899a59788",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/polyfill-php70": "~1.0"
|
||||
"php": "^7.1.3",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"predis/predis": "~1.0"
|
||||
@@ -775,7 +773,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.4-dev"
|
||||
"dev-master": "4.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -810,96 +808,40 @@
|
||||
"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"
|
||||
"time": "2018-05-30T07:26:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/valitron",
|
||||
"version": "v1.4.2",
|
||||
"version": "v1.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vlucas/valitron.git",
|
||||
"reference": "87775d76268beda2afa085bdd6e44b17e98907c6"
|
||||
"reference": "3c5463315bfa23b17f8949b100a960d035234e43"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vlucas/valitron/zipball/87775d76268beda2afa085bdd6e44b17e98907c6",
|
||||
"reference": "87775d76268beda2afa085bdd6e44b17e98907c6",
|
||||
"url": "https://api.github.com/repos/vlucas/valitron/zipball/3c5463315bfa23b17f8949b100a960d035234e43",
|
||||
"reference": "3c5463315bfa23b17f8949b100a960d035234e43",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "It can support the multiple bytes string length."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Valitron": "src/"
|
||||
"psr-4": {
|
||||
"Valitron\\": "src/Valitron"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD"
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
@@ -915,7 +857,47 @@
|
||||
"validation",
|
||||
"validator"
|
||||
],
|
||||
"time": "2017-10-30T23:15:06+00:00"
|
||||
"time": "2018-05-06T10:45:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "xemlock/htmlpurifier-html5",
|
||||
"version": "v0.1.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/xemlock/htmlpurifier-html5.git",
|
||||
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/xemlock/htmlpurifier-html5/zipball/b4b35e51ec75e0207c23035f7d9a354bdcdac359",
|
||||
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ezyang/htmlpurifier": "^4.7",
|
||||
"php": ">=5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.7.*|5.7.*"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"library/HTMLPurifier/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "xemlock",
|
||||
"email": "xemlock@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "HTML Purifier definitions for HTML5 elements",
|
||||
"time": "2018-06-07T14:30:17+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
||||
Binary file not shown.
@@ -128,6 +128,14 @@ body{
|
||||
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;
|
||||
}
|
||||
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
@@ -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');
|
||||
|
||||
@@ -29,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,
|
||||
@@ -59,7 +60,7 @@ ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
###################
|
||||
# KV storage
|
||||
###################
|
||||
CREATE TABLE `storage` (
|
||||
CREATE TABLE if not exists `storage` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`namespace` VARCHAR(40) NOT NULL,
|
||||
`key` VARCHAR(40) NOT NULL,
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
switch($btn) {
|
||||
case "분당김":
|
||||
$gameStor->cacheValues('turntime', 'starttime', 'tnmt_time');
|
||||
$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"));
|
||||
@@ -47,7 +47,7 @@ case "분당김":
|
||||
], true);
|
||||
break;
|
||||
case "분지연":
|
||||
$gameStor->cacheValues('turntime', 'starttime', 'tnmt_time');
|
||||
$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"));
|
||||
|
||||
@@ -19,6 +19,7 @@ if($session->userGrade < 5) {
|
||||
$generalID = $session->generalID;
|
||||
if(!$generalID){
|
||||
header('location:_admin2.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
@@ -111,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;
|
||||
|
||||
+14
-1
@@ -13,11 +13,11 @@ if($session->userGrade < 5) {
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$genlist = Util::getReq('genlist', 'array_int');
|
||||
$msg = Util::getReq('msg','string', '메시지');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//NOTE: 왜 기능이 admin2와 admin4가 같이 있는가?
|
||||
//NOTE: 왜 블럭 시 admin4에선 금쌀을 없애지 않는가?
|
||||
@@ -57,7 +57,20 @@ switch($btn) {
|
||||
case "메세지 전달":
|
||||
//TODO:새 갠메 시스템으로 변경
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$msgObj = new Message(
|
||||
Message::MSGTYPE_PRIVATE,
|
||||
$src,
|
||||
MessageTarget::buildQuick($genlist[$i]),
|
||||
$msg,
|
||||
new DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
if($msgObj){
|
||||
$msgObj->send(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ $sel[$type] = "selected";
|
||||
<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>
|
||||
|
||||
+24
-21
@@ -82,7 +82,7 @@ $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);
|
||||
|
||||
$game_env = $gameStor->getAll();
|
||||
$admin = $gameStor->getAll();
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
@@ -172,7 +172,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
$opposecount = 0;
|
||||
}
|
||||
|
||||
$warphase = getRate($game_env, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
|
||||
$warphase = getRate($admin, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
|
||||
|
||||
// 우선 스케일링
|
||||
$city['def'] *= 10;
|
||||
@@ -188,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) {
|
||||
@@ -300,7 +301,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game_env, $general['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $avoid == 1) {
|
||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
||||
$myCrew /= 10; // 10%만 소모
|
||||
@@ -378,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) {
|
||||
@@ -664,7 +667,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game_env, $general['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $myAvoid == 1) {
|
||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
||||
$myCrew /= 10; // 10%만 소모
|
||||
@@ -672,7 +675,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
}
|
||||
//회피
|
||||
$ratio = rand() % 100; // 0 ~ 99
|
||||
$ratio2 = getRate($game_env, $oppose['crewtype'], "avd"); //회피율
|
||||
$ratio2 = getRate($admin, $oppose['crewtype'], "avd"); //회피율
|
||||
if($ratio < $ratio2 && $opAvoid == 1) {
|
||||
$msg .= "<C>●</>상대가 <R>회피</>했다!</><br>";
|
||||
$opCrew /= 10; // 10%만 소모
|
||||
@@ -801,8 +804,8 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
|
||||
|
||||
$def = 7000;
|
||||
$wall = 7000;
|
||||
$train3 = $game_env['city_rate'];
|
||||
$atmos3 = $game_env['city_rate'];
|
||||
$train3 = $admin['city_rate'];
|
||||
$atmos3 = $admin['city_rate'];
|
||||
}
|
||||
|
||||
switch($level1) {
|
||||
@@ -1597,31 +1600,31 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
|
||||
<?php
|
||||
for($i=0; $i <= 5; $i++) {
|
||||
printSimul($game_env, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=10; $i <= 14; $i++) {
|
||||
printSimul($game_env, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=20; $i <= 27; $i++) {
|
||||
printSimul($game_env, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=30; $i <= 38; $i++) {
|
||||
printSimul($game_env, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
|
||||
for($i=40; $i <= 43; $i++) {
|
||||
printSimul($game_env, $i);
|
||||
printSimul($admin, $i);
|
||||
}
|
||||
echo "
|
||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
||||
@@ -1632,13 +1635,13 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
|
||||
</html>
|
||||
<?php
|
||||
|
||||
function printSimul($game_env, $i) {
|
||||
$att = $game_env["att{$i}"];
|
||||
$def = $game_env["def{$i}"];
|
||||
$spd = $game_env["spd{$i}"];
|
||||
$avd = $game_env["avd{$i}"];
|
||||
$cst = $game_env["cst{$i}"];
|
||||
$ric = $game_env["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>
|
||||
|
||||
+135
-283
@@ -14,19 +14,9 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("명장일람", 2);
|
||||
increaseRefresh("명장일람", 1);
|
||||
|
||||
$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']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -36,14 +26,14 @@ if ($con >= 2) {
|
||||
<title><?=UniqueConst::$serverName?>: 명장일람</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1100 class='tb_layout bg0'>
|
||||
<tr><td>명 장 일 람<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1100 class='tb_layout bg0'>
|
||||
<form name=form1 action=a_bestGeneral.php method=post>
|
||||
<tr><td align=center>
|
||||
<input type=submit name=btn value='유저 보기'>
|
||||
@@ -51,294 +41,156 @@ if ($con >= 2) {
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<div style="margin:auto;width=1000px;">
|
||||
<?php
|
||||
if (isset($btn) && $btn == "NPC 보기") {
|
||||
//FIXME: query가 너무 적나라.
|
||||
$sel = "npc>=2";
|
||||
} else {
|
||||
$sel = "npc<2";
|
||||
}
|
||||
|
||||
$nationName = ['재야'];
|
||||
$nationColor = ['#000000'];
|
||||
|
||||
$nationName = [0=>'재야'];
|
||||
$nationColor = [0=>'#000000'];
|
||||
foreach (getAllNationStaticInfo() as $nation) {
|
||||
$nationName[$nation['nation']] = $nation['name'];
|
||||
$nationColor[$nation['nation']] = $nation['color'];
|
||||
}
|
||||
|
||||
$type = array(
|
||||
"명 성",
|
||||
"계 급",
|
||||
"계 략 성 공",
|
||||
"전 투 횟 수",
|
||||
"승 리",
|
||||
"승 률",
|
||||
"사 살",
|
||||
"살 상 률",
|
||||
"보 병 숙 련 도",
|
||||
"궁 병 숙 련 도",
|
||||
"기 병 숙 련 도",
|
||||
"귀 병 숙 련 도",
|
||||
"차 병 숙 련 도",
|
||||
"전 력 전 승 률",
|
||||
"통 솔 전 승 률",
|
||||
"일 기 토 승 률",
|
||||
"설 전 승 률",
|
||||
"베 팅 투 자 액",
|
||||
"베 팅 당 첨",
|
||||
"베 팅 수 익 금",
|
||||
"베 팅 수 익 률"
|
||||
);
|
||||
$types = [
|
||||
["명 성", "int", function($v){$v['value'] = $v['experience']; return $v; }],
|
||||
["계 급", "int", function($v){$v['value'] = $v['dedication']; return $v; }],
|
||||
["계 략 성 공", "int", function($v){
|
||||
$v['value'] = $v['firenum'];
|
||||
$v['nationName'] = '???';
|
||||
$v['pictureFullPath'] = GetImageURL(0)."/default.jpg";
|
||||
$v['name'] = '???';
|
||||
$v['owner_name'] = null;
|
||||
$v['bgColor'] = GameConst::$basecolor4;
|
||||
$v['fgColor'] = newColor($v['bgColor']);
|
||||
return $v;
|
||||
}],
|
||||
["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }],
|
||||
["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }],
|
||||
["승 률", "percent", function($v){$v['value'] = $v['killnum'] / max(1, $v['warnum']); return $v; }],
|
||||
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
|
||||
["살 상 률", "percent", function($v){$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); return $v; }],
|
||||
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex0']; return $v; }],
|
||||
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex10']; return $v; }],
|
||||
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex20']; return $v; }],
|
||||
["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex30']; return $v; }],
|
||||
["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex40']; return $v; }],
|
||||
["전 력 전 승 률", "percent", function($v){$v['value'] = $v['ttw']/max(1, $v['ttw']+$v['ttd']+$v['ttl']); return $v; }],
|
||||
["통 솔 전 승 률", "percent", function($v){$v['value'] = $v['tlw']/max(1, $v['tlw']+$v['tld']+$v['tll']); return $v; }],
|
||||
["일 기 토 승 률", "percent", function($v){$v['value'] = $v['tpw']/max(1, $v['tpw']+$v['tpd']+$v['tpl']); return $v; }],
|
||||
["설 전 승 률", "percent", function($v){$v['value'] = $v['tiw']/max(1, $v['tiw']+$v['tid']+$v['til']); return $v; }],
|
||||
["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }],
|
||||
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
|
||||
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){$v['value'] = $v['betwingold']/max(1, $v['betgold']); return $v; }],
|
||||
];
|
||||
|
||||
|
||||
for ($i=0; $i < 21; $i++) {
|
||||
$name = [];
|
||||
$data = [];
|
||||
$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;
|
||||
case 2: $query = "select nation,no,name,picture,imgsvr,firenum as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 3: $query = "select nation,no,name,picture,imgsvr,warnum as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 4: $query = "select nation,no,name,picture,imgsvr,killnum as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 5: $query = "select nation,no,name,picture,imgsvr,killnum/warnum*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
|
||||
case 6: $query = "select nation,no,name,picture,imgsvr,killcrew as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 7: $query = "select nation,no,name,picture,imgsvr,killcrew/deathcrew*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
|
||||
case 8: $query = "select nation,no,name,picture,imgsvr,dex0 as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 9: $query = "select nation,no,name,picture,imgsvr,dex10 as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 10: $query = "select nation,no,name,picture,imgsvr,dex20 as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 11: $query = "select nation,no,name,picture,imgsvr,dex30 as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 12: $query = "select nation,no,name,picture,imgsvr,dex40 as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 13: $query = "select nation,no,name,picture,imgsvr,ttw/(ttw+ttd+ttl)*10000 as data from general where $sel and (ttw+ttd+ttl)>=50 order by data desc limit 0,10"; break;
|
||||
case 14: $query = "select nation,no,name,picture,imgsvr,tlw/(tlw+tld+tll)*10000 as data from general where $sel and (tlw+tld+tll)>=50 order by data desc limit 0,10"; break;
|
||||
case 15: $query = "select nation,no,name,picture,imgsvr,tpw/(tpw+tpd+tpl)*10000 as data from general where $sel and (tpw+tpd+tpl)>=50 order by data desc limit 0,10"; break;
|
||||
case 16: $query = "select nation,no,name,picture,imgsvr,tiw/(tiw+tid+til)*10000 as data from general where $sel and (tiw+tid+til)>=50 order by data desc limit 0,10"; break;
|
||||
case 17: $query = "select nation,no,name,picture,imgsvr,betgold as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 18: $query = "select nation,no,name,picture,imgsvr,betwin as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 19: $query = "select nation,no,name,picture,imgsvr,betwingold as data from general where $sel order by data desc limit 0,10"; break;
|
||||
case 20: $query = "select nation,no,name,picture,imgsvr,betwingold/betgold*10000 as data from general where $sel and betgold >= 1000 order by data desc limit 0,10"; break;
|
||||
$generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
$general['bgColor'] = $nationColor[$general['nation']]??GameConst::$basecolor4;
|
||||
$general['fgColor'] = newColor($general['bgColor']);
|
||||
$general['nationName'] = $nationName[$general['nation']];
|
||||
|
||||
if(key_exists('picture', $general)){
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
$general['pictureFullPath'] = "$imageTemp/{$general['picture']}";
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
|
||||
echo "
|
||||
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
|
||||
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
|
||||
<tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if ($i != 2) {
|
||||
if (isset($gen)) {
|
||||
$name[$k] = $gen['name'];
|
||||
$nation[$k] = $nationName[$gen['nation']];
|
||||
$data[$k] = $gen['data'];
|
||||
$color[$k] = $nationColor[$gen['nation']];
|
||||
$pic[$k] = $gen['picture'];
|
||||
} else {
|
||||
$name[$k] = "-";
|
||||
$nation[$k] = "-";
|
||||
$data[$k] = "-";
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
$pic[$k] = "";
|
||||
}
|
||||
} else {
|
||||
$name[$k] = "???";
|
||||
$nation[$k] = "???";
|
||||
$data[$k] = $gen['data'];
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
$gen['imgsvr'] = 0;
|
||||
$pic[$k] = "9999.jpg";
|
||||
}
|
||||
if ($color[$k] == "") {
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
}
|
||||
if ($nation[$k] == "") {
|
||||
$nation[$k] = " ";
|
||||
}
|
||||
if ($pic[$k] == "") {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']);
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></td>";
|
||||
}
|
||||
else{
|
||||
$general['pictureFullPath'] = GetImageURL(0)."/default.jpg";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
return $general;
|
||||
}, $db->query(
|
||||
"SELECT nation,no,name,name2 as owner_name, picture, imgsvr,
|
||||
experience, dedication, firenum, warnum, killnum, killcrew, deathcrew,
|
||||
dex0, dex10, dex20, dex30, dex40,
|
||||
ttw, ttd, ttl, tlw, tld, tll, tpw, tpd, tpl, tiw, tid, til,
|
||||
betgold, betwin, betwingold,
|
||||
horse, weap, book, item
|
||||
FROM general WHERE %l", $btn == "NPC 보기"?"npc>=2":"npc<2"));
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
|
||||
}
|
||||
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc){
|
||||
$general = ($typeFunc)($general);
|
||||
$value = $general['value'];
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
if($data[$k] === '-'){
|
||||
//do Nothing
|
||||
if($typeValue == 'percent'){
|
||||
$general['printValue'] = number_format($value*100, 2).'%';
|
||||
}
|
||||
else if ($i == 5 || $i == 7 || $i == 20) {
|
||||
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
|
||||
else {
|
||||
$general['printValue'] = number_format($value);
|
||||
}
|
||||
else if ($i >= 13 && $i <= 16) {
|
||||
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
|
||||
}
|
||||
echo "<td align=center>{$data[$k]}</td>";
|
||||
}
|
||||
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
return $general;
|
||||
}, $generals);
|
||||
|
||||
usort($typeGenerals, function($lhs, $rhs){
|
||||
//내림차순
|
||||
return -($lhs['value'] <=> $rhs['value']);
|
||||
});
|
||||
|
||||
echo $templates->render('hallOfFrame', [
|
||||
'typeName'=>$typeName,
|
||||
'generals'=>array_slice($typeGenerals, 0, 10)
|
||||
]);
|
||||
}
|
||||
|
||||
echo "
|
||||
</table>
|
||||
<br>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
";
|
||||
|
||||
$type = array(
|
||||
"명 마",
|
||||
"명 검",
|
||||
"명 서",
|
||||
"도 구"
|
||||
);
|
||||
|
||||
$call = array(
|
||||
"horse",
|
||||
"weap",
|
||||
"book",
|
||||
"item"
|
||||
);
|
||||
|
||||
$func = array(
|
||||
"\\sammo\\getHorseName",
|
||||
"\\sammo\\getWeapName",
|
||||
"\\sammo\\getBookName",
|
||||
"\\sammo\\getItemName"
|
||||
);
|
||||
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$name = [];
|
||||
$data = [];
|
||||
$color = [];
|
||||
$pic = [];
|
||||
|
||||
echo "
|
||||
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
|
||||
<tr align=center id=bg2>";
|
||||
for ($k=26; $k > 16; $k--) {
|
||||
$str = $func[$i]($k);
|
||||
echo "<td>".$str."</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=26; $k > 16; $k--) {
|
||||
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
if (isset($gen)) {
|
||||
$name[$k] = $gen['name'];
|
||||
$nation[$k] = $nationName[$gen['nation']];
|
||||
$color[$k] = $nationColor[$gen['nation']];
|
||||
$pic[$k] = $gen['picture'];
|
||||
} else {
|
||||
$name[$k] = "미발견";
|
||||
$nation[$k] = "-";
|
||||
$color[$k] = "";
|
||||
$pic[$k] = "";
|
||||
}
|
||||
if ($color[$k] == "") {
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
}
|
||||
if ($nation[$k] == "") {
|
||||
$nation[$k] = " ";
|
||||
}
|
||||
if ($pic[$k] == "") {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']??0);
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
}
|
||||
}
|
||||
|
||||
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 "</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 "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
|
||||
echo "
|
||||
<tr align=center id=bg2>";
|
||||
for ($k=16; $k > 6; $k--) {
|
||||
$str = $func[$i]($k);
|
||||
echo "<td>".$str."</td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr>";
|
||||
|
||||
for ($k=16; $k > 6; $k--) {
|
||||
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
if (isset($gen)) {
|
||||
$name[$k] = $gen['name'];
|
||||
$nation[$k] = $nationName[$gen['nation']];
|
||||
$color[$k] = $nationColor[$gen['nation']];
|
||||
$pic[$k] = $gen['picture'];
|
||||
} else {
|
||||
$name[$k] = "미발견";
|
||||
$nation[$k] = "-";
|
||||
$color[$k] = "";
|
||||
$pic[$k] = "";
|
||||
}
|
||||
if ($color[$k] == "") {
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
}
|
||||
if ($nation[$k] == "") {
|
||||
$nation[$k] = " ";
|
||||
}
|
||||
if ($pic[$k] == "") {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']??0);
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
}
|
||||
}
|
||||
|
||||
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 "</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 "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
</div>
|
||||
<div style="margin:auto;width=1000px;margin-top:5px;">
|
||||
<?php
|
||||
//유니크 아이템 소유자
|
||||
$itemTypes = [
|
||||
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
|
||||
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
|
||||
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return getItemName($v);}, 7, 26, []],
|
||||
];
|
||||
|
||||
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
|
||||
|
||||
foreach($generals as $general){
|
||||
foreach($itemTypes as $itemIdx=>[,$itemType, $itemFunc,,,]){
|
||||
$itemCode = $general[$itemType];
|
||||
if($itemCode <= 6){
|
||||
continue;
|
||||
}
|
||||
|
||||
$itemName = ($itemFunc)($itemCode);
|
||||
$general['rankName'] = $itemName;
|
||||
$general['value'] = $itemCode;
|
||||
$itemTypes[$itemIdx][5][$itemCode] = $general;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($itemTypes as [$itemNameType, $itemType, $itemFunc, $itemMinCode, $itemMaxCode, $itemOwners]){
|
||||
$itemRanker = [];
|
||||
for($itemCode = $itemMaxCode; $itemCode >= $itemMinCode; $itemCode--){
|
||||
if(!key_exists($itemCode, $itemOwners)){
|
||||
$emptyCard = [
|
||||
'rankName' => ($itemFunc)($itemCode),
|
||||
'pictureFullPath' => GetImageURL(0)."/default.jpg",
|
||||
'value'=>$itemCode,
|
||||
'name'=>'미발견',
|
||||
'bgColor'=>GameConst::$basecolor4,
|
||||
'fgColor'=>newColor(GameConst::$basecolor4),
|
||||
];
|
||||
$itemRanker[$itemCode] = $emptyCard;
|
||||
continue;
|
||||
}
|
||||
|
||||
$general = $itemOwners[$itemCode];
|
||||
$itemRanker[$itemCode] = $general;
|
||||
}
|
||||
|
||||
echo $templates->render('hallOfFrame', [
|
||||
'typeName'=>$itemNameType,
|
||||
'generals'=>$itemRanker
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<table align=center width=1100 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+153
-138
@@ -11,7 +11,7 @@ extractMissingPostToGlobals();
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("왕조일람", 2);
|
||||
increaseRefresh("왕조일람", 1);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -41,166 +41,181 @@ if ($select == 0) {
|
||||
for ($i=0; $i < $empcount; $i++) {
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
|
||||
echo "
|
||||
<form action=a_emperior.php method=post>
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
|
||||
<input type=submit value='자세히'>
|
||||
<input type=hidden name=select value='{$emperior['no']}'>
|
||||
<input type=hidden name=select value='<?=$emperior['no']?>'>
|
||||
|
||||
<?php if($emperior['server_id']): ?>
|
||||
<a href="a_history.php?server_id=<?=$emperior['server_id']?>"><button type="button">역사 보기</button></a>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=8>
|
||||
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
|
||||
<td align=center style=color:".newColor($emperior['color'])."; bgcolor=<?=$emperior['color']?> colspan=8>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</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>
|
||||
</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>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
}
|
||||
} else {
|
||||
$query = "select * from emperior where no='$select'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
<input type=submit value='전체보기'>
|
||||
<input type=hidden name=select value='0'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['nation_count']}</td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['gen_count']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5>{$emperior['nation_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5>{$emperior['nation_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5>{$emperior['personal_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5>{$emperior['special_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=6>
|
||||
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['power']}</td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['gennum']}</td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['citynum']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2>{$emperior['pop']}</td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2>{$emperior['poprate']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2>{$emperior['gold']}</td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2>{$emperior['rice']}</td>
|
||||
<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 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l12name']}</td>
|
||||
<td align=center><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l11name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center><?=$emperior['l11name']?></td>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l10name']}</td>
|
||||
<td align=center><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l9name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l8name']}</td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l7name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l6name']}</td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l5name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5>{$emperior['tiger']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5>{$emperior['eagle']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5>{$emperior['gen']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5>".ConvertLog($emperior['history'], 1)."</td>
|
||||
<td align=center><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
die();
|
||||
}
|
||||
|
||||
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<form action=a_emperior.php method=get>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
<input type=submit value='전체보기'>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5><?=$emperior['nation_name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5><?=$emperior['nation_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5><?=$emperior['personal_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5><?=$emperior['special_hist']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
|
||||
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2><?=$emperior['pop']?></td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2><?=$emperior['poprate']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2><?=$emperior['gold']?></td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2><?=$emperior['rice']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l12name']?></td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l11name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l7name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5><?=$emperior['tiger']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5><?=$emperior['eagle']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5><?=$emperior['gen']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
+16
-16
@@ -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>";
|
||||
|
||||
+10
-10
@@ -104,20 +104,20 @@ echo"
|
||||
<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);
|
||||
|
||||
+99
-85
@@ -4,10 +4,29 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::getInstance()->setReadOnly();
|
||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("명예의전당", 1);
|
||||
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT distinct(scenario_name) as name, count(scenario) as cnt, scenario from ng_games order by scenario asc') as $scenarioInfo){
|
||||
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
|
||||
$searchScenarioName = $scenarioList[$scenarioIdx]['name'];
|
||||
$searchFilter = $db->sqleval('scenario = %i', $scenarioIdx);
|
||||
}
|
||||
else{
|
||||
$searchScenarioName = '* 모두 *';
|
||||
$searchFilter = $db->sqleval(true);
|
||||
}
|
||||
|
||||
increaseRefresh("명예의전당", 2);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -17,104 +36,99 @@ increaseRefresh("명예의전당", 2);
|
||||
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
<?=WebUtil::printCSS('css/hallOfFame.css')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJs('js/hallOfFame.js')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table align=center width=1100 class='tb_layout bg0'>
|
||||
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
|
||||
<tr><td>
|
||||
시나리오 검색 : <select id="by_scenario" name="by_scenario">
|
||||
<option value="" <?=$scenarioIdx?"selected='selected'":''?>>* 종합 *</option>
|
||||
<?php foreach($scenarioList as $info): ?>
|
||||
<option
|
||||
value="<?=$info['scenario']?>"
|
||||
<?=($info['scenario']===$scenarioIdx)?"selected='selected'":''?>
|
||||
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
|
||||
<?php endforeach; ?>
|
||||
?>
|
||||
</select>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<div style="margin:auto;width=1100px;">
|
||||
<?php
|
||||
$type = array(
|
||||
"명 성",
|
||||
"계 급",
|
||||
"계 략 성 공",
|
||||
"전 투 횟 수",
|
||||
"승 리",
|
||||
"승 률",
|
||||
"사 살",
|
||||
"살 상 률",
|
||||
"보 병 숙 련 도",
|
||||
"궁 병 숙 련 도",
|
||||
"기 병 숙 련 도",
|
||||
"귀 병 숙 련 도",
|
||||
"차 병 숙 련 도",
|
||||
"전 력 전 승 률",
|
||||
"통 솔 전 승 률",
|
||||
"일 기 토 승 률",
|
||||
"설 전 승 률",
|
||||
"베 팅 투 자 액",
|
||||
"베 팅 당 첨",
|
||||
"베 팅 수 익 금",
|
||||
"베 팅 수 익 률"
|
||||
);
|
||||
for ($i=0; $i < 21; $i++) {
|
||||
$name = [];
|
||||
$nation = [];
|
||||
$data = [];
|
||||
$color = [];
|
||||
$pic = [];
|
||||
|
||||
$query = "select * from hall where type={$i} order by rank";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$types = [
|
||||
["명 성", 'int'],
|
||||
["계 급", 'int'],
|
||||
["계 략 성 공", 'int'],
|
||||
["전 투 횟 수", 'int'],
|
||||
["승 리", 'int'],
|
||||
["승 률", 'percent'],
|
||||
["사 살", 'int'],
|
||||
["살 상 률", 'percent'],
|
||||
["보 병 숙 련 도", 'int'],
|
||||
["궁 병 숙 련 도", 'int'],
|
||||
["기 병 숙 련 도", 'int'],
|
||||
["귀 병 숙 련 도", 'int'],
|
||||
["차 병 숙 련 도", 'int'],
|
||||
["전 력 전 승 률", 'percent'],
|
||||
["통 솔 전 승 률", 'percent'],
|
||||
["일 기 토 승 률", 'percent'],
|
||||
["설 전 승 률", 'percent'],
|
||||
["베 팅 투 자 액", 'int'],
|
||||
["베 팅 당 첨", 'int'],
|
||||
["베 팅 수 익 금", 'int'],
|
||||
["베 팅 수 익 률", 'percent'],
|
||||
];
|
||||
|
||||
echo "
|
||||
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
|
||||
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
|
||||
<tr>";
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$name[$k] = $gen['name'];
|
||||
$nation[$k] = $gen['nation'];
|
||||
$data[$k] = $gen['data'];
|
||||
$color[$k] = $gen['color'];
|
||||
$pic[$k] = $gen['picture'];
|
||||
if ($color[$k] == "") {
|
||||
$color[$k] = GameConst::$basecolor4;
|
||||
foreach($types as $idx=>[$typeName, $typeValue]) {
|
||||
$hallResult = $db->query('SELECT * FROM ng_hall WHERE `type`=%i AND %? ORDER BY `value` DESC LIMIT 10', $idx, $searchFilter);
|
||||
|
||||
$hallResult = array_map(function($general)use($typeValue){
|
||||
$aux = Json::decode($general['aux']);
|
||||
$general += $aux;
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
|
||||
}
|
||||
if ($nation[$k] == "") {
|
||||
$nation[$k] = " ";
|
||||
if(!key_exists('fgColor', $general)){
|
||||
$general['fgColor'] = newColor($general['bgColor']);
|
||||
}
|
||||
/*
|
||||
if($pic[$k] == "") {
|
||||
echo "<td align=center> </td>";
|
||||
} else {
|
||||
$imageTemp = GetImageURL($gen['imgsvr']);
|
||||
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// echo "</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 "</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 "</tr><tr>";
|
||||
|
||||
for ($k=0; $k < 10; $k++) {
|
||||
if ($i == 5 || $i == 7 || $i == 20) {
|
||||
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
|
||||
if(key_exists('picture', $general)){
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
$general['pictureFullPath'] = "$imageTemp/{$general['picture']}";
|
||||
}
|
||||
if ($i >= 13 && $i <= 16) {
|
||||
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
|
||||
else{
|
||||
$general['pictureFullPath'] = GetImageURL(0)."/default.jpg";
|
||||
}
|
||||
echo "<td align=center>{$data[$k]}</td>";
|
||||
}
|
||||
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
|
||||
|
||||
if(!key_exists('printValue', $general)){
|
||||
$value = $general['value'];
|
||||
if($typeValue == 'percent'){
|
||||
$general['printValue'] = number_format($value*100, 2).'%';
|
||||
}
|
||||
else {
|
||||
$general['printValue'] = number_format($value);
|
||||
}
|
||||
}
|
||||
|
||||
return $general;
|
||||
}, $hallResult);
|
||||
|
||||
echo $templates->render('hallOfFrame', [
|
||||
'typeName'=>$typeName,
|
||||
'generals'=>$hallResult
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
</div>
|
||||
<table align=center width=1100 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
|
||||
+31
-27
@@ -5,6 +5,7 @@ include "lib.php";
|
||||
include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$yearmonth = Util::getReq('yearmonth', 'int');
|
||||
$serverID = Util::getReq('server_id', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -16,7 +17,13 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("연감", 2);
|
||||
if(!$serverID){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
}
|
||||
|
||||
if($serverID === UniqueConst::$serverID){
|
||||
increaseRefresh("연감", 1);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
||||
|
||||
@@ -30,18 +37,20 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "select year,month from history order by no limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$history = MYDB_fetch_array($result);
|
||||
$s = ($history['year']*12) + $history['month'];
|
||||
|
||||
$query = "select year,month from history order by no desc limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$history = MYDB_fetch_array($result);
|
||||
$e = ($history['year']*12) + $history['month'];
|
||||
|
||||
[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
|
||||
$s = $s_year * 12 + $s_month;
|
||||
|
||||
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
||||
$e = $e_year * 12 + $e_month;
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if (!$yearmonth) {
|
||||
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
||||
$year = $s_year;
|
||||
$month = $s_month;
|
||||
}
|
||||
else if (!$yearmonth) {
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'] - 1;
|
||||
} else {
|
||||
@@ -98,24 +107,19 @@ if ($month <= 0) {
|
||||
<input type=submit name=btn value="◀◀ 이전달">
|
||||
<select name=yearmonth size=1>
|
||||
<?php
|
||||
$query = "select year,month from history";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$histCount = MYDB_num_rows($result);
|
||||
for ($i=0; $i < $histCount; $i++) {
|
||||
$history = MYDB_fetch_array($result);
|
||||
$value = "".$history['year'].StringUtil::padStringAlignRight($history['month'], 2, "0");
|
||||
if ($history['year'] == $year && $history['month'] == $month) {
|
||||
$dates = $db->queryAllLists('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC', $serverID);
|
||||
foreach($dates as [$hYear, $hMonth]){
|
||||
$value = "".$hYear.StringUtil::padStringAlignRight($hMonth, 2, "0");
|
||||
if ($hYear == $year && $hMonth == $month) {
|
||||
echo "
|
||||
<option selected value={$value}>{$history['year']}년 {$history['month']}월</option>";
|
||||
<option selected value={$value}>{$hYear}년 {$hMonth}월</option>";
|
||||
} else {
|
||||
echo "
|
||||
<option value={$value}>{$history['year']}년 {$history['month']}월</option>";
|
||||
<option value={$value}>{$hYear}년 {$hMonth}월</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$query = "select log,genlog,nation,power,gen,city from history where year='$year' and month='$month'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$history = MYDB_fetch_array($result);
|
||||
$history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM history WHERE server_id = %s AND year = %i AND month = %i', $serverID, $year, $month);
|
||||
?>
|
||||
</select>
|
||||
<input type=submit name=btn value='조회하기'>
|
||||
@@ -129,10 +133,10 @@ $history = MYDB_fetch_array($result);
|
||||
<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>
|
||||
@@ -153,7 +157,7 @@ $history = MYDB_fetch_array($result);
|
||||
</table>
|
||||
<script>
|
||||
reloadWorldMap({
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>',
|
||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&server_id=<?=$serverID?>',
|
||||
showMe:false,
|
||||
neutralView:true
|
||||
});
|
||||
|
||||
@@ -129,14 +129,14 @@ for($i=1; $i <= $count; $i++) {
|
||||
<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>
|
||||
|
||||
+17
-17
@@ -10,9 +10,9 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("갱신정보", 2);
|
||||
|
||||
$game_env = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
|
||||
|
||||
$log = getRawFileLogRecent(__dir__.'/logs/_traffic.txt', 11, 100);
|
||||
$log = getRawFileLogRecent(__dir__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
|
||||
|
||||
$date = [];
|
||||
$year = [];
|
||||
@@ -29,21 +29,21 @@ foreach($log as $i=>$value){
|
||||
$refresh[$i] = $parse[3];
|
||||
$online[$i] = $parse[4];
|
||||
}
|
||||
$year[] = $game_env['year'];
|
||||
$month[] = $game_env['month'];
|
||||
$year[] = $admin['year'];
|
||||
$month[] = $admin['month'];
|
||||
$date[] = date('Y-m-d H:i:s');
|
||||
|
||||
if ($game_env['maxrefresh'] == 0) {
|
||||
$game_env['maxrefresh'] = 1;
|
||||
if ($admin['maxrefresh'] == 0) {
|
||||
$admin['maxrefresh'] = 1;
|
||||
}
|
||||
if ($game_env['maxrefresh'] < $game_env['refresh']) {
|
||||
$game_env['maxrefresh'] = $game_env['refresh'];
|
||||
if ($admin['maxrefresh'] < $admin['refresh']) {
|
||||
$admin['maxrefresh'] = $admin['refresh'];
|
||||
}
|
||||
if ($game_env['maxonline'] == 0) {
|
||||
$game_env['maxonline'] = 1;
|
||||
if ($admin['maxonline'] == 0) {
|
||||
$admin['maxonline'] = 1;
|
||||
}
|
||||
if ($game_env['maxonline'] < $curonline) {
|
||||
$game_env['maxonline'] = $curonline;
|
||||
if ($admin['maxonline'] < $curonline) {
|
||||
$admin['maxonline'] = $curonline;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -89,9 +89,9 @@ span.out_bar{
|
||||
<table align=center class='tb_layout bg0'>
|
||||
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
|
||||
<?php
|
||||
$refresh[] = $game_env['refresh'];
|
||||
$refresh[] = $admin['refresh'];
|
||||
foreach($refresh as $i=>$value){
|
||||
$w = round($value / $game_env['maxrefresh'] * 100, 1);
|
||||
$w = round($value / $admin['maxrefresh'] * 100, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
@@ -114,7 +114,7 @@ foreach($refresh as $i=>$value){
|
||||
?>
|
||||
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
|
||||
<tr>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$game_env['maxrefresh']?></td>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$admin['maxrefresh']?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ foreach($refresh as $i=>$value){
|
||||
<?php
|
||||
$online[] = $curonline;
|
||||
foreach($online as $i=>$value){
|
||||
$w = round($value / $game_env['maxonline'] * 100, 1);
|
||||
$w = round($value / $admin['maxonline'] * 100, 1);
|
||||
$color = getTrafficColor($w);
|
||||
$dt = substr($date[$i], 11, 5); ?>
|
||||
<tr height=30>
|
||||
@@ -149,7 +149,7 @@ foreach($online as $i=>$value){
|
||||
?>
|
||||
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
|
||||
<tr>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$game_env['maxonline']?></td>
|
||||
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$admin['maxonline']?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
|
||||
+54
-24
@@ -12,16 +12,16 @@ $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);
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','voteopen','vote','votecomment']);
|
||||
|
||||
$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>
|
||||
@@ -60,7 +60,7 @@ function captureKey(e) {
|
||||
<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>
|
||||
@@ -70,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>
|
||||
";
|
||||
|
||||
@@ -99,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);
|
||||
@@ -135,7 +135,7 @@ echo "
|
||||
</tr>
|
||||
";
|
||||
|
||||
if ($session->userGrade >= 5) {
|
||||
if ($isVoteAdmin) {
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center><input type=submit name=btn value='리셋'></td>
|
||||
@@ -165,18 +165,18 @@ for ($i=0; $i < $commentCount; $i++) {
|
||||
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>
|
||||
";
|
||||
}
|
||||
@@ -187,7 +187,7 @@ if ($me['no'] > 0) {
|
||||
<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='전체통계만'>
|
||||
@@ -196,12 +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>
|
||||
<td width=742>
|
||||
";
|
||||
|
||||
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
|
||||
@@ -233,8 +233,17 @@ 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'] = " "; }
|
||||
?>
|
||||
<?php if($per == 0): ?>
|
||||
@@ -252,7 +261,7 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
|
||||
";
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -272,8 +281,15 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
<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'] = " "; }
|
||||
?>
|
||||
<?php if($per == 0): ?>
|
||||
@@ -318,15 +334,29 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
|
||||
<td align=center>
|
||||
";
|
||||
|
||||
$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'] = " "; }
|
||||
?>
|
||||
<?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]?></div>
|
||||
<div class='little_bar' style='width:<?=$per?>%;color:<?=getNewColor($k)?>;background-color:<?=getVoteColor($k)?>;'><?=$nationVote[$nation['nation']][$k]??0?></div>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
}
|
||||
|
||||
+1
-1
@@ -280,7 +280,7 @@ for ($i=0; $i < $count; $i++) {
|
||||
ㆍ악용 방지를 위해 50% ~ 200%의 가격에서 거래시작이 가능합니다.<br>
|
||||
ㆍ악용 방지를 위해 즉시판매가는 110% 이상, 즉시구매가는 90% 이하의 시세로 가능합니다.<br>
|
||||
ㆍ악용 방지를 위해 즉시판매가는 시작판매가의 110% 이상, 즉시구매가는 시작구매가의 90% 이하로 가능합니다.<br>
|
||||
ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다. 거상 특기 소유자는 1인당 도합 3건입니다.<br>
|
||||
ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다.<br>
|
||||
ㆍ기본금쌀 1000은 거래에 사용되지 못합니다.<br>
|
||||
ㆍ유찰될 때는 거래 과실자에게 거래금의 1%가 벌금으로 부과됩니다.<br>
|
||||
ㆍ<font color=magenta>10단위로 거래가 가능합니다. 1자리는 반올림 처리 됩니다.</font><br>
|
||||
|
||||
+7
-1
@@ -297,7 +297,13 @@ for ($i=0; $i < 16; $i++) {
|
||||
}
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$gold[$i] = Util::round($myBet[$i] * $bet[$i]);
|
||||
if(!is_numeric($bet[$i])){
|
||||
$gold[$i] = 0;
|
||||
}
|
||||
else{
|
||||
$gold[$i] = Util::round($myBet[$i] * $bet[$i]);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
@@ -33,6 +33,7 @@ if($me['level'] < 5) {
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<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>
|
||||
@@ -65,10 +66,11 @@ for($i=0; $i < 20; $i++) {
|
||||
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+10
-10
@@ -152,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']); }
|
||||
|
||||
+14
-14
@@ -184,18 +184,18 @@ if($city['trade'] == 0) {
|
||||
<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>
|
||||
@@ -234,7 +234,7 @@ if($city['trade'] == 0) {
|
||||
<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
|
||||
|
||||
+5
-5
@@ -58,7 +58,7 @@ if ($me['level'] >= 5) {
|
||||
<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>
|
||||
@@ -216,10 +216,10 @@ if ($budgetricediff > 0) {
|
||||
<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 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메시지</td></tr>
|
||||
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=16000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
||||
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=1000 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
|
||||
<tr><td colspan=2>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||
<tr>
|
||||
|
||||
+9
-9
@@ -39,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 = [];
|
||||
@@ -108,7 +108,7 @@ $(function(){
|
||||
<?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);
|
||||
@@ -186,7 +186,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
<?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>
|
||||
@@ -215,10 +215,10 @@ 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>
|
||||
|
||||
+10
-10
@@ -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 "
|
||||
@@ -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>"; }
|
||||
@@ -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++) {
|
||||
|
||||
+12
-12
@@ -128,18 +128,18 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
<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>
|
||||
|
||||
@@ -28,7 +28,8 @@ $me = MYDB_fetch_array($result);
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout 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 class='tb_layout bg0'>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+13
-11
@@ -31,6 +31,7 @@ $troopcount = MYDB_num_rows($result);
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style="width:1000px;margin:auto;">
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
@@ -38,10 +39,10 @@ $troopcount = MYDB_num_rows($result);
|
||||
<table class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=64 class='bg1 center'>선 택</td>
|
||||
<td width=98 class='bg1 center'>부 대 정 보</td>
|
||||
<td width=64 class='bg1 center'>부 대 장</td>
|
||||
<td width=662 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
|
||||
<td width=98 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</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++) {
|
||||
@@ -82,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>
|
||||
@@ -93,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']) {
|
||||
@@ -101,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 "
|
||||
@@ -109,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;
|
||||
}
|
||||
@@ -138,10 +139,10 @@ echo "
|
||||
<br>";
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout 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>";
|
||||
@@ -154,11 +155,12 @@ echo "
|
||||
</table>";
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+2
-2
@@ -91,11 +91,11 @@ if ($btn == "판매") {
|
||||
$msg = "ㆍ<span class='ev_warning'>시작판매가는 50% ~ 200% 이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($topv < $amount*1.1 || $topv > $amount * 2) {
|
||||
if ($topv * 10 < $amount * 11 || $topv > $amount * 2) {
|
||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 110% ~ 200% 이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($topv < $cost*1.1) {
|
||||
if ($topv * 10 < $cost * 11) {
|
||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
|
||||
+12
-14
@@ -19,11 +19,8 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`level` FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
//내가 수뇌부이어야함
|
||||
if($me['level'] < 5) {
|
||||
@@ -32,21 +29,21 @@ if($me['level'] < 5) {
|
||||
}
|
||||
|
||||
if($btn == "국가방침") {
|
||||
$msg == mb_substr($msg, 0, 1000);
|
||||
$msg = mb_substr($msg, 0, 16384);
|
||||
//$msg = StringUtil::
|
||||
$db->update('nation', [
|
||||
'msg'=>BadTag2Code($msg)
|
||||
'msg'=>WebUtil::htmlPurify($msg)
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "임관권유") {
|
||||
$scoutmsg == mb_substr($msg, 0, 500);
|
||||
$scoutmsg = mb_substr($scoutmsg, 0, 1000);
|
||||
$db->update('nation', [
|
||||
'scoutmsg'=>BadTag2Code($scoutmsg)
|
||||
'scoutmsg'=>WebUtil::htmlPurify($scoutmsg)
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "세율") {
|
||||
if($rate < 5) { $rate = 5; }
|
||||
if($rate > 30) { $rate = 30; }
|
||||
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$rate = Util::valueFit($rate, 5, 30);
|
||||
$db->update('nation', [
|
||||
'rate'=>$rate,
|
||||
], 'nation=%i', $me['nation']);
|
||||
} elseif($btn == "지급율") {
|
||||
$bill = Util::valueFit($bill, 20, 200);
|
||||
$db->update('nation', [
|
||||
@@ -70,8 +67,9 @@ if($btn == "국가방침") {
|
||||
'war'=>1
|
||||
], 'nation=%i',$me['nation']);
|
||||
} elseif($btn == "전쟁 허가") {
|
||||
$query = "update nation set war='0' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'war'=>0
|
||||
], 'nation=%i',$me['nation']);
|
||||
}
|
||||
|
||||
header('location:b_dipcenter.php');
|
||||
|
||||
+7
-18
@@ -44,12 +44,8 @@ $comStr = EncodeCommand($fourth, $third, $double, $command);
|
||||
|
||||
// 건국
|
||||
if($command == 46) {
|
||||
$name = addslashes(SQ2DQ($name));
|
||||
$name = str_replace("|", "", $name);
|
||||
$name = str_replace(" ", "", $name);
|
||||
$name = str_replace(" ", "뷁", $name);
|
||||
$name = StringUtil::neutralize($name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
$name = StringUtil::subStringForWidth($name, 0, 12);
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$name
|
||||
@@ -72,15 +68,12 @@ if($command == 53) {
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
$nationname = addslashes(SQ2DQ($nationname));
|
||||
$nationname = str_replace("|", "", $nationname);
|
||||
$nationname = str_replace(" ", "", $nationname);
|
||||
$nationname = str_replace(" ", "뷁", $nationname);
|
||||
$nationname = StringUtil::neutralize($nationname, 18);
|
||||
if($nationname == "") { $nationname = "무명"; }
|
||||
$nationname = StringUtil::subStringForWidth($nationname, 0, 12);
|
||||
|
||||
$query = "update general set makenation='{$nationname}' where level>=5 and nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$nationname
|
||||
], 'level>=5 and nation=%i', $me['nation']);
|
||||
|
||||
$count = count($turn);
|
||||
$str = "type=type";
|
||||
@@ -101,11 +94,7 @@ if($command == 61) {
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
$note = addslashes(SQ2DQ($note));
|
||||
$note = str_replace("|", "", $note);
|
||||
$note = str_replace(" ", "", $note);
|
||||
$note = str_replace(" ", "뷁", $note);
|
||||
$note = StringUtil::subStringForWidth($note, 0, 90);
|
||||
$note = StringUtil::neutralize($note, 90);
|
||||
|
||||
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+30
-25
@@ -38,27 +38,29 @@ 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==0){
|
||||
$general = [];
|
||||
}
|
||||
else{
|
||||
$general = $db->queryFirstRow('SELECT `no`,nation,`level`,leader,`power`,intel FROM general WHERE no = %i', $genlist);
|
||||
}
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
if($genlist != 0 && !$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
|
||||
|
||||
if($meLevel < 5 || ($genlist != 0 && $general['nation'] != $me['nation']) || ($genlist != 0 && $general['level'] == 12)) {
|
||||
header('location:b_myBossInfo.php');
|
||||
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);
|
||||
@@ -111,21 +113,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%감소
|
||||
@@ -192,7 +197,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; }
|
||||
@@ -233,7 +238,7 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
|
||||
$nation['chemi'] -= 1;
|
||||
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
|
||||
|
||||
$query = "update nation set chemi='{$nation['chemi']}' where nation='{$general['nation']}'";
|
||||
$query = "update nation set chemi='{$nation['chemi']}' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//기존 장수 일반으로
|
||||
@@ -242,12 +247,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) {
|
||||
@@ -299,8 +304,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,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;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-13
@@ -16,11 +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();
|
||||
|
||||
$admin = $gameStor->getValues(['develcost', 'cost', 'vote', 'votecomment']);
|
||||
$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),"");
|
||||
@@ -35,11 +38,8 @@ 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']);
|
||||
|
||||
@@ -50,7 +50,7 @@ else if($btn == "댓글" && $comment != "") {
|
||||
$gameStor->votecomment = $admin['votecomment'];
|
||||
}
|
||||
|
||||
if($session->userGrade < 5){
|
||||
if(!$isVoteAdmin){
|
||||
header('location:a_vote.php');
|
||||
die();
|
||||
}
|
||||
@@ -58,20 +58,21 @@ if($session->userGrade < 5){
|
||||
|
||||
if($btn == "수정") {
|
||||
if($title != "") {
|
||||
$vote = $admin['vote'];
|
||||
$vote[0] = $title;
|
||||
$gameStor->vote = $admin['vote'];
|
||||
$gameStor->vote_title = WebUtil::htmlPurify($title);
|
||||
}
|
||||
} elseif($btn == "추가") {
|
||||
if($str != "") {
|
||||
//TODO:vote
|
||||
$admin['vote'][] = $str;
|
||||
if(!$admin['vote']){
|
||||
$admin['vote'] = [];
|
||||
}
|
||||
$admin['vote'][] = WebUtil::htmlPurify($str);
|
||||
$gameStor->vote=$admin['vote'];
|
||||
}
|
||||
} elseif($btn == "리셋") {
|
||||
$gameStor->voteopen=1;
|
||||
$gameStor->vote='';
|
||||
$gameStor->votecomment='';
|
||||
$gameStor->vote=['-'];
|
||||
$gameStor->vote_title = '-';
|
||||
$gameStor->votecomment=[];
|
||||
|
||||
$query = "update general set vote='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+7
-11
@@ -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>
|
||||
@@ -19,7 +18,7 @@ $connect=$db->get();
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if(!$session->isLoggedIn()){
|
||||
if(!$session->isGameLoggedIn()){
|
||||
echo 'window.parent.location.href = "../";';
|
||||
}
|
||||
?>
|
||||
@@ -68,7 +67,6 @@ myCommandList();
|
||||
function myCommandList() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
@@ -76,9 +74,7 @@ function myCommandList() {
|
||||
// 명령 목록
|
||||
$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;
|
||||
@@ -108,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']);
|
||||
|
||||
@@ -130,6 +130,7 @@ div.bar_out div.bar_in{
|
||||
|
||||
.small_war_log .crew_plate{
|
||||
color:orangered;
|
||||
font-size:90%;
|
||||
}
|
||||
|
||||
.t_date{
|
||||
@@ -180,3 +181,39 @@ div.bar_out div.bar_in{
|
||||
float:left;
|
||||
}
|
||||
|
||||
.tooltip{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 120px;
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
margin-left: -60px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #555 transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
.rankView {
|
||||
width:1100px;
|
||||
margin:auto;
|
||||
position:relative;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.rankView h3{
|
||||
text-align:center;
|
||||
margin:0;
|
||||
padding:2px;
|
||||
border-bottom:1px solid gray;
|
||||
}
|
||||
|
||||
.rankView ul{
|
||||
list-style:none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
margin-top:-1px;
|
||||
margin-bottom:-1px;
|
||||
}
|
||||
|
||||
.rankView li{
|
||||
display:inline-block;
|
||||
vertical-align: top;
|
||||
width:110px;
|
||||
height:149px;
|
||||
text-align:center;
|
||||
border-right:1px solid gray;
|
||||
border-top:1px solid gray;
|
||||
margin:0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.rankView li.no_value{
|
||||
height:128px;
|
||||
}
|
||||
|
||||
.rankView li.has_server {
|
||||
height:168px;
|
||||
}
|
||||
|
||||
.rankView li.no_value.has_server {
|
||||
height:146px;
|
||||
}
|
||||
|
||||
.rankView .hall_server{
|
||||
border-top:1px solid gray;
|
||||
}
|
||||
|
||||
.rankView .tooltip .tooltiptext{
|
||||
width:220px;
|
||||
margin-left: -110px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.rankView .no_value .hall_value{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.rankView .hall_nation{
|
||||
font-size:11px;
|
||||
border-top:1px solid gray;
|
||||
border-bottom:1px solid gray;
|
||||
}
|
||||
|
||||
.rankView .hall_name{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
resize: vertical;
|
||||
font-size:11px;
|
||||
height:28px;
|
||||
}
|
||||
|
||||
.rankView .hall_name p{
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.rankView .hall_owner{
|
||||
font-size:95%;
|
||||
}
|
||||
|
||||
.rankView .hall_value{
|
||||
line-height:13px;
|
||||
box-sizing: border-box;
|
||||
border-top:1px solid gray;
|
||||
padding-top:3px;
|
||||
padding-bottom:3px;
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
text-align:center;
|
||||
}
|
||||
.general_card{
|
||||
width:100px;
|
||||
width:125px;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
|
||||
@@ -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_;
|
||||
}
|
||||
+230
-182
@@ -1116,15 +1116,12 @@ function nationMsg() {
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$msg = $db->queryFirstField(
|
||||
'SELECT msg FROM nation WHERE nation = (SELECT nation FROM general WHERE `owner` = %i)',
|
||||
$userID
|
||||
);
|
||||
|
||||
$query = "select msg from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
echo "<font color=orange>".$nation['msg']."</font>";
|
||||
return $msg?:'';
|
||||
}
|
||||
|
||||
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
@@ -1145,13 +1142,13 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
echo "
|
||||
<table style='text-align:center;' width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=64 style='text-align:center;' class='bg1'><font size=1>$name</font></td>
|
||||
<td width=772 style='text-align:center;' class='bg1'><font size=4><b>$message[0]</b></font></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]);
|
||||
@@ -1161,16 +1158,16 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$regen = MYDB_fetch_array($result);
|
||||
echo "
|
||||
<tr>
|
||||
<td width=64 style='text-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 style='text-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>
|
||||
@@ -1269,7 +1266,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
$date2 = substr($date, 0, 10);
|
||||
$online = getOnlineNum();
|
||||
file_put_contents(
|
||||
__dir__."/logs/_{$date2}_refresh.txt",
|
||||
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_refresh.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s, %s, %s, %d\n",
|
||||
$date,
|
||||
@@ -1306,7 +1303,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
}
|
||||
if($str != "") {
|
||||
file_put_contents(
|
||||
__dir__."/logs/_{$date2}_ipcheck.txt",
|
||||
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_ipcheck.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s%s\n",
|
||||
$session->userName,
|
||||
@@ -1322,31 +1319,31 @@ function updateTraffic() {
|
||||
$online = getOnlineNum();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$game_env = $gameStor->getValues(['year','month','refresh','maxonline','maxrefresh']);
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxonline','maxrefresh']);
|
||||
|
||||
//최다갱신자
|
||||
$user = $db->queryFirstRow('select name,refresh from general order by refresh desc limit 1');
|
||||
|
||||
if($game_env['maxrefresh'] < $game_env['refresh']) {
|
||||
$game_env['maxrefresh'] = $game_env['refresh'];
|
||||
if($admin['maxrefresh'] < $admin['refresh']) {
|
||||
$admin['maxrefresh'] = $admin['refresh'];
|
||||
}
|
||||
if($game_env['maxonline'] < $online) {
|
||||
$game_env['maxonline'] = $online;
|
||||
if($admin['maxonline'] < $online) {
|
||||
$admin['maxonline'] = $online;
|
||||
}
|
||||
$gameStor->refresh = 0;
|
||||
$gameStor->maxrefresh = $game_env['maxrefresh'];
|
||||
$gameStor->maxonline = $game_env['maxonline'];
|
||||
$gameStor->maxrefresh = $admin['maxrefresh'];
|
||||
$gameStor->maxonline = $admin['maxonline'];
|
||||
|
||||
$db->update('general', ['refresh'=>0], true);
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
//일시|년|월|총갱신|접속자|최다갱신자
|
||||
file_put_contents(__dir__."/logs/_traffic.txt",
|
||||
file_put_contents(__dir__."/logs/".UniqueConst::$serverID."/_traffic.txt",
|
||||
Json::encode([
|
||||
$date,
|
||||
$game_env['year'],
|
||||
$game_env['month'],
|
||||
$game_env['refresh'],
|
||||
$admin['year'],
|
||||
$admin['month'],
|
||||
$admin['refresh'],
|
||||
$online,
|
||||
$user['name']."(".$user['refresh'].")"
|
||||
])."\n"
|
||||
@@ -1438,9 +1435,12 @@ function checkDelay() {
|
||||
$iter = intdiv($timeMinDiff, $term);
|
||||
if($iter > $threshold) {
|
||||
$minute = $iter * $term;
|
||||
$newTurntime = $turntime->add(new DateInterval("PT{$minute}M"));
|
||||
$newNextTurntime = $turntime->add(new DateInterval("PT{$term}M"));
|
||||
$gameStor->turntime = $newTurntime;
|
||||
$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)
|
||||
@@ -1537,7 +1537,7 @@ function checkTurn() {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', 진입');
|
||||
|
||||
//천통시에는 동결
|
||||
if($gameStor->isUnited == 2) {
|
||||
if($gameStor->isunited == 2) {
|
||||
$db->update('plock', ['plock'=>1], true);
|
||||
return;
|
||||
}
|
||||
@@ -1743,8 +1743,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'";
|
||||
@@ -1758,8 +1759,9 @@ 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} 익혔습니다!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1842,7 +1844,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'];
|
||||
@@ -1850,7 +1853,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}</>명을 치료합니다!");
|
||||
@@ -1864,7 +1868,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)) {
|
||||
//환약 사용
|
||||
@@ -1893,7 +1898,7 @@ function updateTurntime($no) {
|
||||
$alllog = [];
|
||||
$log = [];
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'isUnited', 'turnterm']);
|
||||
$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),"");
|
||||
@@ -1908,13 +1913,13 @@ 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) {
|
||||
CheckHall($no);
|
||||
}
|
||||
} else {
|
||||
|
||||
storeOldGeneral($general['no'], $admin['year'], $admin['month']);
|
||||
|
||||
// 군주였으면 유지 이음
|
||||
if($general['level'] == 12) {
|
||||
nextRuler($general);
|
||||
@@ -1953,72 +1958,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2029,14 +2035,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>은퇴</>하고 자손에게 자리를 물려줍니다.";
|
||||
@@ -2052,9 +2059,9 @@ function updateTurntime($no) {
|
||||
|
||||
function CheckHall($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$type = array(
|
||||
$types = array(
|
||||
"experience",
|
||||
"dedication",
|
||||
"firenum",
|
||||
@@ -2078,59 +2085,77 @@ function CheckHall($no) {
|
||||
"betrate"
|
||||
);
|
||||
|
||||
$query = "select name,nation,picture,
|
||||
experience,dedication,warnum,firenum,killnum,
|
||||
killnum/warnum*10000 as winrate,killcrew,killcrew/deathcrew*10000 as killrate,
|
||||
dex0,dex10,dex20,dex30,dex40,
|
||||
ttw/(ttw+ttd+ttl)*10000 as ttrate, ttw+ttd+ttl as tt,
|
||||
tlw/(tlw+tld+tll)*10000 as tlrate, tlw+tld+tll as tl,
|
||||
tpw/(tpw+tpd+tpl)*10000 as tprate, tpw+tpd+tpl as tp,
|
||||
tiw/(tiw+tid+til)*10000 as tirate, tiw+tid+til as ti,
|
||||
betgold, betwin, betwingold, betwingold/betgold*10000 as betrate
|
||||
from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = $db->queryFirstRow('SELECT name,name2,owner,nation,picture,imgsvr,
|
||||
experience,dedication,warnum,firenum,killnum,
|
||||
killnum/warnum as winrate,killcrew,killcrew/deathcrew as killrate,
|
||||
dex0,dex10,dex20,dex30,dex40,
|
||||
ttw/(ttw+ttd+ttl) as ttrate, ttw+ttd+ttl as tt,
|
||||
tlw/(tlw+tld+tll) as tlrate, tlw+tld+tll as tl,
|
||||
tpw/(tpw+tpd+tpl) as tprate, tpw+tpd+tpl as tp,
|
||||
tiw/(tiw+tid+til) as tirate, tiw+tid+til as ti,
|
||||
betgold, betwin, betwingold, betwingold/betgold as betrate
|
||||
from general where no=%i', $no);
|
||||
|
||||
if(!$general){
|
||||
return;
|
||||
}
|
||||
|
||||
$unitedDate = date('Y-m-d H:i:s');
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
for($k=0; $k < 21; $k++) {
|
||||
$query = "select * from hall where type='$k' order by data desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||
|
||||
[$scenarioIdx, $scenarioName, $startTime] = $gameStor->getValuesAsArray(['scenario', 'scenario_text', 'starttime']);
|
||||
|
||||
foreach($types as $idx=>$typeName) {
|
||||
|
||||
|
||||
//승률,살상률인데 10회 미만 전투시 스킵
|
||||
if(($k == 5 || $k == 7) && $general['warnum']<10) { continue; }
|
||||
if(($typeName === 'winrate' || $typeName === 'killrate') && $general['warnum']<10) { continue; }
|
||||
//토너승률인데 50회 미만시 스킵
|
||||
if($k == 13 && $general['tt'] < 50) { continue; }
|
||||
if($typeName === 'ttrate' && $general['tt'] < 50) { continue; }
|
||||
//토너승률인데 50회 미만시 스킵
|
||||
if($k == 14 && $general['tl'] < 50) { continue; }
|
||||
if($typeName === 'tlrate' && $general['tl'] < 50) { continue; }
|
||||
//토너승률인데 50회 미만시 스킵
|
||||
if($k == 15 && $general['tp'] < 50) { continue; }
|
||||
if($typeName === 'tprate' && $general['tp'] < 50) { continue; }
|
||||
//토너승률인데 50회 미만시 스킵
|
||||
if($k == 16 && $general['ti'] < 50) { continue; }
|
||||
if($typeName === 'tirate' && $general['ti'] < 50) { continue; }
|
||||
//수익률인데 1000미만시 스킵
|
||||
if($k == 20 && $general['betgold'] < 1000) { continue; }
|
||||
if($typeName === 'betrate' && $general['betgold'] < 1000) { continue; }
|
||||
|
||||
$rank = 10;
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$ranker = MYDB_fetch_array($result);
|
||||
|
||||
if($general[$type[$k]] >= $ranker['data']) {
|
||||
$rank = $i;
|
||||
break;
|
||||
}
|
||||
if($general[$typeName]<=0){
|
||||
continue;
|
||||
}
|
||||
for($i=8; $i >= $rank; $i--) {
|
||||
$j = $i + 1;
|
||||
$query = "select * from hall where type='$k' and rank='$i'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$ranker = MYDB_fetch_array($result);
|
||||
|
||||
$query = "update hall set name='{$ranker['name']}', nation='{$ranker['nation']}', data='{$ranker['data']}', color='{$ranker['color']}', picture='{$ranker['picture']}' where type='$k' and rank='$j'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$query = "update hall set name='{$general['name']}', nation='{$nation['name']}', data='{$general[$type[$k]]}', color='{$nation['color']}', picture='{$general['picture']}' where type='$k' and rank='$rank'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$aux = [
|
||||
'name'=>$general['name'],
|
||||
'nationName'=>$nation['name'],
|
||||
'bgColor'=>$nation['color'],
|
||||
'fgColor'=>newColor($nation['color']),
|
||||
'picture'=>$general['picture'],
|
||||
'imgsvr'=>$general['imgsvr'],
|
||||
'startTime'=>$startTime,
|
||||
'unitedTime'=>$unitedDate,
|
||||
'owner_name'=>$general['name2'],
|
||||
'serverID'=>UniqueConst::$serverID,
|
||||
'serverIdx'=>$serverCnt,
|
||||
'serverName'=>UniqueConst::$serverName,
|
||||
'scenarioName'=>$scenarioName,
|
||||
];
|
||||
$jsonAux = Json::encode($aux);
|
||||
|
||||
$db->insertUpdate('ng_hall', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'scenario'=>$scenarioIdx,
|
||||
'general_no'=>$no,
|
||||
'type'=>$idx,
|
||||
'value'=>$general[$typeName]??0,
|
||||
'owner'=>$general['owner']??null,
|
||||
'aux'=>$jsonAux
|
||||
],[
|
||||
'value'=>$general[$typeName]??0,
|
||||
'aux'=>$jsonAux
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2153,7 +2178,7 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if($game_env['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개 등장
|
||||
@@ -2193,64 +2218,72 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
|
||||
switch($sel) {
|
||||
case 0:
|
||||
$log[] = "<C>●</><C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$game_env['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$game_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year']}년 {$game_env['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_env['year'], $game_env['month']);
|
||||
pushWorldHistory($history, $game_env['year'], $game_env['month']);
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
}
|
||||
return $log;
|
||||
@@ -2315,11 +2348,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;
|
||||
@@ -2408,7 +2443,12 @@ function deleteNation($general) {
|
||||
|
||||
$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>멸망</>했습니다.";
|
||||
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $general['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $general['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
|
||||
// 전 장수 재야로 // 전 장수 소속 무소속으로
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
|
||||
@@ -2420,6 +2460,13 @@ function deleteNation($general) {
|
||||
$query = "delete from troop where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 국가 삭제
|
||||
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$general['nation'],
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$query = "delete from nation where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 외교 삭제
|
||||
@@ -2491,10 +2538,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에서
|
||||
}
|
||||
|
||||
|
||||
+51
-22
@@ -82,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']);
|
||||
}
|
||||
@@ -162,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;
|
||||
@@ -194,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;
|
||||
@@ -204,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']);
|
||||
}
|
||||
@@ -234,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);
|
||||
@@ -265,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;
|
||||
@@ -275,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']) {
|
||||
@@ -306,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;
|
||||
@@ -316,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']) {
|
||||
|
||||
+43
-32
@@ -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];
|
||||
@@ -460,7 +471,7 @@ function processCommand($no) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,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);
|
||||
|
||||
@@ -522,7 +533,7 @@ 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);
|
||||
}
|
||||
@@ -572,7 +583,7 @@ function processCommand($no) {
|
||||
case 17: process_17($general); break; //소집해제
|
||||
|
||||
case 21: process_21($general); break; //이동
|
||||
case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
|
||||
case 22: process_22($general); break; //등용
|
||||
case 25: process_25($general); break; //임관
|
||||
case 26: process_26($general); break; //집합
|
||||
case 28: process_28($general); break; //귀환
|
||||
|
||||
+11
-8
@@ -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;
|
||||
@@ -791,7 +791,10 @@ function getItemCost($weap) : int {
|
||||
|
||||
|
||||
|
||||
function ConvertLog(string $str, $type=1) : string {
|
||||
function ConvertLog(?string $str, $type=1) : string {
|
||||
if(!$str){
|
||||
return '';
|
||||
}
|
||||
//TODO: 이 함수는 없애야 한다. CSS로 대신하자
|
||||
if($type > 0) {
|
||||
$str = str_replace("<1>", "<font size=1>", $str);
|
||||
|
||||
+435
-368
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 게임 내부에 사용하는 유틸리티 함수들을 분리
|
||||
*/
|
||||
|
||||
@@ -213,7 +144,7 @@ function SetNationFront($nationNo) {
|
||||
$db = DB::db();
|
||||
$enemyCities = $db->queryFirstColumn(
|
||||
'SELECT city from city where nation IN
|
||||
(SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=3)))'
|
||||
(SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=5)))'
|
||||
, $nationNo
|
||||
);
|
||||
if($enemyCities) {
|
||||
@@ -245,48 +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($db->query('SELECT capital, nation FROM nation WHERE `level` > 0') 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];
|
||||
if($nation['nation'] != $city['nation']){
|
||||
$city = $cities[$capitalID];
|
||||
if($nationID != $city->nation){
|
||||
continue;
|
||||
}
|
||||
$city['supply'] = true;
|
||||
$queue->enqueue($city['id']);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,11 +242,6 @@ function checkSupply() {
|
||||
], 'city IN %li', $supply);
|
||||
}
|
||||
|
||||
if($unsupply){
|
||||
$db->update('city', [
|
||||
'supply'=>0
|
||||
], 'city IN %li', $unsupply);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -381,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이하 공백지 처리
|
||||
@@ -585,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";
|
||||
@@ -600,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),"");
|
||||
@@ -723,35 +655,52 @@ 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);
|
||||
|
||||
// 국가 백업
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
|
||||
// 자금 통합, 외교제한 5년, 기술유지
|
||||
$query = "update nation set name='{$you['makenation']}',gold=gold+'{$mynation['gold']}',rice=rice+'{$mynation['rice']}',surlimit='24',totaltech='$newTotalTech',tech='$newTech',gennum='{$newGenCount}' where nation='{$younation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//국가 삭제
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$me['nation'],
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$query = "delete from nation where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 아국 모든 도시들 상대국 소속으로
|
||||
@@ -849,23 +798,31 @@ 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} 합병");
|
||||
|
||||
// 국가 백업
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
|
||||
$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년, 기술유지
|
||||
@@ -878,6 +835,13 @@ function checkSurrender() {
|
||||
$query = "update city set pop=pop*0.95,agri=agri*0.95,comm=comm*0.95,secu=secu*0.95,rate=rate*0.95,def=def*0.95,wall=wall*0.95 where nation='{$you['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//국가 삭제
|
||||
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$me['nation'],
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$query = "delete from nation where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 군주가 있는 위치 구함
|
||||
@@ -965,8 +929,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)."</>에 등극하였습니다.";
|
||||
@@ -991,7 +956,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,53 +967,79 @@ function updateNationState() {
|
||||
function checkStatistic() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$nationHists = [];
|
||||
$specialHists = [];
|
||||
$personalHists = [];
|
||||
$specialHists2 = [0];
|
||||
$specialHists2 = [];
|
||||
$crewtypeHists = [];
|
||||
|
||||
$etc = '';
|
||||
|
||||
$query = "select avg(gold) as avggold, avg(rice) as avgrice, avg(dex0+dex10+dex20+dex30) as avgdex, max(dex0+dex10+dex20+dex30) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['avggold'] = Util::round($general['avggold']);
|
||||
$general['avgrice'] = Util::round($general['avgrice']);
|
||||
$general['avgdex'] = Util::round($general['avgdex']);
|
||||
$general['avgexpded'] = Util::round($general['avgexpded']);
|
||||
$etc .= "평균 금/쌀 ({$general['avggold']}/{$general['avgrice']}), 평균/최고 숙련({$general['avgdex']}/{$general['maxdex']}), 평균/최고 경험공헌({$general['avgexpded']}/{$general['maxexpded']}), ";
|
||||
$auxData = [
|
||||
'generals'=>[],
|
||||
'nations'=>[],
|
||||
];
|
||||
|
||||
$query = "select min(tech) as mintech, max(tech) as maxtech, avg(tech) as avgtech, min(power) as minpower, max(power) as maxpower, avg(power) as avgpower from nation where level>0";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nation['avgtech'] = Util::round($nation['avgtech']);
|
||||
$nation['avgpower'] = Util::round($nation['avgpower']);
|
||||
$etc .= "최저/평균/최고 기술({$nation['mintech']}/{$nation['avgtech']}/{$nation['maxtech']}), ";
|
||||
$etc .= "최저/평균/최고 국력({$nation['minpower']}/{$nation['avgpower']}/{$nation['maxpower']}), ";
|
||||
$avgGeneral = $db->queryFirstRow(
|
||||
'SELECT avg(gold) as avggold, avg(rice) as avgrice, avg(dex0+dex10+dex20+dex30) as avgdex,
|
||||
max(dex0+dex10+dex20+dex30) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded
|
||||
FROM general'
|
||||
);
|
||||
$auxData['generals']['avg'] = $avgGeneral;
|
||||
|
||||
$avgGeneral['avggold'] = Util::round($avgGeneral['avggold']);
|
||||
$avgGeneral['avgrice'] = Util::round($avgGeneral['avgrice']);
|
||||
$avgGeneral['avgdex'] = Util::round($avgGeneral['avgdex']);
|
||||
$avgGeneral['avgexpded'] = Util::round($avgGeneral['avgexpded']);
|
||||
$etc .= "평균 금/쌀 ({$avgGeneral['avggold']}/{$avgGeneral['avgrice']}), 평균/최고 숙련({$avgGeneral['avgdex']}/{$avgGeneral['maxdex']}), 평균/최고 경험공헌({$avgGeneral['avgexpded']}/{$avgGeneral['maxexpded']}), ";
|
||||
|
||||
$avgNation = $db->queryFirstRow(
|
||||
'SELECT min(tech) as mintech, max(tech) as maxtech, avg(tech) as avgtech,
|
||||
min(power) as minpower, max(power) as maxpower, avg(power) as avgpower from nation where level>0');
|
||||
$auxData['nations']['avg'] = $avgNation;
|
||||
|
||||
$avgNation['avgtech'] = Util::round($avgNation['avgtech']);
|
||||
$avgNation['avgpower'] = Util::round($avgNation['avgpower']);
|
||||
$etc .= "최저/평균/최고 기술({$avgNation['mintech']}/{$avgNation['avgtech']}/{$avgNation['maxtech']}), ";
|
||||
$etc .= "최저/평균/최고 국력({$avgNation['minpower']}/{$avgNation['avgpower']}/{$avgNation['maxpower']}), ";
|
||||
|
||||
$nationName = '';
|
||||
$power_hist = '';
|
||||
$powerHist = '';
|
||||
|
||||
$query = "select nation,name,type,power,gennum,round((gold+rice)/100) as goldrice from nation where level>0 order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nations = Util::convertArrayToDict(
|
||||
$db->query(
|
||||
'SELECT nation,name,type,power,gennum,gold+rice as goldrice from nation where level>0 order by power desc', 'nation'
|
||||
),
|
||||
'nation'
|
||||
);
|
||||
$nationCount = count($nations);
|
||||
|
||||
$query = "select sum(leader+power+intel) as abil,round(sum(gold+rice)/100) as goldrice,round(sum(dex0+dex10+dex20+dex30)/1000) as dex,round(sum(experience+dedication)/100) as expded from general where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result2);
|
||||
$nationGeneralInfos = Util::convertArrayToDict(
|
||||
$db->query(
|
||||
'SELECT nation, sum(leader+power+intel) as abil,sum(gold+rice) as goldrice,
|
||||
sum(dex0+dex10+dex20+dex30) as dex,sum(experience+dedication) as expded
|
||||
from general GROUP BY nation'
|
||||
),
|
||||
'nation'
|
||||
);
|
||||
|
||||
$query = "select count(*) as cnt,round(sum(pop)/100) as pop,round(sum(pop2)/100) as pop2 from city where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result2);
|
||||
$nationCityInfos = Util::convertArrayToDict(
|
||||
$db->query('SELECT nation, count(*) as cnt, sum(pop) as pop,sum(pop2) as pop2 from city GROUP BY nation'),
|
||||
'nation'
|
||||
);
|
||||
|
||||
foreach($nations as $nationNo=>&$nation) {
|
||||
$general = $nationGeneralInfos[$nationNo];
|
||||
$city = $nationCityInfos[$nationNo];
|
||||
|
||||
$nation['generalInfo'] = $general;
|
||||
$nation['cityInfo'] = $city;
|
||||
|
||||
$nationName .= $nation['name'].'('.getNationType($nation['type']).'), ';
|
||||
$power_hist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop2']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), ";
|
||||
$powerHist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop2']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), ";
|
||||
|
||||
if(!isset($nationHists[$nation['type']])){
|
||||
$nationHists[$nation['type']] = 0;
|
||||
@@ -1056,26 +1047,21 @@ function checkStatistic() {
|
||||
$nationHists[$nation['type']]++;
|
||||
}
|
||||
|
||||
$auxData['nations']['all'] = $nations;
|
||||
|
||||
$nationHist = '';
|
||||
for($i=1; $i <= 13; $i++) {
|
||||
if(!Util::array_get($nationHists[$i])) { $nationHists[$i] = '-'; }
|
||||
$nationHist .= getNationType($i)."({$nationHists[$i]}), ";
|
||||
}
|
||||
|
||||
$query = "select no from general where npc <= 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
$generals = $db->query('SELECT `no`,npc,personal,special,special2,crewtype FROM general');
|
||||
|
||||
$query = "select no from general where npc > 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$npcCount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select personal,special,special2 from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$generalCount = MYDB_num_rows($result);
|
||||
for($i=0; $i < $generalCount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$genCount = 0;
|
||||
$npcCount = 0;
|
||||
$generalCount = count($generals);
|
||||
|
||||
foreach($generals as $general) {
|
||||
if(!isset($personalHists[$general['personal']])){
|
||||
$personalHists[$general['personal']] = 0;
|
||||
}
|
||||
@@ -1088,70 +1074,112 @@ function checkStatistic() {
|
||||
$specialHists2[$general['special2']] = 0;
|
||||
}
|
||||
|
||||
if($general['npc'] < 2){
|
||||
$genCount+=1;
|
||||
}
|
||||
else{
|
||||
$npcCount+=1;
|
||||
}
|
||||
|
||||
$personalHists[$general['personal']]++;
|
||||
$specialHists[$general['special']]++;
|
||||
$specialHists2[$general['special2']]++;
|
||||
}
|
||||
|
||||
foreach($db->queryAllLists(
|
||||
'SELECT crewtype, count(crewtype) AS cnt FROM general WHERE crew>=100 OR deathnum>0 GROUP BY crewtype'
|
||||
) as [$crewtype, $cnt]
|
||||
){
|
||||
$crewtypeHists[$crewtype] = $cnt;
|
||||
}
|
||||
|
||||
$auxData['generals']['hists'] = [
|
||||
'personal' => $personalHists,
|
||||
'special' => $specialHists,
|
||||
'special2' => $specialHists2,
|
||||
'crewtype' => $crewtypeHists,
|
||||
'userCnt' => $genCount,
|
||||
'npcCnt' => $npcCount,
|
||||
];
|
||||
|
||||
$generalCountStr = "{$generalCount}({$genCount}+{$npcCount})";
|
||||
|
||||
$personalHist = '';
|
||||
for($i=0; $i < 11; $i++) {
|
||||
if(!Util::array_get($personalHists[$i])) { $personalHists[$i] = '-'; }
|
||||
$personalHist .= getGenChar($i)."({$personalHists[$i]}), ";
|
||||
}
|
||||
$specialHist = '';
|
||||
for($i=0; $i < 40; $i++) {
|
||||
$call = getGenSpecial($i);
|
||||
if($call) {
|
||||
if(!Util::array_get($specialHists[$i])) { $specialHists[$i] = '-'; }
|
||||
$personalHistStr = join(', ', array_map(function($histPair){
|
||||
[$histKey, $cnt] = $histPair;
|
||||
return getGenChar($histKey).'('.$cnt.')';
|
||||
}, Util::convertDictToArray($personalHists)));
|
||||
|
||||
$specialHist .= $call."({$specialHists[$i]}), ";
|
||||
}
|
||||
}
|
||||
$specialHist .= '// ';
|
||||
$specialHist .= "-({$specialHists2[0]}), ";
|
||||
for($i=40; $i < 80; $i++) {
|
||||
$call = getGenSpecial($i);
|
||||
if($call) {
|
||||
if(!Util::array_get($specialHists2[$i])) { $specialHists2[$i] = '-'; }
|
||||
$specialHistsStr = join(', ', array_map(function($histPair){
|
||||
[$histKey, $cnt] = $histPair;
|
||||
return getGenSpecial($histKey).'('.$cnt.')';
|
||||
}, Util::convertDictToArray($specialHists)));
|
||||
|
||||
$specialHist .= $call."({$specialHists2[$i]}), ";
|
||||
}
|
||||
}
|
||||
$specialHists2Str = join(', ', array_map(function($histPair){
|
||||
[$histKey, $cnt] = $histPair;
|
||||
return getGenSpecial($histKey).'('.$cnt.')';
|
||||
}, Util::convertDictToArray($specialHists2)));
|
||||
|
||||
$crewtype = '';
|
||||
$types = array(0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43);
|
||||
$count = count($types);
|
||||
foreach(GameUnitConst::all() as $unit){
|
||||
$userCnt = DB::db()->queryFirstField(
|
||||
"SELECT count(*) as type from general where crewtype=%i and crew>=100",
|
||||
$unit->id
|
||||
$specialHistsAllStr = "$specialHistsStr // $specialHists2Str";
|
||||
|
||||
$crewtypeHistsStr = join(', ', array_map(function($histPair){
|
||||
[$histKey, $cnt] = $histPair;
|
||||
return getGenSpecial($histKey).'('.$cnt.')';
|
||||
}, Util::convertDictToArray($crewtypeHists)));
|
||||
|
||||
$db->insert('statistic', [
|
||||
'year'=>$admin['year'],
|
||||
'month'=>$admin['month'],
|
||||
'nation_count'=>$nationCount,
|
||||
'nation_name'=>$nationName,
|
||||
'nation_hist'=>$nationHist,
|
||||
'gen_count'=>$generalCountStr,
|
||||
'personal_hist'=>$personalHistStr,
|
||||
'special_hist'=>$specialHistsAllStr,
|
||||
'power_hist'=>$powerHist,
|
||||
'crewtype'=>$crewtypeHistsStr,
|
||||
'etc'=>$etc,
|
||||
'aux'=>Json::encode($auxData)
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function convForOldGeneral(array $general, int $year, int $month){
|
||||
return [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'general_no'=>$general['no'],
|
||||
'owner'=>$general['owner'],
|
||||
'name'=>$general['name'],
|
||||
'last_yearmonth'=>$year*100+$month,
|
||||
'turntime'=>$general['turntime'],
|
||||
'data'=>Json::encode($general)
|
||||
];
|
||||
}
|
||||
|
||||
function storeOldGeneral(int $no, int $year, int $month){
|
||||
$db = DB::db();
|
||||
$general = $db->queryFirstRow('SELECT * FROM general WHERE `no` = %i', $no);
|
||||
if(!$general){
|
||||
return;
|
||||
}
|
||||
$data = convForOldGeneral($general, $year, $month);
|
||||
$db->insertUpdate(
|
||||
'ng_old_generals',
|
||||
$data,
|
||||
$data
|
||||
);
|
||||
}
|
||||
|
||||
function storeOldGenerals(int $nation, int $year, int $month){
|
||||
$db = DB::db();
|
||||
foreach($db->query('SELECT * FROM general WHERE nation = %i',$nation) as $general){
|
||||
$data = convForOldGeneral($general, $year, $month);
|
||||
$db->insertUpdate(
|
||||
'ng_old_generals',
|
||||
$data,
|
||||
$data
|
||||
);
|
||||
$crewtype .= "{$unit->name}({$userCnt}), ";
|
||||
}
|
||||
for($i=0; $i < $count; $i++) {
|
||||
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$query = "
|
||||
insert into statistic (
|
||||
year, month,
|
||||
nation_count, nation_name, nation_hist,
|
||||
gen_count, personal_hist, special_hist, power_hist,
|
||||
crewtype, etc
|
||||
) values (
|
||||
'{$admin['year']}', '{$admin['month']}',
|
||||
'$nationCount', '$nationName', '$nationHist',
|
||||
'$generalCountStr', '$personalHist', '$specialHist', '$power_hist',
|
||||
'$crewtype', '$etc'
|
||||
)";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function checkEmperior() {
|
||||
@@ -1159,186 +1187,225 @@ function checkEmperior() {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'isUnited']);
|
||||
$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) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
if ($count != 1 || $admin['isunited'] != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select city from city";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$allcount = MYDB_num_rows($result);
|
||||
$count = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i', $nation['nation']);
|
||||
if(!$count){
|
||||
return;
|
||||
}
|
||||
$allcount = $db->queryFirstField('SELECT count(city) FROM city');
|
||||
|
||||
if($count == $allcount) {
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>(이)가 전토를 통일");
|
||||
if ($count != $allcount) {
|
||||
return;
|
||||
}
|
||||
|
||||
$gameStor->isUnited = 2;
|
||||
$gameStor->conlimit = $gameStor->conlimit*100;
|
||||
checkStatistic();
|
||||
|
||||
$query = "select no from general where npc<2 and age>=45";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$josaYi = JosaUtil::pick($nation['name'], '이');
|
||||
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
CheckHall($general['no']);
|
||||
}
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일");
|
||||
|
||||
$query = "select nation,name,type,color,gold,rice,power,gennum from nation where nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$gameStor->isunited = 2;
|
||||
$gameStor->conlimit = $gameStor->conlimit*100;
|
||||
|
||||
$query = "select SUM(pop) as totalpop,SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
$pop = "{$city['totalpop']} / {$city['maxpop']}";
|
||||
$poprate = round($city['totalpop']/$city['maxpop']*100, 2);
|
||||
$poprate .= " %";
|
||||
$query = "select no from general where npc<2 and age>=40";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='12'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level12 = MYDB_fetch_array($genresult);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
CheckHall($general['no']);
|
||||
}
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='11'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level11 = MYDB_fetch_array($genresult);
|
||||
$query = "select nation,name,type,color,gold,rice,power,gennum from nation where nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='10'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level10 = MYDB_fetch_array($genresult);
|
||||
$query = "select SUM(pop) as totalpop,SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
$pop = "{$city['totalpop']} / {$city['maxpop']}";
|
||||
$poprate = round($city['totalpop']/$city['maxpop']*100, 2);
|
||||
$poprate .= " %";
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='9'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level9 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='12'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level12 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='8'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level8 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='11'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level11 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='7'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level7 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='10'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level10 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='6'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level6 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='9'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level9 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='5'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level5 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='8'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level8 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,killnum from general where nation='{$nation['nation']}' order by killnum desc limit 5"; // 오호장군
|
||||
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$tigernum = MYDB_num_rows($tigerresult);
|
||||
$tigerstr = '';
|
||||
for($i=0; $i < $tigernum; $i++) {
|
||||
$tiger = MYDB_fetch_array($tigerresult);
|
||||
if($tiger['killnum'] > 0) {
|
||||
$tigerstr .= "{$tiger['name']}【{$tiger['killnum']}】, ";
|
||||
}
|
||||
}
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='7'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level7 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name,picture,firenum from general where nation='{$nation['nation']}' order by firenum desc limit 7"; // 건안칠자
|
||||
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$eaglenum = MYDB_num_rows($eagleresult);
|
||||
$eaglestr = '';
|
||||
for($i=0; $i < $eaglenum; $i++) {
|
||||
$eagle = MYDB_fetch_array($eagleresult);
|
||||
if($eagle['firenum'] > 0) {
|
||||
$eaglestr .= "{$eagle['name']}【{$eagle['firenum']}】, ";
|
||||
}
|
||||
}
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='6'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level6 = MYDB_fetch_array($genresult);
|
||||
|
||||
$log = ["<C>●</>{$admin['year']}년 {$admin['month']}월: <D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
|
||||
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='5'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level5 = MYDB_fetch_array($genresult);
|
||||
|
||||
$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),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gen = '';
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$gen .= "{$general['name']}, ";
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
|
||||
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['generals'] = $oldNationGenerals;
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
$nation['type'] = getNationType($nation['type']);
|
||||
|
||||
$query = "select MAX(nation_count) as nc,MAX(gen_count) as gc from statistic";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$stat = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select count(*) as cnt from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_fetch_array($result);
|
||||
|
||||
$statNC = "1 / {$stat['nc']}";
|
||||
$statGC = "{$gencount['cnt']} / {$stat['gc']}";
|
||||
|
||||
$query = "select nation_count,nation_name,nation_hist from statistic where nation_count='{$stat['nc']}' limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$statNation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gen_count,personal_hist,special_hist from statistic order by no desc limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$statGeneral = MYDB_fetch_array($result);
|
||||
|
||||
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
|
||||
|
||||
$db->insert('emperior', [
|
||||
'phase'=>'-',
|
||||
'nation_count'=>$statNC,
|
||||
'nation_name'=>$statNation['nation_name'],
|
||||
'nation_hist'=>$statNation['nation_hist'],
|
||||
'gen_count'=>$statGC,
|
||||
'personal_hist'=>$statGeneral['personal_hist'],
|
||||
'special_hist'=>$statGeneral['special_hist'],
|
||||
'name'=>$nation['name'],
|
||||
'type'=>$nation['type'],
|
||||
'color'=>$nation['color'],
|
||||
'year'=>$admin['year'],
|
||||
'month'=>$admin['month'],
|
||||
'power'=>$nation['power'],
|
||||
'gennum'=>$nation['gennum'],
|
||||
'citynum'=>$allcount,
|
||||
'pop'=>$pop,
|
||||
'poprate'=>$poprate,
|
||||
'gold'=>$nation['gold'],
|
||||
'rice'=>$nation['rice'],
|
||||
'l12name'=>$level12['name'],
|
||||
'l12pic'=>$level12['picture'],
|
||||
'l11name'=>$level11['name'],
|
||||
'l11pic'=>$level11['picture'],
|
||||
'l10name'=>$level10['name'],
|
||||
'l10pic'=>$level10['picture'],
|
||||
'l9name'=>$level9['name'],
|
||||
'l9pic'=>$level9['picture'],
|
||||
'l8name'=>$level8['name'],
|
||||
'l8pic'=>$level8['picture'],
|
||||
'l7name'=>$level7['name'],
|
||||
'l7pic'=>$level7['picture'],
|
||||
'l6name'=>$level6['name'],
|
||||
'l6pic'=>$level6['picture'],
|
||||
'l5name'=>$level5['name'],
|
||||
'l5pic'=>$level5['picture'],
|
||||
'tiger'=>$tigerstr,
|
||||
'eagle'=>$eaglestr,
|
||||
'gen'=>$gen,
|
||||
'history'=>$nationHistory
|
||||
]);
|
||||
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
|
||||
//연감 월결산
|
||||
LogHistory();
|
||||
$query = "select name,picture,killnum from general where nation='{$nation['nation']}' order by killnum desc limit 5"; // 오호장군
|
||||
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$tigernum = MYDB_num_rows($tigerresult);
|
||||
$tigerstr = '';
|
||||
for($i=0; $i < $tigernum; $i++) {
|
||||
$tiger = MYDB_fetch_array($tigerresult);
|
||||
if($tiger['killnum'] > 0) {
|
||||
$tigerstr .= "{$tiger['name']}【{$tiger['killnum']}】, ";
|
||||
}
|
||||
}
|
||||
|
||||
$query = "select name,picture,firenum from general where nation='{$nation['nation']}' order by firenum desc limit 7"; // 건안칠자
|
||||
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$eaglenum = MYDB_num_rows($eagleresult);
|
||||
$eaglestr = '';
|
||||
for($i=0; $i < $eaglenum; $i++) {
|
||||
$eagle = MYDB_fetch_array($eagleresult);
|
||||
if($eagle['firenum'] > 0) {
|
||||
$eaglestr .= "{$eagle['name']}【{$eagle['firenum']}】, ";
|
||||
}
|
||||
}
|
||||
|
||||
$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),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gen = '';
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$gen .= "{$general['name']}, ";
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
$nation['type'] = getNationType($nation['type']);
|
||||
|
||||
$query = "select MAX(nation_count) as nc,MAX(gen_count) as gc from statistic";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$stat = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select count(*) as cnt from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_fetch_array($result);
|
||||
|
||||
$statNC = "1 / {$stat['nc']}";
|
||||
$statGC = "{$gencount['cnt']} / {$stat['gc']}";
|
||||
|
||||
$query = "select nation_count,nation_name,nation_hist from statistic where nation_count='{$stat['nc']}' limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$statNation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select gen_count,personal_hist,special_hist,aux from statistic order by no desc limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$statGeneral = MYDB_fetch_array($result);
|
||||
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
|
||||
$oldNation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
||||
|
||||
storeOldGenerals(0, $admin['year'], $admin['month']);
|
||||
storeOldGenerals($nation['nation'], $admin['year'], $admin['month']);
|
||||
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$nation['nation'],
|
||||
'history'=>'',
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$noNationGeneral = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=0');
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>0,
|
||||
'data'=>Json::encode([
|
||||
'nation'=>0,
|
||||
'name'=>'재야',
|
||||
'generals'=>$noNationGeneral
|
||||
])
|
||||
]);
|
||||
|
||||
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
|
||||
|
||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||
$serverName = UniqueConst::$serverName;
|
||||
|
||||
$db->insert('emperior', [
|
||||
'phase'=>$serverName.$serverCnt.'기',
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation_count'=>$statNC,
|
||||
'nation_name'=>$statNation['nation_name'],
|
||||
'nation_hist'=>$statNation['nation_hist'],
|
||||
'gen_count'=>$statGC,
|
||||
'personal_hist'=>$statGeneral['personal_hist'],
|
||||
'special_hist'=>$statGeneral['special_hist'],
|
||||
'name'=>$nation['name'],
|
||||
'type'=>$nation['type'],
|
||||
'color'=>$nation['color'],
|
||||
'year'=>$admin['year'],
|
||||
'month'=>$admin['month'],
|
||||
'power'=>$nation['power'],
|
||||
'gennum'=>$nation['gennum'],
|
||||
'citynum'=>$allcount,
|
||||
'pop'=>$pop,
|
||||
'poprate'=>$poprate,
|
||||
'gold'=>$nation['gold'],
|
||||
'rice'=>$nation['rice'],
|
||||
'l12name'=>$level12['name'],
|
||||
'l12pic'=>$level12['picture'],
|
||||
'l11name'=>$level11['name'],
|
||||
'l11pic'=>$level11['picture'],
|
||||
'l10name'=>$level10['name'],
|
||||
'l10pic'=>$level10['picture'],
|
||||
'l9name'=>$level9['name'],
|
||||
'l9pic'=>$level9['picture'],
|
||||
'l8name'=>$level8['name'],
|
||||
'l8pic'=>$level8['picture'],
|
||||
'l7name'=>$level7['name'],
|
||||
'l7pic'=>$level7['picture'],
|
||||
'l6name'=>$level6['name'],
|
||||
'l6pic'=>$level6['picture'],
|
||||
'l5name'=>$level5['name'],
|
||||
'l5pic'=>$level5['picture'],
|
||||
'tiger'=>$tigerstr,
|
||||
'eagle'=>$eaglestr,
|
||||
'gen'=>$gen,
|
||||
'history'=>$nationHistory,
|
||||
'aux'=>$statGeneral['aux']
|
||||
]);
|
||||
|
||||
$history = ["<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
|
||||
//연감 월결산
|
||||
LogHistory();
|
||||
}
|
||||
|
||||
+50
-21
@@ -5,7 +5,7 @@ namespace sammo;
|
||||
|
||||
function delStepLog() {
|
||||
$date = date('Y_m_d');
|
||||
@unlink(__dir__."/logs/_{$date}_steplog.txt");
|
||||
@unlink(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt");
|
||||
}
|
||||
|
||||
function pushRawFileLog($path, $lines){
|
||||
@@ -50,81 +50,109 @@ function eraseTnmtFightLogAll(){
|
||||
}
|
||||
|
||||
function eraseTnmtFightLog(int $group){
|
||||
$filepath = __dir__."/logs/fight{$group}.txt";
|
||||
$filepath = __dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt";
|
||||
if(file_exists($filepath)){
|
||||
@unlink($filepath);
|
||||
}
|
||||
}
|
||||
|
||||
function pushTnmtFightLog(int $group, $log) {
|
||||
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt", $log);
|
||||
}
|
||||
|
||||
function getTnmtFightLogAll(int $group) {
|
||||
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
|
||||
return join('<br>',getFormattedFileLogAll(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt"));
|
||||
}
|
||||
|
||||
function pushSabotageLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $log);
|
||||
}
|
||||
|
||||
function getSabotageLogRecent($count) {
|
||||
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/_sabotagelog.txt", $count, 150));
|
||||
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $count, 150));
|
||||
}
|
||||
|
||||
function pushProcessLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
|
||||
}
|
||||
|
||||
|
||||
function pushStepLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
|
||||
}
|
||||
|
||||
function pushLockLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAdminLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_adminlog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAuctionLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $log);
|
||||
}
|
||||
|
||||
function getAuctionLogRecent(int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/_auctionlog.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushGenLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getGenLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/gen{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatRes($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatResRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batres{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batlog{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushOldNationStop(int $no, int $nationNo){
|
||||
$logPrefixList = ['batres', 'gen', 'batlog'];
|
||||
|
||||
$result = [];
|
||||
foreach($logPrefixList as $logPrefix){
|
||||
$path = __dir__."/logs/".UniqueConst::$serverID."/{$logPrefix}{$no}.txt";
|
||||
if(file_exists($path)){
|
||||
$fileLen = @filesize($path);
|
||||
}
|
||||
else{
|
||||
$fileLen = 0;
|
||||
}
|
||||
$result[$logPrefix] = $fileLen;
|
||||
}
|
||||
|
||||
$baseStopPath = __dir__."/logs/".UniqueConst::$serverID."/stop{$no}.txt";
|
||||
if(file_exists($baseStopPath)){
|
||||
$oldValues = Json::decode(file_get_contents($baseStopPath));
|
||||
}
|
||||
else{
|
||||
$oldValues = [];
|
||||
}
|
||||
|
||||
$oldValues[$nationNo] = $result;
|
||||
|
||||
file_put_contents($baseStopPath, Json::encode($oldValues, Json::PRETTY));
|
||||
}
|
||||
|
||||
//DB-based
|
||||
@@ -290,14 +318,15 @@ 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');
|
||||
|
||||
$db->insert('history', [
|
||||
'server_id' => UniqueConst::$serverID,
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'map' => $map_json,
|
||||
|
||||
+11
-3
@@ -1,12 +1,14 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
class MapRequest{
|
||||
public $serverID;
|
||||
public $year;
|
||||
public $month;
|
||||
public $aux;
|
||||
public $neutralView;
|
||||
public $showMe;
|
||||
function __construct($obj){
|
||||
$this->serverID = Util::array_get($obj['serverID'], null);
|
||||
$this->year = Util::array_get($obj['year']);
|
||||
$this->month = Util::array_get($obj['month']);
|
||||
$this->aux = Util::array_get($obj['aux'],[]);
|
||||
@@ -19,14 +21,20 @@ class MapRequest{
|
||||
/**
|
||||
* @param int $year
|
||||
* @param int $month
|
||||
* @param string|null $serverID
|
||||
* @return mixed
|
||||
*/
|
||||
function getHistoryMap($year, $month){
|
||||
function getHistoryMap($year, $month, ?string $serverID=null){
|
||||
if(!$year || !$month){
|
||||
return ['result'=>false, 'reason'=>'연 월이 지정되지 않음'];
|
||||
}
|
||||
|
||||
$map = DB::db()->queryFirstField('select map from history where year=%i and month=%i',
|
||||
if($serverID === null){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
}
|
||||
|
||||
$map = DB::db()->queryFirstField('SELECT map FROM history WHERE server_id = %s AND year=%i and month=%i',
|
||||
$serverID,
|
||||
$year,
|
||||
$month);
|
||||
|
||||
@@ -47,7 +55,7 @@ function getWorldMap($req){
|
||||
}
|
||||
|
||||
if($req->year && $req->month){
|
||||
return getHistoryMap($req->year, $req->month);
|
||||
return getHistoryMap($req->year, $req->month, $req->serverID??null);
|
||||
}
|
||||
|
||||
$session = Session::getInstance();
|
||||
|
||||
@@ -44,15 +44,3 @@ function getMailboxList(){
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Legacy
|
||||
|
||||
function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//TODO: moveMsg 쓰는 곳 모두 고쳐!!!
|
||||
$query = "update {$table} set {$msgtype}{$msgnum}='$msg',{$msgtype}{$msgnum}_type='$type',{$msgtype}{$msgnum}_who='$who',{$msgtype}{$msgnum}_when='$when' where {$column}='$value'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
+501
-248
@@ -228,7 +228,7 @@ function processAI($no) {
|
||||
// 전쟁준비 선포중이면 2상태
|
||||
if($dipCount > 0) { $dipState = 2; }
|
||||
|
||||
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term<=3";
|
||||
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term<=5";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
|
||||
$dipCount = MYDB_num_rows($result);
|
||||
// 교전 직전이면 3상태
|
||||
@@ -309,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); //견문
|
||||
}
|
||||
@@ -322,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 {
|
||||
@@ -378,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),"");
|
||||
@@ -499,184 +484,11 @@ function processAI($no) {
|
||||
|
||||
//방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일
|
||||
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0) {
|
||||
$query = "select A.no,A.name,A.nation,B.nation from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation!='{$general['nation']}' and A.no!='{$general['no']}' order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
|
||||
$curGen = MYDB_fetch_array($result);
|
||||
|
||||
if($curGen['no'] != 0) { // 타도시에 있는 경우 국내로 발령
|
||||
if($dipState >= 3) {
|
||||
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
if($selCity['city'] > 0) {
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $curGen['no'], $selCity['city'], 27);
|
||||
} else {
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
|
||||
}
|
||||
} else {
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
|
||||
}
|
||||
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
} elseif($dipState <= 1) { // 평시엔 균등 발령만
|
||||
//발령, 최소장수 도시 선택, 최다장수도시의 장수 선택
|
||||
$query = "select B.city,count(*) as cnt,((B.agri+B.comm+B.secu+B.def+B.wall)/(B.agri2+B.comm2+B.secu2+B.def2+B.wall2)+(B.pop/B.pop2))/2*100 as dev from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.supply=1 group by A.city";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($result);
|
||||
//도시 2개 이상일때만
|
||||
if($cityCount > 1) {
|
||||
$min = 500; $minCity = 0;
|
||||
$max = 0; $maxCity = 0;
|
||||
$devCity = 0;
|
||||
for($i=0; $i < $cityCount; $i++) {
|
||||
$curCity = MYDB_fetch_array($result);
|
||||
if($curCity['cnt'] >= $max) { $max = $curCity['cnt']; $maxCity = $curCity['city']; }
|
||||
if($curCity['cnt'] <= $min) { $min = $curCity['cnt']; $minCity = $curCity['city']; }
|
||||
if($curCity['dev'] < 70) { $devCity = $curCity['city']; } // 개발이 안된 곳 우선
|
||||
}
|
||||
if($devCity != 0) { $minCity = $devCity; }
|
||||
if($maxCity != $minCity) {
|
||||
$query = "select no from general where city='$maxCity' and nation='{$general['nation']}' and no!='{$general['no']}' and npc>=2 limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
|
||||
$curGen = MYDB_fetch_array($result);
|
||||
|
||||
if($curGen['no'] != 0) {
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $curGen['no'], $minCity, 27);
|
||||
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
}
|
||||
//계속 진행
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 병사있고 쌀있고 후방에 있는 장수
|
||||
$query = "select A.no from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.front=0 and A.crew>700 and A.rice>700*{$tech} order by A.npc,A.crew desc limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selGen = MYDB_fetch_array($result);
|
||||
// 전방 도시, 30% 확률로 태수 있는 전방으로 발령
|
||||
if(rand()%100 < 30) {
|
||||
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by gen1 desc,rand() limit 0,1";
|
||||
} else {
|
||||
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by rand() limit 0,1";
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
|
||||
} else {
|
||||
//병사 없고 인구없는 전방에 있는 장수
|
||||
$query = "select A.no from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.pop<40000 and B.front=1 and A.crew<700 order by A.npc,A.crew limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selGen = MYDB_fetch_array($result);
|
||||
// 인구많은도시
|
||||
$query = "select city from city where nation='{$general['nation']}' and supply=1 order by pop desc limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
|
||||
// 발령
|
||||
$command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
|
||||
} else {
|
||||
// 발령할 장수 없으면 몰포
|
||||
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
|
||||
else { $type = "rice"; $type2 = 2; }
|
||||
|
||||
if($nation[$type] < $type2*3000) { // 몰수
|
||||
// 몰수 대상
|
||||
list($npcGenID, $npcGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc >= 2 ORDER BY %b DESC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$type
|
||||
);
|
||||
|
||||
list($userGenID, $userGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc < 2 ORDER BY %b DESC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$type
|
||||
);
|
||||
|
||||
if($npcGenID === null && $userGenID === null){
|
||||
$genID = 0;
|
||||
$genValue = 0;
|
||||
}
|
||||
else if($npcGenID === null || $userGenValue > $npcGenValue * 4){
|
||||
$genID = $userGenID;
|
||||
$genValue = $userGenValue;
|
||||
}
|
||||
else{
|
||||
$genID = $npcGenID;
|
||||
$genValue = $npcGenValue;
|
||||
}
|
||||
|
||||
if($genID){
|
||||
$amount = min(100, intdiv($genValue, 5000)*10 + 10);
|
||||
// 몰수
|
||||
$command = EncodeCommand($type2, $genID, $amount, 24); // 금,쌀 1000단위 몰수
|
||||
}
|
||||
} else { // 포상
|
||||
// 포상 대상
|
||||
list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList(
|
||||
'SELECT `no`, %b, leader FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
$resrc,
|
||||
$type
|
||||
);
|
||||
|
||||
list($userGenID, $userGenValue) = $db->queryFirstList(
|
||||
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND npc < 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
|
||||
$type,
|
||||
$general['nation'],
|
||||
$general['no'],
|
||||
$type,
|
||||
($type=='gold')?21000:3000,
|
||||
$type
|
||||
);
|
||||
|
||||
if($npcGenID === null && $userGenID === null){
|
||||
$genID = 0;
|
||||
}
|
||||
else if($npcGenID === null || ($userGenValue !== null && $userGenValue < $npcGenValue * 3)){
|
||||
$genID = $userGenID;
|
||||
}
|
||||
else{
|
||||
$genID = $npcGenID;
|
||||
}
|
||||
|
||||
if ($genID) {
|
||||
if($genID === $npcGenID){
|
||||
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||
if($npcLeadership < 40){
|
||||
$amount = min($amount, intdiv($resrc, 1000)*10 + 10);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 2000)*10 + 10);
|
||||
}
|
||||
|
||||
// 포상
|
||||
$command = EncodeCommand($type2, $genID, $amount, 23); // 금,쌀 1000단위 포상
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($command)){
|
||||
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
||||
}
|
||||
$command = NPCStaffWork($general, $nation, $dipState);
|
||||
if($command){
|
||||
$db->update('nation', [
|
||||
"l{$general['level']}turn0"=>$command
|
||||
], 'nation=%i', $general['nation']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,7 +536,7 @@ function processAI($no) {
|
||||
){
|
||||
//쌀을 많이 들고 있다면
|
||||
$amount = $general['rice'] * 0.9;
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 1000, 10000), 100);
|
||||
|
||||
$command = EncodeCommand(0, 2, $amount, 44); //헌납
|
||||
$db->update('general', [
|
||||
@@ -739,7 +551,7 @@ function processAI($no) {
|
||||
){
|
||||
//금을 많이 들고 있다면
|
||||
$amount = $general['gold'] * 0.9;
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
|
||||
$amount = intdiv(Util::valueFit($amount, $resrc + 1000, 10000), 100);
|
||||
|
||||
$command = EncodeCommand(0, 1, $amount, 44); //헌납
|
||||
$db->update('general', [
|
||||
@@ -761,12 +573,12 @@ function processAI($no) {
|
||||
|
||||
// R
|
||||
// ┃ ┃ 공격/내정
|
||||
// 700┃쌀┣━━━━┓
|
||||
// 500┃쌀┣━━━━┓
|
||||
// ┃팜┃ ┃
|
||||
// 100┣━┫ 내정 ┣━━━
|
||||
// 100┣━┫ 내정 ┣━━━
|
||||
// ┃조┃ ┃쌀삼
|
||||
// 0┗━┻━━━━┻━━━> G
|
||||
// 100 700
|
||||
// 100 500
|
||||
|
||||
$target = array();
|
||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||
@@ -779,7 +591,7 @@ function processAI($no) {
|
||||
elseif($general['gold'] < 100) { //금없으면 쌀팜
|
||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 1, $amount, 49); //팜
|
||||
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||
} elseif($general['gold'] < 500 && $general['rice'] < 500) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
|
||||
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 2, $amount, 49); //삼
|
||||
@@ -852,7 +664,7 @@ function processAI($no) {
|
||||
// 700t
|
||||
|
||||
} else { // 공격인 경우
|
||||
if($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
|
||||
if($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
|
||||
if($city['pop'] > 40000) { $command = EncodeCommand(0, 0, 0, 11); }
|
||||
else { $command = EncodeCommand(0, 0, 0, 1); }
|
||||
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
|
||||
@@ -866,9 +678,9 @@ function processAI($no) {
|
||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
|
||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||
//자원, 병사 모두 충족
|
||||
} elseif($general['crew'] >= 700 && $general['train'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
|
||||
$command = EncodeCommand(0, 0, 0, 13); //훈련
|
||||
} elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
|
||||
$command = EncodeCommand(0, 0, 0, 14); //사기진작
|
||||
} else {
|
||||
//공격
|
||||
@@ -881,25 +693,25 @@ function processAI($no) {
|
||||
// ┃ ┃
|
||||
// ┃쌀┃
|
||||
// ┃팜┃ 공격
|
||||
// 700t┣━╋━━━━━
|
||||
//1000t┣━╋━━━━━
|
||||
// ┃조┃ 쌀삼
|
||||
// 0┗━┻━━━━━> G
|
||||
// 700t
|
||||
// 1000t
|
||||
|
||||
//전시일때
|
||||
if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
|
||||
elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
|
||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||
} elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
|
||||
} elseif($general['rice'] < $resrc || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) { // 쌀없으면 쌀삼
|
||||
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
|
||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||
elseif($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
|
||||
elseif($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
@@ -938,13 +750,13 @@ function processAI($no) {
|
||||
$command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장
|
||||
}
|
||||
}
|
||||
} elseif($general['crew'] >= 700 && $general['train'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
|
||||
if($general['atmos'] >= 90 && $general['train'] >= 60 && $general['mode'] == 0) {
|
||||
$query = "update general set mode=1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
|
||||
}
|
||||
$command = EncodeCommand(0, 0, 0, 13); //훈련
|
||||
} elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
|
||||
if($general['atmos'] >= 60 && $general['train'] >= 90 && $general['mode'] == 0) {
|
||||
$query = "update general set mode=1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
|
||||
@@ -1039,6 +851,444 @@ function processAI($no) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function NPCStaffWork($general, $nation, $dipState){
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate', 'develcost']);
|
||||
|
||||
$nationCities = [];
|
||||
$frontCitiesID = [];
|
||||
$frontImportantCitiesID = [];
|
||||
$supplyCitiesID = [];
|
||||
$backupCitiesID = [];
|
||||
|
||||
$tech = getTechCost($nation['tech']);
|
||||
|
||||
foreach ($db->query('SELECT * FROM city WHERE nation = %i', $general['nation']) as $nationCity) {
|
||||
$nationCity['generals'] = [];
|
||||
$cityID = $nationCity['city'];
|
||||
$dev =
|
||||
($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall'])/
|
||||
($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall']);
|
||||
$dev += $nationCity['pop'] / $nationCity['pop2'];
|
||||
$dev /= 50;
|
||||
|
||||
$nationCity['dev'] = $dev;
|
||||
|
||||
$nationCities[$cityID] = $nationCity;
|
||||
|
||||
if($nationCity['supply']){
|
||||
$supplyCitiesID[] = $cityID;
|
||||
if($nationCity['front']){
|
||||
$frontCitiesID[] = $cityID;
|
||||
if($nationCity['gen1']){
|
||||
$frontImportantCitiesID[] = $cityID;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$backupCitiesID[] = $cityID;
|
||||
}
|
||||
}
|
||||
}
|
||||
Util::shuffle_assoc($nationCities);
|
||||
shuffle($frontCitiesID);
|
||||
shuffle($supplyCitiesID);
|
||||
|
||||
$nationGenerals = [];
|
||||
$lostGeneralsID = [];
|
||||
|
||||
$userGeneralsID = [];
|
||||
$npcWarGeneralsID = [];
|
||||
$npcCivilGeneralsID = [];
|
||||
|
||||
|
||||
$commandList = [];
|
||||
|
||||
foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level` FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) {
|
||||
$cityID = $nationGeneral['city'];
|
||||
$generalID = $nationGeneral['no'];
|
||||
|
||||
if($generalID == $general['no']){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key_exists($cityID, $nationCities)){
|
||||
$nationCities[$cityID]['generals'][] = $generalID;
|
||||
if(!$nationCities[$cityID]['supply']){
|
||||
$lostGeneralsID[] = $generalID;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$lostGeneralsID[] = $generalID;
|
||||
}
|
||||
|
||||
if($nationGeneral['npc']<2 && $nationGeneral['killturn'] >= 5){
|
||||
$userGeneralsID[] = $generalID;
|
||||
}
|
||||
else if($nationGeneral['leader']>=40 && $nationGeneral['killturn'] >= 5){
|
||||
$npcWarGeneralsID[] = $generalID;
|
||||
}
|
||||
else{
|
||||
//삭턴이 몇 안남은 장수는 '내정장 npc'로 처리
|
||||
$npcCivilGeneralsID[] = $generalID;
|
||||
}
|
||||
|
||||
$nationGenerals[$generalID] = $nationGeneral;
|
||||
}
|
||||
Util::shuffle_assoc($nationGenerals);
|
||||
shuffle($lostGeneralsID);
|
||||
|
||||
uasort($nationCities, function($lhs, $rhs){
|
||||
//키 순서를 지키지 않지만, 원래부터 random order를 목표로 하므로 크게 신경쓰지 않는다.
|
||||
return count($lhs['generals']) - count($rhs['generals']);
|
||||
});
|
||||
|
||||
|
||||
//타 도시에 있는 '유저장' 발령
|
||||
foreach($lostGeneralsID as $lostGeneralID){
|
||||
$lostGeneral = $nationGenerals[$lostGeneralID];
|
||||
if($lostGeneral['npc'] < 2){
|
||||
if($dipState >= 3 && $frontCitiesID){
|
||||
$selCityID = Util::choiceRandom($frontCitiesID);
|
||||
}
|
||||
else{
|
||||
$selCityID = Util::choiceRandom($supplyCitiesID);
|
||||
}
|
||||
$commandList[EncodeCommand(0, $lostGeneralID, $selCityID, 27)] = 200;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$resBaseType = [['gold', 1], ['rice', 2]];
|
||||
[$resName, $resType] = Util::choiceRandom($resBaseType);
|
||||
|
||||
usort($userGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
|
||||
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
|
||||
});
|
||||
|
||||
usort($npcWarGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
|
||||
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
|
||||
});
|
||||
|
||||
usort($npcCivilGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
|
||||
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
|
||||
});
|
||||
|
||||
$avgUserRes = 0;
|
||||
foreach ($userGeneralsID as $id){
|
||||
$avgUserRes += $nationGenerals[$id][$resName];
|
||||
}
|
||||
$avgUserRes /= max(1, count($userGeneralsID));
|
||||
|
||||
$avgNpcWarRes = 0;
|
||||
foreach ($npcWarGeneralsID as $id){
|
||||
$avgNpcWarRes += $nationGenerals[$id][$resName];
|
||||
}
|
||||
$avgNpcWarRes /= max(1, count($npcWarGeneralsID));
|
||||
|
||||
$avgNpcCivilRes = 0;
|
||||
foreach ($npcCivilGeneralsID as $id){
|
||||
$avgNpcCivilRes += $nationGenerals[$id][$resName];
|
||||
}
|
||||
$avgNpcCivilRes /= max(1, count($npcCivilGeneralsID));
|
||||
|
||||
|
||||
|
||||
//금쌀이 부족한 '유저장' 먼저 포상
|
||||
while ($nation[$resName] > ($resName=='gold'?1:2)*3000 && $userGeneralsID) {
|
||||
$isWarUser = null;
|
||||
|
||||
foreach($userGeneralsID as $userGeneralID){
|
||||
$compUser = $nationGenerals[$userGeneralID];
|
||||
if($compUser['leader'] >= 50){
|
||||
$isWarUser = true;
|
||||
break;
|
||||
}
|
||||
if(Util::randF(0.2)){
|
||||
$isWarUser = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($isWarUser === null){
|
||||
break;
|
||||
}
|
||||
|
||||
$compRes = $compUser[$resName];
|
||||
|
||||
$work = false;
|
||||
if(!$isWarUser){
|
||||
$work = false;
|
||||
} else if ($compRes < $avgNpcWarRes*3) {
|
||||
$work = true;
|
||||
} elseif ($compRes < $avgNpcCivilRes * 4) {
|
||||
$work = true;
|
||||
}
|
||||
|
||||
if((($isWarUser || $resName == 'gold') && $compUser[$resName] < 21000) || ($compUser[$resName] < 5000)){
|
||||
if($work){
|
||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 3000)*10 + 10);
|
||||
$commandList[EncodeCommand($resType, $userGeneralsID[0], $amount, 23)] = 10; // 금,쌀 1000단위 포상
|
||||
}
|
||||
else{
|
||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||
$commandList[EncodeCommand($resType, $userGeneralsID[0], $amount, 23)] = 1; // 금,쌀 1000단위 포상
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$minRes = $admin['develcost'] * 24 * $tech;
|
||||
|
||||
if($nation[$resName] < ($resName=='gold'?1:2)*3000) { // 몰수
|
||||
// 몰수 대상
|
||||
$compUser = $userGeneralsID?$nationGenerals[end($userGeneralsID)]:null;
|
||||
$compNpcWar = $npcWarGeneralsID?$nationGenerals[end($npcWarGeneralsID)]:null;
|
||||
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[end($npcCivilGeneralsID)]:null;
|
||||
|
||||
$compUserRes = $compUser[$resName]??0;
|
||||
$compNpcWarRes = $compNpcWar[$resName]*5??0;
|
||||
$compNpcCivilRes = $compNpcCivil[$resName]*10??0;
|
||||
|
||||
[$compRes, $compGenID] = max(
|
||||
[$compNpcCivilRes, $compNpcCivil['no']??null],
|
||||
[$compNpcWarRes, $compNpcWar['no']??null],
|
||||
[$compUserRes, $compUser['no']??null]
|
||||
);
|
||||
|
||||
if($compGenID){
|
||||
$targetGeneral = $nationGenerals[$compGenID];
|
||||
if($compGenID === ($compNpcCivil['no']??null)){
|
||||
$amount = intdiv($targetGeneral[$resName] - $minRes * 3, 100);
|
||||
}
|
||||
else{
|
||||
$amount = min(100, intdiv($targetGeneral[$resName], 5000)*10 + 10);
|
||||
}
|
||||
|
||||
if($amount > 0){
|
||||
$commandList[EncodeCommand($resType, $compGenID, $amount, 24)] = 3;
|
||||
}
|
||||
|
||||
}
|
||||
} else{ // 포상
|
||||
$compNpcWar = $npcWarGeneralsID?$nationGenerals[$npcWarGeneralsID[0]]:null;
|
||||
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[$npcCivilGeneralsID[0]]:null;
|
||||
|
||||
if($compNpcWar && $compNpcWar[$resName] < 21000){
|
||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||
$commandList[EncodeCommand($resType, $compNpcWar['no'], $amount, 23)] = 3;
|
||||
}
|
||||
if($compNpcCivil && $compNpcCivil[$resName] < $minRes){
|
||||
$amount = intdiv($minRes+99, 100);
|
||||
$commandList[EncodeCommand($resType, $compNpcCivil['no'], $amount, 23)] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
//고립 도시 장수 발령
|
||||
foreach($lostGeneralsID as $lostGeneralID){
|
||||
$lostGeneral = $nationGenerals[$lostGeneralID];
|
||||
if($lostGeneral['npc']<2){
|
||||
//고립 유저 장수는 이미 세팅했음
|
||||
continue;
|
||||
}
|
||||
if($dipState >= 3 && $frontCitiesID){
|
||||
$selCityID = Util::choiceRandom($frontCitiesID);
|
||||
}
|
||||
else{
|
||||
$selCityID = Util::choiceRandom($supplyCitiesID);
|
||||
}
|
||||
//고립된 장수가 많을 수록 발령 확률 증가
|
||||
$commandList[EncodeCommand(0, $lostGeneralID, $selCityID, 27)] = sqrt(count($lostGeneralsID)) * 10;
|
||||
}
|
||||
|
||||
// 평시엔 균등 발령만
|
||||
if($dipState <= 1 && count($supplyCitiesID) > 1) {
|
||||
$targetCity = null;
|
||||
$minCity = null;
|
||||
$maxCity = null;
|
||||
$maxDevCity = null;
|
||||
foreach($nationCities as $nationCity){
|
||||
if($nationCity['dev']>=95){
|
||||
continue;
|
||||
}
|
||||
if($nationCity['supply']){
|
||||
$minCity = $nationCity;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//reverse_order T_T
|
||||
$maxCity = end($nationCities);
|
||||
if(!$minCity){
|
||||
$minCity = $maxCity;
|
||||
}
|
||||
while($maxCity['city'] !== $minCity['city']){
|
||||
if($nationCity['supply']){
|
||||
break;
|
||||
}
|
||||
$maxCity = prev($nationCities);
|
||||
}
|
||||
|
||||
foreach($nationCities as $nationCity){
|
||||
if($nationCity['city'] == $maxCity['city']){
|
||||
break;
|
||||
}
|
||||
if(!$nationCity['supply']){
|
||||
continue;
|
||||
}
|
||||
if($nationCity['dev'] < 70){
|
||||
$targetCity = $nationCity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($nationCities as $nationCity) {
|
||||
if(!$nationCity['supply']){
|
||||
continue;
|
||||
}
|
||||
if(count($nationCity['generals']) == 0){
|
||||
continue;
|
||||
}
|
||||
if($maxDevCity === null || $maxDevCity['dev'] < $nationCity['dev']){
|
||||
$maxDevCity = $nationCity;
|
||||
}
|
||||
}
|
||||
|
||||
if($targetCity === null || (count($targetCity['generals']) >= count($maxCity['generals']) - 1)){
|
||||
$targetCity = $minCity;
|
||||
}
|
||||
|
||||
if($maxDevCity['dev'] >= 95 && $targetCity['city'] != $maxDevCity['city'] && $targetCity['dev'] <= 70){
|
||||
$targetGeneral = $nationGenerals[Util::choiceRandom($maxDevCity['generals'])];
|
||||
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2;
|
||||
}
|
||||
|
||||
if(count($targetCity['generals']) < count($maxCity['generals']) - 2){
|
||||
//세명 이상 차이나야 함
|
||||
$targetGeneral = $nationGenerals[Util::choiceRandom($maxCity['generals'])];
|
||||
if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95){
|
||||
//유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함!
|
||||
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 병사있고 쌀있고 후방에 있는 장수
|
||||
if($frontCitiesID){
|
||||
$workRemain = 3;
|
||||
foreach($nationGenerals as $nationGeneral){
|
||||
$generalCity = $nationCities[$nationGeneral['city']]??null;
|
||||
if(!$generalCity){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['crew'] < 2000){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['rice'] < 700 * $tech){
|
||||
continue;
|
||||
}
|
||||
if($generalCity['front']){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['train'] * $nationGeneral['atmos'] < 75 * 75){
|
||||
continue;
|
||||
}
|
||||
|
||||
$score = 5;
|
||||
if($nationGeneral['npc']<2){
|
||||
$score *= 4;
|
||||
}
|
||||
|
||||
if(Util::randF(0.3) && $frontImportantCitiesID){
|
||||
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
|
||||
}
|
||||
else{
|
||||
$targetCityID = Util::choiceRandom($frontCitiesID);
|
||||
}
|
||||
|
||||
$command = EncodeCommand(0, $nationGeneral['no'], $targetCityID, 27);
|
||||
|
||||
if($nationGeneral['npc']<2 && ($workRemain&2)){
|
||||
$workRemain ^= 2;
|
||||
$commandList[$command] = $score;
|
||||
}
|
||||
else if($nationGeneral['npc']>=2 && ($workRemain&1)){
|
||||
$workRemain ^= 1;
|
||||
$commandList[$command] = $score;
|
||||
}
|
||||
|
||||
if($workRemain <= 0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//병사 없고 인구없는 전방에 있는 장수
|
||||
if($frontCitiesID && $backupCitiesID){
|
||||
$workRemain = 3;
|
||||
foreach($nationGenerals as $nationGeneral){
|
||||
$generalCity = $nationCities[$nationGeneral['city']]??null;
|
||||
if(!$generalCity){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['crew'] >= 1000){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['rice'] < 700 * $tech){
|
||||
continue;
|
||||
}
|
||||
if(!$generalCity['front']){
|
||||
continue;
|
||||
}
|
||||
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
||||
continue;
|
||||
}
|
||||
|
||||
$score = 5;
|
||||
if($nationGeneral['npc']<2){
|
||||
$score *= 4;
|
||||
}
|
||||
|
||||
$popTrial = 5;
|
||||
for($popTrial = 0; $popTrial < 5; $popTrial++){
|
||||
$targetCity = $nationCities[Util::choiceRandom($backupCitiesID)];
|
||||
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
|
||||
continue;
|
||||
}
|
||||
if (Util::randF($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$command = EncodeCommand(0, $nationGeneral['no'], $targetCity['city'], 27);
|
||||
|
||||
if($nationGeneral['npc']<2 && ($workRemain&2)){
|
||||
$workRemain ^= 2;
|
||||
$commandList[$command] = $score;
|
||||
}
|
||||
else if($nationGeneral['npc']>=2 && ($workRemain&1)){
|
||||
$workRemain ^= 1;
|
||||
$commandList[$command] = $score;
|
||||
}
|
||||
|
||||
if($workRemain <= 0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$commandList)return 0;
|
||||
return Util::choiceRandomUsingWeight($commandList);
|
||||
}
|
||||
|
||||
//종전하기, 지급율
|
||||
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
|
||||
|
||||
@@ -1055,8 +1305,11 @@ function Promotion($nation, $level) {
|
||||
$query = "update general set level=1 where level<11 and level>4 and nation='$nation'";
|
||||
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
|
||||
|
||||
$maxBelong = $db->queryFirstField('SELECT max(belong) FROM `general` WHERE nation=%i', $nation);
|
||||
$maxBelong = min($maxBelong - 1, 3);
|
||||
|
||||
//유저 후보 선택
|
||||
$query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=3 and killturn>='{$admin['killturn']}' order by rand() limit 0,1";
|
||||
$query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=$maxBelong and killturn>='{$admin['killturn']}' order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),"");
|
||||
$userCandidate = MYDB_fetch_array($result);
|
||||
// 유저수뇌 안함
|
||||
|
||||
+49
-33
@@ -366,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),"");
|
||||
@@ -1279,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;
|
||||
@@ -1388,12 +1389,13 @@ function process_21(&$general) {
|
||||
$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;
|
||||
|
||||
// 성격 보정
|
||||
@@ -1419,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);
|
||||
}
|
||||
@@ -1471,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);
|
||||
@@ -1537,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;
|
||||
|
||||
@@ -1587,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;
|
||||
|
||||
// 성격 보정
|
||||
@@ -1615,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);
|
||||
@@ -1679,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>병종</>】";
|
||||
|
||||
@@ -2284,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),"");
|
||||
}
|
||||
|
||||
+174
-123
@@ -279,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;
|
||||
|
||||
@@ -460,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'";
|
||||
@@ -480,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;
|
||||
@@ -581,7 +584,8 @@ 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</>"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -755,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']}'";
|
||||
@@ -970,7 +977,8 @@ 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) {
|
||||
@@ -1026,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;
|
||||
|
||||
@@ -1034,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);
|
||||
@@ -1126,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;
|
||||
|
||||
@@ -1134,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']}'";
|
||||
@@ -1214,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;
|
||||
|
||||
@@ -1222,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']}'";
|
||||
@@ -1304,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;
|
||||
|
||||
@@ -1312,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']}'";
|
||||
@@ -1376,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; }
|
||||
@@ -1414,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']}'";
|
||||
@@ -1488,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; }
|
||||
@@ -1528,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']}'";
|
||||
@@ -1606,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; }
|
||||
@@ -1648,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);
|
||||
@@ -1666,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']}'";
|
||||
@@ -1736,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; }
|
||||
@@ -1778,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";
|
||||
@@ -1875,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; }
|
||||
@@ -1915,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);
|
||||
@@ -1933,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']}'";
|
||||
@@ -1989,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; }
|
||||
@@ -2027,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),"");
|
||||
@@ -2059,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;
|
||||
@@ -2111,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;
|
||||
@@ -2160,7 +2202,7 @@ function process_76(&$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;
|
||||
|
||||
// 국가보정
|
||||
if($nation['type'] == 11) { $term3 = Util::round($term3 / 2); }
|
||||
@@ -2217,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);
|
||||
@@ -2255,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);
|
||||
@@ -2273,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) {
|
||||
@@ -2344,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);
|
||||
@@ -2384,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);
|
||||
@@ -2402,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']}')";
|
||||
@@ -2474,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']}'";
|
||||
|
||||
+194
-106
@@ -46,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']}'";
|
||||
@@ -67,7 +70,7 @@ function process_25(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
$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),"");
|
||||
@@ -76,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;
|
||||
|
||||
@@ -148,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),"");
|
||||
@@ -195,12 +258,13 @@ function process_29(&$general) {
|
||||
$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 {
|
||||
@@ -262,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),"");
|
||||
@@ -276,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;
|
||||
@@ -404,7 +470,7 @@ function process_29(&$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;
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
|
||||
@@ -476,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></>에서 하야");
|
||||
|
||||
@@ -530,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; }
|
||||
@@ -592,8 +663,13 @@ function process_46(&$general) {
|
||||
} elseif($city['level'] != 5 && $city['level'] != 6) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:중, 소 도시에서만 가능합니다. 건국 실패. <1>$date</>";
|
||||
} else {
|
||||
$query = "update nation set name='{$general['makenation']}',color='$color',level=1,type='$type',capital='{$general['city']}' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'name'=>$general['makenation'],
|
||||
'color'=>$color,
|
||||
'level'=>1,
|
||||
'type'=>$type,
|
||||
'capital'=>$general['city'],
|
||||
], 'nation=%i', $general['nation']);
|
||||
|
||||
refreshNationStaticInfo();
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
@@ -602,11 +678,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;
|
||||
@@ -658,11 +738,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']);
|
||||
@@ -745,13 +828,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);
|
||||
@@ -820,11 +904,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></>에서 거병");
|
||||
|
||||
// 외교테이블 추가
|
||||
|
||||
@@ -869,9 +954,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),"");
|
||||
@@ -952,14 +1039,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);
|
||||
|
||||
@@ -64,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) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -89,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;
|
||||
@@ -193,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) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -339,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) {
|
||||
// 육도, 삼략 사용
|
||||
@@ -466,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) {
|
||||
// 육도, 삼략 사용
|
||||
|
||||
@@ -24,13 +24,6 @@ function Tag2Code(string $str) {
|
||||
return nl2br($str);
|
||||
}
|
||||
|
||||
function BadTag2Code(string $str) {
|
||||
/* FIXME: 제대로된 tag 변환 코드 사용 */
|
||||
$str = str_replace("<script", "<sorry", $str);
|
||||
$str = str_replace("</script", "</sorry", $str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
function tab(string $str, $maxsize, $ch) {
|
||||
$size = strlen($str);
|
||||
|
||||
|
||||
+18
-8
@@ -77,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');
|
||||
}
|
||||
|
||||
|
||||
@@ -95,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);
|
||||
|
||||
@@ -113,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;
|
||||
@@ -170,7 +169,18 @@ 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');
|
||||
}
|
||||
|
||||
function getInvitationList(array $nationList){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
foreach($nationList as &$nation){
|
||||
$nation['textColor'] = newColor($nation['color']);
|
||||
}
|
||||
return $templates->render('invitationList', [
|
||||
'nationList'=>$nationList
|
||||
]);
|
||||
}
|
||||
+86
-29
@@ -109,7 +109,7 @@ function processTournament() {
|
||||
$second = $unit * $iter;
|
||||
$gameStor->tournament = $tnmt;
|
||||
$gameStor->phase = $phase;
|
||||
$gameStor->tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ function printRow($k, $npc, $name, $abil, $tgame, $win, $draw, $lose, $gd, $gl,
|
||||
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>$tgame</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) {
|
||||
@@ -255,7 +255,6 @@ function startTournament($auto, $type) {
|
||||
$gameStor->tournament = 1;
|
||||
$gameStor->tnmt_type = $type;
|
||||
$gameStor->phase = 0;
|
||||
$gameStor->bet = 0;
|
||||
for($i=0;$i<16;$i+=1){
|
||||
$gameStor->setValue("bet{$i}", 0);
|
||||
}
|
||||
@@ -670,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,7 +695,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
|
||||
$no = ($general['grp'] - 20) * 2 + $general['grp_no'];
|
||||
|
||||
|
||||
$admin = $gameStor->getDBValues(['bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$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);
|
||||
|
||||
@@ -776,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -11,7 +11,6 @@ increaseRefresh("메인", 1);
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
if (!$userID) {
|
||||
header('Location:..');
|
||||
@@ -26,6 +25,11 @@ $me = $db->queryFirstRow(
|
||||
//턴 실행.
|
||||
checkTurn();
|
||||
|
||||
if(!$session->isGameLoggedIn()){
|
||||
header('Location:..');
|
||||
die();
|
||||
}
|
||||
|
||||
//그새 사망이면
|
||||
if ($me === null) {
|
||||
$session->logoutGame();
|
||||
@@ -40,11 +44,9 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote']);
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
|
||||
|
||||
$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']);
|
||||
if ($con >= 2) {
|
||||
@@ -136,7 +138,7 @@ $(function(){
|
||||
<tr height=30>
|
||||
<td>
|
||||
<?php
|
||||
if ($plock['plock'] == 0) {
|
||||
if (!$plock) {
|
||||
echo "<marquee scrollamount=2><font color=cyan>서버 가동중</font></marquee>";
|
||||
} else {
|
||||
echo "<font color=magenta>서버 동결중</font>";
|
||||
@@ -166,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 {
|
||||
@@ -180,12 +180,12 @@ echo "
|
||||
<td colspan=2 align=center>
|
||||
";
|
||||
|
||||
$vote = explode("|", $admin['vote']);
|
||||
$vote[0] = Tag2Code($vote[0]);
|
||||
$vote = $admin['vote']?:[''];
|
||||
$vote_title = Tag2Code($admin['vote_title']??'-');
|
||||
if ($vote[0] == "") {
|
||||
echo "<font color=magenta>진행중 설문 없음</font>";
|
||||
} else {
|
||||
echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote[0]</marquee>";
|
||||
echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote_title</marquee>";
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ echo "
|
||||
?>
|
||||
<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;"><div>【 국가방침 】</div><div style="color:orange;"><?=nationMsg()?></div></td></tr>
|
||||
<tr><td colspan=5 style="text-align:left;">【 접속자 】<?=onlinegen()?></td></tr>
|
||||
<?php
|
||||
if ($session->userGrade >= 5) {
|
||||
|
||||
+10
-3
@@ -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('관리자 아님');
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ if($session->userGrade == 5){
|
||||
<?=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::printJS('js/install_db.js')?>
|
||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('css/install.css')?>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ $now = new \DateTime();
|
||||
|
||||
$status = 'not_yet';
|
||||
|
||||
list($isUnited, $lastTurn) = $gameStor->getValues(['isUnited', 'turntime']);
|
||||
list($isUnited, $lastTurn) = $gameStor->getValuesAsArray(['isunited', 'turntime']);
|
||||
if($isUnited === null || $lastTurn === null){
|
||||
$isUnited = 2;
|
||||
$lastTurn = '2000-01-01';
|
||||
|
||||
+42
-2
@@ -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'];
|
||||
@@ -78,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;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ include "func.php";
|
||||
|
||||
$year = Util::getReq('year', 'int');
|
||||
$month = Util::getReq('month', 'int');
|
||||
$serverID = Util::getReq('server_id', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
@@ -26,13 +27,17 @@ if(!$year || !$month) {
|
||||
}
|
||||
|
||||
|
||||
if(!$serverID){
|
||||
$serverID = UniqueConst::$serverID;
|
||||
}
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin([])->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$map = $db->queryFirstField('SELECT map FROM history WHERE year=%i AND month=%i', $year, $month);
|
||||
$map = $db->queryFirstField('SELECT map FROM history WHERE server_id=%s AND year=%i AND month=%i', $serverID, $year, $month);
|
||||
|
||||
if(!$map){
|
||||
Json::die([
|
||||
|
||||
@@ -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);
|
||||
@@ -89,9 +89,10 @@ if(!$db->affectedRows()){
|
||||
|
||||
$db->delete('select_npc_token', 'owner=%i or valid_until < %s', $userID, $now);
|
||||
|
||||
pushGeneralHistory($pickedNPC, "<C>●</>{$year}년 {$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>(이)가 빙의되다.");
|
||||
$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}</>(이)가 <S>빙의</>됩니다!"], $year, $month);
|
||||
pushGeneralPublicRecord(["<C>●</>{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>{$josaYi} <S>빙의</>됩니다!"], $year, $month);
|
||||
|
||||
pushAdminLog(["가입 : {$userID} // {$session->userName} // {$pick} // ".getenv("REMOTE_ADDR")]);
|
||||
|
||||
|
||||
@@ -38,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
|
||||
@@ -47,18 +48,24 @@ if(file_exists(__dir__.'/.htaccess')){
|
||||
|
||||
//TODO: 천통시에도 예약 오픈 알림이 필요..?
|
||||
|
||||
$game_env = $gameStor->getValues(['isUnited', 'npcMode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnTerm']);
|
||||
$game_env['maxUserCnt'] = $game_env['maxgeneral'];
|
||||
unset($game_env['maxgeneral']);
|
||||
$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_env['scenario'] = $game_env['scenario_text'];
|
||||
$game_env['userCnt'] = $genCnt;
|
||||
$game_env['npcCnt'] = $npcCnt;
|
||||
$game_env['nationCnt'] = $nationCnt;
|
||||
$admin['scenario'] = $admin['scenario_text'];
|
||||
$admin['userCnt'] = $genCnt;
|
||||
$admin['npcCnt'] = $npcCnt;
|
||||
$admin['nationCnt'] = $nationCnt;
|
||||
|
||||
$me = [];
|
||||
|
||||
@@ -75,6 +82,6 @@ if($general){
|
||||
|
||||
//TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것.
|
||||
Json::die([
|
||||
'game'=>$game_env,
|
||||
'game'=>$admin,
|
||||
'me'=>$me?:null
|
||||
]);
|
||||
+10
-21
@@ -32,6 +32,11 @@ $connect=$db->get();
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<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')?>
|
||||
@@ -58,27 +63,11 @@ if ($gencount >= $admin['maxgeneral']) {
|
||||
echo "<script>history.go(-1);</script>";
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<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";
|
||||
$nationresult = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect), "");
|
||||
$nationcount = MYDB_num_rows($nationresult);
|
||||
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation ORDER BY rand()');
|
||||
|
||||
for ($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($nationresult);
|
||||
if ($nation['scoutmsg'] == "") {
|
||||
echo "
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
|
||||
} else {
|
||||
echo "
|
||||
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
|
||||
}
|
||||
}
|
||||
echo getInvitationList($nationList);
|
||||
?>
|
||||
</table>
|
||||
|
||||
<form name=form1 method=post action=join_post.php>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
@@ -88,7 +77,7 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
<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
|
||||
@@ -156,13 +145,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>모든 능력치는 ( <?=GameConst::$defaultStatMin?> <= 능력치 <= <?=GameConst::$defaultStatMax?> ) 사이로 잡으셔야 합니다.<br>
|
||||
그 외의 능력치는 가입되지 않습니다.</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center colspan=3>
|
||||
능력치의 총합은 150입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
|
||||
능력치의 총합은 <?=GameConst::$defaultStatTotal?>입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
|
||||
임의의 도시에서 재야로 시작하며 건국과 임관은 게임 내에서 실행합니다.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+14
-8
@@ -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);
|
||||
|
||||
@@ -43,7 +43,10 @@ $userID = Session::getUserID();
|
||||
//NOTE: 이 페이지에서는 세션에 데이터를 등록하지 않음. 로그인은 이후에.
|
||||
|
||||
$name = Util::getReq('name');
|
||||
$name = htmlspecialchars($name);
|
||||
$name = StringUtil::removeSpecialCharacter($name);
|
||||
$name = WebUtil::htmlPurify($name);
|
||||
$name = StringUtil::textStrip($name);
|
||||
$pic = (int)Util::getReq('pic', 'bool', 0);
|
||||
$character = Util::getReq('character', 'int', 0);
|
||||
|
||||
@@ -102,16 +105,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;
|
||||
@@ -165,6 +168,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;
|
||||
@@ -237,13 +242,14 @@ $me = [
|
||||
$log = [];
|
||||
$mylog = [];
|
||||
|
||||
$josaRa = JosaUtil::pick($name, '라');
|
||||
if ($genius) {
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.";
|
||||
$log[1] = "<C>●</>{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
|
||||
|
||||
pushWorldHistory(["<C>●</>{$gameStor->year}년 {$gameStor->month}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $gameStor->year, $gameStor->month);
|
||||
} else {
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 호걸이 천하에 이름을 알립니다.";
|
||||
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.";
|
||||
}
|
||||
pushGeneralHistory($me, "<C>●</>{$gameStor->year}년 {$gameStor->month}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
|
||||
$mylog[] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
jQuery(function($){
|
||||
$('#by_scenario').change(function(){
|
||||
var scenarioIdx = $(this).val();
|
||||
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get');
|
||||
})
|
||||
//$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
|
||||
});
|
||||
+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);
|
||||
|
||||
@@ -134,7 +134,21 @@ function redrawMsg(deferred){
|
||||
$('#last_contact').val(contactTarget).html(generalList[contactTarget].textName).show();
|
||||
}
|
||||
|
||||
msg.nationID = obj.nationID;
|
||||
msg.generalName = obj.generalName;
|
||||
msg.msgType = msgType;
|
||||
|
||||
if(msg.src.nation_id == msg.dest.nation_id){
|
||||
msg.nationType = 'local';
|
||||
}
|
||||
else if(msg.nationID == msg.src.nation_id){
|
||||
msg.nationType = 'src';
|
||||
}
|
||||
else{
|
||||
msg.nationType = 'dest';
|
||||
}
|
||||
|
||||
|
||||
msg.defaultIcon = pathConfig.sharedIcon+'/default.jpg';
|
||||
var msgHtml = TemplateEngine(messageTemplate, msg);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div
|
||||
class="msg_plate msg_plate_<%msgType%>"
|
||||
class="msg_plate msg_plate_<%msgType%> msg_plate_<%nationType%>""
|
||||
id="msg_<%id%>"
|
||||
data-id="<%id%>"
|
||||
>
|
||||
<div class="msg_icon">
|
||||
<%if(src.icon) { %>
|
||||
<%if(src.icon){ %>
|
||||
<img width='64' height='64' src="<%encodeURI(src.icon)%>">
|
||||
<%} else {%>
|
||||
<img width='64' height='64' src="<%encodeURI(defaultIcon)%>">
|
||||
@@ -13,15 +13,26 @@
|
||||
<div class="msg_body">
|
||||
<div class="msg_header">
|
||||
<%if(msgType == 'private') {%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
<%if(src.name == generalName){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;">나</span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;"><%e(dest.name)%>:<%e(dest.nation)%></span>
|
||||
<%} else if(msgType == 'national' && src.nation_id == dest.nation_id){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span>
|
||||
<%} else if(msgType == 'national' || msgType == 'diplomacy'){%>
|
||||
<%}else{%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;">나</span>
|
||||
<%}%>
|
||||
<%} else if(msgType == 'national' && src.nation_id == dest.nation_id){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%></span>
|
||||
<%} else if(msgType == 'national' || msgType == 'diplomacy'){%>
|
||||
<%if(src.nation_id == nationID){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%></span
|
||||
><span class="msg_from_to">▶</span
|
||||
><span class="msg_target msg_<%dest.colorType%>" style="background-color:<%dest.color%>;"><%e(dest.nation)%></span>
|
||||
<%}else{%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span
|
||||
><span class="msg_from_to"></span>
|
||||
<%}%>
|
||||
<%} else {%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%e(src.nation)%></span>
|
||||
<%} %>
|
||||
|
||||
+4
-6
@@ -7,11 +7,9 @@ $loader->addPsr4('sammo\\', __DIR__.'/sammo', true);
|
||||
|
||||
$loader->addClassMap((function () {
|
||||
$d_settingMap = [];
|
||||
foreach (glob(__dir__.'/d_setting/*.php') as $filepath) {
|
||||
foreach (glob(__dir__.'/d_setting/*.orig.php') as $filepath) {
|
||||
$filepath = str_replace('.orig.php', '.php', $filepath);
|
||||
$filename = basename($filepath);
|
||||
if (Util::ends_with($filename, '.orig.php')) {
|
||||
continue;
|
||||
}
|
||||
$classname = explode('.', $filename)[0];
|
||||
$d_settingMap['sammo\\'.$classname] = $filepath;
|
||||
};
|
||||
@@ -37,9 +35,9 @@ function Error($message='', $url="")
|
||||
if (!$url) {
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
file_put_contents(__dir__."/logs/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
|
||||
file_put_contents(__dir__."/logs/".UniqueConst::$serverID."/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
ob_get_flush();
|
||||
WebUtil::setHeaderNoCache();
|
||||
|
||||
+170
-99
@@ -9,14 +9,14 @@ function processWar($general, $city) {
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$game_env = $gameStor->getAll();
|
||||
$admin = $gameStor->getAll();
|
||||
|
||||
$year = $game_env['year'];
|
||||
$month = $game_env['month'];
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'];
|
||||
|
||||
$log = [];
|
||||
$batlog = [];
|
||||
@@ -45,7 +45,8 @@ function processWar($general, $city) {
|
||||
$genAtmos += 3;
|
||||
$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'] >= 14 && $general['item'] <= 16) {
|
||||
//의적주, 두강주, 보령압주 사용
|
||||
@@ -60,7 +61,8 @@ function processWar($general, $city) {
|
||||
$genTrain += 3;
|
||||
$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'] >= 12 && $general['item'] <= 13) {
|
||||
//과실주, 이강주 사용
|
||||
@@ -97,12 +99,12 @@ function processWar($general, $city) {
|
||||
$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 = "select no from general where nation='{$destnation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destgencount = MYDB_num_rows($result);
|
||||
if($destgencount < 10) $destgencount = 10;
|
||||
if($destgencount < GameConst::$initialNationGenLimit) $destgencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$genAtmosBonus = 0; $genTrainBonus = 0;
|
||||
$oppAtmosBonus = 0; $oppTrainBonus = 0;
|
||||
@@ -115,8 +117,10 @@ function processWar($general, $city) {
|
||||
if($originCity['level'] == 2) { $genAtmosBonus += 5; } // 출병도시가 진이면 공격자 공격보정
|
||||
if($city['level'] == 3) { $oppTrainBonus += 5; } // 방어도시가 관이면 방어자 방어보정
|
||||
|
||||
$alllog[] = "<C>●</>{$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <G><b>{$city['name']}</b></>(으)로 진격합니다.";
|
||||
$log[] = "<C>●</>{$month}월:<G><b>{$city['name']}</b></>(으)로 <M>진격</>합니다. <1>$date</>";
|
||||
$josaRo = JosaUtil::pick($city['name'], '로');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <G><b>{$city['name']}</b></>{$josaRo} 진격합니다.";
|
||||
$log[] = "<C>●</>{$month}월:<G><b>{$city['name']}</b></>{$josaRo} <M>진격</>합니다. <1>$date</>";
|
||||
|
||||
// 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상
|
||||
$query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='{$city['city']}' and nation='{$city['nation']}' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc";
|
||||
@@ -136,7 +140,9 @@ function processWar($general, $city) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$alllog[] = "<C>●</>{$month}월:병량 부족으로 <G><b>{$city['name']}</b></>의 수비병들이 <R>패퇴</>합니다.";
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<M><b>【패퇴】</b></><D><b>{$destnation['name']}</b></>(이)가 병량 부족으로 <G><b>{$city['name']}</b></>(을)를 뺏기고 말았습니다.";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<M><b>【패퇴】</b></><D><b>{$destnation['name']}</b></>{$josaYi} 병량 부족으로 <G><b>{$city['name']}</b></>{$josaUl} 뺏기고 말았습니다.";
|
||||
pushGenLog($general, $log);
|
||||
pushGeneralPublicRecord($alllog, $year, $month);
|
||||
pushWorldHistory($history);
|
||||
@@ -154,12 +160,14 @@ function processWar($general, $city) {
|
||||
|
||||
$city = addConflict($city, $general['nation'], 1);//NOTE: 이 경우 두 국가가 분쟁 중인 경우에는 병량패퇴의 이득이 없다.
|
||||
|
||||
ConquerCity($game_env, $general, $city, $nation, $destnation);
|
||||
ConquerCity($admin, $general, $city, $nation, $destnation);
|
||||
break;
|
||||
// 장수가 없어서 도시 공격
|
||||
} elseif($opposecount == 0) {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>(이)가 ".GameUnitConst::byId($general['crewtype'])->name."(으)로 성벽을 공격합니다.";
|
||||
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."(으)로 성벽을 <M>공격</>합니다.";
|
||||
$josaRo = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '로');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} ".GameUnitConst::byId($general['crewtype'])->name."{$josaRo} 성벽을 공격합니다.";
|
||||
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."{$josaRo} 성벽을 <M>공격</>합니다.";
|
||||
|
||||
$general['train'] += 1; //훈련 상승
|
||||
if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; }
|
||||
@@ -189,13 +197,13 @@ function processWar($general, $city) {
|
||||
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
|
||||
|
||||
//훈련 사기따라
|
||||
$myCrew = getCrew($myCrew, $game_env['city_rate']+$oppAtmosBonus, CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
|
||||
$cityCrew = getCrew($cityCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), $game_env['city_rate']+$oppTrainBonus);
|
||||
$myCrew = getCrew($myCrew, $admin['city_rate']+$oppAtmosBonus, CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
|
||||
$cityCrew = getCrew($cityCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), $admin['city_rate']+$oppTrainBonus);
|
||||
//숙련도 따라
|
||||
$genDexAtt = getGenDex($general, $general['crewtype']);
|
||||
$genDexDef = getGenDex($general, 40);
|
||||
$cityCrew *= getDexLog($genDexAtt, ($game_env['city_rate']-60)*7200);
|
||||
$myCrew *= getDexLog(($game_env['city_rate']-60)*7200, $genDexDef);
|
||||
$cityCrew *= getDexLog($genDexAtt, ($admin['city_rate']-60)*7200);
|
||||
$myCrew *= getDexLog(($admin['city_rate']-60)*7200, $genDexDef);
|
||||
|
||||
$avoid = 1;
|
||||
// 병종간 특성
|
||||
@@ -419,7 +427,7 @@ function processWar($general, $city) {
|
||||
'year'=>$year,
|
||||
'month'=>$month,
|
||||
'war_type'=>'siege',
|
||||
'war_type_str'=>'성',
|
||||
'war_type_str'=>'→',
|
||||
'me' => $render_attacker,
|
||||
'you' => $render_defender,
|
||||
]));
|
||||
@@ -432,7 +440,7 @@ function processWar($general, $city) {
|
||||
|
||||
// 도시쌀 소모 계산
|
||||
$opexp = Util::round($opexp / 50 * 0.8);
|
||||
$rice = Util::round($opexp * 5 * getCrewtypeRice(0, 0) * ($game_env['city_rate']/100 - 0.2));
|
||||
$rice = Util::round($opexp * 5 * getCrewtypeRice(0, 0) * ($admin['city_rate']/100 - 0.2));
|
||||
$destnation['rice'] -= $rice;
|
||||
if($destnation['rice'] < 0) { $destnation['rice'] = 0; }
|
||||
$query = "update nation set rice='{$destnation['rice']}' where nation='{$destnation['nation']}'";
|
||||
@@ -463,7 +471,7 @@ function processWar($general, $city) {
|
||||
if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
|
||||
if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($game_env['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
|
||||
if(TechLimit($admin['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
|
||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 죽은수 기술로 누적
|
||||
@@ -476,7 +484,7 @@ function processWar($general, $city) {
|
||||
$num *= 0.9;
|
||||
}
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($game_env['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
|
||||
if(TechLimit($admin['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
|
||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='{$destnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//양국 평균 기술가격
|
||||
@@ -516,18 +524,20 @@ function processWar($general, $city) {
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
ConquerCity($game_env, $general, $city, $nation, $destnation);
|
||||
ConquerCity($admin, $general, $city, $nation, $destnation);
|
||||
break;
|
||||
// 공격 장수 병사 소진시 실패 처리
|
||||
} elseif($general['crew'] <= 0) {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
$log[] = "<C>●</>퇴각했습니다.";
|
||||
|
||||
$query = "update general set deathnum=deathnum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
} elseif($myRice <= Util::round($general['crew']/100)) {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
$log[] = "<C>●</>군량 부족으로 퇴각합니다.";
|
||||
|
||||
$query = "update general set deathnum=deathnum+1 where no='{$general['no']}'";
|
||||
@@ -537,9 +547,14 @@ function processWar($general, $city) {
|
||||
// 장수 대결
|
||||
} else {
|
||||
$oppose = MYDB_fetch_array($result);
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(와)과 <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 대결합니다.";
|
||||
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."(으)로 <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(을)를 <M>공격</>합니다.";
|
||||
$opplog[] = "<C>●</>".GameUnitConst::byId($oppose['crewtype'])->name."(으)로 <Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(을)를 <M>수비</>합니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '이');
|
||||
$josaWa = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '와');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaWa} <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 대결합니다.";
|
||||
$josaUl = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '을');
|
||||
$josaRo = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '로');
|
||||
$log[] = "<C>●</>".GameUnitConst::byId($general['crewtype'])->name."{$josaRo} <Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaUl} <M>공격</>합니다.";
|
||||
$josaUl = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '을');
|
||||
$opplog[] = "<C>●</>".GameUnitConst::byId($oppose['crewtype'])->name."{$josaRo} <Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaUl} <M>수비</>합니다.";
|
||||
|
||||
$oppAtmos = 0;
|
||||
if($oppose['item'] == 3) {
|
||||
@@ -547,7 +562,8 @@ function processWar($general, $city) {
|
||||
$oppAtmos += 3;
|
||||
$query = "update general set item=0 where no='{$oppose['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($oppose['item'], '을');
|
||||
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
|
||||
$oppose['item'] = 0;
|
||||
} elseif($oppose['item'] >= 14 && $oppose['item'] <= 16) {
|
||||
//의적주, 두강주, 보령압주 사용
|
||||
@@ -562,7 +578,8 @@ function processWar($general, $city) {
|
||||
$oppTrain += 3;
|
||||
$query = "update general set item=0 where no='{$oppose['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
|
||||
$josaUl = JosaUtil::pick($oppose['item'], '을');
|
||||
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
|
||||
$oppose['item'] = 0;
|
||||
} elseif($oppose['item'] >= 12 && $oppose['item'] <= 13) {
|
||||
//과실주, 이강주 사용
|
||||
@@ -582,17 +599,30 @@ function processWar($general, $city) {
|
||||
$query = "update general set recwar='{$general['turntime']}',train='{$oppose['train']}',warnum=warnum+1 where no='{$oppose['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$ratio = rand() % 100;
|
||||
//특기보정 : 저격(수극), 활무기저격
|
||||
if(($general['special2'] == 70 && $ratio <= 33) || ($general['item'] == 2 && $ratio <= 20) || (($general['weap'] == 10 || $general['weap'] == 14 || $general['weap'] == 18 || $general['weap'] == 22) && $ratio <= 20)) {
|
||||
$snipe = false;
|
||||
$snipeItem = false;
|
||||
if(!$snipe && $general['special2'] == 70 && Util::randF(1/3)){
|
||||
$snipe = true;
|
||||
}
|
||||
if(!$snipe && in_array($general['weap'], [10, 14, 18, 22]) && Util::randF(1/5)){
|
||||
$snipe = true;
|
||||
}
|
||||
if(!$snipe && $general['item'] == 2){
|
||||
if(Util::randF(1/5)){
|
||||
$snipe = true;
|
||||
$snipeItem = true;
|
||||
}
|
||||
//수극을 사용했지만 저격 실패한 케이스도 '필요하면' 넣을 것.(밸런스)
|
||||
|
||||
}
|
||||
if($snipe) {
|
||||
//수극 사용
|
||||
if($general['item'] == 2) {
|
||||
$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'])."</>(을)를 사용!";
|
||||
if($snipeItem) {
|
||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
||||
$general['item'] = 0;
|
||||
} elseif($general['weap'] == 10 || $general['weap'] == 14 || $general['weap'] == 18 || $general['weap'] == 22) {
|
||||
// $log[] = "<C>●</><C>".getWeapName($general['weap'])."</>(을)를 사용!";
|
||||
$db->update('general', ['item'=>0], 'no=%i', $general['no']);
|
||||
}
|
||||
$log[] = "<C>●</>상대를 <C>저격</>했다!";
|
||||
$batlog[] = "<C>●</>상대를 <C>저격</>했다!";
|
||||
@@ -601,23 +631,37 @@ function processWar($general, $city) {
|
||||
// 부상
|
||||
$oppose['injury'] += rand() % 41 + 20; // 20 ~ 60
|
||||
if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
|
||||
} else if($general['item'] == 2 && $ratio <= 40) {
|
||||
$query = "update general set item=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$batlog[] = "<C>●</><C>".getItemName($general['item'])."</>(이)가 빗나갑니다!";
|
||||
}
|
||||
else if($snipeItem) {
|
||||
$db->update('general', ['item'=>0], 'no=%i', $general['no']);
|
||||
$josaYi = JosaUtil::pick($general['item'], '이');
|
||||
$batlog[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaYi} 빗나갑니다!";
|
||||
$general['item'] = 0;
|
||||
}
|
||||
$ratio = rand() % 100;
|
||||
|
||||
//특기보정 : 저격(수극), 활무기저격
|
||||
if(($oppose['special2'] == 70 && $ratio <= 33) || ($oppose['item'] == 2 && $ratio <= 20) || (($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) && $ratio <= 20)) {
|
||||
$snipe = false;
|
||||
$snipeItem = false;
|
||||
if(!$snipe && $oppose['special2'] == 70 && Util::randF(1/3)){
|
||||
$snipe = true;
|
||||
}
|
||||
if(!$snipe && in_array($oppose['weap'], [10, 14, 18, 22]) && Util::randF(1/5)){
|
||||
$snipe = true;
|
||||
}
|
||||
if(!$snipe && $oppose['item'] == 2){
|
||||
if(Util::randF(1/5)){
|
||||
$snipe = true;
|
||||
$snipeItem = true;
|
||||
}
|
||||
//수극을 사용했지만 저격 실패한 케이스도 '필요하면' 넣을 것.(밸런스)
|
||||
}
|
||||
if($snipe) {
|
||||
//수극 사용
|
||||
if($oppose['item'] == 2) {
|
||||
$query = "update general set item=0 where no='{$oppose['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
|
||||
if($snipeItem) {
|
||||
$josaUl = JosaUtil::pick($oppose['item'], '을');
|
||||
$log[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
|
||||
$oppose['item'] = 0;
|
||||
} elseif($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) {
|
||||
// $opplog[] = "<C>●</><C>".getWeapName($oppose['weap'])."</>(을)를 사용!";
|
||||
$db->update('general', ['item'=>0], 'no=%i', $oppose['no']);
|
||||
}
|
||||
$oppbatlog[] = "<C>●</>상대를 <C>저격</>했다!";
|
||||
$opplog[] = "<C>●</>상대를 <C>저격</>했다!";
|
||||
@@ -626,10 +670,11 @@ function processWar($general, $city) {
|
||||
// 부상
|
||||
$general['injury'] += rand() % 41 + 20; // 20 ~ 60
|
||||
if($general['injury'] > 80) { $general['injury'] = 80; }
|
||||
} else if($oppose['item'] == 2 && $ratio <= 40) {
|
||||
$query = "update general set item=0 where no='{$oppose['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$oppbatlog[] = "<C>●</><C>".getItemName($oppose['item'])."</>(이)가 빗나갑니다!";
|
||||
}
|
||||
else if($snipeItem) {
|
||||
$db->update('general', ['item'=>0], 'no=%i', $oppose['no']);
|
||||
$josaYi = JosaUtil::pick($oppose['item'], '이');
|
||||
$batlog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaYi} 빗나갑니다!";
|
||||
$oppose['item'] = 0;
|
||||
}
|
||||
|
||||
@@ -1295,7 +1340,7 @@ function processWar($general, $city) {
|
||||
'year'=>$year,
|
||||
'month'=>$month,
|
||||
'war_type'=>'attack',
|
||||
'war_type_str'=>'공',
|
||||
'war_type_str'=>'→',
|
||||
'me' => $render_attacker,
|
||||
'you' => $render_defender,
|
||||
]));
|
||||
@@ -1304,7 +1349,7 @@ function processWar($general, $city) {
|
||||
'year'=>$year,
|
||||
'month'=>$month,
|
||||
'war_type'=>'defense',
|
||||
'war_type_str'=>'수',
|
||||
'war_type_str'=>'←',
|
||||
'me' => $render_defender,
|
||||
'you' => $render_attacker,
|
||||
]));
|
||||
@@ -1338,7 +1383,7 @@ function processWar($general, $city) {
|
||||
if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
|
||||
if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($game_env['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
|
||||
if(TechLimit($admin['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
|
||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -1361,7 +1406,7 @@ function processWar($general, $city) {
|
||||
if($destnation['type'] == 3 || $destnation['type'] == 13) { $num *= 1.1; }
|
||||
if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { $num *= 0.9; }
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($game_env['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
|
||||
if(TechLimit($admin['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
|
||||
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='{$destnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//양국 평균 기술가격
|
||||
@@ -1385,12 +1430,14 @@ function processWar($general, $city) {
|
||||
// 상대 병사 소진이나 쌀 소진시 다음 장수
|
||||
if($oppose['crew'] <= 0 || ($opRice <= Util::round($oppose['crew']/100) && $general['crew'] > 0)) {
|
||||
if($opRice <= Util::round($oppose['crew']/100)) {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다.";
|
||||
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 패퇴했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 패퇴했습니다.";
|
||||
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 패퇴했습니다.";
|
||||
$opplog[] = "<C>●</>군량 부족으로 패퇴합니다.";
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다.";
|
||||
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."(이)가 전멸했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($oppose['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 전멸했습니다.";
|
||||
$log[] = "<C>●</><Y>{$oppose['name']}</>의 ".GameUnitConst::byId($oppose['crewtype'])->name."{$josaYi} 전멸했습니다.";
|
||||
$opplog[] = "<C>●</>전멸했습니다.";
|
||||
}
|
||||
$opposecount--;
|
||||
@@ -1424,13 +1471,15 @@ function processWar($general, $city) {
|
||||
// 공격 장수 병사 소진이나 쌀 소진시 실패 처리
|
||||
} elseif($general['crew'] <= 0 || $myRice <= Util::round($general['crew']/100)) {
|
||||
if($myRice <= Util::round($general['crew']/100)) {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
$log[] = "<C>●</>군량 부족으로 퇴각합니다.";
|
||||
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
} else {
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$josaYi = JosaUtil::pick(GameUnitConst::byId($general['crewtype'])->name, '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
$log[] = "<C>●</>퇴각했습니다.";
|
||||
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."(이)가 퇴각했습니다.";
|
||||
$opplog[] = "<C>●</><Y>{$general['name']}</>의 ".GameUnitConst::byId($general['crewtype'])->name."{$josaYi} 퇴각했습니다.";
|
||||
}
|
||||
|
||||
// 경험치 상승
|
||||
@@ -1466,7 +1515,8 @@ function processWar($general, $city) {
|
||||
unset($opplog);
|
||||
unset($oppbatlog);
|
||||
unset($oppbatres);
|
||||
// $alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>(이)가 }<G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
|
||||
// $josaYi = JosaUtil::pick($general['name'], '이');
|
||||
// $alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} }<G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
|
||||
// $log[] = "<C>●</> <G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
|
||||
break;
|
||||
} else {
|
||||
@@ -1626,9 +1676,9 @@ function getCityDef($city) {
|
||||
return $def;
|
||||
}
|
||||
|
||||
function getRate($game_env, $type, $dtype) {
|
||||
function getRate($admin, $type, $dtype) {
|
||||
$t = "{$dtype}{$type}";
|
||||
return $game_env[$t];
|
||||
return $admin[$t];
|
||||
}
|
||||
|
||||
function addConflict($city, $nationID, $mykillnum) {
|
||||
@@ -1658,7 +1708,8 @@ function addConflict($city, $nationID, $mykillnum) {
|
||||
arsort($conflict);
|
||||
|
||||
$nation = getNationStaticInfo($nationID);
|
||||
pushWorldHistory(["<C>●</>{$year}년 {$month}월:<M><b>【분쟁】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$city['name']}</b></> 공략에 가담하여 분쟁이 발생하고 있습니다."]);
|
||||
$josaYi = JosaUtil::pick($nation['name'], '이');
|
||||
pushWorldHistory(["<C>●</>{$year}년 {$month}월:<M><b>【분쟁】</b></><D><b>{$nation['name']}</b></>{$josaYi} <G><b>{$city['name']}</b></> 공략에 가담하여 분쟁이 발생하고 있습니다."]);
|
||||
}
|
||||
|
||||
$rawConflict = Json::encode($conflict);
|
||||
@@ -1697,7 +1748,7 @@ function getConquerNation($city) : int {
|
||||
return Util::array_first_key($conflict);
|
||||
}
|
||||
|
||||
function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
||||
'@phan-var array<string,mixed> $city';
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
@@ -1712,15 +1763,19 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
$destnationName = "공백지인";
|
||||
}
|
||||
|
||||
$year = $game_env['year'];
|
||||
$month = $game_env['month'];
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'];
|
||||
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>(이)가 <G><b>{$city['name']}</b></> 공략에 <S>성공</>했습니다.";
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||
$josaYiGen = JosaUtil::pick($general['name'], '이');
|
||||
$josaYiCity = JosaUtil::pick($city['name'], '이');
|
||||
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYiGen} <G><b>{$city['name']}</b></> 공략에 <S>성공</>했습니다.";
|
||||
$log[] = "<C>●</><G><b>{$city['name']}</b></> 공략에 <S>성공</>했습니다.";
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<S><b>【지배】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$city['name']}</b></>(을)를 지배했습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:<G><b>{$city['name']}</b></>(을)를 <S>함락</>시킴");
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<Y>{$general['name']}</>(이)가 {$destnationName} <G><b>{$city['name']}</b></>(을)를 <S>점령</>");
|
||||
pushNationHistory($destnation, "<C>●</>{$year}년 {$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>에 의해 <G><b>{$city['name']}</b></>(이)가 <span class='ev_highlight'>함락</span>");
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<S><b>【지배】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$city['name']}</b></>{$josaUl} 지배했습니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$year}년 {$month}월:<G><b>{$city['name']}</b></>{$josaUl} <S>함락</>시킴");
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<Y>{$general['name']}</>{$josaYiGen} {$destnationName} <G><b>{$city['name']}</b></>{$josaUl} <S>점령</>");
|
||||
pushNationHistory($destnation, "<C>●</>{$year}년 {$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>에 의해 <G><b>{$city['name']}</b></>{$josaYiCity} <span class='ev_highlight'>함락</span>");
|
||||
|
||||
$query = "select city from city where nation='{$city['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1733,8 +1788,10 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$losenation = MYDB_fetch_array($result);
|
||||
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<R><b>【멸망】</b></><D><b>{$losenation['name']}</b></>(이)가 멸망하였습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<D><b>{$losenation['name']}</b></>(을)를 정복");
|
||||
$josaYi = JosaUtil::pick($losenation['name'], '이');
|
||||
$josaUl = JosaUtil::pick($losenation['name'], '을');
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<R><b>【멸망】</b></><D><b>{$losenation['name']}</b></>{$josaYi} 멸망하였습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<D><b>{$losenation['name']}</b></>{$josaUl} 정복");
|
||||
|
||||
$query = "select no, nation from general where nation='{$general['nation']}' and level='12'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1748,12 +1805,19 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
$loseGeneralGold = 0;
|
||||
$loseGeneralRice = 0;
|
||||
//멸망국 장수들 역사 기록 및 로그 전달
|
||||
$query = "select no,name,nation,npc,gold,rice from general where nation='{$city['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$genlog = ["<C>●</><D><b>{$losenation['name']}</b></>(이)가 <R>멸망</>했습니다."];
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$josaYi = JosaUtil::pick($losenation['name'], '이');
|
||||
$genlog = ["<C>●</><D><b>{$losenation['name']}</b></>{$josaYi} <R>멸망</>했습니다."];
|
||||
|
||||
|
||||
// 국가 백업
|
||||
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $city['nation']);
|
||||
$oldNationGenerals = $db->query('SELECT * FROM general WHERE nation=%i', $city['nation']);
|
||||
$oldNation['generals'] = array_map(function($gen){
|
||||
//다른 코드와는 다르게 공용으로 쓰므로 남겨둠
|
||||
return $gen['no'];
|
||||
}, $oldNationGenerals);
|
||||
|
||||
foreach($oldNationGenerals as $gen){
|
||||
|
||||
$loseGold = intdiv($gen['gold'] * (rand()%30+20), 100);
|
||||
$loseRice = intdiv($gen['rice'] * (rand()%30+20), 100);
|
||||
@@ -1764,7 +1828,8 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
|
||||
pushGenLog($gen, $genlog);
|
||||
|
||||
pushGeneralHistory($gen, "<C>●</>{$year}년 {$month}월:<D><b>{$losenation['name']}</b></>(이)가 <R>멸망</>");
|
||||
pushGeneralHistory($gen, "<C>●</>{$year}년 {$month}월:<D><b>{$losenation['name']}</b></>{$josaYi} <R>멸망</>");
|
||||
pushOldNationStop($gen['no'], $city['nation']);
|
||||
|
||||
$loseGeneralGold += $loseGold;
|
||||
$loseGeneralRice += $loseRice;
|
||||
@@ -1775,14 +1840,10 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
|| $nation['name'] == "왜족") {
|
||||
//등용장 미발부
|
||||
} elseif(Util::randBool(0.5)) {
|
||||
//TODO:등용장 보낼것
|
||||
/*sendScoutMsg([
|
||||
'id' => $ruler['no'],
|
||||
'nation_id' => $ruler['nation']
|
||||
],[
|
||||
'id' => $gen['no'],
|
||||
'nation_id' => $gen['nation']
|
||||
],$general['turntime']);*/
|
||||
$msg = ScoutMessage::buildScoutMessage($general['no'], $gen['no']);
|
||||
if($msg){
|
||||
$msg->send(true);
|
||||
}
|
||||
}
|
||||
|
||||
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
|
||||
@@ -1820,6 +1881,7 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($city['nation']);
|
||||
// 전 장수 공헌 명성치 깎음
|
||||
@@ -1837,6 +1899,12 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
// 외교 삭제
|
||||
$query = "delete from diplomacy where me='{$city['nation']}' or you='{$city['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$db->insert('ng_old_nations', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'nation'=>$city['nation'],
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
// 국가 삭제
|
||||
$query = "delete from nation where nation='{$city['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1859,7 +1927,8 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
|
||||
$minCityName = CityConst::byID($minCity)->name;
|
||||
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<M><b>【긴급천도】</b></><D><b>{$destnation['name']}</b></>(이)가 수도가 함락되어 <G><b>$minCityName</b></>으로 긴급천도하였습니다.";
|
||||
$josaYi = JosaUtil::pick($destnation['name'], '이');
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<M><b>【긴급천도】</b></><D><b>{$destnation['name']}</b></>{$josaYi} 수도가 함락되어 <G><b>$minCityName</b></>으로 긴급천도하였습니다.";
|
||||
|
||||
//아국 수뇌부에게 로그 전달
|
||||
$query = "select no,name,nation from general where nation='{$destnation['nation']}' and level>='5'";
|
||||
@@ -1915,9 +1984,11 @@ function ConquerCity($game_env, $general, $city, $nation, $destnation) {
|
||||
|
||||
|
||||
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<Y><b>【분쟁협상】</b></><D><b>{$conquerNationArray['name']}</b></>(이)가 영토분쟁에서 우위를 점하여 <G><b>{$city['name']}</b></>(을)를 양도받았습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<G><b>{$city['name']}</b></>(을)를 <D><b>{$conquerNationArray['name']}</b></>에 <Y>양도</>");
|
||||
pushNationHistory($conquerNationArray, "<C>●</>{$year}년 {$month}월:<D><b>{$nation['name']}</b></>에서 <G><b>{$city['name']}</b></>(을)를 <S>양도</> 받음");
|
||||
$josaUl = JosaUtil::pick($city['name'], '을');
|
||||
$josaYi = JosaUtil::pick($conquerNationArray['name'], '이');
|
||||
$history[] = "<C>●</>{$year}년 {$month}월:<Y><b>【분쟁협상】</b></><D><b>{$conquerNationArray['name']}</b></>{$josaYi} 영토분쟁에서 우위를 점하여 <G><b>{$city['name']}</b></>{$josaUl} 양도받았습니다.";
|
||||
pushNationHistory($nation, "<C>●</>{$year}년 {$month}월:<G><b>{$city['name']}</b></>{$josaUl} <D><b>{$conquerNationArray['name']}</b></>에 <Y>양도</>");
|
||||
pushNationHistory($conquerNationArray, "<C>●</>{$year}년 {$month}월:<D><b>{$nation['name']}</b></>에서 <G><b>{$city['name']}</b></>{$josaUl} <S>양도</> 받음");
|
||||
// 이동X 및 사기 변경
|
||||
$query = "update general set atmos='{$general['atmos']}',killnum=killnum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+12
-19
@@ -967,9 +967,13 @@ function command_25($turn, $command) {
|
||||
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$joinedNations = Json::decode($me['nations']);
|
||||
|
||||
$query = "select nation,name,color,scout,scoutmsg,sabotagelimit,gennum from nation order by gennum";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg,gennum FROM nation ORDER BY rand()');
|
||||
|
||||
echo "
|
||||
국가에 임관합니다.<br>
|
||||
@@ -979,29 +983,21 @@ function command_25($turn, $command) {
|
||||
!!!는 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!<br>
|
||||
???는 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.<br>
|
||||
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.<br>
|
||||
900px x 200px 넘는 높이를 점유할 시 통보없이 제한될 수 있습니다.<br>
|
||||
870px x 200px 넘는 높이를 점유할 시 통보없이 제한될 수 있습니다.<br>
|
||||
<form name=form1 action=c_double.php method=post>
|
||||
<select name=double size=1 style=color:white;background-color:black>
|
||||
<option value=99 style=color:white;background-color:black;>!!!</option>
|
||||
<option value=98 style=color:white;background-color:black;>???</option>";
|
||||
|
||||
$scoutStr = "";
|
||||
for($i=1; $i <= $count; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($nation['scoutmsg'] == "") {
|
||||
$scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</td><td width=900 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
|
||||
} else {
|
||||
$scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</td><td width=900 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>".$nation['scoutmsg']."</td></tr>";
|
||||
}
|
||||
|
||||
if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= 10) {
|
||||
foreach($nationList as $nation){
|
||||
if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit) {
|
||||
echo "
|
||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
|
||||
} elseif($nation['scout'] == 1) {
|
||||
echo "
|
||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
|
||||
} elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) {
|
||||
} elseif(in_array($nation['nation'], $joinedNations)) {
|
||||
/*
|
||||
echo "
|
||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red; disabled>【 {$nation['name']} 】</option>";
|
||||
@@ -1021,11 +1017,8 @@ function command_25($turn, $command) {
|
||||
}
|
||||
|
||||
echo "
|
||||
</form>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
|
||||
{$scoutStr}
|
||||
</table>";
|
||||
</form>";
|
||||
echo getInvitationList($nationList);
|
||||
|
||||
ender();
|
||||
}
|
||||
@@ -1584,7 +1577,7 @@ function command_46($turn, $command) {
|
||||
- 명 가 : <font color=cyan>기술↑ 인구↑</font> <font color=magenta>쌀수입↓ 수성↓</font><br>
|
||||
|
||||
<form name=form1 action=c_double.php method=post>
|
||||
국명 : <input type=text name=name size=12 maxlength=6 style=text-align:right;color:white;background-color:black>
|
||||
국명 : <input type=text name=name size=18 maxlength=9 style=text-align:right;color:white;background-color:black>
|
||||
색깔 : <select name=double size=1>
|
||||
<?php
|
||||
foreach(GetNationColors() as $idx=>$color) {
|
||||
@@ -1930,7 +1923,7 @@ function command_53($turn, $command) {
|
||||
|
||||
echo "
|
||||
</select>
|
||||
통합국명 : <input type=text name=nationname size=12 maxlength=6 style=text-align:right;color:white;background-color:black>
|
||||
통합국명 : <input type=text name=nationname size=18 maxlength=9 style=text-align:right;color:white;background-color:black>
|
||||
<input type=submit value=통합제의>
|
||||
<input type=hidden name=command value=$command>";
|
||||
for($i=0; $i < count($turn); $i++) {
|
||||
|
||||
+15
-1
@@ -239,7 +239,7 @@ class CityConst{
|
||||
static::$constID = $constID;
|
||||
static::$constName = $constName;
|
||||
static::$constRegion = $constRegion;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static $buildInitCommon = [
|
||||
@@ -317,8 +317,22 @@ class CityConst{
|
||||
]
|
||||
];
|
||||
|
||||
private static function test(){
|
||||
static::_generate();
|
||||
|
||||
foreach(static::all() as $id=>$city){
|
||||
foreach($city->path as $connId=>$connCityText){
|
||||
$connCity = static::byID($connId);
|
||||
if(!key_exists($id, $connCity->path)){
|
||||
throw new \RuntimeException(sprintf('도시 연결이 올바르지 않음! %s <=> %s', $city->name, $connCity->name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function build(){
|
||||
static::_generate();
|
||||
static::test();
|
||||
|
||||
$queries = array_map(function(CityInitialDetail $city){
|
||||
$initValue = static::$buildInit[$city->level];
|
||||
|
||||
@@ -76,7 +76,11 @@ class CityHelper{
|
||||
self::generateCache();
|
||||
}
|
||||
|
||||
return self::$listInv[$cityName];
|
||||
$city = self::$listInv[$cityName]??null;
|
||||
if($city === null){
|
||||
trigger_error("$cityName 에 해당하는 도시가 없습니다.");
|
||||
}
|
||||
return $city;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -86,12 +86,17 @@ class DiplomaticMessage extends Message{
|
||||
return $chk;
|
||||
}
|
||||
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 <C>$year</>년 불가침에 성공했습니다.";
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 <C>$year</>년 불가침에 합의했습니다.";
|
||||
$josa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>{$josa} <C>$year</>년 불가침에 성공했습니다.";
|
||||
|
||||
$josa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>{$josa} <C>$year</>년 불가침에 합의했습니다.";
|
||||
pushGenLog(['no'=>$this->dest->generalID], $mylog);
|
||||
pushGenLog(['no'=>$this->src->generalID], $youlog);
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$year}년 불가침 성공");
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$year}년 불가침 수락");
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} {$year}년 불가침 성공");
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} {$year}년 불가침 수락");
|
||||
|
||||
return $chk;
|
||||
}
|
||||
@@ -103,12 +108,25 @@ class DiplomaticMessage extends Message{
|
||||
return $chk;
|
||||
}
|
||||
|
||||
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(와)과 <M>조약 파기</>에 합의.";
|
||||
$history[] = "<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【파기】</b></><D><b>{$this->dest->nationName}</b></>(이)가 <D><b>{$this->src->nationName}</b></>(와)과 불가침을 파기 하였습니다.";
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 파기에 성공했습니다.";
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 파기에 합의했습니다.";
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 파기 성공");
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 파기 수락");
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>조약 파기</>에 합의.";
|
||||
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$history[] = "<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【파기】</b></><D><b>{$this->dest->nationName}</b></>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} 불가침을 파기 하였습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>{$josaWa} 파기에 성공했습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>{$josaWa} 파기에 합의했습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} 파기 성공");
|
||||
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} 파기 수락");
|
||||
|
||||
pushGenLog(['no'=>$this->dest->generalID], $mylog);
|
||||
pushGenLog(['no'=>$this->src->generalID], $youlog);
|
||||
@@ -125,12 +143,25 @@ class DiplomaticMessage extends Message{
|
||||
return $chk;
|
||||
}
|
||||
|
||||
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(와)과 <M>종전 합의</> 하였습니다.";
|
||||
$history[] = "<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【종전】</b></><D><b>{$this->dest->nationName}</b></>(이)가 <D><b>{$this->src->nationName}</b></>(와)과 <M>종전 합의</> 하였습니다.";
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 종전에 성공했습니다.";
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 종전에 합의했습니다.";
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 종전 성공");
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 종전 수락");
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$alllog[] = "<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>종전 합의</> 하였습니다.";
|
||||
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$history[] = "<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【종전】</b></><D><b>{$this->dest->nationName}</b></>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>종전 합의</> 하였습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>{$josaWa} 종전에 성공했습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>{$josaWa} 종전에 합의했습니다.";
|
||||
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} 종전 성공");
|
||||
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} 종전 수락");
|
||||
|
||||
pushGenLog(['no'=>$this->dest->generalID], $mylog);
|
||||
pushGenLog(['no'=>$this->src->generalID], $youlog);
|
||||
@@ -147,28 +178,37 @@ class DiplomaticMessage extends Message{
|
||||
return $chk;
|
||||
}
|
||||
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 통합 시도"]
|
||||
);
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->dest->generalID],
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 통합 시도"]
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaWa} 통합 시도"]
|
||||
);
|
||||
pushGenLog(
|
||||
['no'=>$this->dest->generalID],
|
||||
["<C>●</><D><b>{$this->src->nationName}</b></>(와)과 통합에 동의했습니다."]
|
||||
);
|
||||
pushGenLog(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</><D><b>{$this->dest->nationName}</b></>(이)가 통합에 동의했습니다."]
|
||||
["<C>●</><D><b>{$this->src->nationName}</b></>{$josaWa} 통합에 동의했습니다."]
|
||||
);
|
||||
|
||||
$josaWa = JosaUtil::pick($this->src->nationName, '와');
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
pushGeneralPublicRecord(
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(와)과 <M>통합</>에 동의하였습니다."],
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaWa} <M>통합</>에 동의하였습니다."],
|
||||
$helper->year,
|
||||
$helper->month);
|
||||
$josaYi = JosaUtil::pick($this->src->generalName, '이');
|
||||
|
||||
|
||||
$josaWa = JosaUtil::pick($this->dest->nationName, '와');
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>{$josaWa} 통합 시도"]
|
||||
);
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
pushGenLog(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</><D><b>{$this->dest->nationName}</b></>{$josaYi} 통합에 동의했습니다."]
|
||||
);
|
||||
pushWorldHistory(
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【통합시도】</b></><D><b>{$this->dest->nationName}</b></>(와)과 <D><b>{$this->src->nationName}</b></>(이)가 통합을 시도합니다."],
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【통합시도】</b></><D><b>{$this->dest->nationName}</b></>{$josaWa}과 <D><b>{$this->src->nationName}</b></>{$josaYi} 통합을 시도합니다."],
|
||||
$helper->year,
|
||||
$helper->month
|
||||
);
|
||||
@@ -183,28 +223,32 @@ class DiplomaticMessage extends Message{
|
||||
return $chk;
|
||||
}
|
||||
|
||||
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->src->generalID],
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 투항 제의"
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->dest->nationName}</b></>에게 투항 제의"
|
||||
);
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->dest->generalID],
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>(으)로 투항 동의"
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D><b>{$this->src->nationName}</b></>{$josaRo} 투항 동의"
|
||||
);
|
||||
pushGenLog(
|
||||
['no'=>$this->dest->generalID],
|
||||
["<C>●</><D><b>{$this->src->nationName}</b></>(으)로 투항에 동의했습니다."]
|
||||
["<C>●</><D><b>{$this->src->nationName}</b></>{$josaRo} 투항에 동의했습니다."]
|
||||
);
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
pushGenLog(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</><D><b>{$this->dest->nationName}</b></>(이)가 투항에 동의했습니다."]
|
||||
["<C>●</><D><b>{$this->dest->nationName}</b></>{$josaYi} 투항에 동의했습니다."]
|
||||
);
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
pushGeneralPublicRecord(
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 <M>투항</>에 동의하였습니다."],
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaRo} <M>투항</>에 동의하였습니다."],
|
||||
$helper->year,
|
||||
$helper->month);
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
pushWorldHistory(
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【투항시도】</b></><D><b>{$this->dest->nationName}</b></>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 투항합니다."],
|
||||
["<C>●</>{$helper->year}년 {$helper->month}월:<Y><b>【투항시도】</b></><D><b>{$this->dest->nationName}</b></>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaRo} 투항합니다."],
|
||||
$helper->year,
|
||||
$helper->month
|
||||
);
|
||||
@@ -292,11 +336,12 @@ class DiplomaticMessage extends Message{
|
||||
$this->invalidate();
|
||||
$this->validDiplomacy = false;
|
||||
|
||||
$josaYi = JosaUtil::pick($this->src->nationName, '이');
|
||||
$newMsg = new Message(
|
||||
self::MSGTYPE_NATIONAL,
|
||||
$this->dest,
|
||||
$this->src,
|
||||
"【외교】{$year}년 {$month}월: {$this->src->nationName}(이)가 {$this->dest->nationName}에게 제안한 {$this->diplomacyDetail}{$this->diplomacyName} 동의.",
|
||||
"【외교】{$year}년 {$month}월: {$this->src->nationName}{$josaYi} {$this->dest->nationName}에게 제안한 {$this->diplomacyDetail}{$this->diplomacyName} 동의.",
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[
|
||||
@@ -335,8 +380,9 @@ class DiplomaticMessage extends Message{
|
||||
return $result;
|
||||
}
|
||||
|
||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||
pushGenLog(['no'=>$receiverID], "<C>●</><D>{$this->src->nationName}</>의 {$this->diplomacyName} 제안을 거절했습니다.");
|
||||
pushGenLog(['no'=>$this->src->generalID], "<C>●</><Y>{$this->dest->nationName}</>(이)가 {$this->diplomacyName} 제안을 거절했습니다.");
|
||||
pushGenLog(['no'=>$this->src->generalID], "<C>●</><Y>{$this->dest->nationName}</>{$josaYi} {$this->diplomacyName} 제안을 거절했습니다.");
|
||||
$this->_declineMessage();
|
||||
return self::DECLINED;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ namespace sammo\Engine;
|
||||
|
||||
use \sammo\DB;
|
||||
use \sammo\DiplomaticMessage;
|
||||
use \sammo\KVStorage;
|
||||
use \sammo\Json;
|
||||
use \sammo\GameConst;
|
||||
|
||||
//NOTE: A가 B에게 항복, 통합 서신을 보냈을 때 통합 후 대상이 A이므로 A가 주체임.
|
||||
class Diplomacy{
|
||||
|
||||
@@ -3,7 +3,9 @@ namespace sammo\Engine;
|
||||
|
||||
use \sammo\DB;
|
||||
use \sammo\ScoutMessage;
|
||||
|
||||
use \sammo\KVStorage;
|
||||
use \sammo\Json;
|
||||
use \sammo\GameConst;
|
||||
/**
|
||||
* 인사(등용, 추방, 임명, 망명) 헬퍼 클래스?
|
||||
* Nation 클래스가 있고 그걸 상속한 구조가 더 나을지도?
|
||||
@@ -70,7 +72,7 @@ class Personnel{
|
||||
return [ScoutMessage::DECLINED, '군주는 등용장을 수락할 수 없습니다.'];
|
||||
}
|
||||
|
||||
if(strpos($general['nations'], ",{$this->nation['nation']},") !== false){
|
||||
if(in_array($this->nation['nation'], Json::decode($general['nations']))){
|
||||
return [ScoutMessage::DECLINED, '이미 임관했었던 국가입니다.'];
|
||||
}
|
||||
|
||||
@@ -109,22 +111,25 @@ class Personnel{
|
||||
}
|
||||
|
||||
$scoutNationGeneralCnt+=1;
|
||||
if($scoutNationGeneralCnt < 10){
|
||||
$scoutNationGeneralCnt = 10;//XXX: 상수!
|
||||
if($scoutNationGeneralCnt < GameConst::$initialNationGenLimit){
|
||||
$scoutNationGeneralCnt = GameConst::$initialNationGenLimit;
|
||||
}
|
||||
|
||||
$originalNationGeneralCnt-=1;
|
||||
if($originalNationGeneralCnt < 10){
|
||||
$originalNationGeneralCnt = 10;//XXX: 상수!
|
||||
if($originalNationGeneralCnt < GameConst::$initialNationGenLimit){
|
||||
$originalNationGeneralCnt = GameConst::$initialNationGenLimit;
|
||||
}
|
||||
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
$joinedNations[] = $this->nation['nation'];
|
||||
|
||||
// 국가 변경, 도시 변경, 일반으로, 수도로
|
||||
$setValues = [
|
||||
'belong'=>1,
|
||||
'level'=>1,
|
||||
'nation'=>$this->nation['nation'],
|
||||
'city'=>$this->nation['capital'],
|
||||
'nations'=>$db->sqleval('CONCAT(nations, %s)', "{$this->nation['nation']},"),
|
||||
'nations'=>Json::encode($joinedNations),
|
||||
'troop'=>0,
|
||||
];
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class RegNPC extends \sammo\Event\Action{
|
||||
public function __construct(
|
||||
int $affinity,
|
||||
string $name,
|
||||
int $pictureID,
|
||||
$picturePath,
|
||||
int $nationID,
|
||||
$locatedCity,
|
||||
int $leadership,
|
||||
@@ -18,13 +18,13 @@ class RegNPC extends \sammo\Event\Action{
|
||||
int $birth = 160,
|
||||
int $death = 300,
|
||||
$ego = null,
|
||||
string $char = '',
|
||||
$char = '',
|
||||
$text = ''
|
||||
){
|
||||
$this->npc = new \sammo\Scenario\NPC(
|
||||
$affinity,
|
||||
$name,
|
||||
$pictureID,
|
||||
$picturePath,
|
||||
$nationID,
|
||||
$locatedCity,
|
||||
$leadership,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameConst
|
||||
class GameConst extends GameCustomConst
|
||||
{
|
||||
/** @var string 버전 */
|
||||
public static $title = "삼국지 모의전투 PHP HiDCHe";
|
||||
@@ -45,12 +45,6 @@ class GameConst
|
||||
public static $sabotageDefaultAmount = 100;
|
||||
/** @var int 계략시 수치 감소량($firingbase ~ $firingpower)*/
|
||||
public static $sabotageAmountCoef = 400;
|
||||
/** @var int 명장,지장에 사용될 통솔 제한*/
|
||||
public static $goodgenleader = 65;
|
||||
/** @var int 명장에 사용될 무력 제한*/
|
||||
public static $goodgenpower = 65;
|
||||
/** @var int 지장에 사용될 지력 제한*/
|
||||
public static $goodgenintel = 65;
|
||||
/** @var string 기본 배경색깔 푸른색*/
|
||||
public static $basecolor = "#000044";
|
||||
/** @var string 기본 배경색깔 초록색*/
|
||||
@@ -74,6 +68,9 @@ class GameConst
|
||||
/** @var float 성인 연령 */
|
||||
public static $adultAge = 14;
|
||||
|
||||
/** @var int 초기 제한시 장수 제한 */
|
||||
public static $initialNationGenLimit = 10;
|
||||
|
||||
/** @var int 초기 최대 장수수 */
|
||||
public static $defaultMaxGeneral = 500;
|
||||
/** @var int 초기 최대 국가 수 */
|
||||
|
||||
@@ -16,8 +16,8 @@ class ResetHelper{
|
||||
'reason'=>'logs, data 디렉토리를 생성할 권한이 없습니다.'
|
||||
];
|
||||
}
|
||||
mkdir($servRoot.'/logs', 0644);
|
||||
mkdir($servRoot.'/data', 0644);
|
||||
mkdir($servRoot.'/logs', 0755);
|
||||
mkdir($servRoot.'/data', 0755);
|
||||
}
|
||||
|
||||
if(!is_writable($servRoot.'/logs')){
|
||||
@@ -55,13 +55,15 @@ class ResetHelper{
|
||||
$db = DB::db();
|
||||
$mysqli_obj = $db->get();
|
||||
|
||||
FileUtil::delInDir($servRoot."/logs");
|
||||
FileUtil::delInDir($servRoot."/data");
|
||||
$serverID = DB::prefix().'_'.date("ymd").'_'.Util::randomStr(4);
|
||||
|
||||
mkdir($servRoot.'/logs/'.$serverID, 0755);
|
||||
mkdir($servRoot.'/data/'.$serverID, 0755);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
$servRoot.'/d_setting/UniqueConst.orig.php',
|
||||
$servRoot.'/d_setting/UniqueConst.php',[
|
||||
'serverID'=>DB::prefix().'_'.Util::randomStr(8),
|
||||
'serverID'=>$serverID,
|
||||
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
|
||||
], true
|
||||
);
|
||||
@@ -92,7 +94,8 @@ class ResetHelper{
|
||||
(KVStorage::getStorage($db, 'game_env'))->resetValues();
|
||||
|
||||
return [
|
||||
'result'=>true
|
||||
'result'=>true,
|
||||
'serverID'=>$serverID
|
||||
];
|
||||
}
|
||||
|
||||
@@ -126,9 +129,12 @@ class ResetHelper{
|
||||
return $clearResult;
|
||||
}
|
||||
|
||||
$serverID = $clearResult['serverID'];
|
||||
|
||||
$scenarioObj = new Scenario($scenario, false);
|
||||
$startyear = $scenarioObj->getYear()??GameConst::$defaultStartYear;
|
||||
$scenarioObj->buildConf();
|
||||
|
||||
$startyear = $scenarioObj->getYear()??GameConst::$defaultStartYear;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
@@ -160,9 +166,12 @@ class ResetHelper{
|
||||
$killturn = 4800 / $turnterm;
|
||||
if($npcmode == 1) { $killturn = intdiv($killturn, 3); }
|
||||
|
||||
|
||||
|
||||
$env = [
|
||||
'scenario'=>$scenario,
|
||||
'scenario_text'=>$scenarioObj->getTitle(),
|
||||
'icon_path'=>$scenarioObj->getIconPath(),
|
||||
'startyear'=>$startyear,
|
||||
'year'=> $year,
|
||||
'month'=> $month,
|
||||
@@ -199,6 +208,15 @@ class ResetHelper{
|
||||
$gameStor->$key = $value;
|
||||
}
|
||||
|
||||
$db->insert('ng_games', [
|
||||
'server_id'=>$serverID,
|
||||
'date'=>$turntime,
|
||||
'winner_nation'=>null,
|
||||
'scenario'=>$scenario,
|
||||
'scenario_name'=>$scenarioObj->getTitle(),
|
||||
'env'=>Json::encode($env)
|
||||
]);
|
||||
|
||||
$scenarioObj->build($env);
|
||||
|
||||
$db->update('plock', [
|
||||
|
||||
+87
-9
@@ -7,6 +7,7 @@ class Scenario{
|
||||
private $scenarioIdx;
|
||||
private $scenarioPath;
|
||||
|
||||
private $iconPath = '.';
|
||||
private $data;
|
||||
|
||||
private $year;
|
||||
@@ -15,6 +16,8 @@ class Scenario{
|
||||
private $history;
|
||||
|
||||
private $nations;
|
||||
private $nationsInv;
|
||||
|
||||
private $diplomacy;
|
||||
|
||||
private $generals;
|
||||
@@ -27,6 +30,8 @@ class Scenario{
|
||||
|
||||
private $initOK = false;
|
||||
|
||||
private $gameConf = null;
|
||||
|
||||
private function initFull(){
|
||||
if($this->initOK){
|
||||
return;
|
||||
@@ -34,13 +39,17 @@ class Scenario{
|
||||
$this->initOK = true;
|
||||
$data = $this->data;
|
||||
|
||||
$neutralNation = new Scenario\Nation(0, '재야', '#000000', 0, 0);
|
||||
$this->nations = [];
|
||||
$this->nations[0] = new Scenario\Nation(0, '재야', '#000000', 0, 0);
|
||||
$this->nations[0] = $neutralNation;
|
||||
$this->nationsInv = [$neutralNation->getName() => $neutralNation];
|
||||
|
||||
foreach (Util::array_get($data['nation'],[]) as $idx=>$rawNation) {
|
||||
list($name, $color, $gold, $rice, $infoText, $tech, $type, $nationLevel, $cities) = $rawNation;
|
||||
$nationID = $idx+1;
|
||||
|
||||
$this->nations[$nationID] = new Scenario\Nation(
|
||||
|
||||
$nation = new Scenario\Nation(
|
||||
$nationID,
|
||||
$name,
|
||||
$color,
|
||||
@@ -52,6 +61,8 @@ class Scenario{
|
||||
$nationLevel,
|
||||
$cities
|
||||
);
|
||||
$this->nations[$nationID] = $nation;
|
||||
$this->nationsInv[$nation->getName()] = $nation;
|
||||
}
|
||||
|
||||
$this->diplomacy = Util::array_get($data['diplomacy'], []);
|
||||
@@ -63,12 +74,18 @@ class Scenario{
|
||||
}
|
||||
|
||||
list(
|
||||
$affinity, $name, $pictureID, $nationID, $locatedCity,
|
||||
$affinity, $name, $picturePath, $nationName, $locatedCity,
|
||||
$leadership, $power, $intel, $level, $birth, $death, $ego,
|
||||
$char, $text
|
||||
) = $rawGeneral;
|
||||
|
||||
if(!key_exists($nationID, $this->nations)){
|
||||
if(key_exists($nationName, $this->nationsInv)){
|
||||
$nationID = $this->nationsInv[$nationName]->getID();
|
||||
}
|
||||
else if(key_exists($nationName, $this->nations)){
|
||||
$nationID = (int)$nationName;
|
||||
}
|
||||
else{
|
||||
$nationID = 0;
|
||||
}
|
||||
|
||||
@@ -77,7 +94,7 @@ class Scenario{
|
||||
return new Scenario\NPC(
|
||||
$affinity,
|
||||
$name,
|
||||
$pictureID,
|
||||
$picturePath,
|
||||
$nationID,
|
||||
$locatedCity,
|
||||
$leadership,
|
||||
@@ -98,12 +115,18 @@ class Scenario{
|
||||
}
|
||||
|
||||
list(
|
||||
$affinity, $name, $pictureID, $nationID, $locatedCity,
|
||||
$affinity, $name, $picturePath, $nationName, $locatedCity,
|
||||
$leadership, $power, $intel, $level, $birth, $death, $ego,
|
||||
$char, $text
|
||||
) = $rawGeneral;
|
||||
|
||||
if(!key_exists($nationID, $this->nations)){
|
||||
if(key_exists($nationName, $this->nationsInv)){
|
||||
$nationID = $this->nationsInv[$nationName]->id;;
|
||||
}
|
||||
else if(key_exists($nationName, $this->nations)){
|
||||
$nationID = (int)$nationName;
|
||||
}
|
||||
else{
|
||||
$nationID = 0;
|
||||
}
|
||||
|
||||
@@ -112,7 +135,7 @@ class Scenario{
|
||||
return new Scenario\NPC(
|
||||
$affinity,
|
||||
$name,
|
||||
$pictureID,
|
||||
$picturePath,
|
||||
$nationID,
|
||||
$locatedCity,
|
||||
$leadership,
|
||||
@@ -126,7 +149,7 @@ class Scenario{
|
||||
$text
|
||||
);
|
||||
|
||||
}, Util::array_get($data['generalEx'], []));
|
||||
}, Util::array_get($data['general_ex'], []));
|
||||
|
||||
$this->initialEvents = array_map(function($rawEvent){
|
||||
$cond = $rawEvent[0];
|
||||
@@ -148,6 +171,29 @@ class Scenario{
|
||||
}, Util::array_get($data['events'], []));
|
||||
}
|
||||
|
||||
public function getGameConf(){
|
||||
if($this->gameConf){
|
||||
return $this->gameConf;
|
||||
}
|
||||
$defaultPath = self::SCENARIO_PATH."/default.json";
|
||||
if(!file_exists($defaultPath)){
|
||||
throw new \RuntimeException('기본 시나리오 설정 파일 없음!');
|
||||
}
|
||||
$default = Json::decode(file_get_contents($defaultPath));
|
||||
|
||||
$stat = [
|
||||
'statTotal'=>$this->data['stat']['total']??$default['stat']['total'],
|
||||
'statMin'=>$this->data['stat']['min']??$default['stat']['min'],
|
||||
'statMax'=>$this->data['stat']['max']??$default['stat']['max'],
|
||||
'statNPCMax'=>$this->data['stat']['npcMax']??$default['stat']['npcMax'],
|
||||
'statChiefMin'=>$this->data['stat']['chiefMin']??$default['stat']['chiefMin'],
|
||||
];
|
||||
|
||||
$this->gameConf = array_merge($stat);
|
||||
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
|
||||
return $this->gameConf;
|
||||
}
|
||||
|
||||
public function __construct(int $scenarioIdx, bool $lazyInit = true){
|
||||
$scenarioPath = self::SCENARIO_PATH."/scenario_{$scenarioIdx}.json";
|
||||
|
||||
@@ -157,6 +203,8 @@ class Scenario{
|
||||
$data = Json::decode(file_get_contents($scenarioPath));
|
||||
$this->data = $data;
|
||||
|
||||
$this->getGameConf();
|
||||
|
||||
$this->year = Util::array_get($data['startYear']);
|
||||
$this->title = Util::array_get($data['title'] , '');
|
||||
|
||||
@@ -180,6 +228,10 @@ class Scenario{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getIconPath(){
|
||||
return $this->iconPath;
|
||||
}
|
||||
|
||||
public function getNPC(){
|
||||
$this->initFull();
|
||||
return $this->generals;
|
||||
@@ -240,6 +292,17 @@ class Scenario{
|
||||
private function buildGenerals($env){
|
||||
$this->initFull();
|
||||
|
||||
|
||||
try{
|
||||
$text = \file_get_contents(ServConfig::getSharedIconPath('../hook/list.json?1'));
|
||||
$storedIcons = Json::decode($text);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
$storedIcons = [];
|
||||
}
|
||||
|
||||
$env['stored_icons'] = $storedIcons;
|
||||
|
||||
$remainGenerals = [];
|
||||
foreach($this->generals as $general){
|
||||
if($general->build($env)){
|
||||
@@ -292,7 +355,19 @@ class Scenario{
|
||||
}
|
||||
}
|
||||
|
||||
public function buildConf(){
|
||||
$path = __dir__.'/../d_setting';
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
$path.'/GameCustomConst.orig.php',
|
||||
$path.'/GameCustomConst.php',
|
||||
$this->gameConf,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public function build($env=[]){
|
||||
|
||||
|
||||
$this->initFull();
|
||||
|
||||
//NOTE: 초기화가 되어있다고 가정함.
|
||||
@@ -306,6 +381,9 @@ class Scenario{
|
||||
event변수 : currentEventID
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
foreach($this->nations as $id=>$nation){
|
||||
|
||||
+41
-14
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace sammo\Scenario;
|
||||
use \sammo\Util;
|
||||
use \sammo\JosaUtil;
|
||||
use \sammo\DB;
|
||||
use \sammo\CityHelper;
|
||||
|
||||
@@ -8,7 +9,7 @@ class NPC{
|
||||
|
||||
public $affinity;
|
||||
public $name;
|
||||
public $pictureID;
|
||||
public $picturePath;
|
||||
public $nationID;
|
||||
public $locatedCity;
|
||||
public $leadership;
|
||||
@@ -26,7 +27,7 @@ class NPC{
|
||||
public function __construct(
|
||||
int $affinity,
|
||||
string $name,
|
||||
int $pictureID,
|
||||
$picturePath,
|
||||
int $nationID,
|
||||
$locatedCity, //FIXME: 7.1로 올릴 때 ?string 으로 변경
|
||||
int $leadership,
|
||||
@@ -41,7 +42,7 @@ class NPC{
|
||||
){
|
||||
$this->affinity = $affinity;
|
||||
$this->name = $name;
|
||||
$this->pictureID = $pictureID;
|
||||
$this->picturePath = $picturePath;
|
||||
$this->nationID = $nationID;
|
||||
$this->locatedCity = $locatedCity;
|
||||
$this->leadership = $leadership;
|
||||
@@ -116,7 +117,8 @@ class NPC{
|
||||
$db = DB::db();
|
||||
|
||||
if($isNewGeneral){
|
||||
\sammo\pushWorldHistory(["<C>●</>{$month}월:<Y>{$name}</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
|
||||
$josaYi = JosaUtil::pick($name, '이');
|
||||
\sammo\pushWorldHistory(["<C>●</>{$month}월:<Y>{$name}</>{$josaYi} 성인이 되어 <S>등장</>했습니다."], $year, $month);
|
||||
}
|
||||
|
||||
if($this->ego == null || $isFictionMode){
|
||||
@@ -142,15 +144,42 @@ class NPC{
|
||||
|
||||
$name = 'ⓝ'.$this->name;
|
||||
|
||||
$pictureID = $this->pictureID;
|
||||
if($env['show_img_level'] == 3 && $pictureID > 0){
|
||||
$picture = "{$pictureID}.jpg";
|
||||
$picturePath = $this->picturePath;
|
||||
if($env['show_img_level'] < 3){
|
||||
$picturePath = 'default.jpg';
|
||||
}
|
||||
else{
|
||||
$picture = 'default.jpg';
|
||||
else if(is_numeric($picturePath)){
|
||||
if($picturePath < 0){
|
||||
$picturePath = null;
|
||||
}
|
||||
else if(\key_exists($picturePath, $env['stored_icons']['.']??[])){
|
||||
$picturePath = $env['stored_icons']['.'][$picturePath];
|
||||
}
|
||||
else{
|
||||
$picturePath = null;
|
||||
}
|
||||
}
|
||||
else if($picturePath !== null && in_array($picturePath, $env['stored_icons'][$env['icon_path']??'.']??[])){
|
||||
$picturePath = ($env['icon_path']??'.').'/'.$picturePath;
|
||||
}
|
||||
else if($picturePath === null && \key_exists('stored_icons', $env)){
|
||||
$target = $env['stored_icons']??[];
|
||||
$target = $target[$env['icon_path']??'.']??[];
|
||||
$picturePath = $target[$this->name]??null;
|
||||
if($picturePath){
|
||||
$picturePath = ($env['icon_path']??'.').'/'.$picturePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($picturePath === null){
|
||||
$picturePath = 'default.jpg';
|
||||
}
|
||||
|
||||
$city = $this->locatedCity;
|
||||
if($city !== null){
|
||||
$city = CityHelper::getCityByName($city)['id']??null;
|
||||
}
|
||||
if($city === null){
|
||||
if($nationID == 0 || !CityHelper::getAllNationCities($nationID)){
|
||||
$cityObj = Util::choiceRandom(CityHelper::getAllCities());
|
||||
@@ -161,14 +190,12 @@ class NPC{
|
||||
'@phan-var array<string,string|int> $cityObj';
|
||||
$city = $cityObj['id'];
|
||||
}
|
||||
else{
|
||||
$city = CityHelper::getCityByName($city)['id'];
|
||||
}
|
||||
|
||||
|
||||
$experience = $age * 100;
|
||||
$dedication = $age * 100;
|
||||
$level = $this->level;
|
||||
if(!$level){
|
||||
if(!$level || $isNewGeneral){
|
||||
$level = $nationID?1:0;
|
||||
}
|
||||
|
||||
@@ -187,7 +214,7 @@ class NPC{
|
||||
'npc_org'=>2,
|
||||
'affinity'=>$affinity,
|
||||
'name'=>$name,
|
||||
'picture'=>$picture,
|
||||
'picture'=>$picturePath,
|
||||
'nation'=>$nationID,
|
||||
'city'=>$city,
|
||||
'leader'=>$this->leadership,
|
||||
|
||||
@@ -55,6 +55,10 @@ class Nation{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function build($env=[]){
|
||||
//NOTE: NPC의 숫자는 아직 확정된 것이 아니다.
|
||||
$cities = array_map(function($cityName){
|
||||
@@ -133,6 +137,13 @@ class Nation{
|
||||
'gennum'=>$npc_cnt,
|
||||
'totaltech'=>$this->tech*$npc_cnt
|
||||
], 'nation=%i', $this->id);
|
||||
|
||||
//군주가 없는지 확인
|
||||
$hasRuler = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i AND level=12', $this->id);
|
||||
if(!$hasRuler){
|
||||
$newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation=%i ORDER BY leader+power+intel DESC LIMIT 1', $this->id);
|
||||
$db->update('general',['level'=>12], 'no=%i', $newRuler);
|
||||
}
|
||||
}
|
||||
|
||||
public function getBrief(){
|
||||
|
||||
@@ -89,9 +89,11 @@ class ScoutMessage extends Message{
|
||||
$this->invalidate();
|
||||
$this->validScout = false;
|
||||
|
||||
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
pushGenLog(
|
||||
['no'=>$this->dest->generalID],
|
||||
["<C>●</><D>{$this->src->nationName}</>(으)로 망명하여 수도로 이동합니다."]);
|
||||
["<C>●</><D>{$this->src->nationName}</>{$josaRo} 망명하여 수도로 이동합니다."]);
|
||||
pushGenLog(
|
||||
['no'=>$this->src->generalID],
|
||||
["<C>●</><Y>{$this->dest->generalName}</> 등용에 성공했습니다."]
|
||||
@@ -101,10 +103,10 @@ class ScoutMessage extends Message{
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<Y>{$this->dest->generalName}</> 등용에 성공");
|
||||
pushGeneralHistory(
|
||||
['no'=>$this->dest->generalID],
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D>{$this->src->nationName}</>(으)로 망명"
|
||||
"<C>●</>{$helper->year}년 {$helper->month}월:<D>{$this->src->nationName}</>{$josaRo} 망명"
|
||||
);
|
||||
pushGeneralPublicRecord(
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 <S>망명</>하였습니다."],
|
||||
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>{$josaYi} <D><b>{$this->src->nationName}</b></>{$josaRo} <S>망명</>하였습니다."],
|
||||
$helper->year,
|
||||
$helper->month
|
||||
);
|
||||
@@ -113,7 +115,7 @@ class ScoutMessage extends Message{
|
||||
self::MSGTYPE_PRIVATE,
|
||||
$this->src,
|
||||
$this->dest,
|
||||
"{$this->src->nationName}(으)로 등용 제의 수락",
|
||||
"{$this->src->nationName}{$josaRo} 등용 제의 수락",
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[
|
||||
@@ -130,11 +132,12 @@ class ScoutMessage extends Message{
|
||||
$this->invalidate();
|
||||
$this->validScout = false;
|
||||
|
||||
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
||||
$newMsg = new Message(
|
||||
self::MSGTYPE_PRIVATE,
|
||||
$this->src,
|
||||
$this->dest,
|
||||
"{$this->src->nationName}(으)로 등용 제의 거부",
|
||||
"{$this->src->nationName}{$josaRo} 등용 제의 거부",
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[
|
||||
@@ -158,14 +161,16 @@ class ScoutMessage extends Message{
|
||||
return $result;
|
||||
}
|
||||
|
||||
pushGenLog(['no'=>$receiverID], "<C>●</><D>{$this->src->nationName}</>(으)로 망명을 거부했습니다.");
|
||||
pushGenLog(['no'=>$this->src->generalID], "<C>●</><Y>{$this->dest->generalName}</>(이)가 등용을 거부했습니다.");
|
||||
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||
pushGenLog(['no'=>$receiverID], "<C>●</><D>{$this->src->nationName}</>{$josaRo} 망명을 거부했습니다.");
|
||||
pushGenLog(['no'=>$this->src->generalID], "<C>●</><Y>{$this->dest->generalName}</>{$josaYi} 등용을 거부했습니다.");
|
||||
$this->_declineMessage();
|
||||
|
||||
return self::DECLINED;
|
||||
}
|
||||
|
||||
public static function buildScoutMessage(int $srcGeneralID, int $destGeneralID, &$reason = null, \DateTime $date = null): Message{
|
||||
public static function buildScoutMessage(int $srcGeneralID, int $destGeneralID, &$reason = null, \DateTime $date = null):?self{
|
||||
if($srcGeneralID == $destGeneralID){
|
||||
if($reason !== null){
|
||||
$reason = '같은 장수에게 등용장을 보낼 수 없습니다';
|
||||
@@ -220,7 +225,8 @@ class ScoutMessage extends Message{
|
||||
$destNationInfo['color']
|
||||
);
|
||||
|
||||
$msg = "{$src->nationName}(으)로 망명 권유 서신";
|
||||
$josaRo = JosaUtil::pick($src->nationName, '로');
|
||||
$msg = "{$src->nationName}{$josaRo} 망명 권유 서신";
|
||||
$validUntil = new \DateTime("9999-12-31 12:59:59");
|
||||
|
||||
$msgOption = [
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
"stat":{
|
||||
"total":150,
|
||||
"min":10,
|
||||
"max":75
|
||||
}
|
||||
"max":75,
|
||||
"npcMax":95,
|
||||
"chiefMin":65
|
||||
},
|
||||
"iconPath":"."
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"title":"【모드명】 시나리오 명",
|
||||
"life":0,
|
||||
"fiction":0,
|
||||
"nation":[
|
||||
["str:국가명", "RGB string:국가컬러(사용가능한 것만)", "int:금", "int:쌀", "str:국가설명", "int:기술", "str:성향", "int:국가규모(0:방랑군 ~ 7:황제)",
|
||||
["str:소속도시(첫번째 도시가 수도)"]
|
||||
]
|
||||
],
|
||||
"diplomacy":[
|
||||
["int:국가", "int:국가", "int:외교종류(0:전쟁, 1:선포, 7:불가침)", "int:기간(개월)"]
|
||||
],
|
||||
"general":[
|
||||
["int?:상성(1~150, 999:영구재야, null:랜덤)", "str:장수명","str?:전콘경로(시나리오명/장수명.jpg,빈칸:없음)", "str?:소속국가(빈칸:재야)", "str?:도시(null:'랜덤)", "int:통", "int:무", "int:지", "int:관직(0:재야, 1:장수, 5~10:수뇌, 11:참모, 12:군주)", "int:생년", "int:몰년", "str?:성격(null:랜덤)", "str?:내특/전특(랜덤, 랜덤내특, 랜덤전특, null:미정)", "opt,str:대사"]
|
||||
],
|
||||
"general_ex":[
|
||||
],
|
||||
"cities":[
|
||||
|
||||
],
|
||||
"history":[
|
||||
"str:역사"
|
||||
],
|
||||
"initialActions":[
|
||||
"array:event form"
|
||||
],
|
||||
"events":[
|
||||
"array:event form"
|
||||
]
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
{
|
||||
"title":"【가상모드9】 천인 강림",
|
||||
"title":"【가상모드9-a】 천인 강림",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
],
|
||||
"diplomacy":[
|
||||
],
|
||||
"stat":{
|
||||
"npcMax":65,
|
||||
"chiefMin":55
|
||||
},
|
||||
"general":[
|
||||
[ 1, "소제1", 1001, 0, null, 18, 7, 48, 0, 160, 300, "유지", null],
|
||||
[ 1, "헌제", 1002, 0, null, 15, 7, 61, 0, 160, 300, "안전", null],
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user