Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4357fb3874 | ||
|
|
225c356b2d | ||
|
|
0bb45979df | ||
|
|
b28ac27fba | ||
|
|
017d1b5dd9 | ||
|
|
a7b22748cd | ||
|
|
4f2c08918a | ||
|
|
d2f6df270b | ||
|
|
64b14b0c5d | ||
|
|
8394c9780c | ||
|
|
a5b404298b | ||
|
|
ab48082bb8 | ||
|
|
9094434c16 | ||
|
|
ddb971e41e | ||
|
|
a8b3befca9 | ||
|
|
e5bed62ca9 | ||
|
|
76b8a59f39 | ||
|
|
4dbe30bb2b | ||
|
|
adcfcaa1ef | ||
|
|
da32f0067a | ||
|
|
19be0c4560 | ||
|
|
f6e53746b2 | ||
|
|
9cd40b213d | ||
|
|
ed69eb5d7b | ||
|
|
ed95d5e933 | ||
|
|
53f3083b73 | ||
|
|
61df5ed809 | ||
|
|
7c1baa6cf1 | ||
|
|
800d4f6cc9 | ||
|
|
1ab45af036 | ||
|
|
e9b5e4d4d1 | ||
|
|
65aa4c29a4 | ||
|
|
e75b6f2d5b | ||
|
|
dbc758095f | ||
|
|
57a94e4a7d | ||
|
|
50526383f9 | ||
|
|
639b1dcac7 | ||
|
|
a984651888 | ||
|
|
a8befe5478 | ||
|
|
43ba732aad | ||
|
|
158068273e | ||
|
|
94a00dbdac | ||
|
|
fedc7e5ef5 | ||
|
|
78ff016def | ||
|
|
30d8324a0a | ||
|
|
de1fa34922 | ||
|
|
a74b9a5e80 | ||
|
|
79a199cbd3 | ||
|
|
2f2062c9e5 | ||
|
|
1dcace7a62 | ||
|
|
8f107b56b3 | ||
|
|
8c6afee7c9 | ||
|
|
d4982f3ed9 | ||
|
|
f2a785f2fc | ||
|
|
6fafcfae4e | ||
|
|
33e075f669 | ||
|
|
e5fc467c4e | ||
|
|
b7a5de49c6 | ||
|
|
3f145abd6f | ||
|
|
4612834870 | ||
|
|
83c5609fad | ||
|
|
d142056098 | ||
|
|
4d8ecf4191 | ||
|
|
af6c3f466d | ||
|
|
033a2d8674 | ||
|
|
9079788b2b | ||
|
|
44ddb2e480 | ||
|
|
295ba84071 | ||
|
|
8773250aab | ||
|
|
c5a4602fe1 | ||
|
|
5f4c43baf6 | ||
|
|
0ef3921e17 | ||
|
|
efcf0f772e | ||
|
|
ccabe847bb | ||
|
|
45ed63ffe3 | ||
|
|
7bebbe3a16 | ||
|
|
53ba1db79f | ||
|
|
76c306a122 | ||
|
|
89c2c163cb | ||
|
|
8826061266 | ||
|
|
e684877c94 | ||
|
|
12c8152901 | ||
|
|
8ba20bf4d2 | ||
|
|
0bc1ad09d1 | ||
|
|
231c79132a | ||
|
|
089803c599 | ||
|
|
4ea373aff6 | ||
|
|
0d94b8c742 | ||
|
|
d444f19043 | ||
|
|
87a0e73c96 | ||
|
|
b5922095f0 | ||
|
|
3fee29e9e9 | ||
|
|
4e351b3be8 | ||
|
|
3432b900df | ||
|
|
fb7c67f317 | ||
|
|
28d5a5c39a | ||
|
|
e2754511d9 | ||
|
|
71d179de76 | ||
|
|
08523852da | ||
|
|
3dd52942d2 | ||
|
|
bb24e45028 | ||
|
|
f8c72a6a0a | ||
|
|
fa246ff810 | ||
|
|
1a1d384a3e | ||
|
|
6d85c609fd | ||
|
|
e1b8dde60a | ||
|
|
e8d32eef4e | ||
|
|
ec0fa686a9 | ||
|
|
7604273c1a | ||
|
|
00db927ce7 | ||
|
|
9fea24f0f6 | ||
|
|
c903ce929f | ||
|
|
d48d9f85b3 | ||
|
|
5bdf7ba316 | ||
|
|
518c74736f | ||
|
|
223d2cf786 | ||
|
|
cfa2cff34a | ||
|
|
26eacfe795 | ||
|
|
b1b937ee31 | ||
|
|
122479158c | ||
|
|
0af5e9ec84 | ||
|
|
cb5414f789 | ||
|
|
224cb1b913 | ||
|
|
8bd84cc701 | ||
|
|
a14dcf8b3e | ||
|
|
a1a26bf8fe | ||
|
|
fea229c4ad | ||
|
|
7040d940ac | ||
|
|
a576d72335 | ||
|
|
5aab373d20 | ||
|
|
32f8160eb2 | ||
|
|
701355beb3 | ||
|
|
28de7c517b | ||
|
|
7365ca7a64 | ||
|
|
2a61813b67 | ||
|
|
85e9223603 | ||
|
|
943e2be676 | ||
|
|
2f09df7521 | ||
|
|
445e445e49 | ||
|
|
f20e4bd572 | ||
|
|
e731371ab1 | ||
|
|
5559693cb3 | ||
|
|
ca33c3b259 | ||
|
|
a78fa98b3d | ||
|
|
956dc82555 | ||
|
|
d30a824481 | ||
|
|
a643182eee | ||
|
|
e1dbc46d8d | ||
|
|
e33d8776bc | ||
|
|
f6d16883de | ||
|
|
51bdd3bbfd | ||
|
|
8f9ae78b8c | ||
|
|
584b7b8e45 | ||
|
|
f74e903f1f | ||
|
|
4cedf112f5 | ||
|
|
d607a8da0f | ||
|
|
84a12e28df | ||
|
|
54aa47d1a8 | ||
|
|
faaee4b945 | ||
|
|
0b46303f9f | ||
|
|
b98668bc60 | ||
|
|
947e8e9512 | ||
|
|
681918cb63 | ||
|
|
d0fae44430 | ||
|
|
3e752461e8 | ||
|
|
1a9e6f3b1a | ||
|
|
580275a8cf | ||
|
|
ee74771f16 | ||
|
|
81fa97d3ee | ||
|
|
ae8b94b2d7 | ||
|
|
7670d55f3c | ||
|
|
528ab4e203 | ||
|
|
cf1dc90137 | ||
|
|
f78fcc2b71 | ||
|
|
fb2d30f2c9 | ||
|
|
8781e7c6ad | ||
|
|
c34317b1e5 | ||
|
|
b09730b422 | ||
|
|
0f1725a7ab | ||
|
|
b12e0358d6 | ||
|
|
7ef841746a | ||
|
|
2b52b2379e | ||
|
|
8dd5965c44 | ||
|
|
b273082492 | ||
|
|
da088d88ba | ||
|
|
fd13570074 | ||
|
|
b5630a9dae | ||
|
|
0e2cab6409 | ||
|
|
38dc587318 | ||
|
|
6fbddcb7c2 | ||
|
|
df1df2964d | ||
|
|
9b9c2546c8 | ||
|
|
6ce0e72b33 | ||
|
|
a7784d7870 | ||
|
|
306ca3e04f | ||
|
|
82988b0e08 | ||
|
|
8b27d0e249 | ||
|
|
bfae547240 | ||
|
|
0abd026f78 | ||
|
|
3362a76de7 | ||
|
|
355b6c2e7d | ||
|
|
4e3c643e43 | ||
|
|
760cb97db4 | ||
|
|
0be6f7f57e | ||
|
|
d31223fa0c | ||
|
|
86ee9befc1 | ||
|
|
d5689b061f | ||
|
|
a3c4da4455 | ||
|
|
ee9f97f917 | ||
|
|
270c7377de | ||
|
|
9044b57306 | ||
|
|
9ad815a44a | ||
|
|
b7e432228b | ||
|
|
78da30f2ad | ||
|
|
aeea53017f | ||
|
|
f21ebfc366 | ||
|
|
2549aa5809 | ||
|
|
b733b70ad8 | ||
|
|
f9f59bd7c2 | ||
|
|
58933a6bcd | ||
|
|
45d7a29a95 | ||
|
|
e9d1fdb4ee | ||
|
|
2785ca9f31 | ||
|
|
12912a62aa | ||
|
|
2c2b078514 | ||
|
|
110294103f | ||
|
|
a9f3b839ec | ||
|
|
6bd677ad6f | ||
|
|
7d1c5f3510 | ||
|
|
a49508fd20 | ||
|
|
5870213ff0 | ||
|
|
65c3d7f925 | ||
|
|
33f4fd8fee | ||
|
|
9bdc34dc42 | ||
|
|
ff654df997 | ||
|
|
b7758da2f3 | ||
|
|
747089f1a8 | ||
|
|
9ee3021b76 | ||
|
|
0c60ea66e3 | ||
|
|
c3bb312b5f | ||
|
|
7447a42d40 | ||
|
|
3e9cc367af | ||
|
|
4c1790014f | ||
|
|
03fc7a579a | ||
|
|
a53db257cf | ||
|
|
b093cab493 | ||
|
|
9b484dc819 | ||
|
|
5ab26a9f8c | ||
|
|
b800a63bd2 | ||
|
|
43a5e47fb3 | ||
|
|
319545106e | ||
|
|
39b261b8a0 | ||
|
|
c9e61d1098 | ||
|
|
0bffdaa5fc | ||
|
|
9228510834 | ||
|
|
0b002a8946 | ||
|
|
ad43ddabe6 | ||
|
|
24c022a329 | ||
|
|
0e48cee0d6 | ||
|
|
4ad1794d95 | ||
|
|
46cf25b585 | ||
|
|
b3d78fc30f | ||
|
|
556bc06da4 | ||
|
|
7e8f9c463b | ||
|
|
568c7779b6 | ||
|
|
0a0d237f4d | ||
|
|
c243ccbdce | ||
|
|
64b79d6af5 | ||
|
|
016c0f3743 | ||
|
|
fd1599e0a7 | ||
|
|
7408aa6b72 | ||
|
|
e6b2107fa9 | ||
|
|
9aff52eaad | ||
|
|
bf5bda0f85 | ||
|
|
ffbf2d0a93 | ||
|
|
82f59ef5a2 | ||
|
|
c2c40abbb4 | ||
|
|
bb54d732d0 | ||
|
|
eee4e0c676 | ||
|
|
d9457ae017 | ||
|
|
bbc0b18b19 | ||
|
|
da7651311e | ||
|
|
72846f0817 | ||
|
|
05ef3387ab | ||
|
|
eed44e5737 | ||
|
|
27c7a85a21 | ||
|
|
4f6dd046ec | ||
|
|
89fad9ada7 | ||
|
|
bc31b49b99 | ||
|
|
09444e3624 | ||
|
|
7586243a95 | ||
|
|
1e1c7801e1 | ||
|
|
a363f6ef5f | ||
|
|
334e1fd2da | ||
|
|
2e8e29e93c | ||
|
|
5e5a1a3668 | ||
|
|
b93b464ebf | ||
|
|
842ba46a95 | ||
|
|
03b27d8e8f | ||
|
|
c11b41c6ba | ||
|
|
018cc526ee | ||
|
|
edf4508e6b | ||
|
|
d26a1f0312 | ||
|
|
2984f6a453 | ||
|
|
a00058d959 | ||
|
|
8e56a457f1 | ||
|
|
74d5f021cd | ||
|
|
a37715315d | ||
|
|
d9c9977610 | ||
|
|
c2f0cbb10a | ||
|
|
a34d00d822 | ||
|
|
9924ec6963 | ||
|
|
9036201887 | ||
|
|
b2435d2430 | ||
|
|
afd6148770 | ||
|
|
b70b58a35a | ||
|
|
df963c2780 | ||
|
|
1b732c76e6 | ||
|
|
f9489b0173 | ||
|
|
18942c55ae | ||
|
|
bf34b2f1ca | ||
|
|
a717a021c2 | ||
|
|
dcf718d592 | ||
|
|
f5eeb2b839 | ||
|
|
bc435adc11 | ||
|
|
aeb8e82cbd | ||
|
|
5cb2ed3ccd | ||
|
|
93b1864d1b | ||
|
|
a6efffda45 | ||
|
|
c89d6f1a58 | ||
|
|
d4f16abfac | ||
|
|
8529f3f355 | ||
|
|
2eb136827d | ||
|
|
9594e6eb32 | ||
|
|
9e8111994a | ||
|
|
af0c2b7129 | ||
|
|
96b73a0cef | ||
|
|
6c290ee2d3 | ||
|
|
ca53e3de3a | ||
|
|
6ea3ec700a | ||
|
|
fe3355e08e | ||
|
|
43da95b4a5 | ||
|
|
3d93a63caa | ||
|
|
9550607da3 | ||
|
|
d5d9798913 | ||
|
|
6cfe08235f | ||
|
|
49eb850ff1 | ||
|
|
5a558583d2 | ||
|
|
1e5f0d0555 | ||
|
|
c58caeda4c | ||
|
|
26fc56f2b8 | ||
|
|
6a9e7aa89d | ||
|
|
b6c3b0cdc3 | ||
|
|
5ae91ac620 | ||
|
|
70265c55ef | ||
|
|
7c3b5fc31e | ||
|
|
a9a830caa2 | ||
|
|
b49ff3d4ed | ||
|
|
42310fa170 | ||
|
|
bfff1d9e2f | ||
|
|
2c98777b9f | ||
|
|
4a91260a31 | ||
|
|
076971bcae | ||
|
|
01fcc9bcab | ||
|
|
348877c7cd | ||
|
|
478f26e75a | ||
|
|
57cc558b9b | ||
|
|
20b1f8eff8 | ||
|
|
f0a7990404 | ||
|
|
27f53ff4a6 | ||
|
|
9ec5dfc8b1 | ||
|
|
e4c1e414c8 | ||
|
|
a391650472 | ||
|
|
3cfde2b40d | ||
|
|
8bf1ed33dc | ||
|
|
422b3be0c5 | ||
|
|
c34e44c4ec | ||
|
|
a2b20eca67 | ||
|
|
d41c316bfb | ||
|
|
ca1d8aab84 | ||
|
|
32e3dcff7c | ||
|
|
9a23470622 | ||
|
|
c37a186802 | ||
|
|
84c17e3b22 | ||
|
|
64e0fca124 | ||
|
|
5c6537fd7a | ||
|
|
764a82df00 | ||
|
|
e904911fd9 | ||
|
|
a7494f72f6 | ||
|
|
b6b53b028d | ||
|
|
1743ce714a | ||
|
|
656f0c5d11 | ||
|
|
d80aebe1f4 | ||
|
|
ad48bc1962 | ||
|
|
d72fbb7098 | ||
|
|
95d5eaa09b | ||
|
|
b997a6159e | ||
|
|
1cd8b7a450 | ||
|
|
c5a8eb4261 | ||
|
|
8891c29cbd | ||
|
|
2facdfa1dd | ||
|
|
65c9fa0c21 | ||
|
|
e53c85dbaf | ||
|
|
3a231e8e61 | ||
|
|
4dc7776387 | ||
|
|
5ca043e0f1 | ||
|
|
9ef052c814 | ||
|
|
6d1690beaa | ||
|
|
171656e5be | ||
|
|
385e7f4871 | ||
|
|
89c5485784 | ||
|
|
02d191ec28 | ||
|
|
47c3090f3a | ||
|
|
476dac1ac1 | ||
|
|
8ca0d0ced4 | ||
|
|
ab197489d7 | ||
|
|
99736d187b | ||
|
|
197c09bd0d | ||
|
|
6cc634ba1f | ||
|
|
4c89ad91d2 | ||
|
|
d66233bce0 | ||
|
|
b485e6927e | ||
|
|
74b9e8bd7b | ||
|
|
545742ecc0 | ||
|
|
d9f1f65352 | ||
|
|
0904d17a5f | ||
|
|
87171b4246 | ||
|
|
78f8b56203 | ||
|
|
c160c5a555 | ||
|
|
31c7bf5348 | ||
|
|
6eadf718fc | ||
|
|
effced24d1 | ||
|
|
09f399db9a | ||
|
|
2b73f6faea | ||
|
|
943662605e | ||
|
|
9a04962bd6 | ||
|
|
c371f6bbb5 | ||
|
|
8324e2e454 | ||
|
|
30307c1b56 | ||
|
|
f139d0d2a8 | ||
|
|
33843764a7 | ||
|
|
aca7d7c571 | ||
|
|
bff72f609c | ||
|
|
adb03b7420 | ||
|
|
2094e18b60 | ||
|
|
541d8ddd40 |
+3
-7
@@ -1,11 +1,4 @@
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
|
||||
|
||||
|
||||
# 체섭 ignore
|
||||
*.log
|
||||
@@ -16,6 +9,7 @@ d_log/*.zip
|
||||
sess_*
|
||||
*/logs/*.txt
|
||||
*/logs/*/*.txt
|
||||
*/logs/preserved
|
||||
err.txt
|
||||
che/.htaccess
|
||||
kwe/.htaccess
|
||||
@@ -28,6 +22,7 @@ d_shared
|
||||
d_pic/*.jpg
|
||||
d_pic/*.gif
|
||||
d_pic/*.png
|
||||
d_pic/uploaded_image
|
||||
|
||||
d_setting/*.php
|
||||
*/d_setting/*.php
|
||||
@@ -46,3 +41,4 @@ test.php
|
||||
phpinfo.php
|
||||
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
|
||||
*.sqlite3
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Hide_D, 62che
|
||||
Copyright (c) 2020 Hide_D, 62che
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -9,16 +9,23 @@
|
||||
* <code>mpm_event</code> 권장
|
||||
* PHP 7.2 이상
|
||||
* <code>php-fpm</code> 권장
|
||||
* php에서 curl을 실행가능해야 합니다.
|
||||
* MySQL 5.6 이상, 또는 MariaDB 10.0 이상
|
||||
* php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원)
|
||||
* mysqlnd가 지원되어야합니다. (기본값: 지원)
|
||||
* mysqli
|
||||
* gd
|
||||
* MariaDB 10.2.1 이상
|
||||
* 현재 MySQL은 지원하지 않습니다.
|
||||
* <code>git</code>
|
||||
* <code>curl</code>
|
||||
|
||||
Linux는 Ubuntu 16.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
|
||||
Linux는 Ubuntu 16.04, 18.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
|
||||
|
||||
Docker를 이용한 설치는 계획중입니다.
|
||||
|
||||
## 설치
|
||||
## Docker를 이용한 설치
|
||||
|
||||
https://storage.hided.net/gogs/devsam/docker 를 참고해 주세요.
|
||||
|
||||
## 수동 설치
|
||||
|
||||
본 게임은 <code>git</code>을 이용한 업그레이드 시스템을 구현하였으므로, <code>git</code>이 필요합니다.
|
||||
또한 웹 서비스 데몬을 운영중인 사용자(일반적으로 <code>www-data</code>, <code>apache</code>)에게 디렉토리 권한이 주어져야합니다.
|
||||
@@ -28,11 +35,11 @@ Docker를 이용한 설치는 계획중입니다.
|
||||
웹 데몬 user가 <code>www-data</code>인 경우 다음과 같이 입력하여 최신 배포버전과 이미지 파일을 얻을 수 있습니다.
|
||||
|
||||
```
|
||||
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
|
||||
sudo -u www-data git clone https://storage.hided.net/gogs/devsam/core.git
|
||||
sudo -u www-data git clone https://storage.hided.net/gogs/devsam/image.git
|
||||
```
|
||||
|
||||
> 이미지는 git hook을 이용한 업데이트 기능을 제공하지만 아직 범용성 있는 설계가 되어있진 않습니다.
|
||||
> 이미지는 hook/git_hook.php을 통해 동기화되며, 서버 설치 과정에 이미지 갱신 키를 지정하는 것으로 '훼' 서버 업데이트 시 동기화됩니다. 이미지 서버가 게임 서버와 별개여도 동작하나, php와 git을 지원해야합니다.
|
||||
|
||||
### 설치
|
||||
|
||||
@@ -45,9 +52,9 @@ Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의
|
||||
|
||||
## 카카오로그인 연동
|
||||
|
||||
현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
|
||||
서버 설치 시 카카오 로그인 연동을 위한 API KEY를 입력받습니다.
|
||||
|
||||
<code>f_install/templates/KakaoKey.orig.php</code> 를 <code>d_setting/KakaoKey.php</code>로 복사한 후 API 키를 입력하여야 합니다.
|
||||
만약 설치 이후 API KEY를 변경하고자 하는 경우 <code>d_setting/KakaoKey.php</code>에서 API키를 변경해야 합니다.
|
||||
|
||||
|
||||
## 라이선스
|
||||
|
||||
+6
-1
@@ -6,12 +6,17 @@
|
||||
"GPL-2.0-or-later",
|
||||
"proprietary"
|
||||
],
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.3"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"brandonwamboldt/utilphp": "^1.1",
|
||||
"sergeytsalkov/meekrodb": "^2.3",
|
||||
"league/plates": "^3.3",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"leafo/scssphp": "^0.7.5",
|
||||
"scssphp/scssphp": "^1.0",
|
||||
"monolog/monolog": "^1.23",
|
||||
"firephp/firephp-core": "^0.4.0",
|
||||
"vlucas/valitron": "^1.4",
|
||||
|
||||
Generated
+200
-123
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "3fceaf3c2925068c7e757ab12036e29e",
|
||||
"content-hash": "b5b5695ed0b1b04fa672f99972d8caad",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brandonwamboldt/utilphp",
|
||||
@@ -54,16 +54,16 @@
|
||||
},
|
||||
{
|
||||
"name": "catfan/medoo",
|
||||
"version": "v1.5.7",
|
||||
"version": "v1.7.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/catfan/Medoo.git",
|
||||
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf"
|
||||
"reference": "dd9d570584cfb1e09ec470608479b86e41d5b60d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/catfan/Medoo/zipball/8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||
"url": "https://api.github.com/repos/catfan/Medoo/zipball/dd9d570584cfb1e09ec470608479b86e41d5b60d",
|
||||
"reference": "dd9d570584cfb1e09ec470608479b86e41d5b60d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -77,7 +77,7 @@
|
||||
"ext-pdo_oci8": "For Oracle version 8 database",
|
||||
"ext-pdo_pqsql": "For PostgreSQL database",
|
||||
"ext-pdo_sqlite": "For SQLite database",
|
||||
"ext-pdo_sqlsrv": "For MSSQL database"
|
||||
"ext-pdo_sqlsrv": "For MSSQL database on both Window/Liunx platform"
|
||||
},
|
||||
"type": "framework",
|
||||
"autoload": {
|
||||
@@ -95,10 +95,11 @@
|
||||
"email": "angel@catfan.me"
|
||||
}
|
||||
],
|
||||
"description": "The lightest PHP database framework to accelerate development",
|
||||
"description": "The lightweight PHP database framework to accelerate development",
|
||||
"homepage": "https://medoo.in",
|
||||
"keywords": [
|
||||
"database",
|
||||
"database library",
|
||||
"lightweight",
|
||||
"mariadb",
|
||||
"mssql",
|
||||
@@ -109,27 +110,27 @@
|
||||
"sql",
|
||||
"sqlite"
|
||||
],
|
||||
"time": "2018-06-14T18:59:08+00:00"
|
||||
"time": "2019-12-19T05:04:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ezyang/htmlpurifier",
|
||||
"version": "v4.10.0",
|
||||
"version": "v4.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ezyang/htmlpurifier.git",
|
||||
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
|
||||
"reference": "a617e55bc62a87eec73bd456d146d134ad716f03"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
|
||||
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
|
||||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/a617e55bc62a87eec73bd456d146d134ad716f03",
|
||||
"reference": "a617e55bc62a87eec73bd456d146d134ad716f03",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"simpletest/simpletest": "^1.1"
|
||||
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -142,7 +143,7 @@
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
"LGPL-2.1-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
@@ -156,7 +157,7 @@
|
||||
"keywords": [
|
||||
"html"
|
||||
],
|
||||
"time": "2018-02-23T01:58:20+00:00"
|
||||
"time": "2019-10-28T03:44:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firephp/firephp-core",
|
||||
@@ -196,44 +197,46 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.3.3",
|
||||
"version": "6.5.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
|
||||
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
|
||||
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
|
||||
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.4",
|
||||
"guzzlehttp/psr7": "^1.6.1",
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-curl": "*",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
||||
"psr/log": "^1.0"
|
||||
"psr/log": "^1.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
||||
"psr/log": "Required for using the Log middleware"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.3-dev"
|
||||
"dev-master": "6.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\": "src/"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -257,7 +260,7 @@
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2018-04-22T15:46:56+00:00"
|
||||
"time": "2019-12-23T11:57:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@@ -312,32 +315,37 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "1.4.2",
|
||||
"version": "1.6.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
|
||||
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
|
||||
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0",
|
||||
"psr/http-message": "~1.0"
|
||||
"psr/http-message": "~1.0",
|
||||
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-message-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
"ext-zlib": "*",
|
||||
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
||||
},
|
||||
"suggest": {
|
||||
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.4-dev"
|
||||
"dev-master": "1.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -367,65 +375,14 @@
|
||||
"keywords": [
|
||||
"http",
|
||||
"message",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response",
|
||||
"stream",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2017-03-20T17:10:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "leafo/scssphp",
|
||||
"version": "v0.7.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/leafo/scssphp.git",
|
||||
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.6",
|
||||
"squizlabs/php_codesniffer": "~2.5"
|
||||
},
|
||||
"bin": [
|
||||
"bin/pscss"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Leafo\\ScssPhp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Leaf Corcoran",
|
||||
"email": "leafot@gmail.com",
|
||||
"homepage": "http://leafo.net"
|
||||
}
|
||||
],
|
||||
"description": "scssphp is a compiler for SCSS written in PHP.",
|
||||
"homepage": "http://leafo.github.io/scssphp/",
|
||||
"keywords": [
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss",
|
||||
"stylesheet"
|
||||
],
|
||||
"time": "2018-07-22T01:22:08+00:00"
|
||||
"time": "2019-07-01T23:21:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/plates",
|
||||
@@ -484,16 +441,16 @@
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.23.0",
|
||||
"version": "1.25.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4"
|
||||
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4",
|
||||
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fa82921994db851a8becaf3787a9e73c5976b6f1",
|
||||
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -558,7 +515,7 @@
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2017-06-19T01:22:40+00:00"
|
||||
"time": "2019-12-20T14:15:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pguardiario/phpuri",
|
||||
@@ -720,16 +677,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -738,7 +695,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -763,7 +720,108 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-10-10T12:19:37+00:00"
|
||||
"time": "2019-11-01T11:05:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ralouphie/getallheaders",
|
||||
"version": "3.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ralouphie/getallheaders.git",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
||||
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-coveralls/php-coveralls": "^2.1",
|
||||
"phpunit/phpunit": "^5 || ^6.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/getallheaders.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ralph Khattar",
|
||||
"email": "ralph.khattar@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A polyfill for getallheaders.",
|
||||
"time": "2019-03-08T08:55:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "scssphp/scssphp",
|
||||
"version": "1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/scssphp/scssphp.git",
|
||||
"reference": "5b3c9d704950d8f9637f5110c36c281ec47dc13c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/5b3c9d704950d8f9637f5110c36c281ec47dc13c",
|
||||
"reference": "5b3c9d704950d8f9637f5110c36c281ec47dc13c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-ctype": "*",
|
||||
"ext-json": "*",
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3",
|
||||
"squizlabs/php_codesniffer": "~2.5",
|
||||
"twbs/bootstrap": "~4.3",
|
||||
"zurb/foundation": "~6.5"
|
||||
},
|
||||
"bin": [
|
||||
"bin/pscss"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ScssPhp\\ScssPhp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anthon Pang",
|
||||
"email": "apang@softwaredevelopment.ca",
|
||||
"homepage": "https://github.com/robocoder"
|
||||
},
|
||||
{
|
||||
"name": "Cédric Morin",
|
||||
"email": "cedric@yterium.com",
|
||||
"homepage": "https://github.com/Cerdic"
|
||||
}
|
||||
],
|
||||
"description": "scssphp is a compiler for SCSS written in PHP.",
|
||||
"homepage": "http://scssphp.github.io/scssphp/",
|
||||
"keywords": [
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss",
|
||||
"stylesheet"
|
||||
],
|
||||
"time": "2019-12-12T05:00:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sergeytsalkov/meekrodb",
|
||||
@@ -810,29 +868,34 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/lock",
|
||||
"version": "v4.1.1",
|
||||
"version": "v4.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/lock.git",
|
||||
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976"
|
||||
"reference": "6c4f5b620871cfef5b004fc57f2ca74572ae03b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||
"url": "https://api.github.com/repos/symfony/lock/zipball/6c4f5b620871cfef5b004fc57f2ca74572ae03b3",
|
||||
"reference": "6c4f5b620871cfef5b004fc57f2ca74572ae03b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/dbal": "<2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "~2.5",
|
||||
"mongodb/mongodb": "~1.1",
|
||||
"predis/predis": "~1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -848,13 +911,13 @@
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Jérémy Derussé",
|
||||
"email": "jeremy@derusse.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Lock Component",
|
||||
@@ -867,20 +930,20 @@
|
||||
"redlock",
|
||||
"semaphore"
|
||||
],
|
||||
"time": "2018-06-21T11:15:46+00:00"
|
||||
"time": "2020-01-04T13:00:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/valitron",
|
||||
"version": "v1.4.3",
|
||||
"version": "v1.4.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vlucas/valitron.git",
|
||||
"reference": "3c5463315bfa23b17f8949b100a960d035234e43"
|
||||
"reference": "a03072bed1679660200766d134507a30193eaf6d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vlucas/valitron/zipball/3c5463315bfa23b17f8949b100a960d035234e43",
|
||||
"reference": "3c5463315bfa23b17f8949b100a960d035234e43",
|
||||
"url": "https://api.github.com/repos/vlucas/valitron/zipball/a03072bed1679660200766d134507a30193eaf6d",
|
||||
"reference": "a03072bed1679660200766d134507a30193eaf6d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -916,28 +979,29 @@
|
||||
"validation",
|
||||
"validator"
|
||||
],
|
||||
"time": "2018-05-06T10:45:26+00:00"
|
||||
"time": "2019-08-29T19:49:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "xemlock/htmlpurifier-html5",
|
||||
"version": "v0.1.7",
|
||||
"version": "v0.1.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/xemlock/htmlpurifier-html5.git",
|
||||
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359"
|
||||
"reference": "f0d563f9fd4a82a3d759043483f9a94c0d8c2255"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/xemlock/htmlpurifier-html5/zipball/b4b35e51ec75e0207c23035f7d9a354bdcdac359",
|
||||
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359",
|
||||
"url": "https://api.github.com/repos/xemlock/htmlpurifier-html5/zipball/f0d563f9fd4a82a3d759043483f9a94c0d8c2255",
|
||||
"reference": "f0d563f9fd4a82a3d759043483f9a94c0d8c2255",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ezyang/htmlpurifier": "^4.7",
|
||||
"ezyang/htmlpurifier": "^4.8",
|
||||
"php": ">=5.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.7.*|5.7.*"
|
||||
"php-coveralls/php-coveralls": "^1.1|^2.1",
|
||||
"phpunit/phpunit": ">=4.7 <8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -955,8 +1019,18 @@
|
||||
"email": "xemlock@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "HTML Purifier definitions for HTML5 elements",
|
||||
"time": "2018-06-07T14:30:17+00:00"
|
||||
"description": "HTML5 element definitions for HTML Purifier",
|
||||
"keywords": [
|
||||
"HTML5",
|
||||
"Purifier",
|
||||
"html",
|
||||
"htmlpurifier",
|
||||
"security",
|
||||
"tidy",
|
||||
"validator",
|
||||
"xss"
|
||||
],
|
||||
"time": "2019-08-07T17:19:21+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@@ -966,5 +1040,8 @@
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
"platform-dev": [],
|
||||
"platform-overrides": {
|
||||
"php": "7.3"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -164,4 +164,19 @@ a.samButton.disabled {
|
||||
|
||||
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
|
||||
content:'】'
|
||||
}
|
||||
|
||||
.tooltip_copyable_info .tooltiptext{
|
||||
display: inline;
|
||||
color: rgba(0,0,0,0);
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.tooltiptext {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden_but_copyable{
|
||||
color: rgba(0,0,0,0);
|
||||
font-size: 0;
|
||||
}
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -0,0 +1 @@
|
||||
"use strict";!function(t,r){var n=function(t){function r(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function n(t){return t.replace(/"/g,""")}function e(t){if(!t)return"";var r=[];for(var e in t){var i=t[e]+"";r.push(e+'="'+n(i)+'"')}return r.join(" ")}function i(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i=new a(i);for(var f=o(t),u=[],c=0;c<f.length;c++){var p=f[c];if("nl"===p.type&&i.nl2br)u.push("<br>\n");else if(p.isLink&&i.check(p)){var l=i.resolve(p),s=l.formatted,g=l.formattedHref,y=l.tagName,h=l.className,v=l.target,k=l.attributes,S="<"+y+' href="'+n(g)+'"';h&&(S+=' class="'+n(h)+'"'),v&&(S+=' target="'+n(v)+'"'),k&&(S+=" "+e(k)),S+=">"+r(s)+"</"+y+">",u.push(S)}else u.push(r(p.toString()))}return u.join("")}var o=t.tokenize,f=t.options,a=f.Options;if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{a:function(){},get:function(){return function(t){return i(this,t)}}})}catch(u){String.prototype.linkify||(String.prototype.linkify=function(t){return i(this,t)})}return i}(r);t.linkifyStr=n}(window,linkify);
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
||||
|
||||
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
|
||||
Vendored
+188
@@ -0,0 +1,188 @@
|
||||
/* select2-bootstrap4 with Darkly */
|
||||
.select2-container--bootstrap4 { color: black; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; outline: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection.form-control { border-radius: 0.25rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search__field { outline: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search__field::-webkit-input-placeholder { color: #6c757d; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search__field:-moz-placeholder { color: #6c757d; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search__field::-moz-placeholder { color: #6c757d; opacity: 1; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-search__field:-ms-input-placeholder { color: #6c757d; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option { padding: 0.75rem 0.375rem; font-size: 1rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option[role=group] { padding: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option[aria-disabled=true] { color: #6c757d; cursor: not-allowed; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option[aria-selected=true] { background-color: #f8f9fa; color: #16181b; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] { background-color: #007bff; color: #fff; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option { padding: 0.75rem 0.375rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.375rem; padding-left: 0.75rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.75rem; padding-left: 1.125rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.125rem; padding-left: 1.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.5rem; padding-left: 1.875rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.875rem; padding-left: 2.25rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results__group { color: #6c757d; display: block; padding: 0.75rem 0.375rem; font-size: 75%; line-height: 1; white-space: nowrap; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; border-color: #80bdff; }
|
||||
|
||||
@media screen and (prefers-reduced-motion: reduce) { .select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: none; } }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--open .select2-selection .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.25rem 0.25rem 0.25rem; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--open.select2-container--below .select2-selection { border-bottom-right-radius: 0; border-bottom-left-radius: 0; border-bottom-color: transparent; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--open.select2-container--above .select2-selection { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection__clear { color: #6c757d; cursor: pointer; float: right; font-weight: bold; margin-right: 10px; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection__clear:hover { color: #343a40; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--disabled .select2-selection { border-color: #ced4da; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-search__field { cursor: not-allowed; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice { background-color: #e9ecef; }
|
||||
|
||||
.select2-container--bootstrap4.select2-container--disabled .select2-selection__clear, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove { display: none; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-dropdown { border-color: #80bdff; border-width: 1px; overflow-x: hidden; margin-top: -1px; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-dropdown--above { margin-top: 1px; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single { height: calc(2.25rem + 2px); line-height: 1; padding: 0.75rem 1.125rem 0.75rem 0.375rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { position: absolute; bottom: 0; right: 0.375rem; top: 0; width: 0.25rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-color: #6c757d transparent transparent transparent; border-style: solid; border-width: 0.25rem 0.25rem 0 0.25rem; height: 0; left: 0; margin-left: -0.25rem; margin-top: -0.125rem; position: absolute; top: 50%; width: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered { color: #495057; padding: 0; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder { color: #6c757d; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.25rem + 2px); padding: 0; height: auto; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; display: block; line-height: 1; list-style: none; margin: 0; overflow: hidden; padding: 0.75rem 0.375rem 0 0.75rem; width: 100%; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder { color: #6c757d; float: left; margin-top: 5px; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { color: #495057; background: transparent; border: 1px solid #343a40; border-radius: 0.25rem; cursor: default; float: left; margin: -0.25rem 0 0 0.1875rem; padding: 0 0.75rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { background: transparent; padding: 0 0.375rem; height: calc(2.25rem + 2px)-2; line-height: 1; margin-top: 0; min-width: 5em; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove { color: #6c757d; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 0.375rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover { color: #343a40; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.75rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--single, .form-group-sm .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.2rem; font-size: 75%; height: calc(1.8125rem + 2px); line-height: 1; padding: 0.5rem 1rem 0.5rem 0.25rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.input-sm .select2-selection__arrow b, .input-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { margin-left: -0.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(1.8125rem + 2px); border-radius: 0.2rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__rendered, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { padding: 0.5rem 0.25rem 0 0.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__choice, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 75%; line-height: 1; margin: 0 0 0 0.125rem; padding: 0 0.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-search--inline .select2-search__field, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.25rem; font-size: 75%; height: calc(1.8125rem + 2px)-2; line-height: 1; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__clear, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--single, .form-group-lg .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.3rem; font-size: 1.25rem; height: calc(2.875rem + 2px); line-height: 1; padding: 1rem 1.4375rem 1rem 0.5rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { width: 0.3125rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow b, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-width: 0.3125rem 0.3125rem 0 0.3125rem; margin-left: -0.3125rem; margin-left: -1rem; margin-top: -0.15625rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.875rem + 2px); border-radius: 0.3rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__choice, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 1.25rem; line-height: 1; border-radius: 0.25rem; margin: 0rem 0 0 0.25rem; padding: 0 1rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-search--inline .select2-search__field, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.5rem; font-size: 1.25rem; height: calc(2.875rem + 2px)-2; line-height: 1; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__clear, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 1rem; }
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection.input-lg.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
|
||||
|
||||
.input-group-lg .select2-container--bootstrap4 .select2-selection.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single { padding-left: 1.125rem; padding-right: 0.375rem; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 0; padding-left: 0; text-align: right; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 0.375rem; right: auto; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow b { margin-left: 0; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 0; margin-right: 0.1875rem; }
|
||||
|
||||
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; }
|
||||
|
||||
.has-warning .select2-dropdown, .has-warning .select2-selection { border-color: #ffc107; }
|
||||
|
||||
.has-warning .select2-container--focus .select2-selection, .has-warning .select2-container--open .select2-selection { border-color: #d39e00; }
|
||||
|
||||
.has-warning.select2-drop-active { border-color: #d39e00; }
|
||||
|
||||
.has-warning.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #d39e00; }
|
||||
|
||||
.has-error .select2-dropdown, .has-error .select2-selection { border-color: #dc3545; }
|
||||
|
||||
.has-error .select2-container--focus .select2-selection, .has-error .select2-container--open .select2-selection { border-color: #bd2130; }
|
||||
|
||||
.has-error.select2-drop-active { border-color: #bd2130; }
|
||||
|
||||
.has-error.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #bd2130; }
|
||||
|
||||
.has-success .select2-dropdown, .has-success .select2-selection { border-color: #28a745; }
|
||||
|
||||
.has-success .select2-container--focus .select2-selection, .has-success .select2-container--open .select2-selection { border-color: #1e7e34; }
|
||||
|
||||
.has-success.select2-drop-active { border-color: #1e7e34; }
|
||||
|
||||
.has-success.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #1e7e34; }
|
||||
|
||||
.input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection, .input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection.form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
|
||||
|
||||
.input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection.form-control { border-radius: 0; }
|
||||
|
||||
.input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection.form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
|
||||
|
||||
.input-group > .select2-container--bootstrap4 { display: table; table-layout: fixed; position: relative; z-index: 2; width: 100%; margin-bottom: 0; }
|
||||
|
||||
.input-group > .select2-container--bootstrap4 > .selection > .select2-selection.form-control { float: none; }
|
||||
|
||||
.input-group > .select2-container--bootstrap4.select2-container--open, .input-group > .select2-container--bootstrap4.select2-container--focus { z-index: 3; }
|
||||
|
||||
.input-group > .select2-container--bootstrap4, .input-group > .select2-container--bootstrap4 .input-group-btn, .input-group > .select2-container--bootstrap4 .input-group-btn .btn { vertical-align: top; }
|
||||
|
||||
.form-control.select2-hidden-accessible { position: absolute !important; width: 1px !important; }
|
||||
|
||||
@media (min-width: 576px) { .form-inline .select2-container--bootstrap4 { display: inline-block; } }
|
||||
Vendored
+484
@@ -0,0 +1,484 @@
|
||||
.select2-container {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
vertical-align: middle; }
|
||||
.select2-container .select2-selection--single {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 28px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-container .select2-selection--single .select2-selection__rendered {
|
||||
display: block;
|
||||
padding-left: 8px;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap; }
|
||||
.select2-container .select2-selection--single .select2-selection__clear {
|
||||
position: relative; }
|
||||
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
||||
padding-right: 8px;
|
||||
padding-left: 20px; }
|
||||
.select2-container .select2-selection--multiple {
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
min-height: 32px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding-left: 8px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap; }
|
||||
.select2-container .select2-search--inline {
|
||||
float: left; }
|
||||
.select2-container .select2-search--inline .select2-search__field {
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
font-size: 100%;
|
||||
margin-top: 5px;
|
||||
padding: 0; }
|
||||
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none; }
|
||||
|
||||
.select2-dropdown {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: -100000px;
|
||||
width: 100%;
|
||||
z-index: 1051; }
|
||||
|
||||
.select2-results {
|
||||
display: block; }
|
||||
|
||||
.select2-results__options {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
|
||||
.select2-results__option {
|
||||
padding: 6px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none; }
|
||||
.select2-results__option[aria-selected] {
|
||||
cursor: pointer; }
|
||||
|
||||
.select2-container--open .select2-dropdown {
|
||||
left: 0; }
|
||||
|
||||
.select2-container--open .select2-dropdown--above {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--open .select2-dropdown--below {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-search--dropdown {
|
||||
display: block;
|
||||
padding: 4px; }
|
||||
.select2-search--dropdown .select2-search__field {
|
||||
padding: 4px;
|
||||
width: 100%;
|
||||
box-sizing: border-box; }
|
||||
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none; }
|
||||
.select2-search--dropdown.select2-search--hide {
|
||||
display: none; }
|
||||
|
||||
.select2-close-mask {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
min-width: 100%;
|
||||
height: auto;
|
||||
width: auto;
|
||||
opacity: 0;
|
||||
z-index: 99;
|
||||
background-color: #fff;
|
||||
filter: alpha(opacity=0); }
|
||||
|
||||
.select2-hidden-accessible {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important; }
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 28px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
||||
color: #999; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 26px;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
width: 20px; }
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: #888 transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 0; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
||||
float: left; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
||||
left: 1px;
|
||||
right: auto; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single {
|
||||
background-color: #eee;
|
||||
cursor: default; }
|
||||
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
|
||||
display: none; }
|
||||
|
||||
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: transparent transparent #888 transparent;
|
||||
border-width: 0 4px 5px 4px; }
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: text; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
width: 100%; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
||||
list-style: none; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
|
||||
color: #999;
|
||||
margin-top: 5px;
|
||||
float: left; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin-top: 5px;
|
||||
margin-right: 10px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #e4e4e4;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
padding: 0 5px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin-right: 2px; }
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #333; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
||||
float: right; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
margin-left: 5px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
||||
margin-left: 2px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: solid black 1px;
|
||||
outline: 0; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
||||
background-color: #eee;
|
||||
cursor: default; }
|
||||
|
||||
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
||||
display: none; }
|
||||
|
||||
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid #aaa; }
|
||||
|
||||
.select2-container--default .select2-search--inline .select2-search__field {
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: 0;
|
||||
box-shadow: none;
|
||||
-webkit-appearance: textfield; }
|
||||
|
||||
.select2-container--default .select2-results > .select2-results__options {
|
||||
max-height: 200px;
|
||||
overflow-y: auto; }
|
||||
|
||||
.select2-container--default .select2-results__option[role=group] {
|
||||
padding: 0; }
|
||||
|
||||
.select2-container--default .select2-results__option[aria-disabled=true] {
|
||||
color: #999; }
|
||||
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background-color: #ddd; }
|
||||
|
||||
.select2-container--default .select2-results__option .select2-results__option {
|
||||
padding-left: 1em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
|
||||
padding-left: 0; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -1em;
|
||||
padding-left: 2em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -2em;
|
||||
padding-left: 3em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -3em;
|
||||
padding-left: 4em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -4em;
|
||||
padding-left: 5em; }
|
||||
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
||||
margin-left: -5em;
|
||||
padding-left: 6em; }
|
||||
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #5897fb;
|
||||
color: white; }
|
||||
|
||||
.select2-container--default .select2-results__group {
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 6px; }
|
||||
|
||||
.select2-container--classic .select2-selection--single {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
outline: 0;
|
||||
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
||||
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
||||
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
||||
.select2-container--classic .select2-selection--single:focus {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__rendered {
|
||||
color: #444;
|
||||
line-height: 28px; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin-right: 10px; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
|
||||
color: #999; }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__arrow {
|
||||
background-color: #ddd;
|
||||
border: none;
|
||||
border-left: 1px solid #aaa;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
height: 26px;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 1px;
|
||||
width: 20px;
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
||||
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
|
||||
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: #888 transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 0; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
||||
float: left; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
||||
border: none;
|
||||
border-right: 1px solid #aaa;
|
||||
border-radius: 0;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
left: 1px;
|
||||
right: auto; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-selection--single {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
|
||||
background: transparent;
|
||||
border: none; }
|
||||
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: transparent transparent #888 transparent;
|
||||
border-width: 0 4px 5px 4px; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
||||
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
|
||||
|
||||
.select2-container--classic .select2-selection--multiple {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: text;
|
||||
outline: 0; }
|
||||
.select2-container--classic .select2-selection--multiple:focus {
|
||||
border: 1px solid #5897fb; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 5px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
|
||||
display: none; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #e4e4e4;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
padding: 0 5px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
|
||||
color: #888;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin-right: 2px; }
|
||||
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #555; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
float: right; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
||||
margin-left: 5px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
||||
margin-left: 2px;
|
||||
margin-right: auto; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
||||
border: 1px solid #5897fb; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
||||
border-top: none;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0; }
|
||||
|
||||
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
||||
border-bottom: none;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0; }
|
||||
|
||||
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid #aaa;
|
||||
outline: 0; }
|
||||
|
||||
.select2-container--classic .select2-search--inline .select2-search__field {
|
||||
outline: 0;
|
||||
box-shadow: none; }
|
||||
|
||||
.select2-container--classic .select2-dropdown {
|
||||
background-color: white;
|
||||
border: 1px solid transparent; }
|
||||
|
||||
.select2-container--classic .select2-dropdown--above {
|
||||
border-bottom: none; }
|
||||
|
||||
.select2-container--classic .select2-dropdown--below {
|
||||
border-top: none; }
|
||||
|
||||
.select2-container--classic .select2-results > .select2-results__options {
|
||||
max-height: 200px;
|
||||
overflow-y: auto; }
|
||||
|
||||
.select2-container--classic .select2-results__option[role=group] {
|
||||
padding: 0; }
|
||||
|
||||
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
||||
color: grey; }
|
||||
|
||||
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #3875d7;
|
||||
color: white; }
|
||||
|
||||
.select2-container--classic .select2-results__group {
|
||||
cursor: default;
|
||||
display: block;
|
||||
padding: 6px; }
|
||||
|
||||
.select2-container--classic.select2-container--open .select2-dropdown {
|
||||
border-color: #5897fb; }
|
||||
Vendored
+6457
File diff suppressed because it is too large
Load Diff
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+5746
File diff suppressed because it is too large
Load Diff
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
@@ -0,0 +1,153 @@
|
||||
/* Forked from https://github.com/asiffermann/summernote-image-title */
|
||||
|
||||
(function (factory) {
|
||||
/* Global define */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node/CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(window.jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
$.extend(true, $.summernote.lang, {
|
||||
'en-US': {
|
||||
imageFlip: {
|
||||
edit: 'Flip image',
|
||||
flipLabel: 'Alternative Image'
|
||||
}
|
||||
},
|
||||
'ko-KR': {
|
||||
imageFlip: {
|
||||
edit: '이미지 전환',
|
||||
flipLabel: '대체 이미지( , 로 구분)'
|
||||
}
|
||||
},
|
||||
});
|
||||
$.extend($.summernote.options, {
|
||||
imageFlip: {
|
||||
icon: '<i class="note-icon-pencil"/>',
|
||||
tooltip: 'Image Flip'
|
||||
}
|
||||
});
|
||||
$.extend($.summernote.plugins, {
|
||||
'imageFlip': function (context) {
|
||||
var self = this;
|
||||
|
||||
var ui = $.summernote.ui;
|
||||
var $note = context.layoutInfo.note;
|
||||
var $editor = context.layoutInfo.editor;
|
||||
var $editable = context.layoutInfo.editable;
|
||||
var $toolbar = context.layoutInfo.toolbar;
|
||||
|
||||
if (typeof context.options.imageFlip === 'undefined') {
|
||||
context.options.imageFlip = {};
|
||||
}
|
||||
|
||||
var options = context.options;
|
||||
var lang = options.langInfo;
|
||||
|
||||
context.memo('button.imageFlip', function () {
|
||||
var button = ui.button({
|
||||
contents: ui.icon(options.icons.pencil),
|
||||
container: false,
|
||||
tooltip: lang.imageFlip.edit,
|
||||
click: function (e) {
|
||||
context.invoke('imageFlip.show');
|
||||
}
|
||||
});
|
||||
|
||||
return button.render();
|
||||
});
|
||||
|
||||
this.initialize = function () {
|
||||
var $container = options.dialogsInBody ? $(document.body) : $editor;
|
||||
|
||||
var body = '<div class="form-group">' +
|
||||
'<label>' + lang.imageFlip.flipLabel + '</label>' +
|
||||
'<input class="note-image-flip-text form-control" type="text" />' +
|
||||
'</div>';
|
||||
|
||||
var footer = '<button href="#" class="btn btn-primary note-image-flip-btn">' + lang.imageFlip.edit + '</button>';
|
||||
|
||||
this.$dialog = ui.dialog({
|
||||
title: lang.imageFlip.edit,
|
||||
body: body,
|
||||
footer: footer
|
||||
}).render().appendTo($container);
|
||||
};
|
||||
|
||||
this.destroy = function () {
|
||||
ui.hideDialog(this.$dialog);
|
||||
this.$dialog.remove();
|
||||
};
|
||||
|
||||
this.bindEnterKey = function ($input, $btn) {
|
||||
$input.on('keypress', function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
$btn.trigger('click');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.show = function () {
|
||||
var $img = $($editable.data('target'));
|
||||
|
||||
var imgInfo = {
|
||||
imgDom: $img,
|
||||
flip: $img.data('flip'),
|
||||
};
|
||||
this.showLinkDialog(imgInfo).then(function (imgInfo) {
|
||||
ui.hideDialog(self.$dialog);
|
||||
var $img = imgInfo.imgDom;
|
||||
|
||||
if (imgInfo.flip) {
|
||||
$img.attr('data-flip', imgInfo.flip);
|
||||
}
|
||||
else {
|
||||
$img.removeData('flip');
|
||||
}
|
||||
|
||||
$note.val(context.invoke('code'));
|
||||
$note.change();
|
||||
});
|
||||
};
|
||||
|
||||
this.showLinkDialog = function (imgInfo) {
|
||||
return $.Deferred(function (deferred) {
|
||||
var $imageFlip = self.$dialog.find('.note-image-flip-text');
|
||||
var $editBtn = self.$dialog.find('.note-image-flip-btn');
|
||||
|
||||
ui.onDialogShown(self.$dialog, function () {
|
||||
context.triggerEvent('dialog.shown');
|
||||
|
||||
$editBtn.click(function (event) {
|
||||
event.preventDefault();
|
||||
deferred.resolve({
|
||||
imgDom: imgInfo.imgDom,
|
||||
flip: $imageFlip.val(),
|
||||
});
|
||||
});
|
||||
|
||||
$imageFlip.val(imgInfo.flip).trigger('focus');
|
||||
self.bindEnterKey($imageFlip, $editBtn);
|
||||
|
||||
});
|
||||
|
||||
ui.onDialogHidden(self.$dialog, function () {
|
||||
$editBtn.off('click');
|
||||
|
||||
if (deferred.state() === 'pending') {
|
||||
deferred.reject();
|
||||
}
|
||||
});
|
||||
|
||||
ui.showDialog(self.$dialog);
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
}));
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
+13
File diff suppressed because one or more lines are too long
+13
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
+14
-3
@@ -3,7 +3,6 @@ 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');
|
||||
mb_regex_encoding('UTF-8');
|
||||
@@ -88,19 +87,28 @@ function getExceptionTraceAsString($exception) {
|
||||
return $rtn;
|
||||
}
|
||||
|
||||
function logError(string $err, string $errstr, array $trace){
|
||||
function logError(string $err, string $errstr, string $errpath, array $trace){
|
||||
$fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
|
||||
$date = date("Ymd_His");
|
||||
|
||||
$errpath = str_replace(ROOT, '{ROOT}', $errpath);
|
||||
$trace = array_map(function(string $text){
|
||||
return str_replace(ROOT, '{ROOT}', $text);
|
||||
}, $trace);
|
||||
|
||||
$owner = Util::get_client_ip();
|
||||
$session = Session::getInstance();
|
||||
if($session->isLoggedIn(true)){
|
||||
$owner .= '('.$session->getUserID().','.$session->userName.')';
|
||||
}
|
||||
|
||||
$fdb->insert('err_log', [
|
||||
'date'=>$date,
|
||||
'err'=>$err,
|
||||
'errstr'=>$errstr,
|
||||
'trace'=>Json::encode($trace)
|
||||
'errpath'=>$errpath,
|
||||
'trace'=>Json::encode($trace),
|
||||
'webuser'=>$owner
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -116,6 +124,7 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
|
||||
logError(
|
||||
getFriendlyErrorType($errno),
|
||||
$errstr,
|
||||
$errfile.':'.$errline,
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
}
|
||||
@@ -123,9 +132,11 @@ set_error_handler("\sammo\logErrorByCustomHandler");
|
||||
|
||||
|
||||
function logExceptionByCustomHandler(\Throwable $e){
|
||||
|
||||
logError(
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
$e->getFile().':'.$e->getLine(),
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
|
||||
|
||||
@@ -98,6 +98,38 @@ require(__dir__.'/../vendor/autoload.php');
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="image_request_key" class="col-sm-4 col-form-label">이미지 갱신 키</label>
|
||||
<div class="input-group col-sm-8">
|
||||
<input type="text" class="form-control" name="image_request_key" id="image_request_key"
|
||||
placeholder="이미지 서버의 hook/HashKey.php의 값과 동일하게"
|
||||
value="" />
|
||||
<div class="input-group-append">
|
||||
<button id="btn_random_generate_key" class="btn btn-secondary" type="button">랜덤 생성</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="width:100%; border-top: 1px solid lightgray;">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="kakao_rest_key" class="col-sm-4 col-form-label">카카오 API Rest Key</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="kakao_rest_key" id="kakao_rest_key"
|
||||
placeholder="카카오톡 API의 Rest Key"
|
||||
value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="kakao_admin_key" class="col-sm-4 col-form-label">카카오 API Admin Key</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="kakao_admin_key" id="kakao_admin_key"
|
||||
placeholder="카카오톡 API의 Admin Key"
|
||||
value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-4"></div>
|
||||
<div class="col-sm-8">
|
||||
|
||||
@@ -52,6 +52,7 @@ $rootDB->insert('member',[
|
||||
'oauth_type' => 'NONE',
|
||||
'id' => $username,
|
||||
'email' => null,
|
||||
'token_valid_until'=>'2999-01-01 00:00:00',
|
||||
'pw' => $finalPassword,
|
||||
'salt' => $userSalt,
|
||||
'grade'=> 6,
|
||||
|
||||
@@ -11,6 +11,11 @@ $dbName = Util::getReq('db_name');
|
||||
$servHost = Util::getReq('serv_host');
|
||||
$sharedIconPath = Util::getReq('shared_icon_path');
|
||||
$gameImagePath = Util::getReq('game_image_path');
|
||||
$imageRequestKey = Util::getReq('image_request_key');
|
||||
|
||||
$kakaoRESTKey = Util::getReq('kakao_rest_key', 'string', '');
|
||||
$kakaoAdminKey = Util::getReq('kakao_admin_key', 'string', '');
|
||||
|
||||
|
||||
if (!$host || !$port || !$username || !$password || !$dbName || !$servHost || !$sharedIconPath || !$gameImagePath) {
|
||||
Json::die([
|
||||
@@ -186,6 +191,8 @@ $globalSalt = bin2hex(random_bytes(16));
|
||||
|
||||
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
|
||||
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
|
||||
$imageRequestPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/git_pull.php', $servHost);
|
||||
$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/InstallKey.php', $servHost);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
@@ -193,11 +200,17 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
'sharedIconPath'=>$sharedIconPath,
|
||||
'gameImagePath'=>$gameImagePath
|
||||
'gameImagePath'=>$gameImagePath,
|
||||
'imageRequestPath'=>$imageRequestPath,
|
||||
'imageRequestKey'=>$imageRequestKey
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if($imageRequestKey){
|
||||
@file_get_contents($imageKeyInstallPath.'?key='.$imageRequestKey);
|
||||
}
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
@@ -217,8 +230,8 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/menu.orig.js',
|
||||
ROOT.'/d_shared/menu.js',
|
||||
__dir__.'/templates/menu.orig.json',
|
||||
ROOT.'/d_shared/menu.json',
|
||||
[],
|
||||
true
|
||||
);
|
||||
@@ -263,6 +276,19 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
]
|
||||
);
|
||||
|
||||
$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost.'/');
|
||||
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/KakaoKey.orig.php',
|
||||
ROOT.'/d_setting/KakaoKey.php',
|
||||
[
|
||||
'REST_API_KEY'=>$kakaoRESTKey,
|
||||
'ADMIN_KEY'=>$kakaoAdminKey,
|
||||
'REDIRECT_URI'=>$kakaoRedirectURI
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
@@ -272,5 +298,6 @@ if ($result !== true) {
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
'reason'=>'success',
|
||||
'globalSalt'=>$globalSalt
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
if($session->userGrade < 6){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'관리자 아님'
|
||||
]);
|
||||
}
|
||||
|
||||
$servHost = Util::getReq('serv_host');
|
||||
$sharedIconPath = Util::getReq('shared_icon_path');
|
||||
$gameImagePath = Util::getReq('game_image_path');
|
||||
|
||||
if($servHost){
|
||||
if(!$sharedIconPath || $gameImagePath){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'serv_host가 지정된 경우, sharedIconPath와 gameImagePath가 모두 지정되어야합니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
|
||||
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
'sharedIconPath'=>$sharedIconPath,
|
||||
'gameImagePath'=>$gameImagePath
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$result
|
||||
]);
|
||||
}
|
||||
}
|
||||
else if($sharedIconPath || $gameImagePath){
|
||||
$servHost = ServConfig::$serverWebPath;
|
||||
if($sharedIconPath){
|
||||
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
|
||||
}
|
||||
else{
|
||||
$sharedIconPath = ServConfig::$sharedIconPath;
|
||||
}
|
||||
|
||||
if($gameImagePath){
|
||||
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
|
||||
}
|
||||
else{
|
||||
$gameImagePath = ServConfig::$gameImagePath;
|
||||
}
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
'sharedIconPath'=>$sharedIconPath,
|
||||
'gameImagePath'=>$gameImagePath
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$result
|
||||
]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
$servHost = ServConfig::$serverWebPath;
|
||||
$sharedIconPath = ServConfig::$sharedIconPath;
|
||||
$gameImagePath = ServConfig::$gameImagePath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common_path.orig.js',
|
||||
ROOT.'/d_shared/common_path.js',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
'sharedIconPath'=>$sharedIconPath,
|
||||
'gameImagePath'=>$gameImagePath
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common.orig.css',
|
||||
ROOT.'/d_shared/common.css',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
'sharedIconPath'=>$sharedIconPath,
|
||||
'gameImagePath'=>$gameImagePath
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($result !== true) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$result
|
||||
]);
|
||||
}
|
||||
@@ -32,6 +32,7 @@ CREATE TABLE `member` (
|
||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||
`acl` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||
`penalty` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||
`GRADE` INT(1) NULL DEFAULT '1',
|
||||
`REG_NUM` INT(3) NULL DEFAULT '0',
|
||||
`REG_DATE` DATETIME NOT NULL,
|
||||
|
||||
@@ -3,7 +3,9 @@ CREATE TABLE IF NOT EXISTS `err_log` (
|
||||
`date` TEXT NOT NULL,
|
||||
`err` TEXT NOT NULL,
|
||||
`errstr` TEXT NOT NULL,
|
||||
`trace` TEXT NOT NULL
|
||||
`errpath` TEXT NOT NULL,
|
||||
`trace` TEXT NOT NULL,
|
||||
`webuser` TEXT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
|
||||
`date` DESC
|
||||
|
||||
@@ -10,6 +10,8 @@ class ServConfig
|
||||
public static $serverWebPath = '_tK_serverBasePath_';
|
||||
public static $sharedIconPath = '_tK_sharedIconPath_';
|
||||
public static $gameImagePath = "_tK_gameImagePath_";
|
||||
public static $imageRequestPath = "_tK_imageRequestPath_";
|
||||
public static $imageRequestKey = '_tK_imageRequestKey_';
|
||||
|
||||
public static function getSharedIconPath(string $filepath='') : string
|
||||
{
|
||||
@@ -32,6 +34,13 @@ class ServConfig
|
||||
return static::$gameImagePath;
|
||||
}
|
||||
|
||||
public static function getImagePullURI() : string
|
||||
{
|
||||
$now = time();
|
||||
$req_hash = Util::hashPassword(sprintf("%016x",$now), static::$imageRequestKey);
|
||||
return static::$imageRequestPath."?req={$req_hash}&time={$now}";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
|
||||
|
||||
@@ -88,6 +88,59 @@
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
|
||||
/*미니체 지도*/
|
||||
.map_theme_miniche_b.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_b.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_b.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_b.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_b .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
/*미니체 지도*/
|
||||
.map_theme_miniche_clean.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_clean.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_clean.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_clean.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_miniche_clean .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
/*루드라사움 지도*/
|
||||
.map_theme_ludo_rathowm .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/ludo_rathowm/back.jpg') no-repeat;
|
||||
@@ -99,28 +152,21 @@
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_spring .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/spring.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_summer .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/summer.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_fall .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/fall.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_theme_ludo_rathowm.map_detail.map_winter .map_title_text{
|
||||
background:
|
||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.world_map.map_theme_ludo_rathowm .map_title .map_title_text::before {
|
||||
color:white;
|
||||
content:'LP';
|
||||
margin-right:1ch;
|
||||
}
|
||||
}
|
||||
|
||||
/*체스판 지도*/
|
||||
.map_theme_chess .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/chess/chessboard.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
|
||||
/*포켓몬 v1 지도*/
|
||||
.map_theme_pokemon_v1 .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/pokemon_v1/back_pal8.png') no-repeat;
|
||||
background-size: 700px 500px;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
window.sammo_menu = [
|
||||
['/bbs/board', '삼모게시판', '_blank'],
|
||||
['/bbs/tip', '팁/강좌', '_blank'],
|
||||
['/bbs/news', '삼국 일보', '_blank'],
|
||||
['/bbs/history2', '개인 열전', '_blank'],
|
||||
['/bbs/history3', '국가 열전', '_blank'],
|
||||
['/bbs/patch', '패치 내역', '_blank']
|
||||
];
|
||||
@@ -0,0 +1,8 @@
|
||||
[
|
||||
["/bbs/board", "삼모게시판", "_blank"],
|
||||
["/bbs/tip", "팁/강좌", "_blank"],
|
||||
["/bbs/news", "삼국 일보", "_blank"],
|
||||
["/bbs/history2", "개인 열전", "_blank"],
|
||||
["/bbs/history3", "국가 열전", "_blank"],
|
||||
["/bbs/patch", "패치 내역", "_blank"]
|
||||
]
|
||||
+3
-3
@@ -40,10 +40,10 @@ case "분당김":
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
'turntime'=>$db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
$db->update('auction', [
|
||||
'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
|
||||
'expire'=>$db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
break;
|
||||
case "분지연":
|
||||
@@ -87,4 +87,4 @@ case "락풀기":
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location:_119.php');
|
||||
header('Location:_119.php', true, 303);
|
||||
+1
-38
@@ -73,7 +73,6 @@ $sel[$type] = "selected";
|
||||
<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>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@@ -95,11 +94,7 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
$me = $dip['me'];
|
||||
$you = $dip['you'];
|
||||
|
||||
$query = "select reserved,showing from diplomacy where you='$me' and me='$you'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip2 = MYDB_fetch_array($result2);
|
||||
|
||||
if ($dip['state'] == 2 && $dip['fixed'] == "" && $dip['reserved'] == "" && $dip2['reserved'] == "") {
|
||||
if ($dip['state'] == 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -115,37 +110,6 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
}
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$note = "";
|
||||
if ($dip['fixed'] != "") {
|
||||
if ($dip['state'] == 7) {
|
||||
$note .= $dip['fixed'];
|
||||
} else {
|
||||
$note .= "<font color=gray>{$dip['fixed']}</font>";
|
||||
}
|
||||
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip['reserved'] != "") {
|
||||
if ($dip['showing'] >= $date) {
|
||||
$note .= "<font color=skyblue>아국측 제의</font>: {$dip['reserved']}";
|
||||
} else {
|
||||
$note .= "<font color=gray>아국측 제의: {$dip['reserved']}</font>";
|
||||
}
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip2['reserved'] != "") {
|
||||
if ($dip2['showing'] >= $date) {
|
||||
$note .= "<font color=limegreen>상대측 제의</font>: {$dip2['reserved']}";
|
||||
} else {
|
||||
$note .= "<font color=gray>상대측 제의: {$dip2['reserved']}</font>";
|
||||
}
|
||||
}
|
||||
if ($note == "") {
|
||||
$note = " ";
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -153,7 +117,6 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
<td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td>
|
||||
<td align=center>$state</td>
|
||||
<td align=center>{$dip['term']} 개월</td>
|
||||
<td align=left style=font-size:7px;>{$note}</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
if($session->userGrade < 5) {
|
||||
die('권한 부족');
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if(!$gameStor->isunited){
|
||||
die('아직 천통하지 않았습니다');
|
||||
}
|
||||
|
||||
foreach($db->queryFirstColumn(
|
||||
'SELECT no FROM general WHERE npc != 0 and age >= %i',
|
||||
GameConst::$retirementYear
|
||||
) as $generalNo){
|
||||
CheckHall($generalNo);
|
||||
}
|
||||
+13
-5
@@ -6,8 +6,6 @@ include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -51,6 +49,12 @@ increaseRefresh("명장일람", 1);
|
||||
<div style="margin:auto;width=1000px;">
|
||||
<?php
|
||||
|
||||
$ownerNameList = [];
|
||||
if($gameStor->isunited){
|
||||
foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){
|
||||
$ownerNameList[$ownerID] = $ownerName;
|
||||
}
|
||||
}
|
||||
|
||||
$nationName = [0=>'재야'];
|
||||
$nationColor = [0=>'#000000'];
|
||||
@@ -62,8 +66,11 @@ foreach (getAllNationStaticInfo() as $nation) {
|
||||
$types = [
|
||||
["명 성", "int", function($v){$v['value'] = $v['experience']; return $v; }],
|
||||
["계 급", "int", function($v){$v['value'] = $v['dedication']; return $v; }],
|
||||
["계 략 성 공", "int", function($v){
|
||||
["계 략 성 공", "int", function($v) use ($gameStor){
|
||||
$v['value'] = $v['firenum'];
|
||||
if($gameStor->isunited){
|
||||
return $v;
|
||||
}
|
||||
$v['nationName'] = '???';
|
||||
$v['pictureFullPath'] = GetImageURL(0)."/default.jpg";
|
||||
$v['name'] = '???';
|
||||
@@ -168,7 +175,7 @@ $generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
|
||||
return $general;
|
||||
}, $db->query(
|
||||
"SELECT nation,no,name,name2 as owner_name, picture, imgsvr,
|
||||
"SELECT nation,no,name,name2 as owner_name, owner, 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,
|
||||
@@ -181,7 +188,8 @@ $templates = new \League\Plates\Engine('templates');
|
||||
|
||||
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
$validCnt = 0;
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){
|
||||
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt, $ownerNameList){
|
||||
$general['owner_name'] = $ownerNameList[$general['owner']]??null;
|
||||
$general = ($typeFunc)($general);
|
||||
$value = $general['value'];
|
||||
|
||||
|
||||
+11
-1
@@ -98,11 +98,21 @@ foreach($emperiors as $emperior){
|
||||
<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 id=bg1 align=center>표 기 장 군</td>
|
||||
<td align=center><?=$emperior['l10name']?></td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td align=center><?=$emperior['l9name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td align=center><?=$emperior['l8name']?></td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td align=center><?=$emperior['l7name']?></td>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td align=center><?=$emperior['l6name']?></td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td align=center><?=$emperior['l5name']?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ if($showServers){
|
||||
if($nation['generals']){
|
||||
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
|
||||
|
||||
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
|
||||
if(count($generals) != count($nation['generals']) && $serverID == UniqueConst::$serverID){
|
||||
$liveGenerals = $nation['generals'];
|
||||
foreach($generals as $general){
|
||||
if(in_array($general['general_no'], $nation['generals'])){
|
||||
|
||||
+34
-24
@@ -6,8 +6,6 @@ include "func.php";
|
||||
|
||||
$type = Util::getReq('type', 'int', 9);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -32,6 +30,13 @@ if ($type <= 0 || $type > 15) {
|
||||
$type = 9;
|
||||
}
|
||||
|
||||
$ownerNameList = [];
|
||||
if($gameStor->isunited){
|
||||
foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){
|
||||
$ownerNameList[$ownerID] = $ownerName;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -84,26 +89,26 @@ foreach (getAllNationStaticInfo() as $nation) {
|
||||
$nationlevel[$nation['nation']] = $nation['level'];
|
||||
}
|
||||
|
||||
switch ($type) { //FIXME: $query 처리 조심.
|
||||
case 1: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
|
||||
case 2: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
|
||||
case 3: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
|
||||
case 4: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
|
||||
case 5: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 6: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
|
||||
case 7: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
|
||||
case 8: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
|
||||
default:
|
||||
case 9: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
|
||||
case 10: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||
case 11: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
|
||||
case 12: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
|
||||
case 13: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
|
||||
case 14: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
|
||||
case 15: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
|
||||
}
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
[$orderKey, $orderDesc] = [
|
||||
1=>['nation', false],
|
||||
2=>['leader', true],
|
||||
3=>['power', true],
|
||||
4=>['intel', true],
|
||||
5=>['experience', true],
|
||||
6=>['dedication', true],
|
||||
7=>['level', true],
|
||||
8=>['killturn', false],
|
||||
9=>['connect', true],
|
||||
10=>['experience', true],
|
||||
11=>['personal', true],
|
||||
12=>['special', true],
|
||||
13=>['special2', true],
|
||||
14=>['age', true],
|
||||
15=>['npc', true],
|
||||
][$type];
|
||||
|
||||
$generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by %b %l', $orderKey, $orderDesc?'desc':'');
|
||||
|
||||
echo"
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
@@ -124,8 +129,7 @@ echo"
|
||||
<td width=45 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);
|
||||
foreach($generalList as $general){
|
||||
$nation = $nationname[$general['nation']];
|
||||
|
||||
if ($general['level'] == 12) {
|
||||
@@ -154,6 +158,8 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($general['npc'] >= 2) {
|
||||
$name = "<font color=cyan>{$general['name']}</font>";
|
||||
} elseif ($general['npc'] == 1) {
|
||||
@@ -162,6 +168,10 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$name = "{$general['name']}";
|
||||
}
|
||||
|
||||
if(key_exists($general['owner'], $ownerNameList)){
|
||||
$name = $name.'<br><small>('.$ownerNameList[$general['owner']].')</small>';
|
||||
}
|
||||
|
||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
|
||||
+41
-17
@@ -5,26 +5,34 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$session = Session::getInstance()->setReadOnly();
|
||||
$seasonIdx = Util::getReq('seasonIdx', 'int', UniqueConst::$seasonIdx);
|
||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
increaseRefresh("명예의전당", 1);
|
||||
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){
|
||||
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
|
||||
}
|
||||
|
||||
|
||||
$scenarioList = (function(){
|
||||
$db = DB::db();
|
||||
$scenarioList= [];
|
||||
foreach($db->query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo){
|
||||
$seasonIdx = $scenarioInfo['season'];
|
||||
$scenarioIdx = $scenarioInfo['scenario'];
|
||||
if(!key_exists($seasonIdx, $scenarioList)){
|
||||
$scenarioList[$seasonIdx] = [];
|
||||
}
|
||||
$scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo;
|
||||
}
|
||||
return $scenarioList;
|
||||
})();
|
||||
|
||||
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
|
||||
$searchScenarioName = $scenarioList[$scenarioIdx]['name'];
|
||||
$searchFilter = $db->sqleval('scenario = %i', $scenarioIdx);
|
||||
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
|
||||
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
|
||||
}
|
||||
else{
|
||||
$searchScenarioName = '* 모두 *';
|
||||
$searchFilter = $db->sqleval(true);
|
||||
$searchFilter = $db->sqleval('season = %i', $seasonIdx);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -53,14 +61,20 @@ else{
|
||||
<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 foreach($scenarioList as $iterSeasonIdx=>$subScenarioList): ?>
|
||||
<option
|
||||
data-season="<?=$iterSeasonIdx?>"
|
||||
value=""
|
||||
<?=($iterSeasonIdx == $seasonIdx && $scenarioIdx === null)?"selected='selected'":''?>
|
||||
>* 시즌 : <?=$iterSeasonIdx?> 종합 *</option>
|
||||
<?php foreach($subScenarioList as $info): ?>
|
||||
<option
|
||||
data-season="<?=$iterSeasonIdx?>"
|
||||
value="<?=$info['scenario']?>"
|
||||
<?=($iterSeasonIdx == $seasonIdx && $info['scenario']===$scenarioIdx)?"selected='selected'":''?>
|
||||
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
?>
|
||||
</select>
|
||||
</td></tr>
|
||||
</table>
|
||||
@@ -92,12 +106,22 @@ $types = [
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
$ownerNameList = [];
|
||||
foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){
|
||||
$ownerNameList[$ownerID] = $ownerName;
|
||||
}
|
||||
|
||||
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){
|
||||
$hallResult = array_map(function($general)use($typeValue, $ownerNameList){
|
||||
$aux = Json::decode($general['aux']);
|
||||
$general += $aux;
|
||||
|
||||
if(key_exists($general['owner'], $ownerNameList)){
|
||||
$general['owner_name'] = $ownerNameList[$general['owner']];
|
||||
}
|
||||
|
||||
if(!key_exists('bgColor', $general)){
|
||||
if(!key_exists('color', $general)){
|
||||
$general['bgColor'] = GameConst::$basecolor4;
|
||||
|
||||
+14
-20
@@ -7,8 +7,6 @@ $btn = Util::getReq('btn');
|
||||
$yearmonth = Util::getReq('yearmonth', 'int');
|
||||
$serverID = Util::getReq('serverID', 'string', null);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -88,6 +86,8 @@ if ($month <= 0) {
|
||||
$month += 12;
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -103,12 +103,19 @@ if ($month <= 0) {
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS("js/map/theme_{$mapTheme}.js")?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<?=WebUtil::printJS('js/history.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
|
||||
<script>
|
||||
var startYear = <?=$s_year?>;
|
||||
var startMonth = <?=$s_month?>;
|
||||
var lastYear = <?=$e_year?>;
|
||||
var lastMonth = <?=$e_month?>;
|
||||
var selectYear = <?=$year?>;
|
||||
var selectMonth = <?=$month?>;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -118,22 +125,9 @@ if ($month <= 0) {
|
||||
<form name=form1 method=post>
|
||||
년월 선택 :
|
||||
<input type=submit name=btn value="◀◀ 이전달">
|
||||
<select name=yearmonth size=1>
|
||||
<?php
|
||||
$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}>{$hYear}년 {$hMonth}월</option>";
|
||||
} else {
|
||||
echo "
|
||||
<option value={$value}>{$hYear}년 {$hMonth}월</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$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 id='yearmonth' name=yearmonth size=1>
|
||||
<option selected='selected'><?=$year?>년 <?=$month?>월</option>
|
||||
<option><?=$e_year?>년 12월</option>
|
||||
</select>
|
||||
<input type=submit name=btn value='조회하기'>
|
||||
<input type=submit name=btn value="다음달 ▶▶">
|
||||
|
||||
+21
-3
@@ -130,6 +130,19 @@ for($i=1; $i <= $count; $i++) {
|
||||
elseif($level5['npc'] == 1) { $l5 = "<font color=skyblue>{$level5['name']}</font>"; }
|
||||
else { $l5 = $level5['name']; }
|
||||
|
||||
$generals = $db->query('SELECT no,nation,npc,name,level,penalty,permission FROM general WHERE nation=%i ORDER BY no ASC', $nation['nation']);
|
||||
$ambassadors = [];
|
||||
$auditors = [];
|
||||
foreach($generals as $general){
|
||||
$generalPermission = checkSecretPermission($general, false);
|
||||
if($generalPermission == 4){
|
||||
$ambassadors[] = $general['name'];
|
||||
}
|
||||
else if($generalPermission == 3){
|
||||
$auditors[] = $general['name'];
|
||||
}
|
||||
}
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
@@ -143,7 +156,7 @@ for($i=1; $i <= $count; $i++) {
|
||||
<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>
|
||||
<td width=170 align=center>".count($generals)." / {$citycount}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>".getLevel(12, $nation['level'])."</td>
|
||||
@@ -165,6 +178,12 @@ for($i=1; $i <= $count; $i++) {
|
||||
<td align=center id=bg1>".getLevel( 5, $nation['level'])."</td>
|
||||
<td align=center>$l5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>외교권자</td><td colspan=5>";
|
||||
echo join(', ', $ambassadors);
|
||||
echo "</td><td align=center id=bg1>조언자</td><td align=center >";
|
||||
echo count($auditors).'명';
|
||||
echo "</td></tr>
|
||||
<tr>
|
||||
<td colspan=8>";
|
||||
if($nation['level'] > 0) {
|
||||
@@ -190,8 +209,7 @@ for($i=1; $i <= $count; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=8> 장수 일람 : ";
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
foreach($generals as $general){
|
||||
if($general['npc'] >= 2) { echo "<font color=cyan>{$general['name']}</font>, "; }
|
||||
elseif($general['npc'] == 1) { echo "<font color=skyblue>{$general['name']}</font>, "; }
|
||||
else { echo "{$general['name']}, "; }
|
||||
|
||||
@@ -6,8 +6,6 @@ include "func.php";
|
||||
|
||||
$type = Util::getReq('type', 'int', 1);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
if($type <= 0 || $type > 8){
|
||||
$type = 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ $max_refresh['name'] = '접속자 총합';
|
||||
$refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5'));
|
||||
|
||||
foreach ($refresh_result as $i=>$user) {
|
||||
$w = round($user['refresh'] / $max_refresh['refresh'] * 100, 1);
|
||||
$w = round($user['refresh'] / max(1, $max_refresh['refresh']) * 100, 1);
|
||||
$w2 = round(100 - $w, 1);
|
||||
$color = getTrafficColor($w);
|
||||
?>
|
||||
|
||||
@@ -7,8 +7,6 @@ include "func.php";
|
||||
$msg = Util::getReq('msg');
|
||||
$msg2 = Util::getReq('msg2');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
+10
-9
@@ -16,8 +16,6 @@ if ($type < 0 || $type > 3) {
|
||||
$type = 0;
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -35,7 +33,7 @@ $query = "select nation from general where no='$gen'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$query = "select no,nation,level,con,turntime,belong,permission,penalty from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -49,11 +47,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
//재야인 경우
|
||||
$meLevel = $me['level'];
|
||||
if ($meLevel == 0 || ($meLevel == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
//잘못된 접근
|
||||
@@ -160,7 +161,7 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
<?=getBatResRecent($gen, 24)?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($npc > 1 || $meLevel >= 5): ?>
|
||||
<?php if($npc > 1 || $permission >= 2): ?>
|
||||
<tr>
|
||||
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
|
||||
<td align=center id=bg1><font color=orange size=3> </font></td>
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("기밀실", 1);
|
||||
|
||||
$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);
|
||||
|
||||
if($me['level'] < 5) {
|
||||
echo "수뇌부가 아닙니다.";
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</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>
|
||||
<tr><td align=center>
|
||||
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
<input type=hidden name=num value=-1>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['coreindex'];
|
||||
for($i=0; $i < 20; $i++) {
|
||||
$who = "coreboard{$index}_who";
|
||||
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
if($nation["coreboard{$index}"] != '') { msgprint($nation["coreboard{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["coreboard{$index}_when"], $index, 1); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,20 +13,21 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("사령부", 1);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$query = "select no,nation,level,con,turntime,belong,permission,penalty from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
|
||||
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
if($me['level'] >= 5) { $btn = "submit"; $btn2 = "button"; }
|
||||
|
||||
+27
-24
@@ -6,8 +6,6 @@ include "func.php";
|
||||
|
||||
$citylist = Util::getReq('citylist', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -37,8 +35,12 @@ $templates = new \League\Plates\Engine('templates');
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/select2/select2.full.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/currentCity.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<style>
|
||||
@@ -65,8 +67,9 @@ $templates = new \League\Plates\Engine('templates');
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=998>
|
||||
<form name=cityselect method=get>도시선택 :
|
||||
<select name=citylist size=1 style=color:white;background-color:black;width:798px;>
|
||||
<form name=cityselect method=get>
|
||||
<div style='text-align:center;'>도시선택 :
|
||||
<select id="citySelector" name=citylist size=1 style='display:inline-block;min-width:400px;'>
|
||||
<?php
|
||||
if(!$citylist){
|
||||
$citylist = $me['city'];
|
||||
@@ -81,11 +84,11 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
echo ">【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국";
|
||||
else echo "타국";
|
||||
echo "</option>";
|
||||
} else {
|
||||
// 아국 도시들 선택
|
||||
$query = "select city,name,nation from city where nation='{$me['nation']}'";
|
||||
@@ -97,11 +100,11 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
echo ">【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국";
|
||||
else echo "타국";
|
||||
echo "</option>";
|
||||
}
|
||||
|
||||
// 아국 장수가 있는 타국 도시들 선택
|
||||
@@ -114,11 +117,11 @@ if($me['level'] == 0) {
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
echo ">【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국";
|
||||
else echo "타국";
|
||||
echo "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,19 +149,18 @@ if($myNation['level'] > 0) {
|
||||
foreach ($db->query('SELECT city,name,nation FROM city WHERE city in %li', $spyCities) as $city) {
|
||||
echo "<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
echo ">【".StringUtil::padString($city['name'], 4, '_')."】";
|
||||
if($city['nation'] == 0) echo "공백지";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국==";
|
||||
else echo "타국==";
|
||||
echo "============================================</option>";
|
||||
elseif($me['nation'] == $city['nation']) echo "본국";
|
||||
else echo "타국";
|
||||
echo "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "
|
||||
</select>
|
||||
<input type=submit value='도 시 선 택'>
|
||||
</select></div>
|
||||
<p align=center>명령 화면에서 도시를 클릭하셔도 됩니다.</p>
|
||||
</form>
|
||||
</td>
|
||||
@@ -177,7 +179,7 @@ if($valid == 0 && $userGrade < 5) {
|
||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
|
||||
$cityNation = getNationStaticInfo($city['nation']);
|
||||
|
||||
//태수, 군사, 시중
|
||||
//태수, 군사, 종사
|
||||
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
|
||||
$gen2 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen2']);
|
||||
$gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen3']);
|
||||
@@ -280,6 +282,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
|
||||
$generalsFormat[] = [
|
||||
'ourGeneral'=>$ourGeneral,
|
||||
'iconPath'=>GetImageURL($general['imgsvr']).'/'.$general['picture'],
|
||||
'isNPC'=>$isNPC,
|
||||
'wounded'=>$wounded,
|
||||
'name'=>$name,
|
||||
@@ -413,7 +416,7 @@ foreach($generalsFormat as $general){
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center class=bg1>종사</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+21
-51
@@ -13,13 +13,9 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("내무부", 1);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, con, turntime, belong, permission, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nation = $db->queryFirstRow('SELECT msg, scoutmsg FROM nation WHERE nation = %i', $me['nation']);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -27,9 +23,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
if ($me['level'] >= 5) {
|
||||
@@ -49,12 +50,15 @@ if ($me['level'] >= 5) {
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<script>
|
||||
var editable = <?=($me['level']>=5?'true':'false')?>;
|
||||
var editable = <?=(($me['level']>=5||$permission==4)?'true':'false')?>;
|
||||
var nationMsg = <?=Json::encode($nation['msg']??'')?>;
|
||||
var scoutmsg = <?=Json::encode($nation['scoutmsg']??'')?>;
|
||||
</script>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/summernote/summernote-bs4.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/summernote/lang/summernote-ko-KR.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/summernote/plugin/image-sammo/summernote-image-flip.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/dipcenter.js')?>
|
||||
@@ -81,7 +85,6 @@ var editable = <?=($me['level']>=5?'true':'false')?>;
|
||||
<td width=80 align=center class=bg1>상태</td>
|
||||
<td width=60 align=center class=bg1>기간</td>
|
||||
<td width=100 align=center class=bg1>종 료 시 점</td>
|
||||
<td align=center class=bg1>비 고</td>
|
||||
</tr>
|
||||
<?php
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
@@ -107,19 +110,15 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>
|
||||
<td align=left style=font-size:7px;>-</td>
|
||||
</tr>";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = "select state,term,fixed,reserved,showing from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
|
||||
$query = "select state,term from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip = MYDB_fetch_array($result2);
|
||||
|
||||
$query = "select reserved,showing from diplomacy where you='{$me['nation']}' and me='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip2 = MYDB_fetch_array($result2);
|
||||
//속령수
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -145,33 +144,6 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
}
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$note = "";
|
||||
if ($dip['fixed'] != "") {
|
||||
if ($dip['state'] == 7) {
|
||||
$note .= $dip['fixed'];
|
||||
} else {
|
||||
$note .= "<font color=gray>{$dip['fixed']}</font>";
|
||||
}
|
||||
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip['showing'] >= $date) {
|
||||
if ($dip['reserved'] != "") {
|
||||
$note .= "<font color=skyblue>아국측 제의</font>: ".$dip['reserved'];
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($dip2['showing'] >= $date) {
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<font color=limegreen>상대측 제의</font>: ".$dip2['reserved'];
|
||||
}
|
||||
}
|
||||
if ($note == "") {
|
||||
$note = " ";
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -189,15 +161,13 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>";
|
||||
}
|
||||
echo "
|
||||
<td align=left style=font-size:7px;>{$note}</td>
|
||||
</tr>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "
|
||||
</table>
|
||||
";
|
||||
|
||||
$query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,scoutmsg,secretlimit from nation where nation='{$me['nation']}'";
|
||||
$query = "select nation,name,color,type,gold,rice,bill,rate,scout,war,secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -242,7 +212,7 @@ if ($budgetricediff > 0) {
|
||||
<input type='submit' class='submit' name=btn value='국가방침 수정'><input type='button' class='cancel_edit' value='취소'>
|
||||
</div>
|
||||
</div>
|
||||
<textarea type=hidden class='input_form' style='display:none;' name=msg><?=$nation['msg']?></textarea>
|
||||
<input type='hidden' class='input_form' name='msg' data-global='nationMsg'>
|
||||
<div class='edit_form viewer'></div>
|
||||
</div></td></tr>
|
||||
<tr><td colspan='2'><div id='scoutMsgForm'>
|
||||
@@ -255,7 +225,7 @@ if ($budgetricediff > 0) {
|
||||
</div>
|
||||
</div>
|
||||
<div style='border-bottom:solid gray 0.5px;'>870px x 200px를 넘어서는 내용은 표시되지 않습니다.</div>
|
||||
<textarea type=hidden class='input_form' style='display:none;' name=scoutmsg><?=$nation['scoutmsg']?></textarea>
|
||||
<input type='hidden' class='input_form' name='scoutmsg' data-global='scoutmsg'>
|
||||
<div style="width:870px;margin-left:auto;">
|
||||
<div class='edit_form viewer'></div>
|
||||
</div>
|
||||
@@ -303,8 +273,8 @@ if ($budgetricediff > 0) {
|
||||
<tr>
|
||||
<td align=right class=bg1>세율 (5 ~ 30%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn?> name=btn value=세율></td>
|
||||
<td align=right class=bg1>봉급 지급율 (20 ~ 200%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급율></td>
|
||||
<td align=right class=bg1>봉급 지급률 (20 ~ 200%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급률></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>기밀 권한 (1 ~ 99년) </td>
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
";
|
||||
}
|
||||
?>
|
||||
<tr><td colspan=<?=$nationcount+1?> align=center>불가침 : <font color=limegreen>@</font>, 통합 : <font color=cyan>○</font>, 합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
|
||||
<tr><td colspan=<?=$nationcount+1?> align=center>불가침 : <font color=limegreen>@</font>, <!--통합 : <font color=cyan>○</font>, -->합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
|
||||
</table>
|
||||
|
||||
<?php if ($realConflict) : ?>
|
||||
|
||||
+18
-8
@@ -19,11 +19,11 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("암행부", 1);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||
$query = "select no,nation,level,con,turntime,belong,permission,penalty from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select level,secretlimit from nation where nation='{$me['nation']}'";
|
||||
$query = "select level from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -33,9 +33,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
$sel = [];
|
||||
@@ -99,10 +104,15 @@ switch ($type) {
|
||||
|
||||
$generals = $db->query('SELECT npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general WHERE nation = %i %l', $me['nation'], $orderSQL);
|
||||
|
||||
$genCntEff = 0;
|
||||
foreach ($generals as &$general) {
|
||||
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||
$general['troopText'] = $troopName[$general['troop']]??'-';
|
||||
|
||||
if($general['npc'] != 5){
|
||||
$genCntEff += 1;
|
||||
}
|
||||
|
||||
if ($general['level'] == 12) {
|
||||
$lbonus = $nation['level'] * 2;
|
||||
} elseif ($general['level'] >= 5) {
|
||||
@@ -220,11 +230,11 @@ foreach($generals as $general){
|
||||
<tr>
|
||||
<td class='bg1'>전체 금</td><td><?=number_format($totalGold)?></td>
|
||||
<td class='bg1'>전체 쌀</td><td><?=number_format($totalRice)?></td>
|
||||
<td class='bg1'>평균 금</td><td><?=number_format($totalGold/$genCnt, 2)?></td>
|
||||
<td class='bg1'>평균 쌀</td><td><?=number_format($totalRice/$genCnt, 2)?></td>
|
||||
<td class='bg1'>평균 금</td><td><?=number_format($totalGold/$genCntEff, 2)?></td>
|
||||
<td class='bg1'>평균 쌀</td><td><?=number_format($totalRice/$genCntEff, 2)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCnt)?></td>
|
||||
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCntEff)?></td>
|
||||
<td class='bg1'>훈사 90 병력/장수</td><td><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
|
||||
<td class='bg1'>훈사 80 병력/장수</td><td><?=number_format($crew80)?>/<?=number_format($gen80)?></td>
|
||||
<td class='bg1'>훈사 60 병력/장수</td><td><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
|
||||
|
||||
+84
-9
@@ -35,8 +35,12 @@ if($meLevel == 0) {
|
||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/select2/select2.full.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/bossInfo.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
@@ -45,6 +49,51 @@ function out() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
$query = "select nation,name,level,color,l12set,l11set,l10set,l9set,l8set,l7set,l6set,l5set from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result); //국가정보
|
||||
|
||||
$ambassadors = $db->query('SELECT no, name, level, penalty, permission FROM general WHERE permission = \'ambassador\' AND nation = %i', $nation['nation']);
|
||||
$auditors = $db->query('SELECT no, name, level, penalty, permission FROM general WHERE permission = \'auditor\' AND nation = %i', $nation['nation']);
|
||||
$candidateAmbassadors = [];
|
||||
$candidateAuditors = [];
|
||||
foreach($ambassadors as $ambassador){
|
||||
$candidateAmbassadors[] = $ambassador;
|
||||
}
|
||||
foreach($auditors as $auditor){
|
||||
$candidateAuditors[] = $auditor;
|
||||
}
|
||||
foreach($db->query('SELECT no, name, nation, level, penalty, permission FROM general WHERE nation = %i AND permission = \'normal\' AND level != 12', $nation['nation']) as $candidate){
|
||||
$maxPermission = checkSecretMaxPermission($candidate);
|
||||
if($maxPermission == 4){
|
||||
$candidateAmbassadors[] = $candidate;
|
||||
}
|
||||
if($maxPermission >= 3){
|
||||
$candidateAuditors[] = $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
var candidateAmbassadors = <?=Json::encode(array_map(function($value){
|
||||
return [
|
||||
'id'=>$value['no'],
|
||||
'text'=>$value['name'],
|
||||
"selected"=>($value['permission']!='normal')
|
||||
];
|
||||
}, $candidateAmbassadors))?>;
|
||||
|
||||
var candidateAuditors = <?=Json::encode(array_map(function($value){
|
||||
return [
|
||||
'id'=>$value['no'],
|
||||
'text'=>$value['name'],
|
||||
"selected"=>($value['permission']!='normal')
|
||||
];
|
||||
}, $candidateAuditors))?>;
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -55,10 +104,6 @@ function out() {
|
||||
|
||||
<?php
|
||||
|
||||
$query = "select nation,name,level,color,l12set,l11set,l10set,l9set,l8set,l7set,l6set,l5set from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result); //국가정보
|
||||
|
||||
$lv = getNationChiefLevel($nation['level']);
|
||||
if($meLevel >= 5) { $btn = "submit"; }
|
||||
else { $btn = "hidden"; }
|
||||
@@ -77,6 +122,7 @@ $tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connec
|
||||
$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),"");
|
||||
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
@@ -150,12 +196,15 @@ 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,leader,power,intel,killturn from general where nation='{$me['nation']}' and level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
||||
$query = "select no,npc,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);
|
||||
if($general['npc'] == 5){
|
||||
continue;
|
||||
}
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']} <small>({$general['leader']}/{$general['power']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||
}
|
||||
@@ -276,9 +325,35 @@ for($i=10; $i >= $lv; $i--) {
|
||||
echo "
|
||||
<tr><td colspan=4>※ <font color=red>빨간색</font>은 현재 임명중인 장수, <font color=orange>노란색</font>은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.</td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=5 height=5></td></tr>
|
||||
|
||||
";
|
||||
|
||||
if($meLevel == 12):
|
||||
?>
|
||||
<table align='center' width='1000' class='tb_layout bg0'>
|
||||
<tr><td colspan='4' height='5'></td></tr>
|
||||
<tr><td colspan='4' align='center' bgcolor='purple'>외 교 권 자 임 명</td></tr>
|
||||
<tr>
|
||||
<td width=98 align=right id=bg1>외교권자</td>
|
||||
<td width=398>
|
||||
<select id="selectAmbassador" multiple="multiple">
|
||||
</select>
|
||||
<button id='changeAmbassador' type='button'>임명</button>
|
||||
</td>
|
||||
<td width=98 align=right id=bg1>조언자</td>
|
||||
<td width=398>
|
||||
<select id="selectAuditor" multiple="multiple">
|
||||
</select>
|
||||
<button id='changeAuditor' type='button'>임명</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<table align=center width=1000 id='officer_list' class='tb_layout bg0'>
|
||||
<tr><td colspan=5 height=5></td></tr>
|
||||
<?php
|
||||
if($meLevel >= 5) {
|
||||
echo "
|
||||
<tr><td colspan=5 align=center bgcolor=orange>도 시 관 직 임 명</td></tr>
|
||||
@@ -392,7 +467,7 @@ if($meLevel >= 5) {
|
||||
</form>
|
||||
<form method=post action=c_myBossInfo.php>
|
||||
<tr>
|
||||
<td colspan=3 align=right id=bg2>시 중 임 명</td>
|
||||
<td colspan=3 align=right id=bg2>종 사 임 명</td>
|
||||
<td colspan=2>
|
||||
<select name=citylist size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
@@ -452,7 +527,7 @@ echo "
|
||||
<td width=158 align=center id=bg1 colspan=2><font size=4>도 시</font></td>
|
||||
<td width=278 align=center id=bg1><font size=4>태 수 (사관) 【현재도시】</font></td>
|
||||
<td width=278 align=center id=bg1><font size=4>군 사 (사관) 【현재도시】</font></td>
|
||||
<td width=278 align=center id=bg1><font size=4>시 중 (사관) 【현재도시】</font></td>
|
||||
<td width=278 align=center id=bg1><font size=4>종 사 (사관) 【현재도시】</font></td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ if ($type <= 0 || $type > 12) {
|
||||
$type = 10;
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -115,7 +113,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen2 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name from general where no='{$city['gen3']}'"; // 시중
|
||||
$query = "select name from general where no='{$city['gen3']}'"; // 종사
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen3 = MYDB_fetch_array($genresult);
|
||||
|
||||
@@ -165,7 +163,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
<td align=center>";
|
||||
echo $gen2['name']==''?"-":"{$gen2['name']}";
|
||||
echo "</td>
|
||||
<td align=center id=bg1>시중</td>
|
||||
<td align=center id=bg1>종사</td>
|
||||
<td align=center>";
|
||||
echo $gen3['name']==''?"-":"{$gen3['name']}";
|
||||
echo "</td>
|
||||
|
||||
+34
-46
@@ -9,13 +9,12 @@ if($type <= 0 || $type > 15) {
|
||||
$type = 1;
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력장수", 1);
|
||||
@@ -31,6 +30,14 @@ if($me['level'] == 0) {
|
||||
|
||||
$sel = [$type => "selected"];
|
||||
|
||||
$ownerNameList = [];
|
||||
if($gameStor->isunited){
|
||||
foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){
|
||||
$ownerNameList[$ownerID] = $ownerName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -76,48 +83,26 @@ $sel = [$type => "selected"];
|
||||
<?php
|
||||
|
||||
$nationLevel = DB::db()->queryFirstField('select level from nation where nation = %i', $me['nation']);
|
||||
$orderByText = '';//FIXME: 쿼리 재작성
|
||||
switch($type) {
|
||||
case 1: $orderByText = " order by level desc"; break;
|
||||
case 2: $orderByText = " order by dedication desc"; break;
|
||||
case 3: $orderByText = " order by experience desc"; break;
|
||||
case 4: $orderByText = " order by leader desc"; break;
|
||||
case 5: $orderByText = " order by power desc"; break;
|
||||
case 6: $orderByText = " order by intel desc"; break;
|
||||
case 7: $orderByText = " order by gold desc"; break;
|
||||
case 8: $orderByText = " order by rice desc"; break;
|
||||
case 9: $orderByText = " order by crew desc"; break;
|
||||
case 10: $orderByText = " order by connect desc"; break;
|
||||
case 11: $orderByText = " order by personal"; break;
|
||||
case 12: $orderByText = " order by special desc"; break;
|
||||
case 13: $orderByText = " order by special2 desc"; break;
|
||||
case 14: $orderByText = " order by belong desc"; break;
|
||||
case 15: $orderByText = " order by npc desc"; break;
|
||||
}
|
||||
$query =
|
||||
"select
|
||||
npc,
|
||||
special,
|
||||
special2,
|
||||
personal,
|
||||
picture,
|
||||
imgsvr,
|
||||
name,
|
||||
level,
|
||||
dedication,
|
||||
experience,
|
||||
injury,
|
||||
leader,
|
||||
power,
|
||||
intel,
|
||||
gold,
|
||||
rice,
|
||||
belong,
|
||||
connect,
|
||||
killturn
|
||||
from general where nation='{$me['nation']}' ".$orderByText;
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
[$orderKey, $orderDesc] = [
|
||||
1=>['level', true],
|
||||
2=>['dedication', true],
|
||||
3=>['experience', true],
|
||||
4=>['leader', true],
|
||||
5=>['power', true],
|
||||
6=>['intel', true],
|
||||
7=>['gold', true],
|
||||
8=>['rice', true],
|
||||
9=>['crew', true],
|
||||
10=>['connect', true],
|
||||
11=>['personal', true],
|
||||
12=>['special', true],
|
||||
13=>['special2', true],
|
||||
14=>['belong', true],
|
||||
15=>['npc', true],
|
||||
][$type];
|
||||
|
||||
$generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect,gold,rice,crew,belong from general where nation = %i order by %b %l', $me['nation'], $orderKey, $orderDesc?'desc':'');
|
||||
|
||||
echo"
|
||||
<table align=center class='tb_layout bg0'>
|
||||
@@ -138,8 +123,7 @@ echo"
|
||||
<td width=48 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);
|
||||
foreach($generalList as $general){
|
||||
|
||||
if($general['level'] == 12) {
|
||||
$lbonus = $nationLevel * 2;
|
||||
@@ -171,6 +155,10 @@ for($j=0; $j < $gencount; $j++) {
|
||||
elseif($general['npc'] == 1) { $name = "<font color=skyblue>{$general['name']}</font>"; }
|
||||
else { $name = "{$general['name']}"; }
|
||||
|
||||
if(key_exists($general['owner'], $ownerNameList)){
|
||||
$name = $name.'<br><small>('.$ownerNameList[$general['owner']].')</small>';
|
||||
}
|
||||
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "
|
||||
<tr>
|
||||
|
||||
@@ -120,7 +120,7 @@ echo "
|
||||
<td align=center>+$goldincomeList[0] / +$deadIncome</td>
|
||||
<td align=center id=bg1>세곡/둔전</td>
|
||||
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
|
||||
<td align=center id=bg1>지급율</td>
|
||||
<td align=center id=bg1>지급률</td>
|
||||
<td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"{$nation['bill']} %"; echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+60
-10
@@ -10,8 +10,6 @@ $tnmt = Util::getReq('tnmt', 'int', 1);
|
||||
//$detachNPC = Util::getReq('detachNPC', 'bool');
|
||||
$detachNPC = false;
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
if($mode < 0 || $mode > 2){
|
||||
$mode = 2;
|
||||
}
|
||||
@@ -20,21 +18,24 @@ if($tnmt < 0 || $tnmt > 1){
|
||||
$tnmt = 1;
|
||||
}
|
||||
|
||||
$showDieImmediatelyBtn = false;
|
||||
$availableDieImmediately = false;
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime','autorun_user']);
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("내정보", 1);
|
||||
|
||||
$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$query = "select no,npc,mode,tnmt,myset,train,atmos,lastrefresh from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
if ($me['myset'] > 0) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
@@ -48,13 +49,30 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
$me['myset'] -= 1;
|
||||
if($mode == 0){
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'mode'=>$mode,
|
||||
'train'=>max(0, $me['train'] - 3),
|
||||
'atmos'=>max(0, $me['atmos'] - 3),
|
||||
], 'owner=%i AND mode!=%i', $userID, $mode);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'mode'=>$mode
|
||||
], 'owner=%i AND mode!=%i', $userID, $mode);
|
||||
}
|
||||
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'mode'=>$mode,
|
||||
'tnmt'=>$tnmt
|
||||
], 'owner=%i', $userID);
|
||||
if($db->affectedRows()){
|
||||
$me['myset'] -= 1;
|
||||
}
|
||||
|
||||
if($me['tnmt'] != $tnmt){
|
||||
$db->update('general', [
|
||||
'tnmt'=>$tnmt
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$me['mode'] = $mode;
|
||||
$me['tnmt'] = $tnmt;
|
||||
@@ -76,6 +94,16 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if($gameStor->turntime <= $gameStor->opentime){
|
||||
//서버 가오픈시 할 수 있는 행동
|
||||
|
||||
if($me['npc'] == 0){
|
||||
$showDieImmediatelyBtn = true;
|
||||
if(addTurn($me['lastrefresh'], $gameStor->turnterm, 2) <= TimeUtil::DatetimeNow()){
|
||||
$availableDieImmediately = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -91,7 +119,21 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script>
|
||||
var availableDieImmediately = <?=$availableDieImmediately?'true':'false'?>;
|
||||
jQuery(function($){
|
||||
|
||||
$('#die_immediately').click(function(){
|
||||
if(!availableDieImmediately){
|
||||
alert('삭제를 위해서는 생성 후 2턴 가량의 시간이 필요합니다.');
|
||||
location.reload();
|
||||
return false;
|
||||
}
|
||||
return confirm('정말로 삭제하시겠습니까?');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -119,10 +161,18 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
</form>
|
||||
<?php if(!($gameStor->autorun_user['limit_minutes']??false)): ?>
|
||||
휴 가 신 청<br>
|
||||
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
|
||||
<?php endif; ?>
|
||||
<!--빙의 해제용 삭턴 조절<br>
|
||||
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
|
||||
|
||||
<?php if($showDieImmediatelyBtn): ?>
|
||||
가오픈 기간 내 장수 삭제<br>
|
||||
<a href="c_die_immediately.php" id='die_immediately'><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>장수 삭제</button></a><br><br>
|
||||
<?php endif; ?>
|
||||
|
||||
개인용 CSS<br>
|
||||
<textarea id='custom_css' style='color:white;background-color:black;width:420px;height:150px;'></textarea>
|
||||
</td>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$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);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<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>
|
||||
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
<input type=hidden name=num value=-1>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['boardindex'];
|
||||
for($i=0; $i < 20; $i++) {
|
||||
$who = "board{$index}_who";
|
||||
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
if($nation["board{$index}"] != '') { msgprint($nation["board{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["board{$index}_when"], $index, 0); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("국법", 1);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>국 법<br><?=backButton()?></td></tr>
|
||||
<tr><td>
|
||||
|
||||
<?php
|
||||
$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);
|
||||
|
||||
$query = "select rule from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
echo "
|
||||
<form name=form1 method=post action=c_nationrule.php>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px;>{$nation['rule']}</textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
</form>";
|
||||
} else {
|
||||
echo "
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px; readonly>{$nation['rule']}</textarea><br>";
|
||||
}
|
||||
|
||||
?>
|
||||
</td></tr>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+52
-10
@@ -81,6 +81,48 @@ uasort($troops, function($lhs, $rhs){
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/troops.css')?>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
|
||||
$('#form1').submit(function(){
|
||||
return false;
|
||||
});
|
||||
$('#leaveTroop').click(function(e){
|
||||
return confirm("정말 부대를 탈퇴하시겠습니까?");
|
||||
})
|
||||
$('.submitBtn').click(function(event){
|
||||
if(event.isPropagationStopped()){
|
||||
return false;
|
||||
}
|
||||
console.log('b');
|
||||
var $this=$(this);
|
||||
|
||||
$.post({
|
||||
url:'j_troop.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
action:$this.val().replace(/\s/g, ''),
|
||||
troop:$('input.troopId:checked').val(),
|
||||
name:$('#troopName').val(),
|
||||
gen:$('#genNo').val()
|
||||
}
|
||||
}).then(function(data){
|
||||
console.log(data);
|
||||
if(!data.result){
|
||||
alert(data.reason);
|
||||
location.reload();
|
||||
}
|
||||
|
||||
location.reload();
|
||||
|
||||
}, function(){
|
||||
alert('알 수 없는 에러가 발생했습니다.');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -88,7 +130,7 @@ uasort($troops, function($lhs, $rhs){
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<form name=form1 method=post action=c_troop.php>
|
||||
<form id=form1 name=form1 method=post>
|
||||
<table id="troop_list" class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -102,9 +144,9 @@ uasort($troops, function($lhs, $rhs){
|
||||
<tfoot><tr><td colspan='5'>
|
||||
<?php if(!$troops): ?>
|
||||
<?php elseif($me['troop'] == 0): ?>
|
||||
<input type=submit name=btn value='부 대 가 입'>
|
||||
<input type=submit class='submitBtn' value='부 대 가 입'>
|
||||
<?php else: ?>
|
||||
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm("정말 부대를 탈퇴하시겠습니까?")'>
|
||||
<input type=submit id="leaveTroop" class='submitBtn' value='부 대 탈 퇴'>
|
||||
<?php endif;?>
|
||||
</td></tr></tfoot>
|
||||
<tbody>
|
||||
@@ -133,7 +175,7 @@ foreach ($troops as $troopNo=>$troop) {
|
||||
|
||||
<?php if ($me['troop'] == 0): ?>
|
||||
<tr>
|
||||
<td align=center rowspan=2><input type='radio' name='troop' value='<?=$troop['troop']?>'></td>
|
||||
<td align=center rowspan=2><input type='radio' class='troopId' name='troop' value='<?=$troop['troop']?>'></td>
|
||||
<td align=center><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
|
||||
<td height=64 class='generalIcon' style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||
@@ -152,15 +194,15 @@ foreach ($troops as $troopNo=>$troop) {
|
||||
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||
<td rowspan=2>
|
||||
<?php if ($me['no'] == $troopLeader['no']): ?>
|
||||
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
|
||||
<select id='genNo' name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
|
||||
<?php foreach ($troop['users'] as $troopUser): ?>
|
||||
<?php if ($troopUser['no'] == $me['no']) {
|
||||
continue;
|
||||
} ?>
|
||||
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
|
||||
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
|
||||
<?php endforeach; ?>
|
||||
</select><br>
|
||||
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>
|
||||
<input type=submit class='submitBtn' value='부 대 추 방' style=width:130px;height:25px;>
|
||||
<?php else: ?>
|
||||
<?=$troopLeader['turnText']?>
|
||||
<?php endif; ?>
|
||||
@@ -181,11 +223,11 @@ foreach ($troops as $troopNo=>$troop) {
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=80 id=bg1>부 대 명</td>
|
||||
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
|
||||
<td width=130><input id='troopName' type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
|
||||
<?php if($me['troop'] == 0): ?>
|
||||
<td><input type=submit name=btn value='부 대 창 설'></td>
|
||||
<td><input type=submit class='submitBtn' value='부 대 창 설'></td>
|
||||
<?php else: ?>
|
||||
<td><input type=submit name=btn value='부 대 변 경'></td>
|
||||
<td><input type=submit class='submitBtn' value='부 대 변 경'></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -255,7 +255,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<option value="1">일반</option>
|
||||
<option value="4">태수</option>
|
||||
<option value="3">군사</option>
|
||||
<option value="2">시중</option>
|
||||
<option value="2">종사</option>
|
||||
<option value="10">무장 수뇌</option>
|
||||
<option value="9">지장 수뇌</option>
|
||||
<option value="11">참모</option>
|
||||
|
||||
@@ -27,7 +27,6 @@ $sel = Util::getReq('sel', 'int');
|
||||
$msg = '';
|
||||
$msg2 = '';
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$title = Util::getReq('title');
|
||||
$msg = Util::getReq('msg');
|
||||
$num = Util::getReq('num', 'int');
|
||||
$reply = Util::getReq('reply');
|
||||
// $title, $msg, $num
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if (getBlockLevel() == 1 || getBlockLevel() == 3) {
|
||||
header('location:b_chiefboard.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
$title = str_replace("|", " ", $title);
|
||||
$msg = str_replace("|", " ", $msg);
|
||||
$reply = str_replace("|", " ", $reply);
|
||||
$title = trim($title);
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
$num = $nation['coreindex'] + 1;
|
||||
if($num >= 20) { $num = 0; }
|
||||
$msg = $title."|".$msg;
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='{$me['no']}',coreboard{$num}_when='$date' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update nation set coreindex='$num' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//$num에 댓글시
|
||||
} elseif($num >= 0 && $reply != "") {
|
||||
$newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
|
||||
$newmsg = addslashes(SQ2DQ($newmsg));
|
||||
|
||||
$query = "update nation set coreboard{$num}='$newmsg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
header('location:b_chiefboard.php');
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$availableDieImmediately = false;
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$general = $db->queryFirstRow('SELECT no,name,name2,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myPage.php');
|
||||
die();
|
||||
}
|
||||
|
||||
increaseRefresh("장수 삭제", 1);
|
||||
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime', 'year', 'month']);
|
||||
|
||||
if($gameStor->turntime <= $gameStor->opentime){
|
||||
//서버 가오픈시 할 수 있는 행동
|
||||
if(addTurn($general['lastrefresh'], $gameStor->turnterm, 2) <= TimeUtil::DatetimeNow()){
|
||||
$availableDieImmediately = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$availableDieImmediately){
|
||||
header('location:b_myPage.php');
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if(!$db->query('DELETE FROM general WHERE owner=%i AND npc=0', $userID)){
|
||||
trigger_error("올바르지 않은 삭제 프로세스 $userID", E_USER_WARNING);
|
||||
}
|
||||
$generalName = $general['name'];
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
pushGeneralPublicRecord(["<C>●</>{$gameStor->month}월:<Y>{$generalName}</>{$josaYi} 이 홀연히 모습을 <R>감추었습니다</>"], $gameStor->year, $gameStor->month);
|
||||
|
||||
|
||||
|
||||
$session->logoutGame();
|
||||
header('location:..');
|
||||
+9
-6
@@ -12,19 +12,22 @@ $rate = Util::getReq('rate', 'int');
|
||||
$bill = Util::getReq('bill', 'int');
|
||||
$secretlimit = Util::getReq('secretlimit', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`level` FROM general WHERE `owner`=%i', $userID);
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
//내가 수뇌부이어야함
|
||||
if($me['level'] < 5) {
|
||||
header('location:b_myBossInfo.php');
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
else if ($me['level'] < 5 && $permission != 4) {
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -44,7 +47,7 @@ if($btn == "국가방침 수정") {
|
||||
$db->update('nation', [
|
||||
'rate'=>$rate,
|
||||
], 'nation=%i', $me['nation']);
|
||||
} elseif($btn == "지급율") {
|
||||
} elseif($btn == "지급률") {
|
||||
$bill = Util::valueFit($bill, 20, 200);
|
||||
$db->update('nation', [
|
||||
'bill'=>$bill
|
||||
|
||||
+32
-10
@@ -55,7 +55,7 @@ if($command == 46) {
|
||||
$query['turn'.$turnIdx] = $comStr;
|
||||
}
|
||||
$db->update('general', $query, 'owner=%i', $userID);
|
||||
header('Location:./');
|
||||
header('Location:./', true, 303);
|
||||
die();
|
||||
|
||||
}
|
||||
@@ -82,7 +82,7 @@ if($command == 53) {
|
||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
header('location:b_chiefcenter.php');
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -93,11 +93,6 @@ if($command == 61) {
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
$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),"");
|
||||
|
||||
$count = count($turn);
|
||||
$str = "type=type";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
@@ -107,10 +102,35 @@ if($command == 61) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
header('location:b_chiefcenter.php');
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
// 국호변경
|
||||
if($command == 82) {
|
||||
$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);
|
||||
|
||||
$name = StringUtil::neutralize($name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$name
|
||||
], 'owner=%i', $userID);
|
||||
|
||||
$count = count($turn);
|
||||
$str = "type=type";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$str .= ",l{$me['level']}turn{$turn[$i]}='{$comStr}'";
|
||||
}
|
||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
//포상, 몰수, 발령, 항복권고, 원조
|
||||
//선전포고, 종전, 파기, 초토화, 천도, 증축, 감축
|
||||
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
|
||||
@@ -131,15 +151,17 @@ if($command == 23 || $command == 24 || $command == 27 || $command == 51 || $comm
|
||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
header('location:b_chiefcenter.php');
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//일반 턴
|
||||
$query = [];
|
||||
foreach($turn as $turnIdx){
|
||||
$query['turn'.$turnIdx] = $comStr;
|
||||
}
|
||||
$db->update('general', $query, 'owner=%i', $userID);
|
||||
header('Location:./');
|
||||
header('Location:./', true, 303);
|
||||
|
||||
|
||||
+60
-35
@@ -11,8 +11,6 @@ $genlist = Util::getReq('genlist', 'int');
|
||||
$outlist = Util::getReq('outlist', 'int');
|
||||
$citylist = Util::getReq('citylist', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -34,7 +32,7 @@ $ruler = MYDB_fetch_array($result);
|
||||
|
||||
//수뇌가 아니면 아무것도 할 수 없음
|
||||
if($meLevel < 5){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -47,39 +45,52 @@ if($btn == "임명") {
|
||||
}
|
||||
|
||||
if($genlist != 0 && !$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||
if($meLevel < 5 || ($genlist != 0 && $general['nation'] != $me['nation']) || ($genlist != 0 && $general['level'] == 12)) {
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
} elseif($btn == "추방") {
|
||||
if(!$outlist){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr from general where no='$outlist'";
|
||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr,permission,penalty,belong from general where no='$outlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if(!$general){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
|
||||
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) {
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
//추방할사람이 외교권자이면 불가
|
||||
$permission = checkSecretPermission($general);
|
||||
if($permission == 4){
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
//NPC 부대장 추방 불가
|
||||
if($general['npc'] == 5){
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//나와 대상 장수는 국가가 같아야 함
|
||||
if($genlist != 0 && $me['nation'] != $general['nation']){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -139,18 +150,21 @@ if($btn == "추방") {
|
||||
'level'=>0,
|
||||
'nation'=>0,
|
||||
'belong'=>0,
|
||||
'permission'=>'normal',
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'level'=>0,
|
||||
'permission'=>'normal',
|
||||
'nation'=>0,
|
||||
'belong'=>0,
|
||||
'betray'=>$db->sqleval('betray + 1'),
|
||||
'makelimit'=>12,
|
||||
'gold'=>$general['gold'],
|
||||
'rice'=>$general['rice'],
|
||||
'experience'=>$db->sqleval('experience * (1 - 0.1*betray)'),
|
||||
'dedication'=>$db->sqleval('dedication * (1 - 0.1*betray)'),
|
||||
'betray'=>$db->sqleval('betray + 1'),
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
}
|
||||
@@ -238,7 +252,7 @@ if($btn == "추방") {
|
||||
pushGenLog($general, $log);
|
||||
pushGeneralPublicRecord($alllog, $year, $month);
|
||||
}
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -289,34 +303,36 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
|
||||
}
|
||||
}
|
||||
}
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
|
||||
switch($level) {
|
||||
case 4: $lv = 1; break;
|
||||
case 3: $lv = 2; break;
|
||||
case 2: $lv = 3; break;
|
||||
case 4: $genlv = 'gen1'; $genlvset = 'gen1set'; break;
|
||||
case 3: $genlv = 'gen2'; $genlvset = 'gen2set'; break;
|
||||
case 2: $genlv = 'gen3'; $genlvset = 'gen3set'; break;
|
||||
}
|
||||
|
||||
$query = "select gen{$lv} from city where nation='{$me['nation']}' and city='$citylist'";
|
||||
$query = "select {$genlv} from city where nation='{$me['nation']}' and city='$citylist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
if(!$city){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
die();
|
||||
}
|
||||
$oldlist = $city["gen{$lv}"];
|
||||
$oldlist = $city[$genlv];
|
||||
|
||||
if($oldlist != 0) {
|
||||
//기존 장수 일반으로
|
||||
$query = "update general set level=1 where no='$oldlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'level'=>1
|
||||
], 'no=%i', $oldlist);
|
||||
//기존 자리 공석으로
|
||||
$query = "update city set gen{$lv}=0 where city='$citylist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('city', [
|
||||
$genlv=>0
|
||||
], 'city = %i AND nation = %i', $citylist , $me['nation']);
|
||||
}
|
||||
if($genlist != 0) {
|
||||
$valid = 0;
|
||||
@@ -328,24 +344,33 @@ if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
|
||||
|
||||
if($valid == 1) {
|
||||
// 신임 장수의 원래 자리 해제
|
||||
$query = "update city set gen1=0 where gen1='$genlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2=0 where gen2='$genlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen3=0 where gen3='$genlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('city', [
|
||||
'gen1'=>0,
|
||||
], 'gen1=%i', $genlist);
|
||||
$db->update('city', [
|
||||
'gen2'=>0,
|
||||
], 'gen2=%i', $genlist);
|
||||
$db->update('city', [
|
||||
'gen3'=>0,
|
||||
], 'gen3=%i', $genlist);
|
||||
|
||||
//신임 장수
|
||||
$query = "update general set level='$level' where no='$genlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen{$lv}='$genlist',gen{$lv}set='1' where city='$citylist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('city', [
|
||||
$genlv=>$genlist,
|
||||
$genlvset=>1
|
||||
], 'city=%i AND nation=%i', $citylist, $general['nation']);
|
||||
if($db->affectedRows() > 0){
|
||||
$db->update('general',[
|
||||
'level'=>$level
|
||||
], 'no=%i', $genlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $title, $msg, $num
|
||||
$title = Util::getReq('title');
|
||||
$msg = Util::getReq('msg');
|
||||
$num = Util::getReq('num', 'int');
|
||||
$reply = Util::getReq('reply');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$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);
|
||||
|
||||
$title = str_replace("|", " ", $title);
|
||||
$msg = str_replace("|", " ", $msg);
|
||||
$reply = str_replace("|", " ", $reply);
|
||||
$title = trim($title);
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
$num = $nation['boardindex'] + 1;
|
||||
if($num >= 20) { $num = 0; }
|
||||
$msg = $title."|".$msg;
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set board{$num}='$msg',board{$num}_who='{$me['no']}',board{$num}_when='$date' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update nation set boardindex='$num' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//$num에 댓글시
|
||||
} elseif($num >= 0 && $reply != "") {
|
||||
$newmsg = $nation["board{$num}"]."|".$me['no']."|".$reply;
|
||||
$newmsg = addslashes(SQ2DQ($newmsg));
|
||||
|
||||
$query = "update nation set board{$num}='$newmsg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
|
||||
header('location:b_nationboard.php');
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $msg
|
||||
$msg = Util::getReq('msg');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$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 = addslashes(SQ2DQ($msg));
|
||||
|
||||
$query = "update nation set rule='$msg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
header('location:b_nationrule.php');
|
||||
@@ -14,8 +14,6 @@ $gen = Util::getReq('gen', 'int');
|
||||
$sel = Util::getReq('sel', 'int');
|
||||
$trig = Util::getReq('trig', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $btn, $name, $troop
|
||||
$btn = Util::getReq('btn');
|
||||
$name = Util::getReq('name');
|
||||
$gen = Util::getReq('gen', 'int');
|
||||
$troop = Util::getReq('troop', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = $session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$me = $db->queryFirstRow('SELECT `no`, nation, troop FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
$name = trim($name);
|
||||
if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
|
||||
$db->insert('troop',[
|
||||
'name'=>$name,
|
||||
'nation'=>$me['nation'],
|
||||
'no'=>$me['no']
|
||||
]);
|
||||
$troopID = $db->insertId();
|
||||
|
||||
$db->update('general', [
|
||||
'troop'=>$troopID
|
||||
], 'no=%i',$me['no']);
|
||||
} elseif($btn == "부 대 변 경" && $name != "") {
|
||||
$db->update('troop', [
|
||||
'name'=>$name
|
||||
], 'no=%i',$me['no']);
|
||||
} elseif($btn == "부 대 추 방" && $gen != 0) {
|
||||
$db->update('general', [
|
||||
'troop'=>0
|
||||
], 'no=%i AND troop=(SELECT troop FROM troop WHERE no = %i)', $gen, $me['no']);
|
||||
} elseif($btn == "부 대 가 입" && $troop != 0) {
|
||||
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $troop);
|
||||
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `nation`=%i', $troopLeader, $me['nation']);
|
||||
if($troopLeaderNation){
|
||||
$db->update('general', [
|
||||
'troop'=>$troop
|
||||
], 'no=%i', $me['no']);
|
||||
}
|
||||
} elseif($btn == "부 대 탈 퇴") {
|
||||
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $me['troop']);
|
||||
|
||||
//부대장일 경우
|
||||
if($troopLeader == $me['no']) {
|
||||
// 모두 탈퇴
|
||||
$db->update('general', [
|
||||
'troop'=>0
|
||||
], 'troop=%i',$me['troop']);
|
||||
// 부대 삭제
|
||||
$db->delete('troop', 'troop=%i', $me['troop']);
|
||||
} else {
|
||||
$db->update('general', [
|
||||
'troop'=>0
|
||||
], 'no=%i', $me['no']);
|
||||
}
|
||||
}
|
||||
|
||||
header('Location:b_troop.php');
|
||||
+10
-2
@@ -10,10 +10,18 @@ $userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$autorun_user = $gameStor->autorun_user;
|
||||
if($autorun_user['limit_minutes']??false){
|
||||
//자동 턴인 경우에는 휴가 불가
|
||||
header('location:b_myPage.php', true, 303);
|
||||
}
|
||||
|
||||
$killturn = $gameStor->killturn;
|
||||
|
||||
$db->update('general', ['killturn'=>$killturn*3], 'owner=%i', $userID);
|
||||
$db->update('general', [
|
||||
'killturn'=>$killturn*3,
|
||||
], 'owner=%i', $userID);
|
||||
|
||||
|
||||
header('location:b_myPage.php');
|
||||
header('location:b_myPage.php', true, 303);
|
||||
|
||||
|
||||
+2
-4
@@ -10,8 +10,6 @@ $comment = Util::getReq('comment');
|
||||
$title = Util::getReq('title');
|
||||
$str = Util::getReq('str');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -51,7 +49,7 @@ else if($btn == "댓글" && trim($comment) != "") {
|
||||
}
|
||||
|
||||
if(!$isVoteAdmin){
|
||||
header('location:a_vote.php');
|
||||
header('location:a_vote.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -87,4 +85,4 @@ if($btn == "수정") {
|
||||
$gameStor->voteopen = 2;
|
||||
}
|
||||
|
||||
header('location:a_vote.php');
|
||||
header('location:a_vote.php', true, 303);
|
||||
+8
-69
@@ -8,66 +8,10 @@ $session = Session::getInstance()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>커맨드리스트</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if(!$session->isGameLoggedIn()){
|
||||
echo 'window.parent.location.href = "../";';
|
||||
if (!$session->isGameLoggedIn()) {
|
||||
die('<script>window.location.href = "../"</script>');
|
||||
}
|
||||
?>
|
||||
function myclock() {
|
||||
lastday = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
|
||||
|
||||
date = document.clock.clock.value;
|
||||
|
||||
year = parseInt(date.substr(0, 4), 10);
|
||||
month = parseInt(date.substr(5,2), 10);
|
||||
day = parseInt(date.substr(8, 2), 10);
|
||||
hour = parseInt(date.substr(11, 2), 10);
|
||||
min = parseInt(date.substr(14, 2), 10);
|
||||
sec = parseInt(date.substr(17, 2), 10);
|
||||
|
||||
//윤년계산
|
||||
if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { lastday[1] = 29; }
|
||||
else { lastday[1] = 28; }
|
||||
|
||||
// if(term > 0) term--;
|
||||
|
||||
sec++;
|
||||
if(sec >= 60) { sec = 0; min++; }
|
||||
if(min >= 60) { min = 0; hour++; }
|
||||
if(hour >= 24) { hour = 0; day++; }
|
||||
if(day > lastday[month-1]) { month++; day = 1; }
|
||||
if(month >= 13) { year++; month = 1; }
|
||||
if(month < 10) { month = '0' + month; }
|
||||
if(day < 10) { day = '0' + day; }
|
||||
if(hour < 10) { hour = '0' + hour; }
|
||||
if(min < 10) { min = '0' + min; }
|
||||
if(sec < 10) { sec = '0' + sec; }
|
||||
date = '' + year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec;
|
||||
|
||||
document.clock.clock.value = date;
|
||||
|
||||
window.setTimeout("myclock();", 1000);
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body OnLoad='myclock()'>
|
||||
<?php
|
||||
myCommandList();
|
||||
|
||||
function myCommandList() {
|
||||
@@ -76,9 +20,10 @@ function myCommandList() {
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date_precise = (new \DateTime())->format("Y-m-d H:i:s.u");
|
||||
|
||||
// 명령 목록
|
||||
$admin = $gameStor->getValues(['year','month','turnterm']);
|
||||
$admin = $gameStor->getValues(['year','month','turnterm','turntime','opentime']);
|
||||
|
||||
$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){
|
||||
@@ -88,16 +33,15 @@ function myCommandList() {
|
||||
$turn = getTurn($me, 2);
|
||||
|
||||
echo "<table width=300 height=700 class='tb_layout bg2'>
|
||||
<form name=clock>
|
||||
<tr>
|
||||
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
|
||||
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text id=clock size=19 style=background-color:black;color:white;border-style:none; data-server-time='{$date_precise}'></b></td>
|
||||
</tr>";
|
||||
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'];
|
||||
// 실행된 턴시간이면 +1
|
||||
$cutTurn = cutTurn($me['turntime'], $admin['turnterm']);
|
||||
if($date <= $cutTurn) { $month++; }
|
||||
if($date <= $cutTurn && $date >= $admin['opentime']) { $month++; }
|
||||
|
||||
$totaldate = $me['turntime'];
|
||||
|
||||
@@ -111,7 +55,7 @@ function myCommandList() {
|
||||
echo "
|
||||
<tr height=28>
|
||||
<td width=24 align=center height=24 id=bg0><b>$j</b></td>
|
||||
<td width=71 align=center height=24 id=bg1 style='overflow:hidden;'><b>{$year}年 {$month}月</b></td>
|
||||
<td width=71 align=center height=24 id=bg1 style='max-width:68px;white-space:nowrap;overflow:hidden;'><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>";
|
||||
@@ -120,11 +64,6 @@ function myCommandList() {
|
||||
}
|
||||
|
||||
echo "
|
||||
</form>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#newArticle{
|
||||
width:1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.titleInput{
|
||||
width:100%;
|
||||
color:white;
|
||||
background-color:transparent;
|
||||
border:none;
|
||||
margin:1px 5px;
|
||||
}
|
||||
|
||||
.contentInput{
|
||||
width:100%;
|
||||
min-height:3em;
|
||||
color:white;
|
||||
background-color:transparent;
|
||||
border:none;
|
||||
padding:1px 5px;
|
||||
}
|
||||
|
||||
.articleFrame{
|
||||
width:1000px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.commentText{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.authorName, .comment .author{
|
||||
width:110px;
|
||||
font-size:85%;
|
||||
}
|
||||
|
||||
.date{
|
||||
width:125px;
|
||||
font-size:85%;
|
||||
}
|
||||
|
||||
.text{
|
||||
text-align:left;
|
||||
padding:1px 5px;
|
||||
}
|
||||
|
||||
.submitComment{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.commentText{
|
||||
color:white;
|
||||
background-color:transparent;
|
||||
border:none;
|
||||
padding:1px 5px;
|
||||
}
|
||||
@@ -192,10 +192,21 @@ div.bar_out div.bar_in{
|
||||
font-family: '맑은 고딕';
|
||||
}
|
||||
|
||||
.tooltip_copyable_info .tooltiptext{
|
||||
display: inline;
|
||||
color: rgba(0,0,0,0);
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.tooltiptext {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden_but_copyable{
|
||||
color: rgba(0,0,0,0);
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.btn-group-xs > .btn, .btn-xs {
|
||||
padding : .25rem .4rem;
|
||||
font-size : .875rem;
|
||||
@@ -218,3 +229,19 @@ div.bar_out div.bar_in{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.select2-selection--single.simple-select2-align-center .select2-selection__rendered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.select2-dropdown.simple-select2-align-center li.select2-results__option{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection--single.text-secondary .select2-selection__rendered{
|
||||
color:white;
|
||||
}
|
||||
|
||||
.select2-container--bootstrap4 .text-secondary .select2-results__option[aria-selected=false]{
|
||||
color:white;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
#newLetter {
|
||||
width:1000px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
#newLetter th{
|
||||
width:20ch;
|
||||
}
|
||||
|
||||
#newLetter textarea{
|
||||
width:100%;
|
||||
min-height:3em;
|
||||
color:white;
|
||||
background-color:transparent;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.letterFrame{
|
||||
width:1000px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.letterFrame th{
|
||||
width:20ch;
|
||||
}
|
||||
|
||||
.letterHeader{
|
||||
position: relative;
|
||||
font-size:200%;
|
||||
}
|
||||
|
||||
.letterDate{
|
||||
position: absolute;
|
||||
right:1ch;
|
||||
bottom:0.2em;
|
||||
font-size:50%;
|
||||
|
||||
}
|
||||
|
||||
.letterBrief, .letterDetail{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.letterSignerPlate{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.letterSrc, .letterDest{
|
||||
display:inline-block;
|
||||
margin: 0 10px;
|
||||
border: 1px solid gray;
|
||||
width:110px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.signerNation, .signerName{
|
||||
border-top: 1px solid gray;
|
||||
}
|
||||
+1
-1
@@ -67,4 +67,4 @@ color:white;
|
||||
|
||||
.nation_info td{
|
||||
height:18px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.map_title_tooltiptext .tooltip-inner{
|
||||
max-width:220px;
|
||||
width:220px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.map_title_text{
|
||||
margin:auto;
|
||||
text-align:center;
|
||||
@@ -55,6 +61,7 @@
|
||||
position:absolute;
|
||||
right:0;
|
||||
bottom:0;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.map_body .map_toggle_cityname::after{
|
||||
@@ -65,6 +72,18 @@
|
||||
content: "켜기"
|
||||
}
|
||||
|
||||
.map_body .map_toggle_single_tap{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.map_body .map_toggle_single_tap::after{
|
||||
content: "끄기"
|
||||
}
|
||||
|
||||
.map_body .map_toggle_single_tap.active::after{
|
||||
content: "켜기"
|
||||
}
|
||||
|
||||
.world_map .city_tooltip{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
|
||||
+27
-3
@@ -59,12 +59,16 @@
|
||||
height:667px;
|
||||
}
|
||||
|
||||
.private_message{
|
||||
height:667px;
|
||||
.diplomacy_message{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.national_message{
|
||||
height:1350px;
|
||||
height:667px;
|
||||
}
|
||||
|
||||
.private_message{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.msg_icon{
|
||||
@@ -83,6 +87,7 @@
|
||||
font-weight: bold;
|
||||
margin-bottom:3px;
|
||||
color:white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.message_input_form{
|
||||
@@ -129,6 +134,16 @@
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.board_side > div{
|
||||
height: 1.2em;
|
||||
}
|
||||
|
||||
.msg_invalid{
|
||||
color:rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
@@ -143,6 +158,14 @@
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.btn-delete-msg{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin:2px 2px 0 2px;
|
||||
font-size:8px;
|
||||
}
|
||||
|
||||
/*
|
||||
.public_message .msg_target{
|
||||
box-shadow: 2px 2px darkslategrey;
|
||||
@@ -164,6 +187,7 @@
|
||||
.msg_content{
|
||||
margin-left:10px;
|
||||
margin-right:5px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.msg_prompt{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace sammo;
|
||||
class UniqueConst{
|
||||
public static $serverID = '_tK_serverID_';
|
||||
public static $serverName = '_tK_serverName_';
|
||||
public static $seasonIdx = '_tK_seasonIdx_';
|
||||
|
||||
private function __construct(){}
|
||||
|
||||
|
||||
+449
-261
@@ -243,7 +243,7 @@ function cityInfo() {
|
||||
<td height=7>".bar($wall)."</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시세</b></td>
|
||||
<td height=7>".bar($trade)."</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시중</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>종사</b></td>
|
||||
<td rowspan=2 style='text-align:center;'>{$gen3['name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -271,6 +271,11 @@ function myNationInfo() {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if(!$nation){
|
||||
$nation = getNationStaticInfo(0);
|
||||
$nation['tech'] = 0;
|
||||
}
|
||||
|
||||
$query = "select COUNT(*) as cnt, SUM(pop) as totpop, SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
@@ -322,7 +327,7 @@ function myNationInfo() {
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$nation['rice']}";echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bg1 center'><b>지급율</b></td>
|
||||
<td class='bg1 center'><b>지급률</b></td>
|
||||
<td class='center'>";
|
||||
if($me['nation'] == 0) {
|
||||
echo "해당 없음";
|
||||
@@ -341,6 +346,7 @@ function myNationInfo() {
|
||||
|
||||
$techCall = getTechCall($nation['tech']);
|
||||
|
||||
|
||||
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $nation['tech'] = "<font color=magenta>{$nation['tech']}</font>"; }
|
||||
else { $nation['tech'] = "<font color=limegreen>{$nation['tech']}</font>"; }
|
||||
|
||||
@@ -399,25 +405,89 @@ function myNationInfo() {
|
||||
";
|
||||
}
|
||||
|
||||
function checkSecretMaxPermission($me){
|
||||
$secretMax = 4;
|
||||
if($penalty['noTopSecret']??false){
|
||||
$secretMax = 1;
|
||||
}
|
||||
else if($penalty['noChief']??false){
|
||||
$secretMax = 1;
|
||||
}
|
||||
else if($penalty['noAmbassador']??false){
|
||||
$secretMax = 2;
|
||||
}
|
||||
return $secretMax;
|
||||
}
|
||||
|
||||
function checkSecretPermission($me, $checkSecretLimit=true){
|
||||
if(!key_exists('penalty', $me) || !key_exists('permission', $me)){
|
||||
trigger_error ('canAccessSecret() 함수에 필요한 인자가 부족');
|
||||
}
|
||||
$penalty = Json::decode($me['penalty'])??[];
|
||||
$permission = $me['permission'];
|
||||
|
||||
if(!$me['nation']){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if($me['level'] == 0){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if($pernalty['noSecret']??false){
|
||||
return 0;
|
||||
}
|
||||
|
||||
$secretMin = 0;
|
||||
$secretMax = checkSecretMaxPermission($me);
|
||||
|
||||
|
||||
if($me['level'] == 12){
|
||||
$secretMin = 4;
|
||||
}
|
||||
else if($me['permission'] == 'ambassador'){
|
||||
$secretMin = 4;
|
||||
}
|
||||
else if($me['permission'] == 'auditor'){
|
||||
$secretMin = 3;
|
||||
}
|
||||
else if($me['level'] >= 5){
|
||||
$secretMin = 2;
|
||||
}
|
||||
else if($me['level'] > 1){
|
||||
$secretMin = 1;
|
||||
}
|
||||
else if($checkSecretLimit){
|
||||
$db = DB::db();
|
||||
$secretLimit = $db->queryFirstField('SELECT secretlimit FROM nation WHERE nation = %i', $me['nation']);
|
||||
if ($me['belong'] >= $secretLimit) {
|
||||
$secretMin = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return min($secretMin, $secretMax);
|
||||
}
|
||||
|
||||
function addCommand($typename, $value, $valid = 1, $color=0) {
|
||||
if($valid == 1) {
|
||||
switch($color) {
|
||||
case 0:
|
||||
echo "
|
||||
<option style=color:white;background-color:black; value={$value}>{$typename}</option>";
|
||||
<option style='color:white;background-color:black;' value='{$value}'>{$typename}</option>";
|
||||
break;
|
||||
case 1:
|
||||
echo "
|
||||
<option style=color:skyblue;background-color:black; value={$value}>{$typename}</option>";
|
||||
<option style='color:skyblue;background-color:black;' value='{$value}'>{$typename}</option>";
|
||||
break;
|
||||
case 2:
|
||||
echo "
|
||||
<option style=color:orange;background-color:black; value={$value}>{$typename}</option>";
|
||||
<option style='color:orange;background-color:black;' value='{$value}'>{$typename}</option>";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
echo "
|
||||
<option style=color:white;background-color:red; value={$value}>{$typename}(불가)</option>";
|
||||
<option style='color:white;background-color:red;' value='{$value}'>{$typename}(불가)</option>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +507,7 @@ function commandTable() {
|
||||
$connect=$db->get();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario']);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario', 'join_mode']);
|
||||
|
||||
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -493,7 +563,7 @@ function commandTable() {
|
||||
<select name=commandtype size=1 style='height:20px;width:260px;color:white;background-color:black;font-size:12px;'>";
|
||||
addCommand("휴 식", 0);
|
||||
addCommand("요 양", 50);
|
||||
commandGroup("========= 내 정 ==========");
|
||||
commandGroup("======= 내 정 ========");
|
||||
if($me['level'] >= 1 && ($citycount != 0 || $admin['year'] >= $admin['startyear']+3) && $city['supply'] != 0) {
|
||||
addCommand("농지개간(지력경험, 자금$develcostA)", 1, 1, $colorA);
|
||||
addCommand("상업투자(지력경험, 자금$develcostA)", 2, 1, $colorA);
|
||||
@@ -519,7 +589,7 @@ function commandTable() {
|
||||
addCommand("물자조달(랜덤경험)", 9, 0);
|
||||
}
|
||||
commandGroup("", 1);
|
||||
commandGroup("========= 군 사 ==========");
|
||||
commandGroup("======= 군 사 ========");
|
||||
if($me['level'] >= 1 && $citycount > 0) {
|
||||
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31);
|
||||
addCommand("징병(통솔경험)", 11);
|
||||
@@ -544,7 +614,7 @@ function commandTable() {
|
||||
}
|
||||
|
||||
commandGroup("", 1);
|
||||
commandGroup("========= 인 사 ==========");
|
||||
commandGroup("======= 인 사 ========");
|
||||
addCommand("이동(통솔경험, 자금$develcost, 사기↓)", 21);
|
||||
addCommand("강행(통솔경험, 자금$develcost5, 병력/사기/훈련↓)", 30);
|
||||
|
||||
@@ -554,7 +624,10 @@ function commandTable() {
|
||||
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
||||
}
|
||||
|
||||
if($me['level'] >= 1 && $city['supply'] != 0) {
|
||||
if($admin['join_mode'] == 'onlyRandom'){
|
||||
//do Nothing
|
||||
}
|
||||
else if($me['level'] >= 1 && $city['supply'] != 0) {
|
||||
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
||||
} else {
|
||||
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
||||
@@ -576,7 +649,7 @@ function commandTable() {
|
||||
addCommand("임관", 25, 0);
|
||||
}
|
||||
commandGroup("", 1);
|
||||
commandGroup("========= 계 략 ==========");
|
||||
commandGroup("======= 계 략 ========");
|
||||
if($me['level'] >= 1 && (($nation['level'] > 0 && $city['nation'] == $me['nation'] && $city['supply'] != 0) || $nation['level'] == 0)) {
|
||||
addCommand("화계(지력경험, 자금$develcost5, 군량$develcost5)", 32);
|
||||
addCommand("탈취(무력경험, 자금$develcost5, 군량$develcost5)", 33);
|
||||
@@ -589,11 +662,15 @@ function commandTable() {
|
||||
addCommand("선동(통솔경험, 자금$develcost5, 군량$develcost5)", 35, 0);
|
||||
}
|
||||
commandGroup("", 1);
|
||||
commandGroup("========= 개 인 ==========");
|
||||
commandGroup("======= 개 인 ========");
|
||||
addCommand("내정 특기 초기화(3턴, 1회만)", 38);
|
||||
addCommand("전투 특기 초기화(3턴, 1회만)", 39);
|
||||
if($me['level'] >= 1) {
|
||||
addCommand("단련(자금$develcost, 군량$develcost)", 41);
|
||||
addCommand("숙련전환(통솔경험, 자금$develcost, 군량$develcost)", 58);
|
||||
} else {
|
||||
addCommand("단련(자금$develcost, 군량$develcost)", 41, 0);
|
||||
addCommand("숙련전환(통솔경험, 자금$develcost, 군량$develcost)", 58, 0);
|
||||
}
|
||||
addCommand("견문(자금?, 군량?, 경험치?)", 42);
|
||||
if($city['trade'] > 0 || $me['special'] == 30) {
|
||||
@@ -682,9 +759,10 @@ function CoreCommandTable() {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select level,can_change_flag from nation where nation='{$me['nation']}'";
|
||||
$query = "select level,can_change_flag,aux from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nationAux = Json::decode($nation['aux']);
|
||||
|
||||
$query = "select no from general where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -709,7 +787,7 @@ function CoreCommandTable() {
|
||||
addCommand("몰수", 24, $valid);
|
||||
commandGroup("", 1);
|
||||
commandGroup("====== 외 교 ======");
|
||||
addCommand("통합 제의", 53, $valid);
|
||||
//addCommand("통합 제의", 53, $valid);
|
||||
|
||||
addCommand("항복 권고", 51, $valid);
|
||||
if($nation['level'] >= 2) {
|
||||
@@ -725,7 +803,7 @@ function CoreCommandTable() {
|
||||
commandGroup("====== 특 수 ======");
|
||||
addCommand("초토화", 65, $valid);
|
||||
addCommand("천도/3턴(금쌀{$develcost}0)", 66, $valid);
|
||||
$cost = $develcost * 500 + 60000; // 7만~13만
|
||||
$cost = $develcost * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost; // 7만~13만
|
||||
addCommand("증축/6턴(금쌀{$cost})", 67, $valid);
|
||||
addCommand("감축/6턴", 68, $valid);
|
||||
commandGroup("", 1);
|
||||
@@ -754,6 +832,12 @@ function CoreCommandTable() {
|
||||
} else {
|
||||
addCommand("국기 변경", 81, 0);
|
||||
}
|
||||
if($nation['level']==7 && !($nationAux['used_82']??0)){
|
||||
addCommand("국호 변경", 82, 1);
|
||||
}
|
||||
else{
|
||||
addCommand("국호 변경", 82, 0);
|
||||
}
|
||||
commandGroup("", 1);
|
||||
echo "
|
||||
</select>
|
||||
@@ -798,8 +882,6 @@ function generalInfo($no) {
|
||||
$lbonus = "";
|
||||
}
|
||||
|
||||
$troop = getTroop($general['troop']);
|
||||
|
||||
$level = getLevel($general['level'], $nation['level']);
|
||||
if($general['level'] == 2) {
|
||||
$query = "select name from city where gen3='{$general['no']}'";
|
||||
@@ -843,8 +925,8 @@ function generalInfo($no) {
|
||||
|
||||
if($nation['color'] == "") { $nation['color'] = "#000000"; }
|
||||
|
||||
if($general['age'] < 60) { $general['age'] = "<font color=limegreen>{$general['age']} 세</font>"; }
|
||||
elseif($general['age'] < 80) { $general['age'] = "<font color=yellow>{$general['age']} 세</font>"; }
|
||||
if($general['age'] < GameConst::$retirementYear*0.75) { $general['age'] = "<font color=limegreen>{$general['age']} 세</font>"; }
|
||||
elseif($general['age'] < GameConst::$retirementYear) { $general['age'] = "<font color=yellow>{$general['age']} 세</font>"; }
|
||||
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
|
||||
|
||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||
@@ -867,7 +949,23 @@ function generalInfo($no) {
|
||||
default:
|
||||
$train = "{$general['train']}"; break;
|
||||
}
|
||||
if($general['troop'] == 0) { $troop['name'] = "-"; }
|
||||
if($general['troop'] == 0){
|
||||
$troopInfo = '-';
|
||||
}
|
||||
else{
|
||||
$troop = getTroop($general['troop']);
|
||||
$troopLeader = $db->queryFirstRow('SELECT city,turn0 FROM general WHERE no=%i', $troop['no']);
|
||||
$troopInfo = $troop['name'];
|
||||
|
||||
if(DecodeCommand($troopLeader['turn0'])[0] != 26){
|
||||
$troopInfo = "<strike style='color:gray;'>{$troopInfo}</strike>";
|
||||
}
|
||||
else if($troopLeader['city'] != $general['city']){
|
||||
$troopCityName = CityConst::byID($troopLeader['city'])->name;
|
||||
$troopInfo = "<span style='color:orange;'>{$troopInfo}({$troopCityName})</span>";
|
||||
}
|
||||
|
||||
}
|
||||
if($general['mode'] == 2) { $general['mode'] = "<font color=limegreen>수비 함(훈사80)</font>"; }
|
||||
elseif($general['mode'] == 1) { $general['mode'] = "<font color=limegreen>수비 함(훈사60)</font>"; }
|
||||
else { $general['mode'] = "<font color=red>수비 안함</font>"; }
|
||||
@@ -941,7 +1039,7 @@ function generalInfo($no) {
|
||||
</tr>
|
||||
<tr height=20>
|
||||
<td style='text-align:center;' class='bg1'><b>부대</b></td>
|
||||
<td style='text-align:center;' colspan=3>{$troop['name']}</td>
|
||||
<td style='text-align:center;' colspan=3>{$troopInfo}</td>
|
||||
<td style='text-align:center;' class='bg1'><b>벌점</b></td>
|
||||
<td style='text-align:center;' colspan=5>".getConnect($general['connect'])." {$general['connect']}({$general['con']})</td>
|
||||
</tr>
|
||||
@@ -1125,59 +1223,6 @@ function nationMsg() {
|
||||
return $msg?:'';
|
||||
}
|
||||
|
||||
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$message = explode('|', $msg);
|
||||
$count = (count($message) - 2)/2;
|
||||
$message[0] = Tag2Code($message[0]);
|
||||
$message[1] = Tag2Code($message[1]);
|
||||
// $message[0] = str_replace("\n", "<br>", $message[0]);
|
||||
// $message[1] = str_replace("\n", "<br>", $message[1]);
|
||||
|
||||
if($type == 0) { $board = "c_nationboard.php"; }
|
||||
else { $board = "c_chiefboard.php"; }
|
||||
|
||||
$imageTemp = GetImageURL($imgsvr);
|
||||
echo "
|
||||
<table style='text-align:center;' width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<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=90 height=64 valign=top><img width='64' height='64' class='generalIcon' 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]);
|
||||
$reply = Tag2Code($message[3+$i*2]);
|
||||
$query = "select name from general where no='$who'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$regen = MYDB_fetch_array($result);
|
||||
echo "
|
||||
<tr>
|
||||
<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=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>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
<br>";
|
||||
}
|
||||
|
||||
function banner() {
|
||||
|
||||
return sprintf(
|
||||
@@ -1252,8 +1297,10 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameStor->refresh = $gameStor->refresh+$cnt; //TODO: +로 증가하는 값은 별도로 분리
|
||||
$isunited = $gameStor->isunited;
|
||||
$opentime = $gameStor->opentime;
|
||||
|
||||
if($generalID && $userGrade < 6) {
|
||||
if($isunited != 2 && $generalID && $userGrade < 6 && $opentime <= TimeUtil::DatetimeNow()) {
|
||||
$db->update('general', [
|
||||
'lastrefresh'=>$date,
|
||||
'con'=>$db->sqleval('con + %i', $cnt),
|
||||
@@ -1427,10 +1474,10 @@ function checkDelay() {
|
||||
$threshold = 1;
|
||||
}
|
||||
else if($term >= 10){
|
||||
$threshold = 2;
|
||||
$threshold = 3;
|
||||
}
|
||||
else{
|
||||
$threshold = 3;
|
||||
$threshold = 6;
|
||||
}
|
||||
//지연 해야할 밀린 턴 횟수
|
||||
$iter = intdiv($timeMinDiff, $term);
|
||||
@@ -1508,6 +1555,11 @@ function checkTurn() {
|
||||
|
||||
$alllog = [];
|
||||
|
||||
if(date('Y-m-d H:i:s') < $gameStor->turntime){
|
||||
//턴 시각 이전이면 아무것도 하지 않음
|
||||
return true;
|
||||
}
|
||||
|
||||
// 잦은 갱신 금지 현재 5초당 1회
|
||||
if(!timeover()) { return; }
|
||||
// 현재 처리중이면 접근 불가
|
||||
@@ -1542,7 +1594,12 @@ function checkTurn() {
|
||||
$db->update('plock', ['plock'=>1], true);
|
||||
return;
|
||||
}
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
$gameStor->cacheAll();
|
||||
|
||||
|
||||
// 1턴이상 갱신 없었으면 서버 지연
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
|
||||
checkDelay();
|
||||
@@ -1554,10 +1611,12 @@ function checkTurn() {
|
||||
CheckOverhead();
|
||||
//서버정보
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$autorun_user = $gameStor->autorun_user;
|
||||
|
||||
// 최종 처리 월턴의 다음 월턴시간 구함
|
||||
$prevTurn = cutTurn($gameStor->turntime, $gameStor->turnterm);
|
||||
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
|
||||
$computedPrevTurn = false;
|
||||
// 현재 턴 이전 월턴까지 모두처리.
|
||||
//최종 처리 이후 다음 월턴이 현재 시간보다 전이라면
|
||||
while($nextTurn <= $date) {
|
||||
@@ -1571,12 +1630,15 @@ function checkTurn() {
|
||||
//if(PROCESS_LOG) $processlog[0] = "[{$date}] 월턴 이전 갱신: name({$general['name']}), no({$general['no']}), turntime({$general['turntime']}), turn0({$general['turn0']})";
|
||||
//if(PROCESS_LOG) pushProcessLog($processlog);
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
|
||||
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
|
||||
PreprocessCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
|
||||
$reduce_turn = false;
|
||||
if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) {
|
||||
processAI($general['no'], $reduce_turn);
|
||||
} // npc AI 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
|
||||
processCommand($general['no']);
|
||||
processCommand($general['no'], $reduce_turn);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
|
||||
updateCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
|
||||
@@ -1663,12 +1725,16 @@ function checkTurn() {
|
||||
// 다음달로 넘김
|
||||
$prevTurn = $nextTurn;
|
||||
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
|
||||
$computedPrevTurn = true;
|
||||
}
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
|
||||
|
||||
// 이시각 정각 시까지 업데이트 완료했음
|
||||
$gameStor->turntime = $prevTurn;
|
||||
if($computedPrevTurn){
|
||||
$gameStor->turntime = $prevTurn;
|
||||
}
|
||||
|
||||
|
||||
// 그 시각 년도,월 저장
|
||||
list($gameStor->year, $gameStor->month) = turnDate($prevTurn);
|
||||
@@ -1684,12 +1750,14 @@ function checkTurn() {
|
||||
//if(PROCESS_LOG) $processlog[0] = "[{$date}] 월턴 이후 갱신: name({$general['name']}), no({$general['no']}), turntime({$general['turntime']}), turn0({$general['turn0']})";
|
||||
//if(PROCESS_LOG) pushProcessLog($processlog);
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
|
||||
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
|
||||
PreprocessCommand($general['no']);
|
||||
$reduce_turn = false;
|
||||
if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) {
|
||||
processAI($general['no'], $reduce_turn);
|
||||
}
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
|
||||
processCommand($general['no']);
|
||||
processCommand($general['no'], $reduce_turn);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
|
||||
updateCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
|
||||
@@ -1922,7 +1990,7 @@ function updateTurntime($no) {
|
||||
|
||||
$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'";
|
||||
$query = "select no,owner,name,name2,nation,troop,age,startage,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),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1938,6 +2006,7 @@ function updateTurntime($no) {
|
||||
'npc'=>$general['npc_org'],
|
||||
'killturn'=>$general['killturn'],
|
||||
'mode'=>2,
|
||||
'permission'=>'normal',
|
||||
'name2'=>null
|
||||
], 'no=%i',$no);
|
||||
|
||||
@@ -1953,7 +2022,7 @@ function updateTurntime($no) {
|
||||
nextRuler($general);
|
||||
}
|
||||
|
||||
//도시의 태수, 군사, 시중직도 초기화
|
||||
//도시의 태수, 군사, 종사직도 초기화
|
||||
$query = "update city set gen1='0' where gen1='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='{$general['no']}'";
|
||||
@@ -1991,68 +2060,77 @@ function updateTurntime($no) {
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$generalName = $general['name'];
|
||||
|
||||
// 병, 요절, 객사, 번개, 사채, 일확천금, 호랑이, 곰, 수영, 처형, 발견
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
if($general['owner'] > 0 && $general['startage'] + 1 < $general['age']){
|
||||
|
||||
$realName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $general['owner'])??'??';
|
||||
$generalName .= "({$realName})";
|
||||
}
|
||||
|
||||
switch(rand()%42) {
|
||||
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;
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 역병에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>요절</>하고 말았습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 거리에서 갑자기 <R>객사</>하고 말았습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 안타깝게도 번개에 맞아 <R>죽고</> 말았습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 고리대금에 시달리다가 <R>자살</>하고 말았습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 일확천금에 놀라 심장마비로 <R>죽고</> 말았습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 산속에서 호랑이에게 물려 <R>죽고</> 말았습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 산책중 곰에게 할퀴어 <R>죽고</> 말았습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 수영을 하다 <R>익사</>하고 말았습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 황제를 모독하다가 <R>처형</>당하고 말았습니다."; break;
|
||||
case 10: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 이튿날 침실에서 <R>죽은채로</>발견되었습니다."; break;
|
||||
case 11: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 색에 빠져 기력이 쇠진해 <R>죽고</>말았습니다."; break;
|
||||
case 12: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 미녀를 보고 심장마비로 <R>죽고</>말았습니다."; break;
|
||||
case 13: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 우울증에 걸려 <R>자살</>하고 말았습니다."; break;
|
||||
case 14: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 천하 정세를 비관하며 <R>분신</>하고 말았습니다."; break;
|
||||
case 15: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 어떤 관심도 못받고 쓸쓸히 <R>죽고</>말았습니다."; break;
|
||||
case 16: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 유산 상속 문제로 다투다가 <R>살해</>당했습니다."; break;
|
||||
case 17: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 누군가의 사주로 자객에게 <R>암살</>당했습니다."; break;
|
||||
case 18: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 바람난 배우자에게 <R>독살</>당하고 말았습니다."; break;
|
||||
case 19: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 농약을 술인줄 알고 마셔 <R>죽고</>말았습니다."; break;
|
||||
case 20: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 아무 이유 없이 <R>죽고</>말았습니다."; break;
|
||||
case 21: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 전재산을 잃고 화병으로 <R>죽고</>말았습니다."; break;
|
||||
case 22: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 단식운동을 하다가 굶어 <R>죽고</>말았습니다."; break;
|
||||
case 23: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 귀신에게 홀려 시름 앓다가 <R>죽고</>말았습니다."; break;
|
||||
case 24: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 사람들에게 집단으로 맞아서 <R>죽고</>말았습니다."; break;
|
||||
case 25: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 갑자기 성벽에서 뛰어내려 <R>죽고</>말았습니다."; break;
|
||||
case 26: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 농사중 호미에 머리를 맞아 <R>죽고</>말았습니다."; break;
|
||||
case 27: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 저세상이 궁금하다며 <R>자살</>하고 말았습니다."; break;
|
||||
case 28: $alllog[0] = "<C>●</>{$admin['month']}월:운좋기로 소문난 <Y>{$generalName}</>{$josaYi} 불운하게도 <R>죽고</>말았습니다."; break;
|
||||
case 29: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 무리하게 단련을 하다가 <R>죽고</>말았습니다."; break;
|
||||
case 30: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 생활고를 비관하며 <R>자살</>하고 말았습니다."; break;
|
||||
case 31: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 평생 결혼도 못해보고 <R>죽고</> 말았습니다."; break;
|
||||
case 32: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 과식하다 배가 터져 <R>죽고</> 말았습니다."; break;
|
||||
case 33: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 웃다가 숨이 넘어가 <R>죽고</> 말았습니다."; break;
|
||||
case 34: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 추녀를 보고 놀라서 <R>죽고</> 말았습니다."; break;
|
||||
case 35: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 물에 빠진 사람을 구하려다 같이 <R>죽고</> 말았습니다."; break;
|
||||
case 36: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 독살을 준비하다 독에 걸려 <R>죽고</> 말았습니다."; break;
|
||||
case 37: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 뒷간에서 너무 힘을 주다가 <R>죽고</> 말았습니다."; break;
|
||||
case 38: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 돌팔이 의사에게 치료받다가 <R>죽고</> 말았습니다."; break;
|
||||
case 39: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 남의 보약을 훔쳐먹다 부작용으로 <R>죽고</> 말았습니다."; break;
|
||||
case 40: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 사기꾼 <Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
case 41: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 호색한 <Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||
}
|
||||
// 엔피씨,엠피씨,의병 사망로그
|
||||
if($general['npc'] == 2 || $general['npc'] == 6) {
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>사망</>했습니다.";
|
||||
} elseif($general['npc'] >= 3) {
|
||||
switch(rand()%10) {
|
||||
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;
|
||||
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 푸대접에 실망하여 떠났습니다."; break;
|
||||
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 갑자기 화를 내며 떠났습니다."; break;
|
||||
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 의견차이를 좁히지 못하고 떠났습니다."; break;
|
||||
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 판단 착오였다며 떠났습니다."; break;
|
||||
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 생활고가 나아지지 않는다며 떠났습니다."; break;
|
||||
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 기대가 너무 컸다며 떠났습니다."; break;
|
||||
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 아무 이유 없이 떠났습니다."; break;
|
||||
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 자기 목적은 달성했다며 떠났습니다."; break;
|
||||
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 자기가 없어도 될것 같다며 떠났습니다."; break;
|
||||
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 처자식이 그립다며 떠났습니다."; break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2062,7 +2140,7 @@ function updateTurntime($no) {
|
||||
}
|
||||
}
|
||||
|
||||
if($general['age'] >= 80 && $general['npc'] == 0) {
|
||||
if($general['age'] >= GameConst::$retirementYear && $general['npc'] == 0) {
|
||||
if($admin['isunited'] == 0) {
|
||||
CheckHall($no);
|
||||
}
|
||||
@@ -2135,6 +2213,11 @@ function CheckHall($no) {
|
||||
|
||||
[$scenarioIdx, $scenarioName, $startTime] = $gameStor->getValuesAsArray(['scenario', 'scenario_text', 'starttime']);
|
||||
|
||||
$ownerName = $general['name2'];
|
||||
if($general['owner']){
|
||||
$ownerName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $general['owner']);
|
||||
}
|
||||
|
||||
foreach($types as $idx=>$typeName) {
|
||||
|
||||
|
||||
@@ -2164,7 +2247,7 @@ function CheckHall($no) {
|
||||
'imgsvr'=>$general['imgsvr'],
|
||||
'startTime'=>$startTime,
|
||||
'unitedTime'=>$unitedDate,
|
||||
'owner_name'=>$general['name2'],
|
||||
'owner_name'=>$ownerName,
|
||||
'serverID'=>UniqueConst::$serverID,
|
||||
'serverIdx'=>$serverCnt,
|
||||
'serverName'=>UniqueConst::$serverName,
|
||||
@@ -2172,27 +2255,106 @@ function CheckHall($no) {
|
||||
];
|
||||
$jsonAux = Json::encode($aux);
|
||||
|
||||
$db->insertUpdate('ng_hall', [
|
||||
$db->insertIgnore('ng_hall', [
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
'season'=>UniqueConst::$seasonIdx,
|
||||
'scenario'=>$scenarioIdx,
|
||||
'general_no'=>$no,
|
||||
'type'=>$idx,
|
||||
'value'=>$general[$typeName]??0,
|
||||
'owner'=>$general['owner']??null,
|
||||
'aux'=>$jsonAux
|
||||
],[
|
||||
'value'=>$general[$typeName]??0,
|
||||
'aux'=>$jsonAux
|
||||
]);
|
||||
|
||||
if($db->affectedRows() == 0){
|
||||
$db->update('ng_hall', [
|
||||
'value'=>$general[$typeName]??0,
|
||||
'aux'=>$jsonAux
|
||||
],
|
||||
'server_id = %s AND scenario = %i AND general_no = %i AND type = %i AND value < %d',
|
||||
UniqueConst::$serverID,
|
||||
$scenarioIdx,
|
||||
$no,
|
||||
$idx,
|
||||
$general[$typeName]??0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function guaranteedUniqueItemLottery(array $weightedArray, string $headerText='아이템'):?int{
|
||||
//NOTE: Util::choiceRandomUsingWeight 사용
|
||||
//TODO: 또 재 구현해야함.... ㅜㅜ
|
||||
|
||||
if(!$weightedArray){
|
||||
return null;
|
||||
}
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$targetGeneralID = Util::choiceRandomUsingWeight($weightedArray);
|
||||
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$occupied = [];
|
||||
$item = [];
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'scenario']);
|
||||
|
||||
$selGroup = [
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where weap > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where book > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where horse > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
|
||||
];
|
||||
|
||||
if(array_sum($selGroup) == 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
$sel = Util::choiceRandomUsingWeight($selGroup);
|
||||
switch($sel) {
|
||||
case 0: [$type, $nameFunc] = ["weap", 'sammo\getWeapName']; break;
|
||||
case 1: [$type, $nameFunc] = ["book", 'sammo\getBookName']; break;
|
||||
case 2: [$type, $nameFunc] = ["horse", 'sammo\getHorseName']; break;
|
||||
case 3: [$type, $nameFunc] = ["item", 'sammo\getItemName']; break;
|
||||
}
|
||||
|
||||
foreach($db->queryFirstColumn('SELECT %b FROM general WHERE %b > 6', $type, $type) as $itemIdx){
|
||||
$occupied[$itemIdx] = 1;
|
||||
}
|
||||
for($i=7; $i <= 26; $i++) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$item[] = $i;
|
||||
}
|
||||
}
|
||||
$it = Util::choiceRandom($item);
|
||||
|
||||
$general = $db->queryFirstRow('SELECT no, name, nation FROM general WHERE no = %i', $targetGeneralID);
|
||||
|
||||
$db->update('general', [$type=>$it], 'no=%i', $general['no']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
|
||||
$josaUl = JosaUtil::pick(($nameFunc)($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".($nameFunc)($it)."</>{$josaUl} 습득");
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【{$headerText}】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
return $targetGeneralID;
|
||||
}
|
||||
|
||||
function uniqueItem($general, $log, $vote=0) {
|
||||
//TODO: uniqueItem 재 구현
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$occupied = [];
|
||||
@@ -2203,118 +2365,71 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'scenario']);
|
||||
|
||||
$query = "select count(*) as cnt from general where npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$genCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE npc < 2');
|
||||
|
||||
if($admin['scenario'] < 100) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
|
||||
if($admin['scenario'] < 100) { $prob = $genCnt * 5; } // 5~6개월에 하나씩 등장
|
||||
else { $prob = $genCnt; } // 1~2개월에 하나씩 등장
|
||||
|
||||
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||
elseif($vote == 2) { $prob = Util::round($gen['cnt'] / 10 / 2); } // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
|
||||
elseif($vote == 3) { $prob = Util::round($gen['cnt'] / 10 / 4); } // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
|
||||
if($vote == 1) { $prob = Util::round($genCnt * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||
elseif($vote == 2) { $prob = Util::round($genCnt / 10 / 2); } // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
|
||||
elseif($vote == 3) { $prob = Util::round($genCnt / 10 / 4); } // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
|
||||
|
||||
if($prob < 3) { $prob = 3; }
|
||||
//아이템 습득 상황
|
||||
if(rand() % $prob == 0) {
|
||||
//셋중 선택
|
||||
$sel = rand() % 4;
|
||||
switch($sel) {
|
||||
case 0: $type = "weap"; break;
|
||||
case 1: $type = "book"; break;
|
||||
case 2: $type = "horse"; break;
|
||||
case 3: $type = "item"; break;
|
||||
}
|
||||
$query = "select no,{$type} from general where {$type}>6";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
if($count < 20) {
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$occupied[$gen[$type]] = 1;
|
||||
}
|
||||
for($i=7; $i <= 26; $i++) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$item[] = $i;
|
||||
}
|
||||
}
|
||||
$it = $item[rand() % count($item)]??0;
|
||||
if (rand() % $prob != 0) {
|
||||
return $log;
|
||||
|
||||
$query = "update general set {$type}='$it' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
//셋중 선택
|
||||
$selGroup = [
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where weap > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where book > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where horse > 6'),
|
||||
20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
|
||||
];
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
if(array_sum($selGroup) == 0){
|
||||
return $log;
|
||||
}
|
||||
|
||||
switch($sel) {
|
||||
case 0:
|
||||
$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>●</>{$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>●</>{$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>●</>{$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>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getWeapName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
$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>●</>{$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>●</>{$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>●</>{$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>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getBookName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
$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>●</>{$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>●</>{$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>●</>{$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>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
$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>●</>{$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>●</>{$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>●</>{$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>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
|
||||
}
|
||||
break;
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
$sel = Util::choiceRandomUsingWeight($selGroup);
|
||||
switch($sel) {
|
||||
case 0: [$type, $nameFunc] = ["weap", 'sammo\getWeapName']; break;
|
||||
case 1: [$type, $nameFunc] = ["book", 'sammo\getBookName']; break;
|
||||
case 2: [$type, $nameFunc] = ["horse", 'sammo\getHorseName']; break;
|
||||
case 3: [$type, $nameFunc] = ["item", 'sammo\getItemName']; break;
|
||||
}
|
||||
|
||||
switch($vote){
|
||||
case 1: $voteTypeText = '설문상품'; break;
|
||||
case 2: $voteTypeText = '랜덤임관상품'; break;
|
||||
case 3: $voteTypeText = '건국상품'; break;
|
||||
default: $voteTypeText = '아이템'; break;
|
||||
}
|
||||
|
||||
foreach($db->queryFirstColumn('SELECT %b FROM general WHERE %b > 6', $type, $type) as $itemIdx){
|
||||
$occupied[$itemIdx] = 1;
|
||||
}
|
||||
for($i=7; $i <= 26; $i++) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$item[] = $i;
|
||||
}
|
||||
}
|
||||
$it = Util::choiceRandom($item);
|
||||
|
||||
$db->update('general', [$type=>$it], 'no=%i', $general['no']);
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
$josaUl = JosaUtil::pick(($nameFunc)($it), '을');
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
$log[] = "<C>●</><C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<C>".($nameFunc)($it)."</>{$josaUl} 습득");
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【{$voteTypeText}】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
|
||||
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
return $log;
|
||||
}
|
||||
|
||||
@@ -2544,7 +2659,7 @@ function deleteNation($general) {
|
||||
$oldNation['aux'] = Json::decode($oldNation['aux']);
|
||||
|
||||
// 전 장수 재야로 // 전 장수 소속 무소속으로
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
|
||||
$query = "update general set belong=0,troop=0,level=0,nation=0,permission='normal',makelimit=12 where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 도시 공백지로
|
||||
$query = "update city set nation=0,front=0,gen1=0,gen2=0,gen3=0 where nation='{$general['nation']}'";
|
||||
@@ -2686,6 +2801,71 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* $from 으로 지정한 도시의 인접 도시와 $to 도시의 최단 거리를 계산해 줌
|
||||
* @param $from 기준 도시 코드
|
||||
* @param $to 대상 도시 코드
|
||||
* @param $linkNationList 경로에 해당하는 국가 리스트
|
||||
* @return array $dist=>[cityID, $nation] 배열 가장 앞이 가장 가까움
|
||||
*/
|
||||
function searchDistanceListToDest(int $from, int $to, array $linkNationList) {
|
||||
$queue = new \SplQueue();
|
||||
|
||||
$cities = [];
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
//TODO: 도시-국가 캐싱이 있으면 쓸모 있지 않을까
|
||||
$allowedCityList = [];
|
||||
foreach($db->queryAllLists(
|
||||
'SELECT city, nation FROM city WHERE nation IN %li',
|
||||
$linkNationList
|
||||
) as [$cityID, $nationID]){
|
||||
$allowedCityList[$cityID] = $nationID;
|
||||
}
|
||||
|
||||
$remainFromCities = [];
|
||||
foreach(array_keys(CityConst::byID($from)->path) as $fromCityID){
|
||||
if(key_exists($fromCityID, $allowedCityList)){
|
||||
$remainFromCities[$fromCityID] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!key_exists($to, $allowedCityList)){
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
$queue->enqueue([$to, 0]);
|
||||
|
||||
while(!empty($remainFromCities) && !$queue->isEmpty()){
|
||||
list($cityID, $dist) = $queue->dequeue();
|
||||
if(key_exists($cityID, $cities)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$cities[$cityID] = $dist;
|
||||
|
||||
if(key_exists($cityID, $remainFromCities)){
|
||||
unset($remainFromCities[$cityID]);
|
||||
$result[$dist][] = [$cityID, $allowedCityList[$cityID]];
|
||||
}
|
||||
|
||||
foreach(array_keys(CityConst::byID($cityID)->path) as $connCityID){
|
||||
if($allowedCityList !== null && !key_exists($connCityID, $allowedCityList)){
|
||||
continue;
|
||||
}
|
||||
if(key_exists($connCityID, $cities)){
|
||||
continue;
|
||||
}
|
||||
$queue->enqueue([$connCityID, $dist+1]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function isNeighbor(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
||||
if($nation1 === $nation2){
|
||||
return false;
|
||||
@@ -2877,16 +3057,24 @@ function SabotageInjury($city, $type=0) {
|
||||
return $injuryCount;
|
||||
}
|
||||
|
||||
function getRandTurn($term) {
|
||||
function getRandTurn($term, ?\DateTimeInterface $baseDateTime = null) {
|
||||
if($baseDateTime === null){
|
||||
$baseDateTime = new \DateTimeImmutable();
|
||||
}
|
||||
else if($baseDateTime instanceof \DateTime){
|
||||
$baseDateTime = DateTimeImmutable::createFromMutable($baseDateTime);
|
||||
}
|
||||
$randtime = rand(0, 60 * $term - 1);
|
||||
$turntime = date('Y-m-d H:i:s', strtotime('now') + $randtime);
|
||||
|
||||
return $turntime;
|
||||
return $baseDateTime->add(new \DateInterval('PT'.$randtime.'S'))->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
function getRandTurn2($term) {
|
||||
function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null) {
|
||||
if($baseDateTime === null){
|
||||
$baseDateTime = new \DateTimeImmutable();
|
||||
}
|
||||
else if($baseDateTime instanceof \DateTime){
|
||||
$baseDateTime = DateTimeImmutable::createFromMutable($baseDateTime);
|
||||
}
|
||||
$randtime = rand(0, 60 * $term - 1);
|
||||
$turntime = date('Y-m-d H:i:s', strtotime('now') - $randtime);
|
||||
|
||||
return $turntime;
|
||||
return $baseDateTime->sub(new \DateInterval('PT'.$randtime.'S'))->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
+84
-51
@@ -103,14 +103,30 @@ function getTurn(array $general, $type, $font=1) {
|
||||
$str[$i] = "【{$general['name']}】{$josaUl} 등용";
|
||||
break;
|
||||
case 25: //임관
|
||||
$third = $command[2];
|
||||
$double = $command[1];
|
||||
|
||||
$nation = getNationStaticInfo($double);
|
||||
|
||||
if(!$nation['name']) { $nation['name'] = '????'; }
|
||||
|
||||
$josaRo = JosaUtil::pick($nation['name'], '로');
|
||||
$str[$i] = "【{$nation['name']}】{$josaRo} 임관";
|
||||
if($third == 98){
|
||||
$str[$i] = "【건국된 임의 국가】로 임관";
|
||||
}
|
||||
else if($third == 99){
|
||||
$str[$i] = "【임의의 국가】로 임관";
|
||||
}
|
||||
else if($third == 1){
|
||||
$generalName = $db->queryFirstField('SELECT name FROM general WHERE no=%i', $double)??'?!?!';
|
||||
$josaUl = JosaUtil::pick($generalName, '을');
|
||||
$str[$i] = "【{$generalName}】{$josaUl} 따라 임관";
|
||||
}
|
||||
else if($third == 0){
|
||||
$nationName = getNationStaticInfo($double)['name']??'?!?!';
|
||||
|
||||
$josaRo = JosaUtil::pick($nationName, '로');
|
||||
$str[$i] = "【{$nationName}】{$josaRo} 임관";
|
||||
}
|
||||
else{
|
||||
$str[$i] = "????";
|
||||
}
|
||||
|
||||
break;
|
||||
case 26: //집합
|
||||
$str[$i] = "집합";
|
||||
@@ -154,6 +170,13 @@ function getTurn(array $general, $type, $font=1) {
|
||||
$str[$i] = "【{$city['name']}】에 선동 실행";
|
||||
break;
|
||||
|
||||
case 38: //내특 초기화
|
||||
$str[$i] = "내정 특기를 초기화";
|
||||
break;
|
||||
case 39: //전특 초기화
|
||||
$str[$i] = "전투 특기를 초기화";
|
||||
break;
|
||||
|
||||
case 41: //단련
|
||||
$str[$i] = "숙련도를 단련";
|
||||
break;
|
||||
@@ -244,7 +267,9 @@ function getTurn(array $general, $type, $font=1) {
|
||||
case 57: //모반 시도
|
||||
$str[$i] = "모반 시도";
|
||||
break;
|
||||
|
||||
case 58: //숙련 전환
|
||||
$str[$i] = "숙련 전환";
|
||||
break;
|
||||
default:
|
||||
$str[$i] = "????";
|
||||
break;
|
||||
@@ -451,6 +476,9 @@ function getCoreTurn($nation, $level) {
|
||||
|
||||
$str[$i] = "【<font color={$color}>국기</font>】를 변경";
|
||||
break;
|
||||
case 82: //국호변경
|
||||
$str[$i] = "국호를 변경";
|
||||
break;
|
||||
default:
|
||||
$str[$i] = "????";
|
||||
break;
|
||||
@@ -465,15 +493,13 @@ function getCoreTurn($nation, $level) {
|
||||
}
|
||||
|
||||
|
||||
function processCommand($no) {
|
||||
function processCommand($no, $reduceTurn) {
|
||||
$session = Session::getInstance();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = $db->queryFirstRow('SELECT npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,myset,aux from general where no = %i', $no);
|
||||
|
||||
list($month, $killturn) = $gameStor->getValuesAsArray(['month', 'killturn']);
|
||||
$log = [];
|
||||
@@ -511,7 +537,7 @@ function processCommand($no) {
|
||||
case 27: process_27($general); break; //발령
|
||||
case 51: process_51($general); break; //항복권고
|
||||
case 52: process_52($general); break; //원조
|
||||
case 53: process_53($general); break; //통합제의
|
||||
//case 53: process_53($general); break; //통합제의
|
||||
case 61: process_61($general); break; //불가침제의
|
||||
case 62: process_62($general); break; //선전 포고
|
||||
case 63: process_63($general); break; //종전 제의
|
||||
@@ -529,27 +555,37 @@ function processCommand($no) {
|
||||
case 77: process_77($general); break; //이호경식
|
||||
case 78: process_78($general); break; //급습
|
||||
case 81: process_81($general); break; //국기변경
|
||||
case 82: process_82($general); break; //국호변경
|
||||
case 99: break; //수뇌부휴식
|
||||
}
|
||||
|
||||
//장수정보 재로드
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar,myset,aux from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$newKillturn = $killturn;
|
||||
//삭턴 처리
|
||||
if($general['npc'] >= 2 || $general['killturn'] > $killturn) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$newKillturn = $general['killturn'] - 1;
|
||||
} elseif($command[0] == 0) {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$newKillturn = $general['killturn'] - 1;
|
||||
} elseif($reduceTurn == true){
|
||||
$newKillturn = $general['killturn'] - 1;
|
||||
} else {
|
||||
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$killturn}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$newKillturn = $killturn;
|
||||
}
|
||||
|
||||
$newMySet = min($general['myset'] + 1, 3);
|
||||
$db->update('general', [
|
||||
'recturn'=>$db->sqleval('turn0'),
|
||||
'resturn'=>'FAIL',
|
||||
'con'=>0,
|
||||
'killturn'=>$newKillturn,
|
||||
'myset'=>$newMySet
|
||||
], 'no = %i', $general['no']);
|
||||
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
|
||||
|
||||
//연속턴 아닌경우 텀 리셋
|
||||
@@ -596,6 +632,9 @@ function processCommand($no) {
|
||||
case 34: process_34($general); break; //파괴
|
||||
case 35: process_35($general); break; //선동
|
||||
|
||||
case 38: process_38($general, '내정 특기', 'special', 'specage'); break; //내특 초기화
|
||||
case 39: process_38($general, '전투 특기', 'special2', 'specage2'); break; //내특 초기화
|
||||
|
||||
case 41: process_41($general); break; //단련
|
||||
case 42: process_42($general); break; //견문
|
||||
case 43: process_43($general); break; //증여
|
||||
@@ -611,6 +650,8 @@ function processCommand($no) {
|
||||
case 55: process_55($general); break; //거병
|
||||
case 56: process_56($general); break; //해산
|
||||
case 57: process_57($general); break; //모반 시도
|
||||
|
||||
case 58: process_58($general); break; //숙련 전환
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,8 +736,11 @@ where nation='{$general['nation']}'
|
||||
|
||||
function command_Single($turn, $command) {
|
||||
if(!$turn){
|
||||
header('location:commandlist.php');
|
||||
return;
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'nextPage'=>null,
|
||||
'reason'=>'invalid turn'
|
||||
]);
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
@@ -710,7 +754,11 @@ function command_Single($turn, $command) {
|
||||
}
|
||||
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||
|
||||
header('location:commandlist.php');
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'nextPage'=>null,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
}
|
||||
|
||||
function command_Chief($turn, $command) {
|
||||
@@ -733,41 +781,26 @@ function command_Chief($turn, $command) {
|
||||
$query = "update nation set {$str} where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
header('location:b_chiefcenter.php');
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
}
|
||||
|
||||
function command_Other($turn, $commandtype) {
|
||||
|
||||
$target = "processing.php?commandtype={$commandtype}";
|
||||
foreach($turn as $turnItem){
|
||||
$target.="&turn[]={$turnItem}";
|
||||
if(!$turn){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'nextPage'=>null,
|
||||
'reason'=>'invalid turn'
|
||||
]);
|
||||
}
|
||||
$target.="&".mt_rand();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<script>
|
||||
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
||||
</script>
|
||||
</head>
|
||||
<body style="background-color:black;">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
$unixNow = time();
|
||||
$turnArg = join('&turn[]=', $turn);
|
||||
|
||||
/*
|
||||
<form name='form1' action='processing.php' method='post' target=_parent>
|
||||
<?php foreach($turn as $turnItem): ?>
|
||||
<input type='hidden' name='turn[]' value='<?=$turnItem?>'>
|
||||
<?php endforeach; ?>
|
||||
<input type=hidden name=commandtype value=<?=$commandtype?>>
|
||||
</form>
|
||||
<script>*/
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'nextPage'=>"processing.php?commandtype={$commandtype}&turn[]={$turnArg}&t={$unixNow}",
|
||||
'reason'=>'success'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+53
-52
@@ -174,13 +174,10 @@ function getGenSpecial($type) {
|
||||
return $call;
|
||||
}
|
||||
|
||||
function getSpecialInfo(?int $type):?string{
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
function getSpecialTextList():array{
|
||||
|
||||
//앞칸은 '설명을 위해' '그냥' 적어둠
|
||||
$infoText = [
|
||||
return [
|
||||
0 => ['-', null],
|
||||
1 => ['경작', '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
2 => ['상재', '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
|
||||
@@ -200,7 +197,7 @@ function getSpecialInfo(?int $type):?string{
|
||||
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
|
||||
43 => ['집중', '[전투] 계략 성공 시 대미지 +50%'],
|
||||
44 => ['신중', '[전투] 계략 성공 확률 100%'],
|
||||
45 => ['반계', '[전투] 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
|
||||
45 => ['반계', '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
|
||||
|
||||
50 => ['보병', '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'],
|
||||
51 => ['궁병', '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p'],
|
||||
@@ -209,7 +206,7 @@ function getSpecialInfo(?int $type):?string{
|
||||
|
||||
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
|
||||
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
|
||||
62 => ['견고', '[전투] 상대 필살 불가, 상대 계략 시도시 성공 확률 -10%p'],
|
||||
62 => ['견고', '[전투] 상대 필살, 격노, 위압, 저격 불가, 상대 계략 시도시 성공 확률 -10%p, 부상 없음, 아군 피해 -5%'],
|
||||
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
|
||||
|
||||
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
|
||||
@@ -219,6 +216,14 @@ function getSpecialInfo(?int $type):?string{
|
||||
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
|
||||
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
|
||||
];
|
||||
}
|
||||
|
||||
function getSpecialInfo(?int $type):?string{
|
||||
if($type === null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$infoText = getSpecialTextList();
|
||||
|
||||
return $infoText[$type][1]??null;
|
||||
}
|
||||
@@ -278,11 +283,11 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
case 712: $call = '황제'; break; case 612: $call = '왕'; break;
|
||||
case 711: $call = '승상'; break; case 611: $call = '광록훈'; break;
|
||||
case 710: $call = '위장군'; break; case 610: $call = '전장군'; break;
|
||||
case 710: $call = '표기장군'; break; case 610: $call = '좌장군'; break;
|
||||
case 709: $call = '사공'; break; case 609: $call = '상서령'; break;
|
||||
case 708: $call = '표기장군'; break; case 608: $call = '좌장군'; break;
|
||||
case 708: $call = '거기장군'; break; case 608: $call = '우장군'; break;
|
||||
case 707: $call = '태위'; break; case 607: $call = '중서령'; break;
|
||||
case 706: $call = '거기장군'; break; case 606: $call = '우장군'; break;
|
||||
case 706: $call = '위장군'; break; case 606: $call = '전장군'; break;
|
||||
case 705: $call = '사도'; break; case 605: $call = '비서령'; break;
|
||||
|
||||
case 512: $call = '공'; break; case 412: $call = '주목'; break;
|
||||
@@ -302,7 +307,7 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
case 4: $call = '태수'; break;
|
||||
case 3: $call = '군사'; break;
|
||||
case 2: $call = '시중'; break;
|
||||
case 2: $call = '종사'; break;
|
||||
case 1: $call = '일반'; break;
|
||||
case 0: $call = '재야'; break;
|
||||
default: $call = '-'; break;
|
||||
@@ -453,36 +458,32 @@ function getTechCall($tech) : string {
|
||||
function getDexLevelList(): array{
|
||||
return [
|
||||
[0, 'navy', 'F-'],
|
||||
[2500, 'navy', 'F'],
|
||||
[7500, 'navy', 'F+'],
|
||||
[15000, 'skyblue', 'E-'],
|
||||
[25000, 'skyblue', 'E'],
|
||||
[37500, 'skyblue', 'E+'],
|
||||
[52500, 'seagreen', 'D-'],
|
||||
[70000, 'seagreen', 'D'],
|
||||
[90000, 'seagreen', 'D+'],
|
||||
[112500, 'teal', 'C-'],
|
||||
[137500, 'teal', 'C'],
|
||||
[165000, 'teal', 'C+'],
|
||||
[195000, 'limegreen', 'B-'],
|
||||
[227500, 'limegreen', 'B'],
|
||||
[262500, 'limegreen', 'B+'],
|
||||
[300000, 'gold', 'A-'],
|
||||
[340000, 'gold', 'A'],
|
||||
[382500, 'gold', 'A+'],
|
||||
[427500, 'darkorange', 'S-'],
|
||||
[475000, 'darkorange', 'S'],
|
||||
[525000, 'darkorange', 'S+'],
|
||||
[577500, 'tomato', 'SS-'],
|
||||
[632500, 'tomato', 'SS'],
|
||||
[690000, 'tomato', 'SS+'],
|
||||
[750000, 'red', 'SSS-'],
|
||||
[812500, 'red', 'SSS'],
|
||||
[877500, 'red', 'SSS+'],
|
||||
[945000, 'darkviolet', 'Z-'],
|
||||
[1015000, 'darkviolet', 'Z'],
|
||||
[1087500, 'darkviolet', 'Z+'],
|
||||
[1162500, 'white', '?']
|
||||
[350, 'navy', 'F'],
|
||||
[1375, 'navy', 'F+'],
|
||||
[3500, 'skyblue', 'E-'],
|
||||
[7125, 'skyblue', 'E'],
|
||||
[12650, 'skyblue', 'E+'],
|
||||
[20475, 'seagreen', 'D-'],
|
||||
[31000, 'seagreen', 'D'],
|
||||
[44625, 'seagreen', 'D+'],
|
||||
[61750, 'teal', 'C-'],
|
||||
[82775, 'teal', 'C'],
|
||||
[108100, 'teal', 'C+'],
|
||||
[138125, 'limegreen', 'B-'],
|
||||
[173250, 'limegreen', 'B'],
|
||||
[213875, 'limegreen', 'B+'],
|
||||
[260400, 'darkorange', 'A-'],
|
||||
[313225, 'darkorange', 'A'],
|
||||
[372750, 'darkorange', 'A+'],
|
||||
[439375, 'tomato', 'S-'],
|
||||
[513500, 'tomato', 'S'],
|
||||
[595525, 'tomato', 'S+'],
|
||||
[685850, 'darkviolet', 'Z-'],
|
||||
[784875, 'darkviolet', 'Z'],
|
||||
[893000, 'darkviolet', 'Z+'],
|
||||
[1010625, 'gold', 'EX-'],
|
||||
[1138150, 'gold', 'EX'],
|
||||
[1275975, 'white', 'EX+'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -520,7 +521,7 @@ function getDexLevel(int $dex) : int {
|
||||
}
|
||||
|
||||
function getDexLog($dex1, $dex2) {
|
||||
$ratio = (getDexLevel($dex1) - getDexLevel($dex2)) / 50 + 1;
|
||||
$ratio = (getDexLevel($dex1) - getDexLevel($dex2)) / 55 + 1;
|
||||
return $ratio;
|
||||
}
|
||||
|
||||
@@ -757,15 +758,15 @@ function getItemInfo(?int $item):?string{
|
||||
9=>['도소연명(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
10=>['칠엽청점(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
11=>['정력견혈(치료)', '[군사] 턴 실행 전 부상 회복.'],
|
||||
12=>['과실주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
13=>['이강주(훈련)', '[전투] 훈련 보정 +5'],
|
||||
14=>['의적주(사기)', '[전투] 사기 보정 +5'],
|
||||
15=>['두강주(사기)', '[전투] 사기 보정 +5'],
|
||||
16=>['보령압주(사기)', '[전투] 사기 보정 +5'],
|
||||
17=>['철벽서(훈련)', '[전투] 훈련 보정 +7'],
|
||||
18=>['단결도(훈련)', '[전투] 훈련 보정 +7'],
|
||||
19=>['춘화첩(사기)', '[전투] 사기 보정 +7'],
|
||||
20=>['초선화(사기)', '[전투] 사기 보정 +7'],
|
||||
12=>['과실주(훈련)', '[전투] 훈련 보정 +10'],
|
||||
13=>['이강주(훈련)', '[전투] 훈련 보정 +10'],
|
||||
14=>['의적주(사기)', '[전투] 사기 보정 +10'],
|
||||
15=>['두강주(사기)', '[전투] 사기 보정 +10'],
|
||||
16=>['보령압주(사기)', '[전투] 사기 보정 +10'],
|
||||
17=>['철벽서(훈련)', '[전투] 훈련 보정 +14'],
|
||||
18=>['단결도(훈련)', '[전투] 훈련 보정 +14'],
|
||||
19=>['춘화첩(사기)', '[전투] 사기 보정 +14'],
|
||||
20=>['초선화(사기)', '[전투] 사기 보정 +14'],
|
||||
21=>['육도(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
22=>['삼략(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
|
||||
23=>['청낭서(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||
|
||||
+102
-14
@@ -229,7 +229,7 @@ function SetNationFront($nationNo) {
|
||||
|
||||
if($adj){
|
||||
$db->update('city', [
|
||||
'front'=>1
|
||||
'front'=>($enemyCities?1:2),
|
||||
], 'nation=%i and city in %li', $nationNo, array_keys($adj));
|
||||
}
|
||||
}
|
||||
@@ -562,11 +562,14 @@ function postUpdateMonthly() {
|
||||
$genCount = $genNum[$dip['me']];
|
||||
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
||||
// 4000 / 10 * 0.25 = 100
|
||||
$term = Util::round($dip['dead'] / 100 / $genCount) + 1;
|
||||
if($dip['term'] > $term) { $term = $dip['term']; }
|
||||
if($term > 13) { $term = 13; }
|
||||
$query = "update diplomacy set term='{$term}' where (me='{$dip['me']}' and you='{$dip['you']}')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$term = floor($dip['dead'] / 100 / $genCount);
|
||||
$dip['dead'] -= $term * 100 * $genCount;
|
||||
$term = Util::valueFit($dip['term'] + $term, 0, 13);
|
||||
|
||||
$db->update('diplomacy', [
|
||||
'term' => $term,
|
||||
'dead'=> $dip['dead'],
|
||||
], 'me = %i AND you = %i', $dip['me'], $dip['you']);
|
||||
}
|
||||
|
||||
//개전국 로그
|
||||
@@ -609,7 +612,7 @@ function postUpdateMonthly() {
|
||||
}
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
//사상자 초기화
|
||||
$query = "update diplomacy set dead=0";
|
||||
$query = "update diplomacy set dead=0 WHERE state != 0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//외교 기한-1
|
||||
$query = "update diplomacy set term=term-1 where term!=0";
|
||||
@@ -771,6 +774,11 @@ function checkMerge() {
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$db->update('general', [
|
||||
'nation'=>0,
|
||||
'permission'=>'normal',
|
||||
], 'nation=%i AND npc = 5', $me['nation']);
|
||||
|
||||
$query = "delete from nation where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 아국 모든 도시들 상대국 소속으로
|
||||
@@ -913,6 +921,11 @@ function checkSurrender() {
|
||||
'data'=>Json::encode($oldNation)
|
||||
]);
|
||||
|
||||
$db->update('general', [
|
||||
'nation'=>0,
|
||||
'permission'=>'normal',
|
||||
], 'nation=%i AND npc = 5', $me['nation']);
|
||||
|
||||
$query = "delete from nation where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 군주가 있는 위치 구함
|
||||
@@ -960,9 +973,9 @@ function updateNationState() {
|
||||
$connect=$db->get();
|
||||
|
||||
$history = array();
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm', 'turntime', 'killturn']);
|
||||
|
||||
$query = "select nation,name,level from nation";
|
||||
$query = "select nation,name,level,gennum,tech from nation";
|
||||
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($nationresult);
|
||||
|
||||
@@ -973,10 +986,6 @@ function updateNationState() {
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
$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);
|
||||
|
||||
if($citycount == 0) {
|
||||
$nationlevel = 0; // 방랑군
|
||||
} elseif($citycount == 1) {
|
||||
@@ -996,13 +1005,17 @@ function updateNationState() {
|
||||
}
|
||||
|
||||
if($nationlevel > $nation['level']) {
|
||||
$levelDiff = $nationlevel - $nation['level'];
|
||||
$oldLevel = $nation['level'];
|
||||
$nation['level'] = $nationlevel;
|
||||
|
||||
|
||||
switch($nationlevel) {
|
||||
case 7:
|
||||
$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} 자칭");
|
||||
$db->update('nation', ['can_change_flag'=>1], 'nation=%i', $nation['nation']);
|
||||
break;
|
||||
case 6:
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【작위】</b></><D><b>{$nation['name']}</b></>의 군주가 <Y>".getNationLevel($nationlevel)."</>에 등극하였습니다.";
|
||||
@@ -1020,16 +1033,90 @@ function updateNationState() {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
foreach(range(1, $levelDiff) as $idx){
|
||||
//유니크 아이템 하나 돌리자
|
||||
$targetKillTurn = $admin['killturn'];
|
||||
$targetKillTurn -= 24 * 60 / $admin['turnterm'];
|
||||
$nationGenList = $db->query('SELECT no, level, belong, horse, weap, book, item FROM general WHERE nation = %i AND killturn >= %i AND npc < 2', $nation['nation'], $targetKillTurn);
|
||||
$uniqueLotteryWeightList = [];
|
||||
|
||||
foreach($nationGenList as $nationGen){
|
||||
if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){
|
||||
continue;
|
||||
}
|
||||
$score = $nationGen['belong'] + 5; //임관 년도 + 5
|
||||
if($nationGen['level'] == 12){
|
||||
$score += 200; //NOTE: 꼬우면 군주하세요.
|
||||
}
|
||||
else if($nationGen['level'] == 11){
|
||||
$score += 70;
|
||||
}
|
||||
else if($nationGen['level'] > 4){
|
||||
$score += 35;
|
||||
}
|
||||
$uniqueLotteryWeightList[$nationGen['no']] = $score;
|
||||
}
|
||||
guaranteedUniqueItemLottery($uniqueLotteryWeightList, '작위보상');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$lastAssemblerID = $gameStor->assembler_id??0;
|
||||
for($levelGen = max(1, $oldLevel) + 1; $levelGen <= $nationlevel; $levelGen+=1){
|
||||
if(in_array($levelGen, [3, 5, 7])){
|
||||
$genStep = 2;
|
||||
}
|
||||
else{
|
||||
$genStep = 1;
|
||||
}
|
||||
|
||||
while($genStep > 0){
|
||||
$lastAssemblerID += 1;
|
||||
$npcObj = new Scenario\NPC(
|
||||
999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
|
||||
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '척사'
|
||||
);
|
||||
$npcObj->npc = 5;
|
||||
$npcObj->build($admin);
|
||||
$npcID = $npcObj->generalID;
|
||||
|
||||
$db->insert('troop', [
|
||||
'name'=>$npcObj->realName,
|
||||
'nation'=>$nation['nation'],
|
||||
'no'=>$npcID
|
||||
]);
|
||||
$troopID = $db->insertId();
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||
$db->update('general', [
|
||||
'troop'=>$troopID,
|
||||
'turn0'=>$command,
|
||||
'turn1'=>$command,
|
||||
'turn2'=>$command,
|
||||
'turn3'=>$command,
|
||||
'turn4'=>$command,
|
||||
'turn5'=>$command,
|
||||
'killturn'=>80
|
||||
], 'no=%i', $npcID);
|
||||
$genStep -= 1;
|
||||
}
|
||||
}
|
||||
$gameStor->assembler_id = $lastAssemblerID;
|
||||
|
||||
//작위 상승
|
||||
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
$gencount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i', $nation['nation']);
|
||||
|
||||
$gennum = $gencount;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
//기술 및 변경횟수 업데이트
|
||||
$query = "update nation set tech=totaltech/'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
@@ -1230,6 +1317,7 @@ function convForOldGeneral(array $general, int $year, int $month){
|
||||
function storeOldGeneral(int $no, int $year, int $month){
|
||||
$db = DB::db();
|
||||
$general = $db->queryFirstRow('SELECT * FROM general WHERE `no` = %i', $no);
|
||||
$general['aux'] = Json::decode($general['aux']);
|
||||
if(!$general){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,14 +5,15 @@ function getMailboxList(){
|
||||
|
||||
$generalNations = [];
|
||||
|
||||
foreach(DB::db()->queryAllLists('select `no`, `name`, `nation`, `level`, `npc` from `general` where `npc` < 2') as $general)
|
||||
foreach(DB::db()->query('select `no`, `name`, `nation`, `level`, `npc`, `permission`, `penalty` from `general` where `npc` < 2') as $general)
|
||||
{
|
||||
list($generalID, $generalName, $nationID, $level, $npc) = $general;
|
||||
[$generalID, $generalName, $nationID, $level, $npc] = [$general['no'], $general['name'], $general['nation'], $general['level'], $general['npc']];
|
||||
if(!isset($generalNations[$nationID])){
|
||||
$generalNations[$nationID] = [];
|
||||
}
|
||||
|
||||
$obj = [$generalID, $generalName, 0];
|
||||
$permission = checkSecretPermission($general, false);
|
||||
|
||||
if($level == 12){
|
||||
$obj[2] |= 1;
|
||||
@@ -22,6 +23,10 @@ function getMailboxList(){
|
||||
$obj[2] |= 2;
|
||||
}
|
||||
|
||||
if($permission == 4){
|
||||
$obj[2] |= 4;
|
||||
}
|
||||
|
||||
$generalNations[$nationID][] = $obj;
|
||||
}
|
||||
|
||||
@@ -37,7 +42,7 @@ function getMailboxList(){
|
||||
"mailbox"=>$mailbox,
|
||||
"name"=>$nationName,
|
||||
"color"=>$color,
|
||||
"general"=>$generals
|
||||
"general"=>$generals,
|
||||
];
|
||||
}, array_merge([getNationStaticInfo(0)], getAllNationStaticInfo()));
|
||||
|
||||
|
||||
+322
-114
@@ -1,10 +1,83 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class AIAllowedAction{
|
||||
|
||||
public $develop = true;
|
||||
public $warp = true;
|
||||
|
||||
public $recruitLowestCivil = false;
|
||||
public $randomRecruit = true;
|
||||
public $recruit = true;
|
||||
public $recruit_high = false;
|
||||
public $train = true;
|
||||
public $atmos = true;
|
||||
public $battle = true;
|
||||
|
||||
public $appointment = true;
|
||||
public $changeWarCondition = true;
|
||||
public $donation = true;
|
||||
public $buySellRice = true;
|
||||
|
||||
public $staffAction = true;
|
||||
|
||||
function __construct($npc, $aiOptions){
|
||||
if($npc >= 2){
|
||||
return;
|
||||
}
|
||||
|
||||
$this->develop = false;
|
||||
$this->warp = false;
|
||||
|
||||
$this->randomRecruit = false;
|
||||
$this->recruit = false;
|
||||
$this->recruit_high = false;
|
||||
$this->train = false;
|
||||
$this->atmos = false;
|
||||
$this->battle = false;
|
||||
|
||||
$this->appointment = false;
|
||||
$this->changeWarCondition = false;
|
||||
$this->donation = false;
|
||||
$this->buySellRice = true;
|
||||
|
||||
$this->staffAction = false;
|
||||
|
||||
$this->recruitLowestCivil = true;
|
||||
|
||||
foreach($aiOptions as $key=>$value){
|
||||
assert($value);
|
||||
switch($key){
|
||||
case 'develop':
|
||||
$this->develop = true;
|
||||
break;
|
||||
case 'warp':
|
||||
$this->warp = true;
|
||||
break;
|
||||
case 'recruit_high':
|
||||
$this->recruit_high = true;
|
||||
case 'recruit':
|
||||
$this->recruit = true;
|
||||
break;
|
||||
case 'train':
|
||||
$this->train = true;
|
||||
$this->atmos = true;
|
||||
break;
|
||||
case 'battle':
|
||||
$this->battle = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetDevelop($genType, $no, $city, $tech) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||
|
||||
$query = "select rate,pop/pop2*100 as po,comm/comm2*100 as co,def/def2*100 as de,wall/wall2*100 as wa,secu/secu2*100 as se,agri/agri2*100 as ag from city where city='$city'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
@@ -43,20 +116,20 @@ function SetDevelop($genType, $no, $city, $tech) {
|
||||
case 3: //지내정장
|
||||
if($prob < 40) {
|
||||
if($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업
|
||||
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
elseif(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
|
||||
} elseif($prob < 80) {
|
||||
if($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업
|
||||
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
elseif(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
|
||||
} elseif($prob < 90) {
|
||||
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
|
||||
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
|
||||
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
|
||||
} else {
|
||||
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
|
||||
if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
|
||||
else { $command = EncodeCommand(0, 0, 0, 29); }
|
||||
}
|
||||
break;
|
||||
@@ -80,7 +153,7 @@ function SetDevelop($genType, $no, $city, $tech) {
|
||||
return;
|
||||
}
|
||||
|
||||
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40, $currentCrewType, AIAllowedAction $allowedAction) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
@@ -96,7 +169,6 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de
|
||||
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||
$relYear = Util::valueFit($year-$startyear, 0);
|
||||
|
||||
$type = 0;
|
||||
switch($genType) {
|
||||
case 0: //무장
|
||||
case 2: //무내정장
|
||||
@@ -157,7 +229,13 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de
|
||||
}
|
||||
|
||||
if($types){
|
||||
$type = Util::choiceRandom($types);
|
||||
if(!$allowedAction->randomRecruit && in_array($currentCrewType, $types) && ($currentCrewType != GameUnitConst::DEFAULT_CREWTYPE && $currentCrewType != $types[0])){
|
||||
$type = $currentCrewType;
|
||||
}
|
||||
else{
|
||||
$type = Util::choiceRandom($types);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$type = GameUnitConst::DEFAULT_CREWTYPE;
|
||||
@@ -172,19 +250,25 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de
|
||||
|
||||
$crew = intdiv($gold, $cost);
|
||||
if($leader < $crew) { $crew = $leader; }
|
||||
$command = EncodeCommand(0, $type, $crew, 11);
|
||||
|
||||
if($allowedAction->recruit_high && $crew * $cost * 6 < $gold){
|
||||
$command = EncodeCommand(0, $type, $crew, 12);
|
||||
}
|
||||
else{
|
||||
$command = EncodeCommand(0, $type, $crew, 11);
|
||||
}
|
||||
|
||||
$query = "update general set turn0='$command' where no='$no'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
return;
|
||||
}
|
||||
|
||||
function processAI($no) {
|
||||
function processAI($no, &$reduce_turn) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate','killturn','autorun_user']);
|
||||
// 초반 여부
|
||||
if($admin['startyear']+2 > $admin['year'] || ($admin['startyear']+2 == $admin['year'] && $admin['month'] < 5)) {
|
||||
$isStart = 1;
|
||||
@@ -192,19 +276,104 @@ function processAI($no) {
|
||||
$isStart = 0;
|
||||
}
|
||||
|
||||
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
|
||||
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,horse,weap,book,item,special,special2,gold,rice,crew,crewtype,train,atmos,troop,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI01 ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
if($general['npc'] == 5){
|
||||
if($general['nation'] == 0 && $general['killturn'] > 1){
|
||||
$command = EncodeCommand(0, 0, 0, 0); //휴식
|
||||
$db->update('general', [
|
||||
'turn0'=>$command,
|
||||
'killturn'=>1
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
else if($general['level'] == 12){
|
||||
$newRuler = $db->queryFirstField('SELECT `no` FROM general WHERE nation = %i AND no != %i ORDER BY RAND() LIMIT 1', $general['nation'], $general['no']);
|
||||
if($newRuler){
|
||||
$command = EncodeCommand(0, 0, $newRuler, 54); //선양
|
||||
$db->update('general', [
|
||||
'turn0'=>$command,
|
||||
'turn1'=>$command,
|
||||
'turn2'=>$command,
|
||||
'turn3'=>$command,
|
||||
'turn4'=>$command,
|
||||
'killturn'=>rand(70,75),
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$newKillTurn = ($general['killturn'] + Util::randRangeInt(1, 4)) % 5;
|
||||
$newKillTurn += 70;
|
||||
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||
$db->update('general', [
|
||||
'turn0'=>$command,
|
||||
'turn1'=>$command,
|
||||
'turn2'=>$command,
|
||||
'turn3'=>$command,
|
||||
'turn4'=>$command,
|
||||
'turn5'=>$command,
|
||||
'killturn'=>$newKillTurn,
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$autorun_user = $admin['autorun_user'];
|
||||
if($general['npc'] < 2){
|
||||
$autorun_limit_minutes = $autorun_user['limit_minutes']??0;
|
||||
if(!$autorun_limit_minutes){
|
||||
return;
|
||||
}
|
||||
if($general['nation'] == 0){
|
||||
return;
|
||||
}
|
||||
$blankTurnCnt = $admin['killturn']-$general['killturn'];
|
||||
if($blankTurnCnt * $admin['turnterm'] > $autorun_limit_minutes){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 입력된 턴이 있으면 그것 실행
|
||||
if(DecodeCommand($general['turn0'])[0] != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front from city where city='{$general['city']}'";
|
||||
$reduce_turn = true;
|
||||
|
||||
$allowedAction = new AIAllowedAction($general['npc'], $autorun_user['options']??[]);
|
||||
if($general['troop'] && $allowedAction->warp){
|
||||
$troopLeader = $db->queryFirstRow(
|
||||
'SELECT general.no,general.name,general.city,turn0,troop,general.nation, city.nation AS city_nation FROM general JOIN city ON city.city = general.city WHERE troop = %i', $general['troop']
|
||||
);
|
||||
|
||||
if(!$troopLeader){
|
||||
//부대장 사망..?
|
||||
}
|
||||
else if(DecodeCommand($troopLeader['turn0'])[0] != 26){
|
||||
//valid
|
||||
}
|
||||
else if($troopLeader['nation'] == $troopLeader['city_nation']){
|
||||
//valid
|
||||
}
|
||||
else{
|
||||
$allowedAction->warp = false;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front,trade from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
if ($general['npc'] < 2 && $allowedAction->buySellRice) {
|
||||
if($city['trade'] == 0){
|
||||
$allowedAction->buySellRice = false;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result)??[
|
||||
@@ -217,6 +386,9 @@ function processAI($no) {
|
||||
'tech'=>0,
|
||||
];
|
||||
|
||||
setLeadershipBonus($general, $nation['level']);
|
||||
$leadership = getGeneralLeadership($general, false, true, true, true);
|
||||
|
||||
$coreCommand = array();
|
||||
if($general['level'] >= 5) {
|
||||
$query = "select l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
|
||||
@@ -224,7 +396,7 @@ function processAI($no) {
|
||||
$coreCommand = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front=1', $general['nation']);
|
||||
$cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front>0', $general['nation']);
|
||||
// 공격가능도시 있으면 1
|
||||
$attackable = $cityCount > 0;
|
||||
|
||||
@@ -283,17 +455,11 @@ function processAI($no) {
|
||||
$tech = getTechCost($nation['tech']);
|
||||
$resrc = $tech * 700;//XXX: 왜 700이지?
|
||||
|
||||
if($general['atmos'] >= 90 && $general['train'] >= 90) {
|
||||
if($general['mode'] == 0) {
|
||||
$query = "update general set mode=1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
|
||||
}
|
||||
} else {
|
||||
if($general['mode'] == 1) {
|
||||
$query = "update general set mode=0 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
|
||||
}
|
||||
if($allowedAction->changeWarCondition && $general['mode'] != 2){
|
||||
$query = "update general set mode=2 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
|
||||
//운영자메시지 출력 하루 6번..?
|
||||
//특별 메세지 있는 경우 출력 하루 4번
|
||||
@@ -325,7 +491,7 @@ function processAI($no) {
|
||||
|
||||
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
|
||||
|
||||
if($ruler) {
|
||||
if($rulerNation) {
|
||||
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
|
||||
} else {
|
||||
$command = EncodeCommand(0, 0, 0, 42); //견문
|
||||
@@ -333,7 +499,7 @@ function processAI($no) {
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
||||
return;
|
||||
} elseif($general['npc'] != 9 && $general['level'] == 0) {
|
||||
} elseif($general['npc'] != 9 && $general['level'] == 0 && $allowedAction->appointment) {
|
||||
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
|
||||
//임관 10%
|
||||
case 0:
|
||||
@@ -358,7 +524,7 @@ function processAI($no) {
|
||||
}
|
||||
else{
|
||||
//랜임 커맨드 입력.
|
||||
$command = EncodeCommand(0, 0, 99, 25); //임관
|
||||
$command = EncodeCommand(0, 99, 0, 25); //임관
|
||||
}
|
||||
break;
|
||||
case 1: //거병이나 견문 40%
|
||||
@@ -388,7 +554,7 @@ function processAI($no) {
|
||||
|
||||
$rulerCommand = 0;
|
||||
//군주가 할일
|
||||
if($general['level'] == 12) {
|
||||
if($general['level'] == 12 && $allowedAction->staffAction) {
|
||||
//오랑캐인데 공격 못하면 바로 방랑/해산
|
||||
if($general['npc'] == 9 && $dipState == 0 && !$attackable) {
|
||||
//방랑군이냐 아니냐
|
||||
@@ -413,12 +579,12 @@ function processAI($no) {
|
||||
} elseif($admin['month'] == 12) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
//지급률
|
||||
GoldBillRate($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
|
||||
} elseif($admin['month'] == 6) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
//지급률
|
||||
RiceBillRate($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
|
||||
}
|
||||
|
||||
@@ -467,7 +633,7 @@ function processAI($no) {
|
||||
|
||||
SetNationFront($nation['nation']);
|
||||
|
||||
$frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front=1', $general['nation']);
|
||||
$frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front>0', $general['nation']);
|
||||
if($frontCount > 0){
|
||||
break;
|
||||
}
|
||||
@@ -503,7 +669,7 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
//방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일
|
||||
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0) {
|
||||
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0 && $allowedAction->staffAction) {
|
||||
$command = NPCStaffWork($general, $nation, $dipState);
|
||||
if($command){
|
||||
$db->update('nation', [
|
||||
@@ -525,7 +691,7 @@ function processAI($no) {
|
||||
} elseif($general['injury'] > 10) {
|
||||
// 부상 2달 이상이면 요양
|
||||
$command = EncodeCommand(0, 0, 0, 50); //요양
|
||||
} elseif($nation['level'] == 0) {
|
||||
} elseif($nation['level'] == 0 && $allowedAction->appointment) {
|
||||
//방랑군일때
|
||||
if($admin['startyear']+3 <= $admin['year']) {
|
||||
$command = EncodeCommand(0, 0, 0, 45); //하야
|
||||
@@ -547,7 +713,7 @@ function processAI($no) {
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['leader'] < 40){
|
||||
if($general['leader'] < 40 && $allowedAction->donation){
|
||||
//무지장인데
|
||||
|
||||
if(
|
||||
@@ -582,7 +748,7 @@ function processAI($no) {
|
||||
}
|
||||
|
||||
//국가 병량이 없을때 바로 헌납
|
||||
if($nation['rice'] < 2000 && $general['rice'] > 200) {
|
||||
if($nation['rice'] < 2000 && $general['rice'] > 200 && $allowedAction->donation) {
|
||||
$amount = intdiv($general['rice'] - 200, 100) + 1;
|
||||
if($amount > 20) { $amount = 20; }
|
||||
$command = EncodeCommand(0, 2, $amount, 44); //헌납
|
||||
@@ -602,23 +768,23 @@ function processAI($no) {
|
||||
|
||||
$target = array();
|
||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||
if($dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||
if($allowedAction->recruit && $dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||
$command = EncodeCommand(0, 0, 0, 17); //소집해제
|
||||
} elseif($dipState <= 1 || $isStart == 1) {
|
||||
//평시이거나 선포있어도 초반이면
|
||||
if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
|
||||
elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
|
||||
elseif($general['gold'] < 100) { //금없으면 쌀팜
|
||||
elseif($general['rice'] > 100 && $city['rate'] < 95 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
|
||||
elseif($general['gold'] < 100 && $allowedAction->buySellRice) { //금없으면 쌀팜
|
||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 1, $amount, 49); //팜
|
||||
} elseif($general['gold'] < 500 && $general['rice'] < 500) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
|
||||
} elseif($general['gold'] < 500 && $general['rice'] < 500 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
|
||||
elseif($general['rice'] < 100 && $allowedAction->buySellRice) { //쌀없으면 쌀삼
|
||||
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
|
||||
$command = EncodeCommand(0, 2, $amount, 49); //삼
|
||||
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||
} elseif($genType >= 2 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
|
||||
else {
|
||||
//현도시가 전방이면 공격 가능성 체크
|
||||
if($city['front'] > 0) {
|
||||
if($city['front'] > 0 && $allowedAction->battle) {
|
||||
//주변도시 체크
|
||||
$paths = explode('|', $city['path']);
|
||||
for($i=0; $i < count($paths); $i++) {
|
||||
@@ -643,6 +809,11 @@ function processAI($no) {
|
||||
$sel = rand() % 10;
|
||||
if($selCity['dev'] > 95) { $sel = 9; }
|
||||
elseif($selCity['dev'] < 70) { $sel = 0; }
|
||||
|
||||
if(!$allowedAction->warp){
|
||||
$sel = 0;
|
||||
}
|
||||
|
||||
switch($sel) {
|
||||
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 그대로 내정 80 %
|
||||
$command = EncodeCommand(0, 0, 0, 1);
|
||||
@@ -685,22 +856,22 @@ function processAI($no) {
|
||||
|
||||
} else { // 공격인 경우
|
||||
if($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
|
||||
if($city['pop'] > 40000) { $command = EncodeCommand(0, 0, 0, 11); }
|
||||
if($city['pop'] > 40000 && $allowedAction->recruit) { $command = EncodeCommand(0, 0, 0, 11); }
|
||||
else { $command = EncodeCommand(0, 0, 0, 1); }
|
||||
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
|
||||
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold'] && $allowedAction->buySellRice) {
|
||||
//금이 더 많으면 매매
|
||||
$amount = intdiv(($general['gold'] - $general['rice']) / 2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
|
||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
|
||||
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold'] && $allowedAction->buySellRice) {
|
||||
//쌀이 더 많으면 매매
|
||||
$amount = intdiv(($general['rice'] - $general['gold']) / 2, 100); // 100단위
|
||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
|
||||
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
|
||||
//자원, 병사 모두 충족
|
||||
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['train'] < 90 && $allowedAction->train) {
|
||||
$command = EncodeCommand(0, 0, 0, 13); //훈련
|
||||
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
|
||||
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90 && $allowedAction->atmos) {
|
||||
$command = EncodeCommand(0, 0, 0, 14); //사기진작
|
||||
} else {
|
||||
//공격
|
||||
@@ -720,18 +891,18 @@ function processAI($no) {
|
||||
|
||||
//전시일때
|
||||
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 || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] > 0 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||
elseif(($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) && $allowedAction->buySellRice) { // 금없으면 쌀팜
|
||||
$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 || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) { // 쌀없으면 쌀삼
|
||||
} elseif(($general['rice'] < $resrc || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) && $allowedAction->buySellRice) { // 쌀없으면 쌀삼
|
||||
$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'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
|
||||
elseif($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc && $allowedAction->recruit) {
|
||||
$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);
|
||||
@@ -749,38 +920,29 @@ function processAI($no) {
|
||||
$ratio2 = Util::round($genCount2 / $genCount * 100);
|
||||
$ratio3 = rand() % 100;
|
||||
// 전체 인구 대비 확률로 현지에서 징병
|
||||
if($city['pop'] > 40000 && 100 + $ratio - $ratio2 > $ratio3) {
|
||||
$minRecruitPop = 30000 + max($allowedAction->recruitLowestCivil?0:20000, $leadership * 100);
|
||||
if($city['pop'] >= $minRecruitPop && 100 + $ratio - $ratio2 > $ratio3) {
|
||||
$command = EncodeCommand(0, 0, 0, 11); //인구 되면 징병
|
||||
} else {
|
||||
// 인구 안되면 4만 이상인 도시로 워프
|
||||
$query = "select city from city where nation='{$general['nation']}' and pop>40000 and supply='1' order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($result);
|
||||
if($cityCount > 0) {
|
||||
} else{
|
||||
$warpCityID = $db->queryFirstField('SELECT city FROM city WHERE nation=%i AND pop>=%i AND supply=1 ORDER BY rand() limit 1', $general['nation'], $minRecruitPop);
|
||||
if($warpCityID && $allowedAction->warp) {
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
//워프
|
||||
$query = "update general set city='{$selCity['city']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'city'=>$warpCityID
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, 50); //요양
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
|
||||
return;
|
||||
} else {
|
||||
} else if($allowedAction->develop){
|
||||
$command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장
|
||||
}
|
||||
}
|
||||
} 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),"");
|
||||
}
|
||||
} elseif($general['crew'] >= 1000 && $general['train'] < 90 && $allowedAction->train) {
|
||||
$command = EncodeCommand(0, 0, 0, 13); //훈련
|
||||
} 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),"");
|
||||
}
|
||||
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90 && $allowedAction->atmos) {
|
||||
$command = EncodeCommand(0, 0, 0, 14); //사기진작
|
||||
} elseif($dipState <= 3) {
|
||||
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달
|
||||
@@ -800,32 +962,37 @@ function processAI($no) {
|
||||
if($dip['state'] == 0) $target[] = $targetCity['city'];
|
||||
}
|
||||
}
|
||||
if(count($target) == 0) {
|
||||
//전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프
|
||||
if(rand()%100 < 30) {
|
||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by gen1 desc,rand() limit 0,1";
|
||||
} else {
|
||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by rand() limit 0,1";
|
||||
if(count($target) == 0 && $allowedAction->warp) {
|
||||
//전방 도시 선택, 태수, 군사, 시중이 배정되어 있으면 이동 확률 증가
|
||||
$warpCities = $db->queryAllLists('SELECT city, gen1, gen2, gen3 FROM city WHERE nation = %i AND supply = 1 AND front > 0', $general['nation']);
|
||||
$warpCandidates = [];
|
||||
foreach($warpCities as [$cityID, $gen1, $gen2, $gen3]){
|
||||
$score = 1;
|
||||
if($gen1){
|
||||
$score += 1;
|
||||
}
|
||||
if($gen2){
|
||||
$score += 1;
|
||||
}
|
||||
if($gen3){
|
||||
$score += 1;
|
||||
}
|
||||
$warpCandidates[$cityID] = $score;
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($result);
|
||||
if($cityCount == 0) {
|
||||
if($warpCandidates){
|
||||
$selCity = Util::choiceRandomUsingWeight($warpCandidates);
|
||||
}
|
||||
else{
|
||||
//도시 수, 랜덤(상위 20%) 선택, 저개발 도시 선택
|
||||
$query = "select city from city where nation='{$general['nation']}' and supply='1'";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($result);
|
||||
$citySelect = rand() % (Util::round($cityCount/5) + 1);
|
||||
$cityCnt = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1', $general['nation']);
|
||||
$citySelect = Util::randRangeInt(0, Util::toInt($cityCnt/5));
|
||||
|
||||
$query = "select city,(def+wall)/(def2+wall2) as dev from city where nation='{$general['nation']}' and supply='1' order by dev limit {$citySelect},1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
} else {
|
||||
$selCity = MYDB_fetch_array($result);
|
||||
$selCity = $db->queryFirstField('SELECT city, (def+wall)/(def2+wall2) as dev from city where nation=%i and supply=1 order by dev limit %i,1',$general['nation'], $citySelect);
|
||||
}
|
||||
|
||||
if($general['city'] != $selCity['city']) {
|
||||
if($general['city'] != $selCity) {
|
||||
//워프
|
||||
$query = "update general set city='{$selCity['city']}' where no='{$general['no']}'";
|
||||
$query = "update general set city='{$selCity}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),"");
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, 50); //요양
|
||||
@@ -835,20 +1002,36 @@ function processAI($no) {
|
||||
} else {
|
||||
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //공격 가능도시가 없고 워프도 안되면 내정, 조달
|
||||
}
|
||||
} elseif($nation['war'] == 1) {
|
||||
} elseif($nation['war'] == 1 || !$allowedAction->battle) {
|
||||
//전금이면 내정, 조달
|
||||
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //내정, 조달
|
||||
} else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
|
||||
} else if($target && $general['crew'] >= 1000){ $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch($command) {
|
||||
case EncodeCommand(0, 0, 0, 1): //내정
|
||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||
if($allowedAction->develop){
|
||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 29)
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
return;
|
||||
case EncodeCommand(0, 0, 0, 11): //징병
|
||||
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
|
||||
if ($allowedAction->recruit) {
|
||||
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $leadership, $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40'], $general['crewtype'], $allowedAction);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 29)
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
return;
|
||||
default:
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
@@ -867,7 +1050,6 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
|
||||
$nationCities = [];
|
||||
$frontCitiesID = [];
|
||||
$frontImportantCitiesID = [];
|
||||
$supplyCitiesID = [];
|
||||
$backupCitiesID = [];
|
||||
|
||||
@@ -889,10 +1071,18 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
if($nationCity['supply']){
|
||||
$supplyCitiesID[] = $cityID;
|
||||
if($nationCity['front']){
|
||||
$frontCitiesID[] = $cityID;
|
||||
$score = 1;
|
||||
if($nationCity['gen1']){
|
||||
$frontImportantCitiesID[] = $cityID;
|
||||
$score += 1;
|
||||
}
|
||||
if($nationCity['gen2']){
|
||||
$score += 1;
|
||||
}
|
||||
if($nationCity['gen3']){
|
||||
$score += 1;
|
||||
}
|
||||
$frontCitiesID[$cityID] = $score;
|
||||
|
||||
}
|
||||
else{
|
||||
$backupCitiesID[] = $cityID;
|
||||
@@ -900,7 +1090,6 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
}
|
||||
}
|
||||
Util::shuffle_assoc($nationCities);
|
||||
shuffle($frontCitiesID);
|
||||
shuffle($supplyCitiesID);
|
||||
|
||||
$nationGenerals = [];
|
||||
@@ -913,7 +1102,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
|
||||
$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) {
|
||||
foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level`, troop FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) {
|
||||
$cityID = $nationGeneral['city'];
|
||||
$generalID = $nationGeneral['no'];
|
||||
|
||||
@@ -958,7 +1147,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$lostGeneral = $nationGenerals[$lostGeneralID];
|
||||
if($lostGeneral['npc'] < 2){
|
||||
if($dipState >= 3 && $frontCitiesID){
|
||||
$selCityID = Util::choiceRandom($frontCitiesID);
|
||||
$selCityID = Util::choiceRandomUsingWeight($frontCitiesID);
|
||||
}
|
||||
else{
|
||||
$selCityID = Util::choiceRandom($supplyCitiesID);
|
||||
@@ -1082,7 +1271,15 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
}
|
||||
} else{ // 포상
|
||||
$compNpcWar = $npcWarGeneralsID?$nationGenerals[$npcWarGeneralsID[0]]:null;
|
||||
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[$npcCivilGeneralsID[0]]:null;
|
||||
$compNpcCivil = null;
|
||||
foreach($npcCivilGeneralsID??[] as $npcCivilID){
|
||||
$npcCivil = $nationGenerals[$npcCivilID];
|
||||
if($npcCivil['npc'] == 5){
|
||||
continue;
|
||||
}
|
||||
$compNpcCivil = $npcCivil;
|
||||
break;
|
||||
}
|
||||
|
||||
if($compNpcWar && $compNpcWar[$resName] < 21000){
|
||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||
@@ -1102,7 +1299,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
continue;
|
||||
}
|
||||
if($dipState >= 3 && $frontCitiesID){
|
||||
$selCityID = Util::choiceRandom($frontCitiesID);
|
||||
$selCityID = Util::choiceRandomUsingWeight($frontCitiesID);
|
||||
}
|
||||
else{
|
||||
$selCityID = Util::choiceRandom($supplyCitiesID);
|
||||
@@ -1171,13 +1368,18 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
|
||||
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($targetGeneral['troop'] != 0){
|
||||
$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){
|
||||
if($targetGeneral['npc']==5){
|
||||
|
||||
}
|
||||
else if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95 && $targetGeneral['troop'] == 0){
|
||||
//유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함!
|
||||
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5;
|
||||
}
|
||||
@@ -1205,18 +1407,17 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
if($nationGeneral['train'] * $nationGeneral['atmos'] < 75 * 75){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($nationGeneral['troop'] != 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
$score = 5;
|
||||
if($nationGeneral['npc']<2){
|
||||
$score *= 4;
|
||||
}
|
||||
|
||||
if(Util::randBool(0.3) && $frontImportantCitiesID){
|
||||
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
|
||||
}
|
||||
else{
|
||||
$targetCityID = Util::choiceRandom($frontCitiesID);
|
||||
}
|
||||
$targetCityID = Util::choiceRandomUsingWeight($frontCitiesID);
|
||||
|
||||
$command = EncodeCommand(0, $nationGeneral['no'], $targetCityID, 27);
|
||||
|
||||
@@ -1252,7 +1453,10 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
if(!$generalCity['front']){
|
||||
continue;
|
||||
}
|
||||
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
||||
if($generalCity['pop'] - 33000 > $nationGeneral['leader'] * 100){
|
||||
continue;
|
||||
}
|
||||
if($nationGeneral['troop'] != 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1264,7 +1468,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
$popTrial = 5;
|
||||
for($popTrial = 0; $popTrial < 5; $popTrial++){
|
||||
$targetCity = $nationCities[Util::choiceRandom($backupCitiesID)];
|
||||
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
|
||||
if($targetCity['pop'] < 33000 + $nationGeneral['leader'] * 100){
|
||||
continue;
|
||||
}
|
||||
if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) {
|
||||
@@ -1294,7 +1498,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
return Util::choiceRandomUsingWeight($commandList);
|
||||
}
|
||||
|
||||
//종전하기, 지급율
|
||||
//종전하기, 지급률
|
||||
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
|
||||
|
||||
function Promotion($nation, $level) {
|
||||
@@ -1372,6 +1576,10 @@ function Promotion($nation, $level) {
|
||||
$query = "update general set level={$i2} where no='{$level['no']}'";
|
||||
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
$db->update('general', [
|
||||
'permission'=>'ambassador',
|
||||
], 'nation=%i AND npc < 2 AND level > 4', $nation);
|
||||
}
|
||||
|
||||
function TaxRate($nation) {
|
||||
|
||||
+316
-87
@@ -159,6 +159,17 @@ function CriticalRatioDomestic(&$general, $type) {
|
||||
);
|
||||
}
|
||||
|
||||
function calcLeadershipBonus($generalLevel, $nationLevel):int{
|
||||
if($generalLevel == 12) {
|
||||
$lbonus = $nationLevel * 2;
|
||||
} elseif($generalLevel >= 5) {
|
||||
$lbonus = $nationLevel;
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
}
|
||||
return $lbonus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 수뇌직 통솔 보너스 계산
|
||||
*
|
||||
@@ -168,13 +179,7 @@ function CriticalRatioDomestic(&$general, $type) {
|
||||
* @return int 계산된 $general['lbonus'] 값
|
||||
*/
|
||||
function setLeadershipBonus(&$general, $nationLevel){
|
||||
if($general['level'] == 12) {
|
||||
$lbonus = $nationLevel * 2;
|
||||
} elseif($general['level'] >= 5) {
|
||||
$lbonus = $nationLevel;
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
}
|
||||
$lbonus = calcLeadershipBonus($general['level'], $nationLevel);
|
||||
$general['lbonus'] = $lbonus;
|
||||
return $lbonus;
|
||||
}
|
||||
@@ -273,6 +278,17 @@ function process_1(&$general, $type) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
if($city['front'] == 1){
|
||||
if($city['city'] == $nation['capital']){
|
||||
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
|
||||
$score *= Util::valueFit($degrade, 0.5, 1);
|
||||
}
|
||||
else{
|
||||
$score *= 0.5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$score += $city["$stype"];
|
||||
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
|
||||
// 내정 상승
|
||||
@@ -365,17 +381,26 @@ function process_3(&$general) {
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score = intdiv($score, 4); }
|
||||
|
||||
//장수수 구함
|
||||
$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 < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
$gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i', $general['nation']);
|
||||
$gencnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $general['nation']);
|
||||
if ($gencnt_eff < GameConst::$initialNationGenLimit) {
|
||||
$gencount = max(GameConst::$initialNationGenLimit, $gencount);
|
||||
$gencnt_eff = GameConst::$initialNationGenLimit;
|
||||
}
|
||||
|
||||
if($gencount != $gencnt_eff){
|
||||
$score *= $gencount / $gencnt_eff;
|
||||
}
|
||||
|
||||
// 부드러운 기술 제한
|
||||
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score /= 4; }
|
||||
|
||||
// 내정 상승
|
||||
$query = "update nation set totaltech=totaltech+'$score',tech=totaltech/'$gencount' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'totaltech'=>$db->sqleval('totaltech + %i', Util::round($score)),
|
||||
'tech'=>$db->sqleval('totaltech / %i', $gencount)
|
||||
], 'nation=%i', $general['nation']);
|
||||
// 자금 하락, 경험치 상승 // 공헌도, 명성 상승 = $score * 10
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
|
||||
@@ -433,7 +458,7 @@ function process_4(&$general) {
|
||||
|
||||
// 군주, 참모 보정
|
||||
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
|
||||
// 시중 보정
|
||||
// 종사 보정
|
||||
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
|
||||
|
||||
$rd = Util::randF();
|
||||
@@ -558,6 +583,29 @@ function process_5(&$general, $type) {
|
||||
$exp = $score * 0.7;
|
||||
$ded = $score * 1.0;
|
||||
|
||||
if($city['front'] == 1){
|
||||
if($city['city'] == $nation['capital']){
|
||||
if($stype == 'def'){
|
||||
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
|
||||
$score *= Util::valueFit($degrade, 0.5, 1);
|
||||
}
|
||||
else{
|
||||
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.0375;
|
||||
$score *= Util::valueFit($degrade, 0.25, 1);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($stype == 'def'){
|
||||
$score *= 0.5;
|
||||
}
|
||||
else{
|
||||
$score *= 0.25;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -623,7 +671,7 @@ function process_7(&$general) {
|
||||
|
||||
// 군주, 참모 보정
|
||||
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
|
||||
// 시중 보정
|
||||
// 종사 보정
|
||||
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
|
||||
|
||||
$rd = Util::randF();
|
||||
@@ -1225,7 +1273,6 @@ function process_15(&$general) {
|
||||
function process_16(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
@@ -1234,71 +1281,134 @@ function process_16(&$general) {
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
||||
|
||||
$query = "select nation,war,sabotagelimit,tech from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
$nation = $db->queryFirstRow('SELECT nation,war,sabotagelimit,tech from nation where nation=%i', $general['nation']);
|
||||
$city = $db->queryFirstRow('SELECT nation,supply from city where city=%i', $general['city']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$destination = $command[1];
|
||||
$finalTarget = $command[1];
|
||||
$finalDestCityName = CityConst::byID($finalTarget)->name;
|
||||
|
||||
$query = "select * from city where city='$destination'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,sabotagelimit,tech from nation where nation='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dnation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dip = MYDB_fetch_array($result);
|
||||
|
||||
if(key_exists($destination, CityConst::byID($general['city'])->path)){
|
||||
$nearCity = true;
|
||||
}
|
||||
else{
|
||||
$nearCity = false;
|
||||
}
|
||||
|
||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||
if($admin['year'] < $admin['startyear']+3) {
|
||||
$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></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif(!$nearCity) {
|
||||
$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></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($general['crew'] <= 0) {
|
||||
$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></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($dip['state'] != 0) {
|
||||
$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></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
} elseif($nation['war'] == 1) {
|
||||
$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></>{$josaRo} 출병 실패. <1>$date</>";
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 초반 제한중입니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
if($general['crew'] <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['rice'] <= Util::round($general['crew']/100)) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
if($nation['war'] == 1) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 전쟁 금지입니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['nation'] != $city['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국에서만 출병가능합니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
if($general['city'] == $finalTarget){
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 도착했습니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$allowedNationList = $db->queryFirstColumn('SELECT you FROM diplomacy WHERE state = 0 AND me = %i', $general['nation']);
|
||||
$allowedNationList[] = $general['nation'];
|
||||
$allowedNationList[] = 0;
|
||||
|
||||
$distanceList = searchDistanceListToDest($general['city'], $finalTarget, $allowedNationList);
|
||||
|
||||
if(!$distanceList){
|
||||
$log[] = "<C>●</>{$admin['month']}월:경로에 도달할 방법이 없습니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
return;
|
||||
}
|
||||
|
||||
$candidateCities = [];
|
||||
|
||||
$minDist = Util::array_first_key($distanceList);
|
||||
do {
|
||||
//1: 최단 거리 도시 중 공격 대상이 있는가 확인
|
||||
//2: 최단 거리 + 1 도시 중 공격 대상이 있는가 확인
|
||||
foreach($distanceList as $dist => $distCitiesInfo){
|
||||
if($dist > $minDist + 1){
|
||||
break;
|
||||
}
|
||||
$currDist = $dist;
|
||||
foreach($distCitiesInfo as [$distCityID, $distCityNation]){
|
||||
if($distCityNation !== $general['nation']){
|
||||
$candidateCities[] = $distCityID;
|
||||
}
|
||||
}
|
||||
|
||||
if($candidateCities){
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
//3: 최단 거리 도시 중 아군 도시 선택
|
||||
foreach($distanceList[$minDist] as [$distCityID, $distCityNation]){
|
||||
if($distCityNation === $general['nation']){
|
||||
$candidateCities[] = $distCityID;
|
||||
}
|
||||
}
|
||||
}while(false);
|
||||
|
||||
$destCityID = (int)Util::choiceRandom($candidateCities);
|
||||
$destCity = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $destCityID);
|
||||
|
||||
if($general['nation'] == $destCity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:경로에 적국 도시가 없습니다. <G><b>{$finalDestCityName}</b></> 방향으로 출병 실패. <1>$date</>";
|
||||
$general['turn0'] = EncodeCommand(0, 0, $destCityID, 26);
|
||||
pushGenLog($general, $log);
|
||||
process_21($general);
|
||||
return;
|
||||
} else {
|
||||
// 전쟁 표시
|
||||
$query = "update city set state=43,term=3 where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 전투 처리
|
||||
processWar($general, $destcity);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
$destCityName = CityConst::byID($destCityID)->name;
|
||||
if($finalTarget !== $destCityID){
|
||||
$josaRo = JosaUtil::pick($finalDestCityName, '로');
|
||||
$josaUl = JosaUtil::pick($destCityName, '을');
|
||||
if($minDist == $currDist){
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$finalDestCityName}</b></>{$josaRo} 가기 위해 <G><b>{$destCityName}</b></>{$josaUl} 거쳐야 합니다. <1>$date</>";
|
||||
}
|
||||
else{
|
||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$finalDestCityName}</b></>{$josaRo} 가는 도중 <G><b>{$destCityName}</b></>{$josaUl} 거치기로 합니다. <1>$date</>";
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
$log = [];
|
||||
}
|
||||
|
||||
// 전쟁 표시
|
||||
$db->update('city', [
|
||||
'state'=>43,
|
||||
'term'=>3
|
||||
], 'city = %i', $destCityID);
|
||||
// 숙련도 증가
|
||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||
// 전투 처리
|
||||
processWar($general, $destCity);
|
||||
$log = uniqueItem($general, $log);
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
@@ -1748,6 +1858,55 @@ function process_31(&$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_38(&$general, string $specName, string $specTypeKey, string $specAgeKey) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
$genAux = Json::decode($general['aux']);
|
||||
|
||||
|
||||
if($general['term']%100 == 38) {
|
||||
$term = intdiv($general['term'], 100) + 1;
|
||||
$code = $term * 100 + 38;
|
||||
} else {
|
||||
$term = 1;
|
||||
$code = 100 + 38;
|
||||
}
|
||||
|
||||
if($genAux['used_38_'.$specTypeKey]??0){
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 {$specName}을 초기화했습니다. {$specName} 초기화 실패. <1>$date</>";
|
||||
}
|
||||
else if(!$general[$specTypeKey]) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:{$specName}를 갖고 있지 않습니다. {$specName} 초기화 실패. <1>$date</>";
|
||||
} elseif($term < 3) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:새로운 적성을 찾는 중... ({$term}/3) <1>$date</>";
|
||||
|
||||
$query = "update general set resturn='ONGOING',term={$code} where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
|
||||
$genAux['used_38_'.$specTypeKey] = 1;
|
||||
$general[$specAgeKey]=20;
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'term'=>0,
|
||||
$specTypeKey=>0,
|
||||
$specAgeKey=>$db->sqleval('age+1'),
|
||||
'aux'=>Json::encode($genAux)
|
||||
], 'no = %i', $general['no']);
|
||||
|
||||
$log[] = "<C>●</>{$admin['month']}월:새로운 {$specName}를 가질 준비가 되었습니다. <1>$date</>";
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_41(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
@@ -1896,8 +2055,7 @@ function process_42(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:호랑이에게 물려 다쳤습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 10 + 10;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 11:
|
||||
@@ -1911,8 +2069,7 @@ function process_42(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:곰에게 할퀴어 다쳤습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 10 + 10;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 13:
|
||||
@@ -1931,8 +2088,7 @@ function process_42(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:위기에 빠진 사람을 구해주다가 다쳤습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 10 + 10;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp2' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp2' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 16:
|
||||
@@ -1997,24 +2153,21 @@ function process_42(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:호랑이에게 물려 크게 다쳤습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 30 + 20;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 25:
|
||||
$log[] = "<C>●</>{$admin['month']}월:곰에게 할퀴어 크게 다쳤습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 30 + 20;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 26:
|
||||
$log[] = "<C>●</>{$admin['month']}월:위기에 빠진 사람을 구하다가 죽을뻔 했습니다. <1>$date</>";
|
||||
// 경험치 하락 // 명성 상승
|
||||
$injury = rand() % 50 + 30;
|
||||
$general['power2']--;
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp2' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp2' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
default:
|
||||
@@ -2486,6 +2639,82 @@ function process_50(&$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
|
||||
function process_58(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
|
||||
$fromDexIdx = $command[1];
|
||||
$toDexIdx = $command[2];
|
||||
|
||||
|
||||
|
||||
|
||||
if($general['nation'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 숙련 전환 실패. <1>$date</>";
|
||||
} elseif($general['gold'] < $admin['develcost']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 숙련 전환 실패. <1>$date</>";
|
||||
} elseif($general['rice'] < $admin['develcost']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. 숙련 전환 실패. <1>$date</>";
|
||||
} elseif($fromDexIdx < 0 || $fromDexIdx > 4 || $toDexIdx < 0 || $toDexIdx > 4){
|
||||
$log[] = "<C>●</>{$admin['month']}월:올바르지 않은 병종 코드입니다. 숙련 전환 실패. <1>$date</>";
|
||||
} elseif($general['dex'.($fromDexIdx*10)] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:전환할 병종 숙련이 없습니다. 숙련 전환 실패. <1>$date</>";
|
||||
} else {
|
||||
|
||||
$fromOrigDex = $general['dex'.($fromDexIdx*10)];
|
||||
$toOrigDex = $general['dex'.($toDexIdx*10)];
|
||||
|
||||
$cutDex = Util::toInt($fromOrigDex * 0.3);
|
||||
$fromNewDex = $fromOrigDex - $cutDex;
|
||||
|
||||
if($fromDexIdx == $toDexIdx){
|
||||
$toOrigDex = $fromNewDex;
|
||||
}
|
||||
|
||||
$addDex = Util::toInt($cutDex * 2 / 3);
|
||||
$toNewDex = $toOrigDex + $addDex;
|
||||
|
||||
if($fromDexIdx == $toDexIdx){
|
||||
$fromNewDex = $toNewDex;
|
||||
}
|
||||
|
||||
$exp = 10;
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
|
||||
$fromCrewStr = GameUnitConst::allType()[$fromDexIdx];
|
||||
$toCrewStr = GameUnitConst::allType()[$toDexIdx];
|
||||
|
||||
|
||||
$josaUl = JosaUtil::pick($cutDex, '을');
|
||||
$josaRo = JosaUtil::pick($addDex, '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:$fromCrewStr 숙련 {$cutDex}{$josaUl} $toCrewStr 숙련 {$addDex}{$josaRo} 전환했습니다. <1>$date</>";
|
||||
|
||||
$general['leader2'] += 2;
|
||||
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'gold'=>$db->sqleval('gold-%i', $admin['develcost']),
|
||||
'rice'=>$db->sqleval('rice-%i', $admin['develcost']),
|
||||
'experience'=>$db->sqleval('experience+%i',$exp),
|
||||
'leader2'=>$general['leader2'],
|
||||
'dex'.($fromDexIdx*10)=>$fromNewDex,
|
||||
'dex'.($toDexIdx*10)=>$toNewDex,
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
|
||||
function process_99(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
+163
-52
@@ -605,11 +605,6 @@ function process_61(&$general) {
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
//FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다.
|
||||
//XXX: 으악.
|
||||
//TODO: 커맨드 처리 방식을 json으로 변경
|
||||
$option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
@@ -619,19 +614,11 @@ function process_61(&$general) {
|
||||
$validUntil,
|
||||
[
|
||||
'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION,
|
||||
'year'=>$when,
|
||||
'option'=>$option
|
||||
'year'=>$when
|
||||
]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
//NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다.
|
||||
//FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록.
|
||||
$db->update('diplomacy', [
|
||||
'showing'=>$validUntil->format('Y-m-d H:i:s')
|
||||
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
// 3턴후
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
@@ -1091,7 +1078,7 @@ function process_67(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
|
||||
$amount = $admin['develcost'] * 500 + 60000; // 7만~13만
|
||||
$amount = $admin['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost; // 7만~13만
|
||||
|
||||
$code = $nation["l{$general['level']}term"];
|
||||
if($code%100 == 67) {
|
||||
@@ -1144,8 +1131,16 @@ function process_67(&$general) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//수도 증축
|
||||
$query = "update city set upgrading=upgrading+1,level=level+1,pop2=pop2+100000,agri2=agri2+2000,comm2=comm2+2000,def2=def2+2000,wall2=wall2+2000,secu2=secu2+2000 where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('city', [
|
||||
'upgrading'=>$db->sqleval('upgrading+1'),
|
||||
'level'=>$db->sqleval('level+1'),
|
||||
'pop2'=>$db->sqleval('pop2 + %i', GameConst::$expandCityPopIncreaseAmount),
|
||||
'agri2'=>$db->sqleval('agri2 + %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'comm2'=>$db->sqleval('comm2 + %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'secu2'=>$db->sqleval('secu2 + %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'def2'=>$db->sqleval('def2 + %i', GameConst::$expandCityWallIncreaseAmount),
|
||||
'wall2'=>$db->sqleval('wall2 + %i', GameConst::$expandCityWallIncreaseAmount),
|
||||
], 'city=%i', $destcity['city']);
|
||||
|
||||
//경험치, 공헌치
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
@@ -1185,7 +1180,7 @@ function process_68(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$destcity = MYDB_fetch_array($result);
|
||||
|
||||
$amount = $admin['develcost'] * 500 + 30000; // 4만~10만
|
||||
$amount = $admin['develcost'] * GameConst::$expandCityCostCoef + GameConst::$expandCityDefaultCost / 2; // 4만~10만
|
||||
|
||||
$code = $nation["l{$general['level']}term"];
|
||||
if($code%100 == 68) {
|
||||
@@ -1200,12 +1195,10 @@ function process_68(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수도에서 실행해야 합니다. 감축 실패. <1>$date</>";
|
||||
} elseif($nation['capital'] != $destcity['city']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수도만 가능합니다. 감축 실패. <1>$date</>";
|
||||
} elseif($destcity['level'] <= 3) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수진, 진, 관문은 불가능합니다. 감축 실패. <1>$date</>";
|
||||
} elseif($destcity['level'] <= 6) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:더이상 감축할 수 없습니다. 감축 실패. <1>$date</>";
|
||||
} elseif($destcity['upgrading'] <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:증축된 도시가 아닙니다. 감축 실패. <1>$date</>";
|
||||
} elseif($destcity['level'] <= 4) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수, 진, 관문, 이성은 불가능합니다. 감축 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 감축 실패. <1>$date</>";
|
||||
} elseif($nation['capset'] == 1) {
|
||||
@@ -1237,12 +1230,12 @@ function process_68(&$general) {
|
||||
$query = "update nation set l{$general['level']}term='0',capset='1',gold=gold+'$amount',rice=rice+'$amount' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$pop = $destcity['pop'] - 100000;
|
||||
$agri = $destcity['agri'] - 2000;
|
||||
$comm = $destcity['comm'] - 2000;
|
||||
$def = $destcity['def'] - 2000;
|
||||
$wall = $destcity['wall'] - 2000;
|
||||
$secu = $destcity['secu'] - 2000;
|
||||
$pop = $destcity['pop'] - GameConst::$expandCityPopIncreaseAmount;
|
||||
$agri = $destcity['agri'] - GameConst::$expandCityDevelIncreaseAmount;
|
||||
$comm = $destcity['comm'] - GameConst::$expandCityDevelIncreaseAmount;
|
||||
$def = $destcity['def'] - GameConst::$expandCityWallIncreaseAmount;
|
||||
$wall = $destcity['wall'] - GameConst::$expandCityWallIncreaseAmount;
|
||||
$secu = $destcity['secu'] - GameConst::$expandCityDevelIncreaseAmount;
|
||||
if($pop < 30000) { $pop = 30000; }
|
||||
if($agri < 0) { $agri = 0; }
|
||||
if($comm < 0) { $comm = 0; }
|
||||
@@ -1250,8 +1243,22 @@ function process_68(&$general) {
|
||||
if($wall < 0) { $wall = 0; }
|
||||
if($secu < 0) { $secu = 0; }
|
||||
//수도 감축
|
||||
$query = "update city set upgrading=upgrading-1,level=level-1,pop2=pop2-100000,agri2=agri2-2000,comm2=comm2-2000,def2=def2-2000,wall2=wall2-2000,secu2=secu2-2000,pop='$pop',agri='$agri',comm='$comm',def='$def',wall='$wall',secu='$secu' where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('city', [
|
||||
'upgrading'=>$db->sqleval('upgrading-1'),
|
||||
'level'=>$db->sqleval('level-1'),
|
||||
'pop2'=>$db->sqleval('pop2 - %i', GameConst::$expandCityPopIncreaseAmount),
|
||||
'agri2'=>$db->sqleval('agri2 - %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'comm2'=>$db->sqleval('comm2 - %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'secu2'=>$db->sqleval('secu2 - %i', GameConst::$expandCityDevelIncreaseAmount),
|
||||
'def2'=>$db->sqleval('def2 - %i', GameConst::$expandCityWallIncreaseAmount),
|
||||
'wall2'=>$db->sqleval('wall2 - %i', GameConst::$expandCityWallIncreaseAmount),
|
||||
'pop'=>$pop,
|
||||
'agri'=>$agri,
|
||||
'comm'=>$comm,
|
||||
'secu'=>$secu,
|
||||
'def'=>$def,
|
||||
'wall'=>$wall
|
||||
], 'city=%i', $destcity['city']);
|
||||
|
||||
//경험치, 공헌치
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
@@ -1907,7 +1914,7 @@ function process_76(&$general) {
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','turntime']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1981,31 +1988,55 @@ function process_76(&$general) {
|
||||
$avgNation = MYDB_fetch_array($result);
|
||||
$gencount = 5 + Util::round($avgNation['gennum'] / 10);
|
||||
|
||||
$query = "select avg(age) as age, 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),"");
|
||||
$avgGen = MYDB_fetch_array($result);
|
||||
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) as dex_t, avg(age) as age, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
||||
|
||||
$dexTotal = $avgGen['dex_t'];
|
||||
|
||||
//의병추가
|
||||
$npc = 4;
|
||||
$npcid = $admin['npccount'];
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
// 무장 40%, 지장 40%, 무지장 20%
|
||||
$type = rand() % 10;
|
||||
switch($type) {
|
||||
case 0: case 1: case 2: case 3:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatTotal - $leader - $intel;
|
||||
//무장 50%, 지장 50%, 무지장 0%
|
||||
$stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
||||
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
||||
$type = Util::choiceRandomUsingWeight([
|
||||
'power0'=>1,
|
||||
'power1'=>1,
|
||||
'power2'=>1,
|
||||
'intel'=>3,
|
||||
'neutral'=>0
|
||||
]);
|
||||
switch($type){
|
||||
case 'power0':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal*5/8, $dexTotal/8, $dexTotal/8, $dexTotal/8];
|
||||
break;
|
||||
case 4: case 5: case 6: case 7:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$power = GameConst::$defaultStatMin + rand()%6;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
case 'power1':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal/8, $dexTotal*5/8, $dexTotal/8, $dexTotal/8];
|
||||
break;
|
||||
case 8: case 9:
|
||||
$leader = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
case 'power2':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal*5/8, $dexTotal/8];
|
||||
break;
|
||||
case 'intel':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier3;
|
||||
$intel = $stat_tier2;
|
||||
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal/8, $dexTotal*5/8];
|
||||
break;
|
||||
default:
|
||||
$leader = $stat_tier3;
|
||||
$power = $stat_tier1;
|
||||
$intel = $stat_tier2;
|
||||
$dexVal = [$dexTotal/4, $dexTotal/4, $dexTotal/4, $dexTotal/4];
|
||||
break;
|
||||
}
|
||||
// 국내 최고능치 기준으로 랜덤성 스케일링
|
||||
@@ -2039,7 +2070,7 @@ function process_76(&$general) {
|
||||
$intel -= $over3;
|
||||
}
|
||||
// 낮은 능치쪽으로 합산
|
||||
if($type == 0) {
|
||||
if($type == 'power') {
|
||||
$intel = $intel + $over1 + $over2 + $over3;
|
||||
} else {
|
||||
$power = $power + $over1 + $over2 + $over3;
|
||||
@@ -2059,7 +2090,7 @@ function process_76(&$general) {
|
||||
$affinity = rand() % 150 + 1;
|
||||
$name = "ⓖ의병장{$npcid}";
|
||||
$picture = 'default.jpg';
|
||||
$turntime = getRandTurn($admin['turnterm']);
|
||||
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
|
||||
$personal = rand() % 10;
|
||||
$bornyear = $admin['year'];
|
||||
$deadyear = $admin['year'] + 3;
|
||||
@@ -2079,7 +2110,7 @@ function process_76(&$general) {
|
||||
'1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
|
||||
'0','$bornyear','$deadyear',
|
||||
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
||||
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
|
||||
)",
|
||||
$connect
|
||||
) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -2446,3 +2477,83 @@ function process_81(&$general) {
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_82(&$general) {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['year','month']);
|
||||
|
||||
$query = "select nation from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,name,type,sabotagelimit,aux from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nationAux = Json::decode($nation['aux']??'{}');
|
||||
$newNationName = $general['makenation'];
|
||||
|
||||
$nationExists = $db->queryFirstField('SELECT nation FROM nation WHERE name = %s', $newNationName);
|
||||
|
||||
if($nationExists){
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 같은 국호를 가진 곳이 있습니다. 국호변경 실패. <1>$date</>";
|
||||
}
|
||||
else if($city['nation'] != $general['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 국호변경 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 국호변경 실패. <1>$date</>";
|
||||
} elseif($nationAux['used_82']??0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:더이상 변경이 불가능합니다. 국호변경 실패. <1>$date</>";
|
||||
} else {
|
||||
$josaRo = JosaUtil::pick($newNationName, '로');
|
||||
$log[] = "<C>●</>{$admin['month']}월:국호를 <D><b>{$newNationName}{$josaRo}</b></> 변경합니다. <1>$date</>";
|
||||
$exp = 10;
|
||||
$ded = 10;
|
||||
|
||||
// 성격 보정
|
||||
$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']}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다."];
|
||||
for($i=0; $i < $cnt; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.";
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【국호변경】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.";
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경");
|
||||
pushNationHistory($nation, "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경");
|
||||
|
||||
$nationAux['used_82'] = 1;
|
||||
//국기변경
|
||||
$db->update('nation', [
|
||||
'name'=>$newNationName,
|
||||
'aux'=>Json::encode($nationAux)
|
||||
], 'nation=%i', $nation['nation']);
|
||||
|
||||
//경험치, 공헌치
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
+188
-96
@@ -11,7 +11,7 @@ function process_22(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','join_mode']);
|
||||
|
||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -26,7 +26,10 @@ function process_22(&$general) {
|
||||
|
||||
$cost = Util::round($admin['develcost'] + ($you['experience'] + $you['dedication'])/1000) * 10;
|
||||
|
||||
if(!$you) {
|
||||
if($admin['join_mode'] == 'onlyRandom'){
|
||||
$log[] = "<C>●</>{$admin['month']}월:랜덤 임관만 가능합니다. 등용 실패. <1>$date</>";
|
||||
}
|
||||
else if(!$you) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:없는 장수입니다. 등용 실패. <1>$date</>";
|
||||
} elseif($admin['year'] < $admin['startyear']+3) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:초반 제한중입니다. 등용 실패. <1>$date</>";
|
||||
@@ -70,21 +73,26 @@ function process_25(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction']);
|
||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction', 'join_mode', 'init_year', 'init_month']);
|
||||
|
||||
$query = "select nation from city where city='{$general['city']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$type = $command[2];
|
||||
$where = $command[1];
|
||||
|
||||
if($admin['join_mode'] == 'onlyRandom' && $type < 98){
|
||||
$type = 99;
|
||||
}
|
||||
|
||||
$nation = null;
|
||||
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] < 100 || $admin['scenario'] >= 2000 || !$admin['fiction'])){
|
||||
if($general['npc'] >= 2 && $type >= 98 && !$admin['fiction'] && 1000 <= $admin['scenario'] && $admin['scenario'] < 2000){
|
||||
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
||||
$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',
|
||||
@@ -117,43 +125,67 @@ function process_25(&$general) {
|
||||
}
|
||||
|
||||
}
|
||||
else if($where >= 98) {
|
||||
else if($type >= 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;
|
||||
}
|
||||
|
||||
foreach($db->queryAllLists('SELECT count(no), nation FROM general WHERE 3 <= npc and npc <= 4 AND nation > 0 GROUP BY nation') as list($cnt, $nation)){
|
||||
//의병, 인탐장은 1/3로 카운트
|
||||
if(key_exists($nation, $generals)){
|
||||
$generals[$nation] += $cnt / 3;
|
||||
}
|
||||
else{
|
||||
$generals[$nation] = $cnt / 3;
|
||||
}
|
||||
}
|
||||
|
||||
$allGen = array_sum($generals);
|
||||
|
||||
$genLimit = GameConst::$defaultMaxGeneral;
|
||||
if($admin['join_mode'] == 'onlyRandom' && TimeUtil::IsRangeMonth($admin['init_year'], $admin['init_month'], 1, $admin['year'], $admin['month'])){
|
||||
$genLimit = GameConst::$initialNationGenLimitForRandInit;
|
||||
}
|
||||
else if($admin['year'] < $admin['startyear'] + 3){
|
||||
$genLimit = GameConst::$initialNationGenLimit;
|
||||
}
|
||||
|
||||
$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
|
||||
$genLimit
|
||||
);
|
||||
shuffle($nations);
|
||||
|
||||
$randVals = [];
|
||||
foreach($nations as $idx=>$testNation){
|
||||
// 임관금지없음 국가, 방랑군 제외
|
||||
if($where == 98 && $testNation['level'] == 0){
|
||||
if($type == 98 && $testNation['level'] == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
$score = 1;
|
||||
if($admin['startyear']+3 > $admin['year'] && $general['npc'] > 2){
|
||||
if($admin['startyear']+3 > $admin['year'] && $general['npc'] == 2){
|
||||
$score *= sqrt((100-max(30, $testNation['injury']))/100);
|
||||
}
|
||||
|
||||
$score *= sqrt($allGen/$generals[$testNation['nation']]);
|
||||
$score *= $allGen/$generals[$testNation['nation']];
|
||||
$randVals[$idx] = $score;
|
||||
}
|
||||
|
||||
if($randVals){
|
||||
$nation = $nations[Util::choiceRandomUsingWeight($randVals)];
|
||||
}
|
||||
else{
|
||||
$nation = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if($type == 0) {
|
||||
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
|
||||
} else if($type == 1){
|
||||
$where = $db->queryFirstField('SELECT nation FROM general WHERE no=%i', $where)??0;
|
||||
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
|
||||
}
|
||||
|
||||
@@ -164,6 +196,15 @@ function process_25(&$general) {
|
||||
|
||||
if(!$nation) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
|
||||
if($type >= 98 && $genLimit == GameConst::$initialNationGenLimitForRandInit){
|
||||
//랜덤 모드, 초기화시에는 랜덤 임관을 대신 한턴 더 넣어준다.
|
||||
$db->update('general', [
|
||||
'turn1'=>EncodeCommand(0, $type, 0, 25),
|
||||
], '`no` = %i', $general['no']);
|
||||
pushGenLog($general, $log);
|
||||
process_42($general);
|
||||
return;
|
||||
}
|
||||
} elseif($general['nation'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야가 아닙니다. 임관 실패. <1>$date</>";
|
||||
} elseif($nation['nation'] == 0) {
|
||||
@@ -180,7 +221,7 @@ function process_25(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
|
||||
} else {
|
||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||
if($where == 99 || $where == 98) {
|
||||
if($type == 99 || $type == 98) {
|
||||
$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></>에 임관");
|
||||
@@ -216,6 +257,7 @@ function process_25(&$general) {
|
||||
'nation'=>$nation['nation'],
|
||||
'nations'=>Json::encode($joinedNations),
|
||||
'level'=>1,
|
||||
'permission'=>'normal',
|
||||
'experience'=>$db->sqleval('experience + %i', $exp),
|
||||
'city'=>$king['city'],
|
||||
'belong'=>1
|
||||
@@ -231,7 +273,7 @@ function process_25(&$general) {
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($where < 99) {
|
||||
if($type < 99) {
|
||||
$log = uniqueItem($general, $log);
|
||||
} else {
|
||||
$log = uniqueItem($general, $log, 2);
|
||||
@@ -252,7 +294,7 @@ function process_29(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario','maxgeneral', 'turntime']);
|
||||
|
||||
$query = "select nation,name,level,gennum,scout from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -263,30 +305,39 @@ function process_29(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 인재탐색 실패. <1>$date</>";
|
||||
} elseif($nation['level'] <= 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:방랑군입니다. 인재탐색 실패. <1>$date</>";
|
||||
} 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 {
|
||||
$query = "select no from general where nation='{$general['nation']}' and npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select no from general where nation='{$general['nation']}' and npc=3";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$npccount = MYDB_num_rows($result);
|
||||
$max_gen_cnt = $admin['maxgeneral'];
|
||||
|
||||
$query = "select no from general where nation!='{$general['nation']}' and npc=3";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$otherNpccount = MYDB_num_rows($result);
|
||||
$otherNpccount = Util::round(sqrt($otherNpccount + 1)) - 1;
|
||||
|
||||
if($gencount <= 0) { $gencount = 1; }
|
||||
if($npccount <= 0) { $npccount = 1; }
|
||||
$criteria = $gencount * $npccount + $otherNpccount;
|
||||
$total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2');
|
||||
$total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4');
|
||||
|
||||
$gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']);
|
||||
$npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']);
|
||||
|
||||
$nation_cnt = $db->queryFirstField('SELECT count(`nation`) FROM nation WHERE `level` > 0');
|
||||
|
||||
$curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2);
|
||||
$remain_slot = $max_gen_cnt - $curr_cnt;
|
||||
|
||||
$avg_cnt = $curr_cnt / $nation_cnt;
|
||||
|
||||
$found_prop_main = pow($remain_slot / $max_gen_cnt, 6);
|
||||
$found_prop_small = 1 / ($total_npc_cnt / 3 + 1);
|
||||
$found_prop_big = 1 / $max_gen_cnt;
|
||||
|
||||
if($total_npc_cnt < 50){
|
||||
$found_prop = max($found_prop_main, $found_prop_small);
|
||||
}
|
||||
else{
|
||||
$found_prop = max($found_prop_main, $found_prop_big);
|
||||
}
|
||||
$found_npc = Util::randBool($found_prop);
|
||||
|
||||
// 탐색 실패
|
||||
if(rand() % $criteria > 0) {
|
||||
if(!$found_npc) {
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) {
|
||||
@@ -316,7 +367,17 @@ function process_29(&$general) {
|
||||
$name = "{$name}{$count}";
|
||||
}
|
||||
|
||||
if($nation['scout'] != 0) {
|
||||
$join_prop = 0.55 * $avg_cnt / ($gen_cnt + $npc_cnt / 2);
|
||||
|
||||
$no_scout = false;
|
||||
if($nation['scout'] != 0){
|
||||
$no_scout = true;
|
||||
}
|
||||
else if($admin['year'] < $admin['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||
$no_scout = true;
|
||||
}
|
||||
|
||||
if($no_scout || !Util::randBool($join_prop)) {
|
||||
$scoutType = "발견";
|
||||
$scoutLevel = 0;
|
||||
$scoutNation = 0;
|
||||
@@ -332,50 +393,54 @@ function process_29(&$general) {
|
||||
$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),"");
|
||||
$avgGen = MYDB_fetch_array($result);
|
||||
$avgGen = $db->queryFirstRow('SELECT max(leader+power+intel) as lpi, avg(dedication) as ded,avg(experience) as exp, avg(dex0+dex10+dex20+dex30) as dex_t, avg(dex40) as dex40 from general where npc < 5 and nation = %i', $general['nation']);
|
||||
|
||||
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
||||
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
||||
$type = rand() % 10;
|
||||
if($admin['scenario'] < 100) {
|
||||
switch($type) {
|
||||
case 0: case 1:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatTotal - $leader - $intel;
|
||||
break;
|
||||
case 2: case 3:
|
||||
$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 = 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 = 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 = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$power = GameConst::$defaultStatMin + rand()%6;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
case 8: case 9:
|
||||
$leader = GameConst::$defaultStatMin + rand()%6;
|
||||
$power = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$intel = GameConst::$defaultStatTotal - $leader - $power;
|
||||
break;
|
||||
}
|
||||
$dexTotal = $avgGen['dex_t'];
|
||||
|
||||
//무장 40%, 지장 40%, 무지장 20%
|
||||
$stat_tier1 = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
$stat_tier3 = GameConst::$defaultStatMin + rand()%6;
|
||||
$stat_tier2 = GameConst::$defaultStatTotal - $stat_tier1 - $stat_tier3;
|
||||
$type = Util::choiceRandomUsingWeight([
|
||||
'power0'=>2,
|
||||
'power1'=>2,
|
||||
'power2'=>2,
|
||||
'intel'=>6,
|
||||
'neutral'=>3
|
||||
]);
|
||||
switch($type){
|
||||
case 'power0':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal*5/8, $dexTotal/8, $dexTotal/8, $dexTotal/8];
|
||||
break;
|
||||
case 'power1':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal/8, $dexTotal*5/8, $dexTotal/8, $dexTotal/8];
|
||||
break;
|
||||
case 'power2':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier2;
|
||||
$intel = $stat_tier3;
|
||||
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal*5/8, $dexTotal/8];
|
||||
break;
|
||||
case 'intel':
|
||||
$leader = $stat_tier1;
|
||||
$power = $stat_tier3;
|
||||
$intel = $stat_tier2;
|
||||
$dexVal = [$dexTotal/8, $dexTotal/8, $dexTotal/8, $dexTotal*5/8];
|
||||
break;
|
||||
default:
|
||||
$leader = $stat_tier3;
|
||||
$power = $stat_tier1;
|
||||
$intel = $stat_tier2;
|
||||
$dexVal = [$dexTotal/4, $dexTotal/4, $dexTotal/4, $dexTotal/4];
|
||||
break;
|
||||
}
|
||||
|
||||
// 국내 최고능치 기준으로 랜덤성 스케일링
|
||||
if($avgGen['lpi'] > 210) {
|
||||
$leader = Util::round($leader * $avgGen['lpi'] / GameConst::$defaultStatTotal * (60+rand()%31)/100);
|
||||
@@ -407,7 +472,7 @@ function process_29(&$general) {
|
||||
$intel -= $over3;
|
||||
}
|
||||
// 낮은 능치쪽으로 합산
|
||||
if($type == 0) {
|
||||
if($type == 'power') {
|
||||
$intel = $intel + $over1 + $over2 + $over3;
|
||||
} else {
|
||||
$power = $power + $over1 + $over2 + $over3;
|
||||
@@ -429,17 +494,17 @@ function process_29(&$general) {
|
||||
$npccount = 10000 + $npcid;
|
||||
$affinity = rand() % 150 + 1;
|
||||
$picture = 'default.jpg';
|
||||
$turntime = getRandTurn($admin['turnterm']);
|
||||
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
|
||||
$personal = rand() % 10;
|
||||
$bornyear = $admin['year'];
|
||||
$deadyear = $admin['year'] + 3;
|
||||
$age = 20;
|
||||
$specage = Util::round((80 - $age)/12) + $age;
|
||||
$specage2 = Util::round((80 - $age)/3) + $age;
|
||||
$specage = Util::round((GameConst::$retirementYear - $age)/12) + $age;
|
||||
$specage2 = Util::round((GameConst::$retirementYear - $age)/3) + $age;
|
||||
//$specage = $age + 1 + rand() % 3;
|
||||
//$specage2 = $age + 5 + rand() % 5;
|
||||
// 10년 ~ 50년
|
||||
$killturn = rand()%480 + 120;
|
||||
// 20년 ~ 50년
|
||||
$killturn = Util::randRangeInt(20, 50) * 12;
|
||||
|
||||
@MYDB_query("
|
||||
insert into general (
|
||||
@@ -455,7 +520,7 @@ function process_29(&$general) {
|
||||
'$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
|
||||
'0','$bornyear','$deadyear',
|
||||
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
||||
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
|
||||
)",
|
||||
$connect
|
||||
) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -568,11 +633,11 @@ function process_45(&$general) {
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>에서 하야");
|
||||
|
||||
// 국적 바꾸고 등급 재야로 // 명성/공헌 N*10% 감소
|
||||
$query = "update general set resturn='SUCCESS',belong=0,betray=betray+1,nation=0,level=0,experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,permission='normal',experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',betray=betray+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
//도시의 태수, 군사, 시중직도 초기화
|
||||
//도시의 태수, 군사, 종사직도 초기화
|
||||
$query = "update city set gen1='0' where gen1='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='{$general['no']}'";
|
||||
@@ -637,6 +702,8 @@ function process_46(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
|
||||
$currNationLevel = $db->queryFirstField('SELECT level FROM nation WHERE nation=%i', $general['nation']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$color = $command[1];
|
||||
$type = $command[2]; // 1 ~ 13
|
||||
@@ -654,6 +721,8 @@ function process_46(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:건국 기간이 지났습니다. 건국 실패. <1>$date</>";
|
||||
} elseif($city['nation'] != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:공백지가 아닙니다. 건국 실패. <1>$date</>";
|
||||
} elseif($currNationLevel != 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:방랑군이 아닙니다. 건국 실패. <1>$date</>";
|
||||
} elseif($nationcount > 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:존재하는 국가명입니다. 건국 실패. <1>$date</>";
|
||||
} elseif($general['makelimit'] > 0) {
|
||||
@@ -815,18 +884,28 @@ function process_54(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:현재 통합 진행중입니다. 선양 실패.";
|
||||
} else {
|
||||
//군주 교체
|
||||
$query = "update general set level='12' where no='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 태수,군사,시중이었다면 해제
|
||||
$query = "update city set gen1='0' where gen1='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen3='0' where gen3='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'level'=>12,
|
||||
'permission'=>'normal'
|
||||
], 'no=%i', $who);
|
||||
|
||||
$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),"");
|
||||
// 태수,군사,종사이었다면 해제
|
||||
$db->update('city', [
|
||||
'gen1'=>0,
|
||||
], 'gen1=%i', $who);
|
||||
$db->update('city', [
|
||||
'gen2'=>0,
|
||||
], 'gen2=%i', $who);
|
||||
$db->update('city', [
|
||||
'gen3'=>0,
|
||||
], 'gen3=%i', $who);
|
||||
|
||||
$db->update('general', [
|
||||
'resturn'=>'SUCCESS',
|
||||
'level'=>1,
|
||||
'permission'=>'auditor',
|
||||
'experience'=>$db->sqleval('experience*0.7'),
|
||||
], 'no=%i', $general['no']);
|
||||
|
||||
$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']}</>에게 선양했습니다.";
|
||||
@@ -996,7 +1075,7 @@ function process_57(&$general) {
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month', 'killturn']);
|
||||
$admin = $gameStor->getValues(['year', 'month', 'killturn', 'autorun_user', 'turn_term']);
|
||||
|
||||
$query = "select nation,name from nation where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1010,6 +1089,19 @@ function process_57(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$ruler = MYDB_fetch_array($result);
|
||||
|
||||
$killTurnLimit = $admin['killturn'];
|
||||
$autorunLimit = $admin['autorun_user']['limit_minutes']??0;
|
||||
if($autorunLimit){
|
||||
$autorunLimit /= $admin['turn_term'];
|
||||
if($autorunLimit < GameConst::$maxTurn){
|
||||
$killTurnLimit -= $autorunLimit;
|
||||
}
|
||||
else{
|
||||
$killTurnLimit -= Util::toInt(sqrt(GameConst::$maxTurn * $autorunLimit));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($general['level'] == 0) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:재야 입니다. 모반 실패. <1>$date</>";
|
||||
} elseif($general['level'] < 5) {
|
||||
@@ -1020,7 +1112,7 @@ function process_57(&$general) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 모반 실패. <1>$date</>";
|
||||
} elseif($general['level'] == 12) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:이미 군주 입니다. 모반 실패. <1>$date</>";
|
||||
} elseif($ruler['killturn'] >= $admin['killturn']) {
|
||||
} elseif($ruler['killturn'] >= $killTurnLimit) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군주가 활동중입니다. 모반 실패. <1>$date</>";
|
||||
} elseif($ruler['npc'] >= 2) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:군주가 NPC입니다. 모반 실패. <1>$date</>";
|
||||
@@ -1028,7 +1120,7 @@ function process_57(&$general) {
|
||||
//군주 교체
|
||||
$query = "update general set resturn='SUCCESS',level='12' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 태수,군사,시중이었다면 해제
|
||||
// 태수,군사,종사이었다면 해제
|
||||
$query = "update city set gen1='0' where gen1='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='{$general['no']}'";
|
||||
|
||||
@@ -47,7 +47,7 @@ function turnTable() {
|
||||
|
||||
function CoreTurnTable() {
|
||||
return "
|
||||
<select name=turn[] size=3 multiple style=color:white;background-color:black;font-size:13px;>
|
||||
<select name=turn[] size=6 multiple style=color:white;background-color:black;font-size:13px;>
|
||||
<option selected value=0> 1턴</option>
|
||||
<option value=1> 2턴</option>
|
||||
<option value=2> 3턴</option>
|
||||
@@ -136,7 +136,7 @@ function commandButton() {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
|
||||
$me = $db->queryFirstRow("select no,nation,level,belong,permission,penalty from general where owner=%i", $userID);
|
||||
|
||||
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
|
||||
'nation'=>0,
|
||||
@@ -150,22 +150,21 @@ function commandButton() {
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$showSecret = false;
|
||||
if($me['level'] >= 2){
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission >= 1){
|
||||
$showSecret = true;
|
||||
}
|
||||
else if($me['level']== 0){
|
||||
$showSecret = false;
|
||||
}
|
||||
else if($me['belong'] >= $nation['secretlimit']){
|
||||
$showSecret = true;
|
||||
}
|
||||
|
||||
return $templates->render('commandButton', [
|
||||
'bgColor'=>$bgColor,
|
||||
'fgColor'=>$fgColor,
|
||||
'meLevel'=>$me['level'],
|
||||
'nationLevel'=>$nation['level'],
|
||||
'showSecret'=>$showSecret
|
||||
'showSecret'=>$showSecret,
|
||||
'permission'=>$permission,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -40,7 +40,7 @@ function processSpring() {
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
pushWorldHistory(["<R>★</>{$admin['year']}년 {$admin['month']}월: <S>모두들 즐거운 게임 하고 계신가요? ^^ <Y>삼국일보</> 애독해 주시고, <M>훼접</>은 삼가주세요~</>"], $admin['year'], $admin['month']);
|
||||
pushWorldHistory(["<R>★</>{$admin['year']}년 {$admin['month']}월: <S>모두들 즐거운 게임 하고 계신가요? ^^ <Y>매너 있는 플레이</> 부탁드리고, <M>지나친 훼접</>은 삼가주세요~</>"], $admin['year'], $admin['month']);
|
||||
}
|
||||
|
||||
function processGoldIncome() {
|
||||
@@ -68,25 +68,25 @@ function processGoldIncome() {
|
||||
// 기본량도 안될경우
|
||||
if($nation['gold'] < GameConst::$basegold) {
|
||||
$realoutcome = 0;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = 0;
|
||||
//기본량은 넘지만 요구량이 안될경우
|
||||
} elseif($nation['gold'] - GameConst::$basegold < $outcome) {
|
||||
$realoutcome = $nation['gold'] - GameConst::$basegold;
|
||||
$nation['gold'] = GameConst::$basegold;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
} else {
|
||||
$realoutcome = $outcome;
|
||||
$nation['gold'] -= $realoutcome;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[] = StringUtil::padStringAlignRight((string)$nation['name'],12," ")
|
||||
." // 세금 : ".StringUtil::padStringAlignRight((string)$income,6," ")
|
||||
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
|
||||
." // 실제 : ".tab2((string)$realoutcome,6," ")
|
||||
." // 지급율 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." // 지급률 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." % // 결과금 : ".tab2((string)$nation['gold'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
@@ -101,7 +101,7 @@ function processGoldIncome() {
|
||||
$query = "update nation set gold='{$nation['gold']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select no,name,nation,dedication,gold from general where nation='{$nation['nation']}'";
|
||||
$query = "select no,name,nation,dedication,gold from general where nation='{$nation['nation']}' AND npc != 5";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
@@ -178,7 +178,7 @@ function popIncrease() {
|
||||
$ratio *= (1 - $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 경감
|
||||
}
|
||||
|
||||
$pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가
|
||||
$pop = $city['pop'] + (int)($city['pop'] * $ratio) + GameConst::$basePopIncreaseAmount; // 기본인구는 증가
|
||||
|
||||
$ratio = round($ratio*100, 2);
|
||||
$cityrate = $city['rate'];
|
||||
@@ -223,7 +223,7 @@ function getGoldIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$level3[$gen['no']] = $gen['city'];
|
||||
}
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($j=0; $j < $count; $j++) {
|
||||
@@ -317,7 +317,7 @@ function getGoldOutcome($nation, $bill) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
||||
$query = "select dedication from general where nation='$nation' AND npc != 5"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
@@ -391,25 +391,25 @@ function processRiceIncome() {
|
||||
// 기본량도 안될경우
|
||||
if($nation['rice'] < GameConst::$baserice) {
|
||||
$realoutcome = 0;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = 0;
|
||||
//기본량은 넘지만 요구량이 안될경우
|
||||
} elseif($nation['rice'] - GameConst::$baserice < $outcome) {
|
||||
$realoutcome = $nation['rice'] - GameConst::$baserice;
|
||||
$nation['rice'] = GameConst::$baserice;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
} else {
|
||||
$realoutcome = $outcome;
|
||||
$nation['rice'] -= $realoutcome;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[] = StringUtil::padStringAlignRight($nation['name'],12," ")
|
||||
." // 세곡 : ".StringUtil::padStringAlignRight((string)$income,6," ")
|
||||
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
|
||||
." // 실제 : ".tab2((string)$realoutcome,6," ")
|
||||
." // 지급율 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." // 지급률 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." % // 결과곡 : ".tab2((string)$nation['rice'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
@@ -424,7 +424,7 @@ function processRiceIncome() {
|
||||
$query = "update nation set rice='{$nation['rice']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$query = "select no,name,nation,dedication,rice from general where nation='{$nation['nation']}'";
|
||||
$query = "select no,name,nation,dedication,rice from general where nation='{$nation['nation']}' AND npc != 5";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
@@ -467,7 +467,7 @@ function getRiceIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$level3[$gen['no']] = $gen['city'];
|
||||
}
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($j=0; $j < $count; $j++) {
|
||||
@@ -517,7 +517,7 @@ function getRiceOutcome($nation, $bill) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
||||
$query = "select dedication from general where nation='$nation' AND npc != 5"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
@@ -594,14 +594,14 @@ function disaster() {
|
||||
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
//호황 발생 도시 선택 ( 기본 3% 이므로 약 3개 도시 )
|
||||
//재해 발생 도시 선택 ( 기본 6% 이므로 약 6개 도시 )
|
||||
if($isgood == 1) { $ratio = 3 + Util::round(1.0*$city['secu']/$city['secu2']*3); } // 3 ~ 6%
|
||||
else { $ratio = 6 - Util::round(1.0*$city['secu']/$city['secu2']*3); } // 3 ~ 6%
|
||||
//호황 발생 도시 선택 ( 기본 2% )
|
||||
//재해 발생 도시 선택 ( 기본 6% )
|
||||
if($isgood == 1) { $ratio = 2 + Util::round($city['secu']/$city['secu2']*5); } // 2 ~ 7%
|
||||
else { $ratio = 6 - Util::round($city['secu']/$city['secu2']*5); } // 1 ~ 6%
|
||||
|
||||
if(rand()%100+1 < $ratio) {
|
||||
$disastercity[] = $city['city'];
|
||||
$disasterratio[] = 1.0 * $city['secu'] / $city['secu2'];
|
||||
$disasterratio[] = Util::valueFit($city['secu'] / 0.8 / $city['secu2'], 0, 1);
|
||||
$disastername[] = $city['name'];
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user