Compare commits

...
111 Commits
Author SHA1 Message Date
Hide_D a556877a17 현재 진행중인 깃수인 경우 장수가 안 죽었으면 안나타나는 문제 해결 2018-07-05 00:24:03 +09:00
Hide_D bcbd6dc4db 왕조일람 버그 수정 2018-07-05 00:12:34 +09:00
Hide_D 41f7ad8d75 왕조 일람에 아무것도 없을 때 '현재'가 안보이는 문제 해결 2018-07-05 00:10:33 +09:00
Hide_D 258d4b28da 왕조 일람에 현재 국가 표시 2018-07-05 00:05:48 +09:00
Hide_D 31e900c422 메시지 버그 수정 2018-07-03 22:09:07 +09:00
Hide_D 7b1a76871a parseJsonPost 기반 동작 포기 2018-07-03 21:35:17 +09:00
Hide_D c6f3e7672f 국가 정보 빈칸 2018-07-03 20:48:34 +09:00
Hide_D 540c31903c 월마다 최대 국력, 최대 병력, 최대 도시 수를 계산하는 코드 추가. ng_old_nations에도 반영 2018-07-03 20:43:14 +09:00
Hide_D 3e5262d7a3 nation 테이블에 aux 추가 2018-07-03 20:09:36 +09:00
Hide_D 2b36ffef45 왕조일람 임시 갱신 2018-07-03 06:59:27 +09:00
Hide_D 4c25d2275c 버튼 대체 css 추가. form 일부 제거 2018-07-03 02:55:45 +09:00
Hide_D 6c66fcdfc3 명예의 전당 시나리오명 제대로 표기 안되는 문제 해결 2018-07-02 19:45:41 +09:00
Hide_D aaa972d767 명예의 전당 배경색 오류 수정 2018-07-02 19:15:43 +09:00
Hide_D 45c8538426 빙의 해제시 닉네임 초기화 2018-07-02 03:23:20 +09:00
Hide_D 95702724a9 베팅수익률 오타 2018-07-01 15:34:20 +09:00
Hide_D 98c4d3853c 명장 일람 레퍼런스 값 미표기 문제 해결 2018-07-01 15:30:15 +09:00
Hide_D 7c91143f39 명장일람에서 제약 조건 수정 2018-07-01 15:27:41 +09:00
Hide_D 56e6f57568 회원 가입시 링크 변경 2018-07-01 03:58:47 +09:00
Hide_D ccab456679 세력도시 스크립트 동작 안하는 문제 해결 2018-07-01 01:35:47 +09:00
Hide_D 5af000ca43 html 5 비표준 스크립트 제거 2018-07-01 01:28:35 +09:00
Hide_D 354c8f04ae IE=edge 대소문자 주의 2018-06-30 01:52:07 +09:00
Hide_D 3fbd336b45 Revert "컬러 프로필 적용"
This reverts commit 4f279c49c8.
2018-06-30 01:32:46 +09:00
Hide_D 3c0b86a322 컬러 프로필 적용 2018-06-30 01:26:23 +09:00
Hide_D fca4b69d5a 범장 -> 만능장 2018-06-30 01:18:52 +09:00
Hide_D ce62072761 확장 스크립트를 위해 태그 일부 정리 2018-06-30 00:28:45 +09:00
Hide_D 93dd7a8478 extractMissingPostToGlobals 호환을 위해 server_id 인자명 변경 2018-06-29 16:23:48 +09:00
Hide_D 02fb84a312 font boosting 약화 2018-06-29 14:46:06 +09:00
Hide_D f3e68989e5 뷰포트 추가 지정 2018-06-29 14:41:09 +09:00
Hide_D 468050a9ce 뷰포트 크기 변경 2018-06-29 14:37:30 +09:00
Hide_D f37a602da3 모든 웹 페이지에 viewport 지정 2018-06-29 14:32:59 +09:00
Hide_D 2979691d7e 기본 폰트 크기 지정 2018-06-29 14:20:20 +09:00
Hide_D 72920a0432 unset대신 []로 초기화 2018-06-29 09:35:24 +09:00
Hide_D e81075ef04 history 함수 인자 제한 완화 2018-06-29 09:28:58 +09:00
Hide_D df1a99d877 기본 폰트 지정 2018-06-29 09:16:40 +09:00
Hide_D 10e825dc9f 예약 테이블 점검. 스키마 수정 2018-06-29 01:50:28 +09:00
Hide_D 07ba7933fb 토너먼트 inf 버그 수정 2018-06-29 01:25:43 +09:00
Hide_D 3059eac0fd jquery 버전 업데이트 2018-06-29 01:22:03 +09:00
Hide_D aa33aa6d4f Json 에러시 에러 표기하도록 2018-06-29 00:30:05 +09:00
Hide_D 0a1cdeeaa3 세력일람 코드 변경 2018-06-28 14:16:38 +09:00
Hide_D e4bef47b7e 세력일람 연동 2018-06-28 14:14:56 +09:00
Hide_D f551f994b5 세력도시 코드 일단 통합 2018-06-28 13:57:21 +09:00
Hide_D 4b7a3af691 IE에서 카카오 2018-06-28 13:39:58 +09:00
Hide_D 6f88a80118 randBool이 아니라 randF 써서 생기는 버그 수정 2018-06-28 01:57:41 +09:00
Hide_D e03715ee46 천통 안되는 버그 수정 2018-06-28 00:28:00 +09:00
Hide_D aafe6d8863 천통시 저장되는 데이터 변경 2018-06-27 03:43:01 +09:00
Hide_D 47005483cd 버그 수정 2018-06-27 03:05:39 +09:00
Hide_D 378075955a 서버 오픈시 천통국 체크가 이상한 버그 수정 2018-06-27 03:04:54 +09:00
Hide_D 2059797904 사망, 천통시 장수를 ng_old_generals에 보관 2018-06-27 02:53:58 +09:00
Hide_D 8c711242a9 왕조 일람에 연감을 볼 수 있도록 통합 2018-06-27 02:12:59 +09:00
Hide_D 481894c89b 모든 국가 멸망 케이스에 ng_old_nations 백업 추가 2018-06-27 01:55:28 +09:00
Hide_D ba53275322 천통시 깃수 자동 표기 2018-06-27 01:49:46 +09:00
Hide_D cfe2b4c1bd 사소한 코드 수정 2018-06-27 01:34:11 +09:00
Hide_D 60e83f8324 오타 수정 2018-06-27 01:26:02 +09:00
Hide_D ceac040d82 명전에 0 이하는 안받도록 변경 2018-06-27 01:25:50 +09:00
Hide_D 89d400c81a 연감 월 표기 버그 수정 2018-06-27 01:22:16 +09:00
Hide_D 4cf7bca399 왕조 일람에서 서버 정보와 국가 정보를 보관하도록 변경 2018-06-27 01:14:34 +09:00
Hide_D 761441622e 왕조일람 '전체보기' 기능 살림 2018-06-26 23:05:04 +09:00
Hide_D 1b814abf0b 천통 시 왕조 일람용 테이블에 server_id 기록. 연감에 server_id로 이전 연감 조회기능 추가 2018-06-26 23:01:43 +09:00
Hide_D 62a2147e33 천통국 정상 추가 2018-06-26 22:45:47 +09:00
Hide_D 246dff9c87 명장일람 버그? 2018-06-26 16:27:51 +09:00
Hide_D 50494beb27 명장 일람 보정 시도 2018-06-26 16:21:47 +09:00
Hide_D ce3b3ebfd8 명장 일람, 설전 승률 % 표기 오류 2018-06-26 16:18:58 +09:00
Hide_D 213090c32e 오타 수정 2018-06-26 09:45:15 +09:00
Hide_D adb8668197 크롬과 파이어폭스에 최적화 2018-06-26 09:44:26 +09:00
Hide_D 0023677003 임관 권유문 길이 제한 2018-06-26 04:13:41 +09:00
Hide_D 0b19a37ad4 초반 3년 수뇌 임명 방식 변경 2018-06-26 03:52:17 +09:00
Hide_D 9f34ae5d28 천통시 재야 장수도 저장 2018-06-26 03:33:56 +09:00
Hide_D 6f07b5cf08 ng_games에 시나리오명 남도록 수정 2018-06-26 03:20:57 +09:00
Hide_D 0f39431157 chmod 재설정 2018-06-26 03:19:47 +09:00
Hide_D bc1a470e64 디렉토리 권한 문제 해결 2018-06-26 03:15:38 +09:00
Hide_D 09e24f5684 ng_games 누락분 추가 2018-06-26 03:10:50 +09:00
Hide_D 2f27ea4c8a schema 값 꼬이는 문제 해결 2018-06-26 03:06:34 +09:00
Hide_D d09aba70b7 천통시에도 ng_old_nations에 데이터가 저장되도록 변경 2018-06-26 03:00:02 +09:00
Hide_D 69b0a80684 명장 일람, 명예의 전당 최종 개선 2018-06-26 02:36:20 +09:00
Hide_D 48f0c56a9e 국가 멸망시 국가 정보 백업 2018-06-26 00:47:54 +09:00
Hide_D 83833a3693 등용장 및 메시지 일괄 전송 TODO 해결 2018-06-26 00:45:31 +09:00
Hide_D 18429d52d4 명장 일람, 명예의 전당 코드 재구현. 연감 등에 이전 국가 기록 남기도록 설정 2018-06-26 00:32:43 +09:00
Hide_D 58cc90083b 서버 별명에 연월일 추가 2018-06-25 16:08:19 +09:00
Hide_D 2772161144 왕조 일람 테이블 구조 변경. 2018-06-25 01:53:16 +09:00
Hide_D 0e95259b14 게임 오픈 시 logs에 서브 디렉토리를 사용하도록 변경 2018-06-25 01:45:23 +09:00
Hide_D 3d9f38f1e3 건국 등 문자열 입력 변경 2018-06-25 00:46:07 +09:00
Hide_D ba3accd834 스페이스 바 등 몇몇 문자열 가능하게 처리 & 문자열 보정 2018-06-24 04:44:34 +09:00
Hide_D 0786e40ebd 국방 표기 변경 2018-06-24 04:18:54 +09:00
Hide_D 8a56393159 임관 권유 메시지를 템플릿으로 이동 2018-06-24 04:12:19 +09:00
Hide_D 5ca8a6ecfa purifier 1차 적용 2018-06-24 03:47:44 +09:00
Hide_D 5c82edc4be html purifier 보강 2018-06-24 02:56:38 +09:00
Hide_D 093c04bc24 포상 계수 조절 2018-06-23 23:49:22 +09:00
Hide_D 131dd46a38 무지장의 경우에는 쌀 적게 주도록 수정 2018-06-23 22:58:11 +09:00
Hide_D 6b1b4fdfbb 베팅 표기 오류 변경 2018-06-23 22:55:59 +09:00
Hide_D e4ad779b37 npc 발령 로직 변경. 유저 무지장 포상 로직 변경 2018-06-23 22:52:43 +09:00
Hide_D 65d817624e 인사부 조건 검사 순서 변경 2018-06-23 14:36:05 +09:00
Hide_D 66501189c4 적극적 금쌀 교환 2018-06-23 14:22:41 +09:00
Hide_D 4303898bb8 금쌀 계수 조정 2018-06-23 14:10:52 +09:00
Hide_D 7d76a9d3ed 인사부 임명 해제 불가 버그 수정 2018-06-23 13:28:36 +09:00
Hide_D 1cc42f341b 내정, 전투 기준 일부 변경 2018-06-23 13:08:16 +09:00
Hide_D 0b41ee0a29 내정 발령시 내정 찬곳으로는 안함 2018-06-23 12:57:11 +09:00
Hide_D 66b6c4d04f query 간소화 2018-06-23 05:37:34 +09:00
Hide_D 6502843d6c 포상 전략 변경 2018-06-23 05:22:49 +09:00
Hide_D 5ecfe72e19 발령 전략 변경 2018-06-23 05:06:10 +09:00
Hide_D f28cdefffe npc 발령 전략 변경 2018-06-23 05:00:57 +09:00
Hide_D 40494f2cf1 전방 설정을 5개월 내로 변경 2018-06-23 04:51:07 +09:00
Hide_D f2664c112b NPC 사령턴 로직 새로 작성 2018-06-23 04:45:27 +09:00
Hide_D 41d91df355 상인 거래시 110% 가 잘 적용되도록 변경. 삭제된 거상 문구 수정 2018-06-23 02:23:06 +09:00
Hide_D 965671dd93 key,value pair를 보존한 섞기 추가 2018-06-23 02:22:49 +09:00
Hide_D c8d08e4b2c 저격 특기, 활 유니크, 수극 확률이 각각 적용되도록 수정 2018-06-23 02:22:32 +09:00
Hide_D 2897a9b484 환상향 시나리오 전콘 방식 재 적용 2018-06-21 20:16:01 +09:00
Hide_D d190e59d83 장수 등록시 최저 스탯이 10으로 표시되는 버그 수정 2018-06-21 02:55:52 +09:00
Hide_D 0bb25e8773 천인 강림 개선 2018-06-21 02:47:29 +09:00
Hide_D 37e1903cb1 HTML Purifier 추가 2018-06-21 02:27:02 +09:00
Hide_D b402846d43 PHP 7.2 버전용으로 올림! 2018-06-21 02:17:31 +09:00
Hide_D c1a6dd385a 설문 제목이 제대로 표시되지 않는 버그 수정 2018-06-19 02:42:55 +09:00
644 changed files with 48603 additions and 4256 deletions
+2
View File
@@ -15,6 +15,7 @@ d_log/*.txt
d_log/*.zip
sess_*
*/logs/*.txt
*/logs/*/*.txt
err.txt
che/.htaccess
kwe/.htaccess
@@ -43,3 +44,4 @@ test.php
/twe
phpinfo.php
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
+1 -1
View File
@@ -5,7 +5,7 @@
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/logs/*.txt": true,
"**/logs/**/*.txt": true,
"**/session/sess*":true,
"/che":true,
"/kwe":true,
+3 -3
View File
@@ -7,7 +7,7 @@
* Apache2
* <code>mpm_event</code> 권장
* PHP 7.0 이상
* PHP 7.2 이상
* <code>php-fpm</code> 권장
* php에서 curl을 실행가능해야 합니다.
* MySQL 5.6 이상, 또는 MariaDB 10.0 이상
@@ -32,13 +32,13 @@ sudo -u www-data git clone ssh://git@storage.hided.net:2525/devsam/core.git
git clone ssh://git@storage.hided.net:2525/devsam/image.git
```
> 이미지는 별도의 업데이트 기능을 제공하지 않습니다. 수동으로 <code>git pull</code>을 해야합니다.
> 이미지는 git hook을 이용한 업데이트 기능을 제공하지만 아직 범용성 있는 설계가 되어있진 않습니다.
### 설치
이후 해당 경로를 웹 브라우저를 통해 접근하여 설치를 진행할 수 있습니다.
Database 수는 로그인 관리 서버 1개, 내부 서버 5개로, 총 6개의 Database가 필요합니다. 내부 설정을 고쳐서 서버 수를 늘리거나 줄일 경우 그에 맞는 Database 수가 필요합니다. 또한 Database마다 관리할 별도의 계정을 만드는 것을 추천합니다.
Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의 Database가 필요합니다. 내부 설정을 고쳐서 서버 수를 늘리거나 줄일 경우 그에 맞는 Database 수가 필요합니다. 또한 Database마다 관리할 별도의 계정을 만드는 것을 추천합니다.
설치 이후에는 서버관리 페이지에서 **업데이트** 명령을 통해 원 클릭 업데이트가 가능합니다.
+3 -1
View File
@@ -17,7 +17,9 @@
"vlucas/valitron": "^1.4",
"php-extended/php-tail": "^2.1",
"pguardiario/phpuri": "^1.0",
"symfony/lock": "^3.4"
"symfony/lock": "^4.1",
"ezyang/htmlpurifier": "^4.10",
"xemlock/htmlpurifier-html5": "^0.1.7"
},
"autoload": {
"psr-4": {
Generated
+135 -153
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "a329d39be5161c87438d41f9adf4417b",
"content-hash": "43da7d5e9d8441faa4311f32b16ee1c0",
"packages": [
{
"name": "brandonwamboldt/utilphp",
@@ -52,6 +52,53 @@
],
"time": "2015-02-02T17:56:14+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.10.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2018-02-23T01:58:20+00:00"
},
{
"name": "firephp/firephp-core",
"version": "v0.4.0",
@@ -90,16 +137,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "6.3.2",
"version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90"
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90",
"reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
@@ -109,7 +156,7 @@
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
@@ -151,7 +198,7 @@
"rest",
"web service"
],
"time": "2018-03-26T16:33:04+00:00"
"time": "2018-04-22T15:46:56+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -271,16 +318,16 @@
},
{
"name": "leafo/scssphp",
"version": "v0.7.5",
"version": "v0.7.6",
"source": {
"type": "git",
"url": "https://github.com/leafo/scssphp.git",
"reference": "8b538d828bbb75276974605c4a1a435e939da74e"
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/8b538d828bbb75276974605c4a1a435e939da74e",
"reference": "8b538d828bbb75276974605c4a1a435e939da74e",
"url": "https://api.github.com/repos/leafo/scssphp/zipball/585f6ae84de62ffecf69c23805f25d78d7e4b794",
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794",
"shasum": ""
},
"require": {
@@ -319,7 +366,7 @@
"scss",
"stylesheet"
],
"time": "2018-02-09T02:04:21+00:00"
"time": "2018-05-24T02:18:53+00:00"
},
{
"name": "league/plates",
@@ -454,54 +501,6 @@
],
"time": "2017-06-19T01:22:40+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v2.0.12",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
"reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"autoload": {
"files": [
"lib/random.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"pseudorandom",
"random"
],
"time": "2018-04-04T21:24:14+00:00"
},
{
"name": "pguardiario/phpuri",
"version": "1.0",
@@ -528,16 +527,16 @@
},
{
"name": "php-extended/php-system",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/php-extended/php-system.git",
"reference": "66727d5dc0a665916bd7e08bcfb9820e7be1d20c"
"url": "https://gitlab.com/php-extended/php-system.git",
"reference": "9e6b3c2009ef56dc123efc43900e40cdf217ace0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-extended/php-system/zipball/66727d5dc0a665916bd7e08bcfb9820e7be1d20c",
"reference": "66727d5dc0a665916bd7e08bcfb9820e7be1d20c",
"url": "https://gitlab.com/api/v4/projects/php-extended%2Fphp-system/repository/archive.zip?sha=9e6b3c2009ef56dc123efc43900e40cdf217ace0",
"reference": "9e6b3c2009ef56dc123efc43900e40cdf217ace0",
"shasum": ""
},
"type": "library",
@@ -553,31 +552,31 @@
"authors": [
{
"name": "Anastaszor",
"role": "developer"
"role": "Developer"
}
],
"description": "A generic way to find informations about the running system",
"homepage": "https://github.com/php-extended/php-system",
"homepage": "https://gitlab.com/php-extended/php-system",
"keywords": [
"operating system",
"os",
"php",
"system"
],
"time": "2017-01-14T11:56:24+00:00"
"time": "2018-06-07T06:03:27+00:00"
},
{
"name": "php-extended/php-tail",
"version": "2.1.1",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-extended/php-tail.git",
"reference": "eabf7bee64f8c30fe9b9e1176562fdb903c54ae7"
"url": "https://gitlab.com/php-extended/php-tail.git",
"reference": "19fbd3a79ccc071954f28296b2c44754335304a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-extended/php-tail/zipball/eabf7bee64f8c30fe9b9e1176562fdb903c54ae7",
"reference": "eabf7bee64f8c30fe9b9e1176562fdb903c54ae7",
"url": "https://gitlab.com/api/v4/projects/php-extended%2Fphp-tail/repository/archive.zip?sha=19fbd3a79ccc071954f28296b2c44754335304a0",
"reference": "19fbd3a79ccc071954f28296b2c44754335304a0",
"shasum": ""
},
"require": {
@@ -596,11 +595,11 @@
"authors": [
{
"name": "Anastaszor",
"role": "developer"
"role": "Developer"
}
],
"description": "A smart way to tail files depending of the environment",
"homepage": "https://github.com/php-extended/php-tail",
"homepage": "https://gitlab.com/php-extended/php-tail",
"keywords": [
"cheat",
"mighty",
@@ -608,7 +607,7 @@
"php",
"tail"
],
"time": "2017-07-25T13:52:42+00:00"
"time": "2018-06-07T06:04:58+00:00"
},
{
"name": "psr/http-message",
@@ -752,22 +751,21 @@
},
{
"name": "symfony/lock",
"version": "v3.4.9",
"version": "v4.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/lock.git",
"reference": "3a707193326d31603824706e34a95af899a59788"
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/lock/zipball/3a707193326d31603824706e34a95af899a59788",
"reference": "3a707193326d31603824706e34a95af899a59788",
"url": "https://api.github.com/repos/symfony/lock/zipball/a1df50492e927ad00ca271f29adb2949a14f2a5a",
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8",
"psr/log": "~1.0",
"symfony/polyfill-php70": "~1.0"
"php": "^7.1.3",
"psr/log": "~1.0"
},
"require-dev": {
"predis/predis": "~1.0"
@@ -775,7 +773,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@@ -810,96 +808,40 @@
"redlock",
"semaphore"
],
"time": "2018-04-29T14:44:26+00:00"
},
{
"name": "symfony/polyfill-php70",
"version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
"reference": "77454693d8f10dd23bb24955cffd2d82db1007a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6",
"reference": "77454693d8f10dd23bb24955cffd2d82db1007a6",
"shasum": ""
},
"require": {
"paragonie/random_compat": "~1.0|~2.0",
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php70\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2018-04-26T10:06:28+00:00"
"time": "2018-05-30T07:26:09+00:00"
},
{
"name": "vlucas/valitron",
"version": "v1.4.2",
"version": "v1.4.3",
"source": {
"type": "git",
"url": "https://github.com/vlucas/valitron.git",
"reference": "87775d76268beda2afa085bdd6e44b17e98907c6"
"reference": "3c5463315bfa23b17f8949b100a960d035234e43"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/87775d76268beda2afa085bdd6e44b17e98907c6",
"reference": "87775d76268beda2afa085bdd6e44b17e98907c6",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/3c5463315bfa23b17f8949b100a960d035234e43",
"reference": "3c5463315bfa23b17f8949b100a960d035234e43",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
},
"suggest": {
"ext-mbstring": "It can support the multiple bytes string length."
},
"type": "library",
"autoload": {
"psr-0": {
"Valitron": "src/"
"psr-4": {
"Valitron\\": "src/Valitron"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD"
"BSD-3-Clause"
],
"authors": [
{
@@ -915,7 +857,47 @@
"validation",
"validator"
],
"time": "2017-10-30T23:15:06+00:00"
"time": "2018-05-06T10:45:26+00:00"
},
{
"name": "xemlock/htmlpurifier-html5",
"version": "v0.1.7",
"source": {
"type": "git",
"url": "https://github.com/xemlock/htmlpurifier-html5.git",
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/xemlock/htmlpurifier-html5/zipball/b4b35e51ec75e0207c23035f7d9a354bdcdac359",
"reference": "b4b35e51ec75e0207c23035f7d9a354bdcdac359",
"shasum": ""
},
"require": {
"ezyang/htmlpurifier": "^4.7",
"php": ">=5.2"
},
"require-dev": {
"phpunit/phpunit": "4.7.*|5.7.*"
},
"type": "library",
"autoload": {
"classmap": [
"library/HTMLPurifier/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "xemlock",
"email": "xemlock@gmail.com"
}
],
"description": "HTML Purifier definitions for HTML5 elements",
"time": "2018-06-07T14:30:17+00:00"
}
],
"packages-dev": [],
BIN
View File
Binary file not shown.
+74
View File
@@ -89,4 +89,78 @@ input.with_skin:disabled {
caption.section_title {
caption-side:top;
}
.samButton{
float:left;
display:block;
padding:0;
margin:0;
text-decoration: none;
position:relative;
}
a.samButton.disabled {
pointer-events: none;
cursor: default;
}
.samButtonOuter{
display: table;
border: outset 2px white;
box-sizing: border-box;
font-weight:bold;
padding: 1px 6px;
width:125px;
height:30px;
background-color:#000000;
color:#ffffff;
}
.samButtonOuter:active{
border: inset 2px white;
}
.samButtonInner{
display: table-cell;
vertical-align: middle;
width: 100%;
margin: 0 auto;
text-align: center;
user-select: none;
}
.samToolbarButton > .samButtonOuter{
width:125px;
height:30px;
background-color:#225500;
color:white;
}
.samToolbarButton2 > .samButtonOuter{
width:125px;
height:30px;
background-color:#225500;
color:magenta;
}
.samCommandButton > .samButtonOuter{
width:111px;
height:30px;
}
.samCommandButton.disabled > .samButtonOuter{
background-color:transparent !important;
color:gray !important;
border-color:transparent !important;
}
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::before{
content:'【'
}
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
content:'】'
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

+2
View File
File diff suppressed because one or more lines are too long
+7
View File
File diff suppressed because one or more lines are too long
+13
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -8,9 +8,10 @@ require(__dir__.'/../vendor/autoload.php');
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>설치</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('../e_lib/sha512.min.js')?>
+6 -2
View File
@@ -11,7 +11,9 @@ if($session->userGrade < 4) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -38,7 +40,9 @@ $plock = MYDB_fetch_array($result);
<html>
<head>
<title>삼국지 모의전투 HiDCHe</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -34,7 +36,9 @@ $admin = getAdmin();
<html>
<head>
<title>게임관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -32,7 +34,9 @@ $db = DB::db();
<html>
<head>
<title>회원관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+7 -8
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -35,7 +37,9 @@ $conlimit = $gameStor->conlimit;
<html>
<head>
<title>멀티관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -53,12 +57,7 @@ $conlimit = $gameStor->conlimit;
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
$style = "style=;";
if($general['block'] > 0) { $style .= "background-color:red;"; }
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
+14 -1
View File
@@ -13,11 +13,11 @@ if($session->userGrade < 5) {
$btn = Util::getReq('btn');
$genlist = Util::getReq('genlist', 'array_int');
$msg = Util::getReq('msg','string', '메시지');
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
//NOTE: 왜 기능이 admin2와 admin4가 같이 있는가?
//NOTE: 왜 블럭 시 admin4에선 금쌀을 없애지 않는가?
@@ -57,7 +57,20 @@ switch($btn) {
case "메세지 전달":
//TODO:새 갠메 시스템으로 변경
$date = date('Y-m-d H:i:s');
$src = MessageTarget::buildQuick($session->generalID);
for($i=0; $i < count($genlist); $i++) {
$msgObj = new Message(
Message::MSGTYPE_PRIVATE,
$src,
MessageTarget::buildQuick($genlist[$i]),
$msg,
new DateTime(),
new \DateTime('9999-12-31'),
[]
);
if($msgObj){
$msgObj->send(true);
}
}
break;
}
+6 -2
View File
@@ -25,7 +25,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -51,7 +53,9 @@ $sel2[$type2] = "selected";
<html>
<head>
<title>일제정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -19,7 +19,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -42,7 +44,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>접속정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -23,7 +23,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -49,7 +51,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>로그정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -19,7 +19,9 @@ if ($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -45,7 +47,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>외교정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+3 -1
View File
@@ -1140,7 +1140,9 @@ switch($dex240) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title>전투시뮬레이션</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+204 -283
View File
@@ -14,36 +14,28 @@ $userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("명장일람", 2);
increaseRefresh("명장일람", 1);
$query = "select con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['con']);
if ($con >= 2) {
printLimitMsg($me['turntime']);
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1136" />
<title><?=UniqueConst::$serverName?>: 명장일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/hallOfFame.css')?>
</head>
<body>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1100 class='tb_layout bg0'>
<tr><td>명 장 일 람<br><?=closeButton()?></td></tr>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1100 class='tb_layout bg0'>
<form name=form1 action=a_bestGeneral.php method=post>
<tr><td align=center>
<input type=submit name=btn value='유저 보기'>
@@ -51,294 +43,223 @@ if ($con >= 2) {
</td></tr>
</form>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<div style="margin:auto;width=1000px;">
<?php
if (isset($btn) && $btn == "NPC 보기") {
//FIXME: query가 너무 적나라.
$sel = "npc>=2";
} else {
$sel = "npc<2";
}
$nationName = ['재야'];
$nationColor = ['#000000'];
$nationName = [0=>'재야'];
$nationColor = [0=>'#000000'];
foreach (getAllNationStaticInfo() as $nation) {
$nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation['nation']] = $nation['color'];
}
$type = array(
"명 성",
"계 급",
"계 략 성 공",
"전 투 횟 수",
"승 리",
"승 률",
"사 살",
"살 상 률",
"보 병 숙 련 도",
"궁 병 숙 련 도",
"기 병 숙 련 도",
"귀 병 숙 련 도",
"차 병 숙 련 도",
"전 력 전 승 률",
"통 솔 전 승 률",
"일 기 토 승 률",
"설 전 승 률",
"베 팅 투 자 액",
"베 팅 당 첨",
"베 팅 수 익 금",
"베 팅 수 익 률"
);
$types = [
["명 성", "int", function($v){$v['value'] = $v['experience']; return $v; }],
["계 급", "int", function($v){$v['value'] = $v['dedication']; return $v; }],
["계 략 성 공", "int", function($v){
$v['value'] = $v['firenum'];
$v['nationName'] = '???';
$v['pictureFullPath'] = GetImageURL(0)."/default.jpg";
$v['name'] = '???';
$v['owner_name'] = null;
$v['bgColor'] = GameConst::$basecolor4;
$v['fgColor'] = newColor($v['bgColor']);
return $v;
}],
["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }],
["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }],
["승 률", "percent", function($v){
if($v['warnum'] < 10){
$v['value'] = 0;
}
else{
$v['value'] = $v['killnum'] / max(1, $v['warnum']);
}
return $v;
}],
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
["살 상 률", "percent", function($v){
if($v['warnum'] < 10){
$v['value'] = 0;
}
else{
$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']);
}
return $v;
}],
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex0']; return $v; }],
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex10']; return $v; }],
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex20']; return $v; }],
["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex30']; return $v; }],
["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex40']; return $v; }],
["전 력 전 승 률", "percent", function($v){
$totalCnt = $v['ttw']+$v['ttd']+$v['ttl'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['ttw']/max(1, $totalCnt);
}
return $v;
}],
["통 솔 전 승 률", "percent", function($v){
$totalCnt = $v['tlw']+$v['tld']+$v['tll'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tlw']/max(1, $totalCnt);
}
return $v;
}],
["일 기 토 승 률", "percent", function($v){
$totalCnt = $v['tpw']+$v['tpd']+$v['tpl'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tpw']/max(1, $totalCnt);
}
return $v;
}],
["설 전 승 률", "percent", function($v){
$totalCnt = $v['tiw']+$v['tid']+$v['til'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tiw']/max(1, $totalCnt);
}
return $v;
}],
["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }],
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
["베 팅 수 익 률", "percent", function($v){
if($v['betgold'] < 1000){
$v['value'] = 0;
}
else{
$v['value'] = $v['betwingold']/max(1, $v['betgold']);
}
return $v;
}],
];
for ($i=0; $i < 21; $i++) {
$name = [];
$data = [];
$color = [];
$pic = [];
//FIXME: 쿼리에 index를 사용할 수 없는 녀석들이 있다. 그냥 모두 받아서 일괄 처리하는게 더 나을 수도 있음.
switch ($i) {
case 0: $query = "select nation,no,name,picture,imgsvr,experience as data from general where $sel order by data desc limit 0,10"; break;
case 1: $query = "select nation,no,name,picture,imgsvr,dedication as data from general where $sel order by data desc limit 0,10"; break;
case 2: $query = "select nation,no,name,picture,imgsvr,firenum as data from general where $sel order by data desc limit 0,10"; break;
case 3: $query = "select nation,no,name,picture,imgsvr,warnum as data from general where $sel order by data desc limit 0,10"; break;
case 4: $query = "select nation,no,name,picture,imgsvr,killnum as data from general where $sel order by data desc limit 0,10"; break;
case 5: $query = "select nation,no,name,picture,imgsvr,killnum/warnum*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
case 6: $query = "select nation,no,name,picture,imgsvr,killcrew as data from general where $sel order by data desc limit 0,10"; break;
case 7: $query = "select nation,no,name,picture,imgsvr,killcrew/deathcrew*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
case 8: $query = "select nation,no,name,picture,imgsvr,dex0 as data from general where $sel order by data desc limit 0,10"; break;
case 9: $query = "select nation,no,name,picture,imgsvr,dex10 as data from general where $sel order by data desc limit 0,10"; break;
case 10: $query = "select nation,no,name,picture,imgsvr,dex20 as data from general where $sel order by data desc limit 0,10"; break;
case 11: $query = "select nation,no,name,picture,imgsvr,dex30 as data from general where $sel order by data desc limit 0,10"; break;
case 12: $query = "select nation,no,name,picture,imgsvr,dex40 as data from general where $sel order by data desc limit 0,10"; break;
case 13: $query = "select nation,no,name,picture,imgsvr,ttw/(ttw+ttd+ttl)*10000 as data from general where $sel and (ttw+ttd+ttl)>=50 order by data desc limit 0,10"; break;
case 14: $query = "select nation,no,name,picture,imgsvr,tlw/(tlw+tld+tll)*10000 as data from general where $sel and (tlw+tld+tll)>=50 order by data desc limit 0,10"; break;
case 15: $query = "select nation,no,name,picture,imgsvr,tpw/(tpw+tpd+tpl)*10000 as data from general where $sel and (tpw+tpd+tpl)>=50 order by data desc limit 0,10"; break;
case 16: $query = "select nation,no,name,picture,imgsvr,tiw/(tiw+tid+til)*10000 as data from general where $sel and (tiw+tid+til)>=50 order by data desc limit 0,10"; break;
case 17: $query = "select nation,no,name,picture,imgsvr,betgold as data from general where $sel order by data desc limit 0,10"; break;
case 18: $query = "select nation,no,name,picture,imgsvr,betwin as data from general where $sel order by data desc limit 0,10"; break;
case 19: $query = "select nation,no,name,picture,imgsvr,betwingold as data from general where $sel order by data desc limit 0,10"; break;
case 20: $query = "select nation,no,name,picture,imgsvr,betwingold/betgold*10000 as data from general where $sel and betgold >= 1000 order by data desc limit 0,10"; break;
$generals = array_map(function($general) use($nationColor, $nationName) {
$general['bgColor'] = $nationColor[$general['nation']]??GameConst::$basecolor4;
$general['fgColor'] = newColor($general['bgColor']);
$general['nationName'] = $nationName[$general['nation']];
if(key_exists('picture', $general)){
$imageTemp = GetImageURL($general['imgsvr']);
$general['pictureFullPath'] = "$imageTemp/{$general['picture']}";
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
<tr>";
for ($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result);
if ($i != 2) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen['nation']];
$data[$k] = $gen['data'];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "-";
$nation[$k] = "-";
$data[$k] = "-";
$color[$k] = GameConst::$basecolor4;
$pic[$k] = "";
}
} else {
$name[$k] = "???";
$nation[$k] = "???";
$data[$k] = $gen['data'];
$color[$k] = GameConst::$basecolor4;
$gen['imgsvr'] = 0;
$pic[$k] = "9999.jpg";
}
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></td>";
}
else{
$general['pictureFullPath'] = GetImageURL(0)."/default.jpg";
}
echo "</tr><tr>";
return $general;
}, $db->query(
"SELECT nation,no,name,name2 as owner_name, picture, imgsvr,
experience, dedication, firenum, warnum, killnum, killcrew, deathcrew,
dex0, dex10, dex20, dex30, dex40,
ttw, ttd, ttl, tlw, tld, tll, tpw, tpd, tpl, tiw, tid, til,
betgold, betwin, betwingold,
horse, weap, book, item
FROM general WHERE %l", $btn == "NPC 보기"?"npc>=2":"npc<2"));
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
$templates = new \League\Plates\Engine('templates');
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
}
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
$validCnt = 0;
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){
$general = ($typeFunc)($general);
$value = $general['value'];
echo "</tr><tr>";
for ($k=0; $k < 10; $k++) {
if($data[$k] === '-'){
//do Nothing
if($value > 0){
$validCnt+=1;
}
else if ($i == 5 || $i == 7 || $i == 20) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
if($typeValue == 'percent'){
$general['printValue'] = number_format($value*100, 2).'%';
}
else if ($i >= 13 && $i <= 16) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
else {
$general['printValue'] = number_format($value);
}
echo "<td align=center>{$data[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
return $general;
}, $generals);
usort($typeGenerals, function($lhs, $rhs){
//내림차순
return -($lhs['value'] <=> $rhs['value']);
});
echo $templates->render('hallOfFrame', [
'typeName'=>$typeName,
'generals'=>array_slice($typeGenerals, 0, min(10, $validCnt))
]);
}
echo "
</table>
<br>
<table align=center width=1000 class='tb_layout bg0'>
";
$type = array(
"명 마",
"명 검",
"명 서",
"도 구"
);
$call = array(
"horse",
"weap",
"book",
"item"
);
$func = array(
"\\sammo\\getHorseName",
"\\sammo\\getWeapName",
"\\sammo\\getBookName",
"\\sammo\\getItemName"
);
for ($i=0; $i < 4; $i++) {
$name = [];
$data = [];
$color = [];
$pic = [];
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2>";
for ($k=26; $k > 16; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for ($k=26; $k > 16; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
$nation[$k] = "-";
$color[$k] = "";
$pic[$k] = "";
}
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for ($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for ($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
echo "
<tr align=center id=bg2>";
for ($k=16; $k > 6; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for ($k=16; $k > 6; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
$nation[$k] = "-";
$color[$k] = "";
$pic[$k] = "";
}
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for ($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for ($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
}
?>
</table>
<table align=center width=1000 class='tb_layout bg0'>
</div>
<div style="margin:auto;width=1000px;margin-top:5px;">
<?php
//유니크 아이템 소유자
$itemTypes = [
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
["도 구", 'item', function($v){return getItemName($v);}, 7, 26, []],
];
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
foreach($generals as $general){
foreach($itemTypes as $itemIdx=>[,$itemType, $itemFunc,,,]){
$itemCode = $general[$itemType];
if($itemCode <= 6){
continue;
}
$itemName = ($itemFunc)($itemCode);
$general['rankName'] = $itemName;
$general['value'] = $itemCode;
$itemTypes[$itemIdx][5][$itemCode] = $general;
}
}
foreach($itemTypes as [$itemNameType, $itemType, $itemFunc, $itemMinCode, $itemMaxCode, $itemOwners]){
$itemRanker = [];
for($itemCode = $itemMaxCode; $itemCode >= $itemMinCode; $itemCode--){
if(!key_exists($itemCode, $itemOwners)){
$emptyCard = [
'rankName' => ($itemFunc)($itemCode),
'pictureFullPath' => GetImageURL(0)."/default.jpg",
'value'=>$itemCode,
'name'=>'미발견',
'bgColor'=>GameConst::$basecolor4,
'fgColor'=>newColor(GameConst::$basecolor4),
];
$itemRanker[$itemCode] = $emptyCard;
continue;
}
$general = $itemOwners[$itemCode];
$itemRanker[$itemCode] = $general;
}
echo $templates->render('hallOfFrame', [
'typeName'=>$itemNameType,
'generals'=>$itemRanker
]);
}
?>
</div>
<table align=center width=1100 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
+61 -149
View File
@@ -4,20 +4,17 @@ namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
increaseRefresh("왕조일람", 2);
increaseRefresh("왕조일람", 1);
?>
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -27,180 +24,95 @@ increaseRefresh("왕조일람", 2);
<body>
<table align=center width=1000 class="tb_layout bg0">
<tr><td>역 대 왕 조<br>
<input type=button value='창 닫기' onclick=window.close()><br>
<button onclick=window.close()>창 닫기</button><br>
</td></tr>
</table>
<?php
if ($select == 0) {
$query = "select * from emperior order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$empcount = MYDB_num_rows($result);
$showCurrentNation = true;
for ($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
$emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC');
echo "
<form action=a_emperior.php method=post>
<table align=center width=1000 class='tb_layout bg0'>
if($emperiors){
$serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null);
if($serverID == UniqueConst::$serverID){
$showCurrentNation = false;
}
}
if ($showCurrentNation) {
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
?>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
<tr>
<td style="background-color:#333333;" align=center colspan=8>
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
<a href="a_emperior_detail.php"><button>자세히</button></a>
<a href="a_history.php"><button>역사 보기</button></a>
</td>
</tr>
</table>
<?php
}
foreach($emperiors as $emperior){
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=8>
<font size=5>{$emperior['phase']}</font>
<input type=submit value='자세히'>
<input type=hidden name=select value='{$emperior['no']}'>
<font size=5><?=$emperior['phase']?></font>
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button>자세히</button></a>
<?php if($emperior['server_id']): ?>
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button>역사 보기</button></a>
<?php endif ?>
</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=8>
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
<td align=center style=color:".newColor($emperior['color'])."; bgcolor=<?=$emperior['color']?> colspan=8>
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
</td>
</tr>
<tr>
<td id=bg1 align=center width=80>국 력</td>
<td align=center width=170>{$emperior['power']}</td>
<td align=center width=170><?=$emperior['power']?></td>
<td id=bg1 align=center width=80>장 수</td>
<td align=center width=170>{$emperior['gennum']}</td>
<td align=center width=170><?=$emperior['gennum']?></td>
<td id=bg1 align=center width=80>속 령</td>
<td align=center width=170>{$emperior['citynum']}</td>
<td align=center width=170><?=$emperior['citynum']?></td>
<td id=bg1 align=center width=80>성 향</td>
<td align=center width=170>{$emperior['type']}</td>
<td align=center width=170><?=$emperior['type']?></td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td align=center>{$emperior['l12name']}</td>
<td align=center><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td align=center>{$emperior['l11name']}</td>
<td align=center><?=$emperior['l11name']?></td>
<td id=bg1 align=center>위 장 군</td>
<td align=center>{$emperior['l10name']}</td>
<td align=center><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td align=center>{$emperior['l9name']}</td>
<td align=center><?=$emperior['l9name']?></td>
</tr>
</table>
</form>";
}
} else {
$query = "select * from emperior where no='$select'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$emperior = MYDB_fetch_array($result);
echo "
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<font size=5>{$emperior['phase']}</font>
<input type=submit value='전체보기'>
<input type=hidden name=select value='0'>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>{$emperior['nation_count']}</td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>{$emperior['gen_count']}</td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5>{$emperior['nation_name']}</td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5>{$emperior['nation_hist']}</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5>{$emperior['personal_hist']}</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5>{$emperior['special_hist']}</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=6>
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2>{$emperior['power']}</td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2>{$emperior['type']}</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2>{$emperior['gennum']}</td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2>{$emperior['citynum']}</td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2>{$emperior['pop']}</td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2>{$emperior['poprate']}</td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2>{$emperior['gold']}</td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2>{$emperior['rice']}</td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l12name']}</td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l11name']}</td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l10name']}</td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l9name']}</td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l8name']}</td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l7name']}</td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l6name']}</td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332>{$emperior['l5name']}</td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5>{$emperior['tiger']}</td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5>{$emperior['eagle']}</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5>{$emperior['gen']}</td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5>".ConvertLog($emperior['history'], 1)."</td>
</tr>
</table>
";
<?php
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
</html>
</html>
+3 -1
View File
@@ -17,7 +17,9 @@ increaseRefresh("왕조일람", 2);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+210
View File
@@ -0,0 +1,210 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
$db = DB::db();
$templates = new \League\Plates\Engine('templates');
$templates->registerFunction('ConvertLog', '\sammo\ConvertLog');
$templates->registerFunction('newColor', '\sammo\newColor');
increaseRefresh("왕조일람", 1);
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<table align=center width=1000 class="tb_layout bg0">
<tr><td><?=$emperior?'역 대 왕 조':'현 재 왕 조'?><br>
<button onclick=window.close()>창 닫기</button>
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
</td></tr>
</table>
<?php
if($emperior):
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<font size=5><?=$emperior['phase']?></font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5><?=$emperior['nation_name']?></td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5><?=$emperior['nation_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5><?=$emperior['personal_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5><?=$emperior['special_hist']?></td>
</tr>
<tr>
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2><?=$emperior['pop']?></td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2><?=$emperior['poprate']?></td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2><?=$emperior['gold']?></td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2><?=$emperior['rice']?></td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l11name']?></td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l9name']?></td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l8name']?></td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l7name']?></td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l6name']?></td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l5name']?></td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5><?=$emperior['tiger']?></td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5><?=$emperior['eagle']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5><?=$emperior['gen']?></td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
</tr>
</table>
<?php
endif;
$showServers = $serverID || (!$emperior);
if(!$serverID){
$serverID = UniqueConst::$serverID;
}
if($showServers){
$nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID);
foreach($nations as $nation){
if(!$nation['nation']??null){
continue;
}
$nation += Json::decode($nation['data']);
$nation['typeName'] = getNationType($nation['type']);
$nation['levelName'] = getNationLevel($nation['level']);
if($nation['generals']){
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
$liveGenerals = $nation['generals'];
foreach($generals as $general){
if(in_array($general['general_no'], $nation['generals'])){
unset($nation['generals'][$general['general_no']]);
}
}
$liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals);
$nation['generalsFull'] = array_merge($liveGenerals, $generals);
}
else{
$nation['generalsFull'] = $generals;
}
}
else{
$nation['generalsFull'] = [];
}
if(key_exists('aux', $nation) && !is_array($nation['aux'])){
$nation += Json::decode($nation['aux']);
}
echo $templates->render('oldNation', $nation);
}
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
</html>
+4 -2
View File
@@ -37,11 +37,13 @@ if ($type <= 0 || $type > 15) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 장수일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
</head>
+107 -86
View File
@@ -4,117 +4,138 @@ namespace sammo;
include "lib.php";
include "func.php";
$session = Session::getInstance()->setReadOnly();
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
$db = DB::db();
$connect=$db->get();
increaseRefresh("명예의전당", 1);
$scenarioList= [];
foreach($db->query('SELECT 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;
}
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
$searchScenarioName = $scenarioList[$scenarioIdx]['name'];
$searchFilter = $db->sqleval('scenario = %i', $scenarioIdx);
}
else{
$searchScenarioName = '* 모두 *';
$searchFilter = $db->sqleval(true);
}
increaseRefresh("명예의전당", 2);
?>
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1136" />
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/hallOfFame.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJs('js/hallOfFame.js')?>
</head>
<body>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1100 class='tb_layout bg0'>
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
<tr><td>
시나리오 검색 : <select id="by_scenario" name="by_scenario">
<option value="" <?=$scenarioIdx?"selected='selected'":''?>>* 종합 *</option>
<?php foreach($scenarioList as $info): ?>
<option
value="<?=$info['scenario']?>"
<?=($info['scenario']===$scenarioIdx)?"selected='selected'":''?>
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
<?php endforeach; ?>
?>
</select>
</td></tr>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<div style="margin:auto;width=1100px;">
<?php
$type = array(
"명 성",
"계 급",
"계 략 성 공",
"전 투 횟 수",
"승 리",
"승 률",
"사 살",
"살 상 률",
"보 병 숙 련 도",
"궁 병 숙 련 도",
"기 병 숙 련 도",
"귀 병 숙 련 도",
"차 병 숙 련 도",
"전 력 전 승 률",
"통 솔 전 승 률",
"일 기 토 승 률",
"설 전 승 률",
"베 팅 투 자 액",
"베 팅 당 첨",
"베 팅 수 익 금",
"베 팅 수 익 률"
);
for ($i=0; $i < 21; $i++) {
$name = [];
$nation = [];
$data = [];
$color = [];
$pic = [];
$query = "select * from hall where type={$i} order by rank";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$types = [
["명 성", 'int'],
["계 급", 'int'],
["계 략 성 공", 'int'],
["전 투 횟 수", 'int'],
["승 리", 'int'],
["승 률", 'percent'],
["사 살", 'int'],
["살 상 률", 'percent'],
["보 병 숙 련 도", 'int'],
["궁 병 숙 련 도", 'int'],
["기 병 숙 련 도", 'int'],
["귀 병 숙 련 도", 'int'],
["차 병 숙 련 도", 'int'],
["전 력 전 승 률", 'percent'],
["통 솔 전 승 률", 'percent'],
["일 기 토 승 률", 'percent'],
["설 전 승 률", 'percent'],
["베 팅 투 자 액", 'int'],
["베 팅 당 첨", 'int'],
["베 팅 수 익 금", 'int'],
["베 팅 수 익 률", 'percent'],
];
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
<tr>";
$templates = new \League\Plates\Engine('templates');
for ($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result);
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'];
$data[$k] = $gen['data'];
$color[$k] = $gen['color'];
$pic[$k] = $gen['picture'];
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
foreach($types as $idx=>[$typeName, $typeValue]) {
$hallResult = $db->query('SELECT * FROM ng_hall WHERE `type`=%i AND %? ORDER BY `value` DESC LIMIT 10', $idx, $searchFilter);
$hallResult = array_map(function($general)use($typeValue){
$aux = Json::decode($general['aux']);
$general += $aux;
if(!key_exists('bgColor', $general)){
if(!key_exists('color', $general)){
$general['bgColor'] = GameConst::$basecolor4;
}
else{
$general['bgColor'] = $general['color'];
}
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
if(!key_exists('fgColor', $general)){
$general['fgColor'] = newColor($general['bgColor']);
}
/*
if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
*/
}
// echo "</tr><tr>";
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};font-size:80%;color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr>";
for ($k=0; $k < 10; $k++) {
if ($i == 5 || $i == 7 || $i == 20) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
if(key_exists('picture', $general)){
$imageTemp = GetImageURL($general['imgsvr']);
$general['pictureFullPath'] = "$imageTemp/{$general['picture']}";
}
if ($i >= 13 && $i <= 16) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
else{
$general['pictureFullPath'] = GetImageURL(0)."/default.jpg";
}
echo "<td align=center>{$data[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
if(!key_exists('printValue', $general)){
$value = $general['value'];
if($typeValue == 'percent'){
$general['printValue'] = number_format($value*100, 2).'%';
}
else {
$general['printValue'] = number_format($value);
}
}
return $general;
}, $hallResult);
echo $templates->render('hallOfFrame', [
'typeName'=>$typeName,
'generals'=>$hallResult
]);
}
?>
</table>
<table align=center width=1000 class='tb_layout bg0'>
</div>
<table align=center width=1100 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
+31 -25
View File
@@ -5,6 +5,7 @@ include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$yearmonth = Util::getReq('yearmonth', 'int');
$serverID = Util::getReq('serverID', 'string', null);
extractMissingPostToGlobals();
@@ -16,7 +17,13 @@ $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("연감", 2);
if(!$serverID){
$serverID = UniqueConst::$serverID;
}
if($serverID === UniqueConst::$serverID){
increaseRefresh("연감", 1);
}
$admin = $gameStor->getValues(['startyear','year','month']);
@@ -30,18 +37,20 @@ if ($con >= 2) {
exit();
}
$query = "select year,month from history order by no limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$history = MYDB_fetch_array($result);
$s = ($history['year']*12) + $history['month'];
$query = "select year,month from history order by no desc limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$history = MYDB_fetch_array($result);
$e = ($history['year']*12) + $history['month'];
[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
$s = $s_year * 12 + $s_month;
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
$e = $e_year * 12 + $e_month;
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
if (!$yearmonth) {
if($serverID !== UniqueConst::$serverID && !$yearmonth){
$year = $s_year;
$month = $s_month;
}
else if (!$yearmonth) {
$year = $admin['year'];
$month = $admin['month'] - 1;
} else {
@@ -75,9 +84,11 @@ if ($month <= 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 연감</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
@@ -98,24 +109,19 @@ if ($month <= 0) {
<input type=submit name=btn value="◀◀ 이전달">
<select name=yearmonth size=1>
<?php
$query = "select year,month from history";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$histCount = MYDB_num_rows($result);
for ($i=0; $i < $histCount; $i++) {
$history = MYDB_fetch_array($result);
$value = "".$history['year'].StringUtil::padStringAlignRight($history['month'], 2, "0");
if ($history['year'] == $year && $history['month'] == $month) {
$dates = $db->queryAllLists('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC', $serverID);
foreach($dates as [$hYear, $hMonth]){
$value = "".$hYear.StringUtil::padStringAlignRight($hMonth, 2, "0");
if ($hYear == $year && $hMonth == $month) {
echo "
<option selected value={$value}>{$history['year']}년 {$history['month']}월</option>";
<option selected value={$value}>{$hYear}년 {$hMonth}월</option>";
} else {
echo "
<option value={$value}>{$history['year']}년 {$history['month']}월</option>";
<option value={$value}>{$hYear}년 {$hMonth}월</option>";
}
}
$query = "select log,genlog,nation,power,gen,city from history where year='$year' and month='$month'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$history = MYDB_fetch_array($result);
$history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM history WHERE server_id = %s AND year = %i AND month = %i', $serverID, $year, $month);
?>
</select>
<input type=submit name=btn value='조회하기'>
@@ -153,7 +159,7 @@ $history = MYDB_fetch_array($result);
</table>
<script>
reloadWorldMap({
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>',
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
showMe:false,
neutralView:true
});
+5 -1
View File
@@ -24,10 +24,14 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
</head>
+3 -1
View File
@@ -25,7 +25,9 @@ $sel[$type] = "selected";
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+2 -1
View File
@@ -26,8 +26,9 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력도</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
+4 -2
View File
@@ -12,7 +12,7 @@ increaseRefresh("갱신정보", 2);
$admin = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
$log = getRawFileLogRecent(__dir__.'/logs/_traffic.txt', 11, 100);
$log = getRawFileLogRecent(__dir__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
$date = [];
$year = [];
@@ -50,7 +50,9 @@ if ($admin['maxonline'] < $curonline) {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
+3 -1
View File
@@ -28,7 +28,9 @@ $vote = $admin['vote']?:['-'];
<html>
<head>
<title><?=UniqueConst::$serverName?>: 설문조사</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
+4 -2
View File
@@ -56,7 +56,9 @@ if ($msg2 == "") {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 거래장</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -280,7 +282,7 @@ for ($i=0; $i < $count; $i++) {
ㆍ악용 방지를 위해 50% ~ 200%의 가격에서 거래시작이 가능합니다.<br>
ㆍ악용 방지를 위해 즉시판매가는 110% 이상, 즉시구매가는 90% 이하의 시세로 가능합니다.<br>
ㆍ악용 방지를 위해 즉시판매가는 시작판매가의 110% 이상, 즉시구매가는 시작구매가의 90% 이하로 가능합니다.<br>
ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다. 거상 특기 소유자는 1인당 도합 3건입니다.<br>
ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다.<br>
ㆍ기본금쌀 1000은 거래에 사용되지 못합니다.<br>
ㆍ유찰될 때는 거래 과실자에게 거래금의 1%가 벌금으로 부과됩니다.<br>
ㆍ<font color=magenta>10단위로 거래가 가능합니다. 1자리는 반올림 처리 됩니다.</font><br>
+3 -1
View File
@@ -74,7 +74,9 @@ $sel[$type] = "selected";
<head>
<title><?=UniqueConst::$serverName?>: 감찰부</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+10 -2
View File
@@ -55,7 +55,9 @@ if($str3){
MessageBox("접속제한이 얼마 남지 않았습니다!");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 베팅장</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -297,7 +299,13 @@ for ($i=0; $i < 16; $i++) {
}
for ($i=0; $i < 16; $i++) {
$gold[$i] = Util::round($myBet[$i] * $bet[$i]);
if(!is_numeric($bet[$i])){
$gold[$i] = 0;
}
else{
$gold[$i] = Util::round($myBet[$i] * $bet[$i]);
}
}
?>
</tr>
+3 -1
View File
@@ -26,7 +26,9 @@ if($me['level'] < 5) {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 기밀실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -77,7 +77,9 @@ for($i= $lv - 1; $i>=5; $i--){
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 사령부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -33,7 +33,9 @@ $templates = new \League\Plates\Engine('templates');
<head>
<title><?=UniqueConst::$serverName?>: 도시정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
+6 -4
View File
@@ -44,7 +44,9 @@ if ($me['level'] >= 5) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내무부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -216,9 +218,9 @@ if ($budgetricediff > 0) {
<table align=center width=1000 class='tb_layout bg0'>
<form name=form1 method=post action=c_dipcenter.php>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메지</td></tr>
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=1000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메지</td></tr>
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=16000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=1000 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=green>예 산 &amp; 정 책</td></tr>
+2 -1
View File
@@ -75,8 +75,9 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
+39 -32
View File
@@ -50,11 +50,13 @@ $sel[$type] = "selected";
MessageBox("접속제한이 얼마 남지 않았습니다!");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 암행부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
</head>
<body>
@@ -97,24 +99,28 @@ switch ($type) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center class='tb_layout bg0'>
?>
<table align=center id='general_list' class='tb_layout bg0'>
<thead>
<tr>
<td width=98 align=center id=bg1>이 름</td>
<td width=98 align=center id=bg1>통무지</td>
<td width=98 align=center id=bg1>부 대</td>
<td width=58 align=center id=bg1>자 금</td>
<td width=58 align=center id=bg1>군 량</td>
<td width=48 align=center id=bg1>도시</td>
<td width=28 align=center id=bg1>守</td>
<td width=58 align=center id=bg1>병 종</td>
<td width=68 align=center id=bg1>병 사</td>
<td width=48 align=center id=bg1>훈련</td>
<td width=48 align=center id=bg1>사기</td>
<td width=148 align=center id=bg1>명 령</td>
<td width=58 align=center id=bg1>삭턴</td>
<td width=58 align=center id=bg1>턴</td>
</tr>";
<td width=98 align=center class=bg1>이 름</td>
<td width=98 align=center class=bg1>통무지</td>
<td width=98 align=center class=bg1>부 대</td>
<td width=58 align=center class=bg1>자 금</td>
<td width=58 align=center class=bg1>군 량</td>
<td width=48 align=center class=bg1>도시</td>
<td width=28 align=center class=bg1>守</td>
<td width=58 align=center class=bg1>병 종</td>
<td width=68 align=center class=bg1>병 사</td>
<td width=48 align=center class=bg1>훈련</td>
<td width=48 align=center class=bg1>사기</td>
<td width=148 align=center class=bg1>명 령</td>
<td width=58 align=center class=bg1>삭턴</td>
<td width=58 align=center class=bg1>턴</td>
</tr>
</thead>
<tbody>
<?php
for ($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$city = CityConst::byID($general['city'])->name;
@@ -162,24 +168,24 @@ for ($j=0; $j < $gencount; $j++) {
echo "
<tr>
<td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$leader}∥{$power}∥{$intel}</td>
<td align=center>$troop</td>
<td align=center>{$general['gold']}</td>
<td align=center>{$general['rice']}</td>
<td align=center>$city</td>
<td class='i_name' align=center><span class='t_name'>$name</span><br>Lv <span class='t_explevel'>".getExpLevel($general['experience'])."</span></td>
<td class='i_stat' align=center>{$leader}∥{$power}∥{$intel}</td>
<td class='i_troop' align=center>$troop</td>
<td class='i_gold' align=center>{$general['gold']}</td>
<td class='i_rice' align=center>{$general['rice']}</td>
<td class='i_city' align=center>$city</td>
<td align=center>$mode</td>
<td align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
<td align=center>{$general['crew']}</td>
<td align=center>{$general['train']}</td>
<td align=center>{$general['atmos']}</td>";
<td class='i_crewtype' align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
<td class='i_crew' align=center>{$general['crew']}</td>
<td class='i_train' align=center>{$general['train']}</td>
<td class='i_atmos' align=center>{$general['atmos']}</td>";
if ($general['npc'] >= 2) {
echo "
<td>
<td class='i_action'>
<font size=3>NPC 장수";
} else {
echo "
<td>
<td class='i_action'>
<font size=1>";
$turn = getTurn($general, 1, 0);
@@ -194,10 +200,11 @@ for ($j=0; $j < $gencount; $j++) {
</font>
</td>
<td align=center>{$general['killturn']}</td>
<td align=center>".substr($general['turntime'], 14, 5)."</td>
<td class='i_turntime' align=center>".substr($general['turntime'], 14, 5)."</td>
</tr>";
}
echo "
</tbody>
</table>
";
+3 -1
View File
@@ -29,7 +29,9 @@ if($meLevel == 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 인사부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+9 -3
View File
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력도시</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
<?=WebUtil::printJS('js/ext.expand_city.js')?>
</head>
@@ -188,11 +194,11 @@ for ($j=0; $j < $citycount; $j++) {
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1000 class='tb_layout bg0 anchor'>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
<div id="helper_genlist" style="display:none;"></div>
</html>
+3 -1
View File
@@ -36,7 +36,9 @@ $sel = [$type => "selected"];
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력장수</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -26,7 +26,9 @@ if($me['level'] == 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력정보</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -77,7 +77,9 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내정보</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -21,7 +21,9 @@ $me = MYDB_fetch_array($result);
<html>
<head>
<title><?=UniqueConst::$serverName?>: 회의실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -16,7 +16,9 @@ increaseRefresh("국법", 1);
<html>
<head>
<title><?=UniqueConst::$serverName?>: 국법</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+4 -2
View File
@@ -41,7 +41,9 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -400,7 +402,7 @@ for($i=0;$i<16;$i+=1){
}
$bet = [];
for ($i=0; $i < 16; $i++) {
if($betting['bet'] == 0){
if($betting["bet{$i}"] == 0){
$bet[$i] = '∞';
continue;
}
+12 -3
View File
@@ -24,10 +24,14 @@ $troopcount = MYDB_num_rows($result);
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 부대편성</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
</head>
<body>
@@ -36,7 +40,8 @@ $troopcount = MYDB_num_rows($result);
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
</table>
<form name=form1 method=post action=c_troop.php>
<table class='tb_layout bg0'>
<table id="troop_list" class='tb_layout bg0'>
<thead>
<tr>
<td width=64 class='bg1 center'>선 택</td>
<td width=130 class='bg1 center'>부 대 정 보</td>
@@ -44,6 +49,8 @@ $troopcount = MYDB_num_rows($result);
<td width=576 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
</tr>
</thead>
<tbody>
<?php
for($i=0; $i < $troopcount; $i++) {
$troop = MYDB_fetch_array($result);
@@ -122,7 +129,8 @@ for($i=0; $i < $troopcount; $i++) {
<tr><td colspan=5>";
}
}
echo "</tbody>
<tfoot>";
if ($troopcount == 0) {
}
else if($me['troop'] == 0) {
@@ -135,6 +143,7 @@ else if($me['troop'] == 0) {
echo "
</td></tr>
</tfoot>
</table>
<br>";
+2 -2
View File
@@ -91,11 +91,11 @@ if ($btn == "판매") {
$msg = "ㆍ<span class='ev_warning'>시작판매가는 50% ~ 200% 이어야 합니다.</span>";
$valid = 0;
}
if ($topv < $amount*1.1 || $topv > $amount * 2) {
if ($topv * 10 < $amount * 11 || $topv > $amount * 2) {
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 110% ~ 200% 이어야 합니다.</span>";
$valid = 0;
}
if ($topv < $cost*1.1) {
if ($topv * 10 < $cost * 11) {
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</span>";
$valid = 0;
}
+12 -14
View File
@@ -19,11 +19,8 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
$query = "select no,nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$me = $db->queryFirstRow('SELECT `no`,nation,`level` FROM general WHERE `owner`=%i', $userID);
//내가 수뇌부이어야함
if($me['level'] < 5) {
@@ -32,21 +29,21 @@ if($me['level'] < 5) {
}
if($btn == "국가방침") {
$msg == mb_substr($msg, 0, 1000);
$msg = mb_substr($msg, 0, 16384);
//$msg = StringUtil::
$db->update('nation', [
'msg'=>BadTag2Code($msg)
'msg'=>WebUtil::htmlPurify($msg)
], 'nation=%i',$me['nation']);
} elseif($btn == "임관권유") {
$scoutmsg == mb_substr($msg, 0, 500);
$scoutmsg = mb_substr($scoutmsg, 0, 1000);
$db->update('nation', [
'scoutmsg'=>BadTag2Code($scoutmsg)
'scoutmsg'=>WebUtil::htmlPurify($scoutmsg)
], 'nation=%i',$me['nation']);
} elseif($btn == "세율") {
if($rate < 5) { $rate = 5; }
if($rate > 30) { $rate = 30; }
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$rate = Util::valueFit($rate, 5, 30);
$db->update('nation', [
'rate'=>$rate,
], 'nation=%i', $me['nation']);
} elseif($btn == "지급율") {
$bill = Util::valueFit($bill, 20, 200);
$db->update('nation', [
@@ -70,8 +67,9 @@ if($btn == "국가방침") {
'war'=>1
], 'nation=%i',$me['nation']);
} elseif($btn == "전쟁 허가") {
$query = "update nation set war='0' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'war'=>0
], 'nation=%i',$me['nation']);
}
header('location:b_dipcenter.php');
+7 -18
View File
@@ -44,12 +44,8 @@ $comStr = EncodeCommand($fourth, $third, $double, $command);
// 건국
if($command == 46) {
$name = addslashes(SQ2DQ($name));
$name = str_replace("|", "", $name);
$name = str_replace(" ", "", $name);
$name = str_replace(" ", "", $name);
$name = StringUtil::neutralize($name);
if($name == "") { $name = "무명"; }
$name = StringUtil::subStringForWidth($name, 0, 18);
$db->update('general', [
'makenation'=>$name
@@ -72,15 +68,12 @@ if($command == 53) {
$me = MYDB_fetch_array($result);
if($me['level'] >= 5) {
$nationname = addslashes(SQ2DQ($nationname));
$nationname = str_replace("|", "", $nationname);
$nationname = str_replace(" ", "", $nationname);
$nationname = str_replace(" ", "", $nationname);
$nationname = StringUtil::neutralize($nationname, 18);
if($nationname == "") { $nationname = "무명"; }
$nationname = StringUtil::subStringForWidth($nationname, 0, 18);
$query = "update general set makenation='{$nationname}' where level>=5 and nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', [
'makenation'=>$nationname
], 'level>=5 and nation=%i', $me['nation']);
$count = count($turn);
$str = "type=type";
@@ -101,11 +94,7 @@ if($command == 61) {
$me = MYDB_fetch_array($result);
if($me['level'] >= 5) {
$note = addslashes(SQ2DQ($note));
$note = str_replace("|", "", $note);
$note = str_replace(" ", "", $note);
$note = str_replace(" ", "", $note);
$note = StringUtil::subStringForWidth($note, 0, 90);
$note = StringUtil::neutralize($note, 90);
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+8 -11
View File
@@ -39,23 +39,20 @@ if($meLevel < 5){
}
if($btn == "임명") {
if(!$genlist){
header('location:b_myBossInfo.php');
exit();
if($genlist==0){
$general = [];
}
else{
$general = $db->queryFirstRow('SELECT `no`,nation,`level`,leader,`power`,intel FROM general WHERE no = %i', $genlist);
}
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if(!$general){
if($genlist != 0 && !$general){
header('location:b_myBossInfo.php');
exit();
}
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
if($meLevel < 5 || ($genlist != 0 && $general['nation'] != $me['nation']) || ($genlist != 0 && $general['level'] == 12)) {
header('location:b_myBossInfo.php');
exit();
}
@@ -241,7 +238,7 @@ if($btn == "임명" && $level >= 5 && $level <= 11) {
$nation['chemi'] -= 1;
if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
$query = "update nation set chemi='{$nation['chemi']}' where nation='{$general['nation']}'";
$query = "update nation set chemi='{$nation['chemi']}' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 장수 일반으로
+2 -2
View File
@@ -58,14 +58,14 @@ if(!$isVoteAdmin){
if($btn == "수정") {
if($title != "") {
$gameStor->vote_title = $title;
$gameStor->vote_title = WebUtil::htmlPurify($title);
}
} elseif($btn == "추가") {
if($str != "") {
if(!$admin['vote']){
$admin['vote'] = [];
}
$admin['vote'][] = $str;
$admin['vote'][] = WebUtil::htmlPurify($str);
$gameStor->vote=$admin['vote'];
}
} elseif($btn == "리셋") {
+3 -1
View File
@@ -13,7 +13,9 @@ $db = DB::db();
<html>
<head>
<title>커맨드리스트</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<script type="text/javascript">
+42
View File
@@ -1,9 +1,15 @@
@charset "UTF-8";
/* font-boostring Block */
html * {max-height:1000000px;}
html, body{
background-color:black;
color:white;
line-height:1.3;
font-family:'맑은 고딕';
font-size:13px;
}
table { font-family:'맑은 고딕'; }
@@ -181,3 +187,39 @@ div.bar_out div.bar_in{
float:left;
}
.tooltip{
position: relative;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
+94
View File
@@ -0,0 +1,94 @@
.rankView {
width:1100px;
margin:auto;
position:relative;
font-size:13px;
}
.rankView h3{
text-align:center;
margin:0;
padding:2px;
border-bottom:1px solid gray;
}
.rankView ul{
list-style:none;
margin:0;
padding:0;
box-sizing: border-box;
margin-top:-1px;
margin-bottom:-1px;
}
.rankView li{
display:inline-block;
vertical-align: top;
width:110px;
height:149px;
text-align:center;
border-right:1px solid gray;
border-top:1px solid gray;
margin:0;
box-sizing: border-box;
}
.rankView li.no_value{
height:128px;
}
.rankView li.has_server {
height:168px;
}
.rankView li.no_value.has_server {
height:146px;
}
.rankView .hall_server{
border-top:1px solid gray;
}
.rankView .tooltip .tooltiptext{
width:220px;
margin-left: -110px;
}
.rankView .no_value .hall_value{
display:none;
}
.rankView .hall_nation{
font-size:11px;
border-top:1px solid gray;
border-bottom:1px solid gray;
}
.rankView .hall_name{
display: flex;
justify-content: center;
flex-direction: column;
resize: vertical;
font-size:11px;
height:28px;
}
.rankView .hall_name p{
padding:0;
margin:0;
}
.rankView .hall_owner{
font-size:95%;
}
.rankView .hall_value{
line-height:13px;
box-sizing: border-box;
border-top:1px solid gray;
padding-top:3px;
padding-bottom:3px;
}
+91 -59
View File
@@ -1116,15 +1116,12 @@ function nationMsg() {
$connect=$db->get();
$userID = Session::getUserID();
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$msg = $db->queryFirstField(
'SELECT msg FROM nation WHERE nation = (SELECT nation FROM general WHERE `owner` = %i)',
$userID
);
$query = "select msg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
echo "<font color=orange>".$nation['msg']."</font>";
return $msg?:'';
}
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
@@ -1269,7 +1266,7 @@ function increaseRefresh($type="", $cnt=1) {
$date2 = substr($date, 0, 10);
$online = getOnlineNum();
file_put_contents(
__dir__."/logs/_{$date2}_refresh.txt",
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_refresh.txt",
sprintf(
"%s, %s, %s, %s, %s, %d\n",
$date,
@@ -1306,7 +1303,7 @@ function increaseRefresh($type="", $cnt=1) {
}
if($str != "") {
file_put_contents(
__dir__."/logs/_{$date2}_ipcheck.txt",
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_ipcheck.txt",
sprintf(
"%s, %s, %s%s\n",
$session->userName,
@@ -1341,7 +1338,7 @@ function updateTraffic() {
$date = date('Y-m-d H:i:s');
//일시|년|월|총갱신|접속자|최다갱신자
file_put_contents(__dir__."/logs/_traffic.txt",
file_put_contents(__dir__."/logs/".UniqueConst::$serverID."/_traffic.txt",
Json::encode([
$date,
$admin['year'],
@@ -1913,17 +1910,22 @@ function updateTurntime($no) {
if($general['npc'] == 1 && $general['deadyear'] > $admin['year']) {
$general['killturn'] = ($general['deadyear'] - $admin['year']) * 12;
$general['npc'] = $general['npc_org'];
$query = "update general set owner=-1,npc='{$general['npc']}',killturn='{$general['killturn']}',mode=2 where no='$no'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', [
'owner'=>-1,
'npc'=>$general['npc_org'],
'killturn'=>$general['killturn'],
'mode'=>2,
'name2'=>null
], 'no=%i',$no);
$josaYi = JosaUtil::pick($general['name2'], '이');
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>{$josaYi} <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
if($admin['isunited'] == 0) {
CheckHall($no);
}
} else {
storeOldGeneral($general['no'], $admin['year'], $admin['month']);
// 군주였으면 유지 이음
if($general['level'] == 12) {
nextRuler($general);
@@ -2063,9 +2065,9 @@ function updateTurntime($no) {
function CheckHall($no) {
$db = DB::db();
$connect=$db->get();
$gameStor = KVStorage::getStorage($db, 'game_env');
$type = array(
$types = array(
"experience",
"dedication",
"firenum",
@@ -2089,59 +2091,77 @@ function CheckHall($no) {
"betrate"
);
$query = "select name,nation,picture,
experience,dedication,warnum,firenum,killnum,
killnum/warnum*10000 as winrate,killcrew,killcrew/deathcrew*10000 as killrate,
dex0,dex10,dex20,dex30,dex40,
ttw/(ttw+ttd+ttl)*10000 as ttrate, ttw+ttd+ttl as tt,
tlw/(tlw+tld+tll)*10000 as tlrate, tlw+tld+tll as tl,
tpw/(tpw+tpd+tpl)*10000 as tprate, tpw+tpd+tpl as tp,
tiw/(tiw+tid+til)*10000 as tirate, tiw+tid+til as ti,
betgold, betwin, betwingold, betwingold/betgold*10000 as betrate
from general where no='$no'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general = $db->queryFirstRow('SELECT name,name2,owner,nation,picture,imgsvr,
experience,dedication,warnum,firenum,killnum,
killnum/warnum as winrate,killcrew,killcrew/deathcrew as killrate,
dex0,dex10,dex20,dex30,dex40,
ttw/(ttw+ttd+ttl) as ttrate, ttw+ttd+ttl as tt,
tlw/(tlw+tld+tll) as tlrate, tlw+tld+tll as tl,
tpw/(tpw+tpd+tpl) as tprate, tpw+tpd+tpl as tp,
tiw/(tiw+tid+til) as tirate, tiw+tid+til as ti,
betgold, betwin, betwingold, betwingold/betgold as betrate
from general where no=%i', $no);
if(!$general){
return;
}
$unitedDate = date('Y-m-d H:i:s');
$nation = getNationStaticInfo($general['nation']);
for($k=0; $k < 21; $k++) {
$query = "select * from hall where type='$k' order by data desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
[$scenarioIdx, $scenarioName, $startTime] = $gameStor->getValuesAsArray(['scenario', 'scenario_text', 'starttime']);
foreach($types as $idx=>$typeName) {
//승률,살상률인데 10회 미만 전투시 스킵
if(($k == 5 || $k == 7) && $general['warnum']<10) { continue; }
if(($typeName === 'winrate' || $typeName === 'killrate') && $general['warnum']<10) { continue; }
//토너승률인데 50회 미만시 스킵
if($k == 13 && $general['tt'] < 50) { continue; }
if($typeName === 'ttrate' && $general['tt'] < 50) { continue; }
//토너승률인데 50회 미만시 스킵
if($k == 14 && $general['tl'] < 50) { continue; }
if($typeName === 'tlrate' && $general['tl'] < 50) { continue; }
//토너승률인데 50회 미만시 스킵
if($k == 15 && $general['tp'] < 50) { continue; }
if($typeName === 'tprate' && $general['tp'] < 50) { continue; }
//토너승률인데 50회 미만시 스킵
if($k == 16 && $general['ti'] < 50) { continue; }
if($typeName === 'tirate' && $general['ti'] < 50) { continue; }
//수익률인데 1000미만시 스킵
if($k == 20 && $general['betgold'] < 1000) { continue; }
if($typeName === 'betrate' && $general['betgold'] < 1000) { continue; }
$rank = 10;
for($i=0; $i < $count; $i++) {
$ranker = MYDB_fetch_array($result);
if($general[$type[$k]] >= $ranker['data']) {
$rank = $i;
break;
}
if($general[$typeName]<=0){
continue;
}
for($i=8; $i >= $rank; $i--) {
$j = $i + 1;
$query = "select * from hall where type='$k' and rank='$i'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ranker = MYDB_fetch_array($result);
$query = "update hall set name='{$ranker['name']}', nation='{$ranker['nation']}', data='{$ranker['data']}', color='{$ranker['color']}', picture='{$ranker['picture']}' where type='$k' and rank='$j'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "update hall set name='{$general['name']}', nation='{$nation['name']}', data='{$general[$type[$k]]}', color='{$nation['color']}', picture='{$general['picture']}' where type='$k' and rank='$rank'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$aux = [
'name'=>$general['name'],
'nationName'=>$nation['name'],
'bgColor'=>$nation['color'],
'fgColor'=>newColor($nation['color']),
'picture'=>$general['picture'],
'imgsvr'=>$general['imgsvr'],
'startTime'=>$startTime,
'unitedTime'=>$unitedDate,
'owner_name'=>$general['name2'],
'serverID'=>UniqueConst::$serverID,
'serverIdx'=>$serverCnt,
'serverName'=>UniqueConst::$serverName,
'scenarioName'=>$scenarioName,
];
$jsonAux = Json::encode($aux);
$db->insertUpdate('ng_hall', [
'server_id'=>UniqueConst::$serverID,
'scenario'=>$scenarioIdx,
'general_no'=>$no,
'type'=>$idx,
'value'=>$general[$typeName]??0,
'owner'=>$general['owner']??null,
'aux'=>$jsonAux
],[
'value'=>$general[$typeName]??0,
'aux'=>$jsonAux
]);
}
}
@@ -2432,6 +2452,11 @@ function deleteNation($general) {
$josaUn = JosaUtil::pick($nation['name'], '은');
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<R><b>【멸망】</b></><D><b>{$nation['name']}</b></>{$josaUn} <R>멸망</>했습니다.";
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $general['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $general['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
// 전 장수 재야로 // 전 장수 소속 무소속으로
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -2442,6 +2467,13 @@ function deleteNation($general) {
$query = "delete from troop where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 국가 삭제
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$general['nation'],
'data'=>Json::encode($oldNation)
]);
$query = "delete from nation where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 삭제
+4 -3
View File
@@ -583,7 +583,7 @@ function processCommand($no) {
case 17: process_17($general); break; //소집해제
case 21: process_21($general); break; //이동
case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
case 22: process_22($general); break; //등용
case 25: process_25($general); break; //임관
case 26: process_26($general); break; //집합
case 28: process_28($general); break; //귀환
@@ -747,8 +747,9 @@ function command_Other($turn, $commandtype) {
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<script>
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
</script>
+4 -1
View File
@@ -791,7 +791,10 @@ function getItemCost($weap) : int {
function ConvertLog(string $str, $type=1) : string {
function ConvertLog(?string $str, $type=1) : string {
if(!$str){
return '';
}
//TODO: 이 함수는 없애야 한다. CSS로 대신하자
if($type > 0) {
$str = str_replace("<1>", "<font size=1>", $str);
+424 -279
View File
@@ -144,7 +144,7 @@ function SetNationFront($nationNo) {
$db = DB::db();
$enemyCities = $db->queryFirstColumn(
'SELECT city from city where nation IN
(SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=3)))'
(SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=5)))'
, $nationNo
);
if($enemyCities) {
@@ -427,6 +427,15 @@ function postUpdateMonthly() {
$history = [];
//도시 수 측정
$cityNations = [];
foreach($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $cityNation]){
if(!key_exists($cityNation, $cityNations)){
$cityNations[$cityNation] = [];
}
$cityNations[$cityNation][] = $cityName;
}
//각 국가 전월 장수수 대비 당월 장수수로 단합도 산정
//각 국가 장수수를 구하고 국력 산정
// $query = "select nation,gennum from nation where level>0";
@@ -438,34 +447,33 @@ function postUpdateMonthly() {
// 접속률
// 숙련도
// 명성,공헌
$query = "
select
A.nation,
A.gennum, A.gennum2, A.chemi,
round((
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
+A.tech
+if(A.level=0,0,(
select round(
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
) from city where nation=A.nation and supply=1
))
+(select sum(leader+power+intel) from general where nation=A.nation)
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
+(select round(avg(connect)) from general where nation=A.nation)
)/10)
as power
from nation A
group by A.nation
";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result);
$genNum = [];
for($i=0; $i < $nationCount; $i++) {
$nation = MYDB_fetch_array($result);
$nations = $db->query('SELECT
A.nation,
A.gennum, A.gennum2, A.chemi, A.aux,
round((
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
+A.tech
+if(A.level=0,0,(
select round(
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
) from city where nation=A.nation and supply=1
))
+(select sum(leader+power+intel) from general where nation=A.nation)
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
+(select round(avg(connect)) from general where nation=A.nation)
)/10)
as power,
(select sum(crew) from general where nation=A.nation) as totalCrew
from nation A
group by A.nation');
foreach($nations as $nation) {
$genNum[$nation['nation']] = $nation['gennum'];
$aux = Json::decode($nation['aux']);
if($nation['gennum'] > $nation['gennum2']) {
// 장수가 증가했을때
$nation['chemi'] -= ceil(($nation['gennum'] - $nation['gennum2']) / $nation['gennum'] * 100);
@@ -479,9 +487,21 @@ group by A.nation
if($nation['chemi'] > 100) { $nation['chemi'] = 100; }
//약간의 랜덤치 부여 (95% ~ 105%)
$nation['power'] = Util::round($nation['power'] * (rand()%101 + 950) / 1000);
$query = "update nation set power='{$nation['power']}',gennum2='{$nation['gennum']}',chemi='{$nation['chemi']}' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$aux['maxPower'] = max($aux['maxPower']??0, $nation['power']);
$aux['maxCrew'] = max($aux['maxCrew']??0, Util::toInt($nation['totalCrew']));
if(count($cityNations[$nation['nation']]??[]) > count($aux['maxCities']??[])){
$aux['maxCities'] = $cityNations[$nation['nation']];
}
$db->update('nation', [
'power'=>$nation['power'],
'gennum2'=>$nation['gennum'],
'chemi'=>$nation['chemi'],
'aux'=>Json::encode($aux)
], 'nation=%i', $nation['nation']);
}
// 전쟁기한 세팅
@@ -685,10 +705,23 @@ function checkMerge() {
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
$newTotalTech = $younation['totaltech'] + $mynation['totaltech'];
$newTech = Util::round($newTotalTech / $newGenCount);
// 국가 백업
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
// 자금 통합, 외교제한 5년, 기술유지
$query = "update nation set name='{$you['makenation']}',gold=gold+'{$mynation['gold']}',rice=rice+'{$mynation['rice']}',surlimit='24',totaltech='$newTotalTech',tech='$newTech',gennum='{$newGenCount}' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국가 삭제
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$me['nation'],
'data'=>Json::encode($oldNation)
]);
$query = "delete from nation where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아국 모든 도시들 상대국 소속으로
@@ -804,6 +837,12 @@ function checkSurrender() {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>【혼란】</b></>통합에 반대하는 세력들로 인해 <D><b>{$younation['name']}</b></>에 혼란이 일고 있습니다.";
pushNationHistory($younation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>{$josaWa} 합병");
// 국가 백업
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
$newGenCount = $gencount + $gencount2;
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
$newTotalTech = $younation['totaltech'] + $mynation['totaltech'];
@@ -818,6 +857,13 @@ function checkSurrender() {
$query = "update city set pop=pop*0.95,agri=agri*0.95,comm=comm*0.95,secu=secu*0.95,rate=rate*0.95,def=def*0.95,wall=wall*0.95 where nation='{$you['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국가 삭제
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$me['nation'],
'data'=>Json::encode($oldNation)
]);
$query = "delete from nation where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 군주가 있는 위치 구함
@@ -943,53 +989,79 @@ function updateNationState() {
function checkStatistic() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$admin = $gameStor->getValues(['year', 'month']);
$nationHists = [];
$specialHists = [];
$personalHists = [];
$specialHists2 = [0];
$specialHists2 = [];
$crewtypeHists = [];
$etc = '';
$query = "select avg(gold) as avggold, avg(rice) as avgrice, avg(dex0+dex10+dex20+dex30) as avgdex, max(dex0+dex10+dex20+dex30) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general['avggold'] = Util::round($general['avggold']);
$general['avgrice'] = Util::round($general['avgrice']);
$general['avgdex'] = Util::round($general['avgdex']);
$general['avgexpded'] = Util::round($general['avgexpded']);
$etc .= "평균 금/쌀 ({$general['avggold']}/{$general['avgrice']}), 평균/최고 숙련({$general['avgdex']}/{$general['maxdex']}), 평균/최고 경험공헌({$general['avgexpded']}/{$general['maxexpded']}), ";
$auxData = [
'generals'=>[],
'nations'=>[],
];
$query = "select min(tech) as mintech, max(tech) as maxtech, avg(tech) as avgtech, min(power) as minpower, max(power) as maxpower, avg(power) as avgpower from nation where level>0";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$nation['avgtech'] = Util::round($nation['avgtech']);
$nation['avgpower'] = Util::round($nation['avgpower']);
$etc .= "최저/평균/최고 기술({$nation['mintech']}/{$nation['avgtech']}/{$nation['maxtech']}), ";
$etc .= "최저/평균/최고 국력({$nation['minpower']}/{$nation['avgpower']}/{$nation['maxpower']}), ";
$avgGeneral = $db->queryFirstRow(
'SELECT avg(gold) as avggold, avg(rice) as avgrice, avg(dex0+dex10+dex20+dex30) as avgdex,
max(dex0+dex10+dex20+dex30) as maxdex, avg(experience+dedication) as avgexpded, max(experience+dedication) as maxexpded
FROM general'
);
$auxData['generals']['avg'] = $avgGeneral;
$avgGeneral['avggold'] = Util::round($avgGeneral['avggold']);
$avgGeneral['avgrice'] = Util::round($avgGeneral['avgrice']);
$avgGeneral['avgdex'] = Util::round($avgGeneral['avgdex']);
$avgGeneral['avgexpded'] = Util::round($avgGeneral['avgexpded']);
$etc .= "평균 금/쌀 ({$avgGeneral['avggold']}/{$avgGeneral['avgrice']}), 평균/최고 숙련({$avgGeneral['avgdex']}/{$avgGeneral['maxdex']}), 평균/최고 경험공헌({$avgGeneral['avgexpded']}/{$avgGeneral['maxexpded']}), ";
$avgNation = $db->queryFirstRow(
'SELECT min(tech) as mintech, max(tech) as maxtech, avg(tech) as avgtech,
min(power) as minpower, max(power) as maxpower, avg(power) as avgpower from nation where level>0');
$auxData['nations']['avg'] = $avgNation;
$avgNation['avgtech'] = Util::round($avgNation['avgtech']);
$avgNation['avgpower'] = Util::round($avgNation['avgpower']);
$etc .= "최저/평균/최고 기술({$avgNation['mintech']}/{$avgNation['avgtech']}/{$avgNation['maxtech']}), ";
$etc .= "최저/평균/최고 국력({$avgNation['minpower']}/{$avgNation['avgpower']}/{$avgNation['maxpower']}), ";
$nationName = '';
$power_hist = '';
$powerHist = '';
$query = "select nation,name,type,power,gennum,round((gold+rice)/100) as goldrice from nation where level>0 order by power desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result);
for($i=0; $i < $nationCount; $i++) {
$nation = MYDB_fetch_array($result);
$nations = Util::convertArrayToDict(
$db->query(
'SELECT nation,name,type,power,gennum,gold+rice as goldrice from nation where level>0 order by power desc', 'nation'
),
'nation'
);
$nationCount = count($nations);
$query = "select sum(leader+power+intel) as abil,round(sum(gold+rice)/100) as goldrice,round(sum(dex0+dex10+dex20+dex30)/1000) as dex,round(sum(experience+dedication)/100) as expded from general where nation='{$nation['nation']}'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result2);
$nationGeneralInfos = Util::convertArrayToDict(
$db->query(
'SELECT nation, sum(leader+power+intel) as abil,sum(gold+rice) as goldrice,
sum(dex0+dex10+dex20+dex30) as dex,sum(experience+dedication) as expded
from general GROUP BY nation'
),
'nation'
);
$query = "select count(*) as cnt,round(sum(pop)/100) as pop,round(sum(pop2)/100) as pop2 from city where nation='{$nation['nation']}'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result2);
$nationCityInfos = Util::convertArrayToDict(
$db->query('SELECT nation, count(*) as cnt, sum(pop) as pop,sum(pop2) as pop2 from city GROUP BY nation'),
'nation'
);
foreach($nations as $nationNo=>&$nation) {
$general = $nationGeneralInfos[$nationNo];
$city = $nationCityInfos[$nationNo];
$nation['generalInfo'] = $general;
$nation['cityInfo'] = $city;
$nationName .= $nation['name'].'('.getNationType($nation['type']).'), ';
$power_hist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop2']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), ";
$powerHist .= "{$nation['name']}({$nation['power']}/{$nation['gennum']}/{$city['cnt']}/{$city['pop']}/{$city['pop2']}/{$nation['goldrice']}/{$general['goldrice']}/{$general['abil']}/{$general['dex']}/{$general['expded']}), ";
if(!isset($nationHists[$nation['type']])){
$nationHists[$nation['type']] = 0;
@@ -997,26 +1069,21 @@ function checkStatistic() {
$nationHists[$nation['type']]++;
}
$auxData['nations']['all'] = $nations;
$nationHist = '';
for($i=1; $i <= 13; $i++) {
if(!Util::array_get($nationHists[$i])) { $nationHists[$i] = '-'; }
$nationHist .= getNationType($i)."({$nationHists[$i]}), ";
}
$query = "select no from general where npc <= 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
$generals = $db->query('SELECT `no`,npc,personal,special,special2,crewtype FROM general');
$query = "select no from general where npc > 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$npcCount = MYDB_num_rows($result);
$query = "select personal,special,special2 from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$generalCount = MYDB_num_rows($result);
for($i=0; $i < $generalCount; $i++) {
$general = MYDB_fetch_array($result);
$genCount = 0;
$npcCount = 0;
$generalCount = count($generals);
foreach($generals as $general) {
if(!isset($personalHists[$general['personal']])){
$personalHists[$general['personal']] = 0;
}
@@ -1029,70 +1096,112 @@ function checkStatistic() {
$specialHists2[$general['special2']] = 0;
}
if($general['npc'] < 2){
$genCount+=1;
}
else{
$npcCount+=1;
}
$personalHists[$general['personal']]++;
$specialHists[$general['special']]++;
$specialHists2[$general['special2']]++;
}
foreach($db->queryAllLists(
'SELECT crewtype, count(crewtype) AS cnt FROM general WHERE crew>=100 OR deathnum>0 GROUP BY crewtype'
) as [$crewtype, $cnt]
){
$crewtypeHists[$crewtype] = $cnt;
}
$auxData['generals']['hists'] = [
'personal' => $personalHists,
'special' => $specialHists,
'special2' => $specialHists2,
'crewtype' => $crewtypeHists,
'userCnt' => $genCount,
'npcCnt' => $npcCount,
];
$generalCountStr = "{$generalCount}({$genCount}+{$npcCount})";
$personalHist = '';
for($i=0; $i < 11; $i++) {
if(!Util::array_get($personalHists[$i])) { $personalHists[$i] = '-'; }
$personalHist .= getGenChar($i)."({$personalHists[$i]}), ";
}
$specialHist = '';
for($i=0; $i < 40; $i++) {
$call = getGenSpecial($i);
if($call) {
if(!Util::array_get($specialHists[$i])) { $specialHists[$i] = '-'; }
$personalHistStr = join(', ', array_map(function($histPair){
[$histKey, $cnt] = $histPair;
return getGenChar($histKey).'('.$cnt.')';
}, Util::convertDictToArray($personalHists)));
$specialHist .= $call."({$specialHists[$i]}), ";
}
}
$specialHist .= '// ';
$specialHist .= "-({$specialHists2[0]}), ";
for($i=40; $i < 80; $i++) {
$call = getGenSpecial($i);
if($call) {
if(!Util::array_get($specialHists2[$i])) { $specialHists2[$i] = '-'; }
$specialHistsStr = join(', ', array_map(function($histPair){
[$histKey, $cnt] = $histPair;
return getGenSpecial($histKey).'('.$cnt.')';
}, Util::convertDictToArray($specialHists)));
$specialHist .= $call."({$specialHists2[$i]}), ";
}
}
$specialHists2Str = join(', ', array_map(function($histPair){
[$histKey, $cnt] = $histPair;
return getGenSpecial($histKey).'('.$cnt.')';
}, Util::convertDictToArray($specialHists2)));
$crewtype = '';
$types = array(0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43);
$count = count($types);
foreach(GameUnitConst::all() as $unit){
$userCnt = DB::db()->queryFirstField(
"SELECT count(*) as type from general where crewtype=%i and crew>=100",
$unit->id
$specialHistsAllStr = "$specialHistsStr // $specialHists2Str";
$crewtypeHistsStr = join(', ', array_map(function($histPair){
[$histKey, $cnt] = $histPair;
return getGenSpecial($histKey).'('.$cnt.')';
}, Util::convertDictToArray($crewtypeHists)));
$db->insert('statistic', [
'year'=>$admin['year'],
'month'=>$admin['month'],
'nation_count'=>$nationCount,
'nation_name'=>$nationName,
'nation_hist'=>$nationHist,
'gen_count'=>$generalCountStr,
'personal_hist'=>$personalHistStr,
'special_hist'=>$specialHistsAllStr,
'power_hist'=>$powerHist,
'crewtype'=>$crewtypeHistsStr,
'etc'=>$etc,
'aux'=>Json::encode($auxData)
]);
}
function convForOldGeneral(array $general, int $year, int $month){
return [
'server_id'=>UniqueConst::$serverID,
'general_no'=>$general['no'],
'owner'=>$general['owner'],
'name'=>$general['name'],
'last_yearmonth'=>$year*100+$month,
'turntime'=>$general['turntime'],
'data'=>Json::encode($general)
];
}
function storeOldGeneral(int $no, int $year, int $month){
$db = DB::db();
$general = $db->queryFirstRow('SELECT * FROM general WHERE `no` = %i', $no);
if(!$general){
return;
}
$data = convForOldGeneral($general, $year, $month);
$db->insertUpdate(
'ng_old_generals',
$data,
$data
);
}
function storeOldGenerals(int $nation, int $year, int $month){
$db = DB::db();
foreach($db->query('SELECT * FROM general WHERE nation = %i',$nation) as $general){
$data = convForOldGeneral($general, $year, $month);
$db->insertUpdate(
'ng_old_generals',
$data,
$data
);
$crewtype .= "{$unit->name}({$userCnt}), ";
}
for($i=0; $i < $count; $i++) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
}
$query = "
insert into statistic (
year, month,
nation_count, nation_name, nation_hist,
gen_count, personal_hist, special_hist, power_hist,
crewtype, etc
) values (
'{$admin['year']}', '{$admin['month']}',
'$nationCount', '$nationName', '$nationHist',
'$generalCountStr', '$personalHist', '$specialHist', '$power_hist',
'$crewtype', '$etc'
)";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
function checkEmperior() {
@@ -1106,183 +1215,219 @@ function checkEmperior() {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
if($count == 1 && $admin['isunited'] == 0) {
$nation = MYDB_fetch_array($result);
if ($count != 1 || $admin['isunited'] != 0) {
return;
}
$query = "select city from city where nation='{$nation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$nation = MYDB_fetch_array($result);
$query = "select city from city";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$allcount = MYDB_num_rows($result);
$count = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i', $nation['nation']);
if(!$count){
return;
}
$allcount = $db->queryFirstField('SELECT count(city) FROM city');
if($count == $allcount) {
if ($count != $allcount) {
return;
}
$josaYi = JosaUtil::pick($nation['name'], '이');
checkStatistic();
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일");
$josaYi = JosaUtil::pick($nation['name'], '이');
$gameStor->isunited = 2;
$gameStor->conlimit = $gameStor->conlimit*100;
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일");
$query = "select no from general where npc<2 and age>=45";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$gameStor->isunited = 2;
$gameStor->conlimit = $gameStor->conlimit*100;
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
CheckHall($general['no']);
}
$query = "select no from general where npc<2 and age>=40";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$query = "select nation,name,type,color,gold,rice,power,gennum from nation where nation='{$nation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
CheckHall($general['no']);
}
$query = "select SUM(pop) as totalpop,SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
$pop = "{$city['totalpop']} / {$city['maxpop']}";
$poprate = round($city['totalpop']/$city['maxpop']*100, 2);
$poprate .= " %";
$query = "select nation,name,type,color,gold,rice,power,gennum from nation where nation='{$nation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='12'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level12 = MYDB_fetch_array($genresult);
$query = "select SUM(pop) as totalpop,SUM(pop2) as maxpop from city where nation='{$nation['nation']}'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
$pop = "{$city['totalpop']} / {$city['maxpop']}";
$poprate = round($city['totalpop']/$city['maxpop']*100, 2);
$poprate .= " %";
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='11'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level11 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='12'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level12 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='10'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level10 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='11'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level11 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='9'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level9 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='10'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level10 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='8'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level8 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='9'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level9 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='7'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level7 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='8'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level8 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='6'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level6 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='7'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level7 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='5'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level5 = MYDB_fetch_array($genresult);
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='6'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level6 = MYDB_fetch_array($genresult);
$query = "select name,picture,killnum from general where nation='{$nation['nation']}' order by killnum desc limit 5"; // 오호장군
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tigernum = MYDB_num_rows($tigerresult);
$tigerstr = '';
for($i=0; $i < $tigernum; $i++) {
$tiger = MYDB_fetch_array($tigerresult);
if($tiger['killnum'] > 0) {
$tigerstr .= "{$tiger['name']}{$tiger['killnum']}】, ";
}
}
$query = "select name,picture,belong from general where nation='{$nation['nation']}' and level='5'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level5 = MYDB_fetch_array($genresult);
$query = "select name,picture,firenum from general where nation='{$nation['nation']}' order by firenum desc limit 7"; // 건안칠자
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$eaglenum = MYDB_num_rows($eagleresult);
$eaglestr = '';
for($i=0; $i < $eaglenum; $i++) {
$eagle = MYDB_fetch_array($eagleresult);
if($eagle['firenum'] > 0) {
$eaglestr .= "{$eagle['name']}{$eagle['firenum']}】, ";
}
}
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
$oldNation['generals'] = $oldNationGenerals;
$log = ["<C>●</>{$admin['year']}{$admin['month']}월: <D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
$query = "select no,name from general where nation='{$nation['nation']}' order by dedication desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gen = '';
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
$gen .= "{$general['name']}, ";
pushGenLog($general, $log);
}
$nation['type'] = getNationType($nation['type']);
$query = "select MAX(nation_count) as nc,MAX(gen_count) as gc from statistic";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$stat = MYDB_fetch_array($result);
$query = "select count(*) as cnt from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_fetch_array($result);
$statNC = "1 / {$stat['nc']}";
$statGC = "{$gencount['cnt']} / {$stat['gc']}";
$query = "select nation_count,nation_name,nation_hist from statistic where nation_count='{$stat['nc']}' limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$statNation = MYDB_fetch_array($result);
$query = "select gen_count,personal_hist,special_hist from statistic order by no desc limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$statGeneral = MYDB_fetch_array($result);
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
$db->insert('emperior', [
'phase'=>'-',
'nation_count'=>$statNC,
'nation_name'=>$statNation['nation_name'],
'nation_hist'=>$statNation['nation_hist'],
'gen_count'=>$statGC,
'personal_hist'=>$statGeneral['personal_hist'],
'special_hist'=>$statGeneral['special_hist'],
'name'=>$nation['name'],
'type'=>$nation['type'],
'color'=>$nation['color'],
'year'=>$admin['year'],
'month'=>$admin['month'],
'power'=>$nation['power'],
'gennum'=>$nation['gennum'],
'citynum'=>$allcount,
'pop'=>$pop,
'poprate'=>$poprate,
'gold'=>$nation['gold'],
'rice'=>$nation['rice'],
'l12name'=>$level12['name'],
'l12pic'=>$level12['picture'],
'l11name'=>$level11['name'],
'l11pic'=>$level11['picture'],
'l10name'=>$level10['name'],
'l10pic'=>$level10['picture'],
'l9name'=>$level9['name'],
'l9pic'=>$level9['picture'],
'l8name'=>$level8['name'],
'l8pic'=>$level8['picture'],
'l7name'=>$level7['name'],
'l7pic'=>$level7['picture'],
'l6name'=>$level6['name'],
'l6pic'=>$level6['picture'],
'l5name'=>$level5['name'],
'l5pic'=>$level5['picture'],
'tiger'=>$tigerstr,
'eagle'=>$eaglestr,
'gen'=>$gen,
'history'=>$nationHistory
]);
$history = ["<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
pushWorldHistory($history, $admin['year'], $admin['month']);
//연감 월결산
LogHistory();
$query = "select name,picture,killnum from general where nation='{$nation['nation']}' order by killnum desc limit 5"; // 오호장군
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tigernum = MYDB_num_rows($tigerresult);
$tigerstr = '';
for($i=0; $i < $tigernum; $i++) {
$tiger = MYDB_fetch_array($tigerresult);
if($tiger['killnum'] > 0) {
$tigerstr .= "{$tiger['name']}{$tiger['killnum']}】, ";
}
}
$query = "select name,picture,firenum from general where nation='{$nation['nation']}' order by firenum desc limit 7"; // 건안칠자
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$eaglenum = MYDB_num_rows($eagleresult);
$eaglestr = '';
for($i=0; $i < $eaglenum; $i++) {
$eagle = MYDB_fetch_array($eagleresult);
if($eagle['firenum'] > 0) {
$eaglestr .= "{$eagle['name']}{$eagle['firenum']}】, ";
}
}
$log = ["<C>●</>{$admin['year']}{$admin['month']}월: <D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
$query = "select no,name from general where nation='{$nation['nation']}' order by dedication desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gen = '';
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
$gen .= "{$general['name']}, ";
pushGenLog($general, $log);
}
$nation['type'] = getNationType($nation['type']);
$query = "select MAX(nation_count) as nc,MAX(gen_count) as gc from statistic";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$stat = MYDB_fetch_array($result);
$query = "select count(*) as cnt from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_fetch_array($result);
$statNC = "1 / {$stat['nc']}";
$statGC = "{$gencount['cnt']} / {$stat['gc']}";
$query = "select nation_count,nation_name,nation_hist from statistic where nation_count='{$stat['nc']}' limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$statNation = MYDB_fetch_array($result);
$query = "select gen_count,personal_hist,special_hist,aux from statistic order by no desc limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$statGeneral = MYDB_fetch_array($result);
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
$oldNation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
$oldNation['aux'] = Json::decode($oldNation['aux']);
storeOldGenerals(0, $admin['year'], $admin['month']);
storeOldGenerals($nation['nation'], $admin['year'], $admin['month']);
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$nation['nation'],
'data'=>Json::encode($oldNation)
]);
$noNationGeneral = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=0');
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>0,
'data'=>Json::encode([
'nation'=>0,
'name'=>'재야',
'generals'=>$noNationGeneral
])
]);
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
$serverName = UniqueConst::$serverName;
$db->insert('emperior', [
'phase'=>$serverName.$serverCnt.'기',
'server_id'=>UniqueConst::$serverID,
'nation_count'=>$statNC,
'nation_name'=>$statNation['nation_name'],
'nation_hist'=>$statNation['nation_hist'],
'gen_count'=>$statGC,
'personal_hist'=>$statGeneral['personal_hist'],
'special_hist'=>$statGeneral['special_hist'],
'name'=>$nation['name'],
'type'=>$nation['type'],
'color'=>$nation['color'],
'year'=>$admin['year'],
'month'=>$admin['month'],
'power'=>$nation['power'],
'gennum'=>$nation['gennum'],
'citynum'=>$allcount,
'pop'=>$pop,
'poprate'=>$poprate,
'gold'=>$nation['gold'],
'rice'=>$nation['rice'],
'l12name'=>$level12['name'],
'l12pic'=>$level12['picture'],
'l11name'=>$level11['name'],
'l11pic'=>$level11['picture'],
'l10name'=>$level10['name'],
'l10pic'=>$level10['picture'],
'l9name'=>$level9['name'],
'l9pic'=>$level9['picture'],
'l8name'=>$level8['name'],
'l8pic'=>$level8['picture'],
'l7name'=>$level7['name'],
'l7pic'=>$level7['picture'],
'l6name'=>$level6['name'],
'l6pic'=>$level6['picture'],
'l5name'=>$level5['name'],
'l5pic'=>$level5['picture'],
'tiger'=>$tigerstr,
'eagle'=>$eaglestr,
'gen'=>$gen,
'history'=>$nationHistory,
'aux'=>$statGeneral['aux']
]);
$history = ["<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>{$josaYi} 전토를 통일하였습니다."];
pushWorldHistory($history, $admin['year'], $admin['month']);
//연감 월결산
LogHistory();
}
+57 -22
View File
@@ -5,7 +5,7 @@ namespace sammo;
function delStepLog() {
$date = date('Y_m_d');
@unlink(__dir__."/logs/_{$date}_steplog.txt");
@unlink(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt");
}
function pushRawFileLog($path, $lines){
@@ -50,85 +50,116 @@ function eraseTnmtFightLogAll(){
}
function eraseTnmtFightLog(int $group){
$filepath = __dir__."/logs/fight{$group}.txt";
$filepath = __dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt";
if(file_exists($filepath)){
@unlink($filepath);
}
}
function pushTnmtFightLog(int $group, $log) {
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt", $log);
}
function getTnmtFightLogAll(int $group) {
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
return join('<br>',getFormattedFileLogAll(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt"));
}
function pushSabotageLog($log) {
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $log);
}
function getSabotageLogRecent($count) {
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/_sabotagelog.txt", $count, 150));
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $count, 150));
}
function pushProcessLog($log) {
$date = date('Y_m_d');
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
}
function pushStepLog($log) {
$date = date('Y_m_d');
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
}
function pushLockLog($log) {
$date = date('Y_m_d');
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
}
function pushAdminLog($log) {
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_adminlog.txt", $log);
}
function pushAuctionLog($log) {
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $log);
}
function getAuctionLogRecent(int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/_auctionlog.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $count, 300)));
}
function pushGenLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $log);
}
function getGenLogRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/gen{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $count, 300)));
}
function pushBatRes($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $log);
}
function getBatResRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batres{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $count, 300)));
}
function pushBatLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $log);
}
function getBatLogRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batlog{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $count, 300)));
}
function pushOldNationStop(int $no, int $nationNo){
$logPrefixList = ['batres', 'gen', 'batlog'];
$result = [];
foreach($logPrefixList as $logPrefix){
$path = __dir__."/logs/".UniqueConst::$serverID."/{$logPrefix}{$no}.txt";
if(file_exists($path)){
$fileLen = @filesize($path);
}
else{
$fileLen = 0;
}
$result[$logPrefix] = $fileLen;
}
$baseStopPath = __dir__."/logs/".UniqueConst::$serverID."/stop{$no}.txt";
if(file_exists($baseStopPath)){
$oldValues = Json::decode(file_get_contents($baseStopPath));
}
else{
$oldValues = [];
}
$oldValues[$nationNo] = $result;
file_put_contents($baseStopPath, Json::encode($oldValues, Json::PRETTY));
}
//DB-based
function pushNationHistory($nation, $history) {
function pushNationHistory($nation, ?string $history) {
if(!$history){
return;
}
if(!$nation || !$nation['nation']){
return;
}
@@ -136,7 +167,10 @@ function pushNationHistory($nation, $history) {
$history.'<br>', $nation['nation']);
}
function pushGeneralHistory($me, $history) {
function pushGeneralHistory($me, ?string $history) {
if(!$history){
return;
}
DB::db()->query("UPDATE general set history=concat(%s, history) where no=%i",
$history.'<br>', $me['no']);
}
@@ -146,7 +180,7 @@ function getGeneralHistoryAll(int $no) {
return ConvertLog($history);
}
function pushWorldHistory(array $history, $year=null, $month=null) {
function pushWorldHistory(?array $history, $year=null, $month=null) {
if(!$history){
return;
}
@@ -193,7 +227,7 @@ function getWorldHistoryWithDate($year, $month) {
}
function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
function pushGeneralPublicRecord(?array $history, $year=null, $month=null) {
if(!$history){
return;
}
@@ -298,6 +332,7 @@ function LogHistory($isFirst=0) {
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
$db->insert('history', [
'server_id' => UniqueConst::$serverID,
'year' => $year,
'month' => $month,
'map' => $map_json,
+3 -1
View File
@@ -8,7 +8,9 @@ function printLimitMsg($turntime) {
<html>
<head>
<title>접속제한</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+11 -3
View File
@@ -1,12 +1,14 @@
<?php
namespace sammo;
class MapRequest{
public $serverID;
public $year;
public $month;
public $aux;
public $neutralView;
public $showMe;
function __construct($obj){
$this->serverID = Util::array_get($obj['serverID'], null);
$this->year = Util::array_get($obj['year']);
$this->month = Util::array_get($obj['month']);
$this->aux = Util::array_get($obj['aux'],[]);
@@ -19,14 +21,20 @@ class MapRequest{
/**
* @param int $year
* @param int $month
* @param string|null $serverID
* @return mixed
*/
function getHistoryMap($year, $month){
function getHistoryMap($year, $month, ?string $serverID=null){
if(!$year || !$month){
return ['result'=>false, 'reason'=>'연 월이 지정되지 않음'];
}
$map = DB::db()->queryFirstField('select map from history where year=%i and month=%i',
if($serverID === null){
$serverID = UniqueConst::$serverID;
}
$map = DB::db()->queryFirstField('SELECT map FROM history WHERE server_id = %s AND year=%i and month=%i',
$serverID,
$year,
$month);
@@ -47,7 +55,7 @@ function getWorldMap($req){
}
if($req->year && $req->month){
return getHistoryMap($req->year, $req->month);
return getHistoryMap($req->year, $req->month, $req->serverID??null);
}
$session = Session::getInstance();
-12
View File
@@ -44,15 +44,3 @@ function getMailboxList(){
return $result;
}
//Legacy
function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
$db = DB::db();
$connect=$db->get();
//TODO: moveMsg 쓰는 곳 모두 고쳐!!!
$query = "update {$table} set {$msgtype}{$msgnum}='$msg',{$msgtype}{$msgnum}_type='$type',{$msgtype}{$msgnum}_who='$who',{$msgtype}{$msgnum}_when='$when' where {$column}='$value'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
+464 -196
View File
@@ -228,7 +228,7 @@ function processAI($no) {
// 전쟁준비 선포중이면 2상태
if($dipCount > 0) { $dipState = 2; }
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term<=3";
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term<=5";
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
$dipCount = MYDB_num_rows($result);
// 교전 직전이면 3상태
@@ -484,184 +484,11 @@ function processAI($no) {
//방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0) {
$query = "select A.no,A.name,A.nation,B.nation from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation!='{$general['nation']}' and A.no!='{$general['no']}' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
$curGen = MYDB_fetch_array($result);
if($curGen['no'] != 0) { // 타도시에 있는 경우 국내로 발령
if($dipState >= 3) {
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result);
if($selCity['city'] > 0) {
// 발령
$command = EncodeCommand(0, $curGen['no'], $selCity['city'], 27);
} else {
// 발령
$command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
}
} else {
// 발령
$command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
}
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
} elseif($dipState <= 1) { // 평시엔 균등 발령만
//발령, 최소장수 도시 선택, 최다장수도시의 장수 선택
$query = "select B.city,count(*) as cnt,((B.agri+B.comm+B.secu+B.def+B.wall)/(B.agri2+B.comm2+B.secu2+B.def2+B.wall2)+(B.pop/B.pop2))/2*100 as dev from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.supply=1 group by A.city";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result);
//도시 2개 이상일때만
if($cityCount > 1) {
$min = 500; $minCity = 0;
$max = 0; $maxCity = 0;
$devCity = 0;
for($i=0; $i < $cityCount; $i++) {
$curCity = MYDB_fetch_array($result);
if($curCity['cnt'] >= $max) { $max = $curCity['cnt']; $maxCity = $curCity['city']; }
if($curCity['cnt'] <= $min) { $min = $curCity['cnt']; $minCity = $curCity['city']; }
if($curCity['dev'] < 70) { $devCity = $curCity['city']; } // 개발이 안된 곳 우선
}
if($devCity != 0) { $minCity = $devCity; }
if($maxCity != $minCity) {
$query = "select no from general where city='$maxCity' and nation='{$general['nation']}' and no!='{$general['no']}' and npc>=2 limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
$curGen = MYDB_fetch_array($result);
if($curGen['no'] != 0) {
// 발령
$command = EncodeCommand(0, $curGen['no'], $minCity, 27);
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
}
//계속 진행
}
}
} else {
// 병사있고 쌀있고 후방에 있는 장수
$query = "select A.no from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.front=0 and A.crew>700 and A.rice>700*{$tech} order by A.npc,A.crew desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selGen = MYDB_fetch_array($result);
// 전방 도시, 30% 확률로 태수 있는 전방으로 발령
if(rand()%100 < 30) {
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by gen1 desc,rand() limit 0,1";
} else {
$query = "select city from city where nation='{$general['nation']}' and front=1 and supply=1 order by rand() limit 0,1";
}
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result);
if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
// 발령
$command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
} else {
//병사 없고 인구없는 전방에 있는 장수
$query = "select A.no from general A, city B where A.city=B.city and A.nation='{$general['nation']}' and B.nation='{$general['nation']}' and B.pop<40000 and B.front=1 and A.crew<700 order by A.npc,A.crew limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selGen = MYDB_fetch_array($result);
// 인구많은도시
$query = "select city from city where nation='{$general['nation']}' and supply=1 order by pop desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result);
if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
// 발령
$command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
} else {
// 발령할 장수 없으면 몰포
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
else { $type = "rice"; $type2 = 2; }
if($nation[$type] < $type2*3000) { // 몰수
// 몰수 대상
list($npcGenID, $npcGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc >= 2 ORDER BY %b DESC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$type
);
list($userGenID, $userGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc < 2 ORDER BY %b DESC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$type
);
if($npcGenID === null && $userGenID === null){
$genID = 0;
$genValue = 0;
}
else if($npcGenID === null || $userGenValue > $npcGenValue * 4){
$genID = $userGenID;
$genValue = $userGenValue;
}
else{
$genID = $npcGenID;
$genValue = $npcGenValue;
}
if($genID){
$amount = min(100, intdiv($genValue, 5000)*10 + 10);
// 몰수
$command = EncodeCommand($type2, $genID, $amount, 24); // 금,쌀 1000단위 몰수
}
} else { // 포상
// 포상 대상
list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList(
'SELECT `no`, %b, leader FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$resrc,
$type
);
list($userGenID, $userGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND npc < 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
($type=='gold')?21000:3000,
$type
);
if($npcGenID === null && $userGenID === null){
$genID = 0;
}
else if($npcGenID === null || ($userGenValue !== null && $userGenValue < $npcGenValue * 3)){
$genID = $userGenID;
}
else{
$genID = $npcGenID;
}
if ($genID) {
if($genID === $npcGenID){
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
if($npcLeadership < 40){
$amount = min($amount, intdiv($resrc, 1000)*10 + 10);
}
}
else{
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 2000)*10 + 10);
}
// 포상
$command = EncodeCommand($type2, $genID, $amount, 23); // 금,쌀 1000단위 포상
}
}
}
}
if(isset($command)){
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
}
$command = NPCStaffWork($general, $nation, $dipState);
if($command){
$db->update('nation', [
"l{$general['level']}turn0"=>$command
], 'nation=%i', $general['nation']);
}
}
@@ -709,7 +536,7 @@ function processAI($no) {
){
//쌀을 많이 들고 있다면
$amount = $general['rice'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$amount = intdiv(Util::valueFit($amount, $resrc + 1000, 10000), 100);
$command = EncodeCommand(0, 2, $amount, 44); //헌납
$db->update('general', [
@@ -724,7 +551,7 @@ function processAI($no) {
){
//금을 많이 들고 있다면
$amount = $general['gold'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$amount = intdiv(Util::valueFit($amount, $resrc + 1000, 10000), 100);
$command = EncodeCommand(0, 1, $amount, 44); //헌납
$db->update('general', [
@@ -746,12 +573,12 @@ function processAI($no) {
// R
// ┃ ┃ 공격/내정
// 700┃쌀┣━━━━┓
// 500┃쌀┣━━━━┓
// ┃팜┃ ┃
// 100┣━┫ 내정 ┣━━━
// 100┣━┫ 내정 ┣━━━
// ┃조┃ ┃쌀삼
// 0┗━┻━━━━┻━━━> G
// 100 700
// 100 500
$target = array();
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
@@ -764,7 +591,7 @@ function processAI($no) {
elseif($general['gold'] < 100) { //금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
$command = EncodeCommand(0, 1, $amount, 49); //팜
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
} elseif($general['gold'] < 500 && $general['rice'] < 500) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
$command = EncodeCommand(0, 2, $amount, 49); //삼
@@ -837,7 +664,7 @@ function processAI($no) {
// 700t
} else { // 공격인 경우
if($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
if($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
if($city['pop'] > 40000) { $command = EncodeCommand(0, 0, 0, 11); }
else { $command = EncodeCommand(0, 0, 0, 1); }
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
@@ -851,9 +678,9 @@ function processAI($no) {
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
//자원, 병사 모두 충족
} elseif($general['crew'] >= 700 && $general['train'] < 90) {
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
$command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
$command = EncodeCommand(0, 0, 0, 14); //사기진작
} else {
//공격
@@ -866,25 +693,25 @@ function processAI($no) {
// ┃ ┃
// ┃쌀┃
// ┃팜┃ 공격
// 700t┣━╋━━━━━
//1000t┣━╋━━━━━
// ┃조┃ 쌀삼
// 0┗━┻━━━━━> G
// 700t
// 1000t
//전시일때
if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
} elseif($general['rice'] < $resrc || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) { // 쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
elseif($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
elseif($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
$query = "select no from general where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
@@ -923,13 +750,13 @@ function processAI($no) {
$command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장
}
}
} elseif($general['crew'] >= 700 && $general['train'] < 90) {
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
if($general['atmos'] >= 90 && $general['train'] >= 60 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
}
$command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
if($general['atmos'] >= 60 && $general['train'] >= 90 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
@@ -1024,6 +851,444 @@ function processAI($no) {
return;
}
}
function NPCStaffWork($general, $nation, $dipState){
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate', 'develcost']);
$nationCities = [];
$frontCitiesID = [];
$frontImportantCitiesID = [];
$supplyCitiesID = [];
$backupCitiesID = [];
$tech = getTechCost($nation['tech']);
foreach ($db->query('SELECT * FROM city WHERE nation = %i', $general['nation']) as $nationCity) {
$nationCity['generals'] = [];
$cityID = $nationCity['city'];
$dev =
($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall'])/
($nationCity['agri'] + $nationCity['comm'] + $nationCity['secu'] + $nationCity['def'] + $nationCity['wall']);
$dev += $nationCity['pop'] / $nationCity['pop2'];
$dev /= 50;
$nationCity['dev'] = $dev;
$nationCities[$cityID] = $nationCity;
if($nationCity['supply']){
$supplyCitiesID[] = $cityID;
if($nationCity['front']){
$frontCitiesID[] = $cityID;
if($nationCity['gen1']){
$frontImportantCitiesID[] = $cityID;
}
}
else{
$backupCitiesID[] = $cityID;
}
}
}
Util::shuffle_assoc($nationCities);
shuffle($frontCitiesID);
shuffle($supplyCitiesID);
$nationGenerals = [];
$lostGeneralsID = [];
$userGeneralsID = [];
$npcWarGeneralsID = [];
$npcCivilGeneralsID = [];
$commandList = [];
foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level` FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) {
$cityID = $nationGeneral['city'];
$generalID = $nationGeneral['no'];
if($generalID == $general['no']){
continue;
}
if(key_exists($cityID, $nationCities)){
$nationCities[$cityID]['generals'][] = $generalID;
if(!$nationCities[$cityID]['supply']){
$lostGeneralsID[] = $generalID;
}
}
else{
$lostGeneralsID[] = $generalID;
}
if($nationGeneral['npc']<2 && $nationGeneral['killturn'] >= 5){
$userGeneralsID[] = $generalID;
}
else if($nationGeneral['leader']>=40 && $nationGeneral['killturn'] >= 5){
$npcWarGeneralsID[] = $generalID;
}
else{
//삭턴이 몇 안남은 장수는 '내정장 npc'로 처리
$npcCivilGeneralsID[] = $generalID;
}
$nationGenerals[$generalID] = $nationGeneral;
}
Util::shuffle_assoc($nationGenerals);
shuffle($lostGeneralsID);
uasort($nationCities, function($lhs, $rhs){
//키 순서를 지키지 않지만, 원래부터 random order를 목표로 하므로 크게 신경쓰지 않는다.
return count($lhs['generals']) - count($rhs['generals']);
});
//타 도시에 있는 '유저장' 발령
foreach($lostGeneralsID as $lostGeneralID){
$lostGeneral = $nationGenerals[$lostGeneralID];
if($lostGeneral['npc'] < 2){
if($dipState >= 3 && $frontCitiesID){
$selCityID = Util::choiceRandom($frontCitiesID);
}
else{
$selCityID = Util::choiceRandom($supplyCitiesID);
}
$commandList[EncodeCommand(0, $lostGeneralID, $selCityID, 27)] = 200;
}
}
$resBaseType = [['gold', 1], ['rice', 2]];
[$resName, $resType] = Util::choiceRandom($resBaseType);
usort($userGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
});
usort($npcWarGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
});
usort($npcCivilGeneralsID, function($lhs, $rhs) use ($nationGenerals, $resName){
return $nationGenerals[$lhs][$resName] - $nationGenerals[$rhs][$resName];
});
$avgUserRes = 0;
foreach ($userGeneralsID as $id){
$avgUserRes += $nationGenerals[$id][$resName];
}
$avgUserRes /= max(1, count($userGeneralsID));
$avgNpcWarRes = 0;
foreach ($npcWarGeneralsID as $id){
$avgNpcWarRes += $nationGenerals[$id][$resName];
}
$avgNpcWarRes /= max(1, count($npcWarGeneralsID));
$avgNpcCivilRes = 0;
foreach ($npcCivilGeneralsID as $id){
$avgNpcCivilRes += $nationGenerals[$id][$resName];
}
$avgNpcCivilRes /= max(1, count($npcCivilGeneralsID));
//금쌀이 부족한 '유저장' 먼저 포상
while ($nation[$resName] > ($resName=='gold'?1:2)*3000 && $userGeneralsID) {
$isWarUser = null;
foreach($userGeneralsID as $userGeneralID){
$compUser = $nationGenerals[$userGeneralID];
if($compUser['leader'] >= 50){
$isWarUser = true;
break;
}
if(Util::randBool(0.2)){
$isWarUser = false;
break;
}
}
if($isWarUser === null){
break;
}
$compRes = $compUser[$resName];
$work = false;
if(!$isWarUser){
$work = false;
} else if ($compRes < $avgNpcWarRes*3) {
$work = true;
} elseif ($compRes < $avgNpcCivilRes * 4) {
$work = true;
}
if((($isWarUser || $resName == 'gold') && $compUser[$resName] < 21000) || ($compUser[$resName] < 5000)){
if($work){
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 3000)*10 + 10);
$commandList[EncodeCommand($resType, $userGeneralsID[0], $amount, 23)] = 10; // 금,쌀 1000단위 포상
}
else{
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
$commandList[EncodeCommand($resType, $userGeneralsID[0], $amount, 23)] = 1; // 금,쌀 1000단위 포상
}
}
break;
}
$minRes = $admin['develcost'] * 24 * $tech;
if($nation[$resName] < ($resName=='gold'?1:2)*3000) { // 몰수
// 몰수 대상
$compUser = $userGeneralsID?$nationGenerals[end($userGeneralsID)]:null;
$compNpcWar = $npcWarGeneralsID?$nationGenerals[end($npcWarGeneralsID)]:null;
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[end($npcCivilGeneralsID)]:null;
$compUserRes = $compUser[$resName]??0;
$compNpcWarRes = $compNpcWar[$resName]*5??0;
$compNpcCivilRes = $compNpcCivil[$resName]*10??0;
[$compRes, $compGenID] = max(
[$compNpcCivilRes, $compNpcCivil['no']??null],
[$compNpcWarRes, $compNpcWar['no']??null],
[$compUserRes, $compUser['no']??null]
);
if($compGenID){
$targetGeneral = $nationGenerals[$compGenID];
if($compGenID === ($compNpcCivil['no']??null)){
$amount = intdiv($targetGeneral[$resName] - $minRes * 3, 100);
}
else{
$amount = min(100, intdiv($targetGeneral[$resName], 5000)*10 + 10);
}
if($amount > 0){
$commandList[EncodeCommand($resType, $compGenID, $amount, 24)] = 3;
}
}
} else{ // 포상
$compNpcWar = $npcWarGeneralsID?$nationGenerals[$npcWarGeneralsID[0]]:null;
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[$npcCivilGeneralsID[0]]:null;
if($compNpcWar && $compNpcWar[$resName] < 21000){
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
$commandList[EncodeCommand($resType, $compNpcWar['no'], $amount, 23)] = 3;
}
if($compNpcCivil && $compNpcCivil[$resName] < $minRes){
$amount = intdiv($minRes+99, 100);
$commandList[EncodeCommand($resType, $compNpcCivil['no'], $amount, 23)] = 2;
}
}
//고립 도시 장수 발령
foreach($lostGeneralsID as $lostGeneralID){
$lostGeneral = $nationGenerals[$lostGeneralID];
if($lostGeneral['npc']<2){
//고립 유저 장수는 이미 세팅했음
continue;
}
if($dipState >= 3 && $frontCitiesID){
$selCityID = Util::choiceRandom($frontCitiesID);
}
else{
$selCityID = Util::choiceRandom($supplyCitiesID);
}
//고립된 장수가 많을 수록 발령 확률 증가
$commandList[EncodeCommand(0, $lostGeneralID, $selCityID, 27)] = sqrt(count($lostGeneralsID)) * 10;
}
// 평시엔 균등 발령만
if($dipState <= 1 && count($supplyCitiesID) > 1) {
$targetCity = null;
$minCity = null;
$maxCity = null;
$maxDevCity = null;
foreach($nationCities as $nationCity){
if($nationCity['dev']>=95){
continue;
}
if($nationCity['supply']){
$minCity = $nationCity;
break;
}
}
//reverse_order T_T
$maxCity = end($nationCities);
if(!$minCity){
$minCity = $maxCity;
}
while($maxCity['city'] !== $minCity['city']){
if($nationCity['supply']){
break;
}
$maxCity = prev($nationCities);
}
foreach($nationCities as $nationCity){
if($nationCity['city'] == $maxCity['city']){
break;
}
if(!$nationCity['supply']){
continue;
}
if($nationCity['dev'] < 70){
$targetCity = $nationCity;
break;
}
}
foreach ($nationCities as $nationCity) {
if(!$nationCity['supply']){
continue;
}
if(count($nationCity['generals']) == 0){
continue;
}
if($maxDevCity === null || $maxDevCity['dev'] < $nationCity['dev']){
$maxDevCity = $nationCity;
}
}
if($targetCity === null || (count($targetCity['generals']) >= count($maxCity['generals']) - 1)){
$targetCity = $minCity;
}
if($maxDevCity['dev'] >= 95 && $targetCity['city'] != $maxDevCity['city'] && $targetCity['dev'] <= 70){
$targetGeneral = $nationGenerals[Util::choiceRandom($maxDevCity['generals'])];
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2;
}
if(count($targetCity['generals']) < count($maxCity['generals']) - 2){
//세명 이상 차이나야 함
$targetGeneral = $nationGenerals[Util::choiceRandom($maxCity['generals'])];
if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95){
//유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함!
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5;
}
}
}
// 병사있고 쌀있고 후방에 있는 장수
if($frontCitiesID){
$workRemain = 3;
foreach($nationGenerals as $nationGeneral){
$generalCity = $nationCities[$nationGeneral['city']]??null;
if(!$generalCity){
continue;
}
if($nationGeneral['crew'] < 2000){
continue;
}
if($nationGeneral['rice'] < 700 * $tech){
continue;
}
if($generalCity['front']){
continue;
}
if($nationGeneral['train'] * $nationGeneral['atmos'] < 75 * 75){
continue;
}
$score = 5;
if($nationGeneral['npc']<2){
$score *= 4;
}
if(Util::randBool(0.3) && $frontImportantCitiesID){
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
}
else{
$targetCityID = Util::choiceRandom($frontCitiesID);
}
$command = EncodeCommand(0, $nationGeneral['no'], $targetCityID, 27);
if($nationGeneral['npc']<2 && ($workRemain&2)){
$workRemain ^= 2;
$commandList[$command] = $score;
}
else if($nationGeneral['npc']>=2 && ($workRemain&1)){
$workRemain ^= 1;
$commandList[$command] = $score;
}
if($workRemain <= 0){
break;
}
}
}
//병사 없고 인구없는 전방에 있는 장수
if($frontCitiesID && $backupCitiesID){
$workRemain = 3;
foreach($nationGenerals as $nationGeneral){
$generalCity = $nationCities[$nationGeneral['city']]??null;
if(!$generalCity){
continue;
}
if($nationGeneral['crew'] >= 1000){
continue;
}
if($nationGeneral['rice'] < 700 * $tech){
continue;
}
if(!$generalCity['front']){
continue;
}
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
continue;
}
$score = 5;
if($nationGeneral['npc']<2){
$score *= 4;
}
$popTrial = 5;
for($popTrial = 0; $popTrial < 5; $popTrial++){
$targetCity = $nationCities[Util::choiceRandom($backupCitiesID)];
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
continue;
}
if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) {
break;
}
}
$command = EncodeCommand(0, $nationGeneral['no'], $targetCity['city'], 27);
if($nationGeneral['npc']<2 && ($workRemain&2)){
$workRemain ^= 2;
$commandList[$command] = $score;
}
else if($nationGeneral['npc']>=2 && ($workRemain&1)){
$workRemain ^= 1;
$commandList[$command] = $score;
}
if($workRemain <= 0){
break;
}
}
}
if(!$commandList)return 0;
return Util::choiceRandomUsingWeight($commandList);
}
//종전하기, 지급율
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
@@ -1040,8 +1305,11 @@ function Promotion($nation, $level) {
$query = "update general set level=1 where level<11 and level>4 and nation='$nation'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
$maxBelong = $db->queryFirstField('SELECT max(belong) FROM `general` WHERE nation=%i', $nation);
$maxBelong = min($maxBelong - 1, 3);
//유저 후보 선택
$query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=3 and killturn>='{$admin['killturn']}' order by rand() limit 0,1";
$query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=$maxBelong and killturn>='{$admin['killturn']}' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),"");
$userCandidate = MYDB_fetch_array($result);
// 유저수뇌 안함
+7 -2
View File
@@ -663,8 +663,13 @@ function process_46(&$general) {
} elseif($city['level'] != 5 && $city['level'] != 6) {
$log[] = "<C>●</>{$admin['month']}월:중, 소 도시에서만 가능합니다. 건국 실패. <1>$date</>";
} else {
$query = "update nation set name='{$general['makenation']}',color='$color',level=1,type='$type',capital='{$general['city']}' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'name'=>$general['makenation'],
'color'=>$color,
'level'=>1,
'type'=>$type,
'capital'=>$general['city'],
], 'nation=%i', $general['nation']);
refreshNationStaticInfo();
$nation = getNationStaticInfo($general['nation']);
-7
View File
@@ -24,13 +24,6 @@ function Tag2Code(string $str) {
return nl2br($str);
}
function BadTag2Code(string $str) {
/* FIXME: 제대로된 tag 변환 코드 사용 */
$str = str_replace("<script", "<sorry", $str);
$str = str_replace("</script", "</sorry", $str);
return $str;
}
function tab(string $str, $maxsize, $ch) {
$size = strlen($str);
+11
View File
@@ -172,4 +172,15 @@ function getMapHtml(){
$templates = new \League\Plates\Engine(__dir__.'/templates');
return $templates->render('map');
}
function getInvitationList(array $nationList){
$templates = new \League\Plates\Engine(__dir__.'/templates');
foreach($nationList as &$nation){
$nation['textColor'] = newColor($nation['color']);
}
return $templates->render('invitationList', [
'nationList'=>$nationList
]);
}
+6 -5
View File
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
], 'owner=%i', $userID);
}
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote']);
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
@@ -84,7 +84,8 @@ $color = "cyan";
<title><?=UniqueConst::$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
@@ -181,11 +182,11 @@ echo "
";
$vote = $admin['vote']?:[''];
$vote[0] = Tag2Code($vote[0]);
$vote_title = Tag2Code($admin['vote_title']??'-');
if ($vote[0] == "") {
echo "<font color=magenta>진행중 설문 없음</font>";
} else {
echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote[0]</marquee>";
echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote_title</marquee>";
}
@@ -195,7 +196,7 @@ echo "
?>
<tr><td colspan=5 style="text-align:left;">접속중인 국가: <?=onlinenation()?></td></tr>
<tr><td colspan=5 style="text-align:left;"><?=adminMsg()?></td></tr>
<tr><td colspan=5 style="text-align:left;">【 국가방침 】<?php nationMsg(); ?></td></tr>
<tr><td colspan=5 style="text-align:left;"><div>【 국가방침 】</div><div style="color:orange;"><?=nationMsg()?></div></td></tr>
<tr><td colspan=5 style="text-align:left;">【 접속자 】<?=onlinegen()?></td></tr>
<?php
if ($session->userGrade >= 5) {
+2 -1
View File
@@ -27,7 +27,8 @@ if($session->userGrade < 5 && !$allowReset){
<title>설치</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
+2 -1
View File
@@ -20,7 +20,8 @@ if($session->userGrade == 5){
<title>설치</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
+9
View File
@@ -6,6 +6,15 @@ include "func.php";
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
Json::die([
'result'=>true,
'affected'=>0,
'status'=>'no_reserved_table'
]);
}
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
if(!$reserved){
+1 -1
View File
@@ -13,7 +13,7 @@ $defaultPost = [
'neutralView' => false,
'showMe' => true
];
$post = WebUtil::parseJsonPost() + $defaultPost;
$post = Json::decode(Util::getReq('data', 'string', '{}'));
if(!$session->isGameLoggedIn()){
$post['neutralView'] = true;
+6 -1
View File
@@ -6,6 +6,7 @@ include "func.php";
$year = Util::getReq('year', 'int');
$month = Util::getReq('month', 'int');
$serverID = Util::getReq('serverID', 'string', null);
extractMissingPostToGlobals();
@@ -26,13 +27,17 @@ if(!$year || !$month) {
}
if(!$serverID){
$serverID = UniqueConst::$serverID;
}
//로그인 검사
$session = Session::requireGameLogin([])->setReadOnly();
$db = DB::db();
$connect=$db->get();
$map = $db->queryFirstField('SELECT map FROM history WHERE year=%i AND month=%i', $year, $month);
$map = $db->queryFirstField('SELECT map FROM history WHERE server_id=%s AND year=%i AND month=%i', $serverID, $year, $month);
if(!$map){
Json::die([
+1 -1
View File
@@ -17,7 +17,7 @@ if (!$generalID) {
]);
}
$jsonPost = WebUtil::parseJsonPost();
$jsonPost = Json::decode(Util::getReq('data', 'string', '{}'));
$msgID = Util::toInt($jsonPost['msgID']??null);
$msgResponse = $jsonPost['response']??null;
+1 -2
View File
@@ -7,8 +7,7 @@ include('func.php');
$session = Session::requireGameLogin([])->setReadOnly();
$userID = Session::getUserID();
$jsonPost = WebUtil::parseJsonPost();
$reqSequence = (int)Util::array_get($jsonPost['sequence'], 0);
$reqSequence = Util::getReq('sequence', 'int', 0);
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
+1 -1
View File
@@ -4,7 +4,7 @@ namespace sammo;
include 'lib.php';
include 'func.php';
$post = WebUtil::parseJsonPost();
$post = Json::decode(Util::getReq('data', 'string', '{}'));
'@phan-var mixed[] $post';
$v = new Validator($post);
+7 -21
View File
@@ -31,7 +31,9 @@ $connect=$db->get();
<html>
<head>
<title><?=UniqueConst::$serverName?>: 장수생성</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<script>
var defaultStatTotal = <?=GameConst::$defaultStatTotal?>;
var defaultStatMin = <?=GameConst::$defaultStatMin?>;
@@ -39,7 +41,7 @@ var defaultStatMax = <?=GameConst::$defaultStatMax?>;
</script>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/join.js')?>
@@ -63,27 +65,11 @@ if ($gencount >= $admin['maxgeneral']) {
echo "<script>history.go(-1);</script>";
exit();
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
<?php
$query = "select name,scoutmsg,color from nation";
$nationresult = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect), "");
$nationcount = MYDB_num_rows($nationresult);
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation ORDER BY rand()');
for ($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
if ($nation['scoutmsg'] == "") {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
} else {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
}
}
echo getInvitationList($nationList);
?>
</table>
<form name=form1 method=post action=join_post.php>
<table align=center width=1000 class='tb_layout bg0'>
@@ -161,7 +147,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
</tr>
<tr>
<td align=center colspan=3>
<font color=orange>모든 능력치는 ( 10 <= 능력치 <= <?=GameConst::$defaultStatMax?> ) 사이로 잡으셔야 합니다.<br>
<font color=orange>모든 능력치는 ( <?=GameConst::$defaultStatMin?> <= 능력치 <= <?=GameConst::$defaultStatMax?> ) 사이로 잡으셔야 합니다.<br>
그 외의 능력치는 가입되지 않습니다.</font>
</td>
</tr>
+4 -1
View File
@@ -43,7 +43,10 @@ $userID = Session::getUserID();
//NOTE: 이 페이지에서는 세션에 데이터를 등록하지 않음. 로그인은 이후에.
$name = Util::getReq('name');
$name = htmlspecialchars($name);
$name = StringUtil::removeSpecialCharacter($name);
$name = WebUtil::htmlPurify($name);
$name = StringUtil::textStrip($name);
$pic = (int)Util::getReq('pic', 'bool', 0);
$character = Util::getReq('character', 'int', 0);
@@ -278,7 +281,7 @@ $rootDB->insert('member_log', [
?>
<script>
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n튜토리얼을 꼭 읽어보세요!');
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
</script>
<script>location.replace('./');</script>
+908
View File
@@ -0,0 +1,908 @@
$(function() {
var cityList = {};
var userList = {};
var cityGroupOrder = ['하북','중원','서북','서촉','남중','초','오월','동이'];
var city규모 = {:1,:2,:3,:4,:5,:6,:7,:8};
window.cityList = cityList;
window.userList = userList;
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var mergeSort = function(arr,cmpFunc){
if(typeof cmpFunc == "undefined"){
cmpFunc = function(a,b){
if(a<b) return -1;
if(a>b) return 1;
return 0;
}
}
var merge = function(left,right){
var retVal=[];
var leftIdx=0;
var rightIdx=0;
while(leftIdx<left.length && rightIdx<right.length){
var cmpVal = cmpFunc(left[leftIdx],right[rightIdx]);
if(cmpVal<=0){
retVal.push(left[leftIdx]);
leftIdx++;
}
else{
retVal.push(right[rightIdx]);
rightIdx++;
}
}
retVal = retVal.concat(left.slice(leftIdx)).concat(right.slice(rightIdx))
return retVal;
};
var _mergeSort = function(arr){
if(arr.length<2){
return arr;
}
var middle = Math.floor(arr.length/2);
var left = arr.slice(0,middle);
var right = arr.slice(middle);
return merge(_mergeSort(left),_mergeSort(right));
};
return _mergeSort(arr);
};
window.mergeSort = mergeSort;
var extDutyWindow = function(userInfo){
window.currUser = userInfo;
//도시 순서 재구성
var subCityGroupList = {};
var subCityList = {};
var tmpOldVal = 0;
//var callCity = function(num){console.log('city no.'+num+' is clicked!')};
if($('#ext_win').length==0){
var $win = $('<div id="ext_win" style="padding:0;" title="관직 임명"><table style="padding:0;margin:0;" cellspacing="0" cellpadding="0" border="0"><tr><td width="700px" style="padding:0;"><iframe id="in_frame" src="map.php?type=1&amp;graphic=1" width="700" height="520" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe></td>'+
'<td width="305px" style="padding:0;vertical-align:top;height:520px;"><div style="height:520px;width:305px;overflow-y:scroll;overflow-x:hidden;">'+
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">시중</th></tr></thead><tbody class="content">'+
'</tbody></table></div></td></tr></table>'+
'<form name="form1" id="fake_form"><span id="user_name"></span> : <select name="double" id="city_select"></select>'+
'<div id="duty_radio" style="display:inline;">'+
'<input type="radio" id="duty_type1" value="4" name="duty_radio"><label for="duty_type1">태수</label>'+
'<input type="radio" id="duty_type2" value="3" name="duty_radio"><label for="duty_type2">군사</label>'+
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">시중</label>'+
'</div></form></div>');
$win.hide();
$win.css('font-size','9pt');
$('#fake_form').css('display','inline');
$('body').append($win);
$('#inner_table').attr('border','1').attr('cellspacing',"0").attr('cellpadding',"0")
.attr('bordercolordark',"gray").attr('bordercolorlight',"black").attr('align','center')
.css('font-size','13px').css('width','290px');
$('#inner_table thead tr');
$('#fake_form').submit(function(){
return false;
});
$('#in_frame').load(function(){
$('#in_frame').contents().find('div').click(function(){$('#city_select').change();});
});
$("#duty_radio").buttonset();
var $city_select = $('#city_select');
$city_select.css('color','white').css('background-color','black');
$city_select.change(function(event){
if($city_select.val()==null){
$city_select.val(tmpOldVal);
return false;
}
if($city_select.val() == tmpOldVal){
return false;
}
tmpOldVal = $city_select.val();
//console.log(tmpOldVal);
var newInfo = subCityList[tmpOldVal];
var cityInfo = newInfo.city;
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
//console.log(p태수,p군사,p시중);
$('#duty_type1').button({disabled:!p태수});
$('#duty_type2').button({disabled:!p군사});
$('#duty_type3').button({disabled:!p시중});
var $태수 = cityInfo.$태수;
var $군사 = cityInfo.$군사;
var $시중 = cityInfo.$시중;
return true;
});
$win.dialog({
autoOpen:false,
width:1005,
height:680,
buttons:{
"임명":function(){
//console.log("임명!");
var $checked = $('#duty_radio :radio:checked');
if($checked.length==0 || $checked.attr('disabled')=='disabled'){
alert('직책을 선택해주세요!');
return false;
}
var type = $checked.attr('value');
var text = $checked.next().text();
var userVal = currUser.val;
var userName = currUser.name;
var cityVal = $city_select.val();
var cityInfo = subCityList[cityVal].city;
$.post(basicPath+'c_myBossInfo.php',{
citylist:cityVal,
genlist:userVal,
level:type,
btn:'임명'
},function(rawData){
cityInfo['p'+text]=false;
var $target = cityInfo.users.find('.mode_'+type);
$target.prop('disabled',true);
$target.css('background','transparent');
$target.css('border','0');
$target.css('color','');
cityInfo['$'+text].html(userName);
$win.dialog("close");
});
},
"닫기":function(){
$win.dialog("close");
}
}
});
//console.log($win.parent());
$win.parent().css('font-size','10pt');
}
$('#ext_win').dialog("close").dialog( "option", "position", { my: "center top", at: "center bottom", of: userInfo.$user} );
var $innerContent = $('#inner_table .content');
$innerContent.html('');
$("#user_name").html(userInfo.name+'['+userInfo.city+']');
$('#city_select').html('');
$.each(cityList,function(idx,cityInfo){
var 지역 = cityInfo.지역;
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
var newInfo = {
지역 : 지역,
규모 : cityInfo.규모,
이름 : cityInfo.이름,
val : cityInfo.val,
city : cityInfo,
p태수 : p태수,
p군사 : p군사,
p시중 : p시중
};
//console.log(newInfo);
if(p태수 || p군사 || p시중){
if(typeof subCityGroupList[지역] == 'undefined'){
subCityGroupList[지역] = [];
}
subCityGroupList[지역].push(newInfo);
subCityList[cityInfo.val] = newInfo;
}
});
$.each(cityGroupOrder,function(idx,groupName){
if(typeof subCityGroupList[groupName] == 'undefined'){
return true;
}
var subList = subCityGroupList[groupName];
var $group = $('<tr><td colspan="4" style="color:skyblue;">【 '+groupName+' 】</td></tr>');
$innerContent.append($group);
subList.sort(function(a,b){
var cmp규모 = city규모[a.규모] - city규모[b.규모];
if(cmp규모 != 0) return cmp규모;
return a.이름.localeCompare(b.이름);
});
var $optgroup = $('<optgroup label=" 【 '+groupName+' 】 " style="color:skyblue;"></optgroup>');
$.each(subList,function(idx,newInfo){
$optgroup.append('<option value="'+newInfo.val+'" style="color:white;">'+newInfo.이름+'</option>');
var cityInfo = newInfo.city;
var $city = $('<tr><td>'+newInfo.이름+'</td></tr>');
var $태수 = cityInfo.$태수.clone();
$city.append($태수);
if(!newInfo.p태수){
$태수.css('color','red');
}
else{
$태수.click(function(){
$('#duty_radio :radio:eq(0)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
var $군사 = cityInfo.$군사.clone();
$city.append($군사);
if(!newInfo.p군사)$군사.css('color','red');
else{
$군사.click(function(){
$('#duty_radio :radio:eq(1)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
var $시중 = cityInfo.$시중.clone();
$city.append($시중);
if(!newInfo.p시중)$시중.css('color','red');
else{
$시중.click(function(){
$('#duty_radio :radio:eq(2)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
$innerContent.append($city);
$city.click(function(){
$('#city_select').val(newInfo.val).change();
});
});
$('#city_select').append($optgroup);
});
tmpOldVal = $('#city_select').val();
$('#city_select').change();
$('#ext_win').dialog("open");
};
var loadDuty = function(){
try{
$('.for_duty').remove();
$.get(basicPath+'b_myBossInfo.php',function(rawData){
$html = $(rawData);
//window.$html = $html;
var cnt =0;
var $tmpTable = null;
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==5){
$tmpTable = $(this);
return false;
}
}
});
$selects = $tmpTable.find("select");
if($selects.length == 0){
alert("수뇌가 아닙니다!");
return false;
}
var setUserAvailable = function($userList,typeName){
$userList.each(function(idx){
var $this = $(this);
var val = $this.val();
var name = $.trim($this.text());
for(var i=name.length-1;i>0;i--){
if(name[i]=='【'){
name = $.trim(name.substr(0,i));
break;
}
}
if(val == '0'){
return true;
}
if(typeof userList[name] != 'undefined'){
userList[name].val = val;
userList[name][typeName] = true;
}
});
};
var setCityAvailiable = function($cityList,typeName){
$cityList.each(function(idx){
var $this = $(this);
var val = $.trim($this.val());
var name = $.trim($this.text());
cityList[name].val = val;
cityList[name][typeName] = true;
});
}
$.each(cityList,function(idx,cityInfo){
cityInfo.p태수=false;
cityInfo.p군사=false;
cityInfo.p시중=false;
});
$.each(userList,function(idx,userInfo){
userInfo.p태수=false;
userInfo.p군사=false;
userInfo.p시중=false;
});
setUserAvailable($selects.eq(1).find("option"),"p태수");
setUserAvailable($selects.eq(3).find("option"),"p군사");
setUserAvailable($selects.eq(5).find("option"),"p시중");
setCityAvailiable($selects.eq(0).find("option"),"p태수");
setCityAvailiable($selects.eq(2).find("option"),"p군사");
setCityAvailiable($selects.eq(4).find("option"),"p시중");
$.each(cityList,function(idx,cityInfo){
//console.log(cityInfo.users.children());
cityInfo.users.children().each(function(idx){
//console.log(this);
var $this = $(this);
var username = $this.data('username');
var userInfo = userList[username];
if(!userInfo){
return true;
}
if(userInfo.val == '-1'){
return true;
}
$name = $this.find('.nameplate');
$name.append('<br class="for_duty">');
var addBtn=function($name,cityInfo,userInfo,type,text,warn){
var enabled = cityInfo['p'+text]&&userInfo['p'+text];
var cityVal = cityInfo.val;
var $btn = $('<button>'+text.substr(0,1)+'</button>');
$btn.addClass('mode_'+type);
$btn.addClass('for_duty');
if(!enabled){
$btn.prop('disabled',true);
$btn.css('background','transparent');
$btn.css('border','0');
}
else{
if(userInfo.is수뇌){
$btn.css('color','red');
}
}
$btn.css('padding','1px 4px');
$btn.css('margin','0');
$btn.click(function(){
if(userInfo.is수뇌){
if(!confirm('수뇌입니다. 임명할까요?')){
return false;
}
}
$.post(basicPath+'c_myBossInfo.php',{
citylist:cityVal,
genlist:userInfo.val,
level:type,
btn:'임명'
},function(rawData){
cityInfo['p'+text]=false;
var $target = cityInfo.users.find('.mode_'+type);
$target.prop('disabled',true);
$target.css('background','transparent');
$target.css('border','0');
$target.css('color','');
cityInfo['$'+text].html(userInfo.name);
});
});
//console.log($btn);
$name.append($btn);
};
addBtn($name,cityInfo,userInfo,4,'태수');
addBtn($name,cityInfo,userInfo,3,'군사');
addBtn($name,cityInfo,userInfo,2,'시중');
//특수 버튼!
if(userInfo.p태수||userInfo.p군사||userInfo.p시중){
var $btn = $('<button>...</button>');
$btn.addClass('for_duty');
if(userInfo.is수뇌){
$btn.css('color','red');
}
$btn.css('padding','1px 4px');
$btn.css('margin','0');
$btn.click(function(){
if(userInfo.is수뇌){
if(!confirm('수뇌입니다. 임명할까요?')){
return false;
}
}
extDutyWindow(userInfo);
});
$btn.css('border','solid 1px Chocolate').css('background-color','#400000').css('margin-left','4px');
$btn.css('line-hight','20px').css('color','GhostWhite').css('padding','2px 2px').css('height','18px').css('line-height','8px');
//$name.append($btn);
}
});
});
});
}
catch(a){
console.log(a);
}
return false;
};
var loadUser = function(){
$.each(cityList,function(idx,val){
if(typeof val.users == "undefined"){
val.obj.append('<tr><td colspan="12"><table align="center" class="tb_layout cityUser bg0">'+
'<thead><tr>'+
'<td width="100" align="center" class="bg1">이 름</td><td width="100" align="center" class="bg1">통무지</td><td width="100" align="center" class="bg1">부 대</td><td width="60" align="center" class="bg1">자 금</td>'+
'<td width="60" align="center" class="bg1">군 량</td><td width="30" align="center" class="bg1">守</td><td width="60" align="center" class="bg1">병 종</td>'+
'<td width="60" align="center" class="bg1">병 사</td><td width="50" align="center" class="bg1">훈련</td><td width="50" align="center" class="bg1">사기</td><td width="150" align="center" class="bg1">명 령</td>'+
'<td width="60" align="center" class="bg1">삭턴</td><td width="60" align="center" class="bg1">턴</td>'+
'</tr></thead>'+
'<tbody class="cityUserBody"></tbody></table></td></tr>');
val.users = val.obj.find(".cityUserBody");
}
else{
val.users.html("");
}
});
$.get(basicPath+'b_genList.php',function(rawData){
var cnt =0;
var $helper = $('#helper_genlist');
$helper.html('').append($.parseHTML(rawData));
var tmpUsers = $('#general_list tbody tr');
tmpUsers.each(function(idx){
var $this = $(this);
var $city = $this.children('.i_city');
$city.remove();
var cityName = $.trim($city.text());
var $name = $this.children('.i_name');
$name.addClass('nameplate');
var name = $name.find('.t_name').html();
var $work = $this.children('.i_action');
var cityInfo = cityList[cityName];
if(typeof cityInfo == 'undefined'){
return true;
}
if(cityInfo.warn주민)$work.html($work.html().split('정착 장려').join('<span style="color:yellow;">정착 장려</span>'));
if(cityInfo.warn농업)$work.html($work.html().split('농지 개간').join('<span style="color:yellow;">농지 개간</span>'));
if(cityInfo.warn상업)$work.html($work.html().split('상업 투자').join('<span style="color:yellow;">상업 투자</span>'));
if(cityInfo.warn치안)$work.html($work.html().split('치안 강화').join('<span style="color:yellow;">치안 강화</span>'));
if(cityInfo.warn수비)$work.html($work.html().split('수비 강화').join('<span style="color:yellow;">수비 강화</span>'));
if(cityInfo.warn성벽)$work.html($work.html().split('성벽 보수').join('<span style="color:yellow;">성벽 보수</span>'));
var $stat = $this.children('.i_stat');
var stat = $stat.text();
var is수뇌 = stat.indexOf('+')>=0;
$this.data('username',name);
if(cityList[cityName].$태수.text() == name){
cityList[cityName].$태수.css('color','lightgreen');
}
if(cityList[cityName].$군사.text() == name){
cityList[cityName].$군사.css('color','lightgreen');
}
if(cityList[cityName].$시중.text() == name){
cityList[cityName].$시중.css('color','lightgreen');
}
userList[name]={
$city:cityInfo,
city:cityName,
$user:$this,
name:name,
val:'-1',
p태수:false,
p군사:false,
p시중:false,
is수뇌:is수뇌
};
if(cityList[cityName]){
cityList[cityName].users.append($this);
}
});
});
if($("#loadDutyBtn").length == 0){
var $onBossList = $('<button id="loadDutyBtn">인사부 연동</button>');
$onBossList.click(function(){
loadDuty();
return false;
});
$('form').append($onBossList);
}
$('#by_users').show();
};
var mainFunc = function(){
//대상 추출
window.cityList = {};
window.userList = {};
$("form").each(function(){
var $this = $(this);
$this.attr('name','p'+$this.attr('name'));
});
$("table").each(function(idx,val){
$this = $(this);
if($this.attr('class')=='tb_layout bg2'){
$this.addClass('cityInfo');
}
else{
return true;
}
window.$tmpTable = $this;
var cityInfo = {};
//이름 추출
{
var titleText = $this.find('tr:eq(0)>td:eq(0)').text();
var loc0 = titleText.indexOf("【");
var loc1 = titleText.indexOf("|");
var loc2 = titleText.indexOf("】");
var cityLoc = $.trim(titleText.substring(loc0+1,loc1));
var citySize = $.trim(titleText.substring(loc1+1,loc2));
var cityName = $.trim(titleText.substring(loc2+1));
cityName = cityName.replace("[","");
cityName = cityName.replace("]","");
$this.data('cityname',cityName);
cityInfo.지역 = cityLoc;
cityInfo.규모 = citySize;
cityInfo.이름 = cityName;
cityInfo.val = '-1';
cityInfo.p태수 = false;
cityInfo.p군사 = false;
cityInfo.p시중 = false;
}
//주민, 농상치성수
{
var $baseTr = $this.find('tr:eq(1)');
cityInfo.$주민 = $baseTr.find('td:eq(1)');
cityInfo.$농업 = $baseTr.find('td:eq(3)');
cityInfo.$상업 = $baseTr.find('td:eq(5)');
cityInfo.$치안 = $baseTr.find('td:eq(7)');
cityInfo.$수비 = $baseTr.find('td:eq(9)');
cityInfo.$성벽 = $baseTr.find('td:eq(11)');
var tmpVal;
tmpVal = cityInfo.$주민.text().split('/');
cityInfo.주민 = parseInt(tmpVal[0]);
cityInfo.max주민 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$농업.text().split('/');
cityInfo.농업 = parseInt(tmpVal[0]);
cityInfo.max농업 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$상업.text().split('/');
cityInfo.상업 = parseInt(tmpVal[0]);
cityInfo.max상업 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$치안.text().split('/');
cityInfo.치안 = parseInt(tmpVal[0]);
cityInfo.max치안 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$수비.text().split('/');
cityInfo.수비 = parseInt(tmpVal[0]);
cityInfo.max수비 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$성벽.text().split('/');
cityInfo.성벽 = parseInt(tmpVal[0]);
cityInfo.max성벽 = parseInt(tmpVal[1]);
if (cityInfo.주민>cityInfo.max주민*0.9){ cityInfo.$주민.css('color','lightgreen');}
else if (cityInfo.주민>cityInfo.max주민*0.7){ cityInfo.$주민.css('color','yellow');}
else { cityInfo.$주민.css('color','orangered');}
if (cityInfo.농업>cityInfo.max농업*0.8){ cityInfo.$농업.css('color','lightgreen');}
else if (cityInfo.농업>cityInfo.max농업*0.4){ cityInfo.$농업.css('color','yellow');}
else { cityInfo.$농업.css('color','orangered');}
if (cityInfo.상업>cityInfo.max상업*0.8){ cityInfo.$상업.css('color','lightgreen');}
else if (cityInfo.상업>cityInfo.max상업*0.4){ cityInfo.$상업.css('color','yellow');}
else { cityInfo.$상업.css('color','orangered');}
if (cityInfo.치안>cityInfo.max치안*0.8){ cityInfo.$치안.css('color','lightgreen');}
else if (cityInfo.치안>cityInfo.max치안*0.4){ cityInfo.$치안.css('color','yellow');}
else { cityInfo.$치안.css('color','orangered');}
if (cityInfo.수비>cityInfo.max수비*0.6){ cityInfo.$수비.css('color','lightgreen');}
else if (cityInfo.수비>cityInfo.max수비*0.3){ cityInfo.$수비.css('color','yellow');}
else { cityInfo.$수비.css('color','orangered');}
if (cityInfo.성벽>cityInfo.max성벽*0.6){ cityInfo.$성벽.css('color','lightgreen');}
else if (cityInfo.성벽>cityInfo.max성벽*0.3){ cityInfo.$성벽.css('color','yellow');}
else { cityInfo.$성벽.css('color','orangered');}
cityInfo.remain주민 = cityInfo.주민-cityInfo.max주민;
cityInfo.remain농업 = cityInfo.농업-cityInfo.max농업;
cityInfo.remain상업 = cityInfo.상업-cityInfo.max상업;
cityInfo.remain치안 = cityInfo.치안-cityInfo.max치안;
cityInfo.remain수비 = cityInfo.수비-cityInfo.max수비;
cityInfo.remain성벽 = cityInfo.성벽-cityInfo.max성벽;
cityInfo.warn주민 = false;
cityInfo.warn농업 = false;
cityInfo.warn상업 = false;
cityInfo.warn치안 = false;
cityInfo.warn수비 = false;
cityInfo.warn성벽 = false;
if(cityInfo.remain주민 > -10*2000) cityInfo.warn주민 = true;
if(cityInfo.주민 > 0.92*cityInfo.max주민) cityInfo.warn주민 = true;
if(cityInfo.remain농업 > -10*100) cityInfo.warn농업 = true;
if(cityInfo.remain상업 > -10*100) cityInfo.warn상업 = true;
if(cityInfo.remain치안 > -10*100) cityInfo.warn치안 = true;
if(cityInfo.remain수비 > -10*70) cityInfo.warn수비 = true;
if(cityInfo.remain성벽 > -10*70) cityInfo.warn성벽 = true;
if(cityInfo.warn농업) cityInfo.$농업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain농업+']</span>');
if(cityInfo.warn상업) cityInfo.$상업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain상업+']</span>');
if(cityInfo.warn치안) cityInfo.$치안.append('<span class="remain" style="color:yellow;">['+cityInfo.remain치안+']</span>');
if(cityInfo.warn수비) cityInfo.$수비.append('<span class="remain" style="color:yellow;">['+cityInfo.remain수비+']</span>');
if(cityInfo.warn성벽) cityInfo.$성벽.append('<span class="remain" style="color:yellow;">['+cityInfo.remain성벽+']</span>');
}
//태수,군사,시중
{
var $baseTr = $this.find('tr:eq(2)');
cityInfo.$태수 = $baseTr.find('td:eq(7)');
cityInfo.$군사 = $baseTr.find('td:eq(9)');
cityInfo.$시중 = $baseTr.find('td:eq(11)');
}
//기타
{
cityInfo.userCnt = $this.find('tr:eq(3) td:eq(1)').text().split(',').length -1;
}
cityInfo.obj = $this;
cityList[cityInfo.이름] = cityInfo;
});
var $onGenList = $('<button>암행부 연동</button>');
$onGenList.click(function(){
loadUser();
return false;
});
$('form').append($onGenList);
$('table:eq(0) tr:last').after('<tr><td id="sort_more"></td></tr>');
$sort_more = $('#sort_more');
$sort_more.html('재 정렬 순서 :');
var sortIt = function(callback){
var arCity = [];
$('.cityInfo').each(function(){
var $this = $(this);
var cityName = $this.data('cityname');
var cityInfo = cityList[cityName];
arCity.push(cityInfo);
});
arCity = mergeSort(arCity,callback);
//console.log(arCity);
var $anchor = $('.anchor');
//console.log($anchor);
$('body > br').remove();
$('.cityInfo').detach();
$.each(arCity,function(idx,val){
$anchor.before('<br>');
$anchor.before(val.obj);
});
$anchor.before('<br>');
};
var $btn;
$btn = $('<button>도시명</button>').click(function(){
sortIt(function(a,b){
return a.이름.localeCompare(b.이름);
});
});
$sort_more.append($btn);
$btn = $('<button>인구율</button>').click(function(){
sortIt(function(a,b){
return 1.0*a.주민/a.max주민 - 1.0*b.주민/b.max주민;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 주민</button>').click(function(){
sortIt(function(a,b){
return a.remain주민 - b.remain주민;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 농업</button>').click(function(){
sortIt(function(a,b){
return a.remain농업 - b.remain농업;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 상업</button>').click(function(){
sortIt(function(a,b){
return a.remain상업 - b.remain상업;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 치안</button>').click(function(){
sortIt(function(a,b){
return a.remain치안 - b.remain치안;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 수비</button>').click(function(){
sortIt(function(a,b){
return a.remain수비 - b.remain수비;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 성벽</button>').click(function(){
sortIt(function(a,b){
return a.remain성벽 - b.remain성벽;
});
});
$sort_more.append($btn);
$btn = $('<button>배치 장수 수</button>').click(function(){
sortIt(function(a,b){
return b.userCnt - a.userCnt;
});
});
$sort_more.append($btn);
};
mainFunc();
});
+235
View File
@@ -0,0 +1,235 @@
$(function(){
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var headTbl = $('table:eq(0)');
var $userFrame;
var 국가테이블= $('table:gt(0):lt(-2)');
var getUserType = function(,,){
var = ++;
if( < *0.2) {
return "무지";
}else if( < *0.2) {
return "지";
}else if( < *0.2) {
return "무";
}else{
return "만능";
}
};
function formatScore(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var runAnalysis = function(){
var $content = $('#on_mover .content');
$.get(basicPath+'a_genList.php',function(rawData){
try{
var $html = $(rawData);
var $장수일람 = {};
var 국가별 = {};
var cnt =0;
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==2){
$장수일람 = $(this);
return false;
}
}
});
$장수일람.find('tr:gt(0)').each(function(){
var 장수 = {};
$this = $(this);
$tds = $this.find('td');
var 장수명 = $.trim($tds.eq(1).text());
var 국가 = $.trim($tds.eq(6).text());
장수.html = $this.clone();
장수.장수명 = 장수명;
장수.국가 = 국가;
장수.벌점 = parseInt($tds.eq(-1).text());
장수. = parseInt($tds.eq(10).text().split('+')[0]);
장수. = parseInt($tds.eq(11).text().split('+')[0]);
장수. = parseInt($tds.eq(12).text().split('+')[0]);
장수.삭턴 = parseInt($tds.eq(-2).text());
장수.종류 = getUserType(장수., 장수., 장수.);
장수.의병 = 장수명[0]=="ⓜ" || 장수명[0]=="ⓖ";
if(!(국가 in 국가별)){
국가별[국가] = {};
국가별[국가]. = [];
국가별[국가]. = [];
국가별[국가].충차 = [];
국가별[국가].무지 = [];
국가별[국가].만능 = [];
//국가별[국가].의병 = [];
}
//if(장수.의병) 국가별[국가].의병.push(장수);
국가별[국가][장수.종류].push(장수);
장수.html.hide();
$content.append(장수.html);
});
국가테이블.each(function(idx){
var $this = $(this);
var $tbl = $this;
var $td = $this.find('td:last');
var name = $.trim($this.find('td:first').text());
name = name.substr(2,name.length-4);
var 국가정보 = 국가별[name];
var total = 0;
var 전투유저장수 = 0;
var 삭턴장수 = 0;
var 통솔합 = 0;
$td.html('<p class="sum" style="margin:0;font-weight:bold;color:yellow;text-align:center"></p>');
$td.css('text-indent','-5.8em').css('padding-left','5.8em');
for(var 종류명 in 국가정보){
var $p = $("<p></p>").css('margin','0');
var 테이블 = 국가정보[종류명];
if(테이블.length == 0)continue;
테이블.sort(function(, ){
if(.벌점 == .벌점){
return .장수명 > .장수명 ? 1 : 0;
}
return .벌점 - .벌점
});
var text = "  "+종류명;
text = text.substr(text.length-2);
$p.append(text+'장(');
text = ""+테이블.length;
$p.append(text + ')');
if(text.length<3){
$p.append("<span style='display:inline-block;width:"+(3-text.length)/2+"em;'>&nbsp;</span>");
}
$p.append(': ');
total += 테이블.length;
$.each(테이블,function(idx,val){
var 종능 = val. + val. + val.;
if(종류명 == '무' || 종류명 == '지' || 종류명 == '충차'){
if(val.삭턴 >= 80 && !val.의병){
전투유저장수+=1;
if(종능 > 150) 통솔합 += val.;
else if(종능/0.75 >= 150)통솔합 += parseInt(val./0.75);
else if(종능/0.55 >= 150)통솔합 += parseInt(val./0.55);
else if(종능/0.35 >= 150)통솔합 += parseInt(val./0.35);
else if(종능/0.15 >= 150)통솔합 += parseInt(val./0.15);
}
}
var $obj = $('<span></span>');
var $obj2 = $('<span></span>');
$obj.html(val.장수명);
if(!val.의병 && val.삭턴 < 80){
$obj.css('text-decoration','line-through');
삭턴장수+=1;
}
if(val.의병){
$obj.css('color','cyan');
}
if(val.벌점 >= 1500) $obj.css('color','yellow');
else if(val.벌점 >= 200) $obj.css('color','lightgreen');
$obj2.append($obj);
if(idx < 테이블.length-1){
$obj2.append(', ');
}
$p.append($obj2);
$obj2.hover(function(){
var top = $tbl.offset().top + $tbl.outerHeight() + 3;
$userFrame.css('top',top);
val.html.show();
$userFrame.show();
console.log('올림!'+val.장수명);
},function(){
$userFrame.hide();
val.html.hide();
console.log('내림!'+val.장수명);
});
});
$td.append($p);
}
var result = "* 총("+total+"), 전투장("+전투유저장수+", 약 "+formatScore(통솔합*100)+"명), 삭턴장("+삭턴장수+") *";
$tbl.find('.sum').html(result);
});
}
catch(err){
console.log(err);
}
});
}
$userFrame = $('<div id="on_mover" style="position:absolute;">'+
'<table class="tb_layout bg0" style="width:100%;"><thead><tr>'+
'<td width="64" align="center" class="bg1">얼 굴</td>'+
'<td width="100" align="center" class="bg1">이 름</td>'+
'<td width="50" align="center" class="bg1">연령</td>'+
'<td width="50" align="center" class="bg1">성격</td>'+
'<td width="90" align="center" class="bg1">특기</td>'+
'<td width="50" align="center" class="bg1">레 벨</td>'+
'<td width="100" align="center" class="bg1">국 가</td>'+
'<td width="60" align="center" class="bg1">명 성</td>'+
'<td width="60" align="center" class="bg1">계 급</td>'+
'<td width="80" align="center" class="bg1">관 직</td>'+
'<td width="45" align="center" class="bg1">통솔</td>'+
'<td width="45" align="center" class="bg1">무력</td>'+
'<td width="45" align="center" class="bg1">지력</td>'+
'<td width="45" align="center" class="bg1">삭턴</td>'+
'<td width="84" align="center" class="bg1">벌점</td>'+
'</tr></thead><tbody class="content"></tbody></table></div>');
$userFrame.find('thead td');
$userFrame.css('width','1000px').css('margin','0').css('padding','0').css('left','50%').css('margin-left','-500px');
$userFrame.css('box-shadow','0px 0px 7px 3px rgba(255,255,255,50)');
$userFrame.hide();
$('body').append($userFrame);
var $frame = $('table:eq(0) td:eq(0)');
$frame.find('br:last').remove();
var $btn = $('<input type="button" value="장수 일람 연동">');
$btn.click(function(){
runAnalysis();
$btn.prop("disabled",true);
var $tr0 = $('table:eq(0) tr:eq(0)');
$tr0.append('<td><strong>*벌점 순 정렬*</strong><br><span style="color:yellow">벌점 1500점 이상</span>, <span style="color:lightgreen">벌점 200점 이상</span>, '+
'<span style="text-decoration:line-through">삭턴 장</span>, <span style="color:cyan">ⓝ장</span>'+'<br><strong>전투장 :</strong> 무장 + 지장 + 충차장 - 삭턴자(무,지,충) </td>');
});
$frame.append($btn);
});
+250
View File
@@ -0,0 +1,250 @@
$(function(){
var userList = {};
var groupList = {};
var tGroup = [];
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var $userFrame;
window.groupList = groupList;
window.userList = userList;
var aGroup = {};
$('#troop_list tbody > tr').each(function(idx){
var $this = $(this);
//console.log(this);
//console.log($this);
if(idx%3 == 0){
aGroup = {
turn : '77:77',
turnTime : 5555,
부대장 : '에러-집합장없음',
부대명 : '에러-부대명없음',
srclist : [],
도시 : '없지롱',
list: [],
trs:[]
};
aGroup.trs.push($this);
var $children = $this.children();
var names = $.trim($children.eq(1).text()).split('【');
var 부대명 = $.trim(names[0]);
var 도시 = $.trim(names[1].substr(0,names[1].length-1));
aGroup.도시 = 도시;
aGroup.부대명 = 부대명;
aGroup.obj = $this;
aGroup.$users = $children.eq(3);
var lists = $.trim($children.eq(3).text()).split(', ');
lists.pop();
aGroup.srcList = lists;
}
else if(idx%3 == 1){
aGroup.trs.push($this);
var turnBase = $this.children().eq(0).text().split('】')[1];
//console.log(turnBase);
var userName = $this.children().eq(1).text();
var turn = turnBase;
var turnMS = turnBase.split(':');
var turnM = parseInt(turnMS[0]);
var turnS = parseInt(turnMS[1]);
var turnTime = turnM*60+turnS;
aGroup.turn = turn;
aGroup.turnTime = turnTime;
aGroup.부대장 = userName;
aGroup.obj2 = $this;
groupList[aGroup.부대명] = aGroup;
tGroup.push(aGroup);
}
else{
if($this.find('input').length==0){
$this.detach();
}
}
});
$.each(tGroup,function(idx,val){
console.log(val);
for(var i=0;i<val.trs.length;i++){
val.trs[i].detach();
}
});
tGroup.sort(function(lhs,rhs){
return lhs.turnTime-rhs.turnTime;
});
var $last = $('table:eq(1) tr:eq(-1)');
var $tbody = $('table:eq(1) tbody');
$last.detach();
console.log($last);
$.each(tGroup,function(idx,val){
for(var i=0;i<val.trs.length;i++){
$tbody.append(val.trs[i]);
}
$tbody.append('<tr><td colspan="5"></td></tr>');
});
$tbody.find('tr:eq(-1)').detach();
$tbody.append($last);
var runAnalysis = function(){
$.each(groupList,function(idx,val){
val.list = [];
});
userList = [];
var $content = $('#on_mover .content');
$content.html('');
$.get(basicPath+'b_genList.php',function(rawData){
try{
$html = $(rawData);
var cnt =0;
var tmpUsers = {};
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==2){
tmpUsers = $(this);
return false;
}
}
});
tmpUsers.find("tbody > tr").each(function(idx){
var $this = $(this);
var $부대 = $this.children('.i_troop');
var 부대 = $.trim($부대.text());
if(부대 == '-'){
//부대 안탔음!
return true;
}
$부대.remove();
var $name = $this.children('.i_name');
$name.addClass('nameplate');
var name = $name.find('.t_name').text();
var $도시 = $this.children('.i_city');
var 도시 = $.trim($도시.text());
var $턴 = $this.children('.i_action');
//console.log($턴);
var 턴0 = $턴.text().split(':');
var = parseInt(턴0[0])*60 + parseInt(턴0[1]);
var userInfo = {
이름 : name,
부대 : 부대,
도시 : 도시,
: ,
obj : $this
};
groupList[부대].list.push(userInfo);
userList[name] = userInfo;
$this.hide();
$content.append($this);
});
$.each(groupList,function(부대명,aGroup){
aGroup.$users.html('');
$.each(aGroup.list,function(idx,userInfo){
var $user = $('<span><span class="name"></span><span class="other"></span></span>');
var $userName = $user.children('.name');
if(userInfo.이름 == aGroup.부대장){
$userName.html('*'+userInfo.이름+'*');
$userName.css('color','lightgreen');
}
else{
$userName.html(userInfo.이름);
}
if(userInfo.도시 != aGroup.도시){
$userName.css('color','red');
$user.children('.other').html('【'+userInfo.도시+'】');
}
$user.hover(function(){
var top = aGroup.obj2.offset().top + aGroup.obj2.outerHeight();
$userFrame.css('top',top);
userInfo.obj.show();
$userFrame.show();
console.log('올림!'+userInfo.이름);
},function(){
$userFrame.hide();
userInfo.obj.hide();
console.log('내림!'+userInfo.이름);
});
$user.append(', ');
aGroup.$users.append($user);
});
aGroup.$users.append('('+aGroup.list.length+'명)');
});
}
catch(err){
console.log(err);
}
});
};
var $frame = $('table:eq(0) td:eq(0)');
$frame.find('br:last').remove();
var $btn = $('<input type="button" value="암행부 연동">');
$btn.click(function(){
runAnalysis();
});
$frame.append($btn);
$userFrame = $('<div id="on_mover" style="position:absolute;">'+
'<table class="tb_layout bg0" style="width:100%;"><thead><tr>'+
'<td width="98" align="center" class="bg1">이 름</td>'+
'<td width="98" align="center" class="bg1"">통무지</td>'+
'<td width="58" align="center" class="bg1">자 금</td>'+
'<td width="58" align="center" class="bg1">군 량</td>'+
'<td width="48" align="center" class="bg1">도시</td>'+
'<td width="28" align="center" class="bg1">守</td>'+
'<td width="58" align="center" class="bg1">병 종</td>'+
'<td width="68" align="center" class="bg1">병 사</td>'+
'<td width="48" align="center" class="bg1">훈련</td>'+
'<td width="48" align="center" class="bg1">사기</td>'+
'<td width="148" align="center" class="bg1">명 령</td>'+
'<td width="58" align="center" class="bg1">삭턴</td>'+
'<td width="58" align="center" class="bg1">턴</td>'+
'</tr></thead><tbody class="content"></tbody></table></div>');
$userFrame.find('thead td');
$userFrame.css('width','900px').css('margin','0').css('padding','0').css('left','50%').css('margin-left','-450px');
$userFrame.hide();
$('body').append($userFrame);
});
+7
View File
@@ -0,0 +1,7 @@
jQuery(function($){
$('#by_scenario').change(function(){
var scenarioIdx = $(this).val();
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get');
})
//$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
});
+9 -8
View File
@@ -439,14 +439,15 @@ function reloadWorldMap(option){
url: option.targetJson,
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
neutralView:option.neutralView,
year:option.year,
month:option.month,
showMe:option.showMe,
aux:option.aux
})
data: {
data: JSON.stringify({
neutralView:option.neutralView,
year:option.year,
month:option.month,
showMe:option.showMe,
aux:option.aux
})
}
});
deferred

Some files were not shown because too many files have changed in this diff Show More