Compare commits

...
317 Commits
Author SHA1 Message Date
Hide_D a1397e41aa 트래픽 버그 수정 2018-04-29 01:58:59 +09:00
Hide_D 13fccb998e 년도 계산 공식 재 수정. 시나리오 시작시 남은 개월 수를 계산. 반동탁연합 시나리오 외교 추가 2018-04-29 01:47:48 +09:00
Hide_D 1e54220230 연, 월 계산 방식 변경 2018-04-29 01:19:31 +09:00
Hide_D 6b2000bb39 올스타전 내특/전특 2018-04-29 00:53:49 +09:00
Hide_D 5f3fbdb089 KBO 올스타전 리뉴얼 2018-04-29 00:45:12 +09:00
Hide_D 63e888c9b1 특성에 '랜덤', '랜덤전특', '랜점내특' 가능. 0으로 지정 가능 2018-04-29 00:28:06 +09:00
Hide_D e97e702c2e 가상 모드 대응. 랜덤 특성 세팅 추가 2018-04-28 23:55:22 +09:00
Hide_D 657c35f876 git tree 지정이 안되는 업데이트 유저는 기존에 업데이트된 값을 이용하도록 변경 2018-04-28 23:36:35 +09:00
Hide_D bc79250f96 Merge branch 'master' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-28 22:42:01 +09:00
Hide_D dd7846e995 설정 저장용 key_value storage 추가. ROW_FORMAT=DYNAMIC 삭제 2018-04-28 22:01:58 +09:00
Hide_D 8a5483d508 연감 벌점 감소 2018-04-28 21:52:14 +09:00
Hide_D 805053e921 NPC 포상 잘 안주는 문제 우회 시도 2018-04-28 21:04:55 +09:00
Hide_D 170a32a1bd 등용장 메시지 송신이 이상한 문제 해결.
인사부 '공석' 지정 가능
2018-04-28 20:49:38 +09:00
Hide_D 5262d424b4 방랑의 제한 조건 추가 2018-04-28 20:38:19 +09:00
Hide_D 9c3c1045ac 줄간격 문제 해결(inline에 line-height 적용해제) 2018-04-28 20:29:33 +09:00
Hide_D 2d1a3f5da9 많은 버그 수정
커맨드 실행 중 로그아웃 된 경우 버그 수정
국기 변경에 에러 있던 점 수정
등용장 수락시 송신자 명성 안 늘어나는 버그 수정
2018-04-28 20:10:33 +09:00
Hide_D 088260bbc6 npc 재야일때 e_notice 에러 수정 2018-04-28 19:13:18 +09:00
Hide_D 18ebbbc555 oauth_kakao autoload 빼먹은거 수정 2018-04-28 19:10:03 +09:00
Hide_D 80b70a8765 국가 명 너비를 살짝 더 늘림 2018-04-28 18:48:58 +09:00
Hide_D d3d4cce8b5 서버 설명 2018-04-28 18:09:55 +09:00
Hide_D 76bfcd4fa8 베팅 버그 수정 2018-04-28 02:37:47 +09:00
Hide_D 7cbe383a8a 토너먼트 문자열 버그 수정 2018-04-28 02:36:59 +09:00
Hide_D 0488ebf071 무지장 유저장 포상 기준 변경 2018-04-28 02:25:08 +09:00
Hide_D 1cfab53472 문자열 자르기 버그 수정 2018-04-28 01:26:32 +09:00
Hide_D 084c7a2626 선포시 양국 모두 뜨도록 2018-04-28 01:16:00 +09:00
Hide_D 161836a233 상성 가상인 경우 상성이 리셋되지 않는 버그 해결 2018-04-28 01:08:54 +09:00
Hide_D c86ac7d20f 가입 일자 표기, 개인정보 제3자 제공 동의 버튼 추가. 철회 버튼도 추가 2018-04-28 00:23:51 +09:00
Hide_D 20cceec090 IE11에서 javascript 기본 argument 안되는 것 수정 2018-04-28 00:00:46 +09:00
Hide_D 62c6ba362d 개인정보처리방침 & 이용약관 링크 추가 2018-04-27 23:51:57 +09:00
Hide_D 5ed31881e6 PrintElapsedTime 제거 2018-04-27 23:40:50 +09:00
Hide_D 647c51fe0f 외교 서신, 등용장 수락시 올바르지 않을 경우 alert
건국 시 장수 이름과 같아도 건국 가능하도록 변경
2018-04-27 23:08:55 +09:00
Hide_D a2d3ac9e70 시나리오 생성시 장수의 NPC 메시지가 입력되지 않는 버그 해결 2018-04-27 22:51:39 +09:00
Hide_D 20f74f6645 각 페이지에 서버 이름 표기 2018-04-27 22:36:29 +09:00
Hide_D 0bb1ed6f18 서버 리셋 시 서버 이름을 받아오도록 설정 2018-04-27 22:28:16 +09:00
Hide_D 2102a852cb 가상, 사실 거꾸로 표기한 점 수정 2018-04-27 22:21:43 +09:00
Hide_D 0cfb80b7bf 카카오 로그인 버튼을 직관적으로 변경 2018-04-27 22:09:57 +09:00
Hide_D 4297ea9e40 로그인 & 가입 버튼 추가 2018-04-27 21:37:37 +09:00
Hide_D 0ce36e93bd 예약 오픈 테이블은 리셋에도 유지하도록 변경 2018-04-25 21:31:39 +09:00
Hide_D 18bd5f4246 NPC 대사 제대로 안하는 버그 수정 2018-04-25 21:25:04 +09:00
Hide_D 2e7bcd9038 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-25 21:04:50 +09:00
Hide_D bfef0c28bc 리셋 시 폐쇄를 외부에서 하면 예약 리셋이 안되던 버그 수정 2018-04-25 21:04:41 +09:00
Hide_D b447065651 scenario 30번 수정 2018-04-25 18:12:08 +09:00
Hide_D f540f87e77 KBO 올스타전 시나리오 추가 2018-04-25 18:04:01 +09:00
Hide_D 6ebe3454af 예약 안내 조건 버그 수정 2018-04-25 08:15:55 +09:00
Hide_D 7e00500870 예약 리셋시 초기화 에러 표기 가능하도록 변경 2018-04-25 03:10:09 +09:00
Hide_D bc37dd1df7 '폐쇄 여부'를 server_basic_info에서 판단하도록 설정 2018-04-25 03:07:02 +09:00
Hide_D 77aca09f53 상성 여부로 메시지 변경 2018-04-25 03:02:31 +09:00
Hide_D 23fb1194ee 서버 예약 오픈을 UI에 통합 2018-04-25 02:56:11 +09:00
Hide_D 6253b757ec 기본 예약 리셋 동작 2018-04-25 02:13:40 +09:00
Hide_D 9122342fb9 FIXME: 리셋 헬퍼 꼴보기 싫으니 분리할 것 2018-04-25 00:44:33 +09:00
Hide_D fb42a32089 리셋 코드를 별도 코드로 분리 2018-04-25 00:43:09 +09:00
Hide_D 5c7f4c43ae 리셋 시 토너먼트 개최 여부도 같이 설정 2018-04-25 00:28:26 +09:00
Hide_D 3da256cc29 토너먼트 타이틀 정보 약간 개선 2018-04-25 00:05:08 +09:00
Hide_D 717c576cba n장 끼리 포상 제대로 안하는 버그 수정 2018-04-24 02:16:50 +09:00
Hide_D ddb4011b5d 몰수 조건 강화 2018-04-24 02:12:04 +09:00
Hide_D 48207b9300 포상 조건 재 수정. 무지장이라도 금쌀이 너무 적으면 주긴 함 2018-04-24 01:58:07 +09:00
Hide_D 388afe6fb4 CityHelper에서 getAllNationCities가 올바르게 동작하지 않던 버그 해결 2018-04-24 01:15:05 +09:00
Hide_D 99b459766a 무지장 헌납 로직 추가
포상 로직에서 무지장. 사망 예정장은 제외
2018-04-24 00:53:26 +09:00
Hide_D 230fc5ba53 훼섭은 닫히던 문제 마저 수정 2018-04-23 23:51:47 +09:00
Hide_D 9c266b7b1c 불가침 수락 년도 제대로 안보이는 버그 수정 2018-04-23 23:51:02 +09:00
Hide_D 603599d666 업데이트 후 서버를 닫지 않도록 변경 2018-04-23 23:48:59 +09:00
Hide_D b3cd29ac95 명전 테이블에 unique index가 안걸려있던 버그 수정 2018-04-23 01:21:05 +09:00
Hide_D a4beab86c2 도시 정보 턴 시간값을 +1 2018-04-22 12:24:42 +09:00
Hide_D 3a84e0d064 run_daemon 고도화. 1분에 4번 부름 2018-04-22 02:35:21 +09:00
Hide_D 31f1eb2d28 턴 실행 데몬 2018-04-22 02:18:51 +09:00
Hide_D d73c0c6f0c 남귀병이 기술 1등급 병종이었다니! 2018-04-22 01:32:25 +09:00
Hide_D 36409cf066 game, nation, city, general을 myisam으로 변경 2018-04-21 23:47:02 +09:00
Hide_D 556e1059f9 인사부 버그 수정
메인 페이지에서 재야 인사 에러 안나게 수정
2018-04-21 23:19:29 +09:00
Hide_D 131a6cb6c3 건국 버그 수정 2018-04-21 23:08:51 +09:00
Hide_D 598943eb1b 방랑군 상태에서 세력 도시 클릭 불가. 인사부 가능.
설치시 운영자 삭턴
시나리오 29 재 디자인
지도에서 로그인 유저 검사
2018-04-21 22:43:46 +09:00
Hide_D bf746393b8 천인강림 시나리오 리 밸런싱 2018-04-21 21:52:17 +09:00
Hide_D 70b6997436 연감에서 장수 로그 컬럼 길이 연장 2018-04-21 21:10:03 +09:00
Hide_D b26c6a04c0 삭턴 버그로 생긴 버그 수정 2018-04-21 17:27:45 +09:00
Hide_D 4f262a03e4 command_Single 동작 변경 2018-04-21 16:18:07 +09:00
Hide_D a0ca3dc3f6 TODO 추가 2018-04-21 15:59:05 +09:00
Hide_D f58736277f 삭턴 버그 수정 2018-04-21 15:58:41 +09:00
Hide_D 473cae169e 퀘섭 빙의시 계정이름이 아니라 닉네임으로 기록하도록 변경 2018-04-21 14:14:41 +09:00
Hide_D 4b956385bd 메시지 전송을 위해 일괄 2018-04-21 13:16:50 +09:00
Hide_D 481494a885 전체 메시지 안 보내지던 것 수정
10초마다 메시지
2018-04-21 13:06:10 +09:00
Hide_D 243604d6c1 30초마다 메시지 폴링! 2018-04-21 12:28:32 +09:00
Hide_D dc97c71e0b 1월을 놓치면 태어나지 않으므로 Date 기준을 ==에서 >=로 변경 2018-04-21 12:20:55 +09:00
Hide_D e6b4832b5d index.php에 level 없는 버그 2018-04-21 11:49:55 +09:00
Hide_D 00ac67e8ac 시나리오 시작 년도 수정 2018-04-21 11:11:25 +09:00
Hide_D 953b609b32 임관, 장수 선택시 설명 색 변경 2018-04-21 10:54:07 +09:00
Hide_D a5875be39b 쿼리 인덱스 2018-04-21 10:48:55 +09:00
Hide_D 0f45de8384 부상 코드 2018-04-21 10:47:09 +09:00
Hide_D d119200287 서버 업데이트 순서 틀림 2018-04-21 10:43:21 +09:00
Hide_D b9fa0bea6e mkdir 권한 변경 2018-04-21 10:42:30 +09:00
Hide_D 3a28180700 도시 정보 주석 제거 2018-04-21 10:17:24 +09:00
Hide_D 5b6f456d5c 도시 정보 업데이트 2018-04-21 10:15:04 +09:00
Hide_D fb1ae6ea88 투표율 안보이는 버그 수정 2018-04-21 08:56:54 +09:00
Hide_D 50582a0e8b 내무부에 textarea 적용 2018-04-21 07:57:41 +09:00
Hide_D 8fe3d0258a 건국되지 않았을 때 버튼 처리 변경 2018-04-21 07:57:26 +09:00
Hide_D f2537b20de allButton 예제 2018-04-20 02:19:42 +09:00
Hide_D 31d6850e6e 게시판 리스트 변경 2018-04-20 02:17:38 +09:00
Hide_D 31468d5425 전력전 비율을 50% -> 40%로 내림 2018-04-19 22:55:11 +09:00
Hide_D 688b839315 지도 배경 그림이 올바르지 않은 버그 수정 2018-04-19 22:50:40 +09:00
Hide_D fa4c9046fc Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-19 20:08:31 +09:00
Hide_D c7560f9113 체섭에서 세션 시간 가져옮 2018-04-19 20:08:05 +09:00
Hide_D f7e3966310 부운영자 계정 권한 지정 2018-04-19 10:35:49 +09:00
Hide_D 7359237da4 항복 권고시 divide 0 나올 수 있는 문제 우회 2018-04-19 02:56:55 +09:00
Hide_D d617203c05 reply 추가 2018-04-19 02:55:35 +09:00
Hide_D 910526ba44 oauth 버그 2018-04-19 02:50:00 +09:00
Hide_D c1842703d7 Session ID 변경 2018-04-19 02:43:10 +09:00
Hide_D 2f9d2e2bc2 추방시 color 필요하던 점 2018-04-19 02:36:11 +09:00
Hide_D 20d7e005a0 도움말 에러 2018-04-19 02:34:44 +09:00
Hide_D 0ce5a88e49 NPC 추방시 warning 2018-04-19 02:34:38 +09:00
Hide_D 4af10fb485 유니크 아이템 warning 2018-04-19 02:34:28 +09:00
Hide_D f872113e99 토너먼트 warning 제거 2018-04-19 01:55:31 +09:00
Hide_D f33fefd188 도시에서 턴이 4개만 보이는 버그 수정 2018-04-19 01:53:02 +09:00
Hide_D 8c2f4f9dc9 Message 마지막 인자가 없엇 ㅓ터지는 버그 수정 2018-04-19 01:51:27 +09:00
Hide_D 3b6e7c5c28 몰수 시 NPC 반항 에러 2018-04-19 01:50:01 +09:00
Hide_D 595c11a9a7 NPC 사령턴이 '미설정'일때 2018-04-19 01:45:35 +09:00
Hide_D 1ab7b57885 숙련 단련 로그 버그 수정 2018-04-19 01:40:20 +09:00
Hide_D 07130e6022 선포 옵션 변경 2018-04-19 01:38:28 +09:00
Hide_D 2cc2f7eb23 NPC 몰수를 더 잘하도록 설정 2018-04-19 01:30:31 +09:00
Hide_D c798ac49b9 선포 메시지 버그 2018-04-19 01:21:28 +09:00
Hide_D a8796edbd3 체크 방식 유형 변경 2018-04-19 01:16:38 +09:00
Hide_D a4ead74cb2 등용장 로그 이상하게 뜨는것 수정 2018-04-19 00:27:35 +09:00
Hide_D 0beb00c5e5 등용장 탈때 삭턴 NULL되는 버그 수정 2018-04-19 00:26:09 +09:00
Hide_D 3d43690303 훈사 80 못 고치는 버그 수정 2018-04-19 00:22:26 +09:00
Hide_D 938c819e9a 베팅장 INF 수정 2018-04-19 00:19:56 +09:00
Hide_D 889ced68ed 베팅장 warning 우회 2018-04-19 00:18:31 +09:00
Hide_D de97384424 베팅창 warning 수정 2018-04-19 00:17:30 +09:00
Hide_D f6ffc20a23 등용장 장수열전 기록 안되는 버그 수정 2018-04-19 00:10:19 +09:00
Hide_D c0ec82051f $cities 변수 없음 수정 2018-04-19 00:04:30 +09:00
Hide_D 91273522c0 오탈자 수정 2018-04-19 00:03:46 +09:00
Hide_D 20a475466d 등용장 '등용장 안 타지는' 버그 수정 2018-04-18 23:54:48 +09:00
Hide_D 10b6a4ff6e 등용장 버그 고침(송신자에게도 감) 2018-04-18 23:48:47 +09:00
Hide_D 2a4e59d6e2 등용장 버그 수정(임관 국가) 2018-04-18 23:44:49 +09:00
Hide_D c016ea7c52 등용장 버그 수정 2018-04-18 23:44:17 +09:00
Hide_D 00bece9c9c 임관금지 거꾸로된것 수정 2018-04-18 23:42:27 +09:00
Hide_D 44ed61c14e touchmode 삭제 다른 방안을 찾아보는걸로 2018-04-18 23:24:33 +09:00
Hide_D 002b7ae534 등용장 버그 수정 2018-04-18 23:20:47 +09:00
Hide_D 63000bdd22 등용장 버그 수정 2018-04-18 23:18:55 +09:00
Hide_D 20fd52b32d 등용장 버그 수정 2018-04-18 23:17:55 +09:00
Hide_D 7a3064d37b 첩보시 병종 메시지 수정 2018-04-18 23:16:05 +09:00
Hide_D 7fea0a41c6 지도 수준을 없앰 2018-04-18 22:57:38 +09:00
Hide_D e701540d7f 외교 서신 (이)가 2018-04-18 22:37:00 +09:00
Hide_D 5187ebbf52 추방 몰수 선포 등 상황에서 메시지 안 나타나는 버그 수정 2018-04-18 22:34:13 +09:00
Hide_D df26c511b5 금쌀 2500단위도 추가 2018-04-18 22:18:39 +09:00
Hide_D 0e650da34a 메시지창 정렬.
몰/포 1200, 1500 추가
2018-04-18 22:16:59 +09:00
Hide_D 2c382da773 부대가 없더라도 부대 가입 버튼이 뜨는 버그 해결 2018-04-18 22:05:58 +09:00
Hide_D e709ee5db8 불필요한 array_get 삭제. 모병 칸 버튼을 징병->모병 2018-04-18 22:03:01 +09:00
Hide_D d550415b65 세션 설정시 오타 수정 2018-04-18 22:00:11 +09:00
Hide_D 9ec144e8f6 사령부 인덱스 버그 2018-04-18 21:58:01 +09:00
Hide_D 9458307612 사령부 표기 수정 2018-04-18 21:55:22 +09:00
Hide_D 915c5fcd8e npc 몰포 버그 수정 2018-04-18 21:51:44 +09:00
Hide_D 0df1293139 체결 메시지에도 년도 뜨도록 수정 2018-04-18 21:46:26 +09:00
Hide_D 9bcd18c42e 모,징병시 특성 병종이 2000 만 넘어도 뜨는 문제 해결 2018-04-18 21:42:09 +09:00
Hide_D 1c853107b7 불가침 제의 서신 수정 2018-04-18 21:38:56 +09:00
Hide_D 3f21e28ef7 유저에게 포상량이 확실히 더 많아짐 2018-04-18 21:24:00 +09:00
Hide_D 61244fcef9 추가한 커밋에서 불필요한 npc 코드 제거 2018-04-18 21:17:39 +09:00
Hide_D 03c930ce7d npc가 유저에게 포상, 몰수하는 기준을 더 후하게 잡음 2018-04-18 21:16:49 +09:00
Hide_D f57c4967f2 NPC 삼/팜 버그 마저 수정 2018-04-18 13:56:36 +09:00
Hide_D 49f40d56b0 회피 잘못 적용되는 버그 수정 2018-04-18 10:13:32 +09:00
Hide_D 190fcabbac NPC 삼팜 버그 2018-04-18 09:43:58 +09:00
Hide_D 8bccf449ad NPC 감찰부에서 장수 행동 2018-04-18 09:38:32 +09:00
Hide_D f7dc1a588b 능력치 받아올 때 general이 NULL인 경우도 대응 2018-04-18 09:24:10 +09:00
Hide_D 0eb91c6301 버튼들 '뒤로 가기' 가능하도록 직접 링크로 변경 2018-04-18 00:08:12 +09:00
Hide_D 0fa4d88ea9 lock 파일 경로 체크 2018-04-18 00:01:40 +09:00
Hide_D 18e355b701 bool 변수 받는 문제 해결. 전콘 안 고를 수 있도록 선택 2018-04-17 23:39:36 +09:00
Hide_D 1cb877503d 불가침 합의 시 년 표기가 이상한 문제 2018-04-17 23:30:48 +09:00
Hide_D b65e691255 벌점 안 쌓이는 버그 수정 2018-04-17 23:17:16 +09:00
Hide_D a4ee43f12b 세력도 아래 안보이는 것 해결 2018-04-17 23:04:37 +09:00
Hide_D f71c61a55b 특수 권한 유저 추가 2018-04-17 22:57:10 +09:00
Hide_D 418130f4cd bool 변환에서 false 조건 하나 더 추가 2018-04-17 22:44:39 +09:00
Hide_D 1566aa0243 국가색 새로 2018-04-17 22:15:11 +09:00
Hide_D ab546f66f0 국가간 갠메 2018-04-17 22:13:36 +09:00
Hide_D fc021dae54 등용장 살림 2018-04-17 22:03:23 +09:00
Hide_D 58a7b3afe1 등용장 잠시 살림 2018-04-17 22:03:08 +09:00
Hide_D 72f41df5d2 사령부 warning 2018-04-17 21:59:48 +09:00
Hide_D 8fd6b91cf7 아이템 습득시 warning 해결 2018-04-17 21:57:03 +09:00
Hide_D cf2ace32d1 로그아웃 버튼 삭제 2018-04-17 21:39:08 +09:00
Hide_D 05c4f721f2 메시지창 모바일에서 안보이는 것 해결 2018-04-17 21:37:59 +09:00
Hide_D b2096cc274 불가침 서신 개월수 안보이는 문제 해결, 개월수 년으로 보이는 문제 해결 2018-04-17 21:35:13 +09:00
Hide_D 067df49914 29번 능력치 변경 2018-04-17 20:59:16 +09:00
Hide_D 6961298e53 이미지 못 불러오는 문제 해결 2018-04-17 20:48:49 +09:00
Hide_D 3e6523002c 이벤트 메시지 변경 2018-04-17 20:43:18 +09:00
Hide_D c26add7b04 29번 시나리오 급조 2018-04-17 20:40:56 +09:00
Hide_D 12d50fec03 장수 등록 시 scenario 값과 show_img_level 값 2018-04-17 20:16:04 +09:00
Hide_D a43bbc9f23 proc.php 2018-04-17 20:09:35 +09:00
Hide_D 2bec3b253c proc readonly 2018-04-17 20:09:11 +09:00
Hide_D a69f256168 약관 추가 2018-04-17 20:08:15 +09:00
Hide_D d7fb88eed6 TimeZone 세팅 2018-04-17 19:23:05 +09:00
Hide_D bfd79f479e 파일 경로를 절대 경로로 변경 2018-04-17 19:21:30 +09:00
Hide_D 7ec3fcc78e 대문자 GAME 수정 2018-04-17 19:11:09 +09:00
Hide_DandGogs 858a09b429 Merge branch 'devel' of devsam/core into master 2018-04-17 04:33:14 +09:00
Hide_D da7fcafb27 사령부 NPC 색상 2018-04-17 03:45:57 +09:00
Hide_D 7f7d8b2099 명장일람 표기 오류 수정 2018-04-17 03:43:22 +09:00
Hide_D b5fb2e9cf4 중원 정보 분쟁 현황을 제대로 보여줌 2018-04-17 03:39:17 +09:00
Hide_D d9ffdf9df8 외교 서신 밀리는 버그 수정 2018-04-17 03:23:02 +09:00
Hide_D f919187b91 불가침 메시지 수정 2018-04-17 03:22:53 +09:00
Hide_D d5ead5b74f 재야일때 secretlimit 경고 뜨는거 해결 2018-04-17 03:11:00 +09:00
Hide_D ec1be2c887 합병 항복 안되는 버그 수정 2018-04-17 03:10:38 +09:00
Hide_D af0c470923 부대 가입 안되는 버그 수정 2018-04-17 03:10:25 +09:00
Hide_D 78ce7d20e3 거래장 에러로그 수정 2018-04-17 03:10:18 +09:00
Hide_D 932ce9bf51 도시 정보 배경 안보이는 ㅓㄱ수정 2018-04-17 03:06:55 +09:00
Hide_D 3d602b49bf 메시지 표기 프레임 변경 2018-04-17 02:14:58 +09:00
Hide_D 33b7d228f9 긴급 천도 버그 수정 2018-04-17 02:14:48 +09:00
Hide_D 95a8fd5495 토너먼트 표기 2018-04-17 02:14:38 +09:00
Hide_D 87bc416fc7 인사부 표기 버그 수정 2018-04-17 02:14:31 +09:00
Hide_D 8c21eec168 메시지 관련 버그 우회 2018-04-17 01:55:12 +09:00
Hide_D 7ef3f0d5c5 임시로 외교 서신 받는 기능 추가 2018-04-17 01:54:57 +09:00
Hide_D e90e508005 빙의 후 페이지 이동 2018-04-17 01:54:42 +09:00
Hide_D 816daed570 warning 방지 2018-04-17 01:54:03 +09:00
Hide_D 3626266763 시작 년도가 없는 경우 설정 2018-04-17 01:53:55 +09:00
Hide_D 6c117a628c 가운데에 버튼 세트 추가 2018-04-17 01:53:45 +09:00
Hide_D d3225dfb41 버그 수정 2018-04-17 01:53:32 +09:00
Hide_D bd7e7540d8 사령부 출력 오동작 수정 2018-04-17 01:53:23 +09:00
Hide_D 48088748df schema 버그 수정. DB에서 Exception 제대로 안 던지는 버그 해결 2018-04-17 00:18:38 +09:00
Hide_D 7a5eecc3e1 갠메를 보냈을 때 알림 표시 2018-04-17 00:03:40 +09:00
Hide_D 51d7dede55 nation table에서 외교 서신 보관용 column 삭제 2018-04-16 23:58:36 +09:00
Hide_D bcad77ec06 사령턴 외교 서신 재구현 2018-04-16 23:53:54 +09:00
Hide_D 9b79d12521 재야에서는 국메가 안보내지던 버그 수정
일반장이 국메를 보낼 수 없던 버그 수정
외교 서신 클래스 에러 수정
2018-04-16 23:29:17 +09:00
Hide_D 4b33461c70 _admin2의 query를 수정.
- 메시지 전송을 새로 만든 구현을 사용함.
- 테이블 두개 (MEMBER, SYSTEM)을 소문자로 변경
2018-04-16 22:31:54 +09:00
Hide_D bc3a8fefd8 최근 메시지만 전송 받도록 수정. 2018-04-16 08:18:40 +09:00
Hide_D db97400b43 기본 갠메, 국메, 전메 동작 2018-04-16 02:20:05 +09:00
Hide_D 3ad4032239 메시지 입력 버그 수정 중 2018-04-16 02:06:05 +09:00
Hide_D 1d0fb7151d lib.php의 글로벌 변수를 GameConst로 이동
- 계략의 게임 내 영단어를 trick에서 sabotage로 변경
2018-04-16 02:05:46 +09:00
Hide_D 0c9099c868 메시지 첫 동작 2018-04-16 01:09:43 +09:00
Hide_D c87cbaa0a6 등용장 생성시 버그 수정 2018-04-16 00:03:48 +09:00
Hide_D 5a94bf434a css style에서 단위(px)가 설정되지 않은 것들 수정 2018-04-15 23:57:22 +09:00
Hide_D d567f3218a 재야를 따로 다루던 코드 제거 2018-04-15 23:51:46 +09:00
Hide_D 5d97c4ebea mailbox 리스트에서 '재야'를 내부 코드로 처리 2018-04-15 23:48:39 +09:00
Hide_D c3be464774 메시지 시스템 외부로 연결중. 2018-04-15 23:42:59 +09:00
Hide_D 0d1e10a2ce 소소한 수정 switch 무서워라.. 2018-04-15 23:42:47 +09:00
Hide_D 723a7bbfba 장수 생성 시 오류 나던 문제 해결
- Validation 문제
2018-04-15 23:42:30 +09:00
Hide_D 6a100ed2c1 국가 정보 반환시 0인 경우에 한해 재야도 반환.
- 재야의 색을 #000000 으로 설정
2018-04-15 23:41:36 +09:00
Hide_D 5a6cd7fb46 서버에서 아이콘 주소를 바로 돌려주는 기능 추가 2018-04-15 23:39:41 +09:00
Hide_D 871c99a67a 외교 서신 메시지 파트 구현 완료
- 메시지 전송시 수신자에게만 전송 가능한 옵션 추가
- 메시지 추가 옵션으로 delete 옵션 제시.
2018-04-15 21:40:21 +09:00
Hide_D 7bdde2ac8a 외교 서신 상세 내용 추가
- 등용장의 로그 부분은 메시지로 뺌
2018-04-15 21:01:42 +09:00
Hide_D 3564282acb 라이선스 추가 2018-04-15 16:35:38 +09:00
Hide_D 13e24dbcb4 이미지 다운로드도 추가 2018-04-15 16:22:57 +09:00
Hide_D 0026e9cb15 이미지 다운로드도 추가 2018-04-15 16:22:45 +09:00
Hide_D 156795d7e9 readme 추가 2018-04-15 16:17:32 +09:00
Hide_D e41d73b5bd Diplomacy 생성자에서 두 국가르 받도록 변경
인접국 판단 로직을 두경우로 나눔
Diplomacy 클래스 구현중...
2018-04-15 04:07:59 +09:00
Hide_D 655cd1700c DiplomaticMessage 작성중
ScoutMessage 버그 개선
2018-04-15 02:41:00 +09:00
Hide_D 9fb455d38a 등용장 거절시 함수명 버그 수정 2018-04-14 23:46:02 +09:00
Hide_D 879a1e1c61 등용장 내부 로직 처리를 분리 2018-04-14 23:10:46 +09:00
Hide_D e614092690 MessageTarget의 부모 클래스 Target 추가 2018-04-14 22:12:40 +09:00
Hide_D 4ebe51d978 \DateTime 오타 수정 2018-04-14 15:44:47 +09:00
Hide_D 10a29e584f 상수 경고 추가 2018-04-14 15:40:08 +09:00
Hide_D a88982940b 등용장 구현을 위한 ScoutMessage 클래스 완성 2018-04-14 15:37:52 +09:00
Hide_D b92a95cc07 이미지 빠진부분 마저 반영 2018-04-14 03:51:43 +09:00
Hide_D bffca5e163 새 병종 이미지 적용
- 64px 이미지 태그들을 width="64px"가 아니라 width="64"로 변경
2018-04-14 03:27:36 +09:00
Hide_D b56919a343 팝업 차단에 막히는 문제 해결... 2018-04-14 02:52:03 +09:00
Hide_D b797bab7e0 누락된 getReq 추가. 버그 수정 2018-04-14 02:42:58 +09:00
Hide_D a03d2cee63 lib.php에서 강제로 $_POST 추출을 시행하던 부분을 세부 파일로 이동. 2018-04-14 00:28:24 +09:00
Hide_D 67fef4b73d 전콘 적용 버그 수정
갱신정보 제대로 안보이는 문제 수정
분쟁 정보 제대로 안보이는 문제 수정
2018-04-14 00:15:54 +09:00
Hide_D 253a953dfe SQL Injection 대응을 위해 파일 상단에 Util::getReq 사용 2018-04-14 00:15:25 +09:00
Hide_D be7154284e 등용장 수락 코드 작성중 2018-04-13 15:48:47 +09:00
Hide_D 02f90842fe TM 서버 밸런스 패치 이식 2018-04-13 03:41:39 +09:00
Hide_D 0b17a289c8 내정 수치를 tm과 일치 2018-04-13 02:42:10 +09:00
Hide_DandGogs c2298efaf0 Merge branch 'devel' of devsam/core into master 2018-04-13 02:27:07 +09:00
Hide_D e858ad0c33 깜빡한 문구 수정 2018-04-13 02:17:22 +09:00
Hide_D fb1acfa09c 명전 초기값이 없어서 등록할 수 없는 버그 수정 2018-04-13 02:16:15 +09:00
Hide_D 033466edcc 공백지 점령용 예비 코드에 '수도'가 지정되지 않은 문제 해결
천통 가능
2018-04-13 01:52:27 +09:00
Hide_D 3a472506cf 버그 수정... 2018-04-13 01:35:47 +09:00
Hide_D cea015bd4d 전특, 내특 검색을 위한 별도 클래스 제작 2018-04-13 01:01:32 +09:00
Hide_D 8aaf161fd0 세력도 안보이는 문제 해결 2018-04-13 00:54:02 +09:00
Hide_D 1529ab6469 분리한 긴천 함수 호출 버그 2018-04-13 00:38:37 +09:00
Hide_D 1a3b456f39 긴천 함수 분리.
멸망시 등용장이 동작하지 않으므로 일단 끔
2018-04-13 00:26:21 +09:00
Hide_D ac3672a87e 긴천 위치가 엉뚱하게 되는 버그 수정.
getGenSpecial을 마구잡이로 부르는 함수로 인하여 우회
2018-04-13 00:06:32 +09:00
Hide_D a866cb63a4 getConquerNation 버그 수정 2018-04-12 21:32:04 +09:00
Hide_D 943251c56f 에러 코드 출력 방식 변경 2018-04-12 21:31:45 +09:00
Hide_D 4d2b10b979 에러 표기 방식 변경.
- DB 에러도 throw exception을 수행
- exception handler 추가.
- error 발생시 콜 스택을 json 형태로 보관
2018-04-12 21:24:28 +09:00
Hide_D c87614ab2d 연감 지도가 json 기반으로 바뀌었으므로 j 붙임 2018-04-12 20:53:19 +09:00
Hide_D 67dee551b6 분쟁현황 표기 버그 일부 추가 수정 2018-04-12 05:22:20 +09:00
Hide_D 2ee20ce92c 분쟁 코드를 json기반으로 변경 2018-04-12 05:17:32 +09:00
Hide_D cd8ec0687f 성벽 공격시 '국가'를 구해오는 과정에서 공백지를 고려하지 않은 부분 수정 2018-04-12 04:16:02 +09:00
Hide_D 6881b531d7 post type 빠진 것 추가 2018-04-12 04:00:29 +09:00
Hide_D 2eae9b2062 긴천 시 도시 참조하는 부분에 Undefined offset 문제 발생하는 것 해결 2018-04-12 03:34:09 +09:00
Hide_D b055baa7d3 출병시 인접 도시 체크 룰을 DB가 아니라 CityConst에 기반하도록 변경 2018-04-12 03:26:32 +09:00
Hide_D fc0ad32335 사령부 출력 에러 우회. 2018-04-12 03:08:36 +09:00
Hide_D 42cd2fafdd Json에 PASS_THROUGH 옵션 추가 2018-04-12 02:59:44 +09:00
Hide_D 6220d030dc $_POST, $_GET 남은 부분 제거. 연감 지도 받아오는 부분 재 작성 2018-04-12 02:57:53 +09:00
Hide_D 8961dd60a2 $_POST btn 빼먹은거 추가 2018-04-12 02:47:28 +09:00
Hide_D 2726bc13c4 b_myGenInfo 관직 제대로 표기 안된 문제 해결 2018-04-12 02:42:40 +09:00
Hide_D 967c14a972 $sel 변수를 이용한 잘못된 selected 출력 문제를 우회 2018-04-12 02:37:05 +09:00
Hide_D 74d86b7897 POST에 type, btn, gen 빠진것 보정 2018-04-12 02:31:30 +09:00
Hide_D 5a176568e9 b_tournament 진행중에 그래프 그리는 문제 해결 2018-04-12 02:21:11 +09:00
Hide_D 279478c15b 등용장 발부시 국가명 빼먹은 것 수정 2018-04-12 02:18:35 +09:00
Hide_D f5f7c81c20 헌납에서 방랑군일때는 헌납이 가능하게 했던 흔적 수정 2018-04-12 02:11:55 +09:00
Hide_D 3c2499580c checkStatistic() 함수 index 빈 것 해결 2018-04-12 02:08:54 +09:00
Hide_D 45a104f9c0 padString에 문자열 너비가 원하는 길이보다 길때 버그 수정
명장 일람 데이터가 비었을 때 발생하는 버그 수정.
2018-04-12 01:48:16 +09:00
Hide_D a5b0c7f99f 배신한 장수는 유니크를 못먹게 하려는 코드의 흔적을 제거(동작하지 않았음) 2018-04-12 01:40:22 +09:00
Hide_D 643a2822a0 퇴각시 $oppose를 해제하여 마지막 페이즈 쌀 소모하는 문제 해결. 2018-04-12 01:27:29 +09:00
Hide_D be8e22309f _traffic.txt 제대로 작성 못하는 버그 수정.
쌀 소모량 못 받아오는 버그 수정.
getAtt, getDef에서 $game이 더이상 필요없으므로 삭제
2018-04-12 01:16:37 +09:00
Hide_D 8273c3f231 optionsForCities array_map 빼먹은거 수정 2018-04-11 20:57:12 +09:00
Hide_D e9ceb0bdd6 Citys 함수명 변경 2018-04-11 20:49:26 +09:00
Hide_D c204f36aa7 강행 실해하던 것 해결 2018-04-11 20:19:42 +09:00
Hide_D 869ee4b233 레벨이 300이 되면 전투엔진이 터지는 문제 수정 2018-04-11 19:54:25 +09:00
Hide_D f0c6243964 연감 장수 동향 안뜨는 문제도 해결 2018-04-11 03:16:50 +09:00
Hide_D b46a197a5c 연감 지도 엔진 변경 2018-04-11 03:09:49 +09:00
Hide_D d39c04da76 '유기체' 삭제 관리자 명(Hide_D)와 서버명 HiDCHe 로 변경. 2018-04-11 02:20:23 +09:00
Hide_D 22f1f3c227 페이지 리다이렉트 방식 변경
<script>location.replace</script>에서 PHP redirect header를 직접 이용하는 방식으로.
2018-04-11 02:14:03 +09:00
Hide_D 2b3efd0924 전투 수식에 TM서버 내용 반영 2018-04-11 01:50:29 +09:00
Hide_D 3004b20c87 버그 패치
- 메인 페이지에서 턴 실행으로 세션락이 걸리지 않도록.
- 토너먼트에서 매 라운드마다 텍스트가 초기화 되지 않던 문제 해결
- 전투 로그 표기에서  불필요한 빈칸 제거
2018-04-11 01:08:12 +09:00
Hide_D 5c8194b36d 로그 출력 거꾸로 된 것 보정 2018-04-10 22:44:12 +09:00
Hide_D e487846c56 전투 로그 바꾼것 제대로 안나오는 것을 수정 2018-04-10 22:44:00 +09:00
Hide_D 0437d45997 벌점 기준을 현실화 2018-04-10 22:43:45 +09:00
Hide_D 8dd5154de3 searchDistance에서 거리 계산 종료 조건 버그 수정 2018-04-10 21:32:27 +09:00
Hide_D bc519284fb 도시 병종 체크 버그 수정 2018-04-10 21:28:10 +09:00
Hide_D 19e06cc12e 메인 페이지 새 버튼 추가 준비 2018-04-10 21:21:58 +09:00
Hide_D 16e5601651 checkLimit 함수에 입력값이 없어도 자동으로 수행하도록 변경 2018-04-10 21:20:57 +09:00
Hide_D 8f9077dff8 명장 일람 아이템 표기 버그 수정, 사령부 턴 정상 리다이렉트, 개인 기록 역순 표기 문제 해결 2018-04-10 21:20:35 +09:00
Hide_D 9831685bb9 병종 가격 계산 버그, 접경 계산 버그, 긴급 천도 버그 수정 2018-04-10 21:11:56 +09:00
Hide_D 1412834b60 턴 갱신, 당기기, 밀기 코드 재 작성 2018-04-10 21:11:12 +09:00
Hide_D b8636763c1 Message::send 반환값 정리 2018-04-10 02:53:35 +09:00
Hide_D fe4823bb8d sendToSender() 반환값 2018-04-10 02:52:18 +09:00
Hide_D 7ef9a2fdca msg send 반환 방식 변경 2018-04-10 02:51:13 +09:00
Hide_D 9f627ca2f8 함수 이름 변경 2018-04-10 02:46:01 +09:00
Hide_D 2404ab2047 메시지 클래스 새로 작성 2018-04-10 02:38:36 +09:00
Hide_D 50d1c4cd34 dateFormat에 포맷 추가. error 페이지 표기 수정 2018-04-09 03:21:11 +09:00
Hide_D 269a40ca9d stylesheet 잘못 불러오는 문제 해결.
jquery.redirect 추가.
global 변수 extract 우회가 제대로 동작하지 않던 문제 해결
2018-04-09 02:56:45 +09:00
Hide_D 2a814dbbf9 하드리셋 시 UniqueConst가 없어져 세션에서 generalID, generalName을 확인할 수 없는 문제 수정 2018-04-09 01:56:12 +09:00
219 changed files with 8679 additions and 5041 deletions
+1
View File
@@ -30,6 +30,7 @@ d_pic/*.png
d_setting/*.php
*/d_setting/*.php
*/d_setting/templates/*.php
**/old/*
test.php
+1 -1
View File
@@ -32,7 +32,7 @@ return [
'hwe/func_npc.php',
'hwe/func_process_chief.php',
'hwe/func_process_personnel.php',
'hwe/func_process_trick.php',
'hwe/func_process_sabotage.php',
'hwe/func_process.php',
'hwe/func_string.php',
'hwe/func_template.php',
+21
View File
@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2018 Hide_D, 62che
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+60
View File
@@ -0,0 +1,60 @@
# 삼국지 모의전투 HiDCHe
삼국지 모의전투 유기체서버를 기반으로 더욱 더 진화한 서버입니다.
## 요구사항
* Apache2
* <code>mpm_event</code> 권장
* PHP 7.0 이상
* <code>php-fpm</code> 권장
* php에서 curl을 실행가능해야 합니다.
* MySQL 5.6 이상, 또는 MariaDB 10.0 이상
* <code>git</code>
* <code>curl</code>
Linux는 Ubuntu 16.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
Docker를 이용한 설치는 계획중입니다.
## 설치
본 게임은 <code>git</code>을 이용한 업그레이드 시스템을 구현하였으므로, <code>git</code>이 필요합니다.
또한 웹 서비스 데몬을 운영중인 사용자(일반적으로 <code>www-data</code>, <code>apache</code>)에게 디렉토리 권한이 주어져야합니다.
### 다운로드
웹 데몬 user가 <code>www-data</code>인 경우 다음과 같이 입력하여 최신 배포버전과 이미지 파일을 얻을 수 있습니다.
```
sudo -u www-data git clone ssh://git@storage.hided.net:2525/devsam/core.git
git clone ssh://git@storage.hided.net:2525/devsam/image.git
```
> 이미지는 별도의 업데이트 기능을 제공하지 않습니다. 수동으로 <code>git pull</code>을 해야합니다.
### 설치
이후 해당 경로를 웹 브라우저를 통해 접근하여 설치를 진행할 수 있습니다.
Database 수는 로그인 관리 서버 1개, 내부 서버 5개로, 총 6개의 Database가 필요합니다. 내부 설정을 고쳐서 서버 수를 늘리거나 줄일 경우 그에 맞는 Database 수가 필요합니다. 또한 Database마다 관리할 별도의 계정을 만드는 것을 추천합니다.
설치 이후에는 서버관리 페이지에서 **업데이트** 명령을 통해 원 클릭 업데이트가 가능합니다.
## 카카오로그인 연동
현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
<code>f_install/templates/KakaoKey.orig.php</code> 를 <code>d_setting/KakaoKey.php</code>로 복사한 후 API 키를 입력하여야 합니다.
## 라이선스
본 게임을 수정하거나 재배포할 경우 다음 중 하나의 라이선스를 선택하여 적용할 수 있습니다.
* MIT License
* GPL 2.0 또는 이후
만약 별도의 라이선스를 적용하고자 할 경우 Hide_D에게 문의하여 주십시오.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name":"sammo-hid/sammo",
"description":"삼국지 모의전투 HiD",
"description":"삼국지 모의전투 HiDCHe",
"license": [
"MIT",
"GPL-2.0-or-later",
+5 -17
View File
@@ -1,14 +1,14 @@
@charset "utf-8";
* { margin: 0px; padding: 0px; }
body { color:white; background-color:black; border-width:1; border-color:gray; }
body { color:white; background-color:black; border-width:1px; border-color:gray; }
table {
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
padding: 0px;
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';
}
th, td {
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
@@ -16,7 +16,7 @@ th, td {
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';
}
a.just_link {
@@ -53,19 +53,10 @@ div {
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';;
}
font { font-family: '맑은 고딕'; line-height: 110%; }
/*
input {
width: 100px; height: 18px;
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
*/
font { font-family: '맑은 고딕';}
.obj_fill{
display:block;
@@ -77,14 +68,12 @@ button.with_skin {
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
input.with_skin {
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
select {
@@ -92,7 +81,6 @@ select {
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
button {
width: 100px; height: 20px;
+42 -1
View File
@@ -62,8 +62,21 @@ input::-webkit-input-placeholder {
}
.col-form-label{
text-align:center;
}
.terms{
max-height: 200px; overflow: auto;
max-height: 200px; overflow-y: auto;
}
.terms pre{
width:100%;
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
.vertical-center {
@@ -72,4 +85,32 @@ input::-webkit-input-placeholder {
display: flex;
align-items: center;
}
#btn_kakao_login{
cursor: pointer;
height:46px;
width:116px;
background-color: transparent;
color:transparent;
border:0;
background-size: 100%; /* To fill the dimensions of container (button), or */
background-repeat: no-repeat;
background-position: bottom center;
margin-top:5px;
background-image:url('../oauth_kakao/kakao_login_join.png');
}
#btn_kakao_login:hover {
background-image:url('../oauth_kakao/kakao_login_join_ov.png');
}
#bottom_box{
position:fixed;
bottom:0;
width:100%;
left:0;
}
#bottom_box .container{
text-align:center;
}
+5 -165
View File
@@ -81,168 +81,8 @@
height:20px;
}
#EntranceManage_00 {
width: 500px; height: 409px;
z-index: 2;
}
#EntranceManage_0000 {
width: 498px; height: 50px;
}
#EntranceManage_0001 {
width: 100px; height: 30px;
}
#EntranceManage_0002 {
width: 498px; height: 25px;
}
#EntranceManage_0003 {
width: 98px; height: 84px;
line-height: 84px;
}
#EntranceManage_0004 {
width: 148px; height: 84px;
line-height: 84px;
}
#EntranceManage_0005 {
width: 98px; height: 84px;
line-height: 84px;
}
#EntranceManage_0006 {
width: 148px; height: 84px;
text-align: left;
}
#EntranceManage_000600 {
width: 80px; height: 17px;
}
#EntranceManage_000601 {
width: 80px; height: 17px;
}
#EntranceManage_000602 {
width: 80px; height: 17px;
}
#EntranceManage_000603 {
width: 144px; height: 20px;
}
#EntranceManage_0007 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0008 {
width: 148px; height: 64px;
line-height: 64px;
}
#EntranceManage_0009 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0010 {
width: 148px; height: 64px;
line-height: 64px;
}
#EntranceManage_0011 {
width: 98px; height: 20px;
}
#EntranceManage_0012 {
width: 148px; height: 20px;
}
#EntranceManage_0013 {
width: 248px; height: 20px;
}
#EntranceManage_0014 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0015 {
width: 148px; height: 64px;
}
#EntranceManage_001500 {
width: 64px; height: 64px;
}
#EntranceManage_001501 {
width: 64px; height: 64px;
}
#EntranceManage_0016 {
width: 248px; height: 64px;
}
#EntranceManage_001600 {
width: 100px; height: 16px;
display: none;
}
#EntranceManage_001601 {
width: 70px; height: 20px;
}
#EntranceManage_001602 {
width: 85px; height: 20px;
}
#EntranceManage_001603 {
width: 85px; height: 20px;
}
#EntranceManage_0017 {
width: 98px; height: 100px;
line-height: 100px;
}
#EntranceManage_0018 {
width: 398px; height: 100px;
text-align: left;
}
#EntranceManage_0019 {
width: 149px; height: 20px;
}
#EntranceManage_0020 {
width: 500px; height: 20px;
border: none;
}
#EntranceManage_002000 {
width: 500px;
}
#EntranceManage_00200000 {
width: 498px; height: 20px;
}
.EntranceManage_Sequence {
width: 48px; height: 20px;
}
.EntranceManage_Date {
width: 148px; height: 20px;
}
.EntranceManage_Amount {
width: 148px; height: 20px;
}
.EntranceManage_Cumul {
width: 148px; height: 20px;
}
#third_use_disallow{
display:none;
margin-left:10px;
width:40px;
}
+152
View File
@@ -0,0 +1,152 @@
/*
jQuery Redirect v1.1.1
Copyright (c) 2013-2017 Miguel Galante
Copyright (c) 2011-2013 Nemanja Avramovic, www.avramovic.info
Licensed under CC BY-SA 4.0 License: http://creativecommons.org/licenses/by-sa/4.0/
This means everyone is allowed to:
Share - copy and redistribute the material in any medium or format
Adapt - remix, transform, and build upon the material for any purpose, even commercially.
Under following conditions:
Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
*/
(function ($) {
'use strict';
/**
* jQuery Redirect
* @param {string} url - Url of the redirection
* @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
* @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST)
* @param {string} target - (optional) The target of the form. "_blank" will open the url in a new window.
* @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others.
* @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window.
*/
$.redirect = function (url, values, method, target, traditional, redirectTop) {
redirectTop = redirectTop || false;
var generatedForm = $.redirect.getForm(url, values, method, target, traditional);
$('body', redirectTop ? window.top.document : undefined).append(generatedForm.form);
generatedForm.submit();
};
$.redirect.getForm = function (url, values, method, target, traditional) {
method = (method && ["GET", "POST", "PUT", "DELETE"].indexOf(method.toUpperCase()) !== -1) ? method.toUpperCase() : 'POST';
url = url.split("#");
var hash = url[1] ? ("#" + url[1]) : "";
url = url[0];
if (!values) {
var obj = $.parseUrl(url);
url = obj.url;
values = obj.params;
}
values = removeNulls(values);
var form = $('<form>')
.attr("method", method)
.attr("action", url + hash);
if (target) {
form.attr("target", target);
}
var submit = form[0].submit;
iterateValues(values, [], form, null, traditional);
return { form: form, submit: function () { submit.call(form[0]); } };
}
//Utility Functions
/**
* Url and QueryString Parser.
* @param {string} url - a Url to parse.
* @returns {object} an object with the parsed url with the following structure {url: URL, params:{ KEY: VALUE }}
*/
$.parseUrl = function (url) {
if (url.indexOf('?') === -1) {
return {
url: url,
params: {}
};
}
var parts = url.split('?'),
query_string = parts[1],
elems = query_string.split('&');
url = parts[0];
var i, pair, obj = {};
for (i = 0; i < elems.length; i += 1) {
pair = elems[i].split('=');
obj[pair[0]] = pair[1];
}
return {
url: url,
params: obj
};
};
//Private Functions
var getInput = function (name, value, parent, array, traditional) {
var parentString;
if (parent.length > 0) {
parentString = parent[0];
var i;
for (i = 1; i < parent.length; i += 1) {
parentString += "[" + parent[i] + "]";
}
if (array) {
if (traditional)
name = parentString;
else
name = parentString + "[" + name + "]";
} else {
name = parentString + "[" + name + "]";
}
}
return $("<input>").attr("type", "hidden")
.attr("name", name)
.attr("value", value);
};
var iterateValues = function (values, parent, form, isArray, traditional) {
var i, iterateParent = [];
Object.keys(values).forEach(function (i) {
if (typeof values[i] === "object") {
iterateParent = parent.slice();
iterateParent.push(i);
iterateValues(values[i], iterateParent, form, Array.isArray(values[i]), traditional);
} else {
form.append(getInput(i, values[i], parent, isArray, traditional));
}
});
};
var removeNulls = function (values) {
var propNames = Object.getOwnPropertyNames(values);
for (var i = 0; i < propNames.length; i++) {
var propName = propNames[i];
if (values[propName] === null || values[propName] === undefined) {
delete values[propName];
} else if (typeof values[propName] === 'object') {
values[propName] = removeNulls(values[propName]);
} else if (values[propName].length < 1) {
delete values[propName];
}
}
return values;
};
}(window.jQuery || window.Zepto || window.jqlite));
+68 -5
View File
@@ -2,11 +2,52 @@
namespace sammo;
define('ROOT', realpath(__dir__.'/..'));
date_default_timezone_set('Asia/Seoul');
mb_internal_encoding("UTF-8");
mb_http_output('UTF-8');
mb_regex_encoding('UTF-8');
ini_set("session.cache_expire", 10080); // minutes
ini_set("session.gc_maxlifetime", 604800); // seconds
function getFriendlyErrorType($type)
{
switch($type)
{
case E_ERROR: // 1 //
return 'E_ERROR';
case E_WARNING: // 2 //
return 'E_WARNING';
case E_PARSE: // 4 //
return 'E_PARSE';
case E_NOTICE: // 8 //
return 'E_NOTICE';
case E_CORE_ERROR: // 16 //
return 'E_CORE_ERROR';
case E_CORE_WARNING: // 32 //
return 'E_CORE_WARNING';
case E_COMPILE_ERROR: // 64 //
return 'E_COMPILE_ERROR';
case E_COMPILE_WARNING: // 128 //
return 'E_COMPILE_WARNING';
case E_USER_ERROR: // 256 //
return 'E_USER_ERROR';
case E_USER_WARNING: // 512 //
return 'E_USER_WARNING';
case E_USER_NOTICE: // 1024 //
return 'E_USER_NOTICE';
case E_STRICT: // 2048 //
return 'E_STRICT';
case E_RECOVERABLE_ERROR: // 4096 //
return 'E_RECOVERABLE_ERROR';
case E_DEPRECATED: // 8192 //
return 'E_DEPRECATED';
case E_USER_DEPRECATED: // 16384 //
return 'E_USER_DEPRECATED';
}
return "{$type}";
}
function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting, so let it fall
@@ -15,10 +56,32 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
}
$date = date("Ymd_His");
$e = new \Exception();
file_put_contents(ROOT.'/d_log/err_log.txt',"$date, $errno, $errstr, $errfile, $errline\n", FILE_APPEND);
/* Don't execute PHP internal error handler */
//return true;
$data = Json::encode([
'date'=>$date,
'err'=>getFriendlyErrorType($errno),
'errstr'=>$errstr,
'trace'=>explode("\n", $e->getTraceAsString())
], Json::PRETTY);
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
}
set_error_handler("\sammo\logErrorByCustomHandler");
function logExceptionByCustomHandler(\Throwable $e){
$date = date("Ymd_His");
$data = Json::encode([
'date'=>$date,
'err'=>get_class($e),
'errstr'=>$e->getMessage(),
'trace'=>explode("\n", $e->getTraceAsString())
], Json::PRETTY);
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
throw $e;
}
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
+1 -1
View File
@@ -20,7 +20,7 @@ require(__dir__.'/../vendor/autoload.php');
</head>
<body>
<div class="container">
<h1 class="row justify-content-md-center">삼국지 모의전투 HiD 설치</h1>
<h1 class="row justify-content-md-center">삼국지 모의전투 HiDCHe 설치</h1>
<div class="row justify-content-md-center">
<div class="col col-12 col-md-10 col-lg-7">
+1 -1
View File
@@ -24,7 +24,7 @@ $rootDB->error_handler = function($params){
]);
};
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER');
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
if($memberCnt == 0){
Json::die([
'step'=>'admin',
+11
View File
@@ -2,6 +2,7 @@
DROP TABLE IF EXISTS `system`;
DROP TABLE IF EXISTS `member`;
DROP TABLE IF EXISTS `member_log`;
DROP TABLE IF EXISTS `config`;
-- 시스템 테이블
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
@@ -25,6 +26,7 @@ CREATE TABLE `member` (
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
`PW` CHAR(128) NOT NULL,
`salt` CHAR(16) NOT NULL,
`third_use` INT(1) NOT NULL DEFAULT '0',
`NAME` VARCHAR(64) NOT NULL,
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
`IMGSVR` INT(1) NULL DEFAULT '0',
@@ -53,4 +55,13 @@ CREATE TABLE `member_log` (
INDEX `action` (`member_no`, `action_type`, `date`),
INDEX `member` (`member_no`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
CREATE TABLE `config` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`key` VARCHAR(50) NOT NULL,
`value` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `key` (`key`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+4
View File
@@ -29,6 +29,10 @@ class RootDB
if (self::$uDB === null) {
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
self::$uDB->error_handler= function(){};
self::$uDB->throw_exception_on_error = true;
self::$uDB->throw_exception_on_nonsql_error = true;
}
return self::$uDB;
}
+10 -4
View File
@@ -11,18 +11,24 @@ class ServConfig
public static $sharedIconPath = '_tK_sharedIconPath_';
public static $gameImagePath = "_tK_gameImagePath_";
public static function getSharedIconPath() : string
public static function getSharedIconPath(string $filepath='') : string
{
if($filepath){
return static::$sharedIconPath."/{$filepath}";
}
return static::$sharedIconPath;
}
public static function getUserIconPath() : string
public static function getUserIconPath(string $filepath='') : string
{
return AppConf::getUserIconPathWeb();
return AppConf::getUserIconPathWeb($filepath);
}
public static function getGameImagePath() : string
public static function getGameImagePath(string $filepath='') : string
{
if($filepath){
return static::$gameImagePath."/{$filepath}";
}
return static::$gameImagePath;
}
+2 -2
View File
@@ -5,7 +5,7 @@ include "lib.php";
include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) {
if($session->userGrade < 4) {
?><!DOCTYPE html>
<!DOCTYPE html>
<html>
@@ -38,7 +38,7 @@ $plock = MYDB_fetch_array($result);
<!DOCTYPE html>
<html>
<head>
<title>삼국지 모의전투 PHP (유기체서버)</title>
<title>삼국지 모의전투 HiDCHe</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
+6 -5
View File
@@ -6,9 +6,9 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5){
//echo "<script>location.replace('_119.php');</script>";
echo '_119.php';//TODO:debug all and replace
if($session->userGrade < 4){
header('location:_119.php');
die();
}
$v = new Validator($_POST);
@@ -20,9 +20,12 @@ if(!$v->validate()){
Error($v->errorStr());
}
$btn = Util::getReq('btn');
$minute = Util::getReq('minute', 'int');
$minute2 = Util::getReq('minute2', 'int');
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
@@ -67,6 +70,4 @@ case "락풀기":
break;
}
//echo "<script>location.replace('_119.php');</script>";
//echo '_119.php';//TODO:debug all and replace
header('Location:_119.php');
+8 -5
View File
@@ -7,8 +7,8 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) {
//echo "<script>location.replace('_admin1.php');</script>";
echo '_admin1.php';//TODO:debug all and replace
header('location:_admin1.php');
die();
}
$v = new Validator($_POST);
@@ -17,17 +17,21 @@ $v->rule('integer', [
'minutes2'
])->rule('dateFormat', [
'starttime'
]);
], 'Y-m-d H:i:s');
if (!$v->validate()) {
Error($v->errorStr());
}
$msg = Util::getReq('msg');
$btn = Util::getReq('btn');
$log = Util::getReq('log');
$starttime = Util::getReq('starttime', 'string', (new \DateTime())->format('Y-m-d H:i:s'));
$maxgeneral = Util::getReq('maxgeneral', 'int', GameConst::$defaultMaxGeneral);
$maxnation = Util::getReq('maxnation', 'int', GameConst::$defaultMaxNation);
$startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
@@ -117,5 +121,4 @@ switch ($btn) {
break;
}
//echo "<script>location.replace('_admin1.php');</script>";
echo '_admin1.php';//TODO:debug all and replace
header('location:_admin1.php');
+238 -197
View File
@@ -4,11 +4,13 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$weap = Util::getReq('weap', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireLogin()->loginGame();
$session = Session::requireLogin()->loginGame()->setReadOnly();
if($session->userGrade < 5) {
header('location:_admin2.php');
@@ -22,287 +24,326 @@ if(!$generalID){
$db = DB::db();
$connect=$db->get();
$src = MessageTarget::buildQuick($session->generalID);
switch($btn) {
case "전체 접속허용":
$query = "update general set con=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', [
'con'=>0
], true);
break;
case "전체 접속제한":
$query = "update general set con=1000";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', [
'con'=>1000
], true);
break;
case "블럭 해제":
$db->update('general', [
'block'=>0
], '`no` IN %li', $genlist);
DB::db()->query('update general set block=0 where no IN %li', $genlist);
break;
case "1단계 블럭":
$date = date('Y-m-d H:i:s');
$db = DB::db();
$db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
//FIXME: subquery로 하는게 더 빠를 듯.
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where no IN %ls', $date, $uid);
$db->update('general', [
'block'=>1,
'killturn'=>24
], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('SELECT `owner` FROM general WHERE `no` IN %li', $genlist);
RootDB::db()->update('member',[
'block_num'=>$db->sqleval('block_num+1'),
'block_date'=>$date
], 'id IN %li', $uid);
break;
case "2단계 블럭":
$date = date('Y-m-d H:i:s');
$db = DB::db();
$db->query('update general set gold=0,rice=0,block=2,killturn=24 where no IN %li',$genlist);
$db->update('general', [
'gold'=>0,
'rice'=>0,
'block'=>2,
'killturn'=>24
], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
RootDB::db()->update('member',[
'block_num'=>$db->sqleval('block_num+1'),
'block_date'=>$date
], 'id IN %li', $uid);
break;
case "3단계 블럭":
$date = date('Y-m-d H:i:s');
$db = DB::db();
$db->query('update general set gold=0,rice=0,block=3,killturn=24 where no IN %li',$genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
$db->update('general', [
'gold'=>0,
'rice'=>0,
'block'=>3,
'killturn'=>24
], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('SELECT `owner` from general where no IN %li', $genlist);
RootDB::db()->update('member',[
'block_num'=>$db->sqleval('block_num+1'),
'block_date'=>$date
], 'id IN %li', $uid);
break;
case "무한삭턴":
DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
$db->update('general', [
'killturn'=>8000
], '`no` IN %li', $genlist);
break;
case "강제 사망":
$date = date('Y-m-d H:i:s');
DB::db()->query('update general set turn0=0,killturn=0,turntime=%s where no IN %li',$date, $genlist);
$db->update('general', [
'turn0'=>0,
'killturn'=>0,
'turntime'=>$date,
], '`no` IN %li', $genlist);
break;
case "특기 부여":
$admin = DB::db()->queryFirstRow('select `year`, `month` from `game` where `no`=1');
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
$text = "특기 부여!";
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "특기 부여!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "select no,leader,power,intel from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
$special2 = getSpecial2($general['leader'], $general['power'], $general['intel']);
$query = "update general set specage2=age,special2='$special2' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[0] = "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득");
pushGenLog($general, $log);
$specialWar = SpecialityConst::pickSpecialWar($general);
$db->update('general', [
'specage2'=>$db->sqleval('age'),
'special2'=>$specialWar
], 'no=%i', $general['no']);
$specialWarName = SpecialityConst::WAR[$specialWar][0];
pushGeneralHistory($general, "<C>●</>{$year}{$month}월:특기 【<b><C>{$specialWarName}</></b>】(을)를 습득");
pushGenLog($general, ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】(을)를 익혔습니다!"]);
}
break;
case "경험치1000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = $btn." 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set experience=experience+1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$text = $btn." 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'experience'=>$db->sqleval('experience+1000')
], '`no` IN %li', $genlist);
break;
case "공헌치1000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = $btn." 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dedication=dedication+1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$text = $btn." 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dedication'=>$db->sqleval('dedication+1000')
], '`no` IN %li', $genlist);
break;
case "보숙10000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "보병숙련도+10000 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dex0=dex0+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$text = "보병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dex0'=>$db->sqleval('dex0+10000')
], '`no` IN %li', $genlist);
break;
case "궁숙10000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "궁병숙련도+10000 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dex10=dex10+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$text = "궁병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dex10'=>$db->sqleval('dex10+10000')
], '`no` IN %li', $genlist);
break;
case "기숙10000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "기병숙련도+10000 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dex20=dex20+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$src = MessageTarget::buildQuick($session->generalID);
$text = "기병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dex20'=>$db->sqleval('dex20+10000')
], '`no` IN %li', $genlist);
break;
case "귀숙10000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "귀병숙련도+10000 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dex30=dex30+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$src = MessageTarget::buildQuick($session->generalID);
$text = "귀병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dex30'=>$db->sqleval('dex30+10000')
], '`no` IN %li', $genlist);
break;
case "차숙10000":
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
$msg = "차병숙련도+10000 지급!";
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < count($genlist); $i++) {
$query = "update general set dex40=dex40+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$src = MessageTarget::buildQuick($session->generalID);
$text = "차병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
'dex40'=>$db->sqleval('dex40+10000')
], '`no` IN %li', $genlist);
break;
case "접속 허용":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set con=0 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('genera',[
'con'=>0
], '`no` IN %li', $genlist);
break;
case "접속 제한":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set con=1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('genera',[
'con'=>1000
], '`no` IN %li', $genlist);
break;
case "메세지 전달":
//TODO:새 갠메 시스템으로 변경
$date = date('Y-m-d H:i:s');
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
$text = $msg;
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
break;
case "무기지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; }
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
if($weap == 0) {
$text = "무기 회수!";
}
for($i=0; $i < count($genlist); $i++) {
if($weap == 0) {
$query = "update general set weap='0' where no='$genlist[$i]'";
} else {
$query = "update general set weap='$weap' where no='$genlist[$i]' and weap<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
else {
$text = getWeapName($weap)." 지급!";
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
if($weap == 0){
$db->update('general', [
'weap'=>0
], '`no` IN %li', $genlist);
}
else{
$db->update('general', [
'weap'=>$weap
], '`no` IN %li AND weap < %i', $genlist, $weap);
}
break;
case "책지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
if($weap == 0) {
$text = "책 회수!";
}
for($i=0; $i < count($genlist); $i++) {
if($weap == 0) {
$query = "update general set book='0' where no='$genlist[$i]'";
} else {
$query = "update general set book='$weap' where no='$genlist[$i]' and book<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
else {
$text = getBookName($weap)." 지급!";
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
if($weap == 0){
$db->update('general', [
'book'=>0
], '`no` IN %li', $genlist);
}
else{
$db->update('general', [
'book'=>$weap
], '`no` IN %li AND book < %i', $genlist, $weap);
}
break;
case "말지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
if($weap == 0) {
$text = "말 회수!";
}
for($i=0; $i < count($genlist); $i++) {
if($weap == 0) {
$query = "update general set horse='0' where no='$genlist[$i]'";
} else {
$query = "update general set horse='$weap' where no='$genlist[$i]' and horse<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
else {
$text = getHorseName($weap)." 지급!";
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
if($weap == 0){
$db->update('general', [
'horse'=>0
], '`no` IN %li', $genlist);
}
else{
$db->update('general', [
'horse'=>$weap
], '`no` IN %li AND horse < %i', $genlist, $weap);
}
break;
case "도구지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < count($genlist); $i++) {
$you = DB::db()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
if($weap == 0) {
$text = "특수도구 회수!";
}
for($i=0; $i < count($genlist); $i++) {
if($weap == 0) {
$query = "update general set item='0' where no='$genlist[$i]'";
} else {
$query = "update general set item='$weap' where no='$genlist[$i]' and item<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
else {
$text = getItemName($weap)." 지급!";
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
if($weap == 0){
$db->update('general', [
'item'=>0
], '`no` IN %li', $genlist);
}
else{
$db->update('general', [
'item'=>$weap
], '`no` IN %li AND item < %i', $genlist, $weap);
}
break;
case "NPC해제":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set npc=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('general', [
'npc'=>1
], '`no` IN %li', $genlist);
break;
case "하야입력":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set turn0='00000000000045' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('general', [
'turn0'=>'00000000000045'
], '`no` IN %li', $genlist);
break;
case "방랑해산":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set turn0='00000000000047',turn1='00000000000056' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('general', [
'turn0'=>'00000000000047',
'turn1'=>'00000000000056'
], '`no` IN %li', $genlist);
break;
case "NPC설정":
for($i=0; $i < count($genlist); $i++) {
$query = "update general set npc=2 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$db->update('general', [
'npc'=>2
], '`no` IN %li', $genlist);
break;
case "00턴":
$query = "select turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
for($i=0; $i < count($genlist); $i++) {
$turntime = getRandTurn($admin['turnterm']);
$cutTurn = cutTurn($turntime, $admin['turnterm']);
$query = "update general set turntime='$cutTurn' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
foreach($genlist as $generalID){
$turntime = getRandTurn($turnterm);
$cutTurn = cutTurn($turntime, $turnterm);
$db->update('general', [
'turntime'=>$curTurn
], '`no` IN %li', $genlist);
}
break;
case "랜덤턴":
$query = "select turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
for($i=0; $i < count($genlist); $i++) {
$turntime = getRandTurn($admin['turnterm']);
$query = "update general set turntime='$turntime' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
foreach($genlist as $generalID){
$turntime = getRandTurn($turnterm);
$db->update('general', [
'turntime'=>$turntime
], '`no` IN %li', $genlist);
}
break;
}
//echo "<script>location.replace('_admin2.php');</script>";
echo '_admin2.php';//TODO:debug all and replace
header('location:_admin2.php');
+11 -7
View File
@@ -7,10 +7,15 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) {
//echo "<script>location.replace('_admin4.php');</script>";
echo '_admin4.php';//TODO:debug all and replace
header('location:_admin4.php');
die();
}
$btn = Util::getReq('btn');
$genlist = Util::getReq('genlist', 'array_int');
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
@@ -26,21 +31,21 @@ switch($btn) {
$db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
//FIXME: subquery로 하는게 더 빠를 듯.
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break;
case "2단계 블럭":
$date = date('Y-m-d H:i:s');
$db = DB::db();
$db->query('update general set block=2,killturn=24 where no IN %li',$genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break;
case "3단계 블럭":
$date = date('Y-m-d H:i:s');
$db = DB::db();
$db->query('update general set block=3,killturn=24 where no IN %li',$genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update MEMBER set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break;
case "무한삭턴":
DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
@@ -57,6 +62,5 @@ switch($btn) {
break;
}
//echo "<script>location.replace('_admin4.php');</script>";
echo '_admin4.php'; //TODO:debug all and replace
header('location:_admin4.php');
+12 -9
View File
@@ -7,6 +7,15 @@ include "func.php";
$type = Util::getReq('type', 'int', 0);
$type2 = Util::getReq('type2', 'int', 0);
if($type < 0 || $type > 17){
$type = 0;
}
if($type2 < 0 || $type2 > 6){
$type2 = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -33,12 +42,6 @@ if($session->userGrade < 5) {
$db = DB::db();
$connect=$db->get();
if($type == 0) {
$type = 0;
}
if($type2 == 0) {
$type2 = 0;
}
$sel = [];
$sel2 = [];
$sel[$type] = "selected";
@@ -155,7 +158,7 @@ SELECT
A.chemi,
A.color,
A.tech,
A.tricklimit,
A.sabotagelimit,
A.gold,
A.rice,
COUNT(B.nation) AS gennum,
@@ -230,7 +233,7 @@ for($i=0; $i < $nationCount; $i++) {
<td align=center>&nbsp;{$gen['cnt']}&nbsp;</td>
<td align=center>&nbsp;{$city['cnt']}&nbsp;</td>
<td align=center>&nbsp;{$nation['tech']}&nbsp;</td>
<td align=center>&nbsp;{$nation['tricklimit']}&nbsp;</td>
<td align=center>&nbsp;{$nation['sabotagelimit']}&nbsp;</td>
<td align=center>&nbsp;{$nation['gold']}&nbsp;</td>
<td align=center>&nbsp;{$nation['rice']}&nbsp;</td>
<td align=center>&nbsp;{$gen['avgg']}&nbsp;</td>
@@ -260,7 +263,7 @@ for($i=0; $i < $nationCount; $i++) {
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td><?=getTrickLogRecent(20)?></td></tr>
<tr><td><?=getSabotageLogRecent(20)?></td></tr>
</table>
<table align=center width=1760 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px; id=bg0>
+6 -4
View File
@@ -4,15 +4,18 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$nation = Util::getReq('nation', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
if($session->userGrade < 5) {
//echo "<script>location.replace('_admin5.php');</script>";
echo '_admin5.php';//TODO:debug all and replace
header('location:_admin5.php');
die();
}
$db = DB::db();
@@ -34,7 +37,6 @@ switch($btn) {
break;
}
//echo "<script>location.replace('_admin5.php');</script>";
echo '_admin5.php';//TODO:debug all and replace
header('location:_admin5.php');
+12 -8
View File
@@ -3,6 +3,13 @@ namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 0);
if($type < 0 || $type > 4){
$type = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -29,9 +36,6 @@ if($session->userGrade < 5) {
$db = DB::db();
$connect=$db->get();
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
@@ -48,11 +52,11 @@ $sel[$type] = "selected";
<tr><td>접 속 정 보<br><?=closeButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[0]?> value=0>접속률</option>
<option <?=$sel[1]?> value=1>총갱신</option>
<option <?=$sel[2]?> value=2>갱신/턴</option>
<option <?=$sel[3]?> value=3>총로그인</option>
<option <?=$sel[4]?> value=4>갱신/로그인</option>
<option <?=$sel[0]??''?> value=0>접속률</option>
<option <?=$sel[1]??''?> value=1>총갱신</option>
<option <?=$sel[2]??''?> value=2>갱신/턴</option>
<option <?=$sel[3]??''?> value=3>총로그인</option>
<option <?=$sel[4]??''?> value=4>갱신/로그인</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
+15 -7
View File
@@ -3,6 +3,17 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$gen = Util::getReq('gen', 'int', 0);
$type = Util::getReq('type', 'int', 0);
if($type < 0 || $type > 3){
$type = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -33,9 +44,6 @@ if($btn == '정렬하기') {
$gen = 0;
}
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
<!DOCTYPE html>
@@ -53,10 +61,10 @@ $sel[$type] = "selected";
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0]?> value=0>최근턴</option>
<option <?=$sel[1]?> value=1>최근전투</option>
<option <?=$sel[2]?> value=2>장수명</option>
<option <?=$sel[3]?> value=3>전투수</option>
<option <?=$sel[0]??''?> value=0>최근턴</option>
<option <?=$sel[1]??''?> value=1>최근전투</option>
<option <?=$sel[2]??''?> value=2>장수명</option>
<option <?=$sel[3]??''?> value=3>전투수</option>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
+11 -7
View File
@@ -3,6 +3,13 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$gen = Util::getReq('gen', 'int', 0);
$type = 0;
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -33,9 +40,6 @@ if ($btn == '정렬하기') {
$gen = 0;
}
if ($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
<!DOCTYPE html>
@@ -53,7 +57,7 @@ $sel[$type] = "selected";
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0]?> value=0>상태</option>
<option <?=$sel[0]??''?> value=0>상태</option>
</select>
<input type=submit name=btn value='정렬하기'>
</form>
@@ -77,9 +81,9 @@ foreach (getAllNationStaticInfo() as $nation) {
$nationColor[$nation['nation']] = $nation['color'];
}
switch ($type) {
case 0: $query = "select * from diplomacy where me < you order by state desc"; break;
}
$query = "select * from diplomacy where me < you order by state desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$dipcount = MYDB_num_rows($result);
for ($i=0; $i < $dipcount; $i++) {
+12 -13
View File
@@ -194,8 +194,8 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) {
$phase++;
$myAtt = getAtt($game, $general, $tech1, 0);
$myDef = getDef($game, $general, $tech1);
$myAtt = getAtt($general, $tech1, 0);
$myDef = getDef($general, $tech1);
$cityAtt = getCityAtt($city);
$cityDef = getCityDef($city);
@@ -355,7 +355,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
// 도시쌀 소모 계산
$opexp = Util::round($opexp / 50);
$rice = Util::round($opexp * 4 * getCrewtypeRice($game, 0, 0) * ($train3/100 - 0.2));
$rice = Util::round($opexp * 4 * getCrewtypeRice(0, 0) * ($train3/100 - 0.2));
//원래대로 스케일링
$city['def'] = Util::round($city['def'] / 10);
@@ -385,10 +385,10 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
while($phase < $warphase) {
$phase++;
$myAtt = getAtt($game, $general, $tech1, 0);
$myDef = getDef($game, $general, $tech1);
$opAtt = getAtt($game, $oppose, $tech2, 0);
$opDef = getDef($game, $oppose, $tech2);
$myAtt = getAtt($general, $tech1, 0);
$myDef = getDef($general, $tech1);
$opAtt = getAtt($oppose, $tech2, 0);
$opDef = getDef($oppose, $tech2);
// 감소할 병사 수
$myCrew = GameConst::$armperphase + $opAtt - $myDef;
$opCrew = GameConst::$armperphase + $myAtt - $opDef;
@@ -747,9 +747,9 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
// 공헌, 명성 상승
$exp = Util::round($exp / 50);
$ricing = ($exp * 5 * getCrewtypeRice($game, $general['crewtype'], $tech1));
$msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricing<br>";
// $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricing<br>";
$ricing = ($exp * 5 * getCrewtypeRice($general['crewtype'], $tech1));
$msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricing<br>";
// $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricing<br>";
$msg = ConvertLog($msg, 1);
@@ -771,11 +771,11 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "<R>★</>【성벽】내정 감소량 : $expSum2 【성벽】쌀 소모 : $ricingSum2<br>";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricingSum<br>";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricingSum<br>";
} elseif($isgen == "장수평균") {
$msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricingSum<br>";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricingSum<br>";
}
$msg2 = ConvertLog($msg2, 1);
@@ -1630,7 +1630,6 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
</table>
</form>
</body>
<?php PrintElapsedTime(); ?>
</html>
<?php
+27 -19
View File
@@ -3,6 +3,11 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -31,7 +36,7 @@ if ($con >= 2) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명장일람</title>
<title><?=UniqueConst::$serverName?>: 명장일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -52,13 +57,14 @@ if ($con >= 2) {
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<?php
if (isset($btn) && $btn == "NPC 보기") {
//FIXME: query가 너무 적나라.
$sel = "npc>=2";
} else {
$sel = "npc<2";
}
$nationName = [];
$nationColor = [];
$nationName = ['재야'];
$nationColor = ['#000000'];
foreach (getAllNationStaticInfo() as $nation) {
$nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation['nation']] = $nation['color'];
@@ -131,9 +137,9 @@ for ($i=0; $i < 21; $i++) {
if ($i != 2) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$data[$k] = $gen['data'];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "-";
@@ -160,7 +166,7 @@ for ($i=0; $i < 21; $i++) {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></td>";
}
}
@@ -179,10 +185,13 @@ for ($i=0; $i < 21; $i++) {
echo "</tr><tr>";
for ($k=0; $k < 10; $k++) {
if ($i == 5 || $i == 7 || $i == 20) {
if($data[$k] === '-'){
//do Nothing
}
else if ($i == 5 || $i == 7 || $i == 20) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
}
if ($i >= 13 && $i <= 16) {
else if ($i >= 13 && $i <= 16) {
$data[$k] = intdiv($data[$k], 100).".".($data[$k]%100)." %";
}
echo "<td align=center>{$data[$k]}</td>";
@@ -211,10 +220,10 @@ $call = array(
);
$func = array(
"getHorseName",
"getWeapName",
"getBookName",
"getItemName"
"\\sammo\\getHorseName",
"\\sammo\\getWeapName",
"\\sammo\\getBookName",
"\\sammo\\getItemName"
);
for ($i=0; $i < 4; $i++) {
@@ -239,8 +248,8 @@ for ($i=0; $i < 4; $i++) {
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
@@ -258,7 +267,7 @@ for ($i=0; $i < 4; $i++) {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
@@ -291,8 +300,8 @@ for ($i=0; $i < 4; $i++) {
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
@@ -310,7 +319,7 @@ for ($i=0; $i < 4; $i++) {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
@@ -335,7 +344,6 @@ for ($i=0; $i < 4; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -2
View File
@@ -6,6 +6,8 @@ include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
@@ -16,7 +18,7 @@ increaseRefresh("왕조일람", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -199,7 +201,6 @@ if ($select == 0) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -2
View File
@@ -6,6 +6,8 @@ include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
@@ -16,7 +18,7 @@ increaseRefresh("왕조일람", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -200,7 +202,6 @@ if ($select == 0) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+35 -20
View File
@@ -3,6 +3,11 @@ namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 9);
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -13,17 +18,20 @@ $connect=$db->get();
increaseRefresh("장수일람", 2);
$query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$query = "select con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if ($con >= 2) {
printLimitMsg($me['turntime']);
exit();
}
if(!isset($type) || $type == 0) {
if ($type <= 0 || $type > 15) {
$type = 9;
}
@@ -33,7 +41,7 @@ if(!isset($type) || $type == 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>장수일람</title>
<title><?=UniqueConst::$serverName?>: 장수일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
@@ -68,12 +76,12 @@ if(!isset($type) || $type == 0) {
$nationname = [];
$nationlevel = [];
$nationname[0] = "-";
foreach(getAllNationStaticInfo() as $nation){
foreach (getAllNationStaticInfo() as $nation) {
$nationname[$nation['nation']] = $nation['name'];
$nationlevel[$nation['nation']] = $nation['level'];
}
switch($type) {
switch ($type) { //FIXME: $query 처리 조심.
case 1: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
case 2: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
case 3: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
@@ -82,6 +90,7 @@ switch($type) {
case 6: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
case 7: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
case 8: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
default:
case 9: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
case 10: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
case 11: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
@@ -90,7 +99,7 @@ switch($type) {
case 14: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
case 15: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($genresult);
echo"
@@ -112,24 +121,24 @@ echo"
<td width=45 align=center id=bg1>삭턴</td>
<td width=84 align=center id=bg1>벌점</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
for ($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nation = $nationname[$general['nation']];
if($general['level'] == 12) {
if ($general['level'] == 12) {
$lbonus = $nationlevel[$general['nation']] * 2;
} elseif($general['level'] >= 5) {
} elseif ($general['level'] >= 5) {
$lbonus = $nationlevel[$general['nation']];
} else {
$lbonus = 0;
}
if($lbonus > 0) {
if ($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
}
if($general['injury'] > 0) {
if ($general['injury'] > 0) {
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
@@ -142,16 +151,20 @@ for($j=0; $j < $gencount; $j++) {
$intel = "{$general['intel']}";
}
if($general['npc'] >= 2) { $name = "<font color=cyan>{$general['name']}</font>"; }
elseif($general['npc'] == 1) { $name = "<font color=skyblue>{$general['name']}</font>"; }
else { $name = "{$general['name']}"; }
if ($general['npc'] >= 2) {
$name = "<font color=cyan>{$general['name']}</font>";
} elseif ($general['npc'] == 1) {
$name = "<font color=skyblue>{$general['name']}</font>";
} else {
$name = "{$general['name']}";
}
$general['connect'] = Util::round($general['connect'] / 10) * 10;
$imageTemp = GetImageURL($general['imgsvr']);
echo "
<tr>
<td align=center><img src={$imageTemp}/{$general['picture']}></img></td>
<td align=center><img width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
<td align=center>$name</td>
<td align=center>{$general['age']}세</td>
<td align=center>".getGenChar($general['personal'])."</td>
@@ -160,12 +173,15 @@ for($j=0; $j < $gencount; $j++) {
<td align=center>{$nation}</td>
<td align=center>".getHonor($general['experience'])."</td>
<td align=center>".getDed($general['dedication'])."</td>
<td align=center>"; echo getLevel($general['level']); echo "</td>
<td align=center>";
echo getLevel($general['level']);
echo "</td>
<td align=center>$leader</td>
<td align=center>$power</td>
<td align=center>$intel</td>
<td align=center>{$general['killturn']}</td>
<td align=center>{$general['connect']}"; echo "<br>【".getConnect($general['connect'])."】</td>
<td align=center>{$general['connect']}";
echo "<br>【".getConnect($general['connect'])."】</td>
</tr>";
}
echo "
@@ -178,7 +194,6 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
<script type="text/javascript">
$(document).ready(function() {
$("#viewType").val("<?=$type?>").attr("selected", "selected");
+4 -5
View File
@@ -14,14 +14,14 @@ increaseRefresh("명예의전당", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명예의 전당</title>
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13px;word-break:break-all; id=bg0>
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
@@ -82,7 +82,7 @@ for ($i=0; $i < 21; $i++) {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
echo "<td align=center><img width='64' height='64' src={$imageTemp}/{$pic[$k]}></img></td>";
}
*/
}
@@ -114,11 +114,10 @@ for ($i=0; $i < 21; $i++) {
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+26 -11
View File
@@ -4,7 +4,10 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$yearmonth = $_POST['yearmonth'];
$yearmonth = Util::getReq('yearmonth', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -12,13 +15,13 @@ $userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("연감", 5);
increaseRefresh("연감", 2);
$query = "select startyear,year,month,conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$query = "select map,con,turntime from general where owner='{$userID}'";
$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);
@@ -38,12 +41,13 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "
$history = MYDB_fetch_array($result);
$e = ($history['year']*12) + $history['month'];
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
if (!$yearmonth) {
$year = $admin['year'];
$month = $admin['month'] - 1;
} else {
$year = substr($yearmonth, 0, 3) - 0;
$month = substr($yearmonth, 3, 2) - 0;
$year = intdiv($yearmonth, 100);
$month = $yearmonth % 100;
if ($btn == "◀◀ 이전달") {
$month -= 1;
@@ -73,9 +77,16 @@ if ($month <= 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>연감</title>
<title><?=UniqueConst::$serverName?>: 연감</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
<script src="js/base_map.js"></script>
<script src="js/map.js"></script>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<link href="css/map.css" rel="stylesheet">
</head>
@@ -117,9 +128,8 @@ $history = MYDB_fetch_array($result);
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
<tr height=520>
<td width=698>
<iframe src='map_history.php?year=<?=$year?>&month=<?=$month?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe>
</td>
<?=getMapHtml();?>
<td width=98 valign=top><?=$history['nation']?></td>
<td width=78 valign=top><?=$history['power']?></td>
<td width=58 valign=top><?=$history['gen']?></td>
@@ -142,7 +152,12 @@ $history = MYDB_fetch_array($result);
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
<script>
reloadWorldMap({
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>',
showMe:false,
neutralView:true
});
</script>
</body>
</html>
+1 -2
View File
@@ -28,7 +28,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력일람</title>
<title><?=UniqueConst::$serverName?>: 세력일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -248,7 +248,6 @@ echo"
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+27 -20
View File
@@ -6,14 +6,17 @@ include "func.php";
$type = Util::getReq('type', 'int', 1);
extractMissingPostToGlobals();
if($type <= 0 || $type > 8){
$type = 1;
}
$db = DB::db();
$connect=$db->get();
increaseRefresh("빙의일람", 2);
if($type == 0) {
$type = 1;
}
$sel = [];
$sel[$type] = "selected";
@@ -23,7 +26,7 @@ $sel[$type] = "selected";
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>빙의일람</title>
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -34,14 +37,14 @@ $sel[$type] = "selected";
<tr><td>빙 의 일 람<br><?=closeButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1]?> value=1>이름</option>
<option <?=$sel[2]?> value=2>국가</option>
<option <?=$sel[3]?> value=3>종능</option>
<option <?=$sel[4]?> value=4>통솔</option>
<option <?=$sel[5]?> value=5>무력</option>
<option <?=$sel[6]?> value=6>지력</option>
<option <?=$sel[7]?> value=7>명성</option>
<option <?=$sel[8]?> value=8>계급</option>
<option <?=$sel[1]??''?> value=1>이름</option>
<option <?=$sel[2]??''?> value=2>국가</option>
<option <?=$sel[3]??''?> value=3>종능</option>
<option <?=$sel[4]??''?> value=4>통솔</option>
<option <?=$sel[5]??''?> value=5>무력</option>
<option <?=$sel[6]??''?> value=6>지력</option>
<option <?=$sel[7]??''?> value=7>명성</option>
<option <?=$sel[8]??''?> value=8>계급</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
@@ -49,11 +52,12 @@ $sel[$type] = "selected";
<?php
$nationname = [];
$nationname[0] = "-";
foreach(getAllNationStaticInfo() as $nation){
foreach (getAllNationStaticInfo() as $nation) {
$nationname[$nation['nation']] = $nation['name'];
}
switch($type) {
switch ($type) {//FIXME: $query 처리 부실
default:
case 1: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by binary(name)"; break;
case 2: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by nation"; break;
case 3: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by sum desc"; break;
@@ -63,7 +67,7 @@ switch($type) {
case 7: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by experience"; break;
case 8: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by dedication"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($genresult);
echo"
@@ -82,13 +86,17 @@ echo"
<td width=78 align=center id=bg1>명성</td>
<td width=78 align=center id=bg1>계급</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
for ($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nation = $nationname[$general['nation']];
if($general['npc'] >= 2) { $name = "<font color=cyan>{$general['name']}</font>"; }
elseif($general['npc'] == 1) { $name = "<font color=skyblue>{$general['name']}</font>"; }
else { $name = "{$general['name']}"; }
if ($general['npc'] >= 2) {
$name = "<font color=cyan>{$general['name']}</font>";
} elseif ($general['npc'] == 1) {
$name = "<font color=skyblue>{$general['name']}</font>";
} else {
$name = "{$general['name']}";
}
echo "
<tr>
@@ -116,7 +124,6 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+5 -6
View File
@@ -17,7 +17,7 @@ $query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select map,con,turntime from general where owner='{$userID}'";
$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);
@@ -29,7 +29,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>세력도</title>
<title><?=UniqueConst::$serverName?>: 세력도</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
@@ -45,7 +45,7 @@ $(function(){
});
</script>
<link href="../d_shared/common.css" red="stylesheet">
<link href="../d_shared/common.css" rel="stylesheet">
<link href="css/normalize.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<link href="css/map.css" rel="stylesheet">
@@ -59,7 +59,7 @@ $(function(){
<table align=center width=1200 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr height=520>
<td width=498 valign=top>
<?php getGeneralPublicRecordRecent(34); ?>
<?=getGeneralPublicRecordRecent(34)?>
</td>
<td width=698>
<?=getMapHtml()?>
@@ -67,7 +67,7 @@ $(function(){
</tr>
<tr>
<td colspan=2 valign=top>
<?php getWorldHistoryRecent(34); ?>
<?=getWorldHistoryRecent(34)?>
</td>
</tr>
</table>
@@ -75,7 +75,6 @@ $(function(){
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+12 -12
View File
@@ -13,7 +13,7 @@ $query = "select year,month,refresh,maxrefresh,maxonline from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$game = MYDB_fetch_array($result);
$log = [];
$log = getRawFileLogRecent(__dir__.'/logs/_traffic.txt', 11, 100);
$date = [];
$year = [];
@@ -22,14 +22,15 @@ $refresh = [];
$online = [];
$curonline = getOnlineNum();
for ($i=0; $i < 11; $i++) {
$parse = explode("|", $log[count($log)-12+$i]);
$date[$i] = trim($parse[0]);
$year[$i] = trim($parse[1]);
$month[$i] = trim($parse[2]);
$refresh[$i] = trim($parse[3]);
$online[$i] = trim($parse[4]);
foreach($log as $i=>$value){
$parse = Json::decode($value);
$date[$i] = $parse[0];
$year[$i] = $parse[1];
$month[$i] = $parse[2];
$refresh[$i] = $parse[3];
$online[$i] = $parse[4];
}
if ($game['maxrefresh'] == 0) {
$game['maxrefresh'] = 1;
}
@@ -46,7 +47,7 @@ if ($game['maxonline'] < $curonline) {
<!DOCTYPE html>
<html>
<head>
<title>트래픽정보</title>
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -62,7 +63,7 @@ if ($game['maxonline'] < $curonline) {
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
<?php
for ($i=0; $i < 11; $i++) {
foreach($log as $i=>$value){
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
if ($w >= 100) {
$w -= 0.1;
@@ -132,7 +133,7 @@ $dt = date('H:i');
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
<?php
for ($i=0; $i < 11; $i++) {
foreach($log as $i=>$value){
$w = round($online[$i] / $game['maxonline'] * 100, 1);
if ($w >= 100) {
$w -= 0.1;
@@ -263,7 +264,6 @@ for ($i=0; $i < $count; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+26 -21
View File
@@ -28,7 +28,7 @@ if ($vote[0] == "") {
<!DOCTYPE html>
<html>
<head>
<title>설문조사</title>
<title><?=UniqueConst::$serverName?>: 설문조사</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -57,7 +57,7 @@ if ($session->userGrade >= 5) {
<tr>
<td width=48 align=center><input type=submit name=btn value='알림'></td>
<td width=98 align=center><input type=submit name=btn value='수정'></td>
<td width=848 align=left><input type=text name=title style=width:848;></td>
<td width=848 align=left><input type=text name=title style=width:848px;></td>
</tr>
";
}
@@ -132,7 +132,7 @@ if ($session->userGrade >= 5) {
<tr>
<td align=center><input type=submit name=btn value='리셋'></td>
<td align=center><input type=submit name=btn value='추가'></td>
<td align=left><input type=text name=str style=width:848;></td>
<td align=left><input type=text name=str style=width:848px;></td>
</tr>
";
}
@@ -168,7 +168,7 @@ if ($me['no'] > 0) {
<tr>
<td width=108 colspan=2 align=center>-</td>
<td width=83 align=center><input type=submit name=btn value='댓글'></td>
<td align=left><input type=text name=comment maxlength=60 style=width:798; onkeydown='return captureKey(event)'></td>
<td align=left><input type=text name=comment maxlength=60 style=width:798px; onkeydown='return captureKey(event)'></td>
</tr>
";
}
@@ -198,22 +198,19 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
<tr>
";
$memCount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
if ($memCount == 0) {
$memCount = 1;
}
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
$totalVote = [];
$nationVoteCount = [[0]];
$nationVote = [[]];
$nationVoteCount = [];
$nationVote = [];
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
$nation = $row['nation'];
$vote = $row['vote'];
$ownVote = $row['vote'];
$cnt = $row['cnt'];
if (!isset($totalVote[$vote])) {
$totalVote[$vote] = 0;
if (!isset($totalVote[$ownVote])) {
$totalVote[$ownVote] = 0;
}
if (!isset($nationVoteCount[$nation])) {
@@ -221,20 +218,20 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
$nationVote[$nation] = [];
}
if (!isset($nationVote[$nation][$vote])) {
$nationVote[$nation][$vote] = 0;
if (!isset($nationVote[$nation][$ownVote])) {
$nationVote[$nation][$ownVote] = 0;
}
$totalVote[$vote] += $cnt;
$totalVote[$ownVote] += $cnt;
$nationVoteCount[$nation] += $cnt;
$nationVote[$nation][$vote] += $cnt;
$nationVote[$nation][$ownVote] += $cnt;
}
for ($i=0; $i < $voteTypeCount; $i++) {
$per = round(($totalVote[$i]??0) / $memCount * 100, 1);
$per = round(($totalVote[$i]??0) * 100 / $memCount, 1);
// if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
";
}
@@ -293,8 +290,16 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$memCount = MYDB_num_rows($result);
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
$percentage = round($voteCount / $memCount * 100, 1);
if($memCount == 0){
$percentage = 100;
}
else{
$percentage = round($voteCount / $memCount * 100, 1);
}
echo "
<tr>
@@ -328,7 +333,6 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
@@ -340,6 +344,7 @@ function getVoteColor($type)
}
switch ($type) {
default:
case 0: $color = "black"; break;
case 1: $color = "red"; break;
case 2: $color = "orange"; break;
+3 -2
View File
@@ -7,6 +7,8 @@ include "func.php";
$msg = Util::getReq('msg');
$msg2 = Util::getReq('msg2');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -56,7 +58,7 @@ if ($msg2 == "") {
<!DOCTYPE html>
<html>
<head>
<title>거래장</title>
<title><?=UniqueConst::$serverName?>: 거래장</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -297,6 +299,5 @@ for ($i=0; $i < $count; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+37 -15
View File
@@ -8,7 +8,16 @@ $v = new Validator($_POST + $_GET);
$v->rule('required', 'gen')
->rule('integer', 'gen');
$gen = Util::getReq('gen', 'int');
$btn = Util::getReq('btn');
$gen = Util::getReq('gen', 'int', 0);
$type = Util::getReq('type', 'int', 0);
if ($type < 0 || $type > 3) {
$type = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -58,9 +67,6 @@ if ($btn == '정렬하기') {
$gen = 0;
}
if ($type == 0) {
$type = 0;
}
$sel = [];
$sel[$type] = "selected";
@@ -69,7 +75,7 @@ $sel[$type] = "selected";
<html>
<head>
<title>감찰부</title>
<title><?=UniqueConst::$serverName?>: 감찰부</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -83,30 +89,34 @@ $sel[$type] = "selected";
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0]?> value=0>최근턴</option>
<option <?=$sel[1]?> value=1>최근전투</option>
<option <?=$sel[2]?> value=2>장수명</option>
<option <?=$sel[3]?> value=3>전투수</option>
<option <?=$sel[0]??''?> value=0>최근턴</option>
<option <?=$sel[1]??''?> value=1>최근전투</option>
<option <?=$sel[2]??''?> value=2>장수명</option>
<option <?=$sel[3]??''?> value=3>전투수</option>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
<select name=gen size=1>
<?php
switch ($type) {
case 0: $query = "select no,name from general where nation='{$me['nation']}' order by turntime desc"; break;
case 1: $query = "select no,name from general where nation='{$me['nation']}' order by recwar desc"; break;
case 2: $query = "select no,name from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
case 3: $query = "select no,name from general where nation='{$me['nation']}' order by warnum desc"; break;
default:
case 0: $query = "select no,name,npc from general where nation='{$me['nation']}' order by turntime desc"; break;
case 1: $query = "select no,name,npc from general where nation='{$me['nation']}' order by recwar desc"; break;
case 2: $query = "select no,name,npc from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
case 3: $query = "select no,name,npc from general where nation='{$me['nation']}' order by warnum desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($result);
$npc = 0;
for ($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수
if ($gen == 0) {
$gen = $general['no'];
}
if($gen == $general['no']){
$npc = $general['npc'];
}
if ($gen == $general['no']) {
echo "
<option selected value={$general['no']}>{$general['name']}</option>";
@@ -146,11 +156,23 @@ for ($i=0; $i < $gencount; $i++) {
<?=getBatResRecent($gen, 24)?>
</td>
</tr>
<?php if($npc > 1): ?>
<tr>
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>&nbsp;</font></td>
</tr>
<tr>
<td valign=top>
<?=getGenLogRecent($gen, 24)?>
</td>
<td valign=top>
</td>
</tr>
<?php endif; ?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+46 -17
View File
@@ -28,6 +28,7 @@ if ($con >= 2) {
}
switch ($admin['tnmt_type']) {
default: throw new \RuntimeException('Invalid tnmt_type');break;
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
@@ -36,7 +37,13 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
$str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime();
if($str2){
$str2 = ', '.$str2;
}
$str3 = getTournamentTerm();
if($str3){
$str3 = ', '.$str3;
}
?>
<!DOCTYPE html>
@@ -46,13 +53,13 @@ $str3 = getTournamentTerm();
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>베팅장</title>
<title><?=UniqueConst::$serverName?>: 베팅장</title>
<style>
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
body { color:white; background-color:black; border-width:1px; border-color:gray; }
table { font-family:'맑은 고딕';}
font { font-family:'맑은 고딕';}
input { font-family:'맑은 고딕';height:20px }
select { font-family:'굴림'; }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
@@ -64,19 +71,23 @@ select { font-family:'굴림'; line-height:100%; }
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td>베 팅 장<br><?=closeButton()?></td></tr>
</table>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet']?> / 내 투자 금액 : <?=$me['bet']?>)</font></td></tr>
</table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
<tr align=center><td height=10 colspan=16></td></tr>
<tr align=center>
<?php
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
for ($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -96,11 +107,16 @@ $query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$cent = [];
$line = [];
$gen = [];
for ($i=0; $i < 1; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -141,7 +157,11 @@ for ($i=0; $i < 2; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -182,7 +202,11 @@ for ($i=0; $i < 4; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -223,7 +247,11 @@ for ($i=0; $i < 8; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -266,10 +294,12 @@ for ($i=0; $i < 16; $i++) {
}
for ($i=0; $i < 16; $i++) {
$bet[$i] = @round($admin['bet'] / $admin["bet{$i}"], 2);
if ($bet[$i] == 0) {
if($admin["bet{$i}"] == 0){
$bet[$i] = "∞";
}
else{
$bet[$i] = round($admin['bet'] / $admin["bet{$i}"], 2);
}
}
for ($i=0; $i < 16; $i++) {
@@ -403,6 +433,5 @@ for ($i=0; $i < 4; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -4
View File
@@ -25,7 +25,7 @@ if($me['level'] < 5) {
<!DOCTYPE html>
<html>
<head>
<title>기밀실</title>
<title><?=UniqueConst::$serverName?>: 기밀실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -37,11 +37,11 @@ if($me['level'] < 5) {
<tr><td>기 밀 실<br><?=backButton()?></td></tr>
<form name=form1 method=post action=c_chiefboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830;>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998;height:200;></textarea><br>
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
@@ -69,7 +69,6 @@ for($i=0; $i < 20; $i++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+47 -35
View File
@@ -58,13 +58,24 @@ $nation = MYDB_fetch_array($result);
$lv = getNationChiefLevel($nation['level']);
$turn = [];
$gen = [];
for($i=12; $i >= $lv; $i--) {
$turn[$i] = getCoreTurn($nation, $i);
$query = "select name,turntime,npc from general where level={$i} and nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen[$i] = MYDB_fetch_array($result);
$gen[$i] = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'turntime'=>''
];
}
for($i= $lv - 1; $i>=5; $i--){
$gen[$i] = [
'npc'=>0,
'name'=>'',
'turntime'=>''
];
}
?>
@@ -72,7 +83,7 @@ for($i=12; $i >= $lv; $i--) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>사령부</title>
<title><?=UniqueConst::$serverName?>: 사령부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript">
@@ -105,43 +116,45 @@ for($i=12; $i >= $lv; $i--) {
$turntime[$i] = substr($gen[$i]['turntime'], 14);
}
//FIXME: 각 칸을 div로 놓으면 네개씩 출력하는 삽질이 필요없다.
for($k=0; $k < 2; $k++) {
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $k;
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".$gen[$l4]['name']."</font>"; }
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".$gen[$l4]['name']."</font>"; }
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".$gen[$l3]['name']."</font>"; }
elseif($gen[$l3]['npc'] == 1) { $gen[$l3]['name'] = "<font color=skyblue>".$gen[$l3]['name']."</font>"; }
if ($gen[$l2]['npc'] >= 2) { $gen[$l2]['name'] = "<font color=cyan>".$gen[$l2]['name']."</font>"; }
elseif($gen[$l2]['npc'] == 1) { $gen[$l2]['name'] = "<font color=skyblue>".$gen[$l2]['name']."</font>"; }
if ($gen[$l1]['npc'] >= 2) { $gen[$l1]['name'] = "<font color=cyan>".$gen[$l1]['name']."</font>"; }
elseif($gen[$l1]['npc'] == 1) { $gen[$l1]['name'] = "<font color=skyblue>".$gen[$l1]['name']."</font>"; }
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".($gen[$l4]['name']??'')."</font>"; }
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".($gen[$l4]['name']??'')."</font>"; }
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".($gen[$l3]['name']??'')."</font>"; }
elseif($gen[$l3]['npc'] == 1) { $gen[$l3]['name'] = "<font color=skyblue>".($gen[$l3]['name']??'')."</font>"; }
if ($gen[$l2]['npc'] >= 2) { $gen[$l2]['name'] = "<font color=cyan>".($gen[$l2]['name']??'')."</font>"; }
elseif($gen[$l2]['npc'] == 1) { $gen[$l2]['name'] = "<font color=skyblue>".($gen[$l2]['name']??'')."</font>"; }
if ($gen[$l1]['npc'] >= 2) { $gen[$l1]['name'] = "<font color=cyan>".($gen[$l1]['name']??'')."</font>"; }
elseif($gen[$l1]['npc'] == 1) { $gen[$l1]['name'] = "<font color=skyblue>".($gen[$l1]['name']??'')."</font>"; }
echo "
<tr>
<td align=center id=bg1>.</td>
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : {$gen[$l4]['name']}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : {$gen[$l3]['name']}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : {$gen[$l2]['name']}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : {$gen[$l1]['name']}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : ".($gen[$l4]['name']??'')."</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : ".($gen[$l3]['name']??'')."</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : ".($gen[$l2]['name']??'')."</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : ".($gen[$l1]['name']??'')."</b></td>
<td align=center id=bg1>.</td>
</tr>
";
for($i=0; $i < 12; $i++) {
$turndate[$l4] = substr($totaldate[$l4], 11, 5);
$turndate[$l3] = substr($totaldate[$l3], 11, 5);
$turndate[$l2] = substr($totaldate[$l2], 11, 5);
$turndate[$l1] = substr($totaldate[$l1], 11, 5);
$turndate[$l4] = substr($totaldate[$l4]??'', 11, 5);
$turndate[$l3] = substr($totaldate[$l3]??'', 11, 5);
$turndate[$l2] = substr($totaldate[$l2]??'', 11, 5);
$turndate[$l1] = substr($totaldate[$l1]??'', 11, 5);
$j = $i + 1;
$td4 = ($turndate[$l4] == "") ? "-" : $turndate[$l4];
$td3 = ($turndate[$l3] == "") ? "-" : $turndate[$l3];
$td2 = ($turndate[$l2] == "") ? "-" : $turndate[$l2];
$td1 = ($turndate[$l1] == "") ? "-" : $turndate[$l1];
$tn4 = ($turn[$l4][$i] == "") ? "-" : $turn[$l4][$i];
$tn3 = ($turn[$l3][$i] == "") ? "-" : $turn[$l3][$i];
$tn2 = ($turn[$l2][$i] == "") ? "-" : $turn[$l2][$i];
$tn1 = ($turn[$l1][$i] == "") ? "-" : $turn[$l1][$i];
$td4 = $turndate[$l4]??"-";
$td3 = $turndate[$l3]??"-";
$td2 = $turndate[$l2]??"-";
$td1 = $turndate[$l1]??"-";
$tn4 = $turn[$l4][$i]??"-";
$tn3 = $turn[$l3][$i]??"-";
$tn2 = $turn[$l2][$i]??"-";
$tn1 = $turn[$l1][$i]??"-";
echo "
<tr>
<td width=28 align=center id=bg0><b>$j</b></td>
@@ -156,20 +169,20 @@ for($k=0; $k < 2; $k++) {
<td width=28 align=center id=bg0><b>$j</b></td>
</tr>
";
if($totaldate[$l4] != "") { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
if($totaldate[$l3] != "") { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
if($totaldate[$l2] != "") { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
if($totaldate[$l1] != "") { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
if($totaldate[$l4]??'') { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
if($totaldate[$l3]??'') { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
if($totaldate[$l2]??'') { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
if($totaldate[$l1]??'') { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
}
if($k == 0) {
echo "<form action=processing.php method=post><tr><td colspan=5 align=right>";
echo CoreTurnTable();
echo "</td><td colspan=5>
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58;font-size:13px; value='미루기▼' onclick='turn(0)'>
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58;font-size:13px; value='▲당기기' onclick='turn(1)'>
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58px;font-size:13px; value='미루기▼' onclick='turn(0)'>
<input type={$btn2} style=background-color:".GameConst::$basecolor2.";color:white;width:58px;font-size:13px; value='▲당기기' onclick='turn(1)'>
<br>";
CoreCommandTable();
echo "<input type={$btn} style=background-color:".GameConst::$basecolor2.";color:white;width:55;font-size:13px; value='실 행'></td></tr></form>";
echo "<input type={$btn} style=background-color:".GameConst::$basecolor2.";color:white;width:55px;font-size:13px; value='실 행'></td></tr></form>";
}
}
@@ -179,7 +192,6 @@ for($k=0; $k < 2; $k++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+190 -166
View File
@@ -3,6 +3,11 @@ namespace sammo;
include "lib.php";
include "func.php";
$citylist = Util::getReq('citylist', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -20,29 +25,47 @@ $query = "select nation,level,spy from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result);
$templates = new \League\Plates\Engine('templates');
?>
<!DOCTYPE html>
<html>
<head>
<title>도시정보</title>
<title><?=UniqueConst::$serverName?>: 도시정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<link href="../d_shared/common.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<style>
#general_list tr td{
text-align:center;
}
#general_list tr td:last-child{
text-align:left;
padding-left:1em;
}
.general_turn_text{
font-size:x-small;
}
</style>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td>도 시 정 보<br><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr>
<td width=998>
<form name=cityselect method=get>도시선택 :
<select name=citylist size=1 style=color:white;background-color:black;width:798;>
<select name=citylist size=1 style=color:white;background-color:black;width:798px;>
<?php
if(!array_key_exists('citylist', $_REQUEST) || $_REQUEST['citylist'] == '') { $_REQUEST['citylist'] = $me['city']; }
if(!$citylist){
$citylist = $me['city'];
}
// 재야일때는 현재 도시만
$valid = 0;
@@ -52,7 +75,7 @@ if($me['level'] == 0) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value={$city['city']}";
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
@@ -68,7 +91,7 @@ if($me['level'] == 0) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value={$city['city']}";
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
@@ -85,7 +108,7 @@ if($me['level'] == 0) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value={$city['city']}";
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
@@ -111,7 +134,7 @@ if($myNation['level'] > 0) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value={$city['city']}";
if($city['city'] == $_REQUEST['citylist']) { echo " selected"; $valid = 1; }
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
@@ -131,76 +154,68 @@ echo "
</table>
<br>";
unset($city);
// 첩보된 도시까지만 허용
if($valid == 0 && $session->userGrade < 5) {
$_REQUEST['citylist'] = $me['city'];
$citylist = $me['city'];
}
$query = "select * from city where city='{$_REQUEST['citylist']}'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
$nation = getNationStaticInfo($city['nation']);
$query = "select name from general where no='{$city['gen1']}'"; // 태수 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($genresult);
$query = "select name from general where no='{$city['gen2']}'"; // 군사 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($genresult);
$query = "select name from general where no='{$city['gen3']}'"; // 시중 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult);
//태수, 군사, 시중
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
$gen2 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen2']);
$gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen3']);
if($city['trade'] == 0) {
$city['trade'] = "- ";
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg2>
<tr>
<td colspan=12 align=center style=color:"<?=newColor($nation['color'])?>"; bgcolor=<?=$nation['color']?>>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
</tr>
<tr>
<td align=center width=48 class=bg1>주민</td>
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
<td align=center width=48 class=bg1>농업</td>
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
<td align=center width=48 class=bg1>상업</td>
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
<td align=center width=48 class=bg1>치안</td>
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
<td align=center width=48 class=bg1>수비</td>
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
<td align=center width=48 class=bg1>성벽</td>
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
</tr>
<tr>
<td align=center class=bg1>민심</td>
<td align=center><?=$city['rate']?></td>
<td align=center class=bg1>시세</td>
<td align=center><?=$city['trade']?>%</td>
<td align=center class=bg1>인구</td>
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
<td align=center class=bg1>태수</td>
<td align=center><?=$gen1['name']??'-'?></td>
<td align=center class=bg1>군사</td>
<td align=center><?=$gen2['name']??'-'?></td>
<td align=center class=bg1>시중</td>
<td align=center><?=$gen3['name']??'-'?></td>
</tr>
<tr>
<td align=center class=bg1>장수</td>
<td colspan=11>
<?php
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr>
<td colspan=12 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}</td>
</tr>
<tr>
<td align=center width=48 id=bg1>주민</td>
<td align=center width=112>{$city['pop']}/{$city['pop2']}</td>
<td align=center width=48 id=bg1>농업</td>
<td align=center width=108>{$city['agri']}/{$city['agri2']}</td>
<td align=center width=48 id=bg1>상업</td>
<td align=center width=108>{$city['comm']}/{$city['comm2']}</td>
<td align=center width=48 id=bg1>치안</td>
<td align=center width=108>{$city['secu']}/{$city['secu2']}</td>
<td align=center width=48 id=bg1>수비</td>
<td align=center width=108>{$city['def']}/{$city['def2']}</td>
<td align=center width=48 id=bg1>성벽</td>
<td align=center width=108>{$city['wall']}/{$city['wall2']}</td>
</tr>
<tr>
<td align=center id=bg1>민심</td>
<td align=center>{$city['rate']}</td>
<td align=center id=bg1>시세</td>
<td align=center>{$city['trade']}%</td>
<td align=center id=bg1>인구</td>
<td align=center>".round($city['pop']/$city['pop2']*100, 2)." %</td>
<td align=center id=bg1>태수</td>
<td align=center>";echo $gen1['name']==''?"-":"{$gen1['name']}";echo "</td>
<td align=center id=bg1>군사</td>
<td align=center>";echo $gen2['name']==''?"-":"{$gen2['name']}";echo "</td>
<td align=center id=bg1>시중</td>
<td align=center>";echo $gen3['name']==''?"-":"{$gen3['name']}";echo "</td>
</tr>
<tr>
<td align=center id=bg1>장수</td>
<td colspan=11>";
$query = "select name from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
if($gencount == 0) echo "-";
@@ -208,11 +223,31 @@ echo "
$general = MYDB_fetch_array($genresult);
echo "{$general['name']}, ";
}
echo "
?>
</td>
</tr>
</table>";
</table>
<br>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<thead>
<tr>
<td width=64 align=center class=bg1>얼 굴</td>
<td width=98 align=center class=bg1>이 름</td>
<td width=48 align=center class=bg1>통솔</td>
<td width=48 align=center class=bg1>무력</td>
<td width=48 align=center class=bg1>지력</td>
<td width=78 align=center class=bg1>관 직</td>
<td width=28 align=center class=bg1>守</td>
<td width=78 align=center class=bg1>병 종</td>
<td width=78 align=center class=bg1>병 사</td>
<td width=48 align=center class=bg1>훈련</td>
<td width=48 align=center class=bg1>사기</td>
<td width=310 align=center class=bg1>명 령</td>
</tr></thead><tbody class='bg0' id='general_list'>
<?php
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
@@ -224,127 +259,116 @@ foreach(getAllNationStaticInfo() as $nation){
$nationlevel[$nation['nation']] = $nation['level'];
}
if($gencount != 0) {
echo "
<br>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width=64 align=center id=bg1>얼 굴</td>
<td width=98 align=center id=bg1>이 름</td>
<td width=48 align=center id=bg1>통솔</td>
<td width=48 align=center id=bg1>무력</td>
<td width=48 align=center id=bg1>지력</td>
<td width=78 align=center id=bg1>관 직</td>
<td width=28 align=center id=bg1>守</td>
<td width=78 align=center id=bg1>병 종</td>
<td width=78 align=center id=bg1>병 사</td>
<td width=48 align=center id=bg1>훈련</td>
<td width=48 align=center id=bg1>사기</td>
<td width=310 align=center id=bg1>명 령</td>
</tr>";
}
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nationInfo = getNationStaticInfo($general['nation']);
if($general['nation'] != 0 && $general['nation'] == $myNation['nation']){
$ourGeneral = true;
}
else{
$ourGeneral = false;
}
$isNPC = $general['npc']>1;
$wounded = $general['injury'];
$name = $general['name'];
$nameText = formatName($name, $general['npc']);
$leadership = $general['leader'];
$power = $general['power'];
$intel = $general['intel'];
$leadershipText = formatWounded($leadership, $general['injury']);
$powerText = formatWounded($power, $general['injury']);
$intelText = formatWounded($intel, $general['injury']);
$level = $general['level'];
$levelText = getLevel($general['level']);
if($general['level'] == 12) {
$lbonus = $nationlevel[$general['nation']] * 2;
$leadershipBonus = $nationInfo['level'] * 2;
} elseif($general['level'] >= 5) {
$lbonus = $nationlevel[$general['nation']];
$leadershipBonus = $nationInfo['level'];
} else {
$lbonus = 0;
$leadershipBonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
$leadershipBonusText = formatLeadershipBonus($leadershipBonus);
if($ourGeneral){
$defenceMode = $general['mode'];
$defenceModeText = formatDefenceMode($defenceMode);
$crewType = $general['crewtype'];
$crewTypeText = GameUnitConst::byId($crewType)->name;
$crew = $general['crew'];
$train = $general['train'];
$atmos = $general['atmos'];
}
else{
$defenceMode = 0;
$defenceModeText = '';
$crewType = 0;
$crewTypeText = '';
$crew = $general['crew'];
$train = -1;
$atmos = -1;
}
if($general['injury'] > 0) {
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
$leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>";
} else {
$leader = "{$general['leader']}{$lbonus}";
$power = "{$general['power']}";
$intel = "{$general['intel']}";
}
$nation = $general['nation'];
$nationName = $nationInfo['name'];
if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>{$general['name']}</font>"; }
elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>{$general['name']}</font>"; }
$imageTemp = GetImageURL($general['imgsvr']);
echo "
<tr>
<td align=center height=64></td>
<td align=center>{$general['name']}</td>
<td align=center>$leader</td>
<td align=center>$power</td>
<td align=center>$intel</td>
<td align=center>".getLevel($general['level'])."</td>";
//아국장수이거나 보는 사람이 운영자일때 보여줌
if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || $session->userGrade >= 5) {
switch($general['mode']) {
case 0: $mode = "×"; break;
case 1: $mode = "○"; break;
case 2: $mode = "◎"; break;
if($ourGeneral && !$isNPC){
$turnText = [];
foreach(getTurn($general, 1) as $turnRawIdx=>$turn){
$turnIdx = $turnRawIdx+1;
$turnText[] = "{$turnIdx} : $turn";
}
echo "
<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>";
if($general['npc'] >= 2) {
echo "
<td>NPC 장수";
} else {
echo "
<td>
<font size=1>";
$turn = getTurn($general, 1);
for($i=0; $i < 4; $i++) {
$k = $i+1;
echo "
&nbsp;&nbsp;$k : $turn[$i]<br>";
}
echo "
</font>";
}
} elseif($general['nation'] != 0) {
echo "
<td align=center>?</td>
<td align=center>?</td>
<td align=center>{$general['crew']}</td>
<td align=center>?</td>
<td align=center>?</td>
<td>【{$nationname[$general['nation']]}】 장수";
} else {
echo "
<td align=center>?</td>
<td align=center>?</td>
<td align=center>{$general['crew']}</td>
<td align=center>?</td>
<td align=center>?</td>
<td>&nbsp; 재 야";
$turnText = join('<br>', $turnText);
}
echo "
</td>
</tr>";
else{
$turnText = '';
}
echo $templates->render('cityGeneral', [
'ourGeneral'=>$ourGeneral,
'isNPC'=>$isNPC,
'wounded'=>$wounded,
'name'=>$name,
'nameText'=>$nameText,
'leadership'=>$leadership,
'leadershipText'=>$leadershipText,
'leadershipBonus'=>$leadershipBonus,
'leadershipBonusText'=>$leadershipBonusText,
'level'=>$level,
'levelText'=>$levelText,
'power'=>$power,
'powerText'=>$powerText,
'intel'=>$intel,
'intelText'=>$intelText,
'defenceMode'=>$defenceMode,
'defenceModeText'=>$defenceModeText,
'crewType'=>$crewType,
'crewTypeText'=>$crewTypeText,
'crew'=>$crew,
'train'=>$train,
'atmos'=>$atmos,
'nation'=>$nation,
'nationName'=>$nationName,
'turnText'=>$turnText
]);
}
?>
</tbody>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+43 -47
View File
@@ -48,27 +48,27 @@ if ($me['level'] >= 5) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내무부</title>
<title><?=UniqueConst::$serverName?>: 내무부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td>내 무 부<br><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
<tr>
<td width=100 align=center id=bg1>국 가 명</td>
<td width=50 align=center id=bg1>국력</td>
<td width=40 align=center id=bg1>장수</td>
<td width=40 align=center id=bg1>속령</td>
<td width=80 align=center id=bg1>상태</td>
<td width=60 align=center id=bg1>기간</td>
<td width=100 align=center id=bg1>종 료 시 점</td>
<td align=center id=bg1>비 고</td>
<td width=100 align=center class=bg1>국 가 명</td>
<td width=50 align=center class=bg1>국력</td>
<td width=40 align=center class=bg1>장수</td>
<td width=40 align=center class=bg1>속령</td>
<td width=80 align=center class=bg1>상태</td>
<td width=60 align=center class=bg1>기간</td>
<td width=100 align=center class=bg1>종 료 시 점</td>
<td align=center class=bg1>비 고</td>
</tr>
<?php
$query = "select year,month from game limit 1";
@@ -220,65 +220,62 @@ if ($budgetricediff > 0) {
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<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 id=bg1>국가 방침 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830; name=msg value='<?=$nation['msg']?>'><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=1000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=green>예 산 &amp; 정 책</td></tr>
<tr>
<td colspan=2>
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<?php
echo "
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr>
<td colspan=2 align=center id=bg1>자금 예산</td>
<td colspan=2 align=center id=bg1>병량 예산</td>
<td colspan=2 align=center class=bg1>자금 예산</td>
<td colspan=2 align=center class=bg1>병량 예산</td>
</tr>
<tr>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>{$nation['gold']}</td>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>{$nation['rice']}</td>
<td width=248 align=right class=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center><?=$nation['gold']?></td>
<td width=248 align=right class=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center><?=$nation['rice']?></td>
</tr>
<tr>
<td align=right id=bg1>단기수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$deadIncome</td>
<td align=right id=bg1>둔전수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincomeList[1]</td>
<td align=right class=bg1>단기수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$deadIncome?></td>
<td align=right class=bg1>둔전수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincomeList[1]?></td>
</tr>
<tr>
<td align=right id=bg1>세 금&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$goldincomeList[0]</td>
<td align=right id=bg1>세 곡&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincomeList[0]</td>
<td align=right class=bg1>세 금&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$goldincomeList[0]?></td>
<td align=right class=bg1>세 곡&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincomeList[0]?></td>
</tr>
<tr>
<td align=right id=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$goldincome / -$goldoutcome</td>
<td align=right id=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincome / -$riceoutcome</td>
<td align=right class=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$goldincome?> / -<?=$goldoutcome?></td>
<td align=right class=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincome?> / -<?=$riceoutcome?></td>
</tr>
<tr>
<td align=right id=bg1>국고 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
<td align=right id=bg1>병량 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center>{$budgetrice} ({$budgetricediff})</td>
</tr>";
?>
<td align=right class=bg1>국고 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center><?=$budgetgold?> (<?=$budgetgolddiff?>)</td>
<td align=right class=bg1>병량 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center><?=$budgetrice?> (<?=$budgetricediff?>)</td>
</tr>
<tr>
<td align=right id=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn?> name=btn value=세율></td>
<td align=right id=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급율></td>
</tr>
<tr>
<td align=right id=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['secretlimit']?>>년 <input type=<?=$btn?> name=btn value=기밀권한></td>
<td align=right id=bg1>임관&전쟁 변경 가능</td>
<td align=right class=bg1>임관&amp;전쟁 변경 가능</td>
<td align=center>무제한</td>
</tr>
<tr>
@@ -307,10 +304,9 @@ if ($nation['war'] == 0) {
<tr><td colspan=2 height=10></td></tr>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+81 -79
View File
@@ -16,7 +16,7 @@ $query = "select turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,map from general where owner='{$userID}'";
$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);
@@ -25,7 +25,6 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
$nationcount = MYDB_num_rows($result);
$nationnum = [];
$nationname = [];
$nationcolor = [];
$nationStr = "";
$powerStr = "";
@@ -41,7 +40,6 @@ for($i=0; $i < $nationcount; $i++) {
$nationnum[] = $nation['nation'];
$nationname[$nation['nation']] = $nation['name'];
$nationcolor[$nation['nation']] = $nation['color'];
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:{$nation['color']};>{$nation['name']}</font><br>";
$powerStr .= "국력 {$nation['power']}<br>";
@@ -49,13 +47,38 @@ for($i=0; $i < $nationcount; $i++) {
$cityStr .= "속령 $citycount<br>";
}
$realConflict = [];
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as list(
$cityID,
$cityName,
$rawConflict
))
{
$conflict = Json::decode($rawConflict);
if (count($conflict)<2) {
continue;
}
$sum = array_sum($conflict);
foreach ($conflict as $nationID=>$killnum) {
$conflict[$nationID] = ['killnum'=>$killnum];
$conflict[$nationID]['percent'] = round(100*$killnum / $sum, 1);
$conflict[$nationID]['name'] = $nationname[$nationID];
$conflict[$nationID]['color'] = getNationStaticInfo($nationID)['color'];
}
$realConflict[] = [$cityID, $cityName, $conflict];
};
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>중원정보</title>
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
@@ -72,7 +95,7 @@ $(function(){
});
</script>
<link href="css/normalize.css" rel="stylesheet">
<link href="../d_shared/common.css" red="stylesheet">
<link href="../d_shared/common.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<link href="css/map.css" rel="stylesheet">
@@ -96,7 +119,7 @@ if($nationcount != 0) {
for($i=0; $i < $nationcount; $i++) {
echo "
<td align=center width={$width} style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
<td align=center width={$width} style=background-color:".getNationStaticInfo($nationnum[$i])['color'].";color:".newColor(getNationStaticInfo($nationnum[$i])['color']).";>{$nationname[$nationnum[$i]]}</td>";
}
echo "
</tr>";
@@ -113,7 +136,7 @@ for($i=0; $i < $nationcount; $i++) {
}
echo "
<tr>
<td align=center style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
<td align=center style=background-color:".getNationStaticInfo($nationnum[$i])['color'].";color:".newColor(getNationStaticInfo($nationnum[$i])['color']).";>{$nationname[$nationnum[$i]]}</td>";
for($k=0; $k < $nationcount; $k++) {
if($i == $k) {
@@ -152,78 +175,58 @@ for($i=0; $i < $nationcount; $i++) {
?>
<tr><td colspan=<?=$nationcount+1?> align=center>불가침 : <font color=limegreen>@</font>, 통합 : <font color=cyan>○</font>, 합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
</table>
<?php
$query = "select city,name,conflict,conflict2 from city where conflict like '%|%'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
if($citycount != 0) {
echo "
<?php if ($realConflict) : ?>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=2 align=center bgcolor=magenta>분 쟁 현 황</td></tr>";
}
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result);
if($city['conflict'] != "") {
$nation = explode("|", $city['conflict']);
$killnum = explode("|", $city['conflict2']);
$seq = mySort($killnum); // 큰 순서대로 순서를 구한다.
$sum = 0;
for($k=0; $k < count($killnum); $k++) {
$sum += $killnum[$k];
}
echo "
<tr>
<td align=center width=48>{$city['name']}</td>
<td width=948>";
for($k=0; $k < count($nation); $k++) {
$per = 100*$killnum[$seq[$k]] / $sum;
$graph1 = $per / 100 * 798;
$per = round($per, 1);
echo "
<table border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width=98 align=right style=color:".newColor($nationcolor[$nation[$seq[$k]]]).";background-color:{$nationcolor[$nation[$seq[$k]]]};>{$nationname[$nation[$seq[$k]]]}&nbsp;</td>
<td width=48 align=right>{$per}%&nbsp;</td>
<td width=$graph1 style=background-color:{$nationcolor[$nation[$seq[$k]]]};></td>
<td width=*></td>
</tr>
</table>";
}
echo "
</td>
</tr>
<tr><td colspan=2 height=5 id=bg1></td></tr>";
}
}
function mySort($killnum) {
$seq = [];
for($i=0; $i < count($killnum); $i++) {
$seq[$i] = $i;
}
for($i=0; $i < count($killnum); $i++) {
$max = 0;
for($k=0; $k < count($killnum); $k++) {
if($max < $killnum[$k]) {
$max = $killnum[$k];
$index = $k;
}
}
$seq[$i] = $index;
$killnum[$index] = 0;
}
return $seq;
}
?>
<table
align='center'
width=1000
border=1
cellspacing=0
cellpadding=0
bordercolordark='gray'
bordercolorlight='black'
style='font-size:13px;word-break:break-all;'
class='bg0'
>
<tr><td colspan=2 align=center bgcolor=magenta>분 쟁 현 황</td></tr>
<?php foreach($realConflict as list($cityID, $cityName, $conflict)): ?>
<tr>
<td align=center width=48><?=$cityName?></td>
<td width=948>
<table
border=0
cellspacing=0
cellpadding=0
bordercolordark='gray'
bordercolorlight='black'
style='font-size:13px;word-break:break-all;width:100%;'
class='bg0'
>
<?php foreach($conflict as $item): ?>
<tr>
<td
width=98
align=right
style='color:<?=newColor($item['color'])?>;background-color:<?=$item['color']?>;'
><?=$item['name']?>&nbsp;</td>
<td width=48 align=right><?=(float)$item['percent']?> %&nbsp;</td>
<td width=*><div
style='display:inline-block;width:<?=$item['percent']?>%;background-color:<?=$item['color']?>;'
>&nbsp;</div></td>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php endforeach; ?>
<tr><td colspan=2 height=5 id=bg1></td></tr>
</table>
<?php endif; ?>
<br>
<table class="bg0" align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style="font-size:13px;word-break:break-all;">
<tr>
@@ -233,10 +236,10 @@ function mySort($killnum) {
<td width=698 height=420>
<?=getMapHtml()?>
</td>
<td width=98 valign=top><?=$nationStr?></td>
<td width=101 valign=top><?=$nationStr?></td>
<td width=78 valign=top><?=$powerStr?></td>
<td width=58 valign=top><?=$genStr?></td>
<td width=58 valign=top><?=$cityStr?></td>
<td width=55 valign=top><?=$cityStr?></td>
</tr>
</table>
<br>
@@ -245,6 +248,5 @@ function mySort($killnum) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+18 -14
View File
@@ -3,6 +3,14 @@ namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 7);
if ($type <= 0 || $type > 8) {
$type = 7;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -35,9 +43,6 @@ if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretli
exit();
}
if ($type == 0) {
$type = 7;
}
$sel = [];
$sel[$type] = "selected";
@@ -49,7 +54,7 @@ $sel[$type] = "selected";
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>암행부</title>
<title><?=UniqueConst::$serverName?>: 암행부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -60,14 +65,14 @@ $sel[$type] = "selected";
<tr><td>암 행 부<br><?=closeButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1]?> value=1>자금</option>
<option <?=$sel[2]?> value=2>군량</option>
<option <?=$sel[3]?> value=3>도시</option>
<option <?=$sel[4]?> value=4>병종</option>
<option <?=$sel[5]?> value=5>병사</option>
<option <?=$sel[6]?> value=6>삭제턴</option>
<option <?=$sel[7]?> value=7>턴</option>
<option <?=$sel[8]?> value=8>부대</option>
<option <?=$sel[1]??''?> value=1>자금</option>
<option <?=$sel[2]??''?> value=2>군량</option>
<option <?=$sel[3]??''?> value=3>도시</option>
<option <?=$sel[4]??''?> value=4>병종</option>
<option <?=$sel[5]??''?> value=5>병사</option>
<option <?=$sel[6]??''?> value=6>삭제턴</option>
<option <?=$sel[7]??''?> value=7>턴</option>
<option <?=$sel[8]??''?> value=8>부대</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
@@ -116,7 +121,7 @@ echo"
for ($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$city = CityConst::byID($general['city'])->name;
$troop = $troopName[$general['troop']] == "" ? "-" : $troopName[$general['troop']];
$troop = $troopName[$general['troop']]??'-';
if ($general['level'] == 12) {
$lbonus = $nation['level'] * 2;
@@ -205,6 +210,5 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+18 -14
View File
@@ -30,7 +30,7 @@ if($meLevel == 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>인사부</title>
<title><?=UniqueConst::$serverName?>: 인사부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript">
@@ -81,18 +81,18 @@ echo "
";
for($i=12; $i >= $lv; $i-=2) {
$i1 = $i; $i2 = $i - 1;
$imageTemp1 = GetImageURL($level[$i1]['imgsvr']);
$imageTemp2 = GetImageURL($level[$i2]['imgsvr']);
echo "
$imageTemp1 = GetImageURL($level[$i1]['imgsvr']??0);
$imageTemp2 = GetImageURL($level[$i2]['imgsvr']??0);
?>
<tr>
<td width=98 align=center id=bg1><font size=4>".getLevel($i1, $nation['level'])."</font></td>
<td width=64 height=64 background={$imageTemp1}/{$level[$i1]['picture']}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i1]['name']==''?"-":$level[$i1]['name']; echo " ({$level[$i1]['belong']}년)</font></td>
<td width=98 align=center id=bg1><font size=4>".getLevel($i2, $nation['level'])."</font></td>
<td width=64 height=64 background={$imageTemp2}/{$level[$i2]['picture']}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i2]['name']==''?"-":$level[$i2]['name']; echo " ({$level[$i2]['belong']}년)</font></td>
<td width=98 align=center id=bg1><font size=4><?=getLevel($i1, $nation['level'])?></font></td>
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp1?>/<?=$level[$i1]['picture']??'default.jpg'?>");background-size:64px;'></td>
<td width=332><font size=4><?=$level[$i1]['name']??'-'?>(<?=$level[$i1]['belong']??'-'?>년)</font></td>
<td width=98 align=center id=bg1><font size=4><?=getLevel($i2, $nation['level'])?></font></td>
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp2?>/<?=$level[$i2]['picture']??'default.jpg'?>");background-size:64px;'></td>
<td width=332><font size=4><?=$level[$i2]['name']??'-'?>(<?=$level[$i2]['belong']??'-'?>년)</font></td>
</tr>
";
<?php
}
echo "
@@ -205,7 +205,10 @@ if($meLevel >= 5 && $nation['l11set'] == 0) {
$query = "select name,city from general where nation='{$me['nation']}' and level='11'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
if($general){
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
}
}
echo "
</td>
@@ -257,7 +260,9 @@ for($i=10; $i >= $lv; $i--) {
$query = "select name,city from general where nation='{$me['nation']}' and level={$i}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
if($general){
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
}
}
echo "</td></form>";
if($i % 2 == 1) { echo "</tr>"; }
@@ -504,6 +509,5 @@ for($j=0; $j < $citycount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+35 -29
View File
@@ -3,6 +3,14 @@ namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 10);
if ($type <= 0 || $type > 12) {
$type = 10;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -21,9 +29,6 @@ if ($me['level'] == 0) {
exit();
}
if ($type == 0) {
$type = 10;
}
$sel = [$type => "selected"];
?>
@@ -32,7 +37,7 @@ $sel = [$type => "selected"];
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력도시</title>
<title><?=UniqueConst::$serverName?>: 세력도시</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -43,18 +48,18 @@ $sel = [$type => "selected"];
<tr><td>세 력 도 시<br><?=backButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1]?> value=1>기본</option>
<option <?=$sel[2]?> value=2>인구</option>
<option <?=$sel[3]?> value=3>인구율</option>
<option <?=$sel[4]?> value=4>민심</option>
<option <?=$sel[5]?> value=5>농업</option>
<option <?=$sel[6]?> value=6>상업</option>
<option <?=$sel[7]?> value=7>치안</option>
<option <?=$sel[8]?> value=8>수비</option>
<option <?=$sel[9]?> value=9>성벽</option>
<option <?=$sel[10]?> value=10>시세</option>
<option <?=$sel[11]?> value=11>지역</option>
<option <?=$sel[12]?> value=12>규모</option>
<option <?=$sel[1]??''?> value=1>기본</option>
<option <?=$sel[2]??''?> value=2>인구</option>
<option <?=$sel[3]??''?> value=3>인구율</option>
<option <?=$sel[4]??''?> value=4>민심</option>
<option <?=$sel[5]??''?> value=5>농업</option>
<option <?=$sel[6]??''?> value=6>상업</option>
<option <?=$sel[7]??''?> value=7>치안</option>
<option <?=$sel[8]??''?> value=8>수비</option>
<option <?=$sel[9]??''?> value=9>성벽</option>
<option <?=$sel[10]??''?> value=10>시세</option>
<option <?=$sel[11]??''?> value=11>지역</option>
<option <?=$sel[12]??''?> value=12>규모</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
@@ -66,19 +71,21 @@ $me = MYDB_fetch_array($result);
$nation = getNationStaticInfo($me['nation']); //국가정보
$query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}'";
switch ($type) {
case 1: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}'"; break;
case 2: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by pop desc"; break;
case 3: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by poprate desc"; break;
case 4: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by rate desc"; break;
case 5: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by agri desc"; break;
case 6: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by comm desc"; break;
case 7: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by secu desc"; break;
case 8: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by def desc"; break;
case 9: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by wall desc"; break;
case 10: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by trade desc"; break;
case 11: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by region,level desc"; break;
case 12: $query = "select *,pop/pop2 as poprate from city where nation='{$me['nation']}' order by level desc, region"; break;
case 1: break;
case 2: $query .= " order by pop desc"; break;
case 3: $query .= " order by poprate desc"; break;
case 4: $query .= " order by rate desc"; break;
case 5: $query .= " order by agri desc"; break;
case 6: $query .= " order by comm desc"; break;
case 7: $query .= " order by secu desc"; break;
case 8: $query .= " order by def desc"; break;
case 9: $query .= " order by wall desc"; break;
case 10: $query .= " order by trade desc"; break;
case 11: $query .= " order by region,level desc"; break;
case 12: $query .= " order by level desc, region"; break;
}
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$citycount = MYDB_num_rows($cityresult);
@@ -185,7 +192,6 @@ for ($j=0; $j < $citycount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+64 -38
View File
@@ -3,6 +3,14 @@ namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 1);
if($type <= 0 || $type > 15) {
$type = 1;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -21,10 +29,6 @@ if($me['level'] == 0) {
exit();
}
if($type == 0) {
$type = 1;
}
$sel = [$type => "selected"];
?>
@@ -33,7 +37,7 @@ $sel = [$type => "selected"];
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력장수</title>
<title><?=UniqueConst::$serverName?>: 세력장수</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -44,21 +48,21 @@ $sel = [$type => "selected"];
<tr><td>세 력 장 수<br><?=backButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1]?> value=1>관직</option>
<option <?=$sel[2]?> value=2>계급</option>
<option <?=$sel[3]?> value=3>명성</option>
<option <?=$sel[4]?> value=4>통솔</option>
<option <?=$sel[5]?> value=5>무력</option>
<option <?=$sel[6]?> value=6>지력</option>
<option <?=$sel[7]?> value=7>자금</option>
<option <?=$sel[8]?> value=8>군량</option>
<option <?=$sel[9]?> value=9>병사</option>
<option <?=$sel[10]?> value=10>벌점</option>
<option <?=$sel[11]?> value=11>성격</option>
<option <?=$sel[12]?> value=12>내특</option>
<option <?=$sel[13]?> value=13>전특</option>
<option <?=$sel[14]?> value=14>사관</option>
<option <?=$sel[15]?> value=15>NPC</option>
<option <?=$sel[1]??''?> value=1>관직</option>
<option <?=$sel[2]??''?> value=2>계급</option>
<option <?=$sel[3]??''?> value=3>명성</option>
<option <?=$sel[4]??''?> value=4>통솔</option>
<option <?=$sel[5]??''?> value=5>무력</option>
<option <?=$sel[6]??''?> value=6>지력</option>
<option <?=$sel[7]??''?> value=7>자금</option>
<option <?=$sel[8]??''?> value=8>군량</option>
<option <?=$sel[9]??''?> value=9>병사</option>
<option <?=$sel[10]??''?> value=10>벌점</option>
<option <?=$sel[11]??''?> value=11>성격</option>
<option <?=$sel[12]??''?> value=12>내특</option>
<option <?=$sel[13]??''?> value=13>전특</option>
<option <?=$sel[14]??''?> value=14>사관</option>
<option <?=$sel[15]??''?> value=15>NPC</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
@@ -66,23 +70,46 @@ $sel = [$type => "selected"];
<?php
$nationLevel = DB::db()->queryFirstField('select level from nation where nation = %i', $me['nation']);
$orderByText = '';//FIXME: 쿼리 재작성
switch($type) {
case 1: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by level desc"; break;
case 2: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by dedication desc"; break;
case 3: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by experience desc"; break;
case 4: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by leader desc"; break;
case 5: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by power desc"; break;
case 6: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by intel desc"; break;
case 7: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by gold desc"; break;
case 8: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by rice desc"; break;
case 9: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by crew desc"; break;
case 10: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by connect desc"; break;
case 11: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by personal"; break;
case 12: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by special desc"; break;
case 13: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by special2 desc"; break;
case 14: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by belong desc"; break;
case 15: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='{$me['nation']}' order by npc desc"; break;
case 1: $orderByText = " order by level desc"; break;
case 2: $orderByText = " order by dedication desc"; break;
case 3: $orderByText = " order by experience desc"; break;
case 4: $orderByText = " order by leader desc"; break;
case 5: $orderByText = " order by power desc"; break;
case 6: $orderByText = " order by intel desc"; break;
case 7: $orderByText = " order by gold desc"; break;
case 8: $orderByText = " order by rice desc"; break;
case 9: $orderByText = " order by crew desc"; break;
case 10: $orderByText = " order by connect desc"; break;
case 11: $orderByText = " order by personal"; break;
case 12: $orderByText = " order by special desc"; break;
case 13: $orderByText = " order by special2 desc"; break;
case 14: $orderByText = " order by belong desc"; break;
case 15: $orderByText = " order by npc desc"; break;
}
$query =
"select
npc,
special,
special2,
personal,
picture,
imgsvr,
name,
level,
dedication,
experience,
injury,
leader,
power,
intel,
gold,
rice,
belong,
connect,
killturn
from general where nation='{$me['nation']}' ".$orderByText;
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
@@ -141,9 +168,9 @@ for($j=0; $j < $gencount; $j++) {
$imageTemp = GetImageURL($general['imgsvr']);
echo "
<tr>
<td align=center background={$imageTemp}/{$general['picture']} height=64></td>
<td align=center style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;' height=64></td>
<td align=center>$name</td>
<td align=center>"; echo getLevel($general['level'], $nation['level']); echo "</td>
<td align=center>"; echo getLevel($general['level'], $nationLevel); echo "</td>
<td align=center>".getDed($general['dedication'])."</td>
<td align=center>".getHonor($general['experience'])."</td>
<td align=center>".getBill($general['dedication'])."</td>
@@ -168,7 +195,6 @@ for($j=0; $j < $gencount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -26,7 +26,7 @@ if($me['level'] == 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력정보</title>
<title><?=UniqueConst::$serverName?>: 세력정보</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -160,7 +160,6 @@ echo"
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+21 -14
View File
@@ -3,6 +3,21 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$mode = Util::getReq('mode', 'int', 2);
$tnmt = Util::getReq('tnmt', 'int', 1);
extractMissingPostToGlobals();
if($mode < 0 || $mode > 2){
$mode = 2;
}
if($tnmt < 0 || $tnmt > 1){
$tnmt = 1;
}
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -31,13 +46,12 @@ if ($btn == "설정저장" && $me['myset'] > 0) {
$db->update('general', [
'myset'=>$db->sqleval('myset-1'),
'map'=>$map,
'mode'=>$mode,
'tnmt'=>$tnmt
], 'owner=%i', $userID);
}
$query = "select no,map,mode,tnmt,myset from general where owner='{$userID}'";
$query = "select no,mode,tnmt,myset from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
@@ -46,14 +60,13 @@ $me = MYDB_fetch_array($result);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내정보</title>
<link href="../d_shared/common.css" red="stylesheet">
<title><?=UniqueConst::$serverName?>: 내정보</title>
<link href="../d_shared/common.css" rel="stylesheet">
<link rel=stylesheet href="css/common.css">
<script type="text/javascript">
function go(type) {
if(type == 0){
//location.replace('c_vacation.php');
console.log('c_vacation.php');//TODO:debug all and replace
location.replace('c_vacation.php');
}
}
</script>
@@ -72,11 +85,6 @@ function go(type) {
</td>
<td width=50% valign=top>
<form name=form1 action=b_myPage.php method=post>
&nbsp;&nbsp;&nbsp;&nbsp;지도수준 【
<input type=radio name=map value=0 <?=$me['map']==0?"checked":""; ?>>상세
<input type=radio name=map value=1 <?=$me['map']==1?"checked":""; ?>>간단
<input type=radio name=map value=2 <?=$me['map']==2?"checked":""; ?>>생략
】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;토너먼트 【
<input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
@@ -87,11 +95,11 @@ function go(type) {
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160;height:30;font-size:13px; value=설정저장><br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
</form>
&nbsp;&nbsp;&nbsp;&nbsp;휴 가 신 청<br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160;height:30;font-size:13px; value=휴가신청 onclick='go(0)'>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=휴가신청 onclick='go(0)'>
</td>
</tr>
<tr>
@@ -123,7 +131,6 @@ function go(type) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -4
View File
@@ -20,7 +20,7 @@ $me = MYDB_fetch_array($result);
<!DOCTYPE html>
<html>
<head>
<title>회의실</title>
<title><?=UniqueConst::$serverName?>: 회의실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -32,11 +32,11 @@ $me = MYDB_fetch_array($result);
<tr><td>회 의 실<br><?=backButton()?></td></tr>
<form name=form1 method=post action=c_nationboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830;>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998;height:200;></textarea><br>
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
@@ -64,7 +64,6 @@ for($i=0; $i < 20; $i++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -4
View File
@@ -15,7 +15,7 @@ increaseRefresh("국법", 1);
<!DOCTYPE html>
<html>
<head>
<title>국법</title>
<title><?=UniqueConst::$serverName?>: 국법</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -39,12 +39,12 @@ $nation = MYDB_fetch_array($result);
if($me['level'] >= 5) {
echo "
<form name=form1 method=post action=c_nationrule.php>
<textarea name=msg style=color:white;background-color:black;width:998;height:500;>{$nation['rule']}</textarea><br>
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px;>{$nation['rule']}</textarea><br>
<input type=submit value=저장하기>
</form>";
} else {
echo "
<textarea name=msg style=color:white;background-color:black;width:998;height:500; readonly>{$nation['rule']}</textarea><br>";
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px; readonly>{$nation['rule']}</textarea><br>";
}
?>
@@ -52,7 +52,6 @@ if($me['level'] >= 5) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+56 -25
View File
@@ -28,6 +28,7 @@ if ($con >= 2) {
}
switch ($admin['tnmt_type']) {
default: throw new \RuntimeException('invalid tnmt_type');
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
@@ -42,12 +43,12 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>토너먼트</title>
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
<style>
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
body { color:white; background-color:black; border-width:1px; border-color:gray; }
table { font-family:'맑은 고딕'; }
font { font-family:'맑은 고딕'; }
input { font-family:'맑은 고딕'; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
@@ -82,7 +83,7 @@ if ($session->userGrade >= 5) {
}
if ($admin['tournament'] == 0) {
echo "
?>
<select name=auto size=1 style=color:white;background-color:black;>
<option style=color:white; value=0>수동진행</option>
<option style=color:white; value=1>12분 05일</option>
@@ -101,18 +102,19 @@ if ($session->userGrade >= 5) {
</select>
<input type=submit name=btn value='개최'>
<select name=trig size=1 style=color:white;background-color:black;>
<option style=color:white; value=0 {$sel[0]}>수동진행</option>
<option style=color:white; value=1 {$sel[1]}>12분 05일</option>
<option style=color:white; value=2 {$sel[2]}>07분 10시</option>
<option style=color:white; value=3 {$sel[3]}>03분 04시</option>
<option style=color:white; value=4 {$sel[4]}>01분 82분</option>
<option style=color:white; value=5 {$sel[5]}>30초 41분</option>
<option style=color:white; value=6 {$sel[6]}>15초 21분</option>
<option style=color:white; value=7 {$sel[7]}>05초 07분</option>
<option style=color:white; value=0 <?=$sel[0]??''?>>수동진행</option>
<option style=color:white; value=1 <?=$sel[1]??''?>>12분 05일</option>
<option style=color:white; value=2 <?=$sel[2]??''?>>07분 10시</option>
<option style=color:white; value=3 <?=$sel[3]??''?>>03분 04시</option>
<option style=color:white; value=4 <?=$sel[4]??''?>>01분 82분</option>
<option style=color:white; value=5 <?=$sel[5]??''?>>30초 41분</option>
<option style=color:white; value=6 <?=$sel[6]??''?>>15초 21분</option>
<option style=color:white; value=7 <?=$sel[7]??''?>>05초 07분</option>
</select>
<input type=submit name=btn value='자동개최설정'>
<input type=submit name=btn value='포상'>
<input type=submit name=btn value='회수'>";
<input type=submit name=btn value='회수'>
<?php
} else {
echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>";
}
@@ -174,10 +176,16 @@ if ($session->userGrade >= 5) {
$str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime();
if($str2){
$str2 = ', '.$str2;
}
$str3 = getTournamentTerm();
if($str3){
$str3 = ', '.$str3;
}
?>
<tr><td colspan=8>운영자 메세지 : <font color=orange size=5><?=$admin['tnmt_msg']?></font></td></tr>
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
<tr><td colspan=8 align=center id=bg2><font color=magenta size=5>16강 승자전</font></td></tr>
<tr><td height=10 colspan=8 align=center></td></tr>
<?php
@@ -191,7 +199,11 @@ echo "
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
for ($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result) ?? [
'name'=>'',
'npc'=>0,
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -214,8 +226,15 @@ for ($i=0; $i < 1; $i++) {
$cent[$i] = "<font color=white>";
}
$line = [];
$gen = [];
for ($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result);
//FIXME: 다시 작성. null인 경우엔 어쩌려고?
$general = MYDB_fetch_array($result) ?? [
'name'=>'',
'npc'=>0,
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -256,7 +275,11 @@ for ($i=0; $i < 2; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result) ?? [
'name'=>'',
'npc'=>0,
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -297,7 +320,11 @@ for ($i=0; $i < 4; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result) ?? [
'name'=>'',
'npc'=>0,
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -338,7 +365,11 @@ for ($i=0; $i < 8; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result) ?? [
'name'=>'',
'npc'=>0,
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -377,10 +408,11 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "
$betting = MYDB_fetch_array($result);
$bet = [];
for ($i=0; $i < 16; $i++) {
$bet[$i] = @round($betting['bet'] / $betting["bet{$i}"], 2);
if ($bet[$i] == 0) {
$bet[$i] = "∞";
if($betting['bet'] == 0){
$bet[$i] = '∞';
continue;
}
$bet[$i] = round($betting['bet'] / $betting["bet{$i}"], 2);
}
echo "
@@ -478,6 +510,5 @@ if ($admin['tournament'] == 2 || $admin['tournament'] == 3) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+8 -7
View File
@@ -25,7 +25,7 @@ $troopcount = MYDB_num_rows($result);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>부대편성</title>
<title><?=UniqueConst::$serverName?>: 부대편성</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -82,7 +82,7 @@ for($i=0; $i < $troopcount; $i++) {
<tr>
<td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop['troop']}'></td>
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td>
<td rowspan=2>$turn</td>
</tr>
@@ -93,7 +93,7 @@ for($i=0; $i < $troopcount; $i++) {
<tr>
<td align=center rowspan=2>&nbsp;</td>
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td>
<td rowspan=2>";
@@ -102,7 +102,7 @@ for($i=0; $i < $troopcount; $i++) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genresult);
echo "
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:98;>";
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:98px;>";
for($k=0; $k < $genCount; $k++) {
$general = MYDB_fetch_array($genresult);
echo "
@@ -110,7 +110,7 @@ for($i=0; $i < $troopcount; $i++) {
}
echo "
</select><br>
<input type=submit name=btn value='부 대 추 방' style=width:100;height:25;>";
<input type=submit name=btn value='부 대 추 방' style=width:100px;height:25px;>";
} else {
echo $turn;
}
@@ -123,7 +123,9 @@ for($i=0; $i < $troopcount; $i++) {
}
}
if($me['troop'] == 0) {
if ($troopcount == 0) {
}
else if($me['troop'] == 0) {
echo"
<input type=submit name=btn value='부 대 가 입'>";
} else {
@@ -158,7 +160,6 @@ echo "
<tr><td><?=banner()?> </td></tr>
</table>
</form>
<?php PrintElapsedTime(); ?>
</body>
</html>
+6
View File
@@ -15,6 +15,7 @@ $v->rule('integer', [
'sel'
]);
$btn = Util::getReq('btn');
$amount = Util::getReq('amount', 'int');
$cost = Util::getReq('cost', 'int');
$topv = Util::getReq('topv', 'int');
@@ -23,6 +24,11 @@ $term = Util::getReq('term', 'int');
$stuff = Util::getReq('stuff', 'int');
$sel = Util::getReq('sel', 'int');
$msg = '';
$msg2 = '';
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
+6
View File
@@ -7,6 +7,7 @@ include "func.php";
// $btn0~15, $gold0~15
//FIXME: 으악!!!!! 왜?! idx를 지정하고 gold를 지정하라고!
$betTarget = -1;
$betGold = -1;
for($i=0;$i<16;$i++){
@@ -21,6 +22,11 @@ for($i=0;$i<16;$i++){
}
}
if($betGold == -1){
extractMissingPostToGlobals();
}
if($betTarget < 0 || $betGold < 10 || $betGold > 1000){
header('Location: b_betting.php');
exit();
+38 -39
View File
@@ -6,10 +6,12 @@ include "func.php";
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num');
$num = Util::getReq('num', 'int');
$reply = Util::getReq('reply');
// $title, $msg, $num
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -17,45 +19,42 @@ $userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($me['nation']);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation['coreindex'] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='{$me['no']}',coreboard{$num}_when='$date' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set coreindex='$num' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set coreboard{$num}='$newmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
if (getBlockLevel() == 1 || getBlockLevel() == 3) {
header('location:b_chiefboard.php');
die();
}
//echo "<script>location.replace('b_chiefboard.php');</script>";
echo 'b_chiefboard.php';//TODO:debug all and replace
?>
$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);
</body>
</html>
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($me['nation']);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation['coreindex'] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='{$me['no']}',coreboard{$num}_when='$date' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set coreindex='$num' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set coreboard{$num}='$newmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
header('location:b_chiefboard.php');
+30 -27
View File
@@ -12,6 +12,8 @@ $rate = Util::getReq('rate', 'int');
$bill = Util::getReq('bill', 'int');
$secretlimit = Util::getReq('secretlimit', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -23,53 +25,54 @@ $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);
$btn = $_POST['btn'];
//내가 수뇌부이어야함
if($me['level'] < 5) {
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php';//TODO:debug all and replace
header('location:b_myBossInfo.php');
exit();
}
if($btn == "국가방침") {
$msg = BadTag2Code(addslashes(SQ2DQ($msg)));
$query = "update nation set msg='$msg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$msg == mb_substr($msg, 0, 1000);
//$msg = StringUtil::
$db->update('nation', [
'msg'=>BadTag2Code($msg)
], 'nation=%i',$me['nation']);
} elseif($btn == "임관권유") {
$scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg)));
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$scoutmsg == mb_substr($msg, 0, 500);
$db->update('nation', [
'scoutmsg'=>BadTag2Code($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),"");
} elseif($btn == "지급율") {
if($bill < 20) { $bill = 20; }
if($bill > 200) { $bill = 200; }
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bill = Util::valueFit($bill, 20, 200);
$db->update('nation', [
'bill'=>$bill
], 'nation=%i',$me['nation']);
} elseif($btn == "기밀권한") {
if($secretlimit < 1) { $secretlimit = 1; }
if($secretlimit > 99) { $secretlimit = 99; }
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$secretlimit = Util::valueFit($secretlimit, 1, 99);
$db->update('nation', [
'secretlimit'=>$secretlimit
], 'nation=%i',$me['nation']);
} elseif($btn == "임관 금지") {
$query = "update nation set scout='1' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'scout'=>1
], 'nation=%i',$me['nation']);
} elseif($btn == "임관 허가") {
$query = "update nation set scout='0' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'scout'=>0
], 'nation=%i',$me['nation']);
} elseif($btn == "전쟁 금지") {
$query = "update nation set war='1' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'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),"");
}
//echo "<script>location.replace('b_dipcenter.php');</script>";
echo 'b_dipcenter.php';//TODO:debug all and replace
header('location:b_dipcenter.php');
+28 -20
View File
@@ -14,6 +14,8 @@ $double = Util::getReq('double', 'int', 0);
$third = Util::getReq('third', 'int', 0);
$fourth = Util::getReq('fourth', 'int', 0);
extractMissingPostToGlobals();
if(!$turn){
$turn = [0];
}
@@ -33,9 +35,6 @@ if($command < 0) { $command = 0; }
if($double < 0) { $double = 0; }
if($third < 0) { $third = 0; }
if($fourth < 0) { $fourth = 0; }
$double = Util::round($double);
$third = Util::round($third);
$fourth = Util::round($fourth);
if($command > 99) { $command = 0; }
if($double > 9999) { $double = 9999; }
if($third > 9999) { $third = 9999; }
@@ -61,9 +60,13 @@ if($command == 46) {
$query['turn'.$turnIdx] = $comStr;
}
$db->update('general', $query, 'owner=%i', $userID);
header('Location:index.php');
header('Location:./');
die();
}
//통합제의
} elseif($command == 53) {
if($command == 53) {
$query = "select nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -87,10 +90,12 @@ if($command == 46) {
$query = "update nation set {$str} where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//echo "<script>location.replace('b_chiefcenter.php');</script>";
echo 'b_chiefcenter.php';//TODO:debug all and replace
header('location:b_chiefcenter.php');
die();
}
//불가침
} elseif($command == 61) {
if($command == 61) {
$query = "select nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -113,13 +118,16 @@ if($command == 46) {
$query = "update nation set {$str} where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//echo "<script>location.replace('b_chiefcenter.php');</script>";
echo 'b_chiefcenter.php';//TODO:debug all and replace
header('location:b_chiefcenter.php');
die();
}
//포상, 몰수, 발령, 항복권고, 원조
//선전포고, 종전, 파기, 초토화, 천도, 증축, 감축
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
//국기변경
} elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
if($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
$query = "select no,nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -135,15 +143,15 @@ if($command == 46) {
$query = "update nation set {$str} where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//echo "<script>location.replace('b_chiefcenter.php');</script>";
echo 'b_chiefcenter.php';//TODO:debug all and replace
} else {
$query = [];
foreach($turn as $turnIdx){
$query['turn'.$turnIdx] = $comStr;
}
$db->update('general', $query, 'owner=%i', $userID);
header('Location:index.php');
header('location:b_chiefcenter.php');
die();
}
//일반 턴
$query = [];
foreach($turn as $turnIdx){
$query['turn'.$turnIdx] = $comStr;
}
$db->update('general', $query, 'owner=%i', $userID);
header('Location:./');
+61 -20
View File
@@ -11,6 +11,8 @@ $genlist = Util::getReq('genlist', 'int');
$outlist = Util::getReq('outlist', 'int');
$citylist = Util::getReq('citylist', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -18,7 +20,7 @@ $userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
$query = "select startyear,year,month from game limit 1";
$query = "select startyear,year,month,scenario from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
@@ -33,20 +35,28 @@ $ruler = MYDB_fetch_array($result);
//수뇌가 아니면 아무것도 할 수 없음
if($meLevel < 5){
echo 'b_myBossInfo.php';//TODO:debug all and replace
header('location:b_myBossInfo.php');
exit();
}
if($btn == "임명") {
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($genlist !== 0){
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if(!$general){
header('location:b_myBossInfo.php');
exit();
}
}
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) {
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php';//TODO:debug all and replace
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
header('location:b_myBossInfo.php');
exit();
}
} elseif($btn == "추방") {
@@ -54,22 +64,26 @@ if($btn == "임명") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if(!$general){
header('location:b_myBossInfo.php');
exit();
}
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) {
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php';//TODO:debug all and replace
header('location:b_myBossInfo.php');
exit();
}
}
//나와 대상 장수는 국가가 같아야 함
if($me['nation'] != $general['nation']){
echo 'b_myBossInfo.php';//TODO:debug all and replace
if($genlist != 0 && $me['nation'] != $general['nation']){
header('location:b_myBossInfo.php');
exit();
}
if($btn == "추방") {
$query = "select name,l{$meLevel}set,chemi from nation where nation='{$me['nation']}'";
$query = "select name,l{$meLevel}set,chemi,color from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -154,7 +168,24 @@ if($btn == "추방") {
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
}
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$str,
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
//국가 기술력 그대로
@@ -188,7 +219,11 @@ if($btn == "추방") {
pushGenLog($general, $log);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
}
} elseif($btn == "임명" && $level >= 5 && $level <= 11) {
header('location:b_myBossInfo.php');
die();
}
if($btn == "임명" && $level >= 5 && $level <= 11) {
$query = "select l{$level}set,level,chemi from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -235,7 +270,12 @@ if($btn == "추방") {
}
}
}
} elseif($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
header('location:b_myBossInfo.php');
die();
}
if($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
switch($level) {
case 4: $lv = 1; break;
case 3: $lv = 2; break;
@@ -246,8 +286,7 @@ if($btn == "추방") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
if(!$city){
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php';//TODO:debug all and replace
header('location:b_myBossInfo.php');
die();
}
$oldlist = $city["gen{$lv}"];
@@ -283,9 +322,11 @@ if($btn == "추방") {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
header('location:b_myBossInfo.php');
die();
}
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php';//TODO:debug all and replace
header('location:b_myBossInfo.php');
+4 -8
View File
@@ -7,6 +7,9 @@ include "func.php";
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num', 'int');
$reply = Util::getReq('reply');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -50,11 +53,4 @@ if(getBlockLevel() != 1 && getBlockLevel() != 3) {
}
}
//echo "<script>location.replace('b_nationboard.php');</script>";
echo 'b_nationboard.php';//TODO:debug all and replace
?>
</body>
</html>
header('location:b_nationboard.php');
+4 -3
View File
@@ -4,6 +4,9 @@ namespace sammo;
include "lib.php";
include "func.php";
// $msg
$msg = Util::getReq('msg');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -21,6 +24,4 @@ $msg = addslashes(SQ2DQ($msg));
$query = "update nation set rule='$msg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_nationrule.php');</script>";
echo 'b_nationrule.php';//TODO:debug all and replace
header('location:b_nationrule.php');
+98 -36
View File
@@ -4,12 +4,17 @@ namespace sammo;
include "lib.php";
include "func.php";
// $btn, $msg
$gen = Util::getReq('gen', 'int');
$sel = Util::getReq('sel', 'int');
$btn = Util::getReq('btn');
$msg = Util::getReq('msg');
//관리자용
$auto = Util::getReq('gen', 'int');
$auto = Util::getReq('auto', 'int');
$type = Util::getReq('type', 'int');
$gen = Util::getReq('gen', 'int');
$sel = Util::getReq('sel', 'int');
$trig = Util::getReq('trig', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
@@ -33,19 +38,71 @@ case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break;
case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
}
if($me['tournament'] == 1 && $session->userGrade < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
if($btn == '참가') {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='{$me['no']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($btn == "자동개최설정" && $session->userGrade >= 5) {
//{$admin['develcost']}원 참가비
if($general['gold'] < $admin['develcost']) {
header('location:b_tournament.php');
exit(1);
}
$general['gold'] -= $admin['develcost'];
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
$occupied = [];
for($i=0; $i < $grpCount; $i++) {
$grp = MYDB_fetch_array($result);
$occupied[$grp['grp']] = 1;
}
$map = [];
for($i=0; $i < 8; $i++) {
if(!Util::array_get($occupied[$i])) {
$map[] = $i;
}
}
if($grpCount < 8) {
$grp = $map[rand() % count($map)];
$query = "select grp from tournament where grp='$grp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('{$general['no']}', '{$general['npc']}', '{$general['name']}', '{$general['leader']}', '{$general['power']}', '{$general['intel']}', '{$general['explevel']}', '$grp', '$grpCount', '{$general['horse']}', '{$general['weap']}', '{$general['book']}')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=1,gold='{$general['gold']}' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
if($grpCount >= 8) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
header('location:b_tournament.php');
die();
}
if($session->userGrade < 5) {
header('location:b_tournament.php');
exit();
}
if($btn == "자동개최설정") {
$db->update('game', ['tnmt_trig'=>$trig], true);
} elseif($btn == "개최" && $session->userGrade >= 5) {
} elseif($btn == "개최") {
startTournament($auto, $type);
} elseif($btn == "중단" && $session->userGrade >= 5) {
} elseif($btn == "중단") {
$db->update('game', [
'tnmt_auto'=>0,
'tournament'=>0,
'phase'=>0
], true);
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $session->userGrade >= 5) || $btn == "참가") {
} elseif($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") {
if($btn == "투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -95,14 +152,6 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) {
$general = MYDB_fetch_array($result);
$general['gold'] -= $admin['develcost'];
//참가
} else {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='{$me['no']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//{$admin['develcost']}원 참가비
if($general['gold'] < $admin['develcost']) { echo "<script>location.replace('b_tournament.php');</script>"; exit(1); }
$general['gold'] -= $admin['develcost'];
}
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
@@ -138,7 +187,8 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $session->userGrade >= 5) {
} elseif($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") {
$z = 0;
$code = [];
for($i=0; $i < 8; $i++) {
@@ -193,30 +243,42 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "무명전부투입" && $session->userGrade >= 5) { fillLowGenAll();
} elseif($btn == "예선" && $session->userGrade >= 5) { qualify($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "예선전부" && $session->userGrade >= 5) { qualifyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨" && $session->userGrade >= 5) { selection($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨전부" && $session->userGrade >= 5) { selectionAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선" && $session->userGrade >= 5) { finallySingle($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선전부" && $session->userGrade >= 5) { finallyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "배정" && $session->userGrade >= 5) { final16set();
} elseif($btn == "베팅마감" && $session->userGrade >= 5) {
} elseif($btn == "무명전부투입") {
fillLowGenAll();
} elseif($btn == "예선") {
qualify($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "예선전부") {
qualifyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨") {
selection($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨전부") {
selectionAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선") {
finallySingle($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선전부") {
finallyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "배정") {
final16set();
} elseif($btn == "베팅마감") {
$dt = date("Y-m-d H:i:s", time() + 60);
$query = "update game set tournament='7',phase='0',tnmt_time='$dt'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "16강" && $session->userGrade >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
} elseif($btn == "8강" && $session->userGrade >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
} elseif($btn == "4" && $session->userGrade >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
} elseif($btn == "결승" && $session->userGrade >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
} elseif($btn == "포상" && $session->userGrade >= 5) { setGift($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "회수" && $session->userGrade >= 5) { setRefund();
} elseif($btn == "메시지" && $session->userGrade >= 5) {
} elseif($btn == "16강") {
finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
} elseif($btn == "8") {
finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
} elseif($btn == "4강") {
finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
} elseif($btn == "결승") {
finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
} elseif($btn == "포상") {
setGift($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "회수") {
setRefund();
} elseif($btn == "메시지") {
$msg = addslashes(SQ2DQ($msg));
$query = "update game set tnmt_msg='$msg'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('b_tournament.php');</script> //TODO:debug all and replace -->
b_tournament.php
header('location:b_tournament.php');
+6 -3
View File
@@ -6,8 +6,11 @@ include "func.php";
// $btn, $name, $troop
$btn = Util::getReq('btn');
$name = Util::getReq('name');
$gen = Util::getReq('gen', 'int');
$troop = Util::getReq('troop', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = $session::getUserID();
@@ -17,7 +20,6 @@ $db = DB::db();
$me = $db->queryFirstRow('SELECT `no`, nation, troop FROM general WHERE `owner`=%i', $userID);
$name = trim($name);
$name = addslashes(SQ2DQ($name));
if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
$db->insert('troop',[
'name'=>$name,
@@ -38,8 +40,9 @@ if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
'troop'=>0
], 'no=%i AND troop=(SELECT troop FROM troop WHERE no = %i)', $gen, $me['no']);
} elseif($btn == "부 대 가 입" && $troop != 0) {
$troop = $db->queryFirstField('SELECT troop FROM troop WHERE no = %i', $troop);
if($troop){
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $troop);
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `nation`=%i', $troopLeader, $me['nation']);
if($troopLeaderNation){
$db->update('general', [
'troop'=>$troop
], 'no=%i', $me['no']);
+2 -2
View File
@@ -19,6 +19,6 @@ $admin['killturn'] *= 3;
$query = "update general set killturn='{$admin['killturn']}' where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_myPage.php');</script>";
echo 'b_myPage.php'; //TODO:debug all and replace
header('location:b_myPage.php');
+4 -8
View File
@@ -10,6 +10,8 @@ $comment = Util::getReq('comment');
$title = Util::getReq('title');
$str = Util::getReq('str');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -41,9 +43,6 @@ else if($btn == "댓글" && $comment != "") {
$comment = addslashes(SQ2DQ($comment));
$nation = getNationStaticInfo($me['nation']);
if($nation == null) {
$nation = ['name' => "재야"];
}
if($admin['votecomment'] != "") { $admin['votecomment'] .= "|"; }
$admin['votecomment'] .= "{$nation['name']}:{$me['name']}:{$comment}";
@@ -56,8 +55,7 @@ else if($btn == "댓글" && $comment != "") {
}
if($session->userGrade < 5){
echo "<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
echo 'a_vote.php ';
header('location:a_vote.php');
die();
}
@@ -96,7 +94,5 @@ if($btn == "수정") {
$query = "update game set voteopen=2";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
a_vote.php
header('location:a_vote.php');
+4
View File
@@ -80,6 +80,10 @@ function myCommandList() {
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(!$me){
echo "로그인 되어있지 않습니다.";
return;
}
$turn = getTurn($me, 2);
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
+7 -3
View File
@@ -5,9 +5,9 @@ html, body{
color:white;
}
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
table { font-family:'맑은 고딕'; }
font { font-family:'맑은 고딕'; }
input { font-family:'맑은 고딕'; height:20px }
select { font-family:'굴림'; line-height:100%; }
/* */
@@ -48,6 +48,10 @@ select { font-family:'굴림'; line-height:100%; }
content:"◆";
}
.small_war_log{
display:inline-block;
}
.small_war_log .war_type_attack{
color:cyan;
}
+165
View File
@@ -0,0 +1,165 @@
@charset "UTF-8";
/*임시용 */
#container{
width:1000px;
margin:auto;
font-size:13px;
}
/*임시용 끝*/
#message_board{
height:1370px;
position:relative;
}
#message_board section{
overflow-y:auto;
overflow-x:hidden;
max-width:498px;
}
.msg_plate{
width:100%;
border-bottom:groove 0.1em;
border-left:groove 0.1em;
border-right:groove 0.1em;
height:64px;
font-size:12px;
word-break:break-all;
color:white;
}
.msg_plate_private{
background-color:#5d1e1a;
}
.msg_plate_public{
background-color:#141c65;
}
.msg_plate_national, .msg_plate_diplomacy{
background-color:#00582c;
}
.public_message{
height:667px;
}
.private_message{
height:667px;
}
.national_message{
height:1350px;
}
.msg_icon{
float:left;
width:64px;
height:64px;
border-right:groove 0.1em;
}
.msg_time{
font-size:0.75em;
font-weight:normal;
}
.msg_header{
font-weight: bold;
margin-bottom:3px;
color:white;
}
.message_input_form{
position:relative;
}
#msg_input{
color:white;
background-color:black;
font-size:12px;
width:715px;
margin:0 2px;
height:15px;
}
#msg_submit{
position:absolute;
right:0;
margin-right:2px;
}
#mailbox_list{
float:left;
color:white;
background-color:black;
font-size:12px;
width:160px;
height:20px;
}
.board_header{
color:white;
border:groove 0.1em;
}
.board_side{
position:absolute;
height:1370px;
width:498px;
overflow-y: hidden;
border-left:groove 1px;
border-right:groove 1px;
border-bottom:groove 1px;
}
.msg_body{
padding-left:64px;
}
.msg_target{
margin:2px 2px 0 2px;
padding:2px 3px;
display:inline-block;
box-shadow: 2px 2px black;
border-radius: 3px;
}
/*
.public_message .msg_target{
box-shadow: 2px 2px darkslategrey;
}
*/
.msg_target.msg_bright{
color:black;
}
.msg_target.msg_dark{
color:white;
}
.msg_from_to{
display:inline-block;
}
.msg_content{
margin-left:10px;
margin-right:5px;
}
.msg_prompt{
text-align:right;
margin-top:5px;
margin-right:5px;
}
#mailbox_list option{
color:white;
background-color:black;
}
-132
View File
@@ -1,132 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$ok = Util::getReq('ok');
$when = Util::getReq('when', 'int');
$gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
//FIXME: 망했음. CriticalFailure. 재 구현.
$db = DB::db();
$connect=$db->get();
//$when = ($when + 1) * 2;
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,name from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,surlimit,color from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state,term from diplomacy where me='{$me['nation']}' and you='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//상대국의 제의조건
$query = "select reserved from diplomacy where me='{$you['nation']}' and you='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result);
$mylog = [];
$youlog = [];
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me['level'] < 5) {
$mylog[] = "<C>●</>수뇌부가 아니므로 불가능합니다. 불가침 실패.";
} elseif($dip['term'] == $when*12 && $dip['state'] == 7) {
$mylog[] = "<C>●</>이미 수락했습니다. 불가침 실패.";
} elseif($losecitynum == 0) {
$mylog[] = "<C>●</>방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($wincitynum == 0) {
$mylog[] = "<C>●</>상대가 방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($dip['state'] == 0) {
$mylog[] = "<C>●</>아국과 교전중입니다. 불가침 실패.";
} elseif($dip['state'] == 1) {
$mylog[] = "<C>●</>아국과 선포중입니다. 불가침 실패.";
} elseif($dip['state'] == 3 || $dip['state'] == 4) {
$mylog[] = "<C>●</>아국과 합병중입니다. 불가침 실패.";
} elseif($mynation['dipmsg'] == "") {
$mylog[] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>불가침</>에 합의.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<Y><b>【불가침】</b></><D><b>{$mynation['name']}</b></>(이)가 <D><b>{$younation['name']}</b></>(와)과 불가침 조약을 체결했습니다.";
$youlog[] = "<C>●</><D><b>{$mynation['name']}</b></>(와)과 <C>$when</>년 불가침에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 <C>$when</>년 불가침에 합의했습니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 {$when}년 불가침 성공");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>(와)과 {$when}년 불가침 수락");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}(와)과 {$when}년 불가침 합의, 비고: {$dip2['reserved']}";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$mynation['name']}(와)과 {$when}년 불가침 합의, 비고: {$dip2['reserved']}";
PushMsg(2, $me['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $you['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
$when = $when * 12;
//외교 변경
$query = "update diplomacy set state='7',term='$when',fixed='{$dip2['reserved']}' where me='{$me['nation']}' and you='{$you['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='7',term='$when',fixed='{$dip2['reserved']}' where me='{$you['nation']}' and you='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//조건 지움
$query = "update diplomacy set reserved='' where me='{$you['nation']}' and you='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$mynation['name']}</>(이)가 불가침을 거부했습니다.";
$mylog[] = "<C>●</><D>{$younation['name']}</>(와)과 불가침을 거부했습니다.";
//조건 지움
$query = "update diplomacy set reserved='' where me='{$you['nation']}' and you='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
//pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
//pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
-113
View File
@@ -1,113 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$ok = Util::getReq('ok');
$gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
//FIXME: 망했음. CriticalFailure. 재 구현.
$db = DB::db();
$connect=$db->get();
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,surlimit,color from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='{$me['nation']}' and you='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
$mylog = [];
$youlog = [];
$alllog = [];
$history = [];
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me['level'] < 5) {
$mylog[] = "<C>●</>수뇌부가 아니므로 불가능합니다. 파기 실패.";
} elseif($losecitynum == 0) {
$mylog[] = "<C>●</>방랑군이므로 불가능합니다. 파기 실패.";
} elseif($wincitynum == 0) {
$mylog[] = "<C>●</>상대가 방랑군이므로 불가능합니다. 파기 실패.";
} elseif($dip['state'] != 7) {
$mylog[] = "<C>●</>아국과 불가침중이 아닙니다. 파기 실패.";
} elseif($mynation['dipmsg'] == "") {
$mylog[] = "<C>●</>이미 거절했습니다. 파기 실패.";
} else {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>조약 파기</>에 합의.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【파기】</b></><D><b>{$mynation['name']}</b></>(이)가 <D><b>{$younation['name']}</b></>(와)과 불가침을 파기 하였습니다.";
$youlog[] = "<C>●</><D><b>{$mynation['name']}</b></>(와)과 파기에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 파기에 합의했습니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 파기 성공");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>(와)과 파기 수락");
//외교 변경
$query = "update diplomacy set state='2',term='0' where me='{$me['nation']}' and you='{$you['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='{$you['nation']}' and you='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}(와)과 불가침 파기 동의";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$mynation['name']}(와)과 불가침 파기 동의";
PushMsg(2, $me['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $you['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$mynation['name']}</>(이)가 파기를 거부했습니다.";
$mylog[] = "<C>●</><D>{$younation['name']}</>(와)과 파기를 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
-118
View File
@@ -1,118 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$ok = Util::getReq('ok');
$gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
//FIXME: 망했음. CriticalFailure. 재 구현.
$db = DB::db();
$connect=$db->get();
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select nation,name,surlimit,color from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='{$me['nation']}' and you='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
$mylog = [];
$youlog = [];
$alllog = [];
$history = [];
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me['level'] < 5) {
$mylog[] = "<C>●</>수뇌부가 아니므로 불가능합니다. 종전 실패.";
} elseif($losecitynum == 0) {
$mylog[] = "<C>●</>방랑군이므로 불가능합니다. 종전 실패.";
} elseif($wincitynum == 0) {
$mylog[] = "<C>●</>상대가 방랑군이므로 불가능합니다. 종전 실패.";
} elseif($dip['state'] != 0 && $dip['state'] != 1) {
$mylog[] = "<C>●</>아국과 교전중이 아닙니다. 종전 실패.";
} elseif($mynation['dipmsg'] == "") {
$mylog[] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>종전 합의</> 하였습니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【종전】</b></><D><b>{$mynation['name']}</b></>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>종전 합의</> 하였습니다.";
$youlog[] = "<C>●</><D><b>{$mynation['name']}</b></>(와)과 종전에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 종전에 합의했습니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 종전 성공");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>(와)과 종전 수락");
//외교 변경
$query = "update diplomacy set state='2',term='0' where me='{$mynation['nation']}' and you='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='{$younation['nation']}' and you='{$mynation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//외교제한
$query = "update nation set surlimit=24 where nation='{$mynation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set surlimit=24 where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}(와)과 종전 동의";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$mynation['name']}(와)과 종전 동의";
PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$mynation['name']}</>(이)가 종전을 거부했습니다.";
$mylog[] = "<C>●</><D>{$younation['name']}</>(와)과 종전을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
-152
View File
@@ -1,152 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$ok = Util::getReq('ok');
$gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
//FIXME: 망했음. CriticalFailure. 재 구현.
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,name,nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select round(avg(power)) as power,round(avg(gennum)) as gennum from nation where level>=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$avgnation = MYDB_fetch_array($result);
$query = "select round(std(power)) as power,round(std(gennum)) as gennum from nation where level>=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$stdnation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,surlimit,color from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='{$me['nation']}' and you='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='{$you['nation']}' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='{$me['nation']}' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄
$valid = 1;
for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='{$acdip['you']}' and you='{$you['nation']}'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult);
if($abdip['state'] == 7) {
$valid = 0;
}
}
$mylog = [];
$youlog = [];
$alllog = [];
$history = [];
if($ok == "수락") {
// 서신 보낸 후 멸망 했을때.
if($me['level'] < 5) {
$mylog[] = "<C>●</>수뇌부가 아니므로 불가능합니다. 통합 실패.";
} elseif($mynation['surlimit'] > 0) {
$mylog[] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($younation['surlimit'] > 0) {
$mylog[] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($losecitynum == 0) {
$mylog[] = "<C>●</>방랑군이므로 불가능합니다. 통합 실패.";
} elseif($wincitynum == 0) {
$mylog[] = "<C>●</>상대가 방랑군이므로 불가능합니다. 통합 실패.";
} elseif($mynation['power']+$younation['power'] > $avgnation['power']+$stdnation['power']) {
$mylog[] = "<C>●</>양국 국력이 너무 높습니다. 통합 실패.";
} elseif($mynation['gennum']+$younation['gennum'] > $avgnation['gennum']+$stdnation['gennum']) {
$mylog[] = "<C>●</>양국 장수가 많습니다. 통합 실패.";
} elseif(!isClose($younation['nation'], $mynation['nation'])) {
$mylog[] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 통합 실패.";
} elseif($dip['state'] == 0) {
$mylog[] = "<C>●</>아국과 교전중입니다. 통합 실패.";
} elseif($dipcount != 0) {
$mylog[] = "<C>●</>상대국이 외교 진행중입니다. 통합 실패.";
} elseif($valid == 0) {
$mylog[] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 통합 실패.";
} elseif($mynation['dipmsg'] == "") {
$mylog[] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$youlog[] = "<C>●</><D><b>{$mynation['name']}</b></>(이)가 통합에 동의했습니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통합시도】</b></><D><b>{$mynation['name']}</b></>(와)과 <D><b>{$younation['name']}</b></>(이)가 통합을 시도합니다.";
$mylog[] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 통합에 동의했습니다.";
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>통합</>에 동의하였습니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 통합 시도");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>(와)과 통합 시도");
//외교 변경
$query = "update diplomacy set state='3',term='24' where me='{$mynation['nation']}' and you='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='4',term='24' where me='{$younation['nation']}' and you='{$mynation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}(와)과 통합에 합의";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$mynation['name']}(와)과 통합에 합의";
PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$mynation['name']}</>(이)가 항복을 거부했습니다.";
$mylog[] = "<C>●</><D>{$younation['name']}</>(으)로 항복을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
-178
View File
@@ -1,178 +0,0 @@
<?php
namespace sammo;
//TODO: 등용장 재 디자인.
//xxx: 일단 비활성화
header('Location:msglist.php');
die();
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
//FIXME: 망했음. CriticalFailure. 재 구현.
$db = DB::db();
$connect=$db->get();
$query = "select startyear,year,month,killturn from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,nations,level,troop,npc,gold,rice from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,nation,level,capital,scout from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$mylog = [];
$youlog = [];
$allog = [];
if($ok == "수락" && $me['level'] < 12 && $nation['level'] > 0 && $nation['scout'] == 0 && $me['nation'] != $nation['nation'] && $admin['year'] >= $admin['startyear']+3 && strpos($me['nations'], ",{$nation['nation']},") === false) {
$youlog[] = "<C>●</><Y>{$me['name']}</> 등용에 성공했습니다.";
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$nation['name']}</b></>(으)로 <S>망명</>하였습니다.";
$mylog[] = "<C>●</><D>{$nation['name']}</>(으)로 망명하여 수도로 이동합니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$me['name']}</> 등용에 성공");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D>{$nation['name']}</>(으)로 망명");
// 임관내역 추가
$me['nations'] .= "{$nation['nation']},";
// 국가 변경, 도시 변경, 일반으로, 수도로
$query = "update general set killturn='{$admin['killturn']}',belong=1,nation='{$you['nation']}',nations='{$me['nations']}',level=1,city='{$nation['capital']}' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 재야가 아니면 명성N*10% 공헌N*10%감소
if($me['level'] > 0) {
// 1000 1000 남기고 환수
if($me['gold'] > 1000) { $gold = $me['gold'] - 1000; $me['gold'] = 1000; } else { $gold = 0; }
if($me['rice'] > 1000) { $rice = $me['rice'] - 1000; $me['rice'] = 1000; } else { $rice = 0; }
$query = "update general set gold='{$me['gold']}',rice='{$me['rice']}',betray=betray+1,dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set gold=gold+'$gold',rice=rice+'$rice' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
//재야이면 100 100 증가
$query = "update general set dedication=dedication+100,experience=experience+100 where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//유저이면 삭턴 리셋
if($me['npc'] < 2) {
$query = "update general set killturn='{$admin['killturn']}' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//태수 군사 시중 해제
switch($me['level']) {
case 4:
$query = "update city set gen1=0 where gen1='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 3:
$query = "update city set gen2=0 where gen2='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 2:
$query = "update city set gen3=0 where gen3='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
}
//등용자 명성, 공헌 상승
$query = "update general set dedication=dedication+100,experience=experience+100 where no='{$you['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 처리
$query = "select no from troop where troop='{$me['troop']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result);
//부대장일 경우
if($troop['no'] == $me['no']) {
// 모두 탈퇴
$query = "update general set troop='0' where troop='{$me['troop']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제
$query = "delete from troop where troop='{$me['troop']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set troop='0' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//국가 기술력 그대로
$query = "select no from general where nation='{$nation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gennum = $gencount;
if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 국가 기술력 그대로
$query = "select no from general where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gennum = $gencount;
if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 수정
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me['level'] == 12) {
$mylog[] = "<C>●</>군주입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation['level'] == 0) {
$mylog[] = "<C>●</>없는 국가이거나 방랑군입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation['scout'] != 0) {
$mylog[] = "<C>●</>임관 금지중입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($admin['year'] < $admin['startyear']+3) {
$mylog[] = "<C>●</>초반 제한중입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) {
$mylog[] = "<C>●</>이미 임관했었던 국가입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$me['name']}</>(이)가 등용을 거부했습니다.";
$mylog[] = "<C>●</><D>{$nation['name']}</>(으)로 망명을 거부했습니다.";
//현 메세지 지움
$query = "update general set msg{$num}='{$nation['name']}(으)로 등용 제의 거부',msg{$num}_type='10' where no='{$me['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
//pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
+4
View File
@@ -27,6 +27,10 @@ class DB{
if(self::$uDB === null){
self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding);
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
self::$uDB->error_handler= function(){};
self::$uDB->throw_exception_on_error = true;
self::$uDB->throw_exception_on_nonsql_error = true;
}
return self::$uDB;
}
+1
View File
@@ -3,6 +3,7 @@ namespace sammo;
class UniqueConst{
public static $serverID = '_tK_serverID_';
public static $serverName = '_tK_serverName_';
private function __construct(){}
@@ -0,0 +1,22 @@
<div class="buttonPlate bg1">
<div>
<a href="a_status.php" target="_blank"><button class="toolbarButton">세력도</button></a>
<a href="a_kingdomList.php" target="_blank"><button class="toolbarButton">세력일람</button></a>
<a href="a_genList.php" target="_blank"><button class="toolbarButton">장수일람</button></a>
<a href="a_bestGeneral.php" target="_blank"><button class="toolbarButton">명장일람</button></a>
<a href="a_history.php" target="_blank"><button class="toolbarButton">연감</button></a>
<a href="a_hallOfFame.php" target="_blank"><button class="toolbarButton">명예의전당</button></a>
<a href="a_emperior.php" target="_blank"><button class="toolbarButton">왕조일람</button></a>
<a href="a_traffic.php" target="_blank"><button class="toolbarButton">접속량정보</button></a>
</div>
<div>
<a href="/bbs/board" target="_blank"><button class="toolbarButton2">삼모게시판</button></a>
<a href="/bbs/tip" target="_blank"><button class="toolbarButton">팁/강좌</button></a>
<a href="/bbs/news" target="_blank"><button class="toolbarButton">삼국 일보</button></a>
<a href="/bbs/history2" target="_blank"><button class="toolbarButton">개인 열전</button></a>
<a href="/bbs/history3" target="_blank"><button class="toolbarButton">국가 열전</button></a>
<a href="/bbs/patch" target="_blank"><button class="toolbarButton">패치 내역</button></a>
<a href="../i_other/help.php" target="_blank"><button class="toolbarButton">튜토리얼</button></a>
<a href="<?=$site?>" target="_blank"><button class="toolbarButton"><?=$call?></button></a>
</div>
</div>
-141
View File
@@ -1,141 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$ok = Util::getReq('ok');
$gen = Util::getReq('gen', 'int'); //XXX: -_-;;;;;;;;;;;;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
//FIXME: 망했음. CriticalFailure. 재 구현.
$db = DB::db();
$connect=$db->get();
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select nation,name,power,gold,rice,surlimit,color from nation where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,power,surlimit,color,dip{$num} as dipmsg from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='{$me['nation']}' and you='{$you['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='{$you['nation']}' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='{$me['nation']}' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄
$valid = 1;
for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='{$acdip['you']}' and you='{$you['nation']}'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult);
if($abdip['state'] == 7) {
$valid = 0;
}
}
$mylog = [];
$youlog = [];
$alllog = [];
$history = [];
if($ok == "수락") {
// 서신 보낸 후 멸망 했을때.
if($me['level'] < 5) {
$mylog[] = "<C>●</>수뇌부가 아니므로 불가능합니다. 투항 실패.";
} elseif($mynation['surlimit'] > 0) {
$mylog[] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 투항 실패.";
} elseif($younation['surlimit'] > 0) {
$mylog[] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 투항 실패.";
// } elseif($losecitynum == 0) {
// $mylog[] = "<C>●</>방랑군이므로 불가능합니다. 투항 실패.";
} elseif($wincitynum == 0) {
$mylog[] = "<C>●</>상대가 방랑군이므로 불가능합니다. 투항 실패.";
} elseif($younation['power'] / $mynation['power'] <= 3) {
$mylog[] = "<C>●</>아국과 상대국의 국력차이가 크지 않습니다. 투항 실패.";
} elseif($losecitynum != 0 && !isClose($younation['nation'], $mynation['nation'])) {
$mylog[] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 투항 실패.";
} elseif($dip['state'] == 0) {
$mylog[] = "<C>●</>아국과 교전중입니다. 투항 실패.";
} elseif($dipcount != 0) {
$mylog[] = "<C>●</>상대국이 외교 진행중입니다. 투항 실패.";
} elseif($valid == 0) {
$mylog[] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 투항 실패.";
} elseif($mynation['dipmsg'] == "") {
$mylog[] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$youlog[] = "<C>●</><D><b>{$mynation['name']}</b></>(이)가 합병에 동의했습니다.";
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【합병시도】</b></><D><b>{$mynation['name']}</b></>(와)과 <D><b>{$younation['name']}</b></>(이)가 합병을 시도합니다.";
$mylog[] = "<C>●</><D><b>{$younation['name']}</b></>(와)과 합병에 동의했습니다.";
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$me['name']}</>(이)가 <D><b>{$younation['name']}</b></>(와)과 <M>합병</>에 동의하였습니다.";
pushGeneralHistory($you, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$mynation['name']}</b></>(와)과 합병 시도");
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$younation['name']}</b></>(와)과 합병 시도");
//외교 변경
$query = "update diplomacy set state='5',term='24' where me='{$mynation['nation']}' and you='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='6',term='24' where me='{$younation['nation']}' and you='{$mynation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}(와)과 합병에 동의";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$mynation['name']}(와)과 합병에 동의";
PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[] = "<C>●</><Y>{$mynation['name']}</>(이)가 항복을 거부했습니다.";
$mylog[] = "<C>●</><D>{$younation['name']}</>(으)로 항복을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
echo "<script>location.replace('msglist.php');</script>";
+133 -117
View File
@@ -4,7 +4,7 @@ namespace sammo;
require_once 'process_war.php';
require_once 'func_gamerule.php';
require_once 'func_process.php';
require_once 'func_process_trick.php';
require_once 'func_process_sabotage.php';
require_once 'func_process_chief.php';
require_once 'func_process_personnel.php';
require_once 'func_npc.php';
@@ -18,13 +18,12 @@ require_once 'func_time_event.php';
require_once('func_template.php');
require_once('func_message.php');
require_once('func_map.php');
require_once('func_diplomacy.php');
require_once('func_command.php');
/**
* nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 규모, 수도)를 반환해줌
*
* @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음
* @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음. 0인 경우에는 재야임
* @param bool $forceRefresh 강제 갱신 여부
*
* @return array|null nationID에 해당하는 국가가 있을 경우 array 반환. 그외의 경우 null
@@ -32,13 +31,24 @@ require_once('func_command.php');
function getNationStaticInfo($nationID, $forceRefresh=false)
{
static $nationList = null;
static $freeNation = [
'nation'=>0,
'name'=>'재야',
'color'=>'#000000',
'type'=>0,
'level'=>0,
'capital'=>0
];
if ($forceRefresh) {
$nationList = null;
}
if($nationID === null || $nationID == 0){
return null;
if ($nationID === null) {
return null;
}
if($nationID === 0){
return $freeNation;
}
if($nationList === null){
@@ -67,19 +77,33 @@ function getAllNationStaticInfo(){
return getNationStaticInfo(-1);
}
function GetImageURL($imgsvr) {
function GetImageURL($imgsvr, $filepath='') {
if($imgsvr == 0) {
return ServConfig::$sharedIconPath;
return ServConfig::getSharedIconPath($filepath);
} else {
return AppConf::getUserIconPathWeb();
return AppConf::getUserIconPathWeb($filepath);
}
}
function checkLimit($con, $conlimit) {
/**
* @param null|int $con 장수의 벌점
* @param null|int $conlimit 최대 벌점
*/
function checkLimit($con = null, $conlimit = null) {
$session = Session::getInstance();
if($session->userGrade>=4){
return 0;
}
$db = DB::db();
if($con === null){
$con = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', Session::getUserID());
}
if($conlimit === null){
$conlimit = $db->queryFirstField('SELECT conlimit FROM game LIMIT 1');
}
if($con > $conlimit) {
return 2;
//접속제한 90%이면 경고문구
@@ -144,10 +168,14 @@ function cityInfo() {
$tradeStr = $city['trade'] . "%";
}
if(!$nation){
$nation = getNationStaticInfo(0);
}
if($nation['color'] == "" ) { $nation['color'] = "#000000"; }
echo "<table width=640 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr><td colspan=8 align=center style=height:20;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]."{$city['name']}</td></tr>
<tr><td colspan=8 align=center style=height:20;color:".newColor($nation['color']).";background-color:{$nation['color']}><b>";
<tr><td colspan=8 align=center style=height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]."{$city['name']}</td></tr>
<tr><td colspan=8 align=center style=height:20px;color:".newColor($nation['color']).";background-color:{$nation['color']}><b>";
if($city['nation'] == 0) {
echo "공 백 지";
@@ -241,7 +269,7 @@ function myNationInfo() {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select nation,name,color,power,msg,gold,rice,bill,rate,scout,war,tricklimit,surlimit,tech,totaltech,level,type from nation where nation='{$me['nation']}'";
$query = "select nation,name,color,power,msg,gold,rice,bill,rate,scout,war,sabotagelimit,surlimit,tech,totaltech,level,type from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -321,14 +349,14 @@ function myNationInfo() {
$nation['tech'] = "$techCall / {$nation['tech']}";
if($me['nation']==0){
$nation['tricklimit'] = "<font color=white>해당 없음</font>";
$nation['sabotagelimit'] = "<font color=white>해당 없음</font>";
$nation['surlimit'] = "<font color=white>해당 없음</font>";
$nation['scout'] = "<font color=white>해당 없음</font>";
$nation['war'] = "<font color=white>해당 없음</font>";
$nation['power'] = "<font color=white>해당 없음</font>";
} else {
if($nation['tricklimit'] != 0) { $nation['tricklimit'] = "<font color=red>{$nation['tricklimit']}턴</font>"; }
else { $nation['tricklimit'] = "<font color=limegreen>가 능</font>"; }
if($nation['sabotagelimit'] != 0) { $nation['sabotagelimit'] = "<font color=red>{$nation['sabotagelimit']}턴</font>"; }
else { $nation['sabotagelimit'] = "<font color=limegreen>가 능</font>"; }
if($nation['surlimit'] != 0) { $nation['surlimit'] = "<font color=red>{$nation['surlimit']}턴</font>"; }
else { $nation['surlimit'] = "<font color=limegreen>가 능</font>"; }
@@ -359,7 +387,7 @@ function myNationInfo() {
</tr>
<tr>
<td align=center id=bg1><b>전 략</b></td>
<td align=center>{$nation['tricklimit']}</td>
<td align=center>{$nation['sabotagelimit']}</td>
<td align=center id=bg1><b>외 교</b></td>
<td align=center>{$nation['surlimit']}</td>
</tr>
@@ -465,7 +493,7 @@ function commandTable() {
$develcostE = Util::round($develcostE);
echo "
<select name=commandtype size=1 style=width:260px;color:white;background-color:black;font-size:12;>";
<select name=commandtype size=1 style=width:260px;color:white;background-color:black;font-size:12px;>";
addCommand("휴 식", 0);
addCommand("요 양", 50);
commandGroup("========= 내 정 ==========");
@@ -528,15 +556,13 @@ function commandTable() {
} else {
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
}
//TODO:등용장 재 디자인
//xxx:등용장 일단 끔
/*
if($me['level'] >= 1 && $city['supply'] != 0) {
addCommand("등용(자금{$develcost5}+장수가치)", 22);
} else {
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
}
*/
if($me['no'] == $troop['no'] && $citycount > 0 && $city['supply'] != 0 && $city['nation'] == $me['nation']) {
addCommand("집합(통솔경험)", 26);
} else {
@@ -618,7 +644,13 @@ function commandTable() {
if($me['level'] == 12) {
addCommand("선양", 54);
if($citycount != 0) {
addCommand("방랑", 47);
if ($admin['year'] + 3 < $admin['startyear']) {
addCommand("방랑", 47, 0);
}
else{
addCommand("방랑", 47);
}
addCommand("해산", 56, 0);
} else {
addCommand("방랑", 47, 0);
@@ -844,12 +876,12 @@ function generalInfo($no) {
elseif($general['mode'] == 1) { $general['mode'] = "<font color=limegreen>수비 함(훈사60)</font>"; }
else { $general['mode'] = "<font color=red>수비 안함</font>"; }
$weapImage = ServConfig::$gameImagePath."/weap{$general['crewtype']}.jpg";
$weapImage = ServConfig::$gameImagePath."/weap{$general['crewtype']}.png";
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; };
$imageTemp = GetImageURL($general['imgsvr']);
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr>
<td width=64 height=64 align=center rowspan=3 background={$imageTemp}/{$general['picture']}>&nbsp;</td>
<td width=64 height=64 align=center rowspan=3 style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;'>&nbsp;</td>
<td align=center colspan=9 height=16 style=color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>{$general['name']}{$level} | {$call} | {$color}{$injury}</font> 】 ".substr($general['turntime'], 11)."</td>
</tr>
<tr height=16>
@@ -872,7 +904,7 @@ function generalInfo($no) {
<td align=center colspan=2><font size=1>$bookname</font></td>
</tr>
<tr>
<td align=center height=64 rowspan=3 background={$weapImage}>&nbsp;</td>
<td align=center height=64 rowspan=3 style='background:no-repeat center url(\"{$weapImage}\");background-size:64px;'></td>
<td align=center id=bg1><b>자금</b></td>
<td align=center colspan=2>{$general['gold']}</td>
<td align=center id=bg1><b>군량</b></td>
@@ -933,8 +965,6 @@ function myInfo2() {
}
function generalInfo2($no) {
global $_dexLimit;
$db = DB::db();
$connect=$db->get();
@@ -960,11 +990,11 @@ function generalInfo2($no) {
$dedication = getDed($general['dedication'])." ({$general['dedication']})"; break;
}
$dex0 = $general['dex0'] / $_dexLimit * 100;
$dex10 = $general['dex10'] / $_dexLimit * 100;
$dex20 = $general['dex20'] / $_dexLimit * 100;
$dex30 = $general['dex30'] / $_dexLimit * 100;
$dex40 = $general['dex40'] / $_dexLimit * 100;
$dex0 = $general['dex0'] / GameConst::$dexLimit * 100;
$dex10 = $general['dex10'] / GameConst::$dexLimit * 100;
$dex20 = $general['dex20'] / GameConst::$dexLimit * 100;
$dex30 = $general['dex30'] / GameConst::$dexLimit * 100;
$dex40 = $general['dex40'] / GameConst::$dexLimit * 100;
if($dex0 > 100) { $dex0 = 100; }
if($dex10 > 100) { $dex10 = 100; }
@@ -1102,23 +1132,6 @@ function nationMsg() {
echo "<font color=orange>".$nation['msg']."</font>";
}
function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $tocolor, $msg) {
if($nation == 0) { $nation = 0; }
if($fromcolor == "") { $fromcolor = "#FFFFFF"; }
if($to == "") { $to = "재야"; }
if($tocolor == "") { $tocolor = "#FFFFFF"; }
$date = date('Y-m-d H:i:s');
if($type == 1) { $file = "_all_msg.txt"; }
else { $file = "_nation_msg{$nation}.txt"; }
$fp = fopen("logs/{$file}", "a");
//로그 파일에 기록
$str = "{$type}|".StringUtil::padStringAlignRight($from,12," ")."|".StringUtil::padStringAlignRight($to,12," ")."|".$date."|".$msg."|".$fromcolor."|".$tocolor."|".$picture."|".$imgsvr;
fwrite($fp, "{$str}\n");
fclose($fp);
}
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
$db = DB::db();
$connect=$db->get();
@@ -1142,7 +1155,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
<td width=148 align=center id=bg1>$when</td>
</tr>
<tr>
<td width=64 height=64 valign=top><img src={$imageTemp}/{$picture} width=64 height=64 border=0></td>
<td width=64 height=64 valign=top><img width='64' height='64' src={$imageTemp}/{$picture} border=0></td>
<td width=932 colspan=2>$message[1]</td>
</tr>";
for($i=0; $i < $count; $i++) {
@@ -1162,7 +1175,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
<form name=reply_form{$num} method=post action=$board>
<td width=64 align=center>댓글달기</td>
<td width=932 colspan=2>
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:830;>
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:830px;>
<input type=submit value=댓글달기>
<input type=hidden name=num value=$num>
</td>
@@ -1238,6 +1251,7 @@ function cutDay($date, int $turnterm) {
function increaseRefresh($type="", $cnt=1) {
//FIXME: 로그인, 비로그인 시 처리가 명확하지 않음
$session = Session::getInstance();
$userID = $session->userID;
$generalID = $session->generalID;
$date = date('Y-m-d H:i:s');
@@ -1254,14 +1268,14 @@ function increaseRefresh($type="", $cnt=1) {
'connect'=>$db->sqleval('connect + %i', $cnt),
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
'refresh'=>$db->sqleval('refresh + %i', $cnt)
], 'owner=%i', $generalID);
], 'owner=%i', $userID);
}
$date = date('Y_m_d H:i:s');
$date2 = substr($date, 0, 10);
$online = getOnlineNum();
file_put_contents(
"logs/_{$date2}_refresh.txt",
__dir__."/logs/_{$date2}_refresh.txt",
sprintf(
"%s, %s, %s, %s, %s, %d\n",
$date,
@@ -1298,7 +1312,7 @@ function increaseRefresh($type="", $cnt=1) {
}
if($str != "") {
file_put_contents(
"logs/_{$date2}_ipcheck.txt",
__dir__."/logs/_{$date2}_ipcheck.txt",
sprintf(
"%s, %s, %s%s\n",
$session->userName,
@@ -1334,22 +1348,24 @@ function updateTraffic() {
$date = date('Y-m-d H:i:s');
//일시|년|월|총갱신|접속자|최다갱신자
file_put_contents(__dir__."logs/_traffic.txt",
StringUtil::padStringAlignRight($date,20," ")
."|".StringUtil::padStringAlignRight($game['year'],3," ")
."|".StringUtil::padStringAlignRight($game['month'],2," ")
."|".StringUtil::padStringAlignRight($game['refresh'],8," ")
."|".StringUtil::padStringAlignRight($online,5," ")
."|".StringUtil::padStringAlignRight($user['name']."(".$user['refresh'].")",20," ")
file_put_contents(__dir__."/logs/_traffic.txt",
Json::encode([
$date,
$game['year'],
$game['month'],
$game['refresh'],
$online,
$user['name']."(".$user['refresh'].")"
])."\n"
, FILE_APPEND);
}
function CheckOverhead() {
//서버정보
$db = DB::db();
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from GAME LIMIT 1');
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
$con = $admin['turnterm'] * 6;
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
if($con != $admin['conlimit']){
@@ -1439,13 +1455,13 @@ function checkDelay() {
function updateOnline() {
$db = DB::db();
$connect=$db->get();
$nationname = [];
$nationname = ["재야"];
//국가별 이름 매핑
foreach(getAllNationStaticInfo() as $nation) {
$nationname[$nation['nation']] = $nation['name'];
}
$nationname[0] = "재야";
//동접수
$query = "select no,name,nation from general where lastrefresh > DATE_SUB(NOW(), INTERVAL 5 MINUTE)";
@@ -1497,7 +1513,7 @@ function checkTurn() {
// 파일락 획득
//FIXME:이미 DB 테이블로 lock을 시도하는데 이게 따로 필요한가?
$fp = fopen('lock.txt', 'r');
$fp = fopen(__dir__.'/lock.txt', 'r');
if(!flock($fp, LOCK_EX)) {
return;
}
@@ -1513,7 +1529,7 @@ function checkTurn() {
// 파일락 해제
if(!flock($fp, LOCK_UN)) { return; }
// 세마포어 해제
//if(!@sem_release($sema)) { echo "치명적 에러! 유기체에게 문의하세요!"; exit(1); }
//if(!@sem_release($sema)) { echo "치명적 에러! Hide_D에게 문의하세요!"; exit(1); }
pushLockLog(["- checkTurn() 입 : ".date('Y-m-d H:i:s')." : ".$session->userName]);
@@ -1694,14 +1710,6 @@ function checkTurn() {
$query = "update game set turntime='$date'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 3턴 전 시간
$letterdate = subTurn($date, $admin['turnterm'], 3);
//기한 지난 외교 메세지 지움(3개월 유지)
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
for($i=0; $i < 5; $i++) {
$query = "update nation set dip{$i}='',dip{$i}_who='0',dip{$i}_type='0',dip{$i}_when='' where dip{$i}_when < '$letterdate'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
// 부상 과도 제한
$query = "update general set injury='80' where injury>'80'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1768,25 +1776,27 @@ function addAge() {
function turnDate($curtime) {
$db = DB::db();
$connect=$db->get();
$query = "select startyear,starttime,turnterm,year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
$turn = $admin['starttime'];
$curturn = cutTurn($curtime, $admin['turnterm']);
$num = 0;
$term = $admin['turnterm']*60;
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term);
$term = $admin['turnterm'];
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term*60);
$year = $admin['startyear'] + intdiv($num, 12);
$month = 1 + (12+$num) % 12;
$date = $admin['startyear'] * 12;
$date += $num;
$year = intdiv($date, 12);
$month = 1 + $date % 12;
// 바뀐 경우만 업데이트
if($admin['month'] != $month || $admin['year'] != $year) {
$query = "update game set year='$year',month='$month'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('game', [
'year'=>$year,
'month'=>$month
], true);
}
return [$year, $month];
@@ -1803,8 +1813,8 @@ function triggerTournament() {
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
$type = rand() % 6; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
//전력전 50%, 통, 일, 설 각 17%
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
//전력전 40%, 통, 일, 설 각 20%
if($type > 3) { $type = 0; }
startTournament($admin['tnmt_trig'], $type);
}
@@ -2143,13 +2153,12 @@ function CheckHall($no) {
function uniqueItem($general, $log, $vote=0) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$occupied = [];
$item = [];
if($general['npc'] >= 2 || $general['betray'] > 1) { return $log; }
if($general['npc'] >= 2) { return $log; }
if($general['weap'] > 6 || $general['book'] > 6 || $general['horse'] > 6 || $general['item'] > 6) { return $log; }
$query = "select year,month,scenario from game limit 1";
@@ -2187,34 +2196,30 @@ function uniqueItem($general, $log, $vote=0) {
$occupied[$gen[$type]] = 1;
}
for($i=7; $i <= 26; $i++) {
if($occupied[$i] == 0) {
if(!Util::array_get($occupied[$i])) {
$item[] = $i;
}
}
$it = $item[rand() % count($item)];
$it = $item[rand() % count($item)]??0;
$query = "update general set {$type}='$it' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = getNationStaticInfo($general['nation']);
if($nation === null) {
$nation = ['name' => "재야"];
}
switch($sel) {
case 0:
$log[] = "<C>●</><C>".getWeapName($it)."</>(을)를 습득했습니다!";
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
}
break;
case 1:
@@ -2222,13 +2227,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
}
break;
case 2:
@@ -2236,13 +2241,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
}
break;
case 3:
@@ -2250,13 +2255,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
}
break;
}
@@ -2532,6 +2537,9 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
while(!$queue->isEmpty()){
list($cityID, $dist) = $queue->dequeue();
if(key_exists($cityID, $cities)){
continue;
}
if(!key_exists($dist, $distanceList)){
$distanceList[$dist] = [];
@@ -2540,7 +2548,7 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
$cities[$cityID] = $dist;
if($dist >= $maxDist){
return;
continue;
}
foreach(array_keys(CityConst::byID($cityID)->path) as $connCityID){
@@ -2560,15 +2568,23 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
}
}
function isClose($nation1, $nation2) {
function isClose(int $nation1, int $nation2, bool $includeNoSupply=true) {
$db = DB::db();
$nation1Cities = [];
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $nation1) as $city){
if($includeNoSupply){
$supplySql = '';
}
else{
$supplySql = 'AND supply = 1';
}
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i %l', $nation1, $supplySql) as $city){
$nation1Cities[$city] = $city;
}
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $nation2) as $city){
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i %l', $nation2, $supplySql) as $city){
foreach(array_keys(CityConst::byID($city)->path) as $adjCity){
if(key_exists($adjCity, $nation1Cities)){
return true;
@@ -2643,7 +2659,7 @@ function CharCritical($rate, $personal) {
return $rate;
}
function TrickInjury($city, $type=0) {
function SabotageInjury($city, $type=0) {
$db = DB::db();
$connect=$db->get();
$log = [];
+47 -26
View File
@@ -1,7 +1,8 @@
<?php
namespace sammo;
function getTurn($general, $type, $font=1) {
function getTurn(array $general, $type, $font=1) {
//TODO: 왜 'Type' 인가. 그냥 count로 하자.
$str = [];
$db = DB::db();
$connect=$db->get();
@@ -14,9 +15,9 @@ function getTurn($general, $type, $font=1) {
$turn[2] = $general["turn2"];
$turn[3] = $general["turn3"];
$turn[4] = $general["turn4"];
$turn[5] = $general["turn5"];
}
if($type >= 2) {
$turn[5] = $general["turn5"];
$turn[6] = $general["turn6"];
$turn[7] = $general["turn7"];
$turn[8] = $general["turn8"];
@@ -532,13 +533,15 @@ function processCommand($no) {
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(intval($command[0]) == 0 && $session->userGrade < 5) {
} elseif($command[0] == 0) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$admin['killturn']}' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
//연속턴 아닌경우 텀 리셋
if($general['term']%100 != $command[0]) {
$query = "update general set term=0 where no='{$general['no']}'";
@@ -570,7 +573,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; //등용 //TODO:등용장 재 디자인
case 25: process_25($general); break; //임관
case 26: process_26($general); break; //집합
case 28: process_28($general); break; //귀환
@@ -681,22 +684,23 @@ where nation='{$general['nation']}'
function command_Single($turn, $command) {
if(!$turn){
header('location:commandlist.php');
return;
}
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
$command = EncodeCommand(0, 0, 0, $command);
$count = count($turn);
$str = "con=con";
for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$command}'";
$setValues = [];
foreach($turn as $turnIdx){
$setValues["turn{$turnIdx}"] = $command;
}
$query = "update general set {$str} where owner='{$userID}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('commandlist.php');</script>";
echo 'commandlist.php';//TODO:debug all and replace
$db->update('general', $setValues, 'owner=%i',$userID);
header('location:commandlist.php');
}
function command_Chief($turn, $command) {
@@ -719,23 +723,40 @@ function command_Chief($turn, $command) {
$query = "update nation set {$str} where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//echo "<script>location.replace('b_chiefcenter.php');</script>";
echo 'b_chiefcenter.php';//TODO:debug all and replace
header('location:b_chiefcenter.php');
}
function command_Other($turn, $commandtype) {
$db = DB::db();
$connect=$db->get();
echo "<form name=form1 action=processing.php method=post target=_parent>";
$count = count($turn);
for($i=0; $i < $count; $i++) {
echo "<input type=hidden name=turn[] value=$turn[$i]>";
$target = "processing.php?commandtype={$commandtype}";
foreach($turn as $turnItem){
$target.="&turn[]={$turnItem}";
}
echo "<input type=hidden name=commandtype value={$commandtype}>";
echo "</form>";
echo "a"; // 없으면 파폭에서 아래 스크립트 실행 안됨
echo "<script>form1.submit();</script>";
$target.="&".mt_rand();
?>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script>
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
</script>
</head>
<body style="background-color:black;">
</body>
</html>
<?php
/*
<form name='form1' action='processing.php' method='post' target=_parent>
<?php foreach($turn as $turnItem): ?>
<input type='hidden' name='turn[]' value='<?=$turnItem?>'>
<?php endforeach; ?>
<input type=hidden name=commandtype value=<?=$commandtype?>>
</form>&nbsp;
<script>*/
}
+2 -3
View File
@@ -174,6 +174,7 @@ function getGenSpecial($type) {
case 73: $call = '의술'; break;
case 74: $call = '격노'; break;
case 75: $call = '척사'; break;
default: $call = null;
}
return $call;
}
@@ -396,9 +397,7 @@ function getBill(int $dedication) : int{
}
function getCost(int $armtype) : int {
//FIXME: 정말로 side effect가 없으려면 query는 밖으로 이동해야함.
//TODO: 병종 값이 column으로 들어있는건 전혀 옳지 않음. key->value 형태로 바꿔야함
return DB::db()->queryFirstColumn('select %b from game limit 1', sprintf('cst%d', $armtype));
return GameUnitConst::byID($armtype)->cost;
}
function TechLimit($startyear, $year, $tech) : int {
-224
View File
@@ -1,224 +0,0 @@
<?php
namespace sammo;
function checkScoutAvailable($messageInfo, $general, $srcGeneral, $startyear, $year){
$nationID = $messageInfo['src']['nationID'];
$srcNation = DB::db()->queryFirstRow('SELECT `level`, `scout` FROM `nation` WHERE `nation` = %i', $nationID);
$realNationID = $srcGeneral['nation'];
if($general['level'] == 12) {
return [false, "군주입니다."];
}
if(!$srcNation || $srcNation['level'] == 0) {
return [false, "없는 국가이거나 방랑군입니다."];
}
if($realNationID != $nationID){
return [false, "권유자의 소속이 바뀌었습니다."];
}
if($srcNation['scout'] != 0) {
return [false, "임관 금지중입니다."];
}
if($year < $startyear+3) {
return [false, "초반 제한중입니다."];
}
if(strpos($general['nations'], ",{$nationID},") > 0) {
return [false, "이미 임관했었던 국가입니다."];
}
return [true, null];
}
function acceptScout($messageInfo, $general, $msgResponse){
$me = $general;
$you = DB::db()->queryFirstRow('SELECT `no`, `name`, `nation` FROM `general` WHERE `no` = %i', $messageInfo['src']['id']);
list($startyear, $year, $month, $killturn) = Util::convertDictToArray(DB::db()->queryFirstRow('SELECT `startyear`, `year`, `month`, `killturn` FROM `game` LIMIT 1'), ['startyear', 'year', 'month', `killturn`]);
list($avaliableScout, $reason) = checkScoutAvailable($messageInfo, $general, $you, $startyear, $year);
if(!$msgResponse || !$avaliableScout){
return declineScout($messageInfo, $reason);
}
$nation = getNationStaticInfo($messageInfo['src']['nationID']);
$generalID = $me['no'];
$nationID = $nation['nation'];
$nationName = $nation['name'];
$myName = $me['name'];
$mylog = [];
$youlog = [];
$alllog = [];
$youlog[] = "<C>●</><Y>{$myName}</> 등용에 성공했습니다.";
$alllog[] = "<C>●</>{$month}월:<Y>{$myName}</>(이)가 <D><b>{$nationName}</b></>(으)로 <S>망명</>하였습니다.";
$mylog[] = "<C>●</><D>{$nationName}</>(으)로 망명하여 수도로 이동합니다.";
pushGeneralHistory($you, "<C>●</>{$year}{$month}월:<Y>{$myName}</> 등용에 성공");
pushGeneralHistory($me, "<C>●</>{$year}{$month}월:<D>{$nationName}</>(으)로 망명");
$me['nations'] .= "{$nationID},";
$updateMe = [
'belong'=>1,
'nation'=>$nationID,
'level'=>1,
'city'=>$nation['capital'],
'troop'=>0
];
//처리가 조금 다름.
$db = DB::db();
if($me['level'] > 0){
$updateOldNation = [
'totaltech' => $db->sqleval('`tech`*greatest(10, `gennum`-1)'),
'gennum' => $db->sqleval('greatest(10, `gennum`-1)')
];
if($me['gold'] > 1000){
$updateOldNation['gold'] = $db->sqleval('`gold` + %i', $me['gold'] - 1000);
$updateMe['gold'] = 1000;
}
if($me['rice'] > 1000){
$updateOldNation['rice'] = $db->sqleval('`rice` + %i', $me['rice'] - 1000);
$updateMe['rice'] = 1000;
}
$updateMe['betray'] = $db->sqleval('`betray` + 1');
$updateMe['dedication'] = $db->sqleval('dedication*(1-0.1*betray)');
$updateMe['experience'] = $db->sqleval('experience*(1-0.1*betray)');
$db->update('nation', $updateOldNation, 'nation = %i', $messageInfo['dest']['nationID']);
}
else{
$updateMe['dedication'] = $db->sqleval('dedication + 100');
$updateMe['experience'] = $db->sqleval('experience + 100');
}
if($me['npc'] < 2){
$updateMe['killturn'] = $killturn;
}
$db->update('general', $updateMe, 'no = %i', $generalID);
$db->query('UPDATE nation set '.
'gennum = greatest(10, (SELECT count(`id`) from general where `nation` = %i_nation)), '.
'totaltech = tech * greatest(10, (SELECT count(`id`) from general where `nation` = %i_nation)) '.
'where nation=%i_nation', ['nation'=>$nationID]);
//태수 군사 시중 해제
switch($me['level']) {
case 4:
$db->query('update city set gen1=0 where gen1=%i', $generalID);
break;
case 3:
$db->query('update city set gen3=0 where gen2=%i', $generalID);
break;
case 2:
$db->query('update city set gen3=0 where gen2=%i', $generalID);
break;
}
$db->query('UPDATE general left join troop on troop.troop = general.troop set general.troop = 0 where troop.no = %i', $generalID);
$db->query('delete from troop where no = %i', $generalID);
$db->query('UPDATE `message` SET `valid_until`=\'1234-11-22 11:22:33\' WHERE `id` = %i', $messageInfo['id']);
$msg = "{$nationName}(으)로 등용 제의 수락";
sendRawMessage('private', false, $general['no'], $messageInfo['src'], $messageInfo['dest'], $msg, null, null, ['parent'=>$messageInfo['id']]);
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($alllog, $year, $month);
return [true, 'success'];
}
function declineScout($messageInfo, $reason=null){
$me = [
'no'=>$messageInfo['dest']['id'],
'name'=>$messageInfo['dest']['name']
];
$you = ['no'=>$messageInfo['src']['id']];
$nation = getNationStaticInfo($messageInfo['src']['nationID']);
$generalID = $me['no'];
$nationID = $nation['nation'];
$nationName = $nation['name'];
$myName = $me['name'];
$mylog = [];
$youlog = [];
$nationName = $messageInfo['src']['nation'];
if($reason){
$mylog[] = "<C>●</>{$reason} 등용 수락 불가.";
$msg = "{$nationName}(으)로 등용 제의 수락 불가";
}
else{
$youlog[] = "<C>●</><Y>{$me['name']}</>(이)가 등용을 거부했습니다.";
$mylog[] = "<C>●</><D>{$nationName}</>(으)로 망명을 거부했습니다.";
$msg = "{$nationName}(으)로 등용 제의 거부";
}
$db = DB::db();
$db->query('UPDATE `message` SET `valid_until`=\'1234-11-22 11:22:33\' WHERE `id` = %i', $messageInfo['id']);
sendRawMessage('private', false, $you['no'], $messageInfo['src'], $messageInfo['dest'], $msg, null, null, ['parent'=>$messageInfo['id']]);
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
return [true, 'success'];
}
function acceptAlly($messageInfo, $general, $msgResponse){
return [false, 'NYI'];
}
function declineAlly($messageInfo, $general, $msgResponse){
}
function acceptBreakAlly($messageInfo, $general, $msgResponse){
}
function declineBreakAlly($messageInfo, $general, $msgResponse){
}
function acceptStopWar($messageInfo, $general, $msgResponse){
}
function declineStopWar($messageInfo, $general, $msgResponse){
}
function acceptMergeNations($messageInfo, $general, $msgResponse){
}
function declineMergeNations($messageInfo, $general, $msgResponse){
}
function acceptSurrender($messageInfo, $general, $msgResponse){
}
function declineSurrender($messageInfo, $general, $msgResponse){
}
+69 -36
View File
@@ -188,7 +188,7 @@ function getGenDex($general, $type) {
return $general["dex{$type}"];
}
function addGenDex($no, $type, $exp) {
function addGenDex($no, $atmos, $train, $type, $exp) {
$db = DB::db();
$connect=$db->get();
@@ -196,6 +196,7 @@ function addGenDex($no, $type, $exp) {
$dexType = "dex{$type}";
if($type == 30) { $exp = Util::round($exp * 0.90); } //귀병은 90%효율
elseif($type == 40) { $exp = Util::round($exp * 0.90); } //차병은 90%효율
$exp = Util::round($exp * ($atmos+$train) / 200); // 사기 + 훈련 / 200
$query = "update general set {$dexType}={$dexType}+{$exp} where no='$no'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -237,7 +238,7 @@ function SetNationFront($nationNo) {
if($adj){
$db->update('city', [
'front'=>0
'front'=>1
], 'nation=%i and city in %li', $nationNo, array_keys($adj));
}
}
@@ -382,7 +383,7 @@ function preUpdateMonthly() {
}
pushWorldHistory($history, $admin['year'], $admin['month']);
//민심30이하 공백지 처리
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='',conflict2='',term=0,front=0 where rate<='30' and supply='0'";
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='{}',term=0,front=0 where rate<='30' and supply='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 우선 병사수/100 만큼 소비
@@ -412,7 +413,7 @@ function preUpdateMonthly() {
//건국제한, 전략제한, 외교제한-1
$query = "update general set makelimit=makelimit-1 where makelimit>'0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set tricklimit=tricklimit-1 where tricklimit>'0'";
$query = "update nation set sabotagelimit=sabotagelimit-1 where sabotagelimit>'0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set surlimit=surlimit-1 where surlimit>'0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -440,7 +441,7 @@ function preUpdateMonthly() {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set term=term-1 where term>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set conflict='',conflict2='' where term=0";
$query = "update city set conflict='{}' where term=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set state=0 where state=41";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -753,7 +754,7 @@ function checkMerge() {
$query = "delete from nation where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아국 모든 도시들 상대국 소속으로
$query = "update city set nation='{$you['nation']}',gen1='0',gen2='0',gen3='0',conflict='',conflict2='' where nation='{$me['nation']}'";
$query = "update city set nation='{$you['nation']}',gen1='0',gen2='0',gen3='0',conflict='{}' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아국 모든 장수들 일반으로 하고 상대국 소속으로, 수도로 이동
$query = "update general set belong=1,level=1,nation='{$you['nation']}' where nation='{$me['nation']}'";
@@ -884,7 +885,7 @@ function checkSurrender() {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$king = MYDB_fetch_array($result);
// 아국 모든 도시들 상대국 소속으로
$query = "update city set nation='{$you['nation']}',gen1='0',gen2='0',gen3='0',conflict='',conflict2='' where nation='{$me['nation']}'";
$query = "update city set nation='{$you['nation']}',gen1='0',gen2='0',gen3='0',conflict='{}' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 제의국 모든 장수들 공헌도0.95, 명성0.95
$query = "update general set dedication=dedication*0.95,experience=experience*0.95 where nation='{$you['nation']}'";
@@ -1050,12 +1051,16 @@ function checkStatistic() {
$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']}), ";
if(!isset($nationHists[$nation['type']])){
$nationHists[$nation['type']] = 0;
}
$nationHists[$nation['type']]++;
}
$nationHist = '';
for($i=1; $i <= 13; $i++) {
if(!$nationHists[$i]) { $nationHists[$i] = '-'; }
if(!Util::array_get($nationHists[$i])) { $nationHists[$i] = '-'; }
$nationHist .= getNationType($i)."({$nationHists[$i]}), ";
}
@@ -1073,6 +1078,18 @@ function checkStatistic() {
for($i=0; $i < $generalCount; $i++) {
$general = MYDB_fetch_array($result);
if(!isset($personalHists[$general['personal']])){
$personalHists[$general['personal']] = 0;
}
if(!isset($specialHists[$general['special']])){
$specialHists[$general['special']] = 0;
}
if(!isset($specialHists2[$general['special2']])){
$specialHists2[$general['special2']] = 0;
}
$personalHists[$general['personal']]++;
$specialHists[$general['special']]++;
$specialHists2[$general['special2']]++;
@@ -1082,14 +1099,14 @@ function checkStatistic() {
$personalHist = '';
for($i=0; $i < 11; $i++) {
if(!$personalHists[$i]) { $personalHists[$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(!$specialHists[$i]) { $specialHists[$i] = '-'; }
if(!Util::array_get($specialHists[$i])) { $specialHists[$i] = '-'; }
$specialHist .= $call."({$specialHists[$i]}), ";
}
@@ -1099,7 +1116,7 @@ function checkStatistic() {
for($i=40; $i < 80; $i++) {
$call = getGenSpecial($i);
if($call) {
if(!$specialHists2[$i]) { $specialHists2[$i] = '-'; }
if(!Util::array_get($specialHists2[$i])) { $specialHists2[$i] = '-'; }
$specialHist .= $call."({$specialHists2[$i]}), ";
}
@@ -1278,31 +1295,47 @@ function checkEmperior() {
$nationHistory = DB::db()->queryFirstField('SELECT `history` FROM `nation` WHERE `nation` = %i', $nation['nation']);
$query = "
insert into emperior (
phase,
nation_count, nation_name, nation_hist,
gen_count, personal_hist, special_hist,
name, type, color, year, month, power, gennum, citynum,
pop, poprate, gold, rice,
l12name, l12pic, l11name, l11pic,
l10name, l10pic, l9name, l9pic,
l8name, l8pic, l7name, l7pic,
l6name, l6pic, l5name, l5pic,
tiger, eagle, gen, history
) values (
'-',
'$statNC', '{$statNation['nation_name']}', '{$statNation['nation_hist']}',
'$statGC', '{$statGeneral['personal_hist']}', '{$statGeneral['special_hist']}',
'{$nation['name']}', '{$nation['type']}', '{$nation['color']}', '{$admin['year']}', '{$admin['month']}', '{$nation['power']}', '{$nation['gennum']}', '$allcount',
'$pop', '$poprate', '{$nation['gold']}', '{$nation['rice']}',
'{$level12['name']}', '{$level12['picture']}', '{$level11['name']}', '{$level11['picture']}',
'{$level10['name']}', '{$level10['picture']}', '{$level9['name']}', '{$level9['picture']}',
'{$level8['name']}', '{$level8['picture']}', '{$level7['name']}', '{$level7['picture']}',
'{$level6['name']}', '{$level6['picture']}', '{$level5['name']}', '{$level5['picture']}',
'$tigerstr', '$eaglestr', '$gen', '{$nationHistory}'
)";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->insert('emperior', [
'phase'=>'-',
'nation_count'=>$statNC,
'nation_name'=>$statNation['nation_name'],
'nation_hist'=>$statNation['nation_hist'],
'gen_count'=>$statGC,
'personal_hist'=>$statGeneral['personal_hist'],
'special_hist'=>$statGeneral['special_hist'],
'name'=>$nation['name'],
'type'=>$nation['type'],
'color'=>$nation['color'],
'year'=>$admin['year'],
'month'=>$admin['month'],
'power'=>$nation['power'],
'gennum'=>$nation['gennum'],
'citynum'=>$allcount,
'pop'=>$pop,
'poprate'=>$poprate,
'gold'=>$nation['gold'],
'rice'=>$nation['rice'],
'l12name'=>$level12['name'],
'l12pic'=>$level12['picture'],
'l11name'=>$level11['name'],
'l11pic'=>$level11['picture'],
'l10name'=>$level10['name'],
'l10pic'=>$level10['picture'],
'l9name'=>$level9['name'],
'l9pic'=>$level9['picture'],
'l8name'=>$level8['name'],
'l8pic'=>$level8['picture'],
'l7name'=>$level7['name'],
'l7pic'=>$level7['picture'],
'l6name'=>$level6['name'],
'l6pic'=>$level6['picture'],
'l5name'=>$level5['name'],
'l5pic'=>$level5['picture'],
'tiger'=>$tigerstr,
'eagle'=>$eaglestr,
'gen'=>$gen,
'history'=>$nationHistory
]);
$history = ["<C>●</>{$admin['year']}{$admin['month']}월:<Y><b>【통일】</b></><D><b>{$nation['name']}</b></>(이)가 전토를 통일하였습니다."];
pushWorldHistory($history, $admin['year'], $admin['month']);
+36 -19
View File
@@ -5,7 +5,7 @@ namespace sammo;
function delStepLog() {
$date = date('Y_m_d');
@unlink("logs/_{$date}_steplog.txt");
@unlink(__dir__."/logs/_{$date}_steplog.txt");
}
function pushRawFileLog($path, $lines){
@@ -43,79 +43,95 @@ function getFormattedFileLogAll(string $path){
}, getRawFileLogAll($path));
}
function eraseTnmtFightLogAll(){
foreach(range(0, 49) as $i){
eraseTnmtFightLog($i);
}
}
function eraseTnmtFightLog(int $group){
$filepath = __dir__."/logs/fight{$group}.txt";
if(file_exists($filepath)){
@unlink($filepath);
}
}
function pushTnmtFightLog(int $group, $log) {
pushRawFileLog("logs/fight{$group}.txt", $log);
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
}
function getTnmtFightLogAll(int $group) {
return join('<br>',getFormattedFileLogAll("logs/fight{$group}.txt"));
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
}
function pushTrickLog($log) {
pushRawFileLog("logs/_tricklog.txt", $log);
function pushSabotageLog($log) {
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
}
function getTrickLogRecent($count) {
return join('<br>', getFormattedFileLogRecent("logs/_tricklog.txt", $count, 150));
function getSabotageLogRecent($count) {
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/_sabotagelog.txt", $count, 150));
}
function pushProcessLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_processlog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
}
function pushStepLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_steplog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
}
function pushLockLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_locklog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
}
function pushAdminLog($log) {
pushRawFileLog("logs/_adminlog.txt", $log);
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
}
function pushAuctionLog($log) {
pushRawFileLog("logs/_auctionlog.txt", $log);
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
}
function getAuctionLogRecent(int $count) {
return join('<br>', getFormattedFileLogRecent("logs/_auctionlog.txt", $count, 300));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/_auctionlog.txt", $count, 300)));
}
function pushGenLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/gen{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
}
function getGenLogRecent(int $no, int $count) {
return join('<br>', getFormattedFileLogRecent("logs/gen{$no}.txt", $count, 300));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/gen{$no}.txt", $count, 300)));
}
function pushBatRes($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/batres{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
}
function getBatResRecent(int $no, int $count) {
return join('<br>', getFormattedFileLogRecent("logs/batres{$no}.txt", $count, 300));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batres{$no}.txt", $count, 300)));
}
function pushBatLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/batlog{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
}
function getBatLogRecent(int $no, int $count) {
return join('<br>', getFormattedFileLogRecent("logs/batlog{$no}.txt", $count, 300));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batlog{$no}.txt", $count, 300)));
}
//DB-based
function pushNationHistory($nation, $history) {
if(!$nation || !$nation['nation']){
return;
}
DB::db()->query("UPDATE nation set history=concat(%s, history) where nation=%i",
$history.'<br>', $nation['nation']);
}
@@ -226,6 +242,7 @@ function getGeneralPublicRecordWithDate($year, $month) {
if(!$texts){
return ConvertLog("<C>●</>{$month}월: 기록 없음");
}
return join('<br>', $texts);
}
function LogHistory($isFirst=0) {
+11 -12
View File
@@ -29,31 +29,30 @@ function bar($per, $h=7) {
$per = round($per, 1);
if($per < 1 || $per > 99) { $per = Util::round($per); }
$str1 = "<td width={$per}% background=".ServConfig::$gameImagePath."/pb{$h2}.gif></td>";
$str2 = "<td width=*% background=".ServConfig::$gameImagePath."/pr{$h2}.gif></td>";
$str1 = "<td width='{$per}%' background=".ServConfig::$gameImagePath."/pb{$h2}.gif></td>";
$str2 = "<td width='*%' background=".ServConfig::$gameImagePath."/pr{$h2}.gif></td>";
if($per <= 0) { $str1 = ""; }
elseif($per >= 100) { $str2 = ""; }
$str = "
<table width=100% height={$h} border={$bd} cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:1;>
<table width=100% height={$h} border={$bd} cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black>
<tr>{$str1}{$str2}</tr>
</table>";
return $str;
}
function OptionsForCitys() {
foreach(CityConst::all() as $city){
echo "
<option value={$city->id}>{$city->name}</option>";
}
function optionsForCities() {
return join('', array_map(function($city){
return "<option value='{$city->id}'>{$city->name}</option>";
}, CityConst::all()));
}
function Submit($url, $msg="", $msg2="") {
echo "a"; // 파폭 버그 때문
echo "
<form method=post name=f1 action='{$url}'>
<input type=hidden name=msg value='{$msg}'>
<input type=hidden name=msg2 value='{$msg2}'>
<input type=hidden name=msg value=\"{$msg}\">
<input type=hidden name=msg2 value=\"{$msg2}\">
</form>
<script>f1.submit();</script>
";
@@ -71,7 +70,7 @@ function GetNationColors() {
function backButton() {
return "
<input type=button value='돌아가기' onclick=location.replace('index.php')><br>
<input type=button value='돌아가기' onclick=location.replace('./')><br>
";
}
@@ -88,7 +87,7 @@ function closeButton() {
}
function printCitysName(int $cityNo, int $maxDistance=1) {
function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1) {
$distanceList = searchDistance($cityNo, $maxDistance, true);
for($dist = 1; $dist <= $maxDistance; $dist++){
+12 -7
View File
@@ -51,7 +51,7 @@ function getWorldMap($req){
}
$session = Session::getInstance();
$generalID = $session->generalID;
$userID = $session->userID;
$db = DB::db();
@@ -60,13 +60,18 @@ function getWorldMap($req){
$year = Util::toInt($game['year']);
$month = Util::toInt($game['month']);
if($generalID && ($req->showMe || !$req->neutralView)){
$city = $db->queryFirstRow(
'select `city`, `nation` from `general` where `no`=%i',
$generalID);
$general = $db->queryFirstRow(
'select `no`, `city`, `nation` from `general` where `owner`=%i',
$userID);
$myCity = Util::toInt($city['city']);
$myNation = Util::toInt($city['nation']);
if($general && ($req->showMe || !$req->neutralView)){
if($session->generalID !== $general['no']){
$session->logoutGame()->loginGame();
}
$myCity = Util::toInt($general['city']);
$myNation = Util::toInt($general['nation']);
if(!$req->showMe){
$myCity = null;
+13 -387
View File
@@ -1,280 +1,45 @@
<?php
namespace sammo;
class Message{
//기본 정보
public $id;
public $mailbox;
public $type;
public $isSender;
/** @var mixed[] */
public $src;
/** @var mixed[] */
public $dest;
public $time;
public $text;
public $option;
function __construct($row){
$db_message = $row['message'];
$this->id = $row['id'];
$this->mailbox = $row['mailbox'];
$this->type = $row['type'];
$this->isSender = $row['is_sender'] != 0;
$this->src = $db_message['src'];
if($this->src['nation'] === null){
$this->src['nation'] = '재야';
$this->src['color'] = '#FFFFFF';
$this->src['nation_id'] = null;
}
$this->dest = $db_message['dest'];
if($this->dest['nation'] === null){
$this->dest['nation'] = '재야';
$this->dest['color'] = '#FFFFFF';
$this->dest['nation_id'] = null;
}
$this->time = $row['time'];
$this->text = $db_message['text'];
$this->option = $db_message['option'];
}
}
function getSingleMessage($messageID){
$messageInfo = DB::db()->queryFirstRow('select * from `message` where `id` = %i', $messageID);
if (!$messageInfo) {
return [false, '존재하지 않는 메시지'];
}
return [true, $messageInfo];
}
function getRawMessage($mailbox, $msgType, $limit=30, $fromSeq=null){
$sql = 'select * from `message` where `mailbox` = %i_mailbox and `type` = %s_type and `valid_until` > now()';
if($fromSeq !== null){
$sql .= ' and `id` > %i_id';
}
$sql .= ' ORDER BY `id` desc';
if($limit > 0){
$sql .= ' LIMIT %i_limit';
}
//TODO: table 네임의 prefix를 처리할 수 있도록 개선
$result = DB::db()->query($sql, [
'mailbox' => $mailbox,
'type' => $msgType,
'limit' => $limit,
'time' => $fromTime
]);
return array_map(function ($row){
return new Message($row);
}, $result);
}
function getMessage($msgType, $nationID=null, $limit=30, $fromSeq=null){
$generalID = Session::getInstance()->generalID;
if($generalID === null){
return [];
}
if($msgType === 'public'){
return getRawMessage(9999, 'public', $limit, $fromSeq);
}
else if($msgType === 'private'){
return getRawMessage($generalID, 'private', $limit, $fromSeq);
}
else if($msgType === 'national'){
if($nationID === null){
return [];
}
return getRawMessage($nationID + 9000, 'national', $limit, $fromSeq);
}
else if($msgType === 'diplomacy'){
if($nationID === null){
return [];
}
return getRawMessage($nationID + 9000, 'diplomacy', $limit, $fromSeq);
}
else{
return [];
}
}
function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date, $validUntil, $msgOption){
$srcNation = getNationStaticInfo($src['nation_id']);
$destNation = getNationStaticInfo($dest['nation_id']);
$src['nation'] = Util::array_get($srcNation['name'], '재야');
$src['color'] = Util::array_get($srcNation['color'], '#ffffff');
$dest['nation'] = Util::array_get($destNation['name'], '재야');
$dest['color'] = Util::array_get($destNation['color'], '#ffffff');
if(!$isSender && $mailbox < 9000 && Util::array_get($msgOption['alert'], false)){
//TODO:newmsg보단 lastmsg로 datetime을 넣는게 더 나아보임
DB::db()->update('general', array(
'newmsg' => true
), 'no=%i', $dest['id']);
}
if(isset($msgOption['alert'])){
unset($msgOption['alert']);
}
DB::db()->insert('message', [
'address' => $dest,
'type' => $msgType,
'is_sender' => $isSender,
'src' => $src['id'],
'dest' => $dest['id'],
'time' => $date,
'valid_until' => $validUntil,
'message' => Json::encode([
'src' => $src,
'dest' =>$dest,
'text' => $msg,
'option' => $msgOption
], Json::DELETE_NULL)
]);
}
/**
* @param string $msgType
* @param mixed[] $src
* @param mixed[] $dest
* @param null|string $date
* @param null|string $validUntil
*/
function sendMessage($msgType, array $src, array $dest, $msg, $date = null, $validUntil = null, $msgOption = null){
if($date === null){
$date = (new \Datetime())->format('Y-m-d H:i:s');
}
if($validUntil === null){
$validUntil = '9999-12-31 12:59:59';
}
if($msgType === 'public'){
//dest는 필요하지 않음
$srcMailbox = null;
$destMailbox = 9999;
$dest['id'] = 9999;
}
else if($msgType === 'national'){
//dest는 nation_id만 필요함
$dest['id'] = $dest['nation_id'] + 9000;
if($src['nation_id'] === $dest['nation_id']){
$srcMailbox = null;
}
else{
$srcMailbox = $src['nation_id'] + 9000;
}
$destMailbox = $dest['nation_id'] + 9000;
}
else if($msgType === 'diplomacy'){
//NOTE:외교 서신의 경우 '동일한 내용'이 두번 가지 않으므로, 별도 처리가 필요함
$src['id'] = $dest['nation_id'] + 9000;
$dest['id'] = $dest['nation_id'] + 9000;
$destMailbox = $dest['id'];
}
else{
//dest는 id, name이 필수
$srcMailbox = $src['id'];
$destMailbox = $dest['id'];
}
if($srcMailbox !== null){
sendRawMessage($msgType, true, $srcMailbox, $src, $dest, $msg, $date, $validUntil, null);
}
sendRawMessage($msgType, false, $destMailbox, $src, $dest, $msg, $date, $validUntil, null);
return true;
}
function sendScoutMsg($src, $dest, $date) {
//$msgType, $isSender, $mailbox, $src, $dest, $msg, $date, $validUntil, $msgOption
if(!$src || !$src['id'] || !$src['nation_id']){
return false;
}
$nation = getNationStaticInfo($src['nation_id']);
$nationName = Util::array_get($nation['name'], '재야');
if(!$dest || !$dest['id']){
return false;
}
$msgType = 'private';
$option = [
"action" => "scout"
];
$msg = "{$src['nation']}(으)로 망명 권유 서신";
$validUntil = "9999-12-31 12:59:59";//등용장의 시간 제한 없음
sendRawMessage('private', false, $dest['id'], $src, $dest, $msg, $date, $validUntil, $option);
return true;
}
function getMailboxList(){
$generalNations = [];
foreach(DB::db()->query('select `no`, `name`, `nation`, `level`, `npc` from `general` where `npc` < 2') as $general)
foreach(DB::db()->queryAllLists('select `no`, `name`, `nation`, `level`, `npc` from `general` where `npc` < 2') as $general)
{
list($generalID, $generalName, $nationID, $level, $npc) = $general;
if(!isset($generalNations[$nationID])){
$generalNations[$nationID] = [];
}
$isChief = ($level == 12);
$obj = [$generalID, $generalName, 0];
$obj = [$generalID, $generalName];
if($isChief){
$obj[] = 1;
if($level == 12){
$obj[2] |= 1;
}
if($npc == 1){
$obj[2] |= 2;
}
//TODO: 빙의장 정보 추가
$generalNations[$nationID][] = $obj;
}
$neutral = [
"nation"=>0,
"name"=>"재야",
"color"=>"#ffffff"
];
$result = array_map(function($nation) use ($generalNations) {
$nationID = $nation['nation'];
$mailbox = $nationID + 9000;
$nation = $nation['name'];
$mailbox = $nationID + Message::MAILBOX_NATIONAL;
$nationName = $nation['name'];
$color = $nation['color'];
$generals = Util::array_get($generalNations[$nationID], []);
return [
"nationID"=>$nationID,
"mailbox"=>$mailbox,
"nation"=>$nationID,
"name"=>$nationName,
"color"=>$color,
"general"=>$generals
];
}, array_merge([$neutral], getAllNationStaticInfo()));
}, array_merge([getNationStaticInfo(0)], getAllNationStaticInfo()));
return $result;
@@ -283,70 +48,6 @@ function getMailboxList(){
//Legacy
// type : xx,xx(불가침기간,타입)
// who : xxxx,xxxx(발신인, 수신인)
function DecodeMsg($msg, $type, $who, $date, $bg, $num=0) {
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
//FIXME: 폐기
$query = "select no,nation,name,picture,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
// 1 : 전메, 2 : 아국->타국, 3 : 타국->아국
// 4 : 합병, 5 : 통합, 6 : 불가침, 7 : 종전, 8 : 파기
// 9 : 자신->타인, 10 : 타인 -> 자신, 11 : 등용
$category = $type % 100;
$term = intdiv($type, 100);
$from = intdiv($who, 10000);
$to = $who % 10000;
$query = "select name,picture,imgsvr,nation from general where no='$from'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$sndr = MYDB_fetch_array($result);
if($sndr['nation'] == 0) {
$sndrnation = [];
$sndrnation['name'] = '재야';
$sndrnation['color'] = '#FFFFFF';
} else {
$sndrnation = getNationStaticInfo($sndr['nation']);
}
switch($bg) {
case 2:
case 4: $bgcolor = "CC6600"; break;
}
if($category == 6) {
$query = "select reserved from diplomacy where me='{$sndr['nation']}' and you='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}", $sndrnation['color'], $sndr['name'], $sndrnation['color'], $msg, $date, $num, $from, $term, $me['level'], $dip['reserved']);
} elseif($category <= 8) {
$rcvrnation = getNationStaticInfo($to);
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}", $sndrnation['color'], $rcvrnation['name'], $rcvrnation['color'], $msg, $date, $num, $from, $term, $me['level']);
} elseif($category <= 11) {
$query = "select name,picture,nation from general where no='$to'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$rcvr = MYDB_fetch_array($result);
if($rcvr['nation'] == 0) {
$rcvrnation = [];
$rcvrnation['name'] = '재야';
$rcvrnation['color'] = '#FFFFFF';
} else {
$rcvrnation = getNationStaticInfo($rcvr['nation']);
}
ShowMsg($bgcolor, $category, $sndr['picture'], $sndr['imgsvr'], "{$sndr['name']}:{$sndrnation['name']}", $sndrnation['color'], "{$rcvr['name']}:{$rcvrnation['name']}", $rcvrnation['color'], $msg, $date, $num, $from, $term);
}
}
function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
$db = DB::db();
$connect=$db->get();
@@ -355,78 +56,3 @@ function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $
$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),"");
}
function MsgDip($bg) {
$db = DB::db();
$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);
$query = "select dip0,dip1,dip2,dip3,dip4,dip0_who,dip1_who,dip2_who,dip3_who,dip4_who,dip0_when,dip1_when,dip2_when,dip3_when,dip4_when,dip0_type,dip1_type,dip2_type,dip3_type,dip4_type from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($nation['dip0']) { echo "\n"; DecodeMsg($nation['dip0'], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); }
if($nation['dip1']) { echo "\n"; DecodeMsg($nation['dip1'], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); }
if($nation['dip2']) { echo "\n"; DecodeMsg($nation['dip2'], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); }
if($nation['dip3']) { echo "\n"; DecodeMsg($nation['dip3'], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); }
if($nation['dip4']) { echo "\n"; DecodeMsg($nation['dip4'], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); }
}
function ShowMsg($bgcolor, $type, $picture, $imgsvr, $me, $mycolor, $you, $youcolor, $msg, $date, $num=0, $who=0, $when=0, $level=0, $note="") {
if($msg == "") return;
$msg = Tag2Code($msg);
$site = ""; $form = ""; $form2 = "";
if($type == 11 || ($type >= 4 && $type <= 8 && $level >= 5)) {
$corebutton = "&nbsp;<input type=submit name=ok value=수락 onclick='return confirm(\"정말 수락하시겠습니까?\")'><input type=submit name=ok value=거절 onclick='return confirm(\"정말 거절하시겠습니까?\")'>";
} else {
$corebutton = "&nbsp;【수락】【거절】";
}
if($type == 6) {
$corebutton .= "<br>비고: {$note}";
}
switch($type) {
case 1: $sign = ""; $corebutton = ""; break;
case 2: $sign = ""; $corebutton = ""; break;
case 3: $sign = ""; $corebutton = ""; break;
case 4: $sign = ""; $site = "d_surrender.php"; break;
case 5: $sign = ""; $site = "d_merge.php"; break;
case 6: $sign = ""; $site = "d_ally.php"; break;
case 7: $sign = ""; $site = "d_cease.php"; break;
case 8: $sign = ""; $site = "d_cancel.php"; break;
case 9: $sign = ""; $corebutton = ""; break;
case 10: $sign = ""; $corebutton = ""; break;
case 11: $sign = ""; $site = "d_scout.php"; break;
}
$imageTemp = GetImageURL($imgsvr);
$naming = "[<font color=$mycolor>$me</font>{$sign}<font color=$youcolor>$you</font>]";
$picture = "<img src={$imageTemp}/{$picture}>";
if($site != "") {
$form = "<form name=scout method=post action={$site}>";
$form2 = "</form>";
}
if($num >= 0) { $num = "<input type=hidden name=num value=$num>"; }
else { $num = ""; }
if($who > 0) { $who = "<input type=hidden name=gen value=$who>"; }
else { $who = ""; }
if($when > 0) { $when = "<input type=hidden name=when value=$when>"; }
else { $when = ""; }
echo "
<table width=498 border=1 bordercolordark=gray bordercolorlight=black cellpadding=0 cellspacing=0 bgcolor='$bgcolor' style=font-size:13px;table-layout:fixed;word-break:break-all;>
<tr>
<td width=64 height=64>$picture</td>
$form
<td width=434 valign=top><b>$naming</b><font size=1><$date></font> <br>{$msg}{$corebutton}</td>
$num
$who
$when
$form2
</tr>
</table>
";
}
+155 -40
View File
@@ -192,7 +192,15 @@ function processAI($no) {
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$nation = MYDB_fetch_array($result)??[
'nation'=>0,
'color'=>'#000000',
'name'=>'재야',
'level'=>0,
'gold'=>0,
'rice'=>0,
'tech'=>0,
];
$coreCommand = array();
if($general['level'] >= 5) {
@@ -261,6 +269,7 @@ function processAI($no) {
}
$tech = getTechCost($nation['tech']);
$resrc = $tech * 700;//XXX: 왜 700이지?
if($general['atmos'] >= 90 && $general['train'] >= 90) {
if($general['mode'] == 0) {
@@ -274,22 +283,28 @@ function processAI($no) {
}
}
//유기체메시지 출력 하루 6번
//운영자메시지 출력 하루 6번..?
//특별 메세지 있는 경우 출력 하루 4번
switch($admin['turnterm']) {
case 0: $term = 1; break;
case 1: $term = 1; break;
case 2: $term = 2; break;
case 3: $term = 3; break;
case 4: $term = 6; break;
case 5: $term = 12; break;
case 6: $term = 30; break;
case 7: $term = 60; break;
}
if($general['npcid'] == 2000 && rand()%(24*$term) < 6) {
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
} elseif($general['npcmsg'] != "" && rand()%(24*$term) < 3) {
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
$term = $admin['turnterm'];
if($general['npcmsg'] && Util::randBool($term / (6*60))) {
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$general['npcmsg'],
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
//재야인경우
@@ -571,33 +586,98 @@ function processAI($no) {
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
else { $type = "rice"; $type2 = 2; }
if($nation[$type] < 1000) { // 몰수
if($nation[$type] < $type2*3000) { // 몰수
// 몰수 대상
$query = "select no,{$type} from general where nation='{$general['nation']}' and no!='{$general['no']}' and {$type}>3000 order by {$type} desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result);
if($SelGen['no'] != 0) {
$amount = intdiv($SelGen[$type], 5000)*10 + 10;
if($amount > 100) $amount = 100;
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, $SelGen['no'], $amount, 24); // 금,쌀 1000단위 몰수
$command = EncodeCommand($type2, $genID, $amount, 24); // 금,쌀 1000단위 몰수
}
} else { // 포상
// 포상 대상
$query = "select no from general where nation='{$general['nation']}' and no!='{$general['no']}' and killturn>=5 order by {$type} limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result);
if($SelGen['no'] != 0) {
$amount = intdiv(($nation[$type]-GameConst::$baserice), 5000)*10 + 10;
if($amount > 100) $amount = 100;
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, $SelGen['no'], $amount, 23); // 금 1000단위 포상
$command = EncodeCommand($type2, $genID, $amount, 23); // 금,쌀 1000단위 포상
}
}
}
}
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
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),"");
}
}
}
@@ -635,6 +715,41 @@ function processAI($no) {
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return;
}
if($general['leader'] < 40){
//무지장인데
if(
(($nation['rice'] - GameConst::$baserice) * 3 <= $general['rice'] && $general['rice'] >= $resrc + 2100) ||
($general['rice'] >= 11000)
){
//쌀을 많이 들고 있다면
$amount = $general['rice'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$command = EncodeCommand(0, 2, $amount, 44); //헌납
$db->update('general', [
'turn0'=>$command
], 'no=%i',$general['no']);
return;
}
if(
(($nation['gold'] - GameConst::$basegold) * 3 <= $general['gold'] && $general['gold'] >= $resrc + 2100) ||
($general['gold'] >= 12000)
){
//금을 많이 들고 있다면
$amount = $general['gold'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$command = EncodeCommand(0, 1, $amount, 44); //헌납
$db->update('general', [
'turn0'=>$command
], 'no=%i',$general['no']);
return;
}
}
//국가 병량이 없을때 바로 헌납
if($nation['rice'] < 2000 && $general['rice'] > 200) {
$amount = intdiv($general['rice'] - 200, 100) + 1;
@@ -653,7 +768,7 @@ function processAI($no) {
// ┃조┃ ┃쌀삼
// 0┗━┻━━━━┻━━━> G
// 100 700
$resrc = $tech * 700;
$target = array();
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
@@ -663,11 +778,11 @@ function processAI($no) {
if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
elseif($general['gold'] < 100) { //금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 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['rice'] < 100) { //쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
$command = EncodeCommand(0, 2, $amount, 49); //삼
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
else {
@@ -743,12 +858,12 @@ function processAI($no) {
else { $command = EncodeCommand(0, 0, 0, 1); }
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
//금이 더 많으면 매매
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$amount = intdiv(($general['gold'] - $general['rice']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
//쌀이 더 많으면 매매
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
$amount = intdiv(($general['rice'] - $general['gold']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
//자원, 병사 모두 충족
@@ -777,11 +892,11 @@ function processAI($no) {
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) { // 금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
$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) { // 쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$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); } //내정장일때 내정
+93 -72
View File
@@ -1,7 +1,6 @@
<?php
namespace sammo;
/**
* 장수의 통솔을 받아옴
*
@@ -14,6 +13,9 @@ namespace sammo;
* @return int|float 계산된 능력치
*/
function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$leadership = $general['leader'];
if($withInjury){
$leadership *= (100 - $general['injury']) / 100;
@@ -48,6 +50,9 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
* @return int|float 계산된 능력치
*/
function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$power = $general['power'];
if($withInjury){
$power *= (100 - $general['injury']) / 100;
@@ -79,6 +84,10 @@ function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $us
* @return int|float 계산된 능력치
*/
function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$intel = $general['intel'];
if($withInjury){
$intel *= (100 - $general['injury']) / 100;
@@ -167,10 +176,10 @@ function setLeadershipBonus(&$general, $nationLevel){
function CriticalScore($score, $type) {
switch($type) {
case 0:
$ratio = (rand()%9 + 20)/10; // 2.0~2.8
$ratio = Util::randF()*0.8 + 2.2; // 2.2~3.0
break;
case 1:
$ratio = (rand()%3 + 2)/10; // 0.2~0.4
$ratio = Util::randF()*0.2 + 0.2; // 0.2~0.4
break;
}
return Util::round($score * $ratio);
@@ -230,20 +239,21 @@ function process_1(&$general, $type) {
// 군사 보정
if($general['level'] == 3 && $general['no'] == $city['gen2']) { $score *= 1.05; }
$rd = rand() % 100;
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 2);
// 특기보정 : 경작, 상재
if($type == 1 && $general['special'] == 1) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 2) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 1 && $general['special'] == 1) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 2) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}{$atype} <span class='ev_failed'>실패</span>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city['rate'] >= 80 && $r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}{$atype} <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -323,10 +333,12 @@ function process_3(&$general) {
// 군주, 참모, 모사 보정
if($general['level'] == 12 || $general['level'] == 11 || $general['level'] == 9 || $general['level'] == 7 || $general['level'] == 5) { $score *= 1.05; }
$rd = rand() % 100;
$r = CriticalRatioDomestic($general, 0);
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 2);
// 특기보정 : 발명
if($general['special'] == 3) { $score *= 1.1; $admin['develcost'] *= 0.8; $r['succ'] += 10; }
if($general['special'] == 3) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
@@ -334,7 +346,7 @@ function process_3(&$general) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}를 <span class='ev_failed'>실패</span>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city['rate'] >= 80 && $r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}를 <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -421,10 +433,10 @@ function process_4(&$general) {
// 시중 보정
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
$rd = rand() % 100;
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 0);
// 특기보정 : 인덕
if($general['special'] == 20) { $r['succ'] += 10; $admin['develcost'] *= 0.8; $score *= 1.1; }
if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//버그방지
if($score < 1) $score = 1;
@@ -432,7 +444,7 @@ function process_4(&$general) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:선정을 <span class='ev_failed'>실패</span>하여 민심이 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:선정을 <S>성공</>하여 민심이 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -519,11 +531,13 @@ function process_5(&$general, $type) {
// 태수 보정
if($general['level'] == 4 && $general['no'] == $city['gen1']) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$r = CriticalRatioDomestic($general, 0);
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 1);
// 특기보정 : 수비, 축성
if($type == 1 && $general['special'] == 11) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 10) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 1 && $general['special'] == 11) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 10) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
@@ -531,7 +545,7 @@ function process_5(&$general, $type) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}를 <span class='ev_failed'>실패</span>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city['rate'] >= 80 && $r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}를 <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -611,10 +625,10 @@ function process_7(&$general) {
// 시중 보정
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 0);
// 특기보정 : 인덕
if($general['special'] == 20) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//버그방지
if($score < 1) $score = 1;
@@ -622,7 +636,7 @@ function process_7(&$general) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:장려를 <span class='ev_failed'>실패</span>하여 주민이 <C>{$score}0</>명 증가했습니다. <1>$date</>";
} elseif($r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:장려를 <S>성공</>하여 주민이 <C>{$score}0</>명 증가했습니다. <1>$date</>";
} else {
@@ -708,10 +722,12 @@ function process_8(&$general) {
// 태수 보정
if($general['level'] == 4 && $general['no'] == $city['gen1']) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$r = CriticalRatioDomestic($general, 0);
$rd = Util::randF();
$r = CriticalRatioDomestic($general, 1);
// 특기보정 : 통찰
if($general['special'] == 12) { $r['succ'] += 10; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($general['special'] == 12) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
@@ -719,7 +735,7 @@ function process_8(&$general) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}을 <span class='ev_failed'>실패</span>하여 <C>$score</> 강화했습니다. <1>$date</>";
} elseif($city['rate'] >= 80 && $r['succ'] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[] = "<C>●</>{$admin['month']}월:{$dtype}을 <S>성공</>하여 <C>$score</> 강화했습니다. <1>$date</>";
} else {
@@ -821,7 +837,7 @@ function process_9(&$general) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
switch(rand()%3) {
switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) {
case 0:
$general['leader2']++;
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
@@ -849,11 +865,10 @@ function process_11(&$general, $type) {
$log = [];
$alllog = [];
$history = [];
global $_defaultatmos, $_defaulttrain, $_defaultatmos2, $_defaulttrain2;
$date = substr($general['turntime'],11,5);
if($type == 1) { $defaultatmos = $_defaultatmos; $defaulttrain = $_defaulttrain; }
else { $defaultatmos = $_defaultatmos2; $defaulttrain = $_defaulttrain2; }
if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; }
else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; }
$query = "select year,month,startyear from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1001,7 +1016,7 @@ function process_11(&$general, $type) {
$exp = $crew;
$ded = $crew;
// 숙련도 증가
addGenDex($general['no'], $armtype, $crew);
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $armtype, $crew);
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
@@ -1036,7 +1051,6 @@ function process_13(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_maxtrain, $_training, $_atmosing;
$date = substr($general['turntime'],11,5);
$query = "select year,month from game limit 1";
@@ -1059,30 +1073,30 @@ function process_13(&$general) {
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 훈련 실패. <1>$date</>";
} elseif($general['crew'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
} elseif($general['train'] >= $_maxtrain) {
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
// } elseif(intdiv($general['crewtype'], 10) == 4) {
// $log[] = "<C>●</>{$admin['month']}월:병기는 훈련이 불가능합니다. <1>$date</>";
} else {
// 훈련시
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * $_training);
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
$log[] = "<C>●</>{$admin['month']}월:훈련치가 <C>$score</> 상승했습니다. <1>$date</>";
$exp = 100;
$ded = 70;
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], Util::round($general['crew']/100));
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 훈련치 변경
$score += $general['train'];
if($score > $_maxtrain) { $score = $_maxtrain; }
if($score > GameConst::$maxTrainByCommand) { $score = GameConst::$maxTrainByCommand; }
$query = "update general set train='$score' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 사기 약간 감소
$score = intval($general['atmos'] * $_atmosing);
$score = intval($general['atmos'] * GameConst::$atmosSideEffectByTraining);
if($score < 0 ) { $score = 0; }
$query = "update general set atmos='$score' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1103,7 +1117,6 @@ function process_14(&$general) {
$db = DB::db();
$connect=$db->get();
global $_maxatmos, $_training;
$log = [];
$alllog = [];
$history = [];
@@ -1131,26 +1144,26 @@ function process_14(&$general) {
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
} elseif($general['gold'] < $general['crew']/100) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
} elseif($general['atmos'] >= $_maxatmos) {
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
// } elseif(intdiv($general['crewtype'], 10) == 4) {
// $log[] = "<C>●</>{$admin['month']}월:병기는 사기 진작이 불가능합니다. <1>$date</>";
} else {
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * $_training);
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
$gold = $general['gold'] - Util::round($general['crew']/100);
$log[] = "<C>●</>{$admin['month']}월:사기치가 <C>$score</> 상승했습니다. <1>$date</>";
$exp = 100;
$ded = 70;
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], Util::round($general['crew']/100));
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 사기치 변경 // 자금 감소 // 경험치 상승 // 공헌도, 명성 상승
$score += $general['atmos'];
if($score > $_maxatmos) { $score = $_maxatmos; }
if($score > GameConst::$maxAtmosByCommand) { $score = GameConst::$maxAtmosByCommand; }
$general['leader2']++;
$query = "update general set resturn='SUCCESS',atmos='$score',gold='$gold',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1166,7 +1179,6 @@ function process_15(&$general) {
$db = DB::db();
$connect=$db->get();
global $_maxatmos, $_maxtrain;
$log = [];
$alllog = [];
$history = [];
@@ -1219,7 +1231,7 @@ function process_15(&$general) {
$exp = 100 * 3;
$ded = 70 * 3;
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], Util::round($general['crew']/100 * 3));
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100 * 3));
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
@@ -1249,15 +1261,14 @@ function process_16(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select nation,war,tricklimit,tech from nation where nation='{$general['nation']}'";
$query = "select nation,war,sabotagelimit,tech from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$query = "select path,nation,supply from city where city='{$general['city']}'";
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$path = explode("|", $city['path']);
$command = DecodeCommand($general['turn0']);
$destination = $command[1];
@@ -1265,7 +1276,7 @@ function process_16(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destcity = MYDB_fetch_array($result);
$query = "select nation,tricklimit,tech from nation where nation='{$destcity['nation']}'";
$query = "select nation,sabotagelimit,tech from nation where nation='{$destcity['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dnation = MYDB_fetch_array($result);
@@ -1273,15 +1284,18 @@ function process_16(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
for($i=0; $i < count($path); $i++) {
if($path[$i] == $destination) { $valid = 1; }
if(key_exists($destination, CityConst::byID($general['city'])->path)){
$nearCity = true;
}
else{
$nearCity = false;
}
if($admin['year'] < $admin['startyear']+3) {
$log[] = "<C>●</>{$admin['month']}월:현재 초반 제한중입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
// } elseif($city['supply'] == 0) {
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
} elseif(!$valid) {
} elseif(!$nearCity) {
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
} elseif($general['level'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
@@ -1305,7 +1319,7 @@ function process_16(&$general) {
$query = "update city set state=43,term=3 where city='{$destcity['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], Util::round($general['crew']/100));
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
// 전투 처리
$dead = processWar($general, $destcity);
@@ -1590,7 +1604,7 @@ function process_30(&$general) {
if($destination == $general['city']){
$log[] = "<C>●</>{$admin['month']}월:같은 도시입니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
} elseif(!key_exists($dist[$destination], $dist)) {
} elseif(!key_exists($destination, $dist)) {
$log[] = "<C>●</>{$admin['month']}월:거리가 멉니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
} elseif($general['gold'] < $cost) {
$log[] = "<C>●</>{$admin['month']}월:자금이 부족합니다. <G><b>{$destcity['name']}</b></>(으)로 강행 실패. <1>$date</>";
@@ -1669,7 +1683,16 @@ function process_31(&$general) {
$typecount = [];
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result);
if($gen['crew'] != 0) { $typecount[$gen['crewtype']]++; $crew += $gen['crew']; }
if($gen['crew'] != 0) {
if(!key_exists($gen['crewtype'], $typecount)){
$typecount[$gen['crewtype']] = 1;
}
else{
$typecount[$gen['crewtype']]+=1;
}
$crew += $gen['crew'];
}
}
if(!key_exists($destination, $dist)) {
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
@@ -1685,13 +1708,9 @@ function process_31(&$general) {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
$msg[] = "【<S>병종</>】";
foreach(GameUnitConst::all() as $unit){
if($typecount[$unit->id] == 0){
continue;
}
$unitStr = mb_substr($unit->name, 0, 2);
$msg[] = "{$unitStr}:{$typecount[$unit->id]}";
foreach($typecount as $crewtype=>$cnt){
$crewtypeText = mb_substr(GameUnitConst::byID($crewtype)->name, 0, 2);
$msg[] = "{$crewtypeText}:{$cnt}";
}
$log[] = join(' ', $msg);
@@ -1739,6 +1758,9 @@ function process_31(&$general) {
{
$cities = array_map('intval', explode("|", $nation['spy']));
}
else{
$cities = [];
}
$exist = 0;
for($i=0; $i < count($cities); $i++) {
if(intdiv($cities[$i], 10) == $destination) {
@@ -1799,7 +1821,7 @@ function process_41(&$general) {
} elseif($crewexp == 0) {
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
} else {
$type = intdiv($general['crewtype'], 10) * 10;
$type = intdiv($general['crewtype'], 10);
switch($type) {
case 0: $crewstr = '보병'; break;
case 1: $crewstr = '궁병'; break;
@@ -1810,17 +1832,17 @@ function process_41(&$general) {
if($ratio < 33) {
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], $crewexp);
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp);
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도 향상이 <span class='ev_failed'>지지부진</span>했습니다. <1>$date</>";
} elseif($ratio < 66) {
$exp = $exp * 2;
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], $crewexp * 2);
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp * 2);
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 향상되었습니다. <1>$date</>";
} else {
$exp = $exp * 3;
// 숙련도 증가
addGenDex($general['no'], $general['crewtype'], $crewexp * 3);
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], $crewexp * 3);
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 <S>일취월장</>했습니다. <1>$date</>";
}
@@ -2189,7 +2211,7 @@ function process_44(&$general) {
$log[] = "<C>●</>{$admin['month']}월:자금이 없습니다. 헌납 실패. <1>$date</>";
} elseif($what == 2 && $general['rice'] <= 0) {
$log[] = "<C>●</>{$admin['month']}월:군량이 없습니다. 헌납 실패. <1>$date</>";
} elseif($general['nation'] != $city['nation'] && $nation['level'] != 0) {
} elseif($general['nation'] != $city['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 헌납 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 헌납 실패. <1>$date</>";
@@ -2349,7 +2371,6 @@ function process_49(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_taxrate;
$date = substr($general['turntime'],11,5);
@@ -2385,7 +2406,7 @@ function process_49(&$general) {
//특기 보정 : 거상
if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해
$tax = $cost * $_taxrate;
$tax = $cost * GameConst::$exchangeFee;
$cost = $cost - $tax;
} elseif($type == 2) {
$dtype = "군량 구입";
@@ -2393,11 +2414,11 @@ function process_49(&$general) {
//특기 보정 : 거상
if($general['special'] == 30 && $city['trade'] < 100) { $cost = $amount * (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
if($general['special'] == 30 && $city['trade'] > 100) { $cost = $amount * (0.2 * $city['trade']/100 + 0.8); } // 손해인 경우 1/5배 손해
$tax = $cost * $_taxrate;
$tax = $cost * GameConst::$exchangeFee;
$cost = $cost + $tax;
if($general['gold'] < $cost) {
$cost = $general['gold'];
$tax = $cost * $_taxrate;
$tax = $cost * GameConst::$exchangeFee;
$amount = ($cost-$tax) * 100 / $city['trade'];
//특기 보정 : 거상
if($general['special'] == 30 && $city['trade'] < 100) { $amount = ($cost-$tax) / (6 * $city['trade']/100 - 5); } // 이익인 경우 5배 이득
@@ -2456,7 +2477,7 @@ function process_49(&$general) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 경험치 상승
switch(rand()%3) {
switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) {
case 0:
$general['leader2']++;
$query = "update general set leader2='{$general['leader2']}' where no='{$general['no']}'";
+478 -363
View File
@@ -173,7 +173,24 @@ function process_24(&$general) {
case 4: $str = "몰수로 인한 사기 저하는 몰수로 얻은 물자보다 더 손해란걸 모른단 말인가!"; break;
}
PushMsg(1, 0, $gen['picture'], $gen['imgsvr'], "{$gen['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
$src = new MessageTarget(
$gen['no'],
$gen['name'],
$gen['nation'],
$nation['name'],
$nation['color'],
GetImageURL($gen['imgsvr'], $gen['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$str,
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
@@ -291,72 +308,87 @@ function process_27(&$general) {
function process_51(&$general) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
$which = $command[1];
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
if($younation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 권고 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 권고 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 권고 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 권고 실패. <1>$date</>";
} else {
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>";
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
$deleted = 4;
for($i=0; $i < 5; $i++) {
if($younation["dip{$i}"] == "") { $deleted = $i; }
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
$date = date('Y-m-d H:i:s');
$query = "update nation set dip0='{$nation['name']}의 항복 권고 서신',dip0_type='4',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $log = checkAbility($general, $log);
if($general['level'] < 5 || $general['nation']==0) {
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 권고 실패. <1>$date</>"]);
return;
}
pushGenLog($general, $log);
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
$command = DecodeCommand($myTurn);
$which = $command[1];
$srcNation = getNationStaticInfo($general['nation']);
$destNation = getNationStaticInfo($which);
if($destNation['nation'] == 0) {
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 권고 실패. <1>$date</>"]);
return;
}
if($supply === null) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 권고 실패. <1>$date</>"]);
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 권고 실패. <1>$date</>"]);
return;
}
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
$general['name'],
$srcNation['nation'],
$srcNation['name'],
$srcNation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$destNation['nation'],
$destNation['name'],
$destNation['color']
);
$now = new \DateTime($date);
$validUntil = new \DateTime($date);
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}의 항복 권고 서신",
$now,
$validUntil,
['action'=>DiplomaticMessage::TYPE_SURRENDER]
);
$msg->send();
$db->update('general', [
'dedication'=>$db->sqleval('dedication+%i', $ded),
'experience'=>$db->sqleval('experience+%i', $exp)
], 'no=%i', $general['no']);
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>"]);
}
function process_52(&$general) {
@@ -473,155 +505,186 @@ function process_52(&$general) {
function process_53(&$general) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($general['level'] < 5 || $general['nation']==0) {
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
$command = DecodeCommand($myTurn);
$which = $command[1];
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$srcNation = getNationStaticInfo($general['nation']);
$destNation = getNationStaticInfo($which);
if($younation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 제의 실패. <1>$date</>";
} else {
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>(으)로 통합 제의 서신을 보냈습니다.<1>$date</>";
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
$deleted = 4;
for($i=0; $i < 5; $i++) {
if($younation["dip{$i}"] == "") { $deleted = $i; }
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
$date = date('Y-m-d H:i:s');
$query = "update nation set dip0='{$nation['name']}의 통합 제의 서신',dip0_type='5',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $log = checkAbility($general, $log);
if($destNation['nation'] == 0) {
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === null) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
pushGenLog($general, $log);
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
$general['name'],
$srcNation['nation'],
$srcNation['name'],
$srcNation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$destNation['nation'],
$destNation['name'],
$destNation['color']
);
$now = new \DateTime($date);
$validUntil = new \DateTime($date);
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}의 통합 제의 서신",
$now,
$validUntil,
['action'=>DiplomaticMessage::TYPE_MERGE]
);
$msg->send();
$db->update('general', [
'dedication'=>$db->sqleval('dedication+%i', $ded),
'experience'=>$db->sqleval('experience+%i', $exp)
], 'no=%i', $general['no']);
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 통합 제의 서신을 보냈습니다.<1>$date</>"]);
}
function process_61(&$general) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
$query = "select year,month,develcost,turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select gold,rice,name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
$when = $command[2];
$which = $command[1];
if($when < 1) { $when = 1; }
elseif($when > 20) { $when = 20; }
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
if($younation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 제의 실패. <1>$date</>";
} else {
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>";
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
$deleted = 4;
for($i=0; $i < 5; $i++) {
if($younation["dip{$i}"] == "") { $deleted = $i; }
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
$type = $when * 100 + 6;
$date = date('Y-m-d H:i:s');
$query = "update nation set dip0='{$nation['name']}{$when}년 불가침 제의 서신',dip0_type='$type',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 3턴후
$date = addTurn($date, $admin['turnterm'], 3);
//조건 표시기한 설정
$query = "update diplomacy set showing='{$date}' where me='{$general['nation']}' and you='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $admin['develcost']*10씩 차감
// $amount = $admin['develcost'];
// $query = "update nation set gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
// MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $log = checkAbility($general, $log);
if($general['level'] < 5 || $general['nation']==0) {
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
pushGenLog($general, $log);
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
$command = DecodeCommand($myTurn);
$which = $command[1];
$when = Util::valueFit($command[2], 1, 20);
$srcNation = getNationStaticInfo($general['nation']);
$destNation = getNationStaticInfo($which);
if($destNation['nation'] == 0) {
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === null) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
$general['name'],
$srcNation['nation'],
$srcNation['name'],
$srcNation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$destNation['nation'],
$destNation['name'],
$destNation['color']
);
$now = new \DateTime($date);
$validUntil = new \DateTime($date);
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
//FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다.
//XXX: 으악.
//TODO: 커맨드 처리 방식을 json으로 변경
$option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID);
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}{$when}년 불가침 제의 서신",
$now,
$validUntil,
[
'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION,
'year'=>$when,
'option'=>$option
]
);
$msg->send();
//NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다.
//FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록.
$db->update('diplomacy', [
'showing'=>$validUntil->format('Y-m-d H:i:s')
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
// 3턴후
$db->update('general', [
'dedication'=>$db->sqleval('dedication+%i', $ded),
'experience'=>$db->sqleval('experience+%i', $exp)
], 'no=%i', $general['no']);
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
}
function process_62(&$general) {
@@ -710,11 +773,33 @@ function process_62(&$general) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}에 선전포고";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$nation['name']}에서 선전포고";
$text = "【외교】{$admin['year']}{$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
PushMsg(2, $nation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}", $nation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}", $nation['color'], $younation['name'], $younation['color'], $youmsg);
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$younation['nation'],
$younation['name'],
$younation['color']
);
$msg = new Message(
Message::MSGTYPE_NATIONAL,
$src,
$dest,
$text,
new \DateTime($general['turntime']),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
pushWorldHistory($history, $admin['year'], $admin['month']);
@@ -724,138 +809,168 @@ function process_62(&$general) {
function process_63(&$general) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($general['level'] < 5 || $general['nation']==0) {
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
$command = DecodeCommand($myTurn);
$which = $command[1];
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$srcNation = getNationStaticInfo($general['nation']);
$destNation = getNationStaticInfo($which);
if($younation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 제의 실패. <1>$date</>";
} else {
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>";
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
$deleted = 4;
for($i=0; $i < 5; $i++) {
if($younation["dip{$i}"] == "") { $deleted = $i; }
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
$date = date('Y-m-d H:i:s');
$query = "update nation set dip0='{$nation['name']}의 종전 제의 서신',dip0_type='7',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $log = checkAbility($general, $log);
if($destNation['nation'] == 0) {
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === null) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
pushGenLog($general, $log);
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
$general['name'],
$srcNation['nation'],
$srcNation['name'],
$srcNation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$destNation['nation'],
$destNation['name'],
$destNation['color']
);
$now = new \DateTime($date);
$validUntil = new \DateTime($date);
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}의 종전 제의 서신",
$now,
$validUntil,
['action'=>DiplomaticMessage::TYPE_STOP_WAR]
);
$msg->send();
$db->update('general', [
'dedication'=>$db->sqleval('dedication+%i', $ded),
'experience'=>$db->sqleval('experience+%i', $exp)
], 'no=%i', $general['no']);
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>"]);
}
function process_64(&$general) {
$db = DB::db();
$connect=$db->get();
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
$query = "select year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($general['level'] < 5 || $general['nation']==0) {
pushGenLog($general, ["<C>●</>{$month}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$supply = $db->queryFirstField('SELECT supply FROM city WHERE city=%i AND nation=%i', $general['city'], $general['nation']);
$myTurn = $db->queryFirstField('SELECT %b FROM nation WHERE nation=%i', "l{$general['level']}turn0", $general['nation']);
$query = "select name,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$command = DecodeCommand($nation["l{$general['level']}turn0"]);
$command = DecodeCommand($myTurn);
$which = $command[1];
$query = "select nation,name,dip0,dip0_type,dip0_who,dip0_when,dip1,dip1_type,dip1_who,dip1_when,dip2,dip2_type,dip2_who,dip2_when,dip3,dip3_type,dip3_who,dip3_when,dip4,dip4_type,dip4_who,dip4_when from nation where nation='$which'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$srcNation = getNationStaticInfo($general['nation']);
$destNation = getNationStaticInfo($which);
if($younation['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 제의 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 제의 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 제의 실패. <1>$date</>";
} else {
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 파기 제의 서신을 보냈습니다. <1>$date</>";
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
//먼저 삭제된 칸 중 가장 오래된 칸 찾음
$deleted = 4;
for($i=0; $i < 5; $i++) {
if($younation["dip{$i}"] == "") { $deleted = $i; }
}
//기존 메세지 한칸씩 뒤로 미룸
for($i=$deleted-1; $i >=0; $i--) {
moveMsg("nation", "dip", $i+1, $younation["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
}
//권고 서신시 장수번호/상대국 번호
$me = $general['no'] * 10000 + $younation['nation'];
$date = date('Y-m-d H:i:s');
$query = "update nation set dip0='{$nation['name']}의 불가침 파기 서신',dip0_type='8',dip0_who='$me',dip0_when='$date' where nation='{$younation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// $log = checkAbility($general, $log);
if($destNation['nation'] == 0) {
pushGenLog($general, ["<C>●</>{$month}월:멸망한 국가입니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === null) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
pushGenLog($general, $log);
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
$exp = 5;
$ded = 5;
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
$general['name'],
$srcNation['nation'],
$srcNation['name'],
$srcNation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$destNation['nation'],
$destNation['name'],
$destNation['color']
);
$now = new \DateTime($date);
$validUntil = new \DateTime($date);
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}의 불가침 파기 제의 서신",
$now,
$validUntil,
['action'=>DiplomaticMessage::TYPE_CANCEL_NA]
);
$msg->send();
$db->update('general', [
'dedication'=>$db->sqleval('dedication+%i', $ded),
'experience'=>$db->sqleval('experience+%i', $exp)
], 'no=%i', $general['no']);
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>(으)로 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
}
function process_65(&$general) {
@@ -935,7 +1050,7 @@ function process_65(&$general) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//성 공백지로
$query = "update city set pop=pop*0.1,rate=50,agri=agri*0.1,comm=comm*0.1,secu=secu*0.1,nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='',conflict2='' where city='{$destcity['city']}'";
$query = "update city set pop=pop*0.1,rate=50,agri=agri*0.1,comm=comm*0.1,secu=secu*0.1,nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='{}' where city='{$destcity['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1243,7 +1358,7 @@ function process_71(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1255,7 +1370,7 @@ function process_71(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1288,7 +1403,7 @@ function process_71(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 필사즉생 실패. <1>$date</>";
} elseif($dipCount == 0) {
$log[] = "<C>●</>{$admin['month']}월:전쟁중이 아닙니다. 필사즉생 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 필사즉생 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:필사즉생 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -1315,7 +1430,7 @@ function process_71(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>필사즉생</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<M>필사즉생</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>필사즉생</>(을)를 발동");
@@ -1328,7 +1443,7 @@ function process_71(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1338,7 +1453,7 @@ function process_71(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -1349,7 +1464,7 @@ function process_72(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1361,7 +1476,7 @@ function process_72(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1401,7 +1516,7 @@ function process_72(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 백성동원 실패. <1>$date</>";
} elseif($dipCount == 0) {
$log[] = "<C>●</>{$admin['month']}월:전쟁중이 아닙니다. 백성동원 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 백성동원 실패. <1>$date</>";
} elseif($destcity['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 도시만 가능합니다. 백성동원 실패. <1>$date</>";
@@ -1430,7 +1545,7 @@ function process_72(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>백성동원</>(을)를 발동");
@@ -1443,7 +1558,7 @@ function process_72(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1453,7 +1568,7 @@ function process_72(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -1464,7 +1579,7 @@ function process_73(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1476,7 +1591,7 @@ function process_73(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1524,7 +1639,7 @@ function process_73(&$general) {
$log[] = "<C>●</>{$admin['month']}월:대상도시가 아국입니다. 수몰 실패. <1>$date</>";
} elseif($dip['state'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전쟁중인 상대국에만 가능합니다. 수몰 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 수몰 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:수몰 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -1560,7 +1675,7 @@ function process_73(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>수몰</>(을)를 발동");
@@ -1574,7 +1689,7 @@ function process_73(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1584,7 +1699,7 @@ function process_73(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -1595,7 +1710,7 @@ function process_74(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1607,7 +1722,7 @@ function process_74(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1655,7 +1770,7 @@ function process_74(&$general) {
$log[] = "<C>●</>{$admin['month']}월:대상도시가 아국입니다. 허보 실패. <1>$date</>";
} elseif($dip['state'] > 1) {
$log[] = "<C>●</>{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 허보 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 허보 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:허보 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -1682,7 +1797,7 @@ function process_74(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국의 <G><b>{$destcity['name']}</b></>에 <M>허보</>(을)를 발동");
@@ -1718,7 +1833,7 @@ function process_74(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1728,7 +1843,7 @@ function process_74(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -1739,7 +1854,7 @@ function process_75(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1751,7 +1866,7 @@ function process_75(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1793,7 +1908,7 @@ function process_75(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 피장파장 실패. <1>$date</>";
} elseif($dip['state'] > 1) {
$log[] = "<C>●</>{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 피장파장 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 피장파장 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:피장파장 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -1829,13 +1944,13 @@ function process_75(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>피장파장</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>피장파장</>(을)를 발동");
//전략기한+60
$query = "update nation set tricklimit=tricklimit+60 where nation='{$destnation['nation']}'";
$query = "update nation set sabotagelimit=sabotagelimit+60 where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 국가보정
@@ -1844,7 +1959,7 @@ function process_75(&$general) {
//전략기한, 최소72
if($term3 < 72) { $term3 = 72; }
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -1854,7 +1969,7 @@ function process_75(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -1865,7 +1980,7 @@ function process_76(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -1877,7 +1992,7 @@ function process_76(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -1906,7 +2021,7 @@ function process_76(&$general) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 의병모집 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 의병모집 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 의병모집 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:의병모집 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -1933,7 +2048,7 @@ function process_76(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <M>의병모집</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<M>의병모집</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <M>의병모집</>(을)를 발동");
@@ -2063,7 +2178,7 @@ function process_76(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한, 국가 기술력 그대로
$query = "update nation set tricklimit={$term3},totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3},totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -2073,7 +2188,7 @@ function process_76(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -2084,7 +2199,7 @@ function process_77(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -2096,7 +2211,7 @@ function process_77(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -2136,7 +2251,7 @@ function process_77(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 이호경식 실패. <1>$date</>";
} elseif($dip['state'] > 1) {
$log[] = "<C>●</>{$admin['month']}월:선포,전쟁중인 상대국에만 가능합니다. 이호경식 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 이호경식 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:이호경식 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -2172,7 +2287,7 @@ function process_77(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>이호경식</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>이호경식</>(을)를 발동");
@@ -2191,7 +2306,7 @@ function process_77(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -2201,7 +2316,7 @@ function process_77(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -2212,7 +2327,7 @@ function process_78(&$general) {
$log = [];
$alllog = [];
$history = [];
$tricklog = [];
$sabotagelog = [];
$date = substr($general['turntime'],11,5);
@@ -2224,7 +2339,7 @@ function process_78(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -2266,7 +2381,7 @@ function process_78(&$general) {
$log[] = "<C>●</>{$admin['month']}월:선포중인 상대국에만 가능합니다. 급습 실패. <1>$date</>";
} elseif($dip['term'] < 12) {
$log[] = "<C>●</>{$admin['month']}월:선포 12개월 이상인 상대국에만 가능합니다. 급습 실패. <1>$date</>";
} elseif($nation['tricklimit'] > 0) {
} elseif($nation['sabotagelimit'] > 0) {
$log[] = "<C>●</>{$admin['month']}월:전략기한이 남았습니다. 급습 실패. <1>$date</>";
} elseif($term < $term2) {
$log[] = "<C>●</>{$admin['month']}월:급습 수행중... ({$term}/{$term2}) <1>$date</>";
@@ -2302,7 +2417,7 @@ function process_78(&$general) {
// $alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
// $history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
$tricklog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
$sabotagelog[] = "<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【전략】</b></><D><b>{$nation['name']}</b></>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동하였습니다.";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
pushNationHistory($nation, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$destnation['name']}</b></>에 <M>급습</>(을)를 발동");
pushNationHistory($destnation, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 아국에 <M>급습</>(을)를 발동");
@@ -2316,7 +2431,7 @@ function process_78(&$general) {
if($nation['type'] == 12) { $term3 = $term3 * 2; }
//전략기한
$query = "update nation set tricklimit={$term3} where nation='{$general['nation']}'";
$query = "update nation set sabotagelimit={$term3} where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//경험치, 공헌치
@@ -2326,7 +2441,7 @@ function process_78(&$general) {
// pushWorldHistory($history, $admin['year'], $admin['month']);
// pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushTrickLog($tricklog);
pushSabotageLog($sabotagelog);
pushGenLog($general, $log);
}
@@ -2348,7 +2463,7 @@ function process_81(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$query = "select nation,can_change_flag,name,type,tricklimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$query = "select nation,can_change_flag,name,type,sabotagelimit,l{$general['level']}term,l{$general['level']}turn0 from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
+19 -18
View File
@@ -46,14 +46,9 @@ function process_22(&$general) {
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
sendScoutMsg([
'id' => $general['no'],
'nation_id' => Util::array_get($general['nation'], 0)
],[
'id' => $you['no'],
'nation_id' => Util::array_get($you['nation'], 0)
],$date);
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
$msg->send(true);
$general['intel2']++;
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -132,9 +127,15 @@ function process_25(&$general) {
} elseif(strpos($general['nations'], ",{$nation['nation']},") > 0) {
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
} else {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 임관했습니다. <1>$date</>";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
if($where == 99 || $where == 98) {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 어쩌다보니 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 랜덤으로 임관했습니다. <1>$date</>";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
} else {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>(이)가 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 임관했습니다. <1>$date</>";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
}
if($gencount < 10) { $exp = 700; }
else { $exp = 100; }
@@ -227,7 +228,7 @@ function process_29(&$general) {
if(rand() % $criteria > 0) {
$exp = 100;
$ded = 70;
switch(rand()%3) {
switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) {
case 0: $general['leader2'] += 1; break;
case 1: $general['power2'] += 1; break;
case 2: $general['intel2'] += 1; break;
@@ -237,7 +238,7 @@ function process_29(&$general) {
// 탐색 성공
$exp = 200;
$ded = 300;
switch(rand()%3) {
switch(Util::choiceRandomUsingWeight([$general['leader'], $general['power'], $general['intel']])) {
case 0: $general['leader2'] += 3; break;
case 1: $general['power2'] += 3; break;
case 2: $general['intel2'] += 3; break;
@@ -567,7 +568,7 @@ function process_46(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$query = "select nation from nation where name='{$general['makenation']}'";
$query = "select nation from nation where nation!={$general['nation']} AND name='{$general['makenation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
@@ -604,7 +605,7 @@ function process_46(&$general) {
$nation = getNationStaticInfo($general['nation']);
// 현 도시 소속지로
$query = "update city set nation='{$nation['nation']}',conflict='',conflict2='' where city='{$general['city']}'";
$query = "update city set nation='{$nation['nation']}',conflict='{}' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$nation['name']}</b></>(을)를 건국하였습니다. <1>$date</>";
@@ -673,7 +674,7 @@ function process_47(&$general) {
//분쟁기록 모두 지움
DeleteConflict($general['nation']);
// 국명, 색깔 바꿈 국가 레벨 0, 성향리셋, 기술0
$query = "update nation set name='{$general['name']}',color='330000',level='0',type='0',tech='0',totaltech='0',capital='0' where nation='{$general['nation']}'";
$query = "update nation set name='{$general['name']}',color='#330000',level='0',type='0',tech='0',totaltech='0',capital='0' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 본인 빼고 건국/임관제한
$query = "update general set makelimit='12' where no!='{$general['no']}' and nation='{$general['nation']}'";
@@ -685,7 +686,7 @@ function process_47(&$general) {
$query = "update general set level=1 where nation='{$general['nation']}' and level <= 11";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 전 도시 공백지로
$query = "update city set nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='',conflict2='' where nation='{$general['nation']}'";
$query = "update city set nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='{}' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 리셋
$query = "update diplomacy set state='2',term='0' where me='{$general['nation']}' or you='{$general['nation']}'";
@@ -805,7 +806,7 @@ function process_55(&$general) {
'rice'=>GameConst::$baserice,
'rate'=>20,
'bill'=>100,
'tricklimit'=>36,
'sabotagelimit'=>36,
'surlimit'=>72,
'type'=>0,
'gennum'=>1
@@ -9,7 +9,7 @@ function process_32(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -57,7 +57,7 @@ function process_32(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$intelgen = MYDB_fetch_array($result);
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100);
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
$ratio2 = rand() % 100;
if($general['item'] == 5) {
@@ -93,8 +93,8 @@ function process_32(&$general) {
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>(이)가 불타고 있습니다.";
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 성공했습니다. <1>$date</>";
$destcity['agri'] -= rand() % $_firingpower + $_firingbase;
$destcity['comm'] -= rand() % $_firingpower + $_firingbase;
$destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
$destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
if($destcity['agri'] < 0) { $destcity['agri'] = 0; }
if($destcity['comm'] < 0) { $destcity['comm'] = 0; }
$query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}' where city='$destination'";
@@ -102,7 +102,7 @@ function process_32(&$general) {
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
TrickInjury($destination);
SabotageInjury($destination);
$exp = rand() % 100 + 201;
$ded = rand() % 70 + 141;
} else {
@@ -134,7 +134,7 @@ function process_33(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingbase, $_firingpower;
//탈취는 0까지 무제한
$date = substr($general['turntime'],11,5);
@@ -187,7 +187,7 @@ function process_33(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$powergen = MYDB_fetch_array($result);
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100);
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
$ratio2 = rand() % 100;
if($general['item'] == 5) {
@@ -224,8 +224,8 @@ function process_33(&$general) {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 성공했습니다. <1>$date</>";
// 탈취 최대 400 * 8
$gold = (rand() % $_firingpower + $_firingbase) * $destcity['level'];
$rice = (rand() % $_firingpower + $_firingbase) * $destcity['level'];
$gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
$rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
$nation['gold'] -= $gold;
$nation['rice'] -= $rice;
@@ -254,7 +254,7 @@ function process_33(&$general) {
}
$log[] = "<C>●</>금<C>$gold</> 쌀<C>$rice</>을 획득했습니다.";
// TrickInjury($destination);
// SabotageInjury($destination);
$exp = rand() % 100 + 201;
$ded = rand() % 70 + 141;
} else {
@@ -286,7 +286,7 @@ function process_34(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -334,7 +334,7 @@ function process_34(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$powergen = MYDB_fetch_array($result);
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100);
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
$ratio2 = rand() % 100;
if($general['item'] == 5) {
@@ -371,8 +371,8 @@ function process_34(&$general) {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 성공했습니다. <1>$date</>";
// 파괴
$destcity['def'] -= rand() % $_firingpower + $_firingbase;
$destcity['wall'] -= rand() % $_firingpower + $_firingbase;
$destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
$destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
if($destcity['def'] < 100) { $destcity['def'] = 100; }
if($destcity['wall'] < 100) { $destcity['wall'] = 100; }
$query = "update city set state=34,def='{$destcity['def']}',wall='{$destcity['wall']}' where city='$destination'";
@@ -380,7 +380,7 @@ function process_34(&$general) {
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
TrickInjury($destination);
SabotageInjury($destination);
$exp = rand() % 100 + 201;
$ded = rand() % 70 + 141;
} else {
@@ -412,7 +412,7 @@ function process_35(&$general) {
$log = [];
$alllog = [];
$history = [];
global $_firing, $_basefiring, $_firingbase, $_firingpower;
$date = substr($general['turntime'],11,5);
$query = "select year,month,develcost from game limit 1";
@@ -458,11 +458,11 @@ function process_35(&$general) {
} elseif($dip['state'] >= 7) {
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
} else {
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by sum desc";
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by leader desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / $_firing - ($destcity['secu']/$destcity['secu2'])/5 + $_basefiring)*100);
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
$ratio2 = rand() % 100;
if($general['item'] == 5) {
@@ -499,8 +499,8 @@ function process_35(&$general) {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 성공했습니다. <1>$date</>";
// 선동 최대 10
$destcity['secu'] -= rand() % Util::round($_firingpower/2) + $_firingbase;
$destcity['rate'] -= rand() % Util::round($_firingpower/50) + $_firingbase/50;
$destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$sabotageDefaultAmount;
$destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$sabotageDefaultAmount/50;
if($destcity['secu'] < 0) { $destcity['secu'] = 0; }
if($destcity['rate'] < 0) { $destcity['rate'] = 0; }
$query = "update city set state=32,rate='{$destcity['rate']}',secu='{$destcity['secu']}' where city='$destination'";
@@ -508,7 +508,7 @@ function process_35(&$general) {
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
TrickInjury($destination);
SabotageInjury($destination);
$exp = rand() % 100 + 201;
$ded = rand() % 70 + 141;
} else {
+1 -1
View File
@@ -27,7 +27,7 @@ function Tag2Code(string $str) {
function BadTag2Code(string $str) {
/* FIXME: 제대로된 tag 변환 코드 사용 */
$str = str_replace("<script", "<sorry", $str);
$str = str_replace("<embed", "<sorry", $str);
$str = str_replace("</script", "</sorry", $str);
return $str;
}
+49 -5
View File
@@ -75,7 +75,13 @@ function allButton() {
$call = "설문조사";
}
$templates = new \League\Plates\Engine('templates');
if(\file_exists("d_setting/templates/allButton.php")){
$templates = new \League\Plates\Engine('d_setting/templates');
}
else{
$templates = new \League\Plates\Engine('templates');
}
return $templates->render('allButton', [
'call' => $call,
@@ -95,10 +101,12 @@ function commandButton() {
$db = DB::db();
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
$nation = $db->queryFirstRow("select nation,color,secretlimit from nation where nation=%i",$me['nation']);
if($nation['color'] == "") { $nation['color'] = "#000000"; }
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
'nation'=>0,
'level'=>0,
'secretlimit'=>99,
'color'=>'#000000'
];
$bgColor = Util::array_get($nation['color'])?:'#000000';
$fgColor = newColor($bgColor);
@@ -108,6 +116,9 @@ function commandButton() {
if($me['level'] >= 2){
$showSecret = true;
}
else if($me['level']== 0){
$showSecret = false;
}
else if($me['belong'] >= $nation['secretlimit']){
$showSecret = true;
}
@@ -116,11 +127,44 @@ function commandButton() {
'bgColor'=>$bgColor,
'fgColor'=>$fgColor,
'meLevel'=>$me['level'],
'nationLevel'=>$nation['level'],
'showSecret'=>$showSecret
]);
}
function formatWounded(int $value, int $wound): string{
if($wound == 0){
return "$value";
}
$woundedValue = intdiv($value * (100 - $wound), 100);
return "<font color=red>$woundedValue</font>";
}
function formatDefenceMode(int $value): string{
switch($value) {
case 0: return "×"; break;
case 1: return ""; break;
case 2: return ""; break;
}
return '??';
}
function formatLeadershipBonus(int $value): string{
if($value == 0){
return '';
}
return "<font color=cyan>+{$value}</font>";
}
function formatName(string $name, int $npc): string{
if($npc==1){
$name = "<font color='skyblue'>$name</font>";
}
else if($npc>1){
$name = "<font color='cyan'>$name</font>";
}
return $name;
}
function getMapHtml(){
//NOTE: 필요한가?
+1 -1
View File
@@ -713,7 +713,7 @@ function disaster() {
$query = "update city set state='$state',pop=pop*{$ratio},rate=rate*{$ratio},agri=agri*{$ratio},comm=comm*{$ratio},secu=secu*{$ratio},def=def*{$ratio},wall=wall*{$ratio} where city='$disastercity[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
TrickInjury($disastercity[$i], 1);
SabotageInjury($disastercity[$i], 1);
}
} else {
for($i=0; $i < count($disastercity); $i++) {
+4 -6
View File
@@ -117,6 +117,7 @@ function getTournamentTerm() {
$admin = MYDB_fetch_array($result);
switch($admin['tnmt_auto']) {
case 0: $str = ''; break;
case 1: $str = "경기당 12분"; break;
case 2: $str = "경기당 7분"; break;
case 3: $str = "경기당 3분"; break;
@@ -232,12 +233,7 @@ function startTournament($auto, $type) {
$db = DB::db();
$connect=$db->get();
for($i=0; $i<50; $i++){
$filepath = "logs/fight{$i}.txt";
if(file_exists($filepath)){
@unlink($filepath);
}
}
eraseTnmtFightLogAll();
switch($auto) {
case 1: $unit = 60; break;
@@ -760,6 +756,8 @@ function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$db = DB::db();
$connect=$db->get();
eraseTnmtFightLog($group);
$query = "select *,(ldr+pwr+itl)*7/15 as tot,h,w,b from tournament where grp='$group' and grp_no='$g1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($result);
+45 -57
View File
@@ -4,7 +4,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$session = Session::requireLogin()->loginGame();
$session = Session::requireLogin()->loginGame()->setReadOnly();
$userID = Session::getUserID();
increaseRefresh("메인", 1);
@@ -18,7 +18,7 @@ if (!$userID) {
}
$me = $db->queryFirstRow(
'SELECT no,con,turntime,newmsg,newvote,map from general where owner = %i',
'SELECT no,con,turntime,newmsg,newvote,`level` from general where owner = %i',
$userID
);
@@ -31,12 +31,6 @@ if ($me === null) {
header('Location: ../');
die();
}
if (!$session->generalID) {
$session = Session::requireGameLogin();
}
$session->setReadOnly();
$userID = Session::getUserID();
if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
$db->update('general', [
@@ -64,37 +58,44 @@ $scenario = $admin['scenario_text'];
<!DOCTYPE html>
<html>
<head>
<title>메인</title>
<title><?=UniqueConst::$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../e_lib/jquery.redirect.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
<script src="js/main.js"></script>
<script src="js/base_map.js"></script>
<script src="js/map.js"></script>
<script src="js/msg.js"></script>
<script>
$(function(){
reloadWorldMap({
hrefTemplate:'b_currentCity.php?citylist={0}'
});
setInterval(function(){
refreshMsg();
}, 10000);
});
</script>
<link href="css/normalize.css" rel="stylesheet">
<link href="../d_shared/common.css" red="stylesheet">
<link href="../d_shared/common.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/map.css" rel="stylesheet">
<link href="css/msg.css" rel="stylesheet">
</head>
<body class="img_back">
<div id="container">
<div><?=allButton()?></div>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=5><?=allButton()?></td></tr>
<tr height=50>
<td colspan=5 align=center><font size=4>삼국지 모의전투 PHP 유기체서버 (<font color=cyan><?=$scenario?></font>)</font></td>
<td colspan=5 align=center><font size=4>삼국지 모의전투 HiDCHe (<font color=cyan><?=$scenario?></font>)</font></td>
</tr>
<?php
$valid = 0;
@@ -214,6 +215,14 @@ if ($session->userGrade >= 5) {
</td></tr>
";
}
else if($session->userGrade == 4){
echo "
<tr><td colspan=5>
<input type=button value=시뮬 onclick=window.open('_simul.php')>
<input type=button value=119 onclick=window.open('_119.php')>
</td></tr>
";
}
?>
@@ -223,7 +232,7 @@ if ($session->userGrade >= 5) {
<td width=698 height=520 colspan=2>
<?=getMapHtml()?>
</td>
<td width=298 rowspan=4><iframe name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
<td width=298 rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
</tr>
<form name=form2 action=preprocessing.php method=post target=commandlist>
<tr>
@@ -246,13 +255,13 @@ if ($session->userGrade >= 5) {
<option value=10>10턴</option>
<option value=11>11턴</option>
<option value=12>12턴</option>
</select><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:50;font-size:13px; value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
</select><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:50px;font-size:13px; value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
</td>
</tr>
<tr>
<td width=646 align=right>
<?php commandTable(); ?>
<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160;font-size:13px; value='로그아웃' onclick=location.replace('logout_process.php')><br>
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로비로' onclick=location.replace('../')><br>
</td>
</tr>
</form>
@@ -276,53 +285,32 @@ if ($session->userGrade >= 5) {
<tr><td width=998 colspan=2 align=center id=bg1><b>중원 정세</b></td></tr>
<tr><td width=998 colspan=2><?=getWorldHistoryRecent(15)?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td colspan=2>
<div class="message_input_form bg0">
<select id="mailbox_list" size="1">
<div class="message_input_form bg0">
<select id="mailbox_list" size="1">
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13">
</select>
<input type="textarea" id="msg_input" maxlength="99">
<button id="msg_submit">서신전달&amp;갱신</button>
</div>
</td>
</tr>
<tr><td colspan=2><?=allButton()?></td></tr>
<tr><td colspan=2>
<div id="message_board">
<div class="board_side">
<div class="board_header bg0">전체 메시지(최고99자)</div>
<section class="public_message">
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13">
</section>
<div class="board_header bg0">개인 메시지(최고99자)</div>
<section class="private_message">
</section>
</div>
<div class="board_side">
<section class="diplomacy_message">
</section>
<div class="board_header bg0">국가 메시지(최고99자)</div>
<section class="national_message">
</section>
</div>
</div>
</td></tr>
<tr><td colspan=2>
</select>
<input type="textarea" id="msg_input" maxlength="99">
<button id="msg_submit">서신전달&amp;갱신</button><br>
내용 없이 '서신전달&amp;갱신'을 누르면 메세지창이 갱신됩니다.
</div>
<div><?=allButton()?></div>
<div id="message_board"><div style="left:0;" class="board_side bg0">
<div class="board_header bg0">전체 메시지(최고99자)</div>
<section class="public_message"></section>
<div class="board_header bg0">개인 메시지(최고99자)</div>
<section class="private_message"></section>
</div><div style="right:0;" class="board_side bg0">
<section class="diplomacy_message">
<?php
echo allButton();
echo banner();
?>
</td></tr>
</table>
<?php PrintElapsedTime(); ?>
</section>
<div class="board_header bg0">국가 메시지(최고99자)</div>
<section class="national_message"></section>
</div></div>
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
</div>
<?php
if ($con == 1) {
+42 -3
View File
@@ -31,7 +31,7 @@ if($session->userGrade < 5){
</head>
<body>
<div class="container" style="min-width:720px;">
<h1 class="row justify-content-md-center">삼국지 모의전투 HiD 리셋</h1>
<h1 class="row justify-content-md-center">삼국지 모의전투 HiDCHe 리셋</h1>
<div class="row justify-content-md-center">
<div class="col col-lg-8" >
@@ -155,15 +155,54 @@ if($session->userGrade < 5){
<input type="radio" name="show_img_level" value="1">전콘
</label>
<label class="btn btn-secondary active">
<input type="radio" name="show_img_level" value="2" checked>전콘, 병종
<input type="radio" name="show_img_level" value="2">전콘, 병종
</label>
<label class="btn btn-secondary">
<input type="radio" name="show_img_level" value="3">전콘, 병종, NPC
<input type="radio" name="show_img_level" value="3" checked>전콘, 병종, NPC
</label>
</div>
</div>
</div>
<div class="form-group row">
<label for="tournament_trig" class="col-sm-3 col-form-label">토너먼트 자동 시작<br>경기 단위</label>
<div class="col-sm-9" id="tournament_trig">
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-toggle="buttons">
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="0">안함
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="1">12분(총 5일)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="2">7분(총 10시간)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="3">3분(총 4시간)
</label>
<label class="btn btn-secondary w-25 active">
<input type="radio" name="tournament_trig" value="4" checked>1분(총 82분)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="5">30초(총 41분)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="6">15초(총 21분)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="7">5초(총 7분)
</label>
</div>
</div>
</div>
<div class="form-group row">
<label for="reserve_open" class="col-sm-3 col-form-label">오픈 예약</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="reserve_open" id="reserve_open" placeholder="YYYY-MM-DD hh:mm" value="" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
+1 -1
View File
@@ -31,7 +31,7 @@ if($session->userGrade == 5){
</head>
<body>
<div class="container" style="min-width:720px;">
<h1 class="row justify-content-md-center">삼국지 모의전투 HiD 리셋</h1>
<h1 class="row justify-content-md-center">삼국지 모의전투 HiDCHe 리셋</h1>
<div class="row justify-content-md-center">
<div class="col col-lg-8" >

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