Compare commits
612
Commits
v0.9.7
...
v0.20.0-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0561cc3320 | ||
|
|
6f47e92050 | ||
|
|
9a67ac7509 | ||
|
|
d922993eaf | ||
|
|
9fa2225283 | ||
|
|
35eadad96b | ||
|
|
081416475e | ||
|
|
12492c842c | ||
|
|
68e01c1e73 | ||
|
|
bdcc79ce34 | ||
|
|
869ad39ddc | ||
|
|
30e1e35090 | ||
|
|
6c185ffd09 | ||
|
|
a9435f8f32 | ||
|
|
9ea8d3ec97 | ||
|
|
d918234bb8 | ||
|
|
afbbbaa855 | ||
|
|
a844ef31a2 | ||
|
|
b469ce0504 | ||
|
|
ed2bc8c390 | ||
|
|
cb246e859e | ||
|
|
3d6b99c004 | ||
|
|
842942c0fe | ||
|
|
71c4a84833 | ||
|
|
d1bc434ced | ||
|
|
59f7448aa7 | ||
|
|
4408692565 | ||
|
|
2e8607b811 | ||
|
|
2f2890e582 | ||
|
|
e2b39be3ff | ||
|
|
7ada07a99a | ||
|
|
6b16573f6b | ||
|
|
1de49fe998 | ||
|
|
7109e66ad8 | ||
|
|
d21c2f67ba | ||
|
|
0d39add09c | ||
|
|
5e1f7ea571 | ||
|
|
35c71bd21b | ||
|
|
e6a39f246d | ||
|
|
65cd8af9e1 | ||
|
|
e916f2fc40 | ||
|
|
13da80ee85 | ||
|
|
4f4045363b | ||
|
|
9600e18c92 | ||
|
|
d5aefccadc | ||
|
|
9e64b268cf | ||
|
|
0893bf6473 | ||
|
|
21f8b814e0 | ||
|
|
10fd22ba81 | ||
|
|
a3fef6c62f | ||
|
|
d750167a00 | ||
|
|
241bf62fdc | ||
|
|
bc5574615d | ||
|
|
48cac053fd | ||
|
|
25837f6393 | ||
|
|
b281362c98 | ||
|
|
e5050bb6c8 | ||
|
|
2d0c3ef881 | ||
|
|
ee029aac10 | ||
|
|
da205c09f9 | ||
|
|
07317b86a2 | ||
|
|
79e2543266 | ||
|
|
303cbcd188 | ||
|
|
a47905541c | ||
|
|
4e988db50f | ||
|
|
9dc3d83a77 | ||
|
|
934c1b0cfe | ||
|
|
70181d95c7 | ||
|
|
8a210103c0 | ||
|
|
df96381759 | ||
|
|
2006845ff7 | ||
|
|
44f0e78086 | ||
|
|
824956a34d | ||
|
|
1e7e01b6b0 | ||
|
|
cd25aaaca6 | ||
|
|
d481047eb4 | ||
|
|
1699ac6e08 | ||
|
|
79b7188578 | ||
|
|
843f469914 | ||
|
|
71254e86f4 | ||
|
|
07328847f4 | ||
|
|
9181cbfee5 | ||
|
|
4aef22aac8 | ||
|
|
512266abf4 | ||
|
|
ef64f180a2 | ||
|
|
9e45800367 | ||
|
|
f027f7f225 | ||
|
|
6f7ac86e7f | ||
|
|
93d298ef75 | ||
|
|
121a892c9a | ||
|
|
9222e2bbdd | ||
|
|
fe78d82ace | ||
|
|
77e98d9942 | ||
|
|
2b1efae238 | ||
|
|
d70740b38c | ||
|
|
3ebb30795c | ||
|
|
5d42730e9a | ||
|
|
923777899e | ||
|
|
05b9187a3b | ||
|
|
1198baba67 | ||
|
|
d4b7cdc97c | ||
|
|
bb7e93ac2d | ||
|
|
59c0c6cfb8 | ||
|
|
8699a43a22 | ||
|
|
5529651f91 | ||
|
|
a6f225ae9d | ||
|
|
fceda31c11 | ||
|
|
e5a5281e10 | ||
|
|
ede1d89569 | ||
|
|
44b9ba96c3 | ||
|
|
7fd8bfbe4e | ||
|
|
17654633dc | ||
|
|
8fd0a54018 | ||
|
|
efe8a476da | ||
|
|
ac0f6c6b6c | ||
|
|
8c163515db | ||
|
|
7ce1e64ee8 | ||
|
|
b6e667a291 | ||
|
|
5c7522fd1f | ||
|
|
85e9223603 | ||
|
|
943e2be676 | ||
|
|
2f09df7521 | ||
|
|
445e445e49 | ||
|
|
a3925de127 | ||
|
|
f20e4bd572 | ||
|
|
816c2ac1c4 | ||
|
|
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 | ||
|
|
00a6e9798f | ||
|
|
17a59cbdd5 | ||
|
|
d4c9a0a47a | ||
|
|
6423c22cf8 | ||
|
|
e21fbaff83 | ||
|
|
99e6a2676b | ||
|
|
ab47f40ee1 | ||
|
|
a7f000e51e | ||
|
|
0d9eabcaa0 | ||
|
|
b1c63d7f5e | ||
|
|
820c72820d | ||
|
|
300065504b | ||
|
|
8aa846b349 | ||
|
|
ae8b94b2d7 | ||
|
|
7670d55f3c | ||
|
|
528ab4e203 | ||
|
|
cf1dc90137 | ||
|
|
dd81dcc9c6 | ||
|
|
a31c949734 | ||
|
|
3536d5c413 | ||
|
|
0e50216cee | ||
|
|
16fed754a9 | ||
|
|
c7748934b8 | ||
|
|
d46b3154cc | ||
|
|
f8bcfba90e | ||
|
|
45a4ca5298 | ||
|
|
88e3a9852b | ||
|
|
cf1f023379 | ||
|
|
b4b6f5a1f7 | ||
|
|
a21eef6e84 | ||
|
|
3beca8bba5 | ||
|
|
b5d66dba8a | ||
|
|
24d01a2156 | ||
|
|
45d848cbb9 | ||
|
|
e2f649dd35 | ||
|
|
183bffbc0e | ||
|
|
a874415859 | ||
|
|
93b33ba383 | ||
|
|
26420719f3 | ||
|
|
dc6a35d656 | ||
|
|
51da0bd7b7 | ||
|
|
1afb2c6883 | ||
|
|
f78fcc2b71 | ||
|
|
fb2d30f2c9 | ||
|
|
8781e7c6ad | ||
|
|
c34317b1e5 | ||
|
|
b09730b422 | ||
|
|
0f1725a7ab | ||
|
|
b12e0358d6 | ||
|
|
7ef841746a | ||
|
|
2b52b2379e | ||
|
|
8dd5965c44 | ||
|
|
bc59521cc8 | ||
|
|
815822ef40 | ||
|
|
9e6d33cc1a | ||
|
|
44df85f2bd | ||
|
|
2c15c7087e | ||
|
|
6b281628ed | ||
|
|
9f74db0aff | ||
|
|
83ea5c7fa3 | ||
|
|
bf6fe3482b | ||
|
|
f4d6803720 | ||
|
|
23c2a16286 | ||
|
|
afc301fad2 | ||
|
|
1c0a50e48f | ||
|
|
02e119d0da | ||
|
|
06fcc383ce | ||
|
|
408b1f76e4 | ||
|
|
3a879a37e2 | ||
|
|
9e1bb50d78 | ||
|
|
25dcf426b1 | ||
|
|
7b7baaea62 | ||
|
|
36d83804d0 | ||
|
|
7c46d2e27f | ||
|
|
d4acad33ea | ||
|
|
91cc1159bc | ||
|
|
21b7068c90 | ||
|
|
682d2bf922 | ||
|
|
3ff6788405 | ||
|
|
e59a8606ab | ||
|
|
157285ddb6 | ||
|
|
f49c3e0ff7 | ||
|
|
345877b9fd | ||
|
|
37e4105585 | ||
|
|
4a05b59b4b | ||
|
|
57322d75d7 | ||
|
|
4ccc2c1f71 | ||
|
|
652b32619d | ||
|
|
57b3611965 | ||
|
|
afbf9e619a | ||
|
|
060b1da388 | ||
|
|
38024b6be4 | ||
|
|
6aede6e48b | ||
|
|
b27adfbe27 | ||
|
|
b28e3b2a00 | ||
|
|
ffe4374519 | ||
|
|
793df087ae | ||
|
|
85eadd5856 | ||
|
|
359efe0036 | ||
|
|
3186691b7b | ||
|
|
044c795f38 | ||
|
|
f7128449ca | ||
|
|
3d0c5165b7 | ||
|
|
fc6cda86df | ||
|
|
59877e181e | ||
|
|
506b1a17d1 | ||
|
|
214c2ba0ad | ||
|
|
387312bc87 | ||
|
|
3d3da04e58 | ||
|
|
7ec0cbb43c | ||
|
|
1cd834579c | ||
|
|
a11005c14b | ||
|
|
ea1480e286 | ||
|
|
f1dd328c38 | ||
|
|
44295de206 | ||
|
|
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 | ||
|
|
42f08f5027 | ||
|
|
7a1c8882e6 | ||
|
|
2c193e7e48 | ||
|
|
9714c1c9f6 | ||
|
|
c8f72b5f14 | ||
|
|
be0439f771 | ||
|
|
e2b0b03c96 | ||
|
|
b9fb9f1b34 | ||
|
|
52fd932fd8 | ||
|
|
b0cc200df7 | ||
|
|
05b32db37d | ||
|
|
41f7192532 | ||
|
|
fa420303dc | ||
|
|
b7fd539755 | ||
|
|
cfb8b03446 | ||
|
|
712601041d | ||
|
|
36093eccaf | ||
|
|
58eb6d4210 | ||
|
|
2166429cbf | ||
|
|
236ab10b11 | ||
|
|
99142fdde3 | ||
|
|
ca6755d8b5 | ||
|
|
92ad333863 | ||
|
|
4c48272b4c | ||
|
|
ab5bd1db69 | ||
|
|
5d1cd10f5d | ||
|
|
ef784be082 | ||
|
|
855c41a0e9 | ||
|
|
6ef9667f72 | ||
|
|
068d384e7a | ||
|
|
c3699a8595 | ||
|
|
2cb7513355 | ||
|
|
c44ae2f00c | ||
|
|
a00b62ffcc | ||
|
|
6206b38a78 | ||
|
|
1767bfa70d | ||
|
|
b1d6611923 | ||
|
|
a6a713f40e | ||
|
|
e76ad04207 | ||
|
|
a231adbfdd | ||
|
|
88f97ecb4e | ||
|
|
68a471b859 | ||
|
|
9393324e1f | ||
|
|
944931f7d1 | ||
|
|
5a56be8a75 | ||
|
|
fe7aebae05 | ||
|
|
fd734fadbc | ||
|
|
a3dc250698 | ||
|
|
3f2d36284f | ||
|
|
60d5184a7b | ||
|
|
da612bdc7b | ||
|
|
628a085ba8 | ||
|
|
f56f201bad | ||
|
|
45e579f0ef | ||
|
|
39db811361 | ||
|
|
ff87555eba | ||
|
|
6c5c2d40bc | ||
|
|
c08459e370 | ||
|
|
42418394ed | ||
|
|
64fd0e2f28 | ||
|
|
2de061203b | ||
|
|
cee0d3f03e | ||
|
|
aa19ae129b | ||
|
|
aecbf8ccb3 | ||
|
|
7e5c19f507 | ||
|
|
b178ecd494 | ||
|
|
05d5039fab | ||
|
|
1004e5a8bd | ||
|
|
dbcfe6fc6e | ||
|
|
56698aefe6 | ||
|
|
cbd2e136ed | ||
|
|
9846d7f8e4 | ||
|
|
d16c86a4d7 | ||
|
|
292e642d16 | ||
|
|
90736b52be | ||
|
|
928e8a200b | ||
|
|
2ee06eab2d | ||
|
|
01913983ea | ||
|
|
0aa2f2c44d | ||
|
|
f66d655782 | ||
|
|
4094a08198 | ||
|
|
05389da412 | ||
|
|
e38258b04b | ||
|
|
0cd0e2f730 | ||
|
|
d2c7483db1 | ||
|
|
d388c52ccd | ||
|
|
4a2954d3a4 | ||
|
|
804b9a1d71 | ||
|
|
1067efbbee | ||
|
|
d41ecbeed6 | ||
|
|
f93148b7d7 | ||
|
|
fb7c2573bf | ||
|
|
e4fcc77b0a | ||
|
|
5c9b79729f | ||
|
|
00d4541537 | ||
|
|
1660e563ab | ||
|
|
b94081c45b | ||
|
|
f7b59f0140 | ||
|
|
22aecbe4ba | ||
|
|
be98db9023 | ||
|
|
828e095e64 | ||
|
|
8e1e21b960 | ||
|
|
303d8815e3 | ||
|
|
ba574dda62 | ||
|
|
bf630b5f7d | ||
|
|
9b4bf148cc | ||
|
|
f5212b4aa1 | ||
|
|
eea4cdf379 | ||
|
|
e909b48fea | ||
|
|
258aabbdde | ||
|
|
29984d4b09 | ||
|
|
e1a266e5d8 | ||
|
|
a33a7317cc | ||
|
|
1d0bcd857e | ||
|
|
040da2429f | ||
|
|
978a395421 | ||
|
|
63e5625d62 | ||
|
|
38bbae13b9 | ||
|
|
e975a8106f | ||
|
|
6a49887ad7 | ||
|
|
5565ec2ddb | ||
|
|
34fd000df9 | ||
|
|
1132177e2d | ||
|
|
5be39c04ef | ||
|
|
0ee4593608 | ||
|
|
f301344587 | ||
|
|
d2c5c856ab | ||
|
|
5f8e4ae10c | ||
|
|
4ff30b1a9d | ||
|
|
a0b215dab6 | ||
|
|
144e82d7e2 | ||
|
|
79252ba3b0 | ||
|
|
c5286093f9 | ||
|
|
5ad194bd45 | ||
|
|
501113da44 | ||
|
|
b79045eddb | ||
|
|
6eb67b1a3c | ||
|
|
777ec39bd9 | ||
|
|
9dcafaaa38 | ||
|
|
097e2fb653 | ||
|
|
e7aa97634b | ||
|
|
447b9f265f | ||
|
|
029a6f03b7 | ||
|
|
ae4a349d79 | ||
|
|
35728c7911 | ||
|
|
469330f270 | ||
|
|
03f9c56928 | ||
|
|
ed2a2a8975 | ||
|
|
b5380f183c | ||
|
|
f5bcaba352 | ||
|
|
5a70b23db9 | ||
|
|
fc3487e545 | ||
|
|
a4863dc8d7 | ||
|
|
af12a08e25 | ||
|
|
312dc294b3 | ||
|
|
d958dd5ee4 | ||
|
|
1ddc49b17b | ||
|
|
322541b16f | ||
|
|
00cb10f029 | ||
|
|
ed24a721ed | ||
|
|
9fc10e0f65 | ||
|
|
ab212e0565 | ||
|
|
eac0049577 | ||
|
|
9d1d51d0d7 | ||
|
|
4fd3c4ada6 | ||
|
|
dd73d8fc69 | ||
|
|
b89d37c8c5 | ||
|
|
bc4983c771 | ||
|
|
e6c186b31b | ||
|
|
b106fa55d3 | ||
|
|
981e42c5a9 | ||
|
|
89bf457878 | ||
|
|
91a36eb9a0 | ||
|
|
a3d0ceb6a5 | ||
|
|
7679c11b5b | ||
|
|
e7ae2ab441 | ||
|
|
dd5feb0e2c | ||
|
|
b95d05c134 | ||
|
|
87bdd0016e | ||
|
|
b9befa4e63 | ||
|
|
d9ed00ddee | ||
|
|
4c2b484c2b | ||
|
|
ff31e41fec | ||
|
|
34204f6183 | ||
|
|
6fc8763895 | ||
|
|
1a0914196f | ||
|
|
9dd1adacd2 | ||
|
|
93c5268fbc | ||
|
|
98edc89fa0 | ||
|
|
3aad412102 | ||
|
|
a2ee9524fb | ||
|
|
78955a1540 | ||
|
|
f412b7e734 | ||
|
|
b13f3004e2 | ||
|
|
a093b0f8e8 | ||
|
|
34a84c6548 | ||
|
|
6c52c1177b | ||
|
|
f9bc312f91 | ||
|
|
7283153f44 | ||
|
|
df6b2bd0e8 |
+1
-4
@@ -11,7 +11,7 @@ return [
|
||||
// If this is set to null,
|
||||
// then Phan assumes the PHP version which is closest to the minor version
|
||||
// of the php executable used to execute phan.
|
||||
"target_php_version" => '7.0',
|
||||
"target_php_version" => '7.2',
|
||||
'backward_compatibility_checks ' => false,
|
||||
'ignore_undeclared_variables_in_global_scope' => false,
|
||||
'minimum_severity'=>\Phan\Issue::SEVERITY_LOW,
|
||||
@@ -29,10 +29,7 @@ return [
|
||||
'hwe/func_legacy.php',
|
||||
'hwe/func_map.php',
|
||||
'hwe/func_message.php',
|
||||
'hwe/func_npc.php',
|
||||
'hwe/func_process_chief.php',
|
||||
'hwe/func_process_personnel.php',
|
||||
'hwe/func_process_sabotage.php',
|
||||
'hwe/func_process.php',
|
||||
'hwe/func_string.php',
|
||||
'hwe/func_template.php',
|
||||
|
||||
Vendored
+5
-1
@@ -24,5 +24,9 @@
|
||||
"/nya":true,
|
||||
"/pya":true,
|
||||
"/twe":true,
|
||||
},
|
||||
},
|
||||
"cSpell.words": [
|
||||
"josa",
|
||||
"sammo"
|
||||
],
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -7,20 +7,26 @@
|
||||
|
||||
* Apache2
|
||||
* <code>mpm_event</code> 권장
|
||||
* PHP 7.2 이상
|
||||
* PHP 7.3 이상
|
||||
* <code>php-fpm</code> 권장
|
||||
* php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원)
|
||||
* mysqlnd가 지원되어야합니다. (기본값: 지원)
|
||||
* mysqli
|
||||
* gd
|
||||
* MariaDB 10.2.1 이상
|
||||
* MySQL 5.6 이상도 가능하도록 할 예정입니다.
|
||||
* 현재 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>)에게 디렉토리 권한이 주어져야합니다.
|
||||
@@ -30,11 +36,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을 지원해야합니다.
|
||||
|
||||
### 설치
|
||||
|
||||
@@ -47,9 +53,9 @@ Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의
|
||||
|
||||
## 카카오로그인 연동
|
||||
|
||||
현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
|
||||
서버 설치 시 카카오 로그인 연동을 위한 API KEY를 입력받습니다.
|
||||
|
||||
설치 후 <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
+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
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 |
+15
-3
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
define('ROOT', realpath(__dir__.'/..'));
|
||||
define('ROOT', realpath(__DIR__.'/..'));
|
||||
setlocale(LC_ALL, 'ko_KR.UTF-8');
|
||||
date_default_timezone_set('Asia/Seoul');
|
||||
mb_internal_encoding("UTF-8");
|
||||
@@ -88,19 +88,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 +125,7 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
|
||||
logError(
|
||||
getFriendlyErrorType($errno),
|
||||
$errstr,
|
||||
$errfile.':'.$errline,
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
}
|
||||
@@ -123,9 +133,11 @@ set_error_handler("\sammo\logErrorByCustomHandler");
|
||||
|
||||
|
||||
function logExceptionByCustomHandler(\Throwable $e){
|
||||
|
||||
logError(
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
$e->getFile().':'.$e->getLine(),
|
||||
getExceptionTraceAsString($e)
|
||||
);
|
||||
|
||||
|
||||
+33
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -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">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
session_start();
|
||||
session_destroy();
|
||||
@@ -46,7 +46,7 @@ if($memberCnt > 0){
|
||||
|
||||
$userSalt = bin2hex(random_bytes(8));
|
||||
$finalPassword = Util::hashPassword($userSalt, $password);
|
||||
$nowDate = TimeUtil::DatetimeNow();
|
||||
$nowDate = TimeUtil::now();
|
||||
|
||||
$rootDB->insert('member',[
|
||||
'oauth_type' => 'NONE',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
if(!class_exists('\\sammo\\RootDB')){
|
||||
Json::die([
|
||||
|
||||
+31
-12
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$host = Util::getReq('db_host');
|
||||
$port = Util::getReq('db_port', 'int');
|
||||
@@ -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([
|
||||
@@ -160,7 +165,7 @@ $rootDB->error_handler = function ($params) {
|
||||
|
||||
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
||||
|
||||
if ($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))) {
|
||||
if ($mysqli_obj->multi_query(file_get_contents(__DIR__.'/sql/common_schema.sql'))) {
|
||||
while (true) {
|
||||
if (!$mysqli_obj->more_results()) {
|
||||
break;
|
||||
@@ -174,8 +179,8 @@ if ($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql')
|
||||
$rootDB->insert('system', array(
|
||||
'REG' => 'N',
|
||||
'LOGIN' => 'N',
|
||||
'CRT_DATE' => TimeUtil::DatetimeNow(),
|
||||
'MDF_DATE' => TimeUtil::DatetimeNow()
|
||||
'CRT_DATE' => TimeUtil::now(),
|
||||
'MDF_DATE' => TimeUtil::now()
|
||||
));
|
||||
|
||||
$globalSalt = bin2hex(random_bytes(16));
|
||||
@@ -186,18 +191,26 @@ $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',
|
||||
__DIR__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'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,
|
||||
@@ -206,7 +219,7 @@ if ($result !== true) {
|
||||
}
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common_path.orig.js',
|
||||
__DIR__.'/templates/common_path.orig.js',
|
||||
ROOT.'/d_shared/common_path.js',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -217,7 +230,7 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/menu.orig.json',
|
||||
__DIR__.'/templates/menu.orig.json',
|
||||
ROOT.'/d_shared/menu.json',
|
||||
[],
|
||||
true
|
||||
@@ -232,7 +245,7 @@ if ($result !== true) {
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common.orig.css',
|
||||
__DIR__.'/templates/common.orig.css',
|
||||
ROOT.'/d_shared/common.css',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -251,7 +264,7 @@ if ($result !== true) {
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/RootDB.orig.php',
|
||||
__DIR__.'/templates/RootDB.orig.php',
|
||||
ROOT.'/d_setting/RootDB.php',
|
||||
[
|
||||
'host'=>$host,
|
||||
@@ -263,10 +276,15 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
]
|
||||
);
|
||||
|
||||
$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost.'/');
|
||||
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/KakaoKey.orig.php',
|
||||
__DIR__.'/templates/KakaoKey.orig.php',
|
||||
ROOT.'/d_setting/KakaoKey.php',
|
||||
[
|
||||
'REST_API_KEY'=>$kakaoRESTKey,
|
||||
'ADMIN_KEY'=>$kakaoAdminKey,
|
||||
'REDIRECT_URI'=>$kakaoRedirectURI
|
||||
],
|
||||
true
|
||||
);
|
||||
@@ -280,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
|
||||
]);
|
||||
}
|
||||
@@ -14,7 +14,7 @@ CREATE TABLE `system` (
|
||||
`MDF_DATE` DATETIME NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`NO`)
|
||||
)
|
||||
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 회원 테이블
|
||||
CREATE TABLE `member` (
|
||||
@@ -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,
|
||||
@@ -44,7 +45,7 @@ CREATE TABLE `member` (
|
||||
UNIQUE INDEX `kauth_id` (`oauth_id`),
|
||||
INDEX `delete_after` (`delete_after`)
|
||||
)
|
||||
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 로그인 로그 테이블
|
||||
CREATE TABLE `member_log` (
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-5
@@ -28,13 +28,10 @@ if($session->userGrade < 4) {
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
[$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
|
||||
|
||||
$query = "select plock from plock";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$plock = MYDB_fetch_array($result);
|
||||
$plock = $db->queryFirstField('SELECT plock FROM plock');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -51,7 +48,7 @@ $plock = MYDB_fetch_array($result);
|
||||
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$turntime?><br>
|
||||
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$tnmt_time?><br>
|
||||
봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br>
|
||||
락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock['plock']>0?"동결중":"가동중"?><br>
|
||||
락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock>0?"동결중":"가동중"?><br>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+35
-9
@@ -24,35 +24,53 @@ $btn = Util::getReq('btn');
|
||||
$minute = Util::getReq('minute', 'int');
|
||||
$minute2 = Util::getReq('minute2', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
switch($btn) {
|
||||
case "분당김":
|
||||
$locked = false;
|
||||
for($i = 0; $i < 10; $i++){
|
||||
if(tryLock()){
|
||||
$locked = true;
|
||||
break;
|
||||
}
|
||||
usleep(500000);
|
||||
}
|
||||
|
||||
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
||||
$turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M"));
|
||||
$starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M"));
|
||||
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
|
||||
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s');
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
|
||||
$gameStor->starttime = $starttime->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
|
||||
'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);
|
||||
if($locked){
|
||||
unlock();
|
||||
}
|
||||
break;
|
||||
case "분지연":
|
||||
$locked = false;
|
||||
for($i = 0; $i < 5; $i++){
|
||||
if(tryLock()){
|
||||
$locked = true;
|
||||
break;
|
||||
}
|
||||
sleep(0.5);
|
||||
}
|
||||
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
|
||||
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
|
||||
$starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
|
||||
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
|
||||
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s');
|
||||
$gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
|
||||
$gameStor->starttime = $starttime->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
|
||||
|
||||
@@ -62,6 +80,9 @@ case "분지연":
|
||||
$db->update('auction', [
|
||||
'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
|
||||
], true);
|
||||
if($locked){
|
||||
unlock();
|
||||
}
|
||||
break;
|
||||
case "토너분당김":
|
||||
$tnmt_time = new \DateTime($gameStor->tnmt_time);
|
||||
@@ -80,11 +101,16 @@ case "쌀지급":
|
||||
processRiceIncome();
|
||||
break;
|
||||
case "락걸기":
|
||||
$db->update('plock', ['plock'=>1], true);
|
||||
$db->update('plock', [
|
||||
'plock'=>1,
|
||||
'locktime'=>TimeUtil::now(true)
|
||||
], true);
|
||||
break;
|
||||
case "락풀기":
|
||||
$db->update('plock', ['plock'=>0], true);
|
||||
$db->update('plock', [
|
||||
'plock'=>0
|
||||
], true);
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location:_119.php');
|
||||
header('Location:_119.php', true, 303);
|
||||
@@ -28,7 +28,6 @@ if($session->userGrade < 5) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = getAdmin();
|
||||
?>
|
||||
@@ -66,12 +65,6 @@ $admin = getAdmin();
|
||||
<td width=110 align=right>최대 국가</td>
|
||||
<td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin['maxnation']?>><input type=submit name=btn value=변경3></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=110 align=right></td>
|
||||
<td width=285></td>
|
||||
<td width=110 align=right>현재 수입률</td>
|
||||
<td width=285><?=$admin['gold_rate']?>%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=110 align=right>시작 년도</td>
|
||||
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin['startyear']?>'><input type=submit name=btn value=변경4></td>
|
||||
|
||||
+18
-36
@@ -30,11 +30,8 @@ $maxgeneral = Util::getReq('maxgeneral', 'int', GameConst::$defaultMaxGeneral);
|
||||
$maxnation = Util::getReq('maxnation', 'int', GameConst::$defaultMaxNation);
|
||||
$startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = getAdmin();
|
||||
|
||||
@@ -43,10 +40,6 @@ switch ($btn) {
|
||||
$gameStor->msg = $msg;
|
||||
break;
|
||||
case "로그쓰기":
|
||||
$lognum = $admin['historyindex'] + 1;
|
||||
if ($lognum >= 29) {
|
||||
$lognum = 0;
|
||||
}
|
||||
pushWorldHistory(["<R>★</><S>{$log}</>"]);
|
||||
break;
|
||||
case "변경1":
|
||||
@@ -69,6 +62,7 @@ switch ($btn) {
|
||||
case "30분턴":
|
||||
case "60분턴":
|
||||
case "120분턴":
|
||||
$admin = $gameStor->getValues(['turntime', 'turnterm', 'year', 'startyear', 'month']);
|
||||
switch ($btn) {
|
||||
case "1분턴": $turnterm = 1; break;
|
||||
case "2분턴": $turnterm = 2; break;
|
||||
@@ -79,39 +73,27 @@ switch ($btn) {
|
||||
case "60분턴": $turnterm = 60; break;
|
||||
case "120분턴": $turnterm = 120; break;
|
||||
}
|
||||
$oldunit = $admin['turnterm'] * 60;
|
||||
$unit = $turnterm * 60;
|
||||
|
||||
$unitDiff = $unit / $oldunit;
|
||||
|
||||
$servTurnTime = new \DateTimeImmutable($admin['turntime']);
|
||||
foreach ($db->query('SELECT no,turntime FROM general') as $gen) {
|
||||
$genTurnTime = new \DateTimeImmutable($gen['turntime']);
|
||||
$timeDiff = TimeUtil::DateIntervalToSeconds($genTurnTime->diff($servTurnTime));
|
||||
$timeDiff *= $unitDiff;
|
||||
$newGenTurnTime = $servTurnTime->add(TimeUtil::secondsToDateInterval($timeDiff));
|
||||
|
||||
$db->update('general', [
|
||||
'turntime'=>$newGenTurnTime->format('Y-m-d H:i:s.u')
|
||||
], 'no=%i', $gen['no']);
|
||||
}
|
||||
$turn = ($admin['year'] - $admin['startyear']) * 12 + $admin['month'] - 1;
|
||||
$starttime = date("Y-m-d H:i:s", strtotime($admin['turntime']) - $turn * $unit);
|
||||
$starttime = cutTurn($starttime, $turnterm);
|
||||
$starttime = $servTurnTime->sub(TimeUtil::secondsToDateInterval($turn * $unit))->format('Y-m-d H:i:s');
|
||||
$starttime = cutTurn($starttime, $turnterm, false);
|
||||
$gameStor->turnterm = $turnterm;
|
||||
$gameStor->starttime = $starttime;
|
||||
// 턴시간이 길어지는 경우 랜덤턴 배정
|
||||
if ($turnterm < $admin['turnterm']) {
|
||||
$query = "select no from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$turntime = getRandTurn($turnterm);
|
||||
$query = "update general set turntime='$turntime' where no='{$gen['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
}
|
||||
// 턴시간이 너무 멀리 떨어진 선수 제대로 보정
|
||||
} else {
|
||||
$query = "select no,turntime from general";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$num = intdiv((strtotime($gen['turntime']) - strtotime($admin['turntime'])), $unit);
|
||||
if ($num > 0) {
|
||||
$gen['turntime'] = date("Y-m-d H:i:s", strtotime($gen['turntime']) - $unit * $num);
|
||||
$query = "update general set turntime='{$gen['turntime']}' where no='{$gen['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pushWorldHistory(["<R>★</>턴시간이 <C>$btn</>으로 변경됩니다."]);
|
||||
break;
|
||||
}
|
||||
|
||||
+16
-4
@@ -76,7 +76,19 @@ echo "
|
||||
</td>
|
||||
<td width=100 align=center>아이템 지급</td>
|
||||
<td width=504>
|
||||
<select name=weap size=1 style='color:white;background-color:black;font-size:13px'>";
|
||||
<select name=weapon size=1 style='color:white;background-color:black;font-size:13px'>";
|
||||
foreach(GameConst::$allItems as $itemCategories){
|
||||
foreach($itemCategories as $item=>$cnt){
|
||||
if($cnt == 0){
|
||||
continue;
|
||||
}
|
||||
$itemObj = buildItemClass($item);
|
||||
if($itemObj->isBuyable()){
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
for($i=0; $i < 27; $i++) {
|
||||
echo "
|
||||
<option value={$i}>{$i}</option>";
|
||||
@@ -113,12 +125,12 @@ for($i=0; $i < 27; $i++) {
|
||||
<td><input type=submit name=btn value='접속 허용'><input type=submit name=btn value='접속 제한'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>턴설정</td>
|
||||
<td align=center>턴 시각 설정</td>
|
||||
<td><input type=submit name=btn value='00턴'><input type=submit name=btn value='랜덤턴'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>NPC해제</td>
|
||||
<td><input type=submit name=btn value='NPC해제'><input type=submit name=btn value='하야입력'><input type=submit name=btn value='방랑해산'><input type=submit name=btn value='NPC설정'></td>
|
||||
<td align=center>명령 설정</td>
|
||||
<td><input type=submit name=btn value='하야입력'><input type=submit name=btn value='방랑해산'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>메세지 전달</td>
|
||||
|
||||
+57
-52
@@ -5,12 +5,10 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$weap = Util::getReq('weap', 'int');
|
||||
$item = Util::getReq('item', 'string');
|
||||
$genlist = Util::getReq('genlist', 'array_int');
|
||||
$msg = Util::getReq('msg', 'string');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireLogin()->loginGame()->setReadOnly();
|
||||
|
||||
@@ -26,10 +24,15 @@ if(!$generalID){
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
|
||||
$genObjList = [];
|
||||
$env = [];
|
||||
if($genlist){
|
||||
$genObjList = General::createGeneralObjListFromDB($genlist);
|
||||
$env = $gameStor->cacheAll();
|
||||
}
|
||||
switch($btn) {
|
||||
case "전체 접속허용":
|
||||
$db->update('general', [
|
||||
@@ -48,7 +51,7 @@ switch($btn) {
|
||||
DB::db()->query('update general set block=0 where no IN %li', $genlist);
|
||||
break;
|
||||
case "1단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db->update('general', [
|
||||
'block'=>1,
|
||||
'killturn'=>24
|
||||
@@ -60,7 +63,7 @@ switch($btn) {
|
||||
], 'id IN %li', $uid);
|
||||
break;
|
||||
case "2단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db->update('general', [
|
||||
'gold'=>0,
|
||||
'rice'=>0,
|
||||
@@ -74,7 +77,7 @@ switch($btn) {
|
||||
], 'id IN %li', $uid);
|
||||
break;
|
||||
case "3단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db->update('general', [
|
||||
'gold'=>0,
|
||||
'rice'=>0,
|
||||
@@ -93,18 +96,22 @@ switch($btn) {
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now(true);
|
||||
$db->update('general', [
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 0),
|
||||
'killturn'=>0,
|
||||
'turntime'=>$date,
|
||||
], '`no` IN %li', $genlist);
|
||||
$db->update('general_turn', [
|
||||
'action'=>'휴식',
|
||||
'arg'=>'{}',
|
||||
'brief'=>'휴식',
|
||||
], 'general_id IN %li AND turn_idx = 0', $genlist);
|
||||
break;
|
||||
case "특기 부여":
|
||||
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||
$text = "특기 부여!";
|
||||
|
||||
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
||||
foreach($db->query("SELECT `no`,leadership,strength,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
|
||||
@@ -206,7 +213,7 @@ switch($btn) {
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "메세지 전달":
|
||||
$text = $msg;
|
||||
$text = $msg??'';
|
||||
foreach($genlist as $generalID){
|
||||
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
|
||||
$msg->send(true);
|
||||
@@ -214,11 +221,11 @@ switch($btn) {
|
||||
break;
|
||||
case "무기지급":
|
||||
|
||||
if($weap == 0) {
|
||||
if($item == 'None') {
|
||||
$text = "무기 회수!";
|
||||
}
|
||||
else {
|
||||
$text = getWeapName($weap)." 지급!";
|
||||
$text = getItemName($item)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
@@ -226,23 +233,23 @@ switch($btn) {
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
if($item === 'None'){
|
||||
$db->update('general', [
|
||||
'weap'=>0
|
||||
'weapon'=>'None'
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'weap'=>$weap
|
||||
], '`no` IN %li AND weap < %i', $genlist, $weap);
|
||||
'weapon'=>$item
|
||||
], '`no` IN %li', $genlist, $item);
|
||||
}
|
||||
break;
|
||||
case "책지급":
|
||||
if($weap == 0) {
|
||||
if($item == 'None') {
|
||||
$text = "책 회수!";
|
||||
}
|
||||
else {
|
||||
$text = getBookName($weap)." 지급!";
|
||||
$text = getItemName($item)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
@@ -250,23 +257,23 @@ switch($btn) {
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
if($item == 'None'){
|
||||
$db->update('general', [
|
||||
'book'=>0
|
||||
'book'=>'None'
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'book'=>$weap
|
||||
], '`no` IN %li AND book < %i', $genlist, $weap);
|
||||
'book'=>$item
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
break;
|
||||
case "말지급":
|
||||
if($weap == 0) {
|
||||
if($item == 'None') {
|
||||
$text = "말 회수!";
|
||||
}
|
||||
else {
|
||||
$text = getHorseName($weap)." 지급!";
|
||||
$text = getItemName($item)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
@@ -274,23 +281,23 @@ switch($btn) {
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
if($item == 'None'){
|
||||
$db->update('general', [
|
||||
'horse'=>0
|
||||
'horse'=>'None'
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'horse'=>$weap
|
||||
], '`no` IN %li AND horse < %i', $genlist, $weap);
|
||||
'horse'=>$item
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
break;
|
||||
case "도구지급":
|
||||
if($weap == 0) {
|
||||
if($item == 'None') {
|
||||
$text = "특수도구 회수!";
|
||||
}
|
||||
else {
|
||||
$text = getItemName($weap)." 지급!";
|
||||
$text = getItemName($item)." 지급!";
|
||||
}
|
||||
|
||||
foreach($genlist as $generalID){
|
||||
@@ -298,37 +305,35 @@ switch($btn) {
|
||||
$msg->send(true);
|
||||
}
|
||||
|
||||
if($weap == 0){
|
||||
if($item == 'None'){
|
||||
$db->update('general', [
|
||||
'item'=>0
|
||||
'item'=>'None'
|
||||
], '`no` IN %li', $genlist);
|
||||
}
|
||||
else{
|
||||
$db->update('general', [
|
||||
'item'=>$weap
|
||||
], '`no` IN %li AND item < %i', $genlist, $weap);
|
||||
'item'=>$item
|
||||
], '`no` IN %li AND item < %i', $genlist, $item);
|
||||
}
|
||||
break;
|
||||
case "NPC해제":
|
||||
$db->update('general', [
|
||||
'npc'=>1
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "하야입력":
|
||||
$db->update('general', [
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 45)
|
||||
], '`no` IN %li', $genlist);
|
||||
$db->update('general_turn', [
|
||||
'action'=>'che_하야',
|
||||
'arg'=>'{}',
|
||||
'brief'=>'하야',
|
||||
], 'general_id IN %li AND turn_idx = 0', $genlist);
|
||||
break;
|
||||
case "방랑해산":
|
||||
$db->update('general', [
|
||||
'turn0'=>EncodeCommand(0, 0, 0, 47),
|
||||
'turn1'=>EncodeCommand(0, 0, 0, 56)
|
||||
], '`no` IN %li', $genlist);
|
||||
break;
|
||||
case "NPC설정":
|
||||
$db->update('general', [
|
||||
'npc'=>2
|
||||
], '`no` IN %li', $genlist);
|
||||
$db->update('general_turn', [
|
||||
'action'=>'che_방랑',
|
||||
'arg'=>'{}',
|
||||
'brief'=>'방랑',
|
||||
], 'general_id IN %li AND turn_idx = 0', $genlist);
|
||||
$db->update('general_turn', [
|
||||
'action'=>'che_해산',
|
||||
'arg'=>'{}',
|
||||
'brief'=>'해산',
|
||||
], 'general_id IN %li AND turn_idx = 1', $genlist);
|
||||
break;
|
||||
case "00턴":
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
+15
-10
@@ -15,8 +15,6 @@ $btn = Util::getReq('btn');
|
||||
$genlist = Util::getReq('genlist', 'array_int');
|
||||
$msg = Util::getReq('msg','string', '메시지');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
//NOTE: 왜 기능이 admin2와 admin4가 같이 있는가?
|
||||
@@ -26,7 +24,7 @@ switch($btn) {
|
||||
DB::db()->query('update general set block=0 where no IN %li', $genlist);
|
||||
break;
|
||||
case "1단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
|
||||
//FIXME: subquery로 하는게 더 빠를 듯.
|
||||
@@ -34,14 +32,14 @@ switch($btn) {
|
||||
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
break;
|
||||
case "2단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=2,killturn=24 where no IN %li',$genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
|
||||
break;
|
||||
case "3단계 블럭":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$db = DB::db();
|
||||
$db->query('update general set block=3,killturn=24 where no IN %li',$genlist);
|
||||
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
|
||||
@@ -51,12 +49,19 @@ switch($btn) {
|
||||
DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
|
||||
break;
|
||||
case "강제 사망":
|
||||
$date = date('Y-m-d H:i:s');
|
||||
DB::db()->query('update general set turn0=%s,killturn=0,turntime=%s where no IN %li',EncodeCommand(0, 0, 0, 0),$date, $genlist);
|
||||
$date = TimeUtil::now(true);
|
||||
$db->update('general', [
|
||||
'killturn'=>0,
|
||||
'turntime'=>$date,
|
||||
], '`no` IN %li', $genlist);
|
||||
$db->update('general_turn', [
|
||||
'action'=>'휴식',
|
||||
'arg'=>'{}',
|
||||
'brief'=>'휴식'
|
||||
], 'general_id IN %li AND turn_idx = 0', $genlist);
|
||||
break;
|
||||
case "메세지 전달":
|
||||
//TODO:새 갠메 시스템으로 변경
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$date = TimeUtil::now();
|
||||
$src = MessageTarget::buildQuick($session->generalID);
|
||||
for($i=0; $i < count($genlist); $i++) {
|
||||
$msgObj = new Message(
|
||||
@@ -64,7 +69,7 @@ switch($btn) {
|
||||
$src,
|
||||
MessageTarget::buildQuick($genlist[$i]),
|
||||
$msg,
|
||||
new DateTime(),
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[]
|
||||
);
|
||||
|
||||
+29
-33
@@ -14,8 +14,6 @@ if($type2 < 0 || $type2 > 6){
|
||||
$type2 = 0;
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
@@ -121,7 +119,6 @@ for($i=1; $i <= $count; $i++) {
|
||||
<td align=center>접률</td>
|
||||
<td align=center>단접</td>
|
||||
<td align=center>국력</td>
|
||||
<td align=center>단합</td>
|
||||
<td align=center>장수</td>
|
||||
<td align=center>속령</td>
|
||||
<td align=center>기술</td>
|
||||
@@ -155,10 +152,9 @@ SELECT
|
||||
A.nation,
|
||||
A.name,
|
||||
A.power,
|
||||
A.chemi,
|
||||
A.color,
|
||||
A.tech,
|
||||
A.sabotagelimit,
|
||||
A.strategic_cmd_limit,
|
||||
A.gold,
|
||||
A.rice,
|
||||
COUNT(B.nation) AS gennum,
|
||||
@@ -182,8 +178,8 @@ switch($type) {
|
||||
case 4: $query .= " order by A.rice desc"; break;
|
||||
case 5: $query .= " order by avg(B.gold) desc"; break;
|
||||
case 6: $query .= " order by avg(B.rice) desc"; break;
|
||||
case 7: $query .= " order by avg(B.leader) desc"; break;
|
||||
case 8: $query .= " order by avg(B.power) desc"; break;
|
||||
case 7: $query .= " order by avg(B.leadership) desc"; break;
|
||||
case 8: $query .= " order by avg(B.strength) desc"; break;
|
||||
case 9: $query .= " order by avg(B.intel) desc"; break;
|
||||
case 10: $query .= " order by avg(B.explevel) desc"; break;
|
||||
case 11: $query .= " order by avg(B.connect) desc"; break;
|
||||
@@ -202,8 +198,8 @@ for($i=0; $i < $nationCount; $i++) {
|
||||
$query = "select COUNT(*) as cnt,
|
||||
ROUND(AVG(gold)) as avgg,
|
||||
ROUND(AVG(rice)) as avgr,
|
||||
SUM(leader) as leader, ROUND(AVG(leader), 1) as avgl,
|
||||
ROUND(AVG(power), 1) as avgp,
|
||||
SUM(leadership) as leadership, ROUND(AVG(leadership), 1) as avgl,
|
||||
ROUND(AVG(strength), 1) as avgs,
|
||||
ROUND(AVG(intel), 1) as avgi,
|
||||
ROUND(AVG(explevel), 1) as avge,
|
||||
SUM(crew) as crew
|
||||
@@ -212,13 +208,14 @@ for($i=0; $i < $nationCount; $i++) {
|
||||
$gen = MYDB_fetch_array($genResult);
|
||||
|
||||
$query = "select COUNT(*) as cnt,
|
||||
SUM(pop) as pop, SUM(pop2) as pop2,
|
||||
ROUND(SUM(pop)/SUM(pop2)*100, 2) as rate,
|
||||
ROUND(SUM(agri)/SUM(agri2)*100, 2) as agri,
|
||||
ROUND(SUM(comm)/SUM(comm2)*100, 2) as comm,
|
||||
ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu,
|
||||
ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall,
|
||||
ROUND(SUM(def)/SUM(def2)*100, 2) as def
|
||||
SUM(pop) as pop, SUM(pop_max) as pop_max,
|
||||
ROUND(SUM(pop)/SUM(pop_max)*100, 2) as rate,
|
||||
trust,
|
||||
ROUND(SUM(agri)/SUM(agri_max)*100, 2) as agri,
|
||||
ROUND(SUM(comm)/SUM(comm_max)*100, 2) as comm,
|
||||
ROUND(SUM(secu)/SUM(secu_max)*100, 2) as secu,
|
||||
ROUND(SUM(wall)/SUM(wall_max)*100, 2) as wall,
|
||||
ROUND(SUM(def)/SUM(def_max)*100, 2) as def
|
||||
from city where nation='{$nation['nation']}'";
|
||||
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityResult);
|
||||
@@ -229,27 +226,26 @@ for($i=0; $i < $nationCount; $i++) {
|
||||
<td align=center> {$nation['connect']} </td>
|
||||
<td align=center> {$nation['con']} </td>
|
||||
<td align=center> {$nation['power']} </td>
|
||||
<td align=center> {$nation['chemi']} </td>
|
||||
<td align=center> {$gen['cnt']} </td>
|
||||
<td align=center> {$city['cnt']} </td>
|
||||
<td align=center> {$nation['tech']} </td>
|
||||
<td align=center> {$nation['sabotagelimit']} </td>
|
||||
<td align=right> ".sprintf('%.1f',$nation['tech'])." </td>
|
||||
<td align=center> {$nation['strategic_cmd_limit']} </td>
|
||||
<td align=center> {$nation['gold']} </td>
|
||||
<td align=center> {$nation['rice']} </td>
|
||||
<td align=center> {$gen['avgg']} </td>
|
||||
<td align=center> {$gen['avgr']} </td>
|
||||
<td align=center> {$gen['avgl']} </td>
|
||||
<td align=center> {$gen['avgp']} </td>
|
||||
<td align=center> {$gen['avgi']} </td>
|
||||
<td align=center> {$gen['avge']} </td>
|
||||
<td align=center> {$nation['dex0']} </td>
|
||||
<td align=center> {$nation['dex10']} </td>
|
||||
<td align=center> {$nation['dex20']} </td>
|
||||
<td align=center> {$nation['dex30']} </td>
|
||||
<td align=center> {$nation['dex40']} </td>
|
||||
<td align=center> {$gen['crew']}/{$gen['leader']}00 </td>
|
||||
<td align=center> {$city['pop']}/{$city['pop2']} </td>
|
||||
<td align=center> {$city['rate']}% </td>
|
||||
<td align=right> {$gen['avgg']} </td>
|
||||
<td align=right> {$gen['avgr']} </td>
|
||||
<td align=right> {$gen['avgl']} </td>
|
||||
<td align=right> {$gen['avgs']} </td>
|
||||
<td align=right> {$gen['avgi']} </td>
|
||||
<td align=right> {$gen['avge']} </td>
|
||||
<td align=right> {$nation['dex0']} </td>
|
||||
<td align=right> {$nation['dex10']} </td>
|
||||
<td align=right> {$nation['dex20']} </td>
|
||||
<td align=right> {$nation['dex30']} </td>
|
||||
<td align=right> {$nation['dex40']} </td>
|
||||
<td align=right> {$gen['crew']}/{$gen['leadership']}00 </td>
|
||||
<td align=center> {$city['pop']}/{$city['pop_max']} </td>
|
||||
<td align=center> ".sprintf('%.1f',$city['pop']/$city['pop_max']*100)."% </td>
|
||||
<td align=center> {$city['agri']}% </td>
|
||||
<td align=center> {$city['comm']}% </td>
|
||||
<td align=center> {$city['secu']}% </td>
|
||||
|
||||
@@ -7,8 +7,6 @@ include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$nation = Util::getReq('nation', 'int');
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -19,10 +17,10 @@ if($session->userGrade < 5) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
switch($btn) {
|
||||
case "국가변경":
|
||||
$oldNation = $db->queryFirstField('SELECT nation FROM general WHERE owner=%i', $userID);
|
||||
if($nation == 0) {
|
||||
$db->update('general', [
|
||||
'nation'=>0,
|
||||
@@ -33,6 +31,14 @@ switch($btn) {
|
||||
'nation'=>$nation,
|
||||
'level'=>1,
|
||||
], 'owner=%i', $userID);
|
||||
$db->update('nation', [
|
||||
'gennum'=>$db->sqleval('gennum + 1')
|
||||
], 'nation=%i', $oldNation);
|
||||
}
|
||||
if($oldNation != 0){
|
||||
$db->update('nation', [
|
||||
'gennum'=>$db->sqleval('gennum - 1')
|
||||
], 'nation=%i', $oldNation);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ $type = Util::getReq('type', 'int', 0);
|
||||
if($type < 0 || $type > 4){
|
||||
$type = 0;
|
||||
}
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
+62
-36
@@ -6,14 +6,31 @@ include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$gen = Util::getReq('gen', 'int', 0);
|
||||
$type = Util::getReq('type', 'int', 0);
|
||||
$reqQueryType = Util::getReq('query_type', 'string', null);
|
||||
|
||||
if($type < 0 || $type > 3){
|
||||
$type = 0;
|
||||
// $queryTypeText, $reqArgType(0=>None, 1=>AdditionalColumn, 2=>rankVal, 3=>aux), $comp
|
||||
$queryMap = [
|
||||
'turntime' => ['최근턴', 0, function($lhs, $rhs){
|
||||
return -($lhs['turntime']<=>$rhs['turntime']);
|
||||
}],
|
||||
'recwar' => ['최근전투', 1, function($lhs, $rhs){
|
||||
return -($lhs['recwar']<=>$rhs['recwar']);
|
||||
}],
|
||||
'name' => ['장수명', 0, function($lhs, $rhs){
|
||||
if($lhs['npc'] !== $rhs['npc']){
|
||||
return $lhs['npc']<=>$rhs['npc'];
|
||||
}
|
||||
return $lhs['name']<=>$rhs['name'];
|
||||
}],
|
||||
'warnum' => ['전투수', 1, function($lhs, $rhs){
|
||||
return -($lhs['warnum']<=>$rhs['warnum']);
|
||||
}]
|
||||
];
|
||||
|
||||
if($reqQueryType === null || !key_exists($reqQueryType, $queryMap)){
|
||||
$reqQueryType = Util::array_first_key($queryMap);
|
||||
}
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
@@ -45,7 +62,39 @@ if($btn == '정렬하기') {
|
||||
$gen = 0;
|
||||
}
|
||||
|
||||
$sel[$type] = "selected";
|
||||
[$queryTypeText, $reqArgType, $comp] = $queryMap[$reqQueryType];
|
||||
if($reqArgType===0){
|
||||
$generalBasicList = $db->query('SELECT no, name, nation, npc, turntime FROM general');
|
||||
}
|
||||
else if($reqArgType===1){
|
||||
$generalBasicList = $db->query('SELECT no, name, nation, npc, turntime, %b FROM general', $reqQueryType);
|
||||
}
|
||||
else if($reqArgType===2){
|
||||
$generalBasicList = $db->query('SELECT no, name, nation, npc, turntime, value as %b
|
||||
FROM general LEFT JOIN rank_data
|
||||
ON general.no = rank_data.general_id
|
||||
WHERE rank_data.type = %b',
|
||||
$reqQueryType, $reqQueryType
|
||||
);
|
||||
}
|
||||
else if($reqArgType===3){
|
||||
$generalBasicList = array_map(function($arr){
|
||||
$arr['aux'] = Json::decode($arr['aux']);
|
||||
return $arr;
|
||||
}, $db->query('SELECT no, name, nation, npc, turntime, aux FROM general'));
|
||||
}
|
||||
else{
|
||||
throw new \sammo\MustNotBeReachedException();
|
||||
}
|
||||
|
||||
usort($generalBasicList, $comp);
|
||||
|
||||
if(!$gen){
|
||||
$gen = $generalBasicList[0]['no'];
|
||||
}
|
||||
|
||||
$generalObj = General::createGeneralObjFromDB($gen);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -64,39 +113,16 @@ $sel[$type] = "selected";
|
||||
<form name=form1 method=post>
|
||||
정렬순서 :
|
||||
<select name=type size=1>
|
||||
<option <?=$sel[0]??''?> value=0>최근턴</option>
|
||||
<option <?=$sel[1]??''?> value=1>최근전투</option>
|
||||
<option <?=$sel[2]??''?> value=2>장수명</option>
|
||||
<option <?=$sel[3]??''?> value=3>전투수</option>
|
||||
<?php foreach($queryMap as $queryType => [$queryTypeText,]): ?>
|
||||
<option <?=$queryKey==$reqQueryType?'selected':''?> value='<?=$queryKey?>'><?=$queryTypeText?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='정렬하기'>
|
||||
대상장수 :
|
||||
<select name=gen size=1>
|
||||
<?php
|
||||
switch($type) {
|
||||
case 0: $query = "select no,name from general order by turntime desc"; break;
|
||||
case 1: $query = "select no,name from general order by recwar desc"; break;
|
||||
case 2: $query = "select no,name from general order by npc,binary(name)"; break;
|
||||
case 3: $query = "select no,name from general order by warnum desc"; break;
|
||||
}
|
||||
$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($gen == 0) {
|
||||
$gen = $general['no'];
|
||||
}
|
||||
if($gen == $general['no']) {
|
||||
echo "
|
||||
<option selected value={$general['no']}>{$general['name']}</option>";
|
||||
} else {
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']}</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php foreach($generalBasicList as $general): ?>
|
||||
<option <?=$gen==$general['no']?'selected':''?>><?=getNationStaticInfo($general['nation'])['name']?> - <?=$general['name']?> (<?=$general['turntime']?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='조회하기'>
|
||||
</form>
|
||||
@@ -109,7 +135,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?php generalInfo($gen); generalInfo2($gen); ?>
|
||||
<?php generalInfo($generalObj); generalInfo2($generalObj); ?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
</td>
|
||||
|
||||
+2
-41
@@ -8,8 +8,6 @@ $btn = Util::getReq('btn');
|
||||
$gen = Util::getReq('gen', 'int', 0);
|
||||
$type = 0;
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
@@ -73,7 +71,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 +92,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;
|
||||
}
|
||||
|
||||
@@ -114,38 +107,7 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
case 7: $state = "<font color=green>불가침</font>"; break;
|
||||
}
|
||||
|
||||
$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 = " ";
|
||||
}
|
||||
$date = TimeUtil::now();
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -153,7 +115,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);
|
||||
}
|
||||
+51
-25
@@ -14,6 +14,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("명장일람", 1);
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -46,9 +47,15 @@ increaseRefresh("명장일람", 1);
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<div style="margin:auto;width=1000px;">
|
||||
<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'];
|
||||
@@ -60,8 +67,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'] = '???';
|
||||
@@ -117,12 +127,12 @@ $types = [
|
||||
return $v;
|
||||
}],
|
||||
["일 기 토 승 률", "percent", function($v){
|
||||
$totalCnt = $v['tpw']+$v['tpd']+$v['tpl'];
|
||||
$totalCnt = $v['tsw']+$v['tsd']+$v['tsl'];
|
||||
if($totalCnt < 50){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
$v['value'] = $v['tpw']/max(1, $totalCnt);
|
||||
$v['value'] = $v['tsw']/max(1, $totalCnt);
|
||||
}
|
||||
return $v;
|
||||
}],
|
||||
@@ -141,7 +151,7 @@ $types = [
|
||||
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
|
||||
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
|
||||
["베 팅 수 익 률", "percent", function($v){
|
||||
if($v['betgold'] < 1000){
|
||||
if($v['betgold'] < GameConst::$defaultGold){
|
||||
$v['value'] = 0;
|
||||
}
|
||||
else{
|
||||
@@ -151,7 +161,15 @@ $types = [
|
||||
}],
|
||||
];
|
||||
|
||||
$generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
$generals = [];
|
||||
foreach($db->query(
|
||||
"SELECT nation,no,name,name2 as owner_name, owner, picture, imgsvr,
|
||||
experience, dedication,
|
||||
dex0, dex10, dex20, dex30, dex40,
|
||||
horse, weapon, book, item
|
||||
FROM general WHERE %l", $btn == "NPC 보기"?"npc>=2":"npc<2") as $general
|
||||
){
|
||||
$generalID = $general['no'];
|
||||
$general['bgColor'] = $nationColor[$general['nation']]??GameConst::$basecolor4;
|
||||
$general['fgColor'] = newColor($general['bgColor']);
|
||||
$general['nationName'] = $nationName[$general['nation']];
|
||||
@@ -164,22 +182,19 @@ $generals = array_map(function($general) use($nationColor, $nationName) {
|
||||
$general['pictureFullPath'] = GetImageURL(0)."/default.jpg";
|
||||
}
|
||||
|
||||
return $general;
|
||||
}, $db->query(
|
||||
"SELECT nation,no,name,name2 as owner_name, picture, imgsvr,
|
||||
experience, dedication, firenum, warnum, killnum, killcrew, deathcrew,
|
||||
dex0, dex10, dex20, dex30, dex40,
|
||||
ttw, ttd, ttl, tlw, tld, tll, tpw, tpd, tpl, tiw, tid, til,
|
||||
betgold, betwin, betwingold,
|
||||
horse, weap, book, item
|
||||
FROM general WHERE %l", $btn == "NPC 보기"?"npc>=2":"npc<2"));
|
||||
$generals[$generalID] = $general;
|
||||
}
|
||||
|
||||
foreach($db->queryAllLists('SELECT general_id, `type`, `value` FROM rank_data') as [$generalID, $typeKey, $value]){
|
||||
$generals[$generalID][$typeKey] = $value;
|
||||
}
|
||||
|
||||
$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'];
|
||||
|
||||
@@ -209,27 +224,38 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div style="margin:auto;width=1000px;margin-top:5px;">
|
||||
<div style="margin:auto;width:1000px;margin-top:5px;">
|
||||
<?php
|
||||
//유니크 아이템 소유자
|
||||
$itemTypes = [
|
||||
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
|
||||
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
|
||||
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
|
||||
["도 구", 'item', function($v){return displayItemInfo($v);}, 7, 26, []],
|
||||
'horse'=>'명 마',
|
||||
'weapon'=>'명 검',
|
||||
'book'=>'명 서',
|
||||
'item'=>'도 구'
|
||||
];
|
||||
|
||||
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
|
||||
$simpleItemTypes = array_keys($itemTypes); array_map(function($itemType){return $itemType[1];}, $itemTypes);
|
||||
|
||||
foreach($generals as $general){
|
||||
foreach($itemTypes as $itemIdx=>[,$itemType, $itemFunc,,,]){
|
||||
$itemCode = $general[$itemType];
|
||||
if($itemCode <= 6){
|
||||
$itemClass = buildItemClass($itemCode);
|
||||
if(!$itemClass->isBuyable()){
|
||||
continue;
|
||||
}
|
||||
|
||||
$itemName = ($itemFunc)($itemCode);
|
||||
$general['rankName'] = $itemName;
|
||||
$info = $itemClass->getInfo();
|
||||
$name = $itemClass->getName();
|
||||
|
||||
if($info){
|
||||
$name = $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
'info'=>$info,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$general['rankName'] = $name;
|
||||
$general['value'] = $itemCode;
|
||||
$itemTypes[$itemIdx][5][$itemCode] = $general;
|
||||
}
|
||||
|
||||
+14
-4
@@ -54,7 +54,7 @@ if ($showCurrentNation) {
|
||||
<tr>
|
||||
<td style="background-color:#333333;" align=center colspan=8>
|
||||
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
|
||||
<a href="a_history.php"><button>역사 보기</button></a>
|
||||
<a href="a_history.php"><button type='button'>역사 보기</button></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -71,10 +71,10 @@ foreach($emperiors as $emperior){
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<font size=5><?=$emperior['phase']?></font>
|
||||
|
||||
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button>자세히</button></a>
|
||||
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button type='button'>자세히</button></a>
|
||||
|
||||
<?php if($emperior['server_id']): ?>
|
||||
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button>역사 보기</button></a>
|
||||
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button type='button'>역사 보기</button></a>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null);
|
||||
<table align=center width=1000 class="tb_layout bg0">
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<button onclick=window.close()>창 닫기</button>
|
||||
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
|
||||
<div style="float:right;"><a href="a_emperior.php"><button type='button'>전체보기</button></a><div>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
+49
-46
@@ -12,13 +12,10 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("장수일람", 2);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT con,turntime FROM general WHERE owner = %i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -30,6 +27,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>
|
||||
@@ -82,26 +86,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=>['leadership', true],
|
||||
3=>['strength', 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,leadership,strength,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'>
|
||||
@@ -122,17 +126,10 @@ 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) {
|
||||
$lbonus = $nationlevel[$general['nation']] * 2;
|
||||
} elseif ($general['level'] >= 5) {
|
||||
$lbonus = $nationlevel[$general['nation']];
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
}
|
||||
$lbonus = calcLeadershipBonus($general['level'], $nationlevel[$general['nation']]??0);
|
||||
if ($lbonus > 0) {
|
||||
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
@@ -140,18 +137,20 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
}
|
||||
|
||||
if ($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100);
|
||||
$strength = intdiv($general['strength'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$leadership = "<font color=red>{$leadership}</font>{$lbonusText}";
|
||||
$strength = "<font color=red>{$strength}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonusText}";
|
||||
$power = "{$general['power']}";
|
||||
$leadership = "{$general['leadership']}{$lbonusText}";
|
||||
$strength = "{$general['strength']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($general['npc'] >= 2) {
|
||||
$name = "<font color=cyan>{$general['name']}</font>";
|
||||
} elseif ($general['npc'] == 1) {
|
||||
@@ -160,15 +159,19 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
$name = "{$general['name']}";
|
||||
}
|
||||
|
||||
$general['connect'] = Util::round($general['connect'] / 10) * 10;
|
||||
if(key_exists($general['owner'], $ownerNameList)){
|
||||
$name = $name.'<br><small>('.$ownerNameList[$general['owner']].')</small>';
|
||||
}
|
||||
|
||||
$general['connect'] = Util::round($general['connect'], -1);
|
||||
|
||||
$imageTemp = GetImageURL($general['imgsvr']);
|
||||
echo "
|
||||
<tr data-general-id='{$general['no']}'
|
||||
data-general-wounded='{$general['injury']}'
|
||||
data-general-leadership='{$general['leader']}'
|
||||
data-general-leadership='{$general['leadership']}'
|
||||
data-general-leadership-bonus='{$lbonus}'
|
||||
data-general-power='{$general['power']}'
|
||||
data-general-strength='{$general['strength']}'
|
||||
data-general-intel='{$general['intel']}'
|
||||
data-is-npc='".($general['npc']>=2?'true':'false')."'
|
||||
>
|
||||
@@ -176,16 +179,16 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>$name</td>
|
||||
<td align=center>{$general['age']}세</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".getHonor($general['experience'])."</td>
|
||||
<td align=center>".getDed($general['dedication'])."</td>
|
||||
<td align=center>";
|
||||
echo getLevel($general['level']);
|
||||
echo getLevelText($general['level']);
|
||||
echo "</td>
|
||||
<td align=center>$leader</td>
|
||||
<td align=center>$power</td>
|
||||
<td align=center>$leadership</td>
|
||||
<td align=center>$strength</td>
|
||||
<td align=center>$intel</td>
|
||||
<td align=center>{$general['killturn']}</td>
|
||||
<td align=center>{$general['connect']}";
|
||||
|
||||
+41
-14
@@ -5,26 +5,36 @@ 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,12 +63,19 @@ 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>
|
||||
@@ -92,12 +109,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
-18
@@ -86,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>
|
||||
@@ -101,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>
|
||||
@@ -116,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="다음달 ▶▶">
|
||||
|
||||
+72
-134
@@ -9,13 +9,10 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력일람", 2);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
@@ -43,92 +40,51 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<tr><td>세 력 일 람<br><?=closeButton()?></td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select nation,name,color,level,type,power,gennum,capital from nation order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
for($i=1; $i <= $count; $i++) {
|
||||
$nation = MYDB_fetch_array($result); //국가정보
|
||||
$nations = getAllNationStaticInfo();
|
||||
uasort($nations, function($lhs, $rhs){return $rhs['power']<=>$lhs['power'];});
|
||||
|
||||
$query = "select city,name from city where nation='{$nation['nation']}'"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
$nations[0] = getNationStaticInfo(0);
|
||||
|
||||
$query = "select npc,name,city from general where nation='{$nation['nation']}' and level='12'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level12 = MYDB_fetch_array($genresult);
|
||||
foreach($db->query('SELECT npc,name,city,nation,level,penalty,permission FROM general ORDER BY dedication DESC') as $general){
|
||||
$nationID = $general['nation'];
|
||||
|
||||
if(!key_exists('generals', $nations[$nationID])){
|
||||
$nations[$nationID]['generals'] = [];
|
||||
}
|
||||
$nations[$nationID]['generals'][] = $general;
|
||||
}
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='11'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level11 = MYDB_fetch_array($genresult);
|
||||
foreach ($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $nationID]) {
|
||||
if(!key_exists('cities', $nations[$nationID])){
|
||||
$nations[$nationID]['cities'] = [];
|
||||
}
|
||||
$nations[$nationID]['cities'][$cityID] = $cityName;
|
||||
}
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='10'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level10 = MYDB_fetch_array($genresult);
|
||||
foreach ($nations as $nation) {
|
||||
if ($nation['nation'] == 0) {
|
||||
//재야 도시, 장수
|
||||
continue;
|
||||
}
|
||||
$generals = $nation['generals'];
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='9'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level9 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='8'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level8 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='7'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level7 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='6'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level6 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' and level='5'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level5 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select npc,name from general where nation='{$nation['nation']}' order by dedication desc"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
if($level12['name'] == "") { $l12 = "-"; }
|
||||
elseif($level12['npc'] >= 2) { $l12 = "<font color=cyan>{$level12['name']}</font>"; }
|
||||
elseif($level12['npc'] == 1) { $l12 = "<font color=skyblue>{$level12['name']}</font>"; }
|
||||
else { $l12 = $level12['name']; }
|
||||
|
||||
if($level11['name'] == "") { $l11 = "-"; }
|
||||
elseif($level11['npc'] >= 2) { $l11 = "<font color=cyan>{$level11['name']}</font>"; }
|
||||
elseif($level11['npc'] == 1) { $l11 = "<font color=skyblue>{$level11['name']}</font>"; }
|
||||
else { $l11 = $level11['name']; }
|
||||
|
||||
if($level10['name'] == "") { $l10 = "-"; }
|
||||
elseif($level10['npc'] >= 2) { $l10 = "<font color=cyan>{$level10['name']}</font>"; }
|
||||
elseif($level10['npc'] == 1) { $l10 = "<font color=skyblue>{$level10['name']}</font>"; }
|
||||
else { $l10 = $level10['name']; }
|
||||
|
||||
if($level9['name'] == "") { $l9 = "-"; }
|
||||
elseif($level9['npc'] >= 2) { $l9 = "<font color=cyan>{$level9['name']}</font>"; }
|
||||
elseif($level9['npc'] == 1) { $l9 = "<font color=skyblue>{$level9['name']}</font>"; }
|
||||
else { $l9 = $level9['name']; }
|
||||
|
||||
if($level8['name'] == "") { $l8 = "-"; }
|
||||
elseif($level8['npc'] >= 2) { $l8 = "<font color=cyan>{$level8['name']}</font>"; }
|
||||
elseif($level8['npc'] == 1) { $l8 = "<font color=skyblue>{$level8['name']}</font>"; }
|
||||
else { $l8 = $level8['name']; }
|
||||
|
||||
if($level7['name'] == "") { $l7 = "-"; }
|
||||
elseif($level7['npc'] >= 2) { $l7 = "<font color=cyan>{$level7['name']}</font>"; }
|
||||
elseif($level7['npc'] == 1) { $l7 = "<font color=skyblue>{$level7['name']}</font>"; }
|
||||
else { $l7 = $level7['name']; }
|
||||
|
||||
if($level6['name'] == "") { $l6 = "-"; }
|
||||
elseif($level6['npc'] >= 2) { $l6 = "<font color=cyan>{$level6['name']}</font>"; }
|
||||
elseif($level6['npc'] == 1) { $l6 = "<font color=skyblue>{$level6['name']}</font>"; }
|
||||
else { $l6 = $level6['name']; }
|
||||
|
||||
if($level5['name'] == "") { $l5 = "-"; }
|
||||
elseif($level5['npc'] >= 2) { $l5 = "<font color=cyan>{$level5['name']}</font>"; }
|
||||
elseif($level5['npc'] == 1) { $l5 = "<font color=skyblue>{$level5['name']}</font>"; }
|
||||
else { $l5 = $level5['name']; }
|
||||
$chiefs = [];
|
||||
$ambassadors = [];
|
||||
$auditors = [];
|
||||
foreach($generals as $general){
|
||||
$generalLevel = $general['level'];
|
||||
if($generalLevel >= 5){
|
||||
$chiefs[$generalLevel] = $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'>
|
||||
@@ -143,55 +99,48 @@ 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>
|
||||
</tr>
|
||||
<td width=170 align=center>".count($generals)." / ".count($nation['cities'])."</td>
|
||||
";
|
||||
for($chiefLevel = 12; $chiefLevel >= 5; $chiefLevel--){
|
||||
if($chiefLevel % 4 == 0){
|
||||
echo '</tr><tr>';
|
||||
}
|
||||
$chief = $chiefs[$chiefLevel]??['name'=>'-','npc'=>0];
|
||||
$levelText = getLevelText($chiefLevel, $nation['level']);
|
||||
$chiefText = getColoredName($chief['name'], $chief['npc']);
|
||||
echo "<td class='center bg1'>{$levelText}</td>
|
||||
<td class='center'>{$chiefText}</td>";
|
||||
}
|
||||
echo "</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>".getLevel(12, $nation['level'])."</td>
|
||||
<td align=center>$l12</td>
|
||||
<td align=center id=bg1>".getLevel(11, $nation['level'])."</td>
|
||||
<td align=center>$l11</td>
|
||||
<td align=center id=bg1>".getLevel(10, $nation['level'])."</td>
|
||||
<td align=center>$l10</td>
|
||||
<td align=center id=bg1>".getLevel( 9, $nation['level'])."</td>
|
||||
<td align=center>$l9</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>".getLevel( 8, $nation['level'])."</td>
|
||||
<td align=center>$l8</td>
|
||||
<td align=center id=bg1>".getLevel( 7, $nation['level'])."</td>
|
||||
<td align=center>$l7</td>
|
||||
<td align=center id=bg1>".getLevel( 6, $nation['level'])."</td>
|
||||
<td align=center>$l6</td>
|
||||
<td align=center id=bg1>".getLevel( 5, $nation['level'])."</td>
|
||||
<td align=center>$l5</td>
|
||||
</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) {
|
||||
echo "속령 일람 : ";
|
||||
|
||||
for($j=0; $j < $citycount; $j++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
if($city['city'] == $nation['capital']) {
|
||||
echo "<font color=cyan>[{$city['name']}]</font>, ";
|
||||
foreach($nation['cities'] as $cityID => $cityName) {
|
||||
if($cityID == $nation['capital']) {
|
||||
echo "<font color=cyan>[{$cityName}]</font>, ";
|
||||
} else {
|
||||
echo "{$city['name']}, ";
|
||||
echo "{$cityName}, ";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$query = "select name from city where city='{$level12['city']}'"; // 군주 위치 도시 이름
|
||||
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityResult);
|
||||
$cityName = CityConst::byID($chiefs[12]['city'])->name;
|
||||
|
||||
echo "현재 위치 : <font color=yellow>{$city['name']}</font>";
|
||||
echo "현재 위치 : <font color=yellow>{$cityName}</font>";
|
||||
}
|
||||
echo"
|
||||
</td>
|
||||
</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']}, "; }
|
||||
@@ -204,14 +153,6 @@ for($i=1; $i <= $count; $i++) {
|
||||
}
|
||||
|
||||
//재야
|
||||
$query = "select npc,name from general where nation='0'"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
$query = "select name from city where nation='0'"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
@@ -220,26 +161,23 @@ echo "
|
||||
<tr>
|
||||
<td width=498 align=center> </td>
|
||||
<td width=123 align=center id=bg1>장 수</td>
|
||||
<td width=123 align=center>{$gencount}</td>
|
||||
<td width=123 align=center>".count($nations[0]['generals'])."</td>
|
||||
<td width=123 align=center id=bg1>속 령</td>
|
||||
<td width=123 align=center>{$citycount}</td>
|
||||
<td width=123 align=center>".count($nations[0]['cities']??[])."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5> 속령 일람 : ";
|
||||
for($j=0; $j < $citycount; $j++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
echo "{$city['name']}, ";
|
||||
foreach($nations[0]['cities']??[] as $cityName) {
|
||||
echo "{$cityName}, ";
|
||||
}
|
||||
echo"
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5> 장수 일람 : ";
|
||||
for($j=0; $j < $gencount; $j++) {
|
||||
$general = MYDB_fetch_array($genresult);
|
||||
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']}, "; }
|
||||
foreach($nations[0]['generals'] as $general) {
|
||||
$generalText = getColoredName($general['name'], $general['npc']);
|
||||
echo "{$generalText}, ";
|
||||
}
|
||||
echo"
|
||||
</td>
|
||||
|
||||
+11
-11
@@ -62,14 +62,14 @@ foreach (getAllNationStaticInfo() as $nation) {
|
||||
|
||||
switch ($type) {//FIXME: $query 처리 부실
|
||||
default:
|
||||
case 1: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by binary(name)"; break;
|
||||
case 2: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by nation"; break;
|
||||
case 3: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by sum desc"; break;
|
||||
case 4: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by leader"; break;
|
||||
case 5: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by power"; break;
|
||||
case 6: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by intel"; break;
|
||||
case 7: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by experience"; break;
|
||||
case 8: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by dedication"; break;
|
||||
case 1: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by binary(name)"; break;
|
||||
case 2: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by nation"; break;
|
||||
case 3: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by sum desc"; break;
|
||||
case 4: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by leadership"; break;
|
||||
case 5: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by strength"; break;
|
||||
case 6: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by intel"; break;
|
||||
case 7: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by experience"; break;
|
||||
case 8: $query = "select npc,nation,name,name2,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1 order by dedication"; break;
|
||||
}
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
@@ -109,10 +109,10 @@ for ($j=0; $j < $gencount; $j++) {
|
||||
<td align=center>Lv {$general['explevel']}</td>
|
||||
<td align=center>{$nation}</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['sum']}</td>
|
||||
<td align=center>{$general['leader']}</td>
|
||||
<td align=center>{$general['power']}</td>
|
||||
<td align=center>{$general['leadership']}</td>
|
||||
<td align=center>{$general['strength']}</td>
|
||||
<td align=center>{$general['intel']}</td>
|
||||
<td align=center>{$general['experience']}</td>
|
||||
<td align=center>{$general['dedication']}</td>
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn();
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
|
||||
+2
-3
@@ -6,13 +6,12 @@ include "func.php";
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("갱신정보", 2);
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
|
||||
|
||||
$log = getRawFileLogRecent(__dir__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
|
||||
$log = getRawFileLogRecent(__DIR__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
|
||||
|
||||
$date = [];
|
||||
$year = [];
|
||||
@@ -31,7 +30,7 @@ foreach($log as $i=>$value){
|
||||
}
|
||||
$year[] = $admin['year'];
|
||||
$month[] = $admin['month'];
|
||||
$date[] = date('Y-m-d H:i:s');
|
||||
$date[] = TimeUtil::now();
|
||||
|
||||
if ($admin['maxrefresh'] == 0) {
|
||||
$admin['maxrefresh'] = 1;
|
||||
|
||||
+7
-26
@@ -8,16 +8,13 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("설문조사", 1);
|
||||
|
||||
$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()]??[]);
|
||||
$isVoteAdmin |= $session->userGrade >= 5;
|
||||
|
||||
$query = "select no,vote from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no,vote from general where owner=%i', $userID);
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','voteopen','vote_title','vote','votecomment']);
|
||||
$vote_title = $admin['vote_title']??'-';
|
||||
@@ -84,13 +81,8 @@ echo "
|
||||
</tr>
|
||||
";
|
||||
|
||||
$query = "select no from general where vote>0 and npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$voteCount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select no from general where npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$allCount = MYDB_num_rows($result);
|
||||
$voteCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote>0 AND npc<2');
|
||||
$allCount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc<2');
|
||||
|
||||
$percentage = round($voteCount / $allCount * 100, 1);
|
||||
|
||||
@@ -106,9 +98,7 @@ for ($i=1; $i < $voteTypeCount; $i++) {
|
||||
<input type=radio name=sel value={$i}>
|
||||
";
|
||||
} elseif ($admin['voteopen'] >= 1 || $isVoteAdmin) {
|
||||
$query = "select no from general where vote='{$i}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$vCount = MYDB_num_rows($result);
|
||||
$vCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote=%i', $i);
|
||||
|
||||
$per = @round($vCount / $voteCount * 100, 1);
|
||||
echo "{$vCount} 표 ({$per}%)";
|
||||
@@ -268,9 +258,7 @@ if ($admin['voteopen'] >= 1 || $isVoteAdmin) {
|
||||
}
|
||||
|
||||
if ($admin['voteopen'] >= 2 || $isVoteAdmin) {
|
||||
$query = "select no from general where nation=0 and npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$memCount = MYDB_num_rows($result);
|
||||
$memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=0 AND npc <2');
|
||||
if ($memCount == 0) {
|
||||
$memCount = 1;
|
||||
}
|
||||
@@ -312,15 +300,8 @@ if ($admin['voteopen'] >= 2 || $isVoteAdmin) {
|
||||
</tr>
|
||||
";
|
||||
|
||||
$query = "select nation,color,name,gennum from nation order by gennum desc";
|
||||
$nationResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nationcount = MYDB_num_rows($nationResult);
|
||||
for ($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($nationResult);
|
||||
|
||||
$query = "select no from general where nation='{$nation['nation']}' and npc<2";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$memCount = MYDB_num_rows($result);
|
||||
foreach($db->query('SELECT nation,color,name,gennum from nation order by gennum desc') as $i=>$nation){
|
||||
$memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc<2', $nation['nation']);
|
||||
|
||||
|
||||
|
||||
|
||||
+10
-26
@@ -27,17 +27,12 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "select no from auction where no1='{$me['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$tradeCount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select no from auction where no2='{$me['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$bidCount = MYDB_num_rows($result);
|
||||
$tradeCount = $db->queryFirstField('SELECT count(no) FROM auction WHERE no1=%i', $me['no']);
|
||||
$bidCount = $db->queryFirstField('SELECT count(no) FROM auction where no2=%i', $me['no']);
|
||||
|
||||
$btCount = $tradeCount + $bidCount;
|
||||
|
||||
if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
||||
if ($session->userGrade >= 5) {
|
||||
$btn = "submit";
|
||||
} else {
|
||||
$btn = "hidden";
|
||||
@@ -93,13 +88,12 @@ $count = MYDB_num_rows($result);
|
||||
$chk = 0;
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$auction = MYDB_fetch_array($result);
|
||||
$itemname = GetStuffName($auction['stuff']);
|
||||
$radio = "";
|
||||
$alert = "";
|
||||
$alert2 = "";
|
||||
if ($auction['no1'] == $me['no']) {
|
||||
$radio = " disabled";
|
||||
} elseif ($auction['no2'] > 0 && $auction['amount'] * 2 <= $auction['value'] && $auction['stuff'] == 0) {
|
||||
} elseif ($auction['no2'] > 0 && $auction['amount'] * 2 <= $auction['value']) {
|
||||
$radio = " disabled";
|
||||
$alert = "<font color=red>";
|
||||
$alert2 = "</font>";
|
||||
@@ -113,15 +107,13 @@ for ($i=0; $i < $count; $i++) {
|
||||
}
|
||||
$pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001;
|
||||
$pv = substr((string)$pv, 0, 4);
|
||||
if ($auction['stuff'] != 0) {
|
||||
$pv = '-';
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr align=center>
|
||||
<td>{$auction['no']}</td>
|
||||
<td><input type=radio name=sel value={$auction['no']}{$radio}></td>
|
||||
<td>{$auction['name1']}</td>
|
||||
<td>{$itemname}</td>
|
||||
<td>쌀</td>
|
||||
<td>{$auction['amount']}</td>
|
||||
<td>금 {$auction['cost']}</td>
|
||||
<td>{$alert}금 {$auction['value']}{$alert2}</td>
|
||||
@@ -148,9 +140,7 @@ for ($i=0; $i < $count; $i++) {
|
||||
<td align=center id=bg1>거래등록</td>
|
||||
<td colspan=10>
|
||||
종료: <input type=text style=color:white;background-color:black; size=2 maxlength=2 name=term value=12>턴 후
|
||||
물품: <select size=1 name=stuff style=color:white;background-color:black;>
|
||||
<option style=color:white; value=0>쌀</option>
|
||||
</select>
|
||||
물품: 쌀
|
||||
판매량: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=amount value=1000>
|
||||
시작가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=cost value=500>
|
||||
즉구가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=topv value=2000>
|
||||
@@ -191,13 +181,12 @@ $count = MYDB_num_rows($result);
|
||||
$chk = 0;
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$auction = MYDB_fetch_array($result);
|
||||
$itemname = GetStuffName($auction['stuff']);
|
||||
$radio = "";
|
||||
$alert = "";
|
||||
$alert2 = "";
|
||||
if ($auction['no1'] == $me['no']) {
|
||||
$radio = " disabled";
|
||||
} elseif ($auction['no2'] > 0 && $auction['amount'] >= $auction['value'] * 2 && $auction['stuff'] == 0) {
|
||||
} elseif ($auction['no2'] > 0 && $auction['amount'] >= $auction['value'] * 2) {
|
||||
$radio = " disabled";
|
||||
$alert = "<font color=red>";
|
||||
$alert2 = "</font>";
|
||||
@@ -211,15 +200,12 @@ for ($i=0; $i < $count; $i++) {
|
||||
}
|
||||
$pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001;
|
||||
$pv = substr((string)$pv, 0, 4);
|
||||
if ($auction['stuff'] != 0) {
|
||||
$pv = '-';
|
||||
}
|
||||
echo "
|
||||
<tr align=center>
|
||||
<td>{$auction['no']}</td>
|
||||
<td><input type=radio name=sel value={$auction['no']}{$radio}></td>
|
||||
<td>{$auction['name1']}</td>
|
||||
<td>{$itemname}</td>
|
||||
<td>쌀</td>
|
||||
<td>{$auction['amount']}</td>
|
||||
<td>금 {$auction['cost']}</td>
|
||||
<td>{$alert}금 {$auction['value']}{$alert2}</td>
|
||||
@@ -246,9 +232,7 @@ for ($i=0; $i < $count; $i++) {
|
||||
<td align=center id=bg1>거래등록</td>
|
||||
<td colspan=10>
|
||||
종료: <input type=text style=color:white;background-color:black; size=2 maxlength=2 name=term value=12>턴 후
|
||||
물품: <select size=1 name=stuff style=color:white;background-color:black;>
|
||||
<option style=color:white; value=0>쌀</option>
|
||||
</select>
|
||||
물품: 쌀
|
||||
구입량: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=amount value=1000>
|
||||
시작가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=cost value=2000>
|
||||
즉구가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=topv value=500>
|
||||
|
||||
+78
-47
@@ -10,12 +10,37 @@ $v->rule('required', 'gen')
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$gen = Util::getReq('gen', 'int', 0);
|
||||
$type = Util::getReq('type', 'int', 0);
|
||||
$reqQueryType = Util::getReq('query_type', 'string', null);
|
||||
|
||||
if ($type < 0 || $type > 3) {
|
||||
$type = 0;
|
||||
// $queryTypeText, $reqArgType(0=>None, 1=>AdditionalColumn, 2=>rankVal, 3=>aux), $comp
|
||||
$queryMap = [
|
||||
'turntime' => ['최근턴', 0, function($lhs, $rhs){
|
||||
return -($lhs['turntime']<=>$rhs['turntime']);
|
||||
}],
|
||||
'recwar' => ['최근전투', 1, function($lhs, $rhs){
|
||||
return -($lhs['recwar']<=>$rhs['recwar']);
|
||||
}],
|
||||
'name' => ['장수명', 0, function($lhs, $rhs){
|
||||
if($lhs['npc'] !== $rhs['npc']){
|
||||
return $lhs['npc']<=>$rhs['npc'];
|
||||
}
|
||||
return $lhs['name']<=>$rhs['name'];
|
||||
}],
|
||||
'warnum' => ['전투수', 1, function($lhs, $rhs){
|
||||
return -($lhs['warnum']<=>$rhs['warnum']);
|
||||
}]
|
||||
];
|
||||
|
||||
if($reqQueryType === null || !key_exists($reqQueryType, $queryMap)){
|
||||
$reqQueryType = Util::array_first_key($queryMap);
|
||||
}
|
||||
|
||||
|
||||
if($reqQueryType === null || !key_exists($reqQueryType, $queryMap)){
|
||||
$reqQueryType = Util::array_first_key($queryMap);
|
||||
}
|
||||
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -26,14 +51,14 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("감찰부", 2);
|
||||
//전투 추진을 위해 갱신
|
||||
checkTurn();
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
$gameStor->resetCache();
|
||||
|
||||
$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);
|
||||
|
||||
@@ -47,11 +72,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();
|
||||
}
|
||||
|
||||
//잘못된 접근
|
||||
@@ -63,9 +91,39 @@ if ($btn == '정렬하기') {
|
||||
$gen = 0;
|
||||
}
|
||||
|
||||
$sel = [];
|
||||
$sel[$type] = "selected";
|
||||
|
||||
[$queryTypeText, $reqArgType, $comp] = $queryMap[$reqQueryType];
|
||||
if($reqArgType===0){
|
||||
$generalBasicList = $db->query('SELECT no, name, npc, turntime FROM general');
|
||||
}
|
||||
else if($reqArgType===1){
|
||||
$generalBasicList = $db->query('SELECT no, name, npc, turntime, %b FROM general', $reqQueryType);
|
||||
}
|
||||
else if($reqArgType===2){
|
||||
$generalBasicList = $db->query('SELECT no, name, npc, turntime, value as %b
|
||||
FROM general LEFT JOIN rank_data
|
||||
ON general.no = rank_data.general_id
|
||||
WHERE rank_data.type = %b',
|
||||
$reqQueryType, $reqQueryType
|
||||
);
|
||||
}
|
||||
else if($reqArgType===3){
|
||||
$generalBasicList = array_map(function($arr){
|
||||
$arr['aux'] = Json::decode($arr['aux']);
|
||||
return $arr;
|
||||
}, $db->query('SELECT no, name, npc, turntime, aux FROM general'));
|
||||
}
|
||||
else{
|
||||
throw new \sammo\MustNotBeReachedException();
|
||||
}
|
||||
|
||||
|
||||
usort($generalBasicList, $comp);
|
||||
|
||||
if(!$gen){
|
||||
$gen = $generalBasicList[0]['no'];
|
||||
}
|
||||
$showGeneral = General::createGeneralObjFromDB($gen);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -91,43 +149,16 @@ $sel[$type] = "selected";
|
||||
<form name=form1 method=post>
|
||||
정렬순서 :
|
||||
<select name=type size=1>
|
||||
<option <?=$sel[0]??''?> value=0>최근턴</option>
|
||||
<option <?=$sel[1]??''?> value=1>최근전투</option>
|
||||
<option <?=$sel[2]??''?> value=2>장수명</option>
|
||||
<option <?=$sel[3]??''?> value=3>전투수</option>
|
||||
<?php foreach($queryMap as $queryType => [$queryTypeText,]): ?>
|
||||
<option <?=$queryKey==$reqQueryType?'selected':''?> value='<?=$queryKey?>'><?=$queryTypeText?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='정렬하기'>
|
||||
대상장수 :
|
||||
<select name=gen size=1>
|
||||
<?php
|
||||
switch ($type) {
|
||||
default:
|
||||
case 0: $query = "select no,name,npc from general where nation='{$me['nation']}' order by turntime desc"; break;
|
||||
case 1: $query = "select no,name,npc from general where nation='{$me['nation']}' order by recwar desc"; break;
|
||||
case 2: $query = "select no,name,npc from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
|
||||
case 3: $query = "select no,name,npc from general where nation='{$me['nation']}' order by warnum desc"; break;
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$npc = 0;
|
||||
for ($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
// 선택 없으면 맨 처음 장수
|
||||
if ($gen == 0) {
|
||||
$gen = $general['no'];
|
||||
}
|
||||
if($gen == $general['no']){
|
||||
$npc = $general['npc'];
|
||||
}
|
||||
if ($gen == $general['no']) {
|
||||
echo "
|
||||
<option selected value={$general['no']}>{$general['name']}</option>";
|
||||
} else {
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']}</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php foreach($generalBasicList as $general): ?>
|
||||
<option <?=$gen==$general['no']?'selected':''?>><?=$general['name']?> (<?=$general['turntime']?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='조회하기'>
|
||||
</form>
|
||||
@@ -140,7 +171,7 @@ for ($i=0; $i < $gencount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?php generalInfo($gen); generalInfo2($gen); ?>
|
||||
<?php generalInfo($showGeneral); generalInfo2($showGeneral); ?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<?=getGeneralHistoryAll($gen)?>
|
||||
@@ -158,7 +189,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>
|
||||
|
||||
+26
-32
@@ -12,17 +12,20 @@ $gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("베팅장", 1);
|
||||
checkTurn();
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$query = "select no,tournament,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$generalID = $session->generalID;
|
||||
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_type','develcost','bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$admin['bet'] =
|
||||
$admin['bet0'] + $admin['bet1'] + $admin['bet2'] + $admin['bet3'] + $admin['bet4'] +
|
||||
$admin['bet5'] + $admin['bet6'] + $admin['bet7'] + $admin['bet8'] + $admin['bet9'] +
|
||||
$admin['bet10'] + $admin['bet11'] + $admin['bet12'] + $admin['bet13'] + $admin['bet14'] + $admin['bet15'];
|
||||
//NOTE: general_id만 빼기 귀찮음.
|
||||
$myBet = array_splice($db->queryFirstList('SELECT * FROM betting WHERE general_id = %i', $generalID), -16);
|
||||
$globalBet = array_splice($db->queryFirstList('SELECT * FROM betting WHERE general_id = 0'), -16);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no,tournament,con,turntime from general where owner=%i', $userID);
|
||||
|
||||
$myBetTotal = array_sum($myBet);
|
||||
$globalBetTotal = array_sum($globalBet);
|
||||
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_type','develcost']);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -32,10 +35,10 @@ if ($con >= 2) {
|
||||
|
||||
switch ($admin['tnmt_type']) {
|
||||
default: throw new \RuntimeException('Invalid tnmt_type');break;
|
||||
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
|
||||
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
|
||||
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
|
||||
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break;
|
||||
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "total"; $tp2 = "종합"; $tp3 = "total"; break;
|
||||
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "leadership"; $tp2 = "통솔"; $tp3 = "leadership"; break;
|
||||
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "strength"; $tp2 = "무력"; $tp3 = "strength"; break;
|
||||
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "intel"; $tp2 = "지력"; $tp3 = "intel"; break;
|
||||
}
|
||||
|
||||
$str1 = getTournament($admin['tournament']);
|
||||
@@ -62,6 +65,7 @@ if($str3){
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/betting.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
@@ -74,7 +78,7 @@ if($str3){
|
||||
<table align=center width=1120 class='tb_layout bg0'>
|
||||
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
|
||||
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
|
||||
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet']?> / 내 투자 금액 : <?=$me['bet']?>)</font></td></tr>
|
||||
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$globalBetTotal?> / 내 투자 금액 : <?=$myBetTotal?>)</font></td></tr>
|
||||
</table>
|
||||
<table align=center width=1120 class='mimic_flex bg0' style='border:solid 1px gray;font-size:10px;'>
|
||||
<tr align=center><td height=10 colspan=16></td></tr>
|
||||
@@ -282,23 +286,16 @@ for ($i=0; $i < 16; $i++) {
|
||||
echo "<td width=70>{$gen[$i]}</td>";
|
||||
}
|
||||
|
||||
$query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$myBet = [];
|
||||
$bet = [];
|
||||
$gold = [];
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$myBet[$i] = $me["bet{$i}"];
|
||||
}
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
if($admin["bet{$i}"] == 0){
|
||||
if($globalBet[$i] == 0){
|
||||
$bet[$i] = "∞";
|
||||
}
|
||||
else{
|
||||
$bet[$i] = round($admin['bet'] / $admin["bet{$i}"], 2);
|
||||
$bet[$i] = round($globalBetTotal / $globalBet[$i], 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,13 +349,12 @@ echo "
|
||||
|
||||
if ($admin['tournament'] == 6) {
|
||||
echo "
|
||||
<form method=post action=c_betting.php>
|
||||
<tr align=center>";
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
echo "
|
||||
<td>
|
||||
<select size=1 name=gold{$i} style=color:white;background-color:black;>
|
||||
<select size=1 id='target_{$i}' style=color:white;background-color:black;>
|
||||
<option style=color:white; value=10>금10</option>
|
||||
<option style=color:white; value=20>금20</option>
|
||||
<option style=color:white; value=50>금50</option>
|
||||
@@ -376,12 +372,10 @@ if ($admin['tournament'] == 6) {
|
||||
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
echo "
|
||||
<td><input type=submit name=btn{$i} value=베팅! style=width:100%;color:white;background-color:black;></td>";
|
||||
<td><input type=button class='submitBtn' data-target='{$i}' value=베팅! style=width:100%;color:white;background-color:black;></td>";
|
||||
}
|
||||
|
||||
echo "
|
||||
</tr>
|
||||
</form>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -401,8 +395,8 @@ if ($admin['tournament'] == 6) {
|
||||
|
||||
$type1 = array("전 력 전", "통 솔 전", "일 기 토", "설 전");
|
||||
$type2 = array("종합", "통솔", "무력", "지력");
|
||||
$type3 = array("tt", "tl", "tp", "ti");
|
||||
$type4 = array("total", "leader", "power", "intel");
|
||||
$type3 = array("tt", "tl", "ts", "ti");
|
||||
$type4 = array("total", "leadership", "strength", "intel");
|
||||
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$grp = $i;
|
||||
@@ -412,7 +406,7 @@ for ($i=0; $i < 4; $i++) {
|
||||
<tr><td colspan=9 align=center style=color:white;background-color:black;><font size=4>{$type1[$i]}</font></td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$type2[$i]}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>勝</td></tr>";
|
||||
|
||||
$query = "select npc,name,leader,power,intel,leader+power+intel as total,{$type3[$i]}p as prize,{$type3[$i]}w+{$type3[$i]}d+{$type3[$i]}l as game,{$type3[$i]}w as win,{$type3[$i]}d as draw,{$type3[$i]}l as lose,{$type3[$i]}g as gl from general order by gl desc, game desc, win desc, draw desc, lose, no limit 0,30";
|
||||
$query = "select npc,name,leadership,strength,intel,leadership+strength+intel as total,{$type3[$i]}p as prize,{$type3[$i]}w+{$type3[$i]}d+{$type3[$i]}l as game,{$type3[$i]}w as win,{$type3[$i]}d as draw,{$type3[$i]}l as lose,{$type3[$i]}g as gl from general order by gl desc, game desc, win desc, draw desc, lose, no limit 0,30";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($k=1; $k <= 30; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -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>
|
||||
|
||||
+80
-167
@@ -6,73 +6,7 @@ include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$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);
|
||||
|
||||
$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();
|
||||
}
|
||||
|
||||
if($me['level'] >= 5) { $btn = "submit"; $btn2 = "button"; }
|
||||
else { $btn = "hidden"; $btn2 = "hidden"; }
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// 명령 목록
|
||||
$admin = $gameStor->getValues(['year','month','turnterm']);
|
||||
|
||||
$query = "
|
||||
select nation,level,
|
||||
l12turn0,l12turn1,l12turn2,l12turn3,l12turn4,l12turn5,l12turn6,l12turn7,l12turn8,l12turn9,l12turn10,l12turn11,
|
||||
l11turn0,l11turn1,l11turn2,l11turn3,l11turn4,l11turn5,l11turn6,l11turn7,l11turn8,l11turn9,l11turn10,l11turn11,
|
||||
l10turn0,l10turn1,l10turn2,l10turn3,l10turn4,l10turn5,l10turn6,l10turn7,l10turn8,l10turn9,l10turn10,l10turn11,
|
||||
l9turn0, l9turn1, l9turn2, l9turn3, l9turn4, l9turn5, l9turn6, l9turn7, l9turn8, l9turn9, l9turn10, l9turn11,
|
||||
l8turn0, l8turn1, l8turn2, l8turn3, l8turn4, l8turn5, l8turn6, l8turn7, l8turn8, l8turn9, l8turn10, l8turn11,
|
||||
l7turn0, l7turn1, l7turn2, l7turn3, l7turn4, l7turn5, l7turn6, l7turn7, l7turn8, l7turn9, l7turn10, l7turn11,
|
||||
l6turn0, l6turn1, l6turn2, l6turn3, l6turn4, l6turn5, l6turn6, l6turn7, l6turn8, l6turn9, l6turn10, l6turn11,
|
||||
l5turn0, l5turn1, l5turn2, l5turn3, l5turn4, l5turn5, l5turn6, l5turn7, l5turn8, l5turn9, l5turn10, l5turn11
|
||||
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']);
|
||||
$turn = [];
|
||||
|
||||
for($i=12; $i >= $lv; $i--) {
|
||||
$turn[$i] = getCoreTurn($nation, $i);
|
||||
|
||||
$query = "select name,turntime,npc from general where level={$i} and nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen[$i] = MYDB_fetch_array($result)??[
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'turntime'=>''
|
||||
];
|
||||
}
|
||||
for($i= $lv - 1; $i>=5; $i--){
|
||||
$gen[$i] = [
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'turntime'=>''
|
||||
];
|
||||
}
|
||||
|
||||
$generalObj = General::createGeneralObjFromDB($session->generalID);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -83,116 +17,95 @@ for($i= $lv - 1; $i>=5; $i--){
|
||||
<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/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/chiefCenter.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/chiefCenter.css')?>
|
||||
<script type="text/javascript">
|
||||
function turn(type) {
|
||||
if(type == 0) location.replace('turn_push_core.php');
|
||||
else if(type == 1) location.replace('turn_pop_core.php');
|
||||
}
|
||||
var maxChiefTurn = <?=GameConst::$maxChiefTurn?>;
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>사 령 부<input type=button value='갱신' onclick=location.replace('b_chiefcenter.php')><br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td colspan=10 align=center bgcolor=skyblue>수뇌부 일정</td></tr>
|
||||
<tr><td colspan=10 align=center>
|
||||
<?php
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'];
|
||||
$date = substr(date('Y-m-d H:i:s'), 14);
|
||||
|
||||
$totaldate = [];
|
||||
$turntime = [];
|
||||
$turndate = [];
|
||||
|
||||
for($i=12; $i >= $lv; $i--) {
|
||||
$totaldate[$i] = $gen[$i]['turntime'];
|
||||
$turntime[$i] = substr($gen[$i]['turntime'], 14);
|
||||
}
|
||||
|
||||
//FIXME: 각 칸을 div로 놓으면 네개씩 출력하는 삽질이 필요없다.
|
||||
|
||||
for($k=0; $k < 2; $k++) {
|
||||
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $k;
|
||||
|
||||
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".($gen[$l4]['name']??'')."</font>"; }
|
||||
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".($gen[$l4]['name']??'')."</font>"; }
|
||||
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".($gen[$l3]['name']??'')."</font>"; }
|
||||
elseif($gen[$l3]['npc'] == 1) { $gen[$l3]['name'] = "<font color=skyblue>".($gen[$l3]['name']??'')."</font>"; }
|
||||
if ($gen[$l2]['npc'] >= 2) { $gen[$l2]['name'] = "<font color=cyan>".($gen[$l2]['name']??'')."</font>"; }
|
||||
elseif($gen[$l2]['npc'] == 1) { $gen[$l2]['name'] = "<font color=skyblue>".($gen[$l2]['name']??'')."</font>"; }
|
||||
if ($gen[$l1]['npc'] >= 2) { $gen[$l1]['name'] = "<font color=cyan>".($gen[$l1]['name']??'')."</font>"; }
|
||||
elseif($gen[$l1]['npc'] == 1) { $gen[$l1]['name'] = "<font color=skyblue>".($gen[$l1]['name']??'')."</font>"; }
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center id=bg1>.</td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : ".($gen[$l4]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : ".($gen[$l3]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : ".($gen[$l2]['name']??'')."</b></td>
|
||||
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : ".($gen[$l1]['name']??'')."</b></td>
|
||||
<td align=center id=bg1>.</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
for($i=0; $i < 12; $i++) {
|
||||
$turndate[$l4] = substr($totaldate[$l4]??'', 11, 5);
|
||||
$turndate[$l3] = substr($totaldate[$l3]??'', 11, 5);
|
||||
$turndate[$l2] = substr($totaldate[$l2]??'', 11, 5);
|
||||
$turndate[$l1] = substr($totaldate[$l1]??'', 11, 5);
|
||||
$j = $i + 1;
|
||||
$td4 = $turndate[$l4]??"-";
|
||||
$td3 = $turndate[$l3]??"-";
|
||||
$td2 = $turndate[$l2]??"-";
|
||||
$td1 = $turndate[$l1]??"-";
|
||||
$tn4 = $turn[$l4][$i]??"-";
|
||||
$tn3 = $turn[$l3][$i]??"-";
|
||||
$tn2 = $turn[$l2][$i]??"-";
|
||||
$tn1 = $turn[$l1][$i]??"-";
|
||||
echo "
|
||||
<tr>
|
||||
<td width=20 align=center id=bg0><b>$j</b></td>
|
||||
<td width=43 align=center bgcolor=black><b>$td4</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn4</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td3</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn3</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td2</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn2</td>
|
||||
<td width=43 align=center bgcolor=black><b>$td1</b></td>
|
||||
<td width=192 align=center height=24 style=table-layout:fixed; id=bg2>$tn1</td>
|
||||
<td width=20 align=center id=bg0><b>$j</b></td>
|
||||
</tr>
|
||||
";
|
||||
if($totaldate[$l4]??'') { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
|
||||
if($totaldate[$l3]??'') { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
|
||||
if($totaldate[$l2]??'') { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
|
||||
if($totaldate[$l1]??'') { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
|
||||
}
|
||||
if($k == 0) {
|
||||
echo "<form action=processing.php method=post><tr><td colspan=5 align=right>";
|
||||
echo CoreTurnTable();
|
||||
echo "</td><td colspan=5>
|
||||
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58px;font-size:13px; value='미루기▼' onclick='turn(0)'>
|
||||
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58px;font-size:13px; value='▲당기기' onclick='turn(1)'>
|
||||
<br>";
|
||||
CoreCommandTable();
|
||||
echo "<input type={$btn} style=background-color:".GameConst::$basecolor2.";color:white;width:55px;font-size:13px; value='실 행'></td></tr></form>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
<div id='container' class='tb_layout bg0' style='width:1000px;margin:auto;border:solid 1px #888888;'>
|
||||
<div class='tb_layout bg0'>사 령 부<button type='button' id='reloadTable'>갱신</button><br>
|
||||
<?=backButton()?></div>
|
||||
<div style='background-color:skyblue;text-align:center;'>수뇌부 일정</div>
|
||||
<div class="chiefSubTable" style='height:<?=22*(GameConst::$maxChiefTurn+1)?>px;'
|
||||
><div class='chiefTurnIdxPanel'
|
||||
><div class='bg1 chiefTurnIdx'>.</div
|
||||
<?php foreach(range(1, 12) as $idx):?>
|
||||
><div class='bg0 chiefTurnIdx'><?=$idx?></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
<?php foreach([12, 10, 8, 6] as $chiefIdx): ?>
|
||||
><div class='bg2 chiefPlate' style='flex-grow:1;' id='chief_<?=$chiefIdx?>'
|
||||
><div class='bg1 chiefNamePlate'><span class='chiefLevelText'>-</span> : <span class='chiefName'> </span></div
|
||||
<?php foreach(range(1, GameConst::$maxChiefTurn) as $turnIdx): ?>
|
||||
><div class='chiefTurnBox turn<?=$turnIdx?>'
|
||||
><div class='chiefTurnTime'> </div
|
||||
><div class='chiefTurnPad'><span class='chiefTurnText'> </span></div
|
||||
></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
<?php endforeach; ?>
|
||||
><div class='chiefTurnIdxPanel tail'
|
||||
><div class='bg1 chiefTurnIdx'>.</div
|
||||
<?php foreach(range(1, GameConst::$maxChiefTurn) as $idx):?>
|
||||
><div class='bg0 chiefTurnIdx'><?=$idx?></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
></div
|
||||
><div id='controlPlate' style='display:flex;flex-flow:row wrap;justify-content:center;'
|
||||
><div style='width:400px;text-align:right;'
|
||||
><?=chiefTurnTable()
|
||||
?></div
|
||||
><div style='width:400px;display: flex;justify-content: center;flex-direction: column;'
|
||||
><div
|
||||
><input type='button' id='turnPush' style='visibility:hidden;background-color:<?=GameConst::$basecolor2?>;color:white;font-size:13px;' value='미루기▼'
|
||||
><input type='button' id='turnPull' style='visibility:hidden;background-color:<?=GameConst::$basecolor2?>;color:white;font-size:13px;' value='▲당기기'
|
||||
></div
|
||||
><div
|
||||
><?=chiefCommandTable($generalObj)
|
||||
?><input type='button' id='setCommand' style='visibility:hidden;background-color:<?=GameConst::$basecolor2?>;color:white;font-size:13px;' value='실 행'
|
||||
></div
|
||||
></div
|
||||
></div
|
||||
><div class="chiefSubTable" style='height:<?=22*(GameConst::$maxChiefTurn+1)?>px;'
|
||||
><div class='chiefTurnIdxPanel'
|
||||
><div class='bg1 chiefTurnIdx'>.</div
|
||||
<?php foreach(range(1, GameConst::$maxChiefTurn) as $idx):?>
|
||||
><div class='bg0 chiefTurnIdx'><?=$idx?></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
<?php foreach([11, 9, 7, 5] as $chiefIdx): ?>
|
||||
><div class='bg2 chiefPlate' style='flex-grow:1;' id='chief_<?=$chiefIdx?>'
|
||||
><div class='bg1 chiefNamePlate'><span class='chiefLevelText'>-</span> : <span class='chiefName'> </span></div
|
||||
<?php foreach(range(1, GameConst::$maxChiefTurn) as $turnIdx): ?>
|
||||
><div class='chiefTurnBox turn<?=$turnIdx?>'
|
||||
><div class='chiefTurnTime'> </div
|
||||
><div class='chiefTurnPad'><span class='chiefTurnText'> </span></div
|
||||
></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
<?php endforeach; ?>
|
||||
><div class='chiefTurnIdxPanel tail'
|
||||
><div class='bg1 chiefTurnIdx'>.</div
|
||||
<?php foreach(range(1, 12) as $idx):?>
|
||||
><div class='bg0 chiefTurnIdx'><?=$idx?></div
|
||||
<?php endforeach; ?>
|
||||
></div
|
||||
></div
|
||||
><div
|
||||
><?=backButton()
|
||||
?><?=banner()
|
||||
?></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+76
-52
@@ -133,13 +133,6 @@ if($myNation['level'] > 0) {
|
||||
if($rawSpy == ''){
|
||||
$spyCities = [];
|
||||
}
|
||||
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
|
||||
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
|
||||
$spyCities = array_map(function($val){
|
||||
$val = intval($val);
|
||||
return intdiv($val, 10);
|
||||
}, 'intval',explode('|', $myNation['spy']));
|
||||
}
|
||||
else{
|
||||
$spyCities = array_keys(Json::decode($rawSpy));
|
||||
}
|
||||
@@ -179,19 +172,48 @@ 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']);
|
||||
//태수, 군사, 종사
|
||||
$officer = [
|
||||
4=>['name'=>'-', 'npc'=>0],
|
||||
3=>['name'=>'-', 'npc'=>0],
|
||||
2=>['name'=>'-', 'npc'=>0]
|
||||
];
|
||||
$officerQuery = [];
|
||||
if($city['officer4']){ $officerQuery[] = $city['officer4']; }
|
||||
if($city['officer3']){ $officerQuery[] = $city['officer3']; }
|
||||
if($city['officer2']){ $officerQuery[] = $city['officer2']; }
|
||||
if($officerQuery){
|
||||
foreach($db->query('SELECT `name`, npc, `level` FROM general WHERE `no` IN %li', $city['officer4']) as $officerInfo){
|
||||
$officer[$officerInfo['level']] = $officerInfo;
|
||||
}
|
||||
}
|
||||
|
||||
if($city['trade'] == 0) {
|
||||
if($city['trade'] === null) {
|
||||
$city['trade'] = "- ";
|
||||
}
|
||||
|
||||
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
||||
$query = "select npc,defence_train,no,picture,imgsvr,name,injury,leadership,strength,intel,level,nation,crewtype,crew,train,atmos from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
|
||||
$generals = $db->query(
|
||||
'SELECT npc,defence_train,no,picture,imgsvr,name,injury,leadership,strength,intel,level,nation,crewtype,crew,train,atmos from general where city=%i order by name',
|
||||
$city['city']
|
||||
);
|
||||
|
||||
$generalTurnList = [];
|
||||
|
||||
foreach($db->queryAllLists(
|
||||
'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC',
|
||||
array_column($generals, 'no')
|
||||
) as [$generalID, $turnIdx, $brief]
|
||||
){
|
||||
if(!key_exists($generalID, $generalTurnList)){
|
||||
$generalTurnList[$generalID] = [];
|
||||
}
|
||||
$generalTurnList[$generalID][$turnIdx] = $brief;
|
||||
}
|
||||
|
||||
$nationname = [];
|
||||
$nationlevel = [];
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
@@ -226,16 +248,16 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$name = $general['name'];
|
||||
$nameText = formatName($name, $general['npc']);
|
||||
|
||||
$leadership = $general['leader'];
|
||||
$power = $general['power'];
|
||||
$leadership = $general['leadership'];
|
||||
$strength = $general['strength'];
|
||||
$intel = $general['intel'];
|
||||
|
||||
$leadershipText = formatWounded($leadership, $general['injury']);
|
||||
$powerText = formatWounded($power, $general['injury']);
|
||||
$strengthText = formatWounded($strength, $general['injury']);
|
||||
$intelText = formatWounded($intel, $general['injury']);
|
||||
|
||||
$level = $general['level'];
|
||||
$levelText = getLevel($general['level']);
|
||||
$levelText = getLevelText($general['level']);
|
||||
|
||||
if($general['level'] == 12) {
|
||||
$leadershipBonus = $nationInfo['level'] * 2;
|
||||
@@ -247,8 +269,8 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$leadershipBonusText = formatLeadershipBonus($leadershipBonus);
|
||||
|
||||
if($ourGeneral){
|
||||
$defenceMode = $general['mode'];
|
||||
$defenceModeText = formatDefenceMode($defenceMode);
|
||||
$defenceTrain = $general['defence_train'];
|
||||
$defenceTrainText = formatDefenceTrain($defenceTrain);
|
||||
$crewType = $general['crewtype'];
|
||||
$crewTypeText = GameUnitConst::byId($crewType)->name;
|
||||
$crew = $general['crew'];
|
||||
@@ -256,8 +278,8 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$atmos = $general['atmos'];
|
||||
}
|
||||
else{
|
||||
$defenceMode = 0;
|
||||
$defenceModeText = '';
|
||||
$defenceTrain = 0;
|
||||
$defenceTrainText = '';
|
||||
$crewType = 0;
|
||||
$crewTypeText = '';
|
||||
$crew = $general['crew'];
|
||||
@@ -270,7 +292,8 @@ for($j=0; $j < $gencount; $j++) {
|
||||
|
||||
if($ourGeneral && !$isNPC){
|
||||
$turnText = [];
|
||||
foreach(getTurn($general, 1) as $turnRawIdx=>$turn){
|
||||
$generalObj = new General($general, null, null, null, false);
|
||||
foreach($generalTurnList[$generalObj->getID()] as $turnRawIdx=>$turn){
|
||||
$turnIdx = $turnRawIdx+1;
|
||||
$turnText[] = "{$turnIdx} : $turn";
|
||||
}
|
||||
@@ -282,6 +305,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
|
||||
$generalsFormat[] = [
|
||||
'ourGeneral'=>$ourGeneral,
|
||||
'iconPath'=>GetImageURL($general['imgsvr']).'/'.$general['picture'],
|
||||
'isNPC'=>$isNPC,
|
||||
'wounded'=>$wounded,
|
||||
'name'=>$name,
|
||||
@@ -292,12 +316,12 @@ for($j=0; $j < $gencount; $j++) {
|
||||
'leadershipBonusText'=>$leadershipBonusText,
|
||||
'level'=>$level,
|
||||
'levelText'=>$levelText,
|
||||
'power'=>$power,
|
||||
'powerText'=>$powerText,
|
||||
'strength'=>$strength,
|
||||
'strengthText'=>$strengthText,
|
||||
'intel'=>$intel,
|
||||
'intelText'=>$intelText,
|
||||
'defenceMode'=>$defenceMode,
|
||||
'defenceModeText'=>$defenceModeText,
|
||||
'defenceTrain'=>$defenceTrain,
|
||||
'defenceTrainText'=>$defenceTrainText,
|
||||
'crewType'=>$crewType,
|
||||
'crewTypeText'=>$crewTypeText,
|
||||
'crew'=>$crew,
|
||||
@@ -350,33 +374,33 @@ foreach($generalsFormat as $general){
|
||||
}
|
||||
$armedGenTotal += 1;
|
||||
|
||||
if($general['train'] >= 90 && $general['atmos'] >= 90){
|
||||
$minTrain = min($general['train'], $general['atmos']);
|
||||
|
||||
if($minTrain >= 90){
|
||||
$crew90 += $general['crew'];
|
||||
$gen90 += 1;
|
||||
}
|
||||
|
||||
$chkDef = false;
|
||||
if($general['train'] >= 80 && $general['atmos'] >= 80){
|
||||
|
||||
if($minTrain >= 80){
|
||||
$crew80 += $general['crew'];
|
||||
$gen80 += 1;
|
||||
if($general['defenceMode'] == 2){
|
||||
$crewDef += $general['crew'];
|
||||
$genDef += 1;
|
||||
$chkDef = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($general['train'] >= 60 && $general['atmos'] >= 60){
|
||||
if($minTrain >= 60){
|
||||
$crew60 += $general['crew'];
|
||||
$gen60 += 1;
|
||||
|
||||
if($general['defenceMode'] == 1 && !$chkDef){
|
||||
$crewDef += $general['crew'];
|
||||
$genDef += 1;
|
||||
$chkDef = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($minTrain >= $general['defenceTrain']){
|
||||
$crewDef += $general['crew'];
|
||||
$genDef += 1;
|
||||
$chkDef = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -392,31 +416,31 @@ foreach($generalsFormat as $general){
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=48 class=bg1>주민</td>
|
||||
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
|
||||
<td align=center width=112><?=$city['pop']?>/<?=$city['pop_max']?></td>
|
||||
<td align=center width=48 class=bg1>농업</td>
|
||||
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
|
||||
<td align=center width=108><?=$city['agri']?>/<?=$city['agri_max']?></td>
|
||||
<td align=center width=48 class=bg1>상업</td>
|
||||
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
|
||||
<td align=center width=108><?=$city['comm']?>/<?=$city['comm_max']?></td>
|
||||
<td align=center width=48 class=bg1>치안</td>
|
||||
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
|
||||
<td align=center width=108><?=$city['secu']?>/<?=$city['secu_max']?></td>
|
||||
<td align=center width=48 class=bg1>수비</td>
|
||||
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
|
||||
<td align=center width=108><?=$city['def']?>/<?=$city['def_max']?></td>
|
||||
<td align=center width=48 class=bg1>성벽</td>
|
||||
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||
<td align=center width=108><?=$city['wall']?>/<?=$city['wall_max']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>민심</td>
|
||||
<td align=center><?=$city['rate']?></td>
|
||||
<td align=center><?=round($city['trust'], 1)?></td>
|
||||
<td align=center class=bg1>시세</td>
|
||||
<td align=center><?=$city['trade']?>%</td>
|
||||
<td align=center class=bg1>인구</td>
|
||||
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
||||
<td align=center><?=round($city['pop']/$city['pop_max']*100, 2)?>%</td>
|
||||
<td align=center class=bg1>태수</td>
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center><?=$officer[4]['name']?></td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
<td align=center><?=$officer[3]['name']?></td>
|
||||
<td align=center class=bg1>종사</td>
|
||||
<td align=center><?=$officer[2]['name']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center class=bg1>도시명</td>
|
||||
|
||||
+83
-140
@@ -13,9 +13,10 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("내무부", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, con, turntime, belong FROM general WHERE owner=%i', $userID);
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, con, turntime, belong, permission, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$nation = $db->queryFirstRow('SELECT secretlimit, msg, scoutmsg FROM nation WHERE nation = %i', $me['nation']);
|
||||
$nationID = $me['nation'];
|
||||
$nation = $db->queryFirstRow('SELECT nation,level,name,color,type,gold,rice,bill,rate,scout,war,secretlimit,msg,scoutmsg,capital FROM nation WHERE nation = %i', $nationID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -23,9 +24,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) {
|
||||
@@ -45,7 +51,7 @@ 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>
|
||||
@@ -80,155 +86,92 @@ var scoutmsg = <?=Json::encode($nation['scoutmsg']??'')?>;
|
||||
<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']);
|
||||
|
||||
$query = "select nation,name,color,power,gennum from nation order by power desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
for ($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$cityCntList = Util::convertPairArrayToDict($db->queryAllLists('SELECT nation, count(city) FROM city GROUP BY nation'));
|
||||
$dipStateList = Util::convertArrayToDict($db->query('SELECT you,state,term FROM diplomacy WHERE me = %i', $nationID), 'you');
|
||||
|
||||
// 아국표시
|
||||
if ($nation['nation'] == $me['nation']) {
|
||||
//속령수
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$citycount = MYDB_num_rows($result2);
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</td>
|
||||
<td align=center>{$nation['power']}</td>
|
||||
<td align=center>{$nation['gennum']}</td>
|
||||
<td align=center>$citycount</td>
|
||||
<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']}'";
|
||||
$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);
|
||||
foreach(getAllNationStaticInfo() as $staticNation):
|
||||
//속령수
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$citycount = MYDB_num_rows($result2);
|
||||
switch ($dip['state']) {
|
||||
case 0: $state = "<font color=red>교 전</font>"; break;
|
||||
case 1: $state = "<font color=magenta>선포중</font>"; break;
|
||||
case 2: $state = "통 상"; break;
|
||||
case 3: $state = "<font color=cyan>통합수락중</font>"; break;
|
||||
case 4: $state = "<font color=cyan>통합제의중</font>"; break;
|
||||
case 5: $state = "<font color=cyan>합병수락중</font>"; break;
|
||||
case 6: $state = "<font color=cyan>합병제의중</font>"; break;
|
||||
case 7: $state = "<font color=green>불가침</font>"; break;
|
||||
}
|
||||
$staticNationID = $staticNation['nation'];
|
||||
$cityCnt = $cityCntList[$staticNation['nation']];
|
||||
|
||||
$term = $admin['year'] * 12 + $admin['month'] + $dip['term'];
|
||||
$year = intdiv($term, 12);
|
||||
$month = $term % 12;
|
||||
$dipStateText = '-';
|
||||
$dipTermText = '-';
|
||||
$dipEndDateText = '-';
|
||||
if($staticNationID !== $nationID){
|
||||
$diplomacyState = $dipStateList[$staticNationID];
|
||||
|
||||
if ($month == 0) {
|
||||
$month = 12;
|
||||
$year--;
|
||||
}
|
||||
$dipStateText = [
|
||||
0 => "<font color=red>교 전</font>",
|
||||
1 => "<font color=magenta>선포중</font>",
|
||||
2 => "통 상",
|
||||
3 => "<font color=cyan>통합수락중</font>",
|
||||
4 => "<font color=cyan>통합제의중</font>",
|
||||
5 => "<font color=cyan>합병수락중</font>",
|
||||
6 => "<font color=cyan>합병제의중</font>",
|
||||
7 => "<font color=green>불가침</font>",
|
||||
][$diplomacyState['state']];
|
||||
|
||||
$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($diplomacyState['term']){
|
||||
$dipEndMonth = $admin['month'] + $diplomacyState['term'] - 1;
|
||||
$dipEndYear = $admin['year'] + intdiv($dipEndMonth, 12);
|
||||
$dipEndMonth = $dipEndMonth % 12 + 1;
|
||||
|
||||
$dipTermText = $diplomacyState['term'].'개월';
|
||||
$dipEndDateText = "{$dipEndYear}年 {$dipEndMonth}月";
|
||||
}
|
||||
}
|
||||
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>
|
||||
<td align=center style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</td>
|
||||
<td align=center>{$nation['power']}</td>
|
||||
<td align=center>{$nation['gennum']}</td>
|
||||
<td align=center>$citycount</td>
|
||||
<td align=center>$state</td>";
|
||||
if ($dip['term'] != 0) {
|
||||
echo"
|
||||
<td align=center>{$dip['term']} 개월</td>
|
||||
<td align=center>{$year}年 {$month}月</td>";
|
||||
} else {
|
||||
echo"
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>";
|
||||
}
|
||||
echo "
|
||||
<td align=left style=font-size:7px;>{$note}</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
<tr>
|
||||
<td class='center' style='color:<?=newColor($staticNation['color'])?>;background-color:<?=$staticNation['color']?>'><?=$staticNation['name']?></td>
|
||||
<td class='center'><?=$staticNation['power']?></td>
|
||||
<td class='center'><?=$staticNation['gennum']?></td>
|
||||
<td class='center'><?=$cityCnt?></td>
|
||||
<td class='center'><?=$dipStateText?></td>
|
||||
<td class='center'><?=$dipTermText?></td>
|
||||
<td class='center'><?=$dipEndDateText?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
";
|
||||
|
||||
$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);
|
||||
<?php
|
||||
// 수입 연산
|
||||
$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID);
|
||||
$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID);
|
||||
|
||||
$admin = $gameStor->getValues(['gold_rate','rice_rate']);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
$goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$warIncome = getWarGoldIncome($nation['type'], $cityList);
|
||||
$totalGoldIncome = $goldIncome + $warIncome;
|
||||
|
||||
$goldincomeList = getGoldIncome($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
|
||||
$goldoutcome = getGoldOutcome($nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$riceincome = $riceincomeList[0] + $riceincomeList[1];
|
||||
$riceoutcome = getRiceOutcome($nation['nation'], $nation['bill']);
|
||||
$riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$totalRiceIncome = $riceIncome + $wallIncome;
|
||||
|
||||
$outcome = getOutcome($nation['bill'], $dedicationList);
|
||||
|
||||
$budgetgold = $nation['gold'] + $totalGoldIncome - $outcome;
|
||||
$budgetrice = $nation['rice'] + $totalRiceIncome - $outcome;
|
||||
$budgetgolddiff = $totalGoldIncome - $outcome;
|
||||
$budgetricediff = $totalRiceIncome - $outcome;
|
||||
|
||||
$budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
|
||||
$budgetrice = $nation['rice'] + $riceincome - $riceoutcome;
|
||||
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
|
||||
$budgetricediff = $riceincome - $riceoutcome;
|
||||
if ($budgetgolddiff > 0) {
|
||||
$budgetgolddiff = "+{$budgetgolddiff}";
|
||||
$budgetgolddiff = '+'.number_format($budgetgolddiff);
|
||||
} else {
|
||||
$budgetgolddiff = "$budgetgolddiff";
|
||||
$budgetgolddiff = number_format($budgetgolddiff);
|
||||
}
|
||||
if ($budgetricediff > 0) {
|
||||
$budgetricediff = "+{$budgetricediff}";
|
||||
$budgetricediff = '+'.number_format($budgetricediff);
|
||||
} else {
|
||||
$budgetricediff = "$budgetricediff";
|
||||
$budgetricediff = number_format($budgetricediff);
|
||||
}
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<table width=1000 class='tb_layout bg0' style='margin:auto;'>
|
||||
<form name=form1 method=post action=c_dipcenter.php>
|
||||
<tr><td colspan=2 height=10></td></tr>
|
||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메시지</td></tr>
|
||||
@@ -271,39 +214,39 @@ if ($budgetricediff > 0) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=248 align=right class=bg1>현 재 </td>
|
||||
<td width=248 align=center><?=$nation['gold']?></td>
|
||||
<td width=248 align=center><?=number_format($nation['gold'])?></td>
|
||||
<td width=248 align=right class=bg1>현 재 </td>
|
||||
<td width=248 align=center><?=$nation['rice']?></td>
|
||||
<td width=248 align=center><?=number_format($nation['rice'])?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>단기수입 </td>
|
||||
<td align=center>+<?=$deadIncome?></td>
|
||||
<td align=center>+<?=number_format($warIncome)?></td>
|
||||
<td align=right class=bg1>둔전수입 </td>
|
||||
<td align=center>+<?=$riceincomeList[1]?></td>
|
||||
<td align=center>+<?=number_format($wallIncome)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>세 금 </td>
|
||||
<td align=center>+<?=$goldincomeList[0]?></td>
|
||||
<td align=center>+<?=number_format($goldIncome)?></td>
|
||||
<td align=right class=bg1>세 곡 </td>
|
||||
<td align=center>+<?=$riceincomeList[0]?></td>
|
||||
<td align=center>+<?=number_format($riceIncome)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>수입 / 지출 </td>
|
||||
<td align=center>+<?=$goldincome?> / -<?=$goldoutcome?></td>
|
||||
<td align=center>+<?=number_format($totalGoldIncome)?> / -<?=number_format($outcome)?></td>
|
||||
<td align=right class=bg1>수입 / 지출 </td>
|
||||
<td align=center>+<?=$riceincome?> / -<?=$riceoutcome?></td>
|
||||
<td align=center>+<?=number_format($totalRiceIncome)?> / -<?=number_format($outcome)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>국고 예산 </td>
|
||||
<td align=center><?=$budgetgold?> (<?=$budgetgolddiff?>)</td>
|
||||
<td align=center><?=number_format($budgetgold)?> (<?=$budgetgolddiff?>)</td>
|
||||
<td align=right class=bg1>병량 예산 </td>
|
||||
<td align=center><?=$budgetrice?> (<?=$budgetricediff?>)</td>
|
||||
<td align=center><?=number_format($budgetrice)?> (<?=$budgetricediff?>)</td>
|
||||
</tr>
|
||||
<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
-3
@@ -32,9 +32,7 @@ $cityStr = "";
|
||||
for($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
$citycount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i', $nation['nation']);
|
||||
|
||||
|
||||
$nationnum[] = $nation['nation'];
|
||||
|
||||
+45
-48
@@ -19,13 +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']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
$nationLevel = $db->queryFirstField('SELECT level FROM nation WHERE nation=%i', $me['nation']);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -33,16 +31,20 @@ 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 = [];
|
||||
$sel[$type] = "selected";
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -81,7 +83,7 @@ $templates = new \League\Plates\Engine('templates');
|
||||
</table>
|
||||
<?php
|
||||
$troopName = [];
|
||||
foreach($db->queryAllLists('SELECT troop, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]){
|
||||
foreach($db->queryAllLists('SELECT troop_leader, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]){
|
||||
$troopName[$troopID] = $tName;
|
||||
}
|
||||
|
||||
@@ -94,10 +96,27 @@ switch ($type) {
|
||||
case 5: $orderSQL = "order by crew desc"; break;
|
||||
case 6: $orderSQL = "order by killturn"; break;
|
||||
case 7: $orderSQL = "order by turntime"; break;
|
||||
case 8: $orderSQL = "order by troop desc"; break;
|
||||
case 8: $orderSQL = "order by troop_leader desc"; break;
|
||||
}
|
||||
|
||||
$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);
|
||||
$generals = $db->query(
|
||||
'SELECT npc,defence_train,no,level,troop,city,injury,leadership,strength,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,nation from general WHERE nation = %i %l',
|
||||
$me['nation'],
|
||||
$orderSQL
|
||||
);
|
||||
|
||||
$generalTurnList = [];
|
||||
|
||||
foreach($db->queryAllLists(
|
||||
'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC',
|
||||
array_column($generals, 'no')
|
||||
) as [$generalID, $turnIdx, $brief]
|
||||
){
|
||||
if(!key_exists($generalID, $generalTurnList)){
|
||||
$generalTurnList[$generalID] = [];
|
||||
}
|
||||
$generalTurnList[$generalID][$turnIdx] = $brief;
|
||||
}
|
||||
|
||||
$genCntEff = 0;
|
||||
foreach ($generals as &$general) {
|
||||
@@ -108,13 +127,7 @@ foreach ($generals as &$general) {
|
||||
$genCntEff += 1;
|
||||
}
|
||||
|
||||
if ($general['level'] == 12) {
|
||||
$lbonus = $nation['level'] * 2;
|
||||
} elseif ($general['level'] >= 5) {
|
||||
$lbonus = $nation['level'];
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
}
|
||||
$lbonus = calcLeadershipBonus($general['level'], $nationLevel);
|
||||
if ($lbonus > 0) {
|
||||
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
@@ -124,51 +137,35 @@ foreach ($generals as &$general) {
|
||||
$general['lbonusText'] = $lbonusText;
|
||||
|
||||
if ($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100);
|
||||
$strength = intdiv($general['strength'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$leadership = "<font color=red>{$leadership}</font>{$lbonusText}";
|
||||
$strength = "<font color=red>{$strength}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonusText}";
|
||||
$power = "{$general['power']}";
|
||||
$leadership = "{$general['leadership']}{$lbonusText}";
|
||||
$strength = "{$general['strength']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
|
||||
$general['leaderText'] = $leader;
|
||||
$general['powerText'] = $power;
|
||||
$general['leadershipText'] = $leadership;
|
||||
$general['strengthText'] = $strength;
|
||||
$general['intelText'] = $intel;
|
||||
|
||||
$general['expLevelText'] = getExpLevel($general['experience']);
|
||||
|
||||
if ($general['npc'] >= 2) {
|
||||
$name = "<font color=cyan>{$general['name']}</font>";
|
||||
} elseif ($general['npc'] == 1) {
|
||||
$name = "<font color=skyblue>{$general['name']}</font>";
|
||||
} else {
|
||||
$name = $general['name'];
|
||||
}
|
||||
//TODO: npc 코드를 일원화
|
||||
$general['nameText'] = $name;
|
||||
$general['nameText'] = getColoredName($general['name'], $general['npc']);
|
||||
|
||||
switch ($general['mode']) {
|
||||
case 0: $mode = "×"; break;
|
||||
case 1: $mode = "○"; break;
|
||||
case 2: $mode = "◎"; break;
|
||||
}
|
||||
$general['modeText'] = $mode;
|
||||
$general['modeText'] = formatDefenceTrain($general['defence_train']);
|
||||
$general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name??'-';
|
||||
|
||||
|
||||
if ($general['npc'] < 2) {
|
||||
$turntext = [];
|
||||
$turn = getTurn($general, 1, 0);
|
||||
|
||||
for ($i=0; $i < 5; $i++) {
|
||||
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 41);
|
||||
$k = $i+1;
|
||||
$turntext[] = " $k : $turn[$i]";
|
||||
foreach($generalTurnList[$general['no']] as $turnRawIdx=>$turn){
|
||||
$turn = StringUtil::subStringForWidth($turn, 0, 41);
|
||||
$turnIdx = $turnRawIdx+1;
|
||||
$turntext[] = " $turnIdx : $turn";
|
||||
}
|
||||
$general['turntext'] = join("<br>\n", $turntext);
|
||||
}
|
||||
|
||||
+135
-75
@@ -12,7 +12,7 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("인사부", 1);
|
||||
//훼섭 추방을 위해 갱신
|
||||
checkTurn();
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -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"; }
|
||||
@@ -71,11 +116,26 @@ for($i=12; $i >= $lv; $i--) {
|
||||
$level[$levels['level']] = $levels;
|
||||
}
|
||||
|
||||
$query = "select name,picture,killnum from general where nation='{$nation['nation']}' order by killnum desc limit 5"; // 오호장군
|
||||
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$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),"");
|
||||
$tigers = $db->query('SELECT value, name
|
||||
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
||||
WHERE rank_data.nation_id = %i AND rank_data.type = "warnum" AND value > 0 ORDER BY value DESC LIMIT 5',
|
||||
$nation['nation']
|
||||
);// 오호장군
|
||||
$tigerstr = join(', ', array_map(function($arr){
|
||||
$number = number_format($arr['value']);
|
||||
return "{$arr['name']}【{$number}】";
|
||||
}, $tigers));
|
||||
|
||||
$eagles = $db->query('SELECT value, name
|
||||
FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no
|
||||
WHERE rank_data.nation_id = %i AND rank_data.type = "firenum" AND value > 0 ORDER BY value DESC LIMIT 7',
|
||||
$nation['nation']
|
||||
);// 건안칠자
|
||||
$eaglestr = join(', ', array_map(function($arr){
|
||||
$number = number_format($arr['value']);
|
||||
return "{$arr['name']}【{$number}】";
|
||||
}, $eagles));
|
||||
|
||||
echo "
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
@@ -91,50 +151,24 @@ for($i=12; $i >= $lv; $i-=2) {
|
||||
$imageTemp2 = GetImageURL($level[$i2]['imgsvr']??0);
|
||||
?>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i1, $nation['level'])?></font></td>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevelText($i1, $nation['level'])?></font></td>
|
||||
<td width=64 class='generalIcon' height=64 style='background:no-repeat center url("<?=$imageTemp1?>/<?=$level[$i1]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||
<td width=332><font size=4><?=$level[$i1]['name']??'-'?>(<?=$level[$i1]['belong']??'-'?>년)</font></td>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i2, $nation['level'])?></font></td>
|
||||
<td width=98 align=center id=bg1><font size=4><?=getLevelText($i2, $nation['level'])?></font></td>
|
||||
<td width=64 class='generalIcon' height=64 style='background:no-repeat center url("<?=$imageTemp2?>/<?=$level[$i2]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||
<td width=332><font size=4><?=$level[$i2]['name']??'-'?>(<?=$level[$i2]['belong']??'-'?>년)</font></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>오호장군【승전】</td>
|
||||
<td colspan=5>
|
||||
";
|
||||
|
||||
$tigernum = MYDB_num_rows($tigerresult);
|
||||
for($i=0; $i < $tigernum; $i++) {
|
||||
$tiger = MYDB_fetch_array($tigerresult);
|
||||
|
||||
if($tiger['killnum'] > 0) {
|
||||
echo "{$tiger['name']}【{$tiger['killnum']}】, ";
|
||||
}
|
||||
}
|
||||
|
||||
echo "
|
||||
</td>
|
||||
?>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>오호장군【승전】</td>
|
||||
<td colspan=5><?=$tigerstr?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>건안칠자【계략】</td>
|
||||
<td colspan=5>
|
||||
";
|
||||
|
||||
$eaglenum = MYDB_num_rows($eagleresult);
|
||||
for($i=0; $i < $eaglenum; $i++) {
|
||||
$eagle = MYDB_fetch_array($eagleresult);
|
||||
|
||||
if($eagle['firenum'] > 0) {
|
||||
echo "{$eagle['name']}【{$eagle['firenum']}】, ";
|
||||
}
|
||||
}
|
||||
|
||||
echo "
|
||||
</td>
|
||||
<td colspan=5><?=$eaglestr?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
@@ -144,13 +178,13 @@ echo "
|
||||
<tr>
|
||||
<td width=498 align=right id=bg1>대상 장수</td>
|
||||
<td width=498>
|
||||
";
|
||||
<?php
|
||||
|
||||
if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
|
||||
echo "
|
||||
<select name=outlist size=1 style=color:white;background-color:black;>";
|
||||
|
||||
$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)";
|
||||
$query = "select no,npc,name,level,leadership,strength,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);
|
||||
|
||||
@@ -160,7 +194,7 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
|
||||
continue;
|
||||
}
|
||||
echo "
|
||||
<option value={$general['no']}>{$general['name']} <small>({$general['leader']}/{$general['power']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||
<option value={$general['no']}>{$general['name']} <small>({$general['leadership']}/{$general['strength']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||
}
|
||||
|
||||
echo "
|
||||
@@ -180,9 +214,9 @@ echo "
|
||||
<tr><td colspan=4 height=5></td></tr>
|
||||
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
|
||||
<tr>
|
||||
<td width=98 align=right id=bg1>".getLevel(12, $nation['level'])."</td>
|
||||
<td width=98 align=right id=bg1>".getLevelText(12, $nation['level'])."</td>
|
||||
<td width=398>{$general['name']} 【".CityConst::byID($general['city'])->name."】</td>
|
||||
<td width=98 align=right id=bg1>".getLevel(11, $nation['level'])."</td>
|
||||
<td width=98 align=right id=bg1>".getLevelText(11, $nation['level'])."</td>
|
||||
<form method=post action=c_myBossInfo.php>
|
||||
<td width=398>
|
||||
";
|
||||
@@ -226,17 +260,17 @@ echo "
|
||||
";
|
||||
|
||||
$queries = [];
|
||||
$queries[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[9] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[7] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[5] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
|
||||
for($i=10; $i >= $lv; $i--) {
|
||||
if($i % 2 == 0) { echo "<tr>"; }
|
||||
echo "
|
||||
<td width=98 align=right id=bg1>".getLevel($i, $nation['level'])."</td>
|
||||
<td width=98 align=right id=bg1>".getLevelText($i, $nation['level'])."</td>
|
||||
<form method=post action=c_myBossInfo.php>
|
||||
<td width=398>
|
||||
";
|
||||
@@ -279,9 +313,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>
|
||||
@@ -292,7 +352,7 @@ if($meLevel >= 5) {
|
||||
<select name=citylist size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and gen1set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and officer4set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
@@ -318,7 +378,7 @@ if($meLevel >= 5) {
|
||||
<option value=0>____공석____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$query = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
@@ -346,7 +406,7 @@ if($meLevel >= 5) {
|
||||
<select name=citylist size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and gen2set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and officer3set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
@@ -395,12 +455,12 @@ 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;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and gen3set=0 order by region, level desc,binary(name)"; // 도시 이름 목록
|
||||
$query = "select city,name,region from city where nation='{$nation['nation']}' and officer2set=0 order by region, level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
@@ -455,13 +515,13 @@ 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>
|
||||
";
|
||||
|
||||
$citylevel = getCityLevelList();
|
||||
|
||||
$query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='{$nation['nation']}' order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$query = "select city,name,officer4,officer3,officer2,level,region,officer4set,officer3set,officer2set from city where nation='{$nation['nation']}' order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
@@ -469,15 +529,15 @@ $region = 0;
|
||||
for($j=0; $j < $citycount; $j++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
|
||||
$query = "select name,belong,city from general where no='{$city['gen1']}'";
|
||||
$query = "select name,belong,city from general where no='{$city['officer4']}'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen1 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,belong,city from general where no='{$city['gen2']}'";
|
||||
$officer4 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,belong,city from general where no='{$city['officer3']}'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen2 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,belong,city from general where no='{$city['gen3']}'";
|
||||
$officer3 = MYDB_fetch_array($genresult);
|
||||
$query = "select name,belong,city from general where no='{$city['officer2']}'";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen3 = MYDB_fetch_array($genresult);
|
||||
$officer2 = MYDB_fetch_array($genresult);
|
||||
|
||||
if($region != $city['region']) {
|
||||
echo "
|
||||
@@ -486,19 +546,19 @@ for($j=0; $j < $citycount; $j++) {
|
||||
$region = $city['region'];
|
||||
}
|
||||
|
||||
$gen1['name'] = $gen1['name']==""?"-":$gen1['name']." ({$gen1['belong']}년) 【".CityConst::byID($gen1['city'])->name."】";
|
||||
$gen2['name'] = $gen2['name']==""?"-":$gen2['name']." ({$gen2['belong']}년) 【".CityConst::byID($gen2['city'])->name."】";
|
||||
$gen3['name'] = $gen3['name']==""?"-":$gen3['name']." ({$gen3['belong']}년) 【".CityConst::byID($gen3['city'])->name."】";
|
||||
if($city['gen1set'] == 1) { $gen1['name'] = "<font color=orange>".$gen1['name']."</font>"; }
|
||||
if($city['gen2set'] == 1) { $gen2['name'] = "<font color=orange>".$gen2['name']."</font>"; }
|
||||
if($city['gen3set'] == 1) { $gen3['name'] = "<font color=orange>".$gen3['name']."</font>"; }
|
||||
$officer4['name'] = $officer4['name']==""?"-":$officer4['name']." ({$officer4['belong']}년) 【".CityConst::byID($officer4['city'])->name."】";
|
||||
$officer3['name'] = $officer3['name']==""?"-":$officer3['name']." ({$officer3['belong']}년) 【".CityConst::byID($officer3['city'])->name."】";
|
||||
$officer2['name'] = $officer2['name']==""?"-":$officer2['name']." ({$officer2['belong']}년) 【".CityConst::byID($officer2['city'])->name."】";
|
||||
if($city['officer4set'] == 1) { $officer4['name'] = "<font color=orange>".$officer4['name']."</font>"; }
|
||||
if($city['officer3set'] == 1) { $officer3['name'] = "<font color=orange>".$officer3['name']."</font>"; }
|
||||
if($city['officer2set'] == 1) { $officer2['name'] = "<font color=orange>".$officer2['name']."</font>"; }
|
||||
echo "
|
||||
<tr>
|
||||
<td width=78 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=3>【{$citylevel[$city['level']]}】</font></td>
|
||||
<td width=78 align=right style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=3>{$city['name']} </font></td>
|
||||
<td align=center>{$gen1['name']}</td>
|
||||
<td align=center>{$gen2['name']}</td>
|
||||
<td align=center>{$gen3['name']}</td>
|
||||
<td align=center>{$officer4['name']}</td>
|
||||
<td align=center>{$officer3['name']}</td>
|
||||
<td align=center>{$officer2['name']}</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
+35
-27
@@ -72,19 +72,16 @@ $sel = [$type => "selected"];
|
||||
</td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$nation = getNationStaticInfo($me['nation']); //국가정보
|
||||
|
||||
$query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}'";
|
||||
$query = "select *,pop/pop_max as poprate from city where nation='{$me['nation']}'";
|
||||
|
||||
switch ($type) {
|
||||
case 1: break;
|
||||
case 2: $query .= " order by pop desc"; break;
|
||||
case 3: $query .= " order by poprate desc"; break;
|
||||
case 4: $query .= " order by rate desc"; break;
|
||||
case 4: $query .= " order by trust desc"; break;
|
||||
case 5: $query .= " order by agri desc"; break;
|
||||
case 6: $query .= " order by comm desc"; break;
|
||||
case 7: $query .= " order by secu desc"; break;
|
||||
@@ -105,17 +102,28 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
if ($city['city'] == $nation['capital']) {
|
||||
$city['name'] = "<font color=cyan>[{$city['name']}]</font>";
|
||||
}
|
||||
$query = "select name from general where no='{$city['gen1']}'"; // 태수
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen1 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name from general where no='{$city['gen2']}'"; // 군사
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen2 = MYDB_fetch_array($genresult);
|
||||
$officerQuery = [];
|
||||
$officerName = [
|
||||
2=>'-',
|
||||
3=>'-',
|
||||
4=>'-'
|
||||
];
|
||||
if ($city['officer4'] > 0) {
|
||||
$officerQuery[] = $city['officer4'];
|
||||
}
|
||||
if ($city['officer3'] > 0) {
|
||||
$officerQuery[] = $city['officer3'];
|
||||
}
|
||||
if ($city['officer2'] > 0) {
|
||||
$officerQuery[] = $city['officer2'];
|
||||
}
|
||||
|
||||
$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);
|
||||
if($officerQuery){
|
||||
foreach($db->query('SELECT `level`, `name` FROM general WHERE `no` IN %li', $officerQuery) as $genOfficer){
|
||||
$officerName[$genOfficer['level']] = $genOfficer['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == 10 && $city['region'] != $region) {
|
||||
echo "<br>";
|
||||
@@ -125,7 +133,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
$level = $city['level'];
|
||||
}
|
||||
|
||||
if ($city['trade'] == 0) {
|
||||
if ($city['trade'] === null) {
|
||||
$city['trade'] = "- ";
|
||||
}
|
||||
|
||||
@@ -136,36 +144,36 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center width=46 id=bg1>주민</td>
|
||||
<td align=center width=140>{$city['pop']}/{$city['pop2']}</td>
|
||||
<td align=center width=140>{$city['pop']}/{$city['pop_max']}</td>
|
||||
<td align=center width=46 id=bg1>농업</td>
|
||||
<td align=center width=140>{$city['agri']}/{$city['agri2']}</td>
|
||||
<td align=center width=140>{$city['agri']}/{$city['agri_max']}</td>
|
||||
<td align=center width=46 id=bg1>상업</td>
|
||||
<td align=center width=140>{$city['comm']}/{$city['comm2']}</td>
|
||||
<td align=center width=140>{$city['comm']}/{$city['comm_max']}</td>
|
||||
<td align=center width=46 id=bg1>치안</td>
|
||||
<td align=center width=140>{$city['secu']}/{$city['secu2']}</td>
|
||||
<td align=center width=140>{$city['secu']}/{$city['secu_max']}</td>
|
||||
<td align=center width=46 id=bg1>수비</td>
|
||||
<td align=center width=140>{$city['def']}/{$city['def2']}</td>
|
||||
<td align=center width=140>{$city['def']}/{$city['def_max']}</td>
|
||||
<td align=center width=46 id=bg1>성벽</td>
|
||||
<td align=center width=140>{$city['wall']}/{$city['wall2']}</td>
|
||||
<td align=center width=140>{$city['wall']}/{$city['wall_max']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>민심</td>
|
||||
<td align=center>{$city['rate']}</td>
|
||||
<td align=center>".round($city['trust'], 1)."</td>
|
||||
<td align=center id=bg1>시세</td>
|
||||
<td align=center>{$city['trade']}%</td>
|
||||
<td align=center id=bg1>인구</td>
|
||||
<td align=center>".round($city['pop']/$city['pop2']*100, 2)." %</td>
|
||||
<td align=center>".round($city['pop']/$city['pop_max']*100, 2)." %</td>
|
||||
<td align=center id=bg1>태수</td>
|
||||
<td align=center>";
|
||||
echo $gen1['name']==''?"-":"{$gen1['name']}";
|
||||
echo $officerName[4];
|
||||
echo "</td>
|
||||
<td align=center id=bg1>군사</td>
|
||||
<td align=center>";
|
||||
echo $gen2['name']==''?"-":"{$gen2['name']}";
|
||||
echo $officerName[3];
|
||||
echo "</td>
|
||||
<td align=center id=bg1>시중</td>
|
||||
<td align=center id=bg1>종사</td>
|
||||
<td align=center>";
|
||||
echo $gen3['name']==''?"-":"{$gen3['name']}";
|
||||
echo $officerName[2];
|
||||
echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+46
-65
@@ -14,13 +14,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
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);
|
||||
$me = $db->queryFirstRow('SELECT no,nation,level from general where owner=%i', $userID);
|
||||
|
||||
if($me['level'] == 0) {
|
||||
echo "재야입니다.";
|
||||
@@ -29,6 +27,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>
|
||||
@@ -74,48 +80,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=>['leadership', true],
|
||||
5=>['strength', 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,leadership,strength,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'>
|
||||
@@ -136,16 +120,9 @@ 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;
|
||||
} elseif($general['level'] >= 5) {
|
||||
$lbonus = $nationLevel;
|
||||
} else {
|
||||
$lbonus = 0;
|
||||
}
|
||||
$lbonus = calcLeadershipBonus($general['level'], $nationLevel);
|
||||
if($lbonus > 0) {
|
||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
||||
} else {
|
||||
@@ -153,15 +130,15 @@ for($j=0; $j < $gencount; $j++) {
|
||||
}
|
||||
|
||||
if($general['injury'] > 0) {
|
||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||
$leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100);
|
||||
$strength = intdiv($general['strength'] * (100 - $general['injury']), 100);
|
||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
||||
$power = "<font color=red>{$power}</font>";
|
||||
$leadership = "<font color=red>{$leadership}</font>{$lbonus}";
|
||||
$strength = "<font color=red>{$strength}</font>";
|
||||
$intel = "<font color=red>{$intel}</font>";
|
||||
} else {
|
||||
$leader = "{$general['leader']}{$lbonus}";
|
||||
$power = "{$general['power']}";
|
||||
$leadership = "{$general['leadership']}{$lbonus}";
|
||||
$strength = "{$general['strength']}";
|
||||
$intel = "{$general['intel']}";
|
||||
}
|
||||
|
||||
@@ -169,22 +146,26 @@ 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>
|
||||
<td align=center class='generalIcon' style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;' height=64></td>
|
||||
<td align=center>$name</td>
|
||||
<td align=center>"; echo getLevel($general['level'], $nationLevel); echo "</td>
|
||||
<td align=center>"; echo getLevelText($general['level'], $nationLevel); echo "</td>
|
||||
<td align=center>".getDed($general['dedication'])."</td>
|
||||
<td align=center>".getHonor($general['experience'])."</td>
|
||||
<td align=center>".getBill($general['dedication'])."</td>
|
||||
<td align=center>$leader</td>
|
||||
<td align=center>$power</td>
|
||||
<td align=center>$leadership</td>
|
||||
<td align=center>$strength</td>
|
||||
<td align=center>$intel</td>
|
||||
<td align=center>{$general['gold']}</td>
|
||||
<td align=center>{$general['rice']}</td>
|
||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
|
||||
<td align=center>".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."</td>
|
||||
<td align=center>{$general['belong']}</td>
|
||||
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
|
||||
</tr>";
|
||||
|
||||
+63
-73
@@ -9,15 +9,12 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$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);
|
||||
$nationID = $db->queryFirstField('SELECT nation FROM general WHERE owner=%i', $userID);
|
||||
|
||||
if($me['level'] == 0) {
|
||||
if($nationID == 0) {
|
||||
echo "재야입니다.";
|
||||
exit();
|
||||
}
|
||||
@@ -45,121 +42,114 @@ if($me['level'] == 0) {
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$query = "select nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,history,capital 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 nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,history,capital FROM nation WHERE nation=%i', $nationID); //국가정보
|
||||
$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID);
|
||||
|
||||
$query = "select city,name,pop,pop2 from city where nation='{$nation['nation']}'"; // 도시 이름 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
$currPop = 0;
|
||||
$maxPop = 0;
|
||||
$cityNames = [];
|
||||
|
||||
$totalpop = 0;
|
||||
$maxpop = 0;
|
||||
$cityname = [];
|
||||
for($j=0; $j < $citycount; $j++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
if($city['city'] == $nation['capital']) { $cityname[$j] = "<font color=cyan>[{$city['name']}]</font>"; }
|
||||
else { $cityname[$j] = $city['name']; }
|
||||
$totalpop += $city['pop'];
|
||||
$maxpop += $city['pop2'];
|
||||
foreach($cityList as $city){
|
||||
$currPop += $city['pop'];
|
||||
$maxPop += $city['pop_max'];
|
||||
if($city['city'] == $nation['capital']){
|
||||
$cityNames[] = "<span style='color:cyan;'>{$city['name']}</span>";
|
||||
}
|
||||
else{
|
||||
$cityNames[] = $city['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$query = "select sum(crew) as totcrew,sum(leader)*100 as maxcrew from general where nation='{$nation['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
[$currCrew, $maxCrew] = $db->queryFirstList('SELECT sum(crew), sum(leadership)*100 FROM general WHERE nation=%i AND npc != 5', $nation['nation']);
|
||||
$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID);
|
||||
|
||||
$admin = $gameStor->getValues(['gold_rate','rice_rate']);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
$goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$warIncome = getWarGoldIncome($nation['type'], $cityList);
|
||||
$totalGoldIncome = $goldIncome + $warIncome;
|
||||
|
||||
$goldincomeList = getGoldIncome($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
|
||||
$goldoutcome = getGoldOutcome($nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$riceincome = $riceincomeList[0] + $riceincomeList[1];
|
||||
$riceoutcome = getRiceOutcome($nation['nation'], $nation['bill']);
|
||||
$riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList);
|
||||
$totalRiceIncome = $riceIncome + $wallIncome;
|
||||
|
||||
$outcome = getOutcome($nation['bill'], $dedicationList);
|
||||
|
||||
$budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
|
||||
$budgetrice = $nation['rice'] + $riceincome - $riceoutcome;
|
||||
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
|
||||
$budgetricediff = $riceincome - $riceoutcome;
|
||||
if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; }
|
||||
else { $budgetgolddiff = "$budgetgolddiff"; }
|
||||
if($budgetricediff > 0) { $budgetricediff = "+{$budgetricediff}"; }
|
||||
else { $budgetricediff = "$budgetricediff"; }
|
||||
$budgetgold = $nation['gold'] + $totalGoldIncome - $outcome;
|
||||
$budgetrice = $nation['rice'] + $totalRiceIncome - $outcome;
|
||||
$budgetgolddiff = $totalGoldIncome - $outcome;
|
||||
$budgetricediff = $totalRiceIncome - $outcome;
|
||||
|
||||
echo "
|
||||
if ($budgetgolddiff > 0) {
|
||||
$budgetgolddiff = '+'.number_format($budgetgolddiff);
|
||||
} else {
|
||||
$budgetgolddiff = number_format($budgetgolddiff);
|
||||
}
|
||||
if ($budgetricediff > 0) {
|
||||
$budgetricediff = '+'.number_format($budgetricediff);
|
||||
} else {
|
||||
$budgetricediff = number_format($budgetricediff);
|
||||
}
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg2'>
|
||||
<tr>
|
||||
<td colspan=8 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 ";echo $me['nation']==0?"공 백 지":"{$nation['name']}";echo " 】</td>
|
||||
<td colspan=8 align=center style='color:<?=newColor($nation['color'])?>;background-color:<?=$nation['color']?>'>【<?=$nation['name']?>】</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=98 align=center id=bg1>총주민</td>
|
||||
<td width=198 align=center>{$totalpop}/{$maxpop}</td>
|
||||
<td width=198 align=center><?=number_format($currPop)?>/<?=number_format($maxPop)?></td>
|
||||
<td width=98 align=center id=bg1>총병사</td>
|
||||
<td width=198 align=center>{$general['totcrew']}/{$general['maxcrew']}</td>
|
||||
<td width=198 align=center><?=number_format($currCrew)?>/<?=number_format($maxCrew)?></td>
|
||||
<td width=98 align=center id=bg1>국 력</td>
|
||||
<td width=298 align=center colspan=3>{$nation['power']}</td>
|
||||
<td width=298 align=center colspan=3><?=$nation['power']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>국 고</td>
|
||||
<td align=center>"; echo $nation['gold']==0?"-":"{$nation['gold']}"; echo "</td>
|
||||
<td align=center><?=number_format($nation['gold'])?></td>
|
||||
<td align=center id=bg1>병 량</td>
|
||||
<td align=center>"; echo $nation['rice']==0?"-":"{$nation['rice']}"; echo "</td>
|
||||
<td align=center><?=number_format($nation['rice'])?></td>
|
||||
<td align=center id=bg1>세 율</td>
|
||||
<td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"{$nation['rate']} %"; echo "</td>
|
||||
<td align=center colspan=3><?=$nation['rate']?> %</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>세금/단기</td>
|
||||
<td align=center>+$goldincomeList[0] / +$deadIncome</td>
|
||||
<td align=center>+<?=number_format($goldIncome)?> / +<?=number_format($warIncome)?></td>
|
||||
<td align=center id=bg1>세곡/둔전</td>
|
||||
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
|
||||
<td align=center id=bg1>지급율</td>
|
||||
<td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"{$nation['bill']} %"; echo "</td>
|
||||
<td align=center>+<?=number_format($riceIncome)?> / +<?=number_format($wallIncome)?></td>
|
||||
<td align=center id=bg1>지급률</td>
|
||||
<td align=center colspan=3><?=$nation['bill']?> %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>수입/지출</td>
|
||||
<td align=center>+$goldincome / -$goldoutcome</td>
|
||||
<td align=center>+<?=number_format($totalGoldIncome)?> / -<?=number_format($outcome)?></td>
|
||||
<td align=center id=bg1>수입/지출</td>
|
||||
<td align=center>+$riceincome / -$riceoutcome</td>
|
||||
<td align=center>+<?=number_format($totalRiceIncome)?> / -<?=number_format($outcome)?></td>
|
||||
<td align=center id=bg1>속 령</td>
|
||||
<td width=98 align=center>$citycount</td>
|
||||
<td width=98 align=center><?=count($cityList)?></td>
|
||||
<td width=98 align=center id=bg1>장 수</td>
|
||||
<td width=98 align=center>{$nation['gennum']}</td>
|
||||
<td width=98 align=center><?=$nation['gennum']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center id=bg1>국고 예산</td>
|
||||
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
|
||||
<td align=center><?=number_format($budgetgold)?> (<?=$budgetgolddiff?>)</td>
|
||||
<td align=center id=bg1>병량 예산</td>
|
||||
<td align=center>{$budgetrice} ({$budgetricediff})</td>
|
||||
<td align=center><?=number_format($budgetrice)?> (<?=$budgetricediff?>)</td>
|
||||
<td align=center id=bg1>기술력</td>
|
||||
<td align=center>{$nation['tech']}</td>
|
||||
<td align=center><?=number_format(floor($nation['tech']))?></td>
|
||||
<td align=center id=bg1>작 위</td>
|
||||
<td align=center>".getNationLevel($nation['level'])."</td>
|
||||
<td align=center><?=getNationLevel($nation['level'])?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center valign=top id=bg1> 속령일람 :</td>
|
||||
<td colspan=7>";
|
||||
for($j=0; $j < $citycount; $j++) {
|
||||
echo "$cityname[$j], ";
|
||||
}
|
||||
echo"
|
||||
</td>
|
||||
<td colspan=7><?=join(', ', $cityNames)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center valign=top id=bg1>국가열전</td>
|
||||
<td colspan=7 id=bg0>".ConvertLog($nation['history'])."</td>
|
||||
<td colspan=7 id=bg0><?=ConvertLog($nation['history'])?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>";
|
||||
|
||||
?>
|
||||
<br>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
|
||||
+69
-39
@@ -5,13 +5,19 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$mode = Util::getReq('mode', 'int', 2);
|
||||
$defence_train = Util::getReq('defence_train', 'int', 2);
|
||||
$tnmt = Util::getReq('tnmt', 'int', 1);
|
||||
//$detachNPC = Util::getReq('detachNPC', 'bool');
|
||||
$detachNPC = false;
|
||||
|
||||
if($mode < 0 || $mode > 2){
|
||||
$mode = 2;
|
||||
if ($defence_train <= 60) {
|
||||
$defence_train = 60;
|
||||
}
|
||||
else if($defence_train <= 80){
|
||||
$defence_train = 80;
|
||||
}
|
||||
else{
|
||||
$defence_train = 999;
|
||||
}
|
||||
|
||||
if($tnmt < 0 || $tnmt > 1){
|
||||
@@ -21,43 +27,48 @@ if($tnmt < 0 || $tnmt > 1){
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
$generalID = $session->generalID;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("내정보", 1);
|
||||
|
||||
$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = General::createGeneralObjFromDB($generalID);
|
||||
|
||||
|
||||
if ($me['myset'] > 0) {
|
||||
$myset = $me->getVar('myset');
|
||||
if ($myset > 0) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
if ($me['myset'] > 1) {
|
||||
if (($btn == "설정저장" || $detachNPC) && $myset > 0) {
|
||||
if ($myset > 1) {
|
||||
$submit = 'submit';
|
||||
} else {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
$me['myset'] -= 1;
|
||||
if($defence_train != $me->getVar('defence_train')){
|
||||
if($defence_train == 999){
|
||||
$me->increaseVar('myset', -1);
|
||||
$me->setVar('defence_train', $defence_train);
|
||||
$me->increaseVar('train', -3);
|
||||
$me->increaseVar('atmos', -3);
|
||||
}
|
||||
else{
|
||||
$me->increaseVar('myset', -1);
|
||||
$me->setVar('defence_train', $defence_train);
|
||||
}
|
||||
$myset -= 1;
|
||||
}
|
||||
|
||||
if($me->getVar('tnmt') != $tnmt){
|
||||
$me->setVar('tnmt', $tnmt);
|
||||
}
|
||||
|
||||
$db->update('general', [
|
||||
'myset'=>$db->sqleval('myset-1'),
|
||||
'mode'=>$mode,
|
||||
'tnmt'=>$tnmt
|
||||
], 'owner=%i', $userID);
|
||||
|
||||
$me['mode'] = $mode;
|
||||
$me['tnmt'] = $tnmt;
|
||||
|
||||
if($me['npc'] == 1 && $detachNPC){
|
||||
if($me->getVar('npc') == 1 && $detachNPC){
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
if($turnterm < 10){
|
||||
@@ -66,13 +77,10 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
else{
|
||||
$targetKillTurn = 60 / $turnterm;
|
||||
}
|
||||
$db->update('general', [
|
||||
'killturn'=>$targetKillTurn
|
||||
], 'owner=%i AND npc=1', $userID);
|
||||
|
||||
$me['killturn']=$targetKillTurn;
|
||||
$me->setVar('killturn', $targetKillTurn);
|
||||
}
|
||||
}
|
||||
$me->applyDB($db);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -89,7 +97,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>
|
||||
@@ -99,28 +121,36 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=50%>
|
||||
<?php myInfo(); ?>
|
||||
<?php myInfo2(); ?>
|
||||
<?php generalInfo($me); ?>
|
||||
<?php generalInfo2($me); ?>
|
||||
</td>
|
||||
<td width=50% valign=top style="padding-left:4ch;">
|
||||
<form name=form1 action=b_myPage.php method=post>
|
||||
토너먼트 【
|
||||
<input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
|
||||
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
|
||||
<input type=radio name=tnmt value=0 <?=$me->getVar('tnmt')==0?"checked":""; ?>>수동참여
|
||||
<input type=radio name=tnmt value=1 <?=$me->getVar('tnmt')==1?"checked":""; ?>>자동참여
|
||||
】<br>
|
||||
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
|
||||
수비 【
|
||||
<input type=radio name=mode value=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
|
||||
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
|
||||
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
|
||||
<input type=radio name=defence_train value=80 <?=$me->getVar('defence_train')==80?"checked":""; ?>>◎(훈사80)
|
||||
<input type=radio name=defence_train value=60 <?=$me->getVar('defence_train')==60?"checked":""; ?>>○(훈사60)
|
||||
<input type=radio name=defence_train value=999 <?=$me->getVar('defence_train')==999?"checked":""; ?>>×
|
||||
】<br><br>
|
||||
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
|
||||
∞<font color=orange>설정저장은 이달중 <?=$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>
|
||||
@@ -131,10 +161,10 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?=getGenLogRecent($me['no'], 24)?>
|
||||
<?=getGenLogRecent($generalID, 24)?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<?=getBatLogRecent($me['no'], 24)?>
|
||||
<?=getBatLogRecent($generalID, 24)?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -143,10 +173,10 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?=getGeneralHistoryAll($me['no'])?>
|
||||
<?=getGeneralHistoryAll($generalID)?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<?=getBatResRecent($me['no'], 24)?>
|
||||
<?=getBatResRecent($generalID, 24)?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
$commandType = Util::getReq('command', 'string');
|
||||
$turnList = array_map('intval', explode('_', Util::getReq('turnList', 'string', '0')));
|
||||
$isChiefTurn = Util::getReq('is_chief', 'bool', false);
|
||||
|
||||
function die_redirect(){
|
||||
global $isChiefTurn;
|
||||
if(!$isChiefTurn){
|
||||
header('location:index.php', true, 303);
|
||||
}
|
||||
else{
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
if(!$turnList || !$commandType){
|
||||
die_redirect();
|
||||
}
|
||||
if(!is_array($turnList)){
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
if(!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))){
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
if($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))){
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env')->turnOnCache();
|
||||
$env = $gameStor->getValues(['init_year','init_month','startyear','year','month','show_img_level','join_mode','maxnation']);
|
||||
$general = General::createGeneralObjFromDB($session->generalID);
|
||||
|
||||
if(!$isChiefTurn){
|
||||
$commandObj = buildGeneralCommandClass($commandType, $general, $env);
|
||||
}
|
||||
else{
|
||||
if($general->getVar('level') < 5){
|
||||
die_redirect();
|
||||
}
|
||||
$commandObj = buildNationCommandClass($commandType, $general, $env, new LastTurn());
|
||||
}
|
||||
|
||||
|
||||
if($commandObj->isArgValid()){
|
||||
//인자가 필요없는 타입의 경우 processing에서 '전혀' 처리하지 않음!
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
/*if(!$commandObj->isReservable()){
|
||||
die_redirect();
|
||||
}*/
|
||||
|
||||
$jsList = $commandObj->getJSFiles();
|
||||
$cssList = $commandObj->getCSSFiles();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=$commandObj->getName()?></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('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<?=WebUtil::printJS('js/processing.js')?>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
window.command = '<?=$commandType?>';
|
||||
window.turnList = [<?=join(', ',$turnList)?>];
|
||||
window.isChiefTurn = <?=$isChiefTurn?'true':'false'?>;
|
||||
</script>
|
||||
<?php
|
||||
foreach($jsList as $js){
|
||||
print(WebUtil::printJS($js));
|
||||
}
|
||||
?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/main.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
<?php
|
||||
foreach($cssList as $css){
|
||||
print(WebUtil::printCSS($css));
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body class="img_back">
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr><td class="bg1" style='text-align:center;'><?=$commandObj->getName()?></td></tr>
|
||||
<tr><td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
</td></tr></table>
|
||||
|
||||
<div class="tb_layout bg0" style="width:1000px;margin:auto;padding-bottom:2em;border:solid 1px gray;">
|
||||
<?=$commandObj->getForm()?>
|
||||
</div>
|
||||
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr><td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
<?=banner()?>
|
||||
</td></tr></table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+13
-16
@@ -12,7 +12,7 @@ $gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("토너먼트", 1);
|
||||
checkTurn();
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -28,10 +28,10 @@ if ($con >= 2) {
|
||||
|
||||
switch ($admin['tnmt_type']) {
|
||||
default: throw new \RuntimeException('invalid tnmt_type');
|
||||
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
|
||||
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
|
||||
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
|
||||
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break;
|
||||
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "total"; $tp2 = "종합"; $tp3 = "total"; break;
|
||||
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "leadership"; $tp2 = "통솔"; $tp3 = "leadership"; break;
|
||||
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "strength"; $tp2 = "무력"; $tp3 = "strength"; break;
|
||||
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "intel"; $tp2 = "지력"; $tp3 = "intel"; break;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -115,7 +115,7 @@ if ($session->userGrade >= 5) {
|
||||
case 1:
|
||||
echo "<select name=gen size=1 style=color:white;background-color:black;>";
|
||||
|
||||
$query = "select no,name,npc,tnmt,leader,power,intel,leader+power+intel as total from general where tournament=0 and gold>='{$admin['develcost']}' order by {$tp3} desc";
|
||||
$query = "select no,name,npc,tnmt,leadership,strength,intel,leadership+strength+intel as total from general where tournament=0 and gold>='{$admin['develcost']}' order by {$tp3} desc";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$genCount = MYDB_num_rows($result);
|
||||
|
||||
@@ -394,19 +394,16 @@ for ($i=0; $i < 16; $i++) {
|
||||
|
||||
echo"
|
||||
</tr>";
|
||||
|
||||
$betting = $gameStor->getValues(['tournament','bet0','bet1','bet2','bet3','bet4','bet5','bet6','bet7','bet8','bet9','bet10','bet11','bet12','bet13','bet14','bet15']);
|
||||
$betting['bet'] = 0;
|
||||
for($i=0;$i<16;$i+=1){
|
||||
$betting['bet'] += $betting['bet'.$i];
|
||||
}
|
||||
$globalBet = array_splice($db->queryFirstList('SELECT * FROM betting WHERE general_id = 0'), -16);
|
||||
$globalBetTotal = array_sum($globalBet);
|
||||
$admin = $gameStor->getValues(['tournament', 'phase']);
|
||||
$bet = [];
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
if($betting["bet{$i}"] == 0){
|
||||
if($globalBet[$i] == 0){
|
||||
$bet[$i] = '∞';
|
||||
continue;
|
||||
}
|
||||
$bet[$i] = round($betting['bet'] / $betting["bet{$i}"], 2);
|
||||
$bet[$i] = round($globalBetTotal / $globalBet[$i], 2);
|
||||
}
|
||||
|
||||
echo "
|
||||
@@ -442,7 +439,7 @@ for ($i=0; $i < 8; $i++) {
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
$query = "select npc,name,ldr,pwr,itl,ldr+pwr+itl as tot,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$query = "select npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($k=1; $k <= 4; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -468,7 +465,7 @@ for ($i=0; $i < 8; $i++) {
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
$query = "select npc,name,ldr,pwr,itl,ldr+pwr+itl as tot,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$query = "select npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($k=1; $k <= 8; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
+79
-25
@@ -8,18 +8,15 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("부대편성", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no,nation,troop FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$troops = [];
|
||||
foreach($db->query('SELECT troop,name,no FROM troop WHERE nation = %i', $me['nation']) as $rawTroop){
|
||||
$troops[$rawTroop['troop']] = [
|
||||
'troop'=>$rawTroop['troop'],
|
||||
foreach($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop){
|
||||
$troops[$rawTroop['troop_leader']] = [
|
||||
'name'=>$rawTroop['name'],
|
||||
'no'=>$rawTroop['no'],
|
||||
'users'=>[]
|
||||
];
|
||||
}
|
||||
@@ -40,23 +37,38 @@ foreach($db->query(
|
||||
}
|
||||
|
||||
if($troops){
|
||||
foreach($db->query(
|
||||
'SELECT no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5,troop FROM general WHERE no IN %li',
|
||||
array_column($troops, 'no')
|
||||
) as $troopLeader
|
||||
$troopLeaders = $db->query(
|
||||
'SELECT no,name,picture,imgsvr,turntime,city,troop FROM general WHERE no IN %li',
|
||||
array_keys($troops)
|
||||
);
|
||||
$generalTurnList = [];
|
||||
|
||||
foreach($db->queryAllLists(
|
||||
'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC',
|
||||
array_column($troopLeaders, 'no')
|
||||
) as [$generalID, $turnIdx, $brief]
|
||||
){
|
||||
if(!key_exists($generalID, $generalTurnList)){
|
||||
$generalTurnList[$generalID] = [];
|
||||
}
|
||||
$generalTurnList[$generalID][$turnIdx] = $brief;
|
||||
}
|
||||
|
||||
foreach($troopLeaders as $troopLeader){
|
||||
$imageTemp = GetImageURL($troopLeader['imgsvr']);
|
||||
|
||||
$troopLeader['pictureFullPath'] = "$imageTemp/{$troopLeader['picture']}";
|
||||
$troopLeader['cityText'] = CityConst::byID($troopLeader['city'])->name;
|
||||
|
||||
$troopLeader['turnText'] = join('<br>', [
|
||||
'1 : '.((DecodeCommand($troopLeader['turn0'])[0] == 26)?'집합':'~'),
|
||||
'2 : '.((DecodeCommand($troopLeader['turn1'])[0] == 26)?'집합':'~'),
|
||||
'3 : '.((DecodeCommand($troopLeader['turn2'])[0] == 26)?'집합':'~'),
|
||||
'4 : '.((DecodeCommand($troopLeader['turn3'])[0] == 26)?'집합':'~'),
|
||||
'5 : '.((DecodeCommand($troopLeader['turn4'])[0] == 26)?'집합':'~'),
|
||||
]);
|
||||
$turnText = [];
|
||||
foreach($generalTurnList[$troopLeader['no']] as $rawTurnIdx => $brief){
|
||||
if($brief != '집합'){
|
||||
$brief = '~';
|
||||
}
|
||||
$turnIdx = $rawTurnIdx + 1;
|
||||
$turnText[] = "{$turnIdx} : {$brief}";
|
||||
}
|
||||
$troopLeader['turnText'] = join('<br>', $turnText);
|
||||
$troops[$troopLeader['troop']]['leader'] = $troopLeader;
|
||||
}
|
||||
}
|
||||
@@ -81,6 +93,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 +142,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 +156,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,14 +187,14 @@ 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>
|
||||
<td rowspan=2><?=$troopLeader['turnText']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||
<td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14, 5)?></font></td>
|
||||
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||
<tr><td colspan=5>
|
||||
|
||||
@@ -152,7 +206,7 @@ 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;
|
||||
@@ -160,13 +214,13 @@ foreach ($troops as $troopNo=>$troop) {
|
||||
<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; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||
<tr><td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14, 5)?></font></td>
|
||||
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||
<tr><td colspan=5></td></tr>
|
||||
<?php endif;
|
||||
@@ -181,7 +235,7 @@ 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 type=text style=color:white;background-color:black; size=18 maxlength=18 name=name></td>
|
||||
<?php if($me['troop'] == 0): ?>
|
||||
<td><input type=submit name=btn value='부 대 창 설'></td>
|
||||
<?php else: ?>
|
||||
|
||||
+18
-13
@@ -28,6 +28,9 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/download2.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<script>
|
||||
var defaultSpecialDomestic = <?=GameConst::$defaultSpecialDomestic?>;
|
||||
</script>
|
||||
<?=WebUtil::printJS('js/battle_simulator.js')?>
|
||||
</head>
|
||||
<body>
|
||||
@@ -90,8 +93,9 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<span class="input-group-text">국가 성향</span>
|
||||
</div>
|
||||
<select class="custom-select form_nation_type" style="width:25ch;">
|
||||
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
|
||||
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
|
||||
<?php foreach(GameConst::$availableNationType as $typeID): ?>
|
||||
<?php $nationTypeClass = buildNationTypeClass($typeID) ?>
|
||||
<option value="<?=$typeID?>"><?=$nationTypeClass->getName()?> (<?=$nationTypeClass::$pros?>, <?=$nationTypeClass::$cons?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="input-group-prepend">
|
||||
@@ -161,8 +165,9 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<span class="input-group-text">국가 성향</span>
|
||||
</div>
|
||||
<select class="custom-select form_nation_type" style="width:25ch;">
|
||||
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
|
||||
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
|
||||
<?php foreach(GameConst::$availableNationType as $typeID): ?>
|
||||
<?php $nationTypeObj = buildNationTypeClass($typeID) ?>
|
||||
<option value="<?=$typeID?>"><?=$nationTypeObj->name?> (<?=$nationTypeClass::$pros?>, <?=$nationTypeClass::$cons?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="input-group-prepend">
|
||||
@@ -255,7 +260,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>
|
||||
@@ -275,7 +280,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">무력</span>
|
||||
</div>
|
||||
<input type="number" class="form-control form_power" value="50" min="1" max="300" step="1">
|
||||
<input type="number" class="form-control form_strength" value="50" min="1" max="300" step="1">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">지력</span>
|
||||
</div>
|
||||
@@ -287,7 +292,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
</div>
|
||||
<select class="custom-select form_general_horse">
|
||||
<?php foreach(range(0, 26) as $horseID): ?>
|
||||
<option value="<?=$horseID?>"><?=getHorseName($horseID)?></option>
|
||||
<option value="<?=$horseID?>"><?=getItemName($horseID)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="input-group-prepend">
|
||||
@@ -295,7 +300,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
</div>
|
||||
<select class="custom-select form_general_weap">
|
||||
<?php foreach(range(0, 26) as $weapID): ?>
|
||||
<option value="<?=$weapID?>"><?=getWeapName($weapID)?></option>
|
||||
<option value="<?=$weapID?>"><?=getItemName($weapID)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="input-group-prepend">
|
||||
@@ -303,7 +308,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
</div>
|
||||
<select class="custom-select form_general_book">
|
||||
<?php foreach(range(0, 26) as $bookID): ?>
|
||||
<option value="<?=$bookID?>"><?=getBookName($bookID)?></option>
|
||||
<option value="<?=$bookID?>"><?=getItemName($bookID)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -416,10 +421,10 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<div class="input-group-prepend only_defender">
|
||||
<span class="input-group-text">수비여부</span>
|
||||
</div>
|
||||
<select class="custom-select form_defend_mode only_defender">
|
||||
<option value="2">훈사 80</option>
|
||||
<option value="3">훈사 60</option>
|
||||
<option value="0">안함</option>
|
||||
<select class="custom-select form_defence_train only_defender">
|
||||
<option value="80">훈사 80</option>
|
||||
<option value="60">훈사 60</option>
|
||||
<option value="999">안함</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+18
-52
@@ -11,7 +11,6 @@ $v->rule('integer', [
|
||||
'topv',
|
||||
'value',
|
||||
'term',
|
||||
'stuff',
|
||||
'sel'
|
||||
]);
|
||||
|
||||
@@ -21,7 +20,6 @@ $cost = Util::getReq('cost', 'int');
|
||||
$topv = Util::getReq('topv', 'int');
|
||||
$value = Util::getReq('value', 'int');
|
||||
$term = Util::getReq('term', 'int');
|
||||
$stuff = Util::getReq('stuff', 'int');
|
||||
$sel = Util::getReq('sel', 'int');
|
||||
|
||||
$msg = '';
|
||||
@@ -34,38 +32,30 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("입찰", 1);
|
||||
|
||||
$turnterm = $gameStor->turnterm;
|
||||
|
||||
$query = "select no,name,gold,rice,special from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no,name,gold,rice,special from general where owner=%i', $userID);
|
||||
|
||||
$query = "select no from auction where no1='{$me['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$tradeCount = MYDB_num_rows($result);
|
||||
|
||||
$query = "select no from auction where no2='{$me['no']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$bidCount = MYDB_num_rows($result);
|
||||
$tradeCount = $db->queryFirstField('SELECT count(no) FROM auction WHERE no1=%i', $me['no']);
|
||||
$bidCount = $db->queryFirstField('SELECT count(no) FROM auction WHERE no2=%i', $me['no']);
|
||||
|
||||
$btCount = $tradeCount + $bidCount;
|
||||
|
||||
$unit = $turnterm * 60;
|
||||
|
||||
$amount = Util::round($amount / 10) * 10;
|
||||
$cost = Util::round($cost / 10) * 10;
|
||||
$topv = Util::round($topv / 10) * 10;
|
||||
$value = Util::round($value / 10) * 10;
|
||||
$amount = Util::round($amount, -1);
|
||||
$cost = Util::round($cost, -1);
|
||||
$topv = Util::round($topv, -1);
|
||||
$value = Util::round($value, -1);
|
||||
if ($term > 24) {
|
||||
$term = 24;
|
||||
}
|
||||
|
||||
$valid = 1;
|
||||
if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
||||
if ($session->userGrade >= 5) {
|
||||
} else {
|
||||
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||
@@ -74,10 +64,6 @@ if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['
|
||||
}
|
||||
|
||||
if ($btn == "판매") {
|
||||
if ($stuff != 0) {
|
||||
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($term < 0 || $term > 24) {
|
||||
$msg = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
@@ -98,8 +84,8 @@ if ($btn == "판매") {
|
||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($amount > $me['rice'] - 1000) {
|
||||
$msg = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
||||
if ($amount > $me['rice'] - GameConst::$defaultRice) {
|
||||
$msg = "ㆍ<span class='ev_warning'>기본 군량 ".GameConst::$defaultRice."은 거래할 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($valid == 1) {
|
||||
@@ -109,7 +95,6 @@ if ($btn == "판매") {
|
||||
'type'=>0,
|
||||
'no1'=>$me['no'],
|
||||
'name1'=>$me['name'],
|
||||
'stuff'=>$stuff,
|
||||
'amount'=>$amount,
|
||||
'cost'=>$cost,
|
||||
'value'=>$cost,
|
||||
@@ -118,9 +103,7 @@ if ($btn == "판매") {
|
||||
]);
|
||||
}
|
||||
} elseif ($btn == "구매시도") {
|
||||
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$auction = MYDB_fetch_array($result);
|
||||
$auction = $db->queryFirstRow('SELECT no2,value,topv,expire,amount FROM auction WHERE no=%i LIMIT 1', $sel);
|
||||
|
||||
if ($value == $auction['topv']) {
|
||||
$valid = 2;
|
||||
@@ -129,12 +112,6 @@ if ($btn == "판매") {
|
||||
$msg = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
/*
|
||||
if($stuff != 0) {
|
||||
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
*/
|
||||
if ($auction['no2'] > 0 && $value <= $auction['value']) {
|
||||
$msg = "ㆍ<span class='ev_warning'>현재판매가보다 높게 입찰해야 합니다.</span>";
|
||||
$valid = 0;
|
||||
@@ -147,8 +124,8 @@ if ($btn == "판매") {
|
||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가보다 높을 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($value > $me['gold'] - 1000) {
|
||||
$msg = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
||||
if ($value > $me['gold'] - GameConst::$defaultGold) {
|
||||
$msg = "ㆍ<span class='ev_warning'>기본 자금 ".GameConst::$defaultGold."은 거래할 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($valid == 1) {
|
||||
@@ -176,10 +153,6 @@ if ($btn == "판매") {
|
||||
], 'no=%i', $sel);
|
||||
}
|
||||
} elseif ($btn == "구매") {
|
||||
if ($stuff != 0) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($term < 0 || $term > 24) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
@@ -200,8 +173,8 @@ if ($btn == "판매") {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($cost > $me['gold'] - 1000) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
||||
if ($cost > $me['gold'] - GameConst::$defaultGold) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>기본 자금 ".GameConst::$defaultGold."은 거래할 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($valid == 1) {
|
||||
@@ -212,7 +185,6 @@ if ($btn == "판매") {
|
||||
'type'=>1,
|
||||
'no1'=>$me['no'],
|
||||
'name1'=>$me['name'],
|
||||
'stuff'=>$stuff,
|
||||
'amount'=>$amount,
|
||||
'cost'=>$cost,
|
||||
'value'=>$cost,
|
||||
@@ -221,9 +193,7 @@ if ($btn == "판매") {
|
||||
]);
|
||||
}
|
||||
} elseif ($btn == "판매시도") {
|
||||
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$auction = MYDB_fetch_array($result);
|
||||
$auction = $db->queryFirstRow('SELECT no2,value,topv,expire,amount FROM auction WHERE no=%i LIMIT 1', $sel);
|
||||
|
||||
if ($value == $auction['topv']) {
|
||||
$valid = 2;
|
||||
@@ -232,10 +202,6 @@ if ($btn == "판매") {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($stuff != 0) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($auction['no2'] > 0 && $value >= $auction['value']) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>현재구매가보다 낮게 입찰해야 합니다.</span>";
|
||||
$valid = 0;
|
||||
@@ -248,8 +214,8 @@ if ($btn == "판매") {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가보다 낮을 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($value > $me['rice'] - 1000) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
||||
if ($value > $me['rice'] - GameConst::$defaultRice) {
|
||||
$msg2 = "ㆍ<span class='ev_warning'>기본 군량 ".GameConst::$defaultRice."은 거래할 수 없습니다.</span>";
|
||||
$valid = 0;
|
||||
}
|
||||
if ($valid == 1) {
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
// $btn0~15, $gold0~15
|
||||
|
||||
//FIXME: 으악!!!!! 왜?! idx를 지정하고 gold를 지정하라고!
|
||||
$betTarget = -1;
|
||||
$betGold = -1;
|
||||
for($i=0;$i<16;$i++){
|
||||
$textBtn = "btn{$i}";
|
||||
$textGold = "gold{$i}";
|
||||
$btn = Util::getReq($textBtn);
|
||||
$gold = Util::getReq($textGold, 'int');
|
||||
if($btn === "베팅!" && $gold){
|
||||
$betTarget = $i;
|
||||
$betGold = $gold;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($betGold == -1){
|
||||
extractMissingPostToGlobals();
|
||||
}
|
||||
|
||||
|
||||
if($betTarget < 0 || $betGold < 10 || $betGold > 1000){
|
||||
header('Location: b_betting.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("베팅", 1);
|
||||
|
||||
$tournament = $gameStor->tournament;
|
||||
if($tournament != 6) {
|
||||
header('Location: b_betting.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
$bets = $db->queryFirstList('SELECT bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,gold FROM general WHERE `owner`=%i', $userID);
|
||||
$myGold = array_pop($bets);
|
||||
$totalBet = array_sum($bets);
|
||||
|
||||
//NOTE: 위 코드에서 $betTarget은 0~15의 정수임이 보장된다.
|
||||
$oldBet = $bets[$betTarget];
|
||||
if($betGold + 500 <= $myGold && $betGold + $oldBet <= 1000 && $betGold + $totalBet <= 1000) {
|
||||
$db->update('general', [
|
||||
'gold'=>$db->sqleval('gold - %i', $betGold),
|
||||
"bet{$betTarget}"=>$db->sqleval("bet{$betTarget} + %i", $betGold),
|
||||
'betgold'=>$db->sqleval('betgold + %i', $betGold)
|
||||
], 'owner = %i', $userID);
|
||||
|
||||
$gameStor->setValue("bet{$betTarget}", $gameStor->getValue("bet{$betTarget}") + $betGold);//TODO: +로 증가하는 storage값은 별도로 분리
|
||||
}
|
||||
|
||||
header('location: b_betting.php');
|
||||
@@ -1,58 +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
|
||||
|
||||
//로그인 검사
|
||||
$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
-4
@@ -18,11 +18,16 @@ $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();
|
||||
}
|
||||
|
||||
@@ -42,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
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $turn, $command, $cost, $name, $nationname, $note, $double, $third, $fourth
|
||||
$turn = Util::getReq('turn', 'array_int');
|
||||
$command = Util::getReq('command', 'int', 0);
|
||||
$cost = Util::getReq('cost', 'int');
|
||||
$name = Util::getReq('name');
|
||||
$nationname = Util::getReq('nationname', 'string', '');
|
||||
$note = Util::getReq('note', 'string', '');
|
||||
$double = Util::getReq('double', 'int', 0);
|
||||
$third = Util::getReq('third', 'int', 0);
|
||||
$fourth = Util::getReq('fourth', 'int', 0);
|
||||
|
||||
extractMissingPostToGlobals();
|
||||
|
||||
if(!$turn){
|
||||
$turn = [0];
|
||||
}
|
||||
|
||||
'@phan-var int $double';
|
||||
'@phan-var int $third';
|
||||
'@phan-var int $fourth';
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if($command < 0) { $command = 0; }
|
||||
if($double < 0) { $double = 0; }
|
||||
if($third < 0) { $third = 0; }
|
||||
if($fourth < 0) { $fourth = 0; }
|
||||
if($command > 99) { $command = 0; }
|
||||
if($double > 9999) { $double = 9999; }
|
||||
if($fourth > 9999) { $fourth = 9999; }
|
||||
|
||||
$comStr = EncodeCommand($fourth, $third, $double, $command);
|
||||
|
||||
// 건국
|
||||
if($command == 46) {
|
||||
$name = StringUtil::neutralize($name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$name
|
||||
], 'owner=%i', $userID);
|
||||
|
||||
$query = [];
|
||||
foreach($turn as $turnIdx){
|
||||
$query['turn'.$turnIdx] = $comStr;
|
||||
}
|
||||
$db->update('general', $query, 'owner=%i', $userID);
|
||||
header('Location:./');
|
||||
die();
|
||||
|
||||
}
|
||||
|
||||
//통합제의
|
||||
if($command == 53) {
|
||||
$query = "select 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) {
|
||||
$nationname = StringUtil::neutralize($nationname, 18);
|
||||
if($nationname == "") { $nationname = "무명"; }
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$nationname
|
||||
], 'level>=5 and nation=%i', $me['nation']);
|
||||
|
||||
$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');
|
||||
die();
|
||||
}
|
||||
|
||||
//불가침
|
||||
if($command == 61) {
|
||||
$query = "select 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) {
|
||||
$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++) {
|
||||
$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');
|
||||
die();
|
||||
}
|
||||
|
||||
//포상, 몰수, 발령, 항복권고, 원조
|
||||
//선전포고, 종전, 파기, 초토화, 천도, 증축, 감축
|
||||
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
|
||||
//국기변경
|
||||
if($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
|
||||
$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(($command == 23 || $command == 24 || $command == 27) && $me['no'] == $third) {
|
||||
// 자기자신에게 악용 금지
|
||||
} elseif($me['level'] >= 5) {
|
||||
$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');
|
||||
die();
|
||||
}
|
||||
|
||||
//일반 턴
|
||||
$query = [];
|
||||
foreach($turn as $turnIdx){
|
||||
$query['turn'.$turnIdx] = $comStr;
|
||||
}
|
||||
$db->update('general', $query, 'owner=%i', $userID);
|
||||
header('Location:./');
|
||||
|
||||
+97
-102
@@ -32,7 +32,7 @@ $ruler = MYDB_fetch_array($result);
|
||||
|
||||
//수뇌가 아니면 아무것도 할 수 없음
|
||||
if($meLevel < 5){
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -41,54 +41,61 @@ if($btn == "임명") {
|
||||
$general = [];
|
||||
}
|
||||
else{
|
||||
$general = $db->queryFirstRow('SELECT `no`,nation,`level`,leader,`power`,intel FROM general WHERE no = %i', $genlist);
|
||||
$general = $db->queryFirstRow('SELECT `no`,nation,`level`,leadership,`strength`,intel FROM general WHERE no = %i', $genlist);
|
||||
}
|
||||
|
||||
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');
|
||||
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();
|
||||
}
|
||||
|
||||
if($btn == "추방") {
|
||||
$query = "select name,l{$meLevel}set,chemi,color from nation where nation='{$me['nation']}'";
|
||||
$query = "select name,l{$meLevel}set,color from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -96,24 +103,19 @@ if($btn == "추방") {
|
||||
|
||||
//이미 지정했다면 무시
|
||||
if($nation["l{$meLevel}set"] == 0 && $general['level'] > 0 && $general['level'] < 12) {
|
||||
$query = "select no from diplomacy where me='{$general['nation']}' and state>='3' and state<='4'";
|
||||
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dipcount1 = MYDB_num_rows($dipresult);
|
||||
|
||||
$query = "select no from diplomacy where me='{$general['nation']}' and state>='5' and state<='6'";
|
||||
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$dipcount2 = MYDB_num_rows($dipresult);
|
||||
$dipcount1 = $db->queryFirstField('SELECT count(no) FROM diplomacy WHERE me=%i AND state>=3 AND state<=4', $general['nation']);
|
||||
$dipcount2 = $db->queryFirstField('SELECT count(no) FROM diplomacy WHERE me=%i AND state>=5 AND state<=6', $general['nation']);
|
||||
|
||||
$gold = 0;
|
||||
$rice = 0;
|
||||
// 금쌀1000이상은 남김
|
||||
if($general['gold'] > 1000) {
|
||||
$gold = $general['gold'] - 1000;
|
||||
$general['gold'] = 1000;
|
||||
if($general['gold'] > GameConst::$defaultGold) {
|
||||
$gold = $general['gold'] - GameConst::$defaultGold;
|
||||
$general['gold'] = GameConst::$defaultGold;
|
||||
}
|
||||
if($general['rice'] > 1000) {
|
||||
$rice = $general['rice'] - 1000;
|
||||
$general['rice'] = 1000;
|
||||
if($general['rice'] > GameConst::$defaultRice) {
|
||||
$rice = $general['rice'] - GameConst::$defaultRice;
|
||||
$general['rice'] = GameConst::$defaultRice;
|
||||
}
|
||||
|
||||
if($dipcount1 > 0) {
|
||||
@@ -143,11 +145,13 @@ 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,
|
||||
'makelimit'=>12,
|
||||
@@ -159,31 +163,27 @@ if($btn == "추방") {
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
}
|
||||
// 부대 처리
|
||||
$query = "select no from troop where troop='{$general['troop']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$troop = MYDB_fetch_array($result);
|
||||
|
||||
//부대장일 경우
|
||||
if($troop['no'] == $general['no']) {
|
||||
if($general['troop'] == $general['no']){
|
||||
// 모두 탈퇴
|
||||
$query = "update general set troop='0' where troop='{$general['troop']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 부대 삭제
|
||||
$query = "delete from troop where troop='{$general['troop']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$query = "update general set troop='0' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'troop'=>0,
|
||||
], 'troop = %i', $general['no']);
|
||||
$db->delete('troop', 'troop_leader=%i', $general['no']);
|
||||
}
|
||||
else {
|
||||
$db->update('general', [
|
||||
'troop'=>0,
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
// 도시관직해제
|
||||
$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']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if(2 <= $general['level'] && $general['level'] <= 4){
|
||||
$db->update('city', [
|
||||
'officer'.$general['level']=>0
|
||||
], "officer{$general['level']} = %i", $general['no']);
|
||||
}
|
||||
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] < 100 || rand()%100 == 0)) {
|
||||
switch(rand()%5) {
|
||||
@@ -214,27 +214,25 @@ if($btn == "추방") {
|
||||
$msg->send();
|
||||
}
|
||||
|
||||
//국가 기술력 그대로
|
||||
$query = "select no from general where nation='{$general['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
$gennum = $gencount;
|
||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||
|
||||
$nation['chemi'] -= 1;
|
||||
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
|
||||
|
||||
if($admin['year'] < $admin['startyear']+3) {
|
||||
//초반엔 군주 부상 증가(엔장 임관지양)
|
||||
$query = "update general set injury=injury+1 where no='{$ruler['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'injury'=>$db->sqleval('least(injury + 1, %i)', 80),
|
||||
], 'no=%i', $ruler['no']);
|
||||
|
||||
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum',chemi='{$nation['chemi']}',gold=gold+'$gold',rice=rice+'$rice' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
'gennum'=>$db->sqleval('gennum - 1'),
|
||||
'gold'=>$db->sqleval('gold + %i', $gold),
|
||||
'rice'=>$db->sqleval('rice + %i', $rice),
|
||||
], 'nation = %i', $general['nation']);
|
||||
} else {
|
||||
//이번분기는 추방불가(초반 제외)
|
||||
$query = "update nation set l{$meLevel}set=1,totaltech=tech*'$gencount',gennum='$gennum',chemi='{$nation['chemi']}',gold=gold+'$gold',rice=rice+'$rice' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('nation', [
|
||||
"l{$meLevel}set"=>1,
|
||||
'gennum'=>$db->sqleval('gennum - 1'),
|
||||
'gold'=>$db->sqleval('gold + %i', $gold),
|
||||
'rice'=>$db->sqleval('rice + %i', $rice),
|
||||
], 'nation = %i', $general['nation']);
|
||||
}
|
||||
|
||||
list($year, $month) = $gameStor->getValuesAsArray(['year','month']);
|
||||
@@ -243,12 +241,12 @@ if($btn == "추방") {
|
||||
pushGenLog($general, $log);
|
||||
pushGeneralPublicRecord($alllog, $year, $month);
|
||||
}
|
||||
header('location:b_myBossInfo.php');
|
||||
header('location:b_myBossInfo.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
if($btn == "임명" && $level >= 5 && $level <= 11) {
|
||||
$query = "select l{$level}set,level,chemi from nation where nation='{$me['nation']}'";
|
||||
$query = "select l{$level}set,level from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -257,34 +255,27 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
|
||||
|
||||
//이미 지정했다면 무시
|
||||
if($nation["l{$level}set"] == 0 && $lv <= $level) {
|
||||
$nation['chemi'] -= 1;
|
||||
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
|
||||
|
||||
$query = "update nation set chemi='{$nation['chemi']}' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//기존 장수 일반으로
|
||||
$query = "update general set level=1 where nation='{$me['nation']}' and level='$level'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if($genlist != 0) {
|
||||
$valid = 0;
|
||||
switch($level) {
|
||||
case 10: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 10: if($general['strength'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 9: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 8: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 8: if($general['strength'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 7: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 6: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 6: if($general['strength'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 5: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
default: $valid = 1; break;
|
||||
}
|
||||
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),"");
|
||||
if(2 <= $general['level'] && $general['level'] <= 4){
|
||||
$db->update('city', [
|
||||
'officer'.$general['level']=>0
|
||||
], "officer{$general['level']} = %i", $general['no']);
|
||||
}
|
||||
//신임 장수
|
||||
$query = "update general set level='$level' where no='$genlist'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -294,63 +285,67 @@ 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;
|
||||
}
|
||||
$genlv = 'officer'.$level;
|
||||
$genlvset = 'officer'.$level.'set';
|
||||
|
||||
$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;
|
||||
switch($level) {
|
||||
case 4: if($general['power'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 4: if($general['strength'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
case 3: if($general['intel'] >= GameConst::$chiefStatMin) { $valid = 1; } break;
|
||||
default: $valid = 1; break;
|
||||
}
|
||||
|
||||
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),"");
|
||||
if(2 <= $general['level'] && $general['level'] <= 4){
|
||||
$db->update('city', [
|
||||
'officer'.$general['level']=>0
|
||||
], "officer{$general['level']} = %i", $general['no']);
|
||||
}
|
||||
|
||||
//신임 장수
|
||||
$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,54 +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');
|
||||
|
||||
//로그인 검사
|
||||
$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,25 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $msg
|
||||
$msg = Util::getReq('msg');
|
||||
|
||||
//로그인 검사
|
||||
$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');
|
||||
+84
-68
@@ -29,9 +29,9 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
switch($admin['tnmt_type']) {
|
||||
case 0: $tp = "total"; $tp2 = "전력전"; $tp3 = "leader+power+intel"; break;
|
||||
case 1: $tp = "leader"; $tp2 = "통솔전"; $tp3 = "leader"; break;
|
||||
case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break;
|
||||
case 0: $tp = "total"; $tp2 = "전력전"; $tp3 = "leadership+strength+intel"; break;
|
||||
case 1: $tp = "leadership"; $tp2 = "통솔전"; $tp3 = "leadership"; break;
|
||||
case 2: $tp = "strength"; $tp2 = "일기토"; $tp3 = "strength"; break;
|
||||
case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ if($btn == '참가') {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$general = $db->queryFirstRow('SELECT no,name,npc,leader,power,intel,explevel,gold,horse,weap,book FROM general WHERE `no`=%i', $me['no']);
|
||||
$general = $db->queryFirstRow('SELECT no,name,npc,leadership,strength,intel,explevel,gold,horse,weapon,book FROM general WHERE `no`=%i', $me['no']);
|
||||
|
||||
//{$admin['develcost']}원 참가비
|
||||
if($general['gold'] < $admin['develcost']) {
|
||||
@@ -51,35 +51,36 @@ if($btn == '참가') {
|
||||
}
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
|
||||
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$occupied = [];
|
||||
for($i=0; $i < $grpCount; $i++) {
|
||||
$grp = MYDB_fetch_array($result);
|
||||
$occupied[$grp['grp']] = 1;
|
||||
foreach($db->queryFirstColumn('SELECT grp FROM tournament WHERE grp < 10 GROUP BY grp HAVING count(*)=8') as $grp){
|
||||
$occupied[$grp] = true;
|
||||
}
|
||||
$map = [];
|
||||
for($i=0; $i < 8; $i++) {
|
||||
if(!Util::array_get($occupied[$i])) {
|
||||
$map[] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
$grpCount = count($occupied);
|
||||
|
||||
if($grpCount < 8) {
|
||||
$grp = $map[rand() % count($map)];
|
||||
$query = "select grp from tournament where grp='$grp'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('{$general['no']}', '{$general['npc']}', '{$general['name']}', '{$general['leader']}', '{$general['power']}', '{$general['intel']}', '{$general['explevel']}', '$grp', '$grpCount', '{$general['horse']}', '{$general['weap']}', '{$general['book']}')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set tournament=1,gold='{$general['gold']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grp = Util::choiceRandom(array_keys($occupied));
|
||||
$grpMemberCount = $db->queryFirstField('SELECT count(*) FROM tournament WHERE grp=%i', $grp);
|
||||
$db->insert('tournament', [
|
||||
'no'=>$general['no'],
|
||||
'npc'=>$general['npc'],
|
||||
'name'=>$general['name'],
|
||||
'leadership'=>$general['leadership'],
|
||||
'strength'=>$general['strength'],
|
||||
'intel'=>$general['intel'],
|
||||
'lvl'=>$general['explevel'],
|
||||
'grp'=>$grp,
|
||||
'grp_no'=>$grpMemberCount,
|
||||
'h'=>$general['horse'],
|
||||
'w'=>$general['weapon'],
|
||||
'b'=>$general['book']
|
||||
]);
|
||||
$db->update('general', [
|
||||
'tournament'=>1,
|
||||
'gold'=>$general['gold']
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$grpCount = $db->queryFirstField('SELECT count(*) FROM tournament where grp<10 GROUP BY grp HAVING count(*)=8');
|
||||
if($grpCount >= 8) {
|
||||
$gameStor->tournament = 2;
|
||||
$gameStor->phase = 0;
|
||||
@@ -103,7 +104,7 @@ if($btn == "자동개최설정") {
|
||||
$gameStor->phase = 0;
|
||||
} elseif($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") {
|
||||
if($btn == "투입") {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,gold,horse,weapon,book from general where no='$gen'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
@@ -111,14 +112,14 @@ if($btn == "자동개최설정") {
|
||||
$general['no'] = 0;
|
||||
$general['name'] = "무명장수";
|
||||
$general['npc'] = 2;
|
||||
$general['leader'] = 10;
|
||||
$general['power'] = 10;
|
||||
$general['leadership'] = 10;
|
||||
$general['strength'] = 10;
|
||||
$general['intel'] = 10;
|
||||
$general['explevel'] = 10;
|
||||
$general['gold'] = 0;
|
||||
} elseif($btn == "쪼렙투입") {
|
||||
$sel = rand() % 32;
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,gold,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} limit {$sel},1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
@@ -135,56 +136,57 @@ if($btn == "자동개최설정") {
|
||||
|
||||
$sel = rand() % 32 + $genCount - 8;
|
||||
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
} elseif($btn == "굇수투입") {
|
||||
$sel = rand() % 32;
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,gold,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
} elseif($btn == "랜덤투입") {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by rand() limit 0,1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,gold,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by rand() limit 0,1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general['gold'] -= $admin['develcost'];
|
||||
//참가
|
||||
}
|
||||
|
||||
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$occupied = [];
|
||||
for($i=0; $i < $grpCount; $i++) {
|
||||
$grp = MYDB_fetch_array($result);
|
||||
$occupied[$grp['grp']] = 1;
|
||||
}
|
||||
$map = [];
|
||||
for($i=0; $i < 8; $i++) {
|
||||
if(!isset($occupied[$i]) || $occupied[$i] == 0) {
|
||||
$map[] = $i;
|
||||
}
|
||||
foreach($db->queryFirstColumn('SELECT grp FROM tournament WHERE grp < 10 GROUP BY grp HAVING count(*)=8') as $grp){
|
||||
$occupied[$grp] = true;
|
||||
}
|
||||
$grpCount = count($occupied);
|
||||
|
||||
if($grpCount < 8) {
|
||||
$grp = $map[rand() % count($map)];
|
||||
$query = "select grp from tournament where grp='$grp'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('{$general['no']}', '{$general['npc']}', '{$general['name']}', '{$general['leader']}', '{$general['power']}', '{$general['intel']}', '{$general['explevel']}', '$grp', '$grpCount', '{$general['horse']}', '{$general['weap']}', '{$general['book']}')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set tournament=1,gold='{$general['gold']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grp = Util::choiceRandom(array_keys($occupied));
|
||||
$grpMemberCount = $db->queryFirstField('SELECT count(*) FROM tournament WHERE grp=%i', $grp);
|
||||
$db->insert('tournament', [
|
||||
'no'=>$general['no'],
|
||||
'npc'=>$general['npc'],
|
||||
'name'=>$general['name'],
|
||||
'leadership'=>$general['leadership'],
|
||||
'strength'=>$general['strength'],
|
||||
'intel'=>$general['intel'],
|
||||
'lvl'=>$general['explevel'],
|
||||
'grp'=>$grp,
|
||||
'grp_no'=>$grpMemberCount,
|
||||
'h'=>$general['horse'],
|
||||
'w'=>$general['weapon'],
|
||||
'b'=>$general['book']
|
||||
]);
|
||||
$db->update('general', [
|
||||
'tournament'=>1,
|
||||
'gold'=>$general['gold']
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$grpCount = MYDB_num_rows($result);
|
||||
$grpCount = $db->queryFirstField('SELECT count(*) FROM tournament where grp<10 GROUP BY grp HAVING count(*)=8');
|
||||
if($grpCount >= 8) {
|
||||
$gameStor->tournament=2;
|
||||
$gameStor->phase=0;
|
||||
$gameStor->tournament = 2;
|
||||
$gameStor->phase = 0;
|
||||
}
|
||||
|
||||
} elseif($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") {
|
||||
@@ -209,7 +211,7 @@ if($btn == "자동개최설정") {
|
||||
for($i=0; $i < $z; $i++) {
|
||||
$sel = rand() % 32;
|
||||
if($btn == "쪼렙전부투입") {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} limit {$sel},1";
|
||||
} elseif($btn == "일반전부투입") {
|
||||
//참가한 사람 평균치
|
||||
$query = "select AVG({$tp3}) as av from general where tournament=1";
|
||||
@@ -223,21 +225,35 @@ if($btn == "자동개최설정") {
|
||||
|
||||
$sel += $genCount - 8;
|
||||
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
} elseif($btn == "굇수전부투입") {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by {$tp} desc limit {$sel},1";
|
||||
} else {
|
||||
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by rand() limit 0,1";
|
||||
$query = "select no,name,npc,leadership,strength,intel,explevel,leadership+strength+intel as total,horse,weapon,book from general where tournament=0 and gold>='{$admin['develcost']}' and npc>=2 order by rand() limit 0,1";
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
$grp = intdiv($code[$i], 10);
|
||||
$grp_no = $code[$i] % 10;
|
||||
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('{$general['no']}', '{$general['npc']}', '{$general['name']}', '{$general['leader']}', '{$general['power']}', '{$general['intel']}', '{$general['explevel']}', '$grp', '$grp_no', '{$general['horse']}', '{$general['weap']}', '{$general['book']}')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set tournament=1,gold=gold-'{$admin['develcost']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->insert('tournament', [
|
||||
'no'=>$general['no'],
|
||||
'npc'=>$general['npc'],
|
||||
'name'=>$general['name'],
|
||||
'leadership'=>$general['leadership'],
|
||||
'strength'=>$general['strength'],
|
||||
'intel'=>$general['intel'],
|
||||
'lvl'=>$general['explevel'],
|
||||
'grp'=>$grp,
|
||||
'grp_no'=>$grp_no,
|
||||
'h'=>$general['horse'],
|
||||
'w'=>$general['weapon'],
|
||||
'b'=>$general['book']
|
||||
]);
|
||||
$db->update('general', [
|
||||
'tournament'=>1,
|
||||
'gold'=>$db->sqleval('gold - %i', $admin['develcost'])
|
||||
], 'no=%i', $general['no']);
|
||||
}
|
||||
|
||||
$gameStor->tournament = 2;
|
||||
|
||||
+14
-13
@@ -17,45 +17,46 @@ $db = DB::db();
|
||||
|
||||
$me = $db->queryFirstRow('SELECT `no`, nation, troop FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
|
||||
if($name && mb_strwidth($name) > 18){
|
||||
$name = mb_strimwidth($name, 0, 18);
|
||||
}
|
||||
|
||||
$name = trim($name);
|
||||
if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
|
||||
$db->insert('troop',[
|
||||
$db->insertIgnore('troop',[
|
||||
'troop_leader'=>$me['no'],
|
||||
'name'=>$name,
|
||||
'nation'=>$me['nation'],
|
||||
'no'=>$me['no']
|
||||
]);
|
||||
$troopID = $db->insertId();
|
||||
|
||||
$db->update('general', [
|
||||
'troop'=>$troopID
|
||||
'troop'=>$me['no'],
|
||||
], 'no=%i',$me['no']);
|
||||
} elseif($btn == "부 대 변 경" && $name != "") {
|
||||
$db->update('troop', [
|
||||
'name'=>$name
|
||||
], 'no=%i',$me['no']);
|
||||
], 'troop_leader=%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']);
|
||||
], 'no=%i AND troop= %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']);
|
||||
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `troop`=%i AND `nation`=%i', $troop, $troop, $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']) {
|
||||
if($me['troop'] == $me['no']) {
|
||||
// 모두 탈퇴
|
||||
$db->update('general', [
|
||||
'troop'=>0
|
||||
], 'troop=%i',$me['troop']);
|
||||
// 부대 삭제
|
||||
$db->delete('troop', 'troop=%i', $me['troop']);
|
||||
$db->delete('troop', 'troop_leader=%i', $me['troop']);
|
||||
} else {
|
||||
$db->update('general', [
|
||||
'troop'=>0
|
||||
@@ -63,4 +64,4 @@ if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
|
||||
}
|
||||
}
|
||||
|
||||
header('Location:b_troop.php');
|
||||
header('Location:b_troop.php', true, 303);
|
||||
|
||||
+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);
|
||||
|
||||
|
||||
+13
-12
@@ -19,18 +19,17 @@ $isVoteAdmin |= $session->userGrade >= 5;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = $gameStor->getValues(['develcost', 'cost', 'vote_title', 'vote', 'votecomment']);
|
||||
|
||||
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no,vote,name,nation,horse,weapon,book,item,npc from general where owner=%i', $userID);
|
||||
|
||||
if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
|
||||
$develcost = $admin['develcost'] * 5;
|
||||
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'gold'=>$db->sqleval('gold + %i', $develcost),
|
||||
'vote'=>$sel
|
||||
], 'owner=%i', $userID);
|
||||
|
||||
$log = [];
|
||||
$log = uniqueItem($me, $log, 1);
|
||||
@@ -49,7 +48,7 @@ else if($btn == "댓글" && trim($comment) != "") {
|
||||
}
|
||||
|
||||
if(!$isVoteAdmin){
|
||||
header('location:a_vote.php');
|
||||
header('location:a_vote.php', true, 303);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -72,11 +71,13 @@ if($btn == "수정") {
|
||||
$gameStor->vote_title = '-';
|
||||
$gameStor->votecomment=[];
|
||||
|
||||
$query = "update general set vote='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'vote'=>0
|
||||
], true);
|
||||
} elseif($btn == "알림") {
|
||||
$query = "update general set newvote='1' where vote=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->update('general', [
|
||||
'newvote'=>1
|
||||
], 'vote=0');
|
||||
} elseif($btn == "숨김") {
|
||||
$gameStor->voteopen = 0;
|
||||
} elseif($btn == "전체통계만") {
|
||||
@@ -85,4 +86,4 @@ if($btn == "수정") {
|
||||
$gameStor->voteopen = 2;
|
||||
}
|
||||
|
||||
header('location:a_vote.php');
|
||||
header('location:a_vote.php', true, 303);
|
||||
@@ -1,130 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$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 = "../";';
|
||||
}
|
||||
?>
|
||||
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() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// 명령 목록
|
||||
$admin = $gameStor->getValues(['year','month','turnterm']);
|
||||
|
||||
$me = $db->queryFirstRow("SELECT `no`,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 FROM general WHERE `owner`=%s", $userID);
|
||||
if(!$me){
|
||||
echo "로그인 되어있지 않습니다.";
|
||||
return;
|
||||
}
|
||||
$turn = getTurn($me, 2);
|
||||
|
||||
echo "<table width=300 height=700 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>
|
||||
</tr>";
|
||||
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'];
|
||||
// 실행된 턴시간이면 +1
|
||||
$cutTurn = cutTurn($me['turntime'], $admin['turnterm']);
|
||||
if($date <= $cutTurn) { $month++; }
|
||||
|
||||
$totaldate = $me['turntime'];
|
||||
|
||||
for($i=0; $i < 24; $i++) {
|
||||
if($month == 13) {
|
||||
$month = 1;
|
||||
$year++;
|
||||
}
|
||||
$j = $i + 1;
|
||||
$turndate = substr($totaldate,11, 5);
|
||||
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=42 align=center bgcolor=black><b>$turndate</b></td>
|
||||
<td width=150 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
|
||||
</tr>";
|
||||
$month++;
|
||||
$totaldate = addTurn($totaldate, $admin['turnterm']);
|
||||
}
|
||||
|
||||
echo "
|
||||
</form>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
#container{
|
||||
width:1024px;
|
||||
margin:auto;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
.chiefSubTable{
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: flex-start;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#chiefTurnSelector{
|
||||
width:50px;
|
||||
color:white;
|
||||
background-color:black;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.chiefTurnIdx{
|
||||
flex-grow:1;
|
||||
border-top:solid 0.67px #888888;
|
||||
line-height:21px;
|
||||
}
|
||||
|
||||
.chiefTurnIdxPanel{
|
||||
width:18px;display:flex;flex-flow:column;
|
||||
}
|
||||
|
||||
.chiefTurnIdxPanel.tail{
|
||||
border-left:solid 0.67px #888888;
|
||||
}
|
||||
|
||||
.chiefPlate{
|
||||
display:flex;
|
||||
flex-flow:column;
|
||||
border-left:solid 0.67px #888888;
|
||||
}
|
||||
|
||||
.chiefTurnBox{
|
||||
flex-grow: 1;
|
||||
display:flex;
|
||||
flex-flow: row;
|
||||
max-height:22px;
|
||||
}
|
||||
|
||||
.chiefTurnBox .turnHeader{
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chiefNamePlate{
|
||||
border-top:solid 0.67px #888888;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
flex-grow: 1;
|
||||
line-height:21px;
|
||||
}
|
||||
|
||||
.turnIdxHeader{
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
width:20px;
|
||||
}
|
||||
|
||||
.chiefTurnTime{
|
||||
border-top:solid 0.67px #888888;
|
||||
border-right:solid 0.67px #888888;
|
||||
font-weight: bold;
|
||||
background: black;
|
||||
text-align: center;
|
||||
width:44px;
|
||||
line-height:21px;
|
||||
}
|
||||
|
||||
.chiefTurnPad{
|
||||
border-top:solid 0.67px #888888;
|
||||
table-layout: fixed;
|
||||
width:192px;
|
||||
line-height:21px;
|
||||
flex-grow: 1;
|
||||
white-space:nowrap;
|
||||
}
|
||||
+33
-1
@@ -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;
|
||||
@@ -219,6 +230,27 @@ div.bar_out div.bar_in{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.commandBasic{
|
||||
background-color:black;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.compensatePositive{
|
||||
color:skyblue;
|
||||
}
|
||||
|
||||
.compensateNegative{
|
||||
color:orange;
|
||||
}
|
||||
|
||||
.compensateNeutral{
|
||||
color:white;
|
||||
}
|
||||
|
||||
.commandBasic.commandImpossible{
|
||||
background-color:red;
|
||||
color:white;
|
||||
}
|
||||
.select2-selection--single.simple-select2-align-center .select2-selection__rendered {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -233,4 +265,4 @@ div.bar_out div.bar_in{
|
||||
|
||||
.select2-container--bootstrap4 .text-secondary .select2-results__option[aria-selected=false]{
|
||||
color:white;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
#scoutMsgForm .viewer{
|
||||
max-height:200px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -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,3 +1,4 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
.rankView {
|
||||
width:1100px;
|
||||
|
||||
@@ -67,4 +67,34 @@ color:white;
|
||||
|
||||
.nation_info td{
|
||||
height:18px;
|
||||
}
|
||||
|
||||
#generalTurnSelector{
|
||||
width:50px;
|
||||
color:white;
|
||||
background-color:black;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
#sidebar{
|
||||
position:fixed;
|
||||
right:0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
#sidebar button{
|
||||
/*width:100px;*/
|
||||
}
|
||||
|
||||
.turn_pad{
|
||||
white-space:nowrap;
|
||||
font-weight:lighter;
|
||||
max-width: 162px;
|
||||
width: 162px;
|
||||
|
||||
}
|
||||
|
||||
.turn_pad .turn_text{
|
||||
display:inline-block;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
.world_map{
|
||||
width:700px;
|
||||
background:black;
|
||||
@@ -61,6 +63,7 @@
|
||||
position:absolute;
|
||||
right:0;
|
||||
bottom:0;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.map_body .map_toggle_cityname::after{
|
||||
@@ -71,6 +74,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;
|
||||
|
||||
+26
-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;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
.container{
|
||||
width:1000px;
|
||||
margin:0 auto;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
#troop_list .cityText{
|
||||
display:none;
|
||||
}
|
||||
|
||||
@@ -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(){}
|
||||
|
||||
|
||||
+807
-1714
File diff suppressed because it is too large
Load Diff
+115
-262
@@ -1,21 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function GetStuffName($stuff) {
|
||||
$type1 = $stuff % 10;
|
||||
$type2 = intdiv($stuff, 10);
|
||||
|
||||
switch($type1) {
|
||||
case 0: $str = "쌀"; break;
|
||||
case 1: $str = getWeapName($type2); break;
|
||||
case 2: $str = getBookName($type2); break;
|
||||
case 3: $str = getHorseName($type2); break;
|
||||
case 4: $str = getItemName($type2); break;
|
||||
default:$str = "?"; break;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
function registerAuction() {
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
@@ -35,66 +20,7 @@ function registerAuction() {
|
||||
if($general['rice'] < 1000) { $general['rice'] = 1000; }
|
||||
if($general['rice'] > 20000) { $general['rice'] = 20000; }
|
||||
|
||||
/*
|
||||
// 유닉템 등록
|
||||
$query = "select * from auction where stuff!='0'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
// 유닉템 거래가 없을 경우 1% 확률로 등장
|
||||
if($count == 0 && rand()%100 < 1) {
|
||||
// 유닉템 선택
|
||||
$sel = rand() % 4 + 1;
|
||||
switch($sel) {
|
||||
case 1: $type = "weap"; break;
|
||||
case 2: $type = "book"; break;
|
||||
case 3: $type = "horse"; break;
|
||||
case 4: $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($occupied[$i] == 0) {
|
||||
$item[] = $i;
|
||||
}
|
||||
}
|
||||
$it = $item[rand() % count($item)];
|
||||
$stuff = $it * 10 + $sel;
|
||||
|
||||
//평균 금의 100%
|
||||
$amount = 1;
|
||||
$cost = $general['gold'];
|
||||
$topv = $general['maxgold'] * 10;
|
||||
if($cost < 5000) { $cost = 5000; }
|
||||
if($topv < 10000) { $topv = 10000; }
|
||||
|
||||
$cost = Util::round($cost / 10) * 10;
|
||||
$topv = Util::round($topv / 10) * 10;
|
||||
|
||||
$term = 12;
|
||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ암시장상인', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaYi = JosaUtil::pick(GetStuffName($stuff), '이');
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<C>".GetStuffName($stuff)."</>{$josaYi} 거래장에 등장했습니다!";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($stuff), '을');
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>이 <C>".GetStuffName($stuff)."</>{$josaUl} 판다는 소문이 돌고 있습니다!";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$query = "select * from auction where type='0' and stuff='0' and no1='0'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=0 AND no1=0');
|
||||
$count += 5;
|
||||
// 판매건 등록
|
||||
if(rand()%$count == 0) {
|
||||
@@ -106,19 +32,17 @@ function registerAuction() {
|
||||
if($cost <= $amount*0.8) { $cost = $amount*0.8; }
|
||||
if($cost >= $amount*1.2) { $cost = $amount*1.2; }
|
||||
|
||||
$amount = Util::round($amount / 10) * 10;
|
||||
$cost = Util::round($cost / 10) * 10;
|
||||
$topv = Util::round($topv / 10) * 10;
|
||||
$amount = Util::round($amount, -1);
|
||||
$cost = Util::round($cost, -1);
|
||||
$topv = Util::round($topv, -1);
|
||||
|
||||
$term = 3 + rand() % 10;
|
||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ상인', '0', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
$query = "insert into auction (type, no1, name1, amount, cost, value, topv, expire) values (0, '0', 'ⓝ상인', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
$query = "select * from auction where type='1' and stuff='0' and no1='0'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=1 AND no1=0');
|
||||
$count += 5;
|
||||
// 구매건 등록
|
||||
if(rand()%$count == 0) {
|
||||
@@ -130,13 +54,13 @@ function registerAuction() {
|
||||
if($cost <= $amount*0.8) { $cost = $amount*0.8; }
|
||||
if($cost >= $amount*1.2) { $cost = $amount*1.2; }
|
||||
|
||||
$amount = Util::round($amount / 10) * 10;
|
||||
$cost = Util::round($cost / 10) * 10;
|
||||
$topv = Util::round($topv / 10) * 10;
|
||||
$amount = Util::round($amount, -1);
|
||||
$cost = Util::round($cost, -1);
|
||||
$topv = Util::round($topv, -1);
|
||||
|
||||
$term = 3 + rand() % 10;
|
||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '0', 'ⓝ상인', '0', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
$query = "insert into auction (type, no1, name1, amount, cost, value, topv, expire) values (1, '0', 'ⓝ상인', '$amount', '$cost', '$cost', '$topv', '$date')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
@@ -153,7 +77,7 @@ function processAuction() {
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
$date = date("Y-m-d H:i:s");
|
||||
$date = TimeUtil::now();
|
||||
|
||||
$admin = $gameStor->getValues(['year', 'month']);
|
||||
|
||||
@@ -167,42 +91,54 @@ function processAuction() {
|
||||
$josaYi1 = JosaUtil::pick($auction['name1'], '이');
|
||||
$josaYi2 = JosaUtil::pick($auction['name2'], '이');
|
||||
|
||||
// 유닉템 처리
|
||||
if($auction['stuff'] != 0) {
|
||||
if($auction['no2'] == 0) {
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>{$josaUl} 판매, 그러나 입찰자 부재";
|
||||
pushAuctionLog($auctionLog);
|
||||
} else {
|
||||
$trader['no'] = 0;
|
||||
$trader['name'] = 'ⓝ암시장상인';
|
||||
$trader['gold'] = 99999999;
|
||||
$trader['rice'] = 99999999;
|
||||
|
||||
$query = "select no,name,gold,rice from general where no='{$auction['no2']}'";
|
||||
// 쌀 처리
|
||||
if($auction['no2'] == 0) {
|
||||
// 상인건수가 아닌것만 출력
|
||||
if($auction['no1'] != 0) {
|
||||
$query = "select no from general where no='{$auction['no1']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$bidder = MYDB_fetch_array($result);
|
||||
$trader = MYDB_fetch_array($result);
|
||||
|
||||
$sel1 = $auction['stuff'] % 10;
|
||||
$sel2 = intdiv($auction['stuff'], 10);
|
||||
switch($sel1) {
|
||||
case 1: $type = "weap"; break;
|
||||
case 2: $type = "book"; break;
|
||||
case 3: $type = "horse"; break;
|
||||
case 4: $type = "item"; break;
|
||||
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
if($auction['type'] == 0) {
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 그러나 입찰자 부재";
|
||||
} else {
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, 그러나 입찰자 부재";
|
||||
}
|
||||
// 이미 유닉템이 풀렸는지 검사
|
||||
$query = "select no from general where {$type}='$sel2'";
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
}
|
||||
} else {
|
||||
if($auction['no1'] == 0) {
|
||||
$trader['no'] = 0;
|
||||
$trader['name'] = 'ⓝ상인';
|
||||
$trader['gold'] = 99999;
|
||||
$trader['rice'] = 99999;
|
||||
} else {
|
||||
$query = "select no,name,gold,rice from general where no='{$auction['no1']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
$trader = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
// 판매거래만 존재
|
||||
if($count > 0) {
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$query = "select no,name,gold,rice from general where no='{$auction['no2']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$bidder = MYDB_fetch_array($result);
|
||||
//판매거래
|
||||
if($auction['type'] == 0) {
|
||||
if($auction['amount'] > $trader['rice'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$trader['gold'] -= $gold;
|
||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 아이템 이미 매진!";
|
||||
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
@@ -210,165 +146,82 @@ function processAuction() {
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$josaUl = JosaUtil::pick(GetStuffName($auction['stuff']), '을');
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, <C>".GetStuffName($auction['stuff'])."</> 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} <C>".GetStuffName($auction['stuff'])."</>$josaUl 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||
$auctionLog[0] .= " <M>★ 아이템 거래 ★</>";
|
||||
|
||||
$query = "update general set gold=gold-'{$auction['value']}',{$type}='$sel2' where no='{$auction['no2']}'";
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] >= $auction['topv']) {
|
||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||
}
|
||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$auction['name2']}</>{$josaYi2} <C>".GetStuffName($auction['stuff'])."</>$josaUl 구매했습니다!";
|
||||
$history[0] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<C><b>【암시장】</b></><Y>{$auction['name2']}</>{$josaYi2} <C>".GetStuffName($auction['stuff'])."</>$josaUl 구매했습니다!";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushGenLog($bidder, $bidderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
}
|
||||
} else {
|
||||
// 쌀 처리
|
||||
if($auction['no2'] == 0) {
|
||||
// 상인건수가 아닌것만 출력
|
||||
if($auction['no1'] != 0) {
|
||||
$query = "select no from general where no='{$auction['no1']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$trader = MYDB_fetch_array($result);
|
||||
|
||||
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
if($auction['type'] == 0) {
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 그러나 입찰자 부재";
|
||||
} else {
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, 그러나 입찰자 부재";
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
}
|
||||
//구매거래
|
||||
} else {
|
||||
if($auction['no1'] == 0) {
|
||||
$trader['no'] = 0;
|
||||
$trader['name'] = 'ⓝ상인';
|
||||
$trader['gold'] = 99999;
|
||||
$trader['rice'] = 99999;
|
||||
if($auction['amount'] > $bidder['rice'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
if($bidder['gold'] < 0) $bidder['gold'] = 0;
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $trader['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$trader['gold'] -= $gold;
|
||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$query = "select no,name,gold,rice from general where no='{$auction['no1']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$trader = MYDB_fetch_array($result);
|
||||
}
|
||||
|
||||
$query = "select no,name,gold,rice from general where no='{$auction['no2']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$bidder = MYDB_fetch_array($result);
|
||||
//판매거래
|
||||
if($auction['type'] == 0) {
|
||||
if($auction['amount'] > $trader['rice'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$trader['gold'] -= $gold;
|
||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
if($bidder['gold'] < 0) $bidder['gold'] = 0;
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] >= $auction['topv']) {
|
||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||
}
|
||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 판매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||
} elseif($auction['value'] <= $auction['topv']) {
|
||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushGenLog($bidder, $bidderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
//구매거래
|
||||
} else {
|
||||
if($auction['amount'] > $bidder['rice'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$bidder['gold'] -= $gold;
|
||||
if($bidder['gold'] < 0) $bidder['gold'] = 0;
|
||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
||||
} elseif($auction['value'] > $trader['gold'] - 1000) {
|
||||
$gold = Util::round($auction['value'] * 0.01);
|
||||
$trader['gold'] -= $gold;
|
||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
||||
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
||||
} else {
|
||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 판매";
|
||||
if($auction['value'] >= $auction['amount'] * 2) {
|
||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||
} elseif($auction['value'] <= $auction['topv']) {
|
||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||
}
|
||||
|
||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushGenLog($bidder, $bidderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no1']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no2']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
pushGenLog($trader, $traderLog);
|
||||
pushGenLog($bidder, $bidderLog);
|
||||
pushAuctionLog($auctionLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user