Compare commits

..
74 Commits
Author SHA1 Message Date
Hide_D 7586243a95 DB 스키마 변경 2019-01-25 00:13:04 +09:00
Hide_D 1e1c7801e1 중간반영 2019-01-24 03:34:03 +09:00
Hide_D a363f6ef5f 외교부 틀 작성 2019-01-23 03:11:07 +09:00
Hide_D 334e1fd2da 국메 처리 방식을 변경. 국가간 메시지는 외교권자만 가능 2019-01-23 02:36:03 +09:00
Hide_D 2e8e29e93c 외교메시지 수신 기준 변경중 2019-01-23 01:37:40 +09:00
Hide_D 5e5a1a3668 기존 회의실, 기밀실 코드 삭제 2019-01-22 03:17:44 +09:00
Hide_D b93b464ebf 외교서신 응답 2019-01-22 02:47:27 +09:00
Hide_D 842ba46a95 파일 명을 namespace를 고려하여 수정 2019-01-21 02:25:54 +09:00
Hide_D 03b27d8e8f 외교 서신 추가 기능 2019-01-21 02:23:23 +09:00
Hide_D c11b41c6ba 게시물 코드 2019-01-21 02:00:48 +09:00
Hide_D 018cc526ee 게시판 글, 댓글 작성 초안 2019-01-21 01:45:32 +09:00
Hide_D edf4508e6b 권한 세팅 2019-01-18 03:01:02 +09:00
Hide_D d26a1f0312 왕 무장 관직 순서 변경 2019-01-17 23:01:05 +09:00
Hide_D 2984f6a453 무관 최종 관직을 실제 삼국지 관직 순서에 맞게 변경 2019-01-17 22:59:54 +09:00
Hide_D a00058d959 시중->종사 2019-01-17 22:44:18 +09:00
Hide_D 8e56a457f1 게시물 구조 설정 2019-01-17 03:12:26 +09:00
Hide_D 74d5f021cd tui-editor와 새 게시판 준비 2019-01-17 02:54:58 +09:00
Hide_D a37715315d permission, penalty 대응 준비 2019-01-16 02:47:48 +09:00
Hide_D d9c9977610 장수 schema 수정 2019-01-16 02:26:28 +09:00
Hide_D c2f0cbb10a 버튼 이동 코드 정리 2019-01-16 02:18:42 +09:00
Hide_D a34d00d822 DB 스키마 정리, diplomacy 테이블 정리, 코드 정리 2019-01-16 01:59:07 +09:00
Hide_D 9924ec6963 국법 기능 제거. 외교부를 위한 자리 추가 2019-01-12 18:53:01 +09:00
Hide_D 9036201887 DB 스키마 준비 2019-01-12 07:21:34 +09:00
Hide_D b2435d2430 걸그룹 전콘 문제 일부 수정 2018-12-08 20:55:48 +09:00
Hide_D afd6148770 걸그룹 대전 0.5 반영 2018-12-02 22:28:10 +09:00
Hide_D b70b58a35a 지급율 -> 지급률 2018-12-01 23:37:40 +09:00
Hide_D df963c2780 외교 메시지는 삭제 할 수 없도록 2018-12-01 18:36:43 +09:00
Hide_D 1b732c76e6 국메 삭제 가능 2018-11-30 21:49:19 +09:00
Hide_D f9489b0173 디버그 코드 제거 2018-11-30 21:44:59 +09:00
Hide_D 18942c55ae 메시지 삭제 기능 추가 2018-11-30 21:29:31 +09:00
Hide_D bf34b2f1ca 메시지 타이밍 정책 일부 수정 2018-11-30 19:03:26 +09:00
Hide_D a717a021c2 페이지당 갱신 시간을 10초에서 5초로 변경 2018-11-30 02:05:33 +09:00
Hide_D dcf718d592 메시지를 띄울 때 flex 적용 2018-11-30 01:51:24 +09:00
Hide_D f5eeb2b839 로그아웃 되었을 경우 무한히 호출하는 버그 수정 2018-11-30 01:24:45 +09:00
Hide_D bc435adc11 이전 메시지 가져오기 기능 추가 2018-11-30 01:18:07 +09:00
Hide_D aeb8e82cbd 부상으로 인한 전투 우선순위 감소를 완화 2018-11-28 23:43:42 +09:00
Hide_D 5cb2ed3ccd 등갑, 맹수 너프 2018-11-28 01:24:29 +09:00
Hide_D 93b1864d1b 자객병의 기동을 8로 상향 2018-11-28 01:20:32 +09:00
Hide_D a6efffda45 selector에 검은색 추가 2018-11-28 01:14:43 +09:00
Hide_D c89d6f1a58 도시 목록에 select2를 시험 적용 2018-11-28 01:02:56 +09:00
Hide_D d4f16abfac 암행부의 장수수에서 '부대장'이 제외됩니다. 2018-11-28 00:29:53 +09:00
Hide_D 8529f3f355 임관턴이 어찌저찌 어거지로 동작하던 버그 수정 2018-11-28 00:26:29 +09:00
Hide_D 2eb136827d 랜덤 임관을 더 고르게 합니다. 2018-11-28 00:18:09 +09:00
Hide_D 9594e6eb32 부대장은 기술연구, 전투시 기술 상승에 영향을 주지 않도록 변경 2018-11-28 00:16:34 +09:00
Hide_D 9e8111994a 통합, 합병시 부대장까지 같이 포함되는 문제 수정 2018-11-28 00:14:36 +09:00
Hide_D af0c2b7129 select2 설치 2018-11-27 23:52:12 +09:00
Hide_D 96b73a0cef 도시 목록 등 불필요한 가로바 길이 줄임 2018-11-26 22:29:11 +09:00
Hide_D 6c290ee2d3 추방시 명성 안깎이는 버그 수정, 첫 하야시 패널티 없음 2018-11-26 18:12:21 +09:00
Hide_D ca53e3de3a 반계 상향 2018-11-26 18:08:57 +09:00
Hide_D 6ea3ec700a 수비 우선 순위를 부상여부, 수뇌여부, 훈사 여부를 반영하도록 변경 2018-11-26 15:17:51 +09:00
Hide_D fe3355e08e gitignore 변경 2018-11-26 15:08:33 +09:00
Hide_D 43da95b4a5 디버그 코드 제거 2018-11-25 00:51:59 +09:00
Hide_D 3d93a63caa php의 rename을 OS의 mv로 변경 2018-11-25 00:50:41 +09:00
Hide_D 9550607da3 디버그 모드 2018-11-25 00:39:49 +09:00
Hide_D d5d9798913 rename 재수정 2018-11-25 00:37:24 +09:00
Hide_D 6cfe08235f base을 filename으로 수정 시도 2018-11-25 00:35:11 +09:00
Hide_D 49eb850ff1 파일명 에러 수정 2018-11-25 00:29:26 +09:00
Hide_D 5a558583d2 폴더명 실수.. 2018-11-24 23:46:04 +09:00
Hide_D 1e5f0d0555 이전 디렉토리를 이동하도록 변경 2018-11-24 23:44:33 +09:00
Hide_D c58caeda4c 국방 표기 방식 변경 2018-11-13 19:55:40 +09:00
Hide_D 26fc56f2b8 extractMissingPostToGlobals(); 제거 2018-11-13 02:11:00 +09:00
Hide_D 6a9e7aa89d msg overflow 적용 2018-11-11 23:32:19 +09:00
Hide_D b6c3b0cdc3 방랑군이 아니어도 건국 가능한 버그 수정 2018-10-29 03:15:45 +09:00
Hide_D 5ae91ac620 견문 무력 버그 수정 2018-10-25 01:26:59 +09:00
Hide_D 70265c55ef 3인 임관 실패시 견문 2018-10-25 01:21:52 +09:00
Hide_D 7c3b5fc31e 견문 시 무력이 떨어지지 않도록 변경 2018-10-25 01:17:04 +09:00
Hide_D a9a830caa2 기타 설정 추가 2018-10-24 03:27:22 +09:00
Hide_D b49ff3d4ed 예약 안되는 버그 수정 2018-10-24 03:22:41 +09:00
Hide_D 42310fa170 랜임 개월 수 버그 수정 2018-10-24 01:17:03 +09:00
Hide_D bfff1d9e2f 랜임 모드 버그 수정 2018-10-24 00:54:18 +09:00
Hide_D 2c98777b9f 등용장 무효화 2018-10-23 23:33:12 +09:00
Hide_D 4a91260a31 오타 수정 설명 수정 2018-10-23 16:38:25 +09:00
Hide_D 076971bcae 오타 수정 2018-10-23 16:35:28 +09:00
Hide_D 01fcc9bcab 랜덤 임관 모드 추가 2018-10-23 15:05:19 +09:00
108 changed files with 15269 additions and 2988 deletions
+1
View File
@@ -16,6 +16,7 @@ d_log/*.zip
sess_*
*/logs/*.txt
*/logs/*/*.txt
*/logs/preserved
err.txt
che/.htaccess
kwe/.htaccess
+3
View File
@@ -0,0 +1,3 @@
/*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
+188
View File
@@ -0,0 +1,188 @@
/* select2-bootstrap4 with Darkly */
.select2-container--bootstrap4 { color: black; }
.select2-container--bootstrap4 .select2-selection { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; outline: 0; }
.select2-container--bootstrap4 .select2-selection.form-control { border-radius: 0.25rem; }
.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; }
.select2-container--bootstrap4 .select2-search__field { outline: 0; }
.select2-container--bootstrap4 .select2-search__field::-webkit-input-placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-search__field:-moz-placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-search__field::-moz-placeholder { color: #6c757d; opacity: 1; }
.select2-container--bootstrap4 .select2-search__field:-ms-input-placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-results__option { padding: 0.75rem 0.375rem; font-size: 1rem; }
.select2-container--bootstrap4 .select2-results__option[role=group] { padding: 0; }
.select2-container--bootstrap4 .select2-results__option[aria-disabled=true] { color: #6c757d; cursor: not-allowed; }
.select2-container--bootstrap4 .select2-results__option[aria-selected=true] { background-color: #f8f9fa; color: #16181b; }
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] { background-color: #007bff; color: #fff; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option { padding: 0.75rem 0.375rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.375rem; padding-left: 0.75rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.75rem; padding-left: 1.125rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.125rem; padding-left: 1.5rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.5rem; padding-left: 1.875rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.875rem; padding-left: 2.25rem; }
.select2-container--bootstrap4 .select2-results__group { color: #6c757d; display: block; padding: 0.75rem 0.375rem; font-size: 75%; line-height: 1; white-space: nowrap; }
.select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; border-color: #80bdff; }
@media screen and (prefers-reduced-motion: reduce) { .select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: none; } }
.select2-container--bootstrap4.select2-container--open .select2-selection .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.25rem 0.25rem 0.25rem; }
.select2-container--bootstrap4.select2-container--open.select2-container--below .select2-selection { border-bottom-right-radius: 0; border-bottom-left-radius: 0; border-bottom-color: transparent; }
.select2-container--bootstrap4.select2-container--open.select2-container--above .select2-selection { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; }
.select2-container--bootstrap4 .select2-selection__clear { color: #6c757d; cursor: pointer; float: right; font-weight: bold; margin-right: 10px; }
.select2-container--bootstrap4 .select2-selection__clear:hover { color: #343a40; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection { border-color: #ced4da; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-search__field { cursor: not-allowed; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice { background-color: #e9ecef; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection__clear, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove { display: none; }
.select2-container--bootstrap4 .select2-dropdown { border-color: #80bdff; border-width: 1px; overflow-x: hidden; margin-top: -1px; }
.select2-container--bootstrap4 .select2-dropdown--above { margin-top: 1px; }
.select2-container--bootstrap4 .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; }
.select2-container--bootstrap4 .select2-selection--single { height: calc(2.25rem + 2px); line-height: 1; padding: 0.75rem 1.125rem 0.75rem 0.375rem; }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { position: absolute; bottom: 0; right: 0.375rem; top: 0; width: 0.25rem; }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-color: #6c757d transparent transparent transparent; border-style: solid; border-width: 0.25rem 0.25rem 0 0.25rem; height: 0; left: 0; margin-left: -0.25rem; margin-top: -0.125rem; position: absolute; top: 50%; width: 0; }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered { color: #495057; padding: 0; }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.25rem + 2px); padding: 0; height: auto; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; display: block; line-height: 1; list-style: none; margin: 0; overflow: hidden; padding: 0.75rem 0.375rem 0 0.75rem; width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder { color: #6c757d; float: left; margin-top: 5px; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { color: #495057; background: transparent; border: 1px solid #343a40; border-radius: 0.25rem; cursor: default; float: left; margin: -0.25rem 0 0 0.1875rem; padding: 0 0.75rem; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { background: transparent; padding: 0 0.375rem; height: calc(2.25rem + 2px)-2; line-height: 1; margin-top: 0; min-width: 5em; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove { color: #6c757d; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 0.375rem; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover { color: #343a40; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.75rem; }
.select2-container--bootstrap4 .select2-selection--single.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--single, .form-group-sm .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.2rem; font-size: 75%; height: calc(1.8125rem + 2px); line-height: 1; padding: 0.5rem 1rem 0.5rem 0.25rem; }
.select2-container--bootstrap4 .select2-selection--single.input-sm .select2-selection__arrow b, .input-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { margin-left: -0.5rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(1.8125rem + 2px); border-radius: 0.2rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__rendered, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { padding: 0.5rem 0.25rem 0 0.5rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__choice, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 75%; line-height: 1; margin: 0 0 0 0.125rem; padding: 0 0.5rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-search--inline .select2-search__field, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.25rem; font-size: 75%; height: calc(1.8125rem + 2px)-2; line-height: 1; }
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__clear, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.5rem; }
.select2-container--bootstrap4 .select2-selection--single.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--single, .form-group-lg .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.3rem; font-size: 1.25rem; height: calc(2.875rem + 2px); line-height: 1; padding: 1rem 1.4375rem 1rem 0.5rem; }
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { width: 0.3125rem; }
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow b, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-width: 0.3125rem 0.3125rem 0 0.3125rem; margin-left: -0.3125rem; margin-left: -1rem; margin-top: -0.15625rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.875rem + 2px); border-radius: 0.3rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__choice, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 1.25rem; line-height: 1; border-radius: 0.25rem; margin: 0rem 0 0 0.25rem; padding: 0 1rem; }
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-search--inline .select2-search__field, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.5rem; font-size: 1.25rem; height: calc(2.875rem + 2px)-2; line-height: 1; }
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__clear, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 1rem; }
.select2-container--bootstrap4 .select2-selection.input-lg.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
.input-group-lg .select2-container--bootstrap4 .select2-selection.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single { padding-left: 1.125rem; padding-right: 0.375rem; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 0; padding-left: 0; text-align: right; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 0.375rem; right: auto; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow b { margin-left: 0; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 0; margin-right: 0.1875rem; }
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; }
.has-warning .select2-dropdown, .has-warning .select2-selection { border-color: #ffc107; }
.has-warning .select2-container--focus .select2-selection, .has-warning .select2-container--open .select2-selection { border-color: #d39e00; }
.has-warning.select2-drop-active { border-color: #d39e00; }
.has-warning.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #d39e00; }
.has-error .select2-dropdown, .has-error .select2-selection { border-color: #dc3545; }
.has-error .select2-container--focus .select2-selection, .has-error .select2-container--open .select2-selection { border-color: #bd2130; }
.has-error.select2-drop-active { border-color: #bd2130; }
.has-error.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #bd2130; }
.has-success .select2-dropdown, .has-success .select2-selection { border-color: #28a745; }
.has-success .select2-container--focus .select2-selection, .has-success .select2-container--open .select2-selection { border-color: #1e7e34; }
.has-success.select2-drop-active { border-color: #1e7e34; }
.has-success.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #1e7e34; }
.input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection, .input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection.form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection.form-control { border-radius: 0; }
.input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection.form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .select2-container--bootstrap4 { display: table; table-layout: fixed; position: relative; z-index: 2; width: 100%; margin-bottom: 0; }
.input-group > .select2-container--bootstrap4 > .selection > .select2-selection.form-control { float: none; }
.input-group > .select2-container--bootstrap4.select2-container--open, .input-group > .select2-container--bootstrap4.select2-container--focus { z-index: 3; }
.input-group > .select2-container--bootstrap4, .input-group > .select2-container--bootstrap4 .input-group-btn, .input-group > .select2-container--bootstrap4 .input-group-btn .btn { vertical-align: top; }
.form-control.select2-hidden-accessible { position: absolute !important; width: 1px !important; }
@media (min-width: 576px) { .form-inline .select2-container--bootstrap4 { display: inline-block; } }
+484
View File
@@ -0,0 +1,484 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }
.select2-results {
display: block; }
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
.select2-container--classic .select2-dropdown--below {
border-top: none; }
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
+6457
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+5746
View File
File diff suppressed because it is too large Load Diff
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+1
View File
@@ -32,6 +32,7 @@ CREATE TABLE `member` (
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
`IMGSVR` INT(1) NULL DEFAULT '0',
`acl` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
`penalty` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
`GRADE` INT(1) NULL DEFAULT '1',
`REG_NUM` INT(3) NULL DEFAULT '0',
`REG_DATE` DATETIME NOT NULL,
+1 -38
View File
@@ -73,7 +73,6 @@ $sel[$type] = "selected";
<td width=130 align=center id=bg1> </td>
<td width=80 align=center id=bg1> </td>
<td width=60 align=center id=bg1> </td>
<td align=center id=bg1> </td>
</tr>
<?php
@@ -95,11 +94,7 @@ for ($i=0; $i < $dipcount; $i++) {
$me = $dip['me'];
$you = $dip['you'];
$query = "select reserved,showing from diplomacy where you='$me' and me='$you'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$dip2 = MYDB_fetch_array($result2);
if ($dip['state'] == 2 && $dip['fixed'] == "" && $dip['reserved'] == "" && $dip2['reserved'] == "") {
if ($dip['state'] == 2) {
continue;
}
@@ -115,37 +110,6 @@ for ($i=0; $i < $dipcount; $i++) {
}
$date = date('Y-m-d H:i:s');
$note = "";
if ($dip['fixed'] != "") {
if ($dip['state'] == 7) {
$note .= $dip['fixed'];
} else {
$note .= "<font color=gray>{$dip['fixed']}</font>";
}
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
$note .= "<br>";
}
}
if ($dip['reserved'] != "") {
if ($dip['showing'] >= $date) {
$note .= "<font color=skyblue>아국측 제의</font>: {$dip['reserved']}";
} else {
$note .= "<font color=gray>아국측 제의: {$dip['reserved']}</font>";
}
if ($dip2['reserved'] != "") {
$note .= "<br>";
}
}
if ($dip2['reserved'] != "") {
if ($dip2['showing'] >= $date) {
$note .= "<font color=limegreen>상대측 제의</font>: {$dip2['reserved']}";
} else {
$note .= "<font color=gray>상대측 제의: {$dip2['reserved']}</font>";
}
}
if ($note == "") {
$note = "&nbsp;";
}
echo "
<tr>
@@ -153,7 +117,6 @@ for ($i=0; $i < $dipcount; $i++) {
<td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td>
<td align=center>$state</td>
<td align=center>{$dip['term']} 개월</td>
<td align=left style=font-size:7px;>{$note}</td>
</tr>";
}
?>
-2
View File
@@ -6,8 +6,6 @@ include "func.php";
$btn = Util::getReq('btn');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
-2
View File
@@ -6,8 +6,6 @@ include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
-2
View File
@@ -6,8 +6,6 @@ include "func.php";
$type = Util::getReq('type', 'int', 9);
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
-2
View File
@@ -7,8 +7,6 @@ $btn = Util::getReq('btn');
$yearmonth = Util::getReq('yearmonth', 'int');
$serverID = Util::getReq('serverID', 'string', null);
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
-2
View File
@@ -6,8 +6,6 @@ include "func.php";
$type = Util::getReq('type', 'int', 1);
extractMissingPostToGlobals();
if($type <= 0 || $type > 8){
$type = 1;
}
-2
View File
@@ -7,8 +7,6 @@ include "func.php";
$msg = Util::getReq('msg');
$msg2 = Util::getReq('msg2');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
+8 -7
View File
@@ -16,8 +16,6 @@ if ($type < 0 || $type > 3) {
$type = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -49,11 +47,14 @@ if ($con >= 2) {
exit();
}
//재야인 경우
$meLevel = $me['level'];
if ($meLevel == 0 || ($meLevel == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
$permission = checkSecretPermission($me);
if($permission < 0){
echo '국가에 소속되어있지 않습니다.';
die();
}
else if ($permission < 1) {
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
die();
}
//잘못된 접근
-82
View File
@@ -1,82 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("기밀실", 1);
$query = "select no,nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['level'] < 5) {
echo "수뇌부가 아닙니다.";
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?=UniqueConst::$serverName?>: 기밀실</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<div style='width:1000px;margin:auto'>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td> <br><?=backButton()?></td></tr>
<form name=form1 method=post action=c_chiefboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
</form>
</table>
<br>
<?php
$nation = getNation($me['nation']);
//20개 메세지
$index = $nation['coreindex'];
for($i=0; $i < 20; $i++) {
$who = "coreboard{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($nation["coreboard{$index}"] != '') { msgprint($nation["coreboard{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["coreboard{$index}_when"], $index, 1); }
$index--;
if($index < 0) { $index = 19; }
}
?>
<table width=1000 class='tb_layout bg0'>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</div>
</body>
</html>
+8 -7
View File
@@ -17,16 +17,17 @@ $query = "select no,nation,level,con,turntime,belong from general where owner='{
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me['con']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
$permission = checkSecretPermission($me);
if($permission < 0){
echo '국가에 소속되어있지 않습니다.';
die();
}
else if ($permission < 1) {
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
die();
}
if($me['level'] >= 5) { $btn = "submit"; $btn2 = "button"; }
+26 -24
View File
@@ -6,8 +6,6 @@ include "func.php";
$citylist = Util::getReq('citylist', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -37,8 +35,12 @@ $templates = new \League\Plates\Engine('templates');
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/select2/select2.full.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/currentCity.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../e_lib/select2/select2.min.css')?>
<?=WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
@@ -65,8 +67,9 @@ $templates = new \League\Plates\Engine('templates');
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td width=998>
<form name=cityselect method=get>도시선택 :
<select name=citylist size=1 style=color:white;background-color:black;width:798px;>
<form name=cityselect method=get>
<div style='text-align:center;'>도시선택 :
<select id="citySelector" name=citylist size=1 style='display:inline-block;min-width:400px;'>
<?php
if(!$citylist){
$citylist = $me['city'];
@@ -81,11 +84,11 @@ if($me['level'] == 0) {
echo "
<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================".StringUtil::padString($city['name'], 4, '_')."";
echo ">【".StringUtil::padString($city['name'], 4, '_')."";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국==";
echo "============================================</option>";
elseif($me['nation'] == $city['nation']) echo "본국";
else echo "타국";
echo "</option>";
} else {
// 아국 도시들 선택
$query = "select city,name,nation from city where nation='{$me['nation']}'";
@@ -97,11 +100,11 @@ if($me['level'] == 0) {
echo "
<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================".StringUtil::padString($city['name'], 4, '_')."";
echo ">【".StringUtil::padString($city['name'], 4, '_')."";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국==";
echo "============================================</option>";
elseif($me['nation'] == $city['nation']) echo "본국";
else echo "타국";
echo "</option>";
}
// 아국 장수가 있는 타국 도시들 선택
@@ -114,11 +117,11 @@ if($me['level'] == 0) {
echo "
<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================".StringUtil::padString($city['name'], 4, '_')."";
echo ">【".StringUtil::padString($city['name'], 4, '_')."";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국==";
echo "============================================</option>";
elseif($me['nation'] == $city['nation']) echo "본국";
else echo "타국";
echo "</option>";
}
}
@@ -146,19 +149,18 @@ if($myNation['level'] > 0) {
foreach ($db->query('SELECT city,name,nation FROM city WHERE city in %li', $spyCities) as $city) {
echo "<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================".StringUtil::padString($city['name'], 4, '_')."";
echo ">【".StringUtil::padString($city['name'], 4, '_')."";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국==";
echo "============================================</option>";
elseif($me['nation'] == $city['nation']) echo "본국";
else echo "타국";
echo "</option>";
}
}
}
echo "
</select>
<input type=submit value='도 시 선 택'>
</select></div>
<p align=center>명령 화면에서 도시를 클릭하셔도 됩니다.</p>
</form>
</td>
@@ -177,7 +179,7 @@ if($valid == 0 && $userGrade < 5) {
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
$cityNation = getNationStaticInfo($city['nation']);
//태수, 군사, 시중
//태수, 군사, 종사
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
$gen2 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen2']);
$gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen3']);
@@ -413,7 +415,7 @@ foreach($generalsFormat as $general){
<td align=center><?=$gen1['name']??'-'?></td>
<td align=center class=bg1>군사</td>
<td align=center><?=$gen2['name']??'-'?></td>
<td align=center class=bg1>시중</td>
<td align=center class=bg1>종사</td>
<td align=center><?=$gen3['name']??'-'?></td>
</tr>
<tr>
+20 -50
View File
@@ -13,13 +13,9 @@ $connect=$db->get();
increaseRefresh("내무부", 1);
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$me = $db->queryFirstRow('SELECT no, nation, level, con, turntime, belong FROM general WHERE owner=%i', $userID);
$query = "select secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$nation = MYDB_fetch_array($result);
$nation = $db->queryFirstRow('SELECT msg, scoutmsg FROM nation WHERE nation = %i', $me['nation']);
$con = checkLimit($me['con']);
if ($con >= 2) {
@@ -27,9 +23,14 @@ if ($con >= 2) {
exit();
}
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
$permission = checkSecretPermission($me);
if($permission < 0){
echo '국가에 소속되어있지 않습니다.';
die();
}
else if ($permission < 1) {
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
die();
}
if ($me['level'] >= 5) {
@@ -49,7 +50,9 @@ if ($me['level'] >= 5) {
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내무부</title>
<script>
var editable = <?=($me['level']>=5?'true':'false')?>;
var editable = <?=(($me['level']>=5||$permission==4)?'true':'false')?>;
var nationMsg = <?=Json::encode($nation['msg']??'')?>;
var scoutmsg = <?=Json::encode($nation['scoutmsg']??'')?>;
</script>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
@@ -108,19 +111,15 @@ for ($i=0; $i < $nationcount; $i++) {
<td align=center>-</td>
<td align=center>-</td>
<td align=center>-</td>
<td align=left style=font-size:7px;>-</td>
</tr>";
continue;
}
$query = "select state,term,fixed,reserved,showing from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
$query = "select state,term from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$dip = MYDB_fetch_array($result2);
$query = "select reserved,showing from diplomacy where you='{$me['nation']}' and me='{$nation['nation']}'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$dip2 = MYDB_fetch_array($result2);
//속령수
$query = "select city from city where nation='{$nation['nation']}'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
@@ -146,33 +145,6 @@ for ($i=0; $i < $nationcount; $i++) {
}
$date = date('Y-m-d H:i:s');
$note = "";
if ($dip['fixed'] != "") {
if ($dip['state'] == 7) {
$note .= $dip['fixed'];
} else {
$note .= "<font color=gray>{$dip['fixed']}</font>";
}
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
$note .= "<br>";
}
}
if ($dip['showing'] >= $date) {
if ($dip['reserved'] != "") {
$note .= "<font color=skyblue>아국측 제의</font>: ".$dip['reserved'];
if ($dip2['reserved'] != "") {
$note .= "<br>";
}
}
}
if ($dip2['showing'] >= $date) {
if ($dip2['reserved'] != "") {
$note .= "<font color=limegreen>상대측 제의</font>: ".$dip2['reserved'];
}
}
if ($note == "") {
$note = "&nbsp;";
}
echo "
<tr>
@@ -190,15 +162,13 @@ for ($i=0; $i < $nationcount; $i++) {
<td align=center>-</td>
<td align=center>-</td>";
}
echo "
<td align=left style=font-size:7px;>{$note}</td>
</tr>";
echo "</tr>";
}
echo "
</table>
";
$query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,scoutmsg,secretlimit from nation where nation='{$me['nation']}'";
$query = "select nation,name,color,type,gold,rice,bill,rate,scout,war,secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$nation = MYDB_fetch_array($result);
@@ -243,7 +213,7 @@ if ($budgetricediff > 0) {
<input type='submit' class='submit' name=btn value='국가방침 수정'><input type='button' class='cancel_edit' value='취소'>
</div>
</div>
<textarea type=hidden class='input_form' style='display:none;' name=msg><?=$nation['msg']?></textarea>
<input type='hidden' class='input_form' name='msg' data-global='nationMsg'>
<div class='edit_form viewer'></div>
</div></td></tr>
<tr><td colspan='2'><div id='scoutMsgForm'>
@@ -256,7 +226,7 @@ if ($budgetricediff > 0) {
</div>
</div>
<div style='border-bottom:solid gray 0.5px;'>870px x 200px를 넘어서는 내용은 표시되지 않습니다.</div>
<textarea type=hidden class='input_form' style='display:none;' name=scoutmsg><?=$nation['scoutmsg']?></textarea>
<input type='hidden' class='input_form' name='scoutmsg' data-global='scoutmsg'>
<div style="width:870px;margin-left:auto;">
<div class='edit_form viewer'></div>
</div>
@@ -304,8 +274,8 @@ if ($budgetricediff > 0) {
<tr>
<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 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>
<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 class=bg1>기밀 권한 (1 ~ 99)&nbsp;&nbsp;&nbsp;</td>
+17 -7
View File
@@ -23,7 +23,7 @@ $query = "select no,nation,level,con,turntime,belong from general where owner='{
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$query = "select level,secretlimit from nation where nation='{$me['nation']}'";
$query = "select level from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$nation = MYDB_fetch_array($result);
@@ -33,9 +33,14 @@ if ($con >= 2) {
exit();
}
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
$permission = checkSecretPermission($me);
if($permission < 0){
echo '국가에 소속되어있지 않습니다.';
die();
}
else if ($permission < 1) {
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
die();
}
$sel = [];
@@ -99,10 +104,15 @@ switch ($type) {
$generals = $db->query('SELECT npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general WHERE nation = %i %l', $me['nation'], $orderSQL);
$genCntEff = 0;
foreach ($generals as &$general) {
$general['cityText'] = CityConst::byID($general['city'])->name;
$general['troopText'] = $troopName[$general['troop']]??'-';
if($general['npc'] != 5){
$genCntEff += 1;
}
if ($general['level'] == 12) {
$lbonus = $nation['level'] * 2;
} elseif ($general['level'] >= 5) {
@@ -220,11 +230,11 @@ foreach($generals as $general){
<tr>
<td class='bg1'>전체 </td><td><?=number_format($totalGold)?></td>
<td class='bg1'>전체 </td><td><?=number_format($totalRice)?></td>
<td class='bg1'>평균 </td><td><?=number_format($totalGold/$genCnt, 2)?></td>
<td class='bg1'>평균 </td><td><?=number_format($totalRice/$genCnt, 2)?></td>
<td class='bg1'>평균 </td><td><?=number_format($totalGold/$genCntEff, 2)?></td>
<td class='bg1'>평균 </td><td><?=number_format($totalRice/$genCntEff, 2)?></td>
</tr>
<tr>
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCnt)?></td>
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCntEff)?></td>
<td class='bg1'>훈사 90 병력/장수</td><td><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
<td class='bg1'>훈사 80 병력/장수</td><td><?=number_format($crew80)?>/<?=number_format($gen80)?></td>
<td class='bg1'>훈사 60 병력/장수</td><td><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
+2 -4
View File
@@ -9,8 +9,6 @@ if ($type <= 0 || $type > 12) {
$type = 10;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -115,7 +113,7 @@ for ($j=0; $j < $citycount; $j++) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen2 = MYDB_fetch_array($genresult);
$query = "select name from general where no='{$city['gen3']}'"; // 시중
$query = "select name from general where no='{$city['gen3']}'"; // 종사
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen3 = MYDB_fetch_array($genresult);
@@ -165,7 +163,7 @@ for ($j=0; $j < $citycount; $j++) {
<td align=center>";
echo $gen2['name']==''?"-":"{$gen2['name']}";
echo "</td>
<td align=center id=bg1>시중</td>
<td align=center id=bg1>종사</td>
<td align=center>";
echo $gen3['name']==''?"-":"{$gen3['name']}";
echo "</td>
-2
View File
@@ -9,8 +9,6 @@ if($type <= 0 || $type > 15) {
$type = 1;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
+1 -1
View File
@@ -120,7 +120,7 @@ echo "
<td align=center>+$goldincomeList[0] / +$deadIncome</td>
<td align=center id=bg1>세곡/둔전</td>
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
<td align=center id=bg1>지급</td>
<td align=center id=bg1>지급</td>
<td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"{$nation['bill']} %"; echo "</td>
</tr>
<tr>
-2
View File
@@ -10,8 +10,6 @@ $tnmt = Util::getReq('tnmt', 'int', 1);
//$detachNPC = Util::getReq('detachNPC', 'bool');
$detachNPC = false;
extractMissingPostToGlobals();
if($mode < 0 || $mode > 2){
$mode = 2;
}
-77
View File
@@ -1,77 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("회의실", 1);
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
?>
<!DOCTYPE html>
<html>
<head>
<title><?=UniqueConst::$serverName?>: 회의실</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<div style='width:1000px;margin:auto'>
<table width=1000 class='tb_layout bg0'>
<tr><td> <br><?=backButton()?></td></tr>
<form name=form1 method=post action=c_nationboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
</form>
</table>
<br>
<?php
$nation = getNation($me['nation']);
//20개 메세지
$index = $nation['boardindex'];
for($i=0; $i < 20; $i++) {
$who = "board{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($nation["board{$index}"] != '') { msgprint($nation["board{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["board{$index}_when"], $index, 0); }
$index--;
if($index < 0) { $index = 19; }
}
?>
<table width=1000 class='tb_layout bg0'>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</div>
</body>
</html>
-63
View File
@@ -1,63 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("국법", 1);
?>
<!DOCTYPE html>
<html>
<head>
<title><?=UniqueConst::$serverName?>: 국법</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td> <br><?=backButton()?></td></tr>
<tr><td>
<?php
$query = "select no,nation,level from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select rule from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($me['level'] >= 5) {
echo "
<form name=form1 method=post action=c_nationrule.php>
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px;>{$nation['rule']}</textarea><br>
<input type=submit value=저장하기>
</form>";
} else {
echo "
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px; readonly>{$nation['rule']}</textarea><br>";
}
?>
</td></tr>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</body>
</html>
+1 -1
View File
@@ -255,7 +255,7 @@ $startYear = $gameStor->getValue('startyear');
<option value="1">일반</option>
<option value="4">태수</option>
<option value="3">군사</option>
<option value="2">시중</option>
<option value="2">종사</option>
<option value="10">무장 수뇌</option>
<option value="9">지장 수뇌</option>
<option value="11">참모</option>
-1
View File
@@ -27,7 +27,6 @@ $sel = Util::getReq('sel', 'int');
$msg = '';
$msg2 = '';
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
-60
View File
@@ -1,60 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num', 'int');
$reply = Util::getReq('reply');
// $title, $msg, $num
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
if (getBlockLevel() == 1 || getBlockLevel() == 3) {
header('location:b_chiefboard.php');
die();
}
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($me['nation']);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation['coreindex'] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='{$me['no']}',coreboard{$num}_when='$date' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set coreindex='$num' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set coreboard{$num}='$newmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
header('location:b_chiefboard.php');
+7 -4
View File
@@ -12,8 +12,6 @@ $rate = Util::getReq('rate', 'int');
$bill = Util::getReq('bill', 'int');
$secretlimit = Util::getReq('secretlimit', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -23,7 +21,12 @@ $db = DB::db();
$me = $db->queryFirstRow('SELECT `no`,nation,`level` FROM general WHERE `owner`=%i', $userID);
//내가 수뇌부이어야함
if($me['level'] < 5) {
$permission = checkSecretPermission($me);
if($permission < 0){
header('location:b_myBossInfo.php');
exit();
}
else if ($me['level'] < 5 && $permission != 4) {
header('location:b_myBossInfo.php');
exit();
}
@@ -44,7 +47,7 @@ if($btn == "국가방침 수정") {
$db->update('nation', [
'rate'=>$rate,
], 'nation=%i', $me['nation']);
} elseif($btn == "지급") {
} elseif($btn == "지급") {
$bill = Util::valueFit($bill, 20, 200);
$db->update('nation', [
'bill'=>$bill
-5
View File
@@ -93,11 +93,6 @@ if($command == 61) {
$me = MYDB_fetch_array($result);
if($me['level'] >= 5) {
$note = StringUtil::neutralize($note, 90);
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = count($turn);
$str = "type=type";
for($i=0; $i < $count; $i++) {
+11 -4
View File
@@ -11,8 +11,6 @@ $genlist = Util::getReq('genlist', 'int');
$outlist = Util::getReq('outlist', 'int');
$citylist = Util::getReq('citylist', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -61,7 +59,7 @@ if($btn == "임명") {
header('location:b_myBossInfo.php');
exit();
}
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr from general where no='$outlist'";
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr,permission,penalty from general where no='$outlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -76,6 +74,13 @@ if($btn == "임명") {
exit();
}
//추방할사람이 외교권자이면 불가
$permission = checkSecretPermission($general);
if($permission == 4){
header('location:b_myBossInfo.php');
exit();
}
//NPC 부대장 추방 불가
if($general['npc'] == 5){
header('location:b_myBossInfo.php');
@@ -150,13 +155,15 @@ if($btn == "추방") {
else{
$db->update('general', [
'level'=>0,
'permission'=>'normal',
'nation'=>0,
'belong'=>0,
'betray'=>$db->sqleval('betray + 1'),
'makelimit'=>12,
'gold'=>$general['gold'],
'rice'=>$general['rice'],
'experience'=>$db->sqleval('experience * (1 - 0.1*betray)'),
'dedication'=>$db->sqleval('dedication * (1 - 0.1*betray)'),
'betray'=>$db->sqleval('betray + 1'),
], 'no=%i', $general['no']);
}
}
-56
View File
@@ -1,56 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
// $title, $msg, $num
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num', 'int');
$reply = Util::getReq('reply');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($me['nation']);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation['boardindex'] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set board{$num}='$msg',board{$num}_who='{$me['no']}',board{$num}_when='$date' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set boardindex='$num' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["board{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set board{$num}='$newmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
header('location:b_nationboard.php');
-27
View File
@@ -1,27 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
// $msg
$msg = Util::getReq('msg');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$msg = addslashes(SQ2DQ($msg));
$query = "update nation set rule='$msg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
header('location:b_nationrule.php');
-2
View File
@@ -14,8 +14,6 @@ $gen = Util::getReq('gen', 'int');
$sel = Util::getReq('sel', 'int');
$trig = Util::getReq('trig', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
-2
View File
@@ -9,8 +9,6 @@ $name = Util::getReq('name');
$gen = Util::getReq('gen', 'int');
$troop = Util::getReq('troop', 'int');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = $session::getUserID();
-2
View File
@@ -10,8 +10,6 @@ $comment = Util::getReq('comment');
$title = Util::getReq('title');
$str = Util::getReq('str');
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
+16
View File
@@ -218,3 +218,19 @@ div.bar_out div.bar_in{
margin:0;
padding:0;
}
.select2-selection--single.simple-select2-align-center .select2-selection__rendered {
text-align: center;
}
.select2-dropdown.simple-select2-align-center li.select2-results__option{
text-align: center;
}
.select2-container--bootstrap4 .select2-selection--single.text-secondary .select2-selection__rendered{
color:white;
}
.select2-container--bootstrap4 .text-secondary .select2-results__option[aria-selected=false]{
color:white;
}
+26 -2
View File
@@ -59,12 +59,16 @@
height:667px;
}
.private_message{
.diplomacy_message{
height:667px;
}
.national_message{
height:1350px;
flex: 1;
}
.private_message{
flex: 1;
}
.msg_icon{
@@ -83,6 +87,7 @@
font-weight: bold;
margin-bottom:3px;
color:white;
position: relative;
}
.message_input_form{
@@ -129,6 +134,16 @@
outline-style:solid;
outline-width:1px;
outline-color: gray;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.board_side > div{
height: 1.2em;
}
.msg_invalid{
color:rgba(255,255,255,0.5);
}
.msg_body{
@@ -143,6 +158,14 @@
border-radius: 3px;
}
.btn-delete-msg{
position: absolute;
right: 0;
top: 0;
margin:2px 2px 0 2px;
font-size:8px;
}
/*
.public_message .msg_target{
box-shadow: 2px 2px darkslategrey;
@@ -164,6 +187,7 @@
.msg_content{
margin-left:10px;
margin-right:5px;
overflow:hidden;
}
.msg_prompt{
+67 -62
View File
@@ -243,7 +243,7 @@ function cityInfo() {
<td height=7>".bar($wall)."</td>
<td rowspan=2 style='text-align:center;' class='bg1'><b>시세</b></td>
<td height=7>".bar($trade)."</td>
<td rowspan=2 style='text-align:center;' class='bg1'><b>시중</b></td>
<td rowspan=2 style='text-align:center;' class='bg1'><b>종사</b></td>
<td rowspan=2 style='text-align:center;'>{$gen3['name']}</td>
</tr>
<tr>
@@ -322,7 +322,7 @@ function myNationInfo() {
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$nation['rice']}";echo "</td>
</tr>
<tr>
<td class='bg1 center'><b>지급</b></td>
<td class='bg1 center'><b>지급</b></td>
<td class='center'>";
if($me['nation'] == 0) {
echo "해당 없음";
@@ -399,6 +399,61 @@ function myNationInfo() {
";
}
function checkSecretPermission($me){
if(!key_exists($me['penalty']) || !key_exists($me['permission'])){
trigger_error ('canAccessSecret() 함수에 필요한 인자가 부족');
}
$penalty = Json::decode($me['penalty'])??[];
$permission = $me['permission'];
if(!$me['nation']){
return -1;
}
if($me['level'] == 0){
return -1;
}
$secretLimit = $db->queryFirstField('SELECT secretlimit FROM nation WHERE nation = %i', $me['nation']);
if($pernalty['noSecret']??false){
return 0;
}
$secretMin = 0;
$secretMax = 3;
if($penalty['noTopSecret']??false){
$secretMax = 1;
}
else if($penalty['noChief']??false){
$secretMax = 1;
}
else if($penalty['noAmbassador']??false){
$secretMax = 2;
}
if($me['level'] == 12){
$secretMin = 4;
}
else if($me['permission'] == 'ambassador'){
$secretMin = 4;
}
else if($me['permission'] == 'auditor'){
$secretMin = 3;
}
else if($me['level'] >= 5){
$secretMin = 2;
}
else if($me['level'] > 1){
$secretMin = 1;
}
else if($me['belong'] >= $secretLimit){
$secretMin = 1;
}
return min($secretMin, $secretMax);
}
function addCommand($typename, $value, $valid = 1, $color=0) {
if($valid == 1) {
switch($color) {
@@ -437,7 +492,7 @@ function commandTable() {
$connect=$db->get();
$userID = Session::getUserID();
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario']);
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario', 'join_mode']);
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -493,7 +548,7 @@ function commandTable() {
<select name=commandtype size=1 style='height:20px;width:260px;color:white;background-color:black;font-size:12px;'>";
addCommand("휴 식", 0);
addCommand("요 양", 50);
commandGroup("========= 내 정 ==========");
commandGroup("======= 내 정 ========");
if($me['level'] >= 1 && ($citycount != 0 || $admin['year'] >= $admin['startyear']+3) && $city['supply'] != 0) {
addCommand("농지개간(지력경험, 자금$develcostA)", 1, 1, $colorA);
addCommand("상업투자(지력경험, 자금$develcostA)", 2, 1, $colorA);
@@ -519,7 +574,7 @@ function commandTable() {
addCommand("물자조달(랜덤경험)", 9, 0);
}
commandGroup("", 1);
commandGroup("========= 군 사 ==========");
commandGroup("======= 군 사 ========");
if($me['level'] >= 1 && $citycount > 0) {
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31);
addCommand("징병(통솔경험)", 11);
@@ -544,7 +599,7 @@ function commandTable() {
}
commandGroup("", 1);
commandGroup("========= 인 사 ==========");
commandGroup("======= 인 사 ========");
addCommand("이동(통솔경험, 자금$develcost, 사기↓)", 21);
addCommand("강행(통솔경험, 자금$develcost5, 병력/사기/훈련↓)", 30);
@@ -554,7 +609,10 @@ function commandTable() {
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
}
if($me['level'] >= 1 && $city['supply'] != 0) {
if($admin['join_mode'] == 'onlyRandom'){
//do Nothing
}
else if($me['level'] >= 1 && $city['supply'] != 0) {
addCommand("등용(자금{$develcost5}+장수가치)", 22);
} else {
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
@@ -576,7 +634,7 @@ function commandTable() {
addCommand("임관", 25, 0);
}
commandGroup("", 1);
commandGroup("========= 계 략 ==========");
commandGroup("======= 계 략 ========");
if($me['level'] >= 1 && (($nation['level'] > 0 && $city['nation'] == $me['nation'] && $city['supply'] != 0) || $nation['level'] == 0)) {
addCommand("화계(지력경험, 자금$develcost5, 군량$develcost5)", 32);
addCommand("탈취(무력경험, 자금$develcost5, 군량$develcost5)", 33);
@@ -589,7 +647,7 @@ function commandTable() {
addCommand("선동(통솔경험, 자금$develcost5, 군량$develcost5)", 35, 0);
}
commandGroup("", 1);
commandGroup("========= 개 인 ==========");
commandGroup("======= 개 인 ========");
if($me['level'] >= 1) {
addCommand("단련(자금$develcost, 군량$develcost)", 41);
} else {
@@ -1125,59 +1183,6 @@ function nationMsg() {
return $msg?:'';
}
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
$db = DB::db();
$connect=$db->get();
$message = explode('|', $msg);
$count = (count($message) - 2)/2;
$message[0] = Tag2Code($message[0]);
$message[1] = Tag2Code($message[1]);
// $message[0] = str_replace("\n", "<br>", $message[0]);
// $message[1] = str_replace("\n", "<br>", $message[1]);
if($type == 0) { $board = "c_nationboard.php"; }
else { $board = "c_chiefboard.php"; }
$imageTemp = GetImageURL($imgsvr);
echo "
<table style='text-align:center;' width=1000 class='tb_layout bg0'>
<tr>
<td width=90 style='text-align:center;' class='bg1'><font size=1>$name</font></td>
<td width=746 style='text-align:center;' class='bg1'><font size=4><b>$message[0]</b></font></td>
<td width=148 style='text-align:center;' class='bg1'>$when</td>
</tr>
<tr>
<td width=90 height=64 valign=top><img width='64' height='64' class='generalIcon' src='{$imageTemp}/{$picture}' border='0'></td>
<td width=906 colspan=2>$message[1]</td>
</tr>";
for($i=0; $i < $count; $i++) {
$who = Tag2Code($message[2+$i*2]);
$reply = Tag2Code($message[3+$i*2]);
$query = "select name from general where no='$who'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$regen = MYDB_fetch_array($result);
echo "
<tr>
<td width=90 style='text-align:center;'><font size=1>{$regen['name']}</font></td>
<td width=906 colspan=2>$reply</td>
</tr>";
}
echo "
<tr>
<form name=reply_form{$num} method=post action=$board>
<td width=90 style='text-align:center;'>댓글달기</td>
<td width=906 colspan=2>
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:804px;>
<input type=submit value=댓글달기>
<input type=hidden name=num value=$num>
</td>
</form>
</tr>
</table>
<br>";
}
function banner() {
return sprintf(
+12 -5
View File
@@ -105,12 +105,19 @@ function getTurn(array $general, $type, $font=1) {
case 25: //임관
$double = $command[1];
$nation = getNationStaticInfo($double);
if($double == 98){
$nationName = '건국된 임의 국가';
}
else if($double == 99){
$nationName = '임의의 국가';
}
else{
$nationName = getNationStaticInfo($double)['name']??'?!?!';
}
if(!$nation['name']) { $nation['name'] = '????'; }
$josaRo = JosaUtil::pick($nation['name'], '로');
$str[$i] = "{$nation['name']}{$josaRo} 임관";
$josaRo = JosaUtil::pick($nationName, '로');
$str[$i] = "{$nationName}{$josaRo} 임관";
break;
case 26: //집합
$str[$i] = "집합";
+5 -5
View File
@@ -200,7 +200,7 @@ function getSpecialInfo(?int $type):?string{
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
43 => ['집중', '[전투] 계략 성공 시 대미지 +50%'],
44 => ['신중', '[전투] 계략 성공 확률 100%'],
45 => ['반계', '[전투] 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
45 => ['반계', '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
50 => ['보병', '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'],
51 => ['궁병', '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p'],
@@ -278,11 +278,11 @@ function getLevel($level, $nlevel=8) {
case 712: $call = '황제'; break; case 612: $call = '왕'; break;
case 711: $call = '승상'; break; case 611: $call = '광록훈'; break;
case 710: $call = '위장군'; break; case 610: $call = '장군'; break;
case 710: $call = '표기장군'; break; case 610: $call = '장군'; break;
case 709: $call = '사공'; break; case 609: $call = '상서령'; break;
case 708: $call = '기장군'; break; case 608: $call = '장군'; break;
case 708: $call = '기장군'; break; case 608: $call = '장군'; break;
case 707: $call = '태위'; break; case 607: $call = '중서령'; break;
case 706: $call = '거기장군'; break; case 606: $call = '장군'; break;
case 706: $call = '위장군'; break; case 606: $call = '장군'; break;
case 705: $call = '사도'; break; case 605: $call = '비서령'; break;
case 512: $call = '공'; break; case 412: $call = '주목'; break;
@@ -302,7 +302,7 @@ function getLevel($level, $nlevel=8) {
case 4: $call = '태수'; break;
case 3: $call = '군사'; break;
case 2: $call = '시중'; break;
case 2: $call = '종사'; break;
case 1: $call = '일반'; break;
case 0: $call = '재야'; break;
default: $call = '-'; break;
+8
View File
@@ -774,6 +774,10 @@ function checkMerge() {
'data'=>Json::encode($oldNation)
]);
$db->update('general', [
'nation'=>0,
], 'nation=%i AND npc = 5', $me['nation']);
$query = "delete from nation where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아국 모든 도시들 상대국 소속으로
@@ -916,6 +920,10 @@ function checkSurrender() {
'data'=>Json::encode($oldNation)
]);
$db->update('general', [
'nation'=>0,
], 'nation=%i AND npc = 5', $me['nation']);
$query = "delete from nation where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 군주가 있는 위치 구함
+3 -3
View File
@@ -437,12 +437,12 @@ function processAI($no) {
} elseif($admin['month'] == 12) {
//세율
$nation['rate'] = TaxRate($general['nation']);
//지급
//지급
GoldBillRate($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
} elseif($admin['month'] == 6) {
//세율
$nation['rate'] = TaxRate($general['nation']);
//지급
//지급
RiceBillRate($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
}
@@ -1338,7 +1338,7 @@ function NPCStaffWork($general, $nation, $dipState){
return Util::choiceRandomUsingWeight($commandList);
}
//종전하기, 지급
//종전하기, 지급
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
function Promotion($nation, $level) {
+26 -23
View File
@@ -369,17 +369,26 @@ function process_3(&$general) {
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score = intdiv($score, 4); }
//장수수 구함
$query = "select no from general where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
$gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i', $general['nation']);
$gencnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $general['nation']);
if ($gencnt_eff < GameConst::$initialNationGenLimit) {
$gencount = GameConst::$initialNationGenLimit;
$gencnt_eff = GameConst::$initialNationGenLimit;
}
if($gencount != $gencnt_eff){
$score *= $gencount / $gencnt_eff;
}
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $admin['year'], $nation['tech'])) { $score /= 4; }
// 내정 상승
$query = "update nation set totaltech=totaltech+'$score',tech=totaltech/'$gencount' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'totaltech'=>$db->sqleval('totaltech + %i', Util::round($score)),
'tech'=>$db->sqleval('totaltech / %i', $gencount)
], 'nation=%i', $general['nation']);
// 자금 하락, 경험치 상승 // 공헌도, 명성 상승 = $score * 10
$general['gold'] -= $admin['develcost'];
@@ -437,7 +446,7 @@ function process_4(&$general) {
// 군주, 참모 보정
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
// 시중 보정
// 종사 보정
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
$rd = Util::randF();
@@ -637,7 +646,7 @@ function process_7(&$general) {
// 군주, 참모 보정
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
// 시중 보정
// 종사 보정
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
$rd = Util::randF();
@@ -1910,8 +1919,7 @@ function process_42(&$general) {
$log[] = "<C>●</>{$admin['month']}월:호랑이에게 물려 다쳤습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 10 + 10;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 11:
@@ -1925,8 +1933,7 @@ function process_42(&$general) {
$log[] = "<C>●</>{$admin['month']}월:곰에게 할퀴어 다쳤습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 10 + 10;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 13:
@@ -1945,8 +1952,7 @@ function process_42(&$general) {
$log[] = "<C>●</>{$admin['month']}월:위기에 빠진 사람을 구해주다가 다쳤습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 10 + 10;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp2' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp2' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 16:
@@ -2011,24 +2017,21 @@ function process_42(&$general) {
$log[] = "<C>●</>{$admin['month']}월:호랑이에게 물려 크게 다쳤습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 30 + 20;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 25:
$log[] = "<C>●</>{$admin['month']}월:곰에게 할퀴어 크게 다쳤습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 30 + 20;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 26:
$log[] = "<C>●</>{$admin['month']}월:위기에 빠진 사람을 구하다가 죽을뻔 했습니다. <1>$date</>";
// 경험치 하락 // 명성 상승
$injury = rand() % 50 + 30;
$general['power2']--;
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',power2='{$general['power2']}',experience=experience+'$exp2' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',injury=injury+'$injury',experience=experience+'$exp2' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
default:
+1 -14
View File
@@ -605,11 +605,6 @@ function process_61(&$general) {
$validMinutes = max(30, $turnterm*3);
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
//FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다.
//XXX: 으악.
//TODO: 커맨드 처리 방식을 json으로 변경
$option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID);
$msg = new DiplomaticMessage(
Message::MSGTYPE_DIPLOMACY,
$src,
@@ -619,19 +614,11 @@ function process_61(&$general) {
$validUntil,
[
'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION,
'year'=>$when,
'option'=>$option
'year'=>$when
]
);
$msg->send();
//NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다.
//FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록.
$db->update('diplomacy', [
'showing'=>$validUntil->format('Y-m-d H:i:s')
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
// 3턴후
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
}
+41 -10
View File
@@ -11,7 +11,7 @@ function process_22(&$general) {
$history = [];
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getValues(['startyear','year','month','develcost']);
$admin = $gameStor->getValues(['startyear','year','month','develcost','join_mode']);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -26,7 +26,10 @@ function process_22(&$general) {
$cost = Util::round($admin['develcost'] + ($you['experience'] + $you['dedication'])/1000) * 10;
if(!$you) {
if($admin['join_mode'] == 'onlyRandom'){
$log[] = "<C>●</>{$admin['month']}월:랜덤 임관만 가능합니다. 등용 실패. <1>$date</>";
}
else if(!$you) {
$log[] = "<C>●</>{$admin['month']}월:없는 장수입니다. 등용 실패. <1>$date</>";
} elseif($admin['year'] < $admin['startyear']+3) {
$log[] = "<C>●</>{$admin['month']}월:초반 제한중입니다. 등용 실패. <1>$date</>";
@@ -70,7 +73,7 @@ function process_25(&$general) {
$history = [];
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction']);
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction', 'join_mode', 'init_year', 'init_month']);
$query = "select nation from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -79,6 +82,10 @@ function process_25(&$general) {
$command = DecodeCommand($general['turn0']);
$where = $command[1];
if($admin['join_mode'] == 'onlyRandom' && $where < 98){
$where = 99;
}
$nation = null;
$joinedNations = Json::decode($general['nations']);
@@ -126,10 +133,18 @@ function process_25(&$general) {
$allGen = array_sum($generals);
$genLimit = GameConst::$defaultMaxGeneral;
if($admin['join_mode'] == 'onlyRandom' && TimeUtil::IsRangeMonth($admin['init_year'], $admin['init_month'], 1, $admin['year'], $admin['month'])){
$genLimit = GameConst::$initialNationGenLimitForRandInit;
}
else if($admin['year'] < $admin['startyear'] + 3){
$genLimit = GameConst::$initialNationGenLimit;
}
$nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`injury` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
$joinedNations,
($admin['year'] < $admin['startyear']+3)?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
$genLimit
);
shuffle($nations);
@@ -141,17 +156,20 @@ function process_25(&$general) {
}
$score = 1;
if($admin['startyear']+3 > $admin['year'] && $general['npc'] > 2){
if($admin['startyear']+3 > $admin['year'] && $general['npc'] == 2){
$score *= sqrt((100-max(30, $testNation['injury']))/100);
}
$score *= sqrt($allGen/$generals[$testNation['nation']]);
$score *= $allGen/$generals[$testNation['nation']];
$randVals[$idx] = $score;
}
if($randVals){
$nation = $nations[Util::choiceRandomUsingWeight($randVals)];
}
else{
$nation = null;
}
} else {
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
@@ -164,6 +182,15 @@ function process_25(&$general) {
if(!$nation) {
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
if($where >= 98 && $genLimit == GameConst::$initialNationGenLimitForRandInit){
//랜덤 모드, 초기화시에는 랜덤 임관을 대신 한턴 더 넣어준다.
$db->update('general', [
'turn1'=>EncodeCommand(0, 0, $where, 25),
], '`no` = %i', $general['no']);
pushGenLog($general, $log);
process_42($general);
return;
}
} elseif($general['nation'] != 0) {
$log[] = "<C>●</>{$admin['month']}월:재야가 아닙니다. 임관 실패. <1>$date</>";
} elseif($nation['nation'] == 0) {
@@ -568,11 +595,11 @@ function process_45(&$general) {
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>에서 하야");
// 국적 바꾸고 등급 재야로 // 명성/공헌 N*10% 감소
$query = "update general set resturn='SUCCESS',belong=0,betray=betray+1,nation=0,level=0,experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,permission='normal',experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',betray=betray+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//도시의 태수, 군사, 시중직도 초기화
//도시의 태수, 군사, 종사직도 초기화
$query = "update city set gen1='0' where gen1='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2='0' where gen2='{$general['no']}'";
@@ -637,6 +664,8 @@ function process_46(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
$currNationLevel = $db->queryFirstField('SELECT level FROM nation WHERE nation=%i', $general['nation']);
$command = DecodeCommand($general['turn0']);
$color = $command[1];
$type = $command[2]; // 1 ~ 13
@@ -654,6 +683,8 @@ function process_46(&$general) {
$log[] = "<C>●</>{$admin['month']}월:건국 기간이 지났습니다. 건국 실패. <1>$date</>";
} elseif($city['nation'] != 0) {
$log[] = "<C>●</>{$admin['month']}월:공백지가 아닙니다. 건국 실패. <1>$date</>";
} elseif($currNationLevel != 0) {
$log[] = "<C>●</>{$admin['month']}월:방랑군이 아닙니다. 건국 실패. <1>$date</>";
} elseif($nationcount > 0) {
$log[] = "<C>●</>{$admin['month']}월:존재하는 국가명입니다. 건국 실패. <1>$date</>";
} elseif($general['makelimit'] > 0) {
@@ -817,7 +848,7 @@ function process_54(&$general) {
//군주 교체
$query = "update general set level='12' where no='$who'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 태수,군사,시중이었다면 해제
// 태수,군사,종사이었다면 해제
$query = "update city set gen1='0' where gen1='$who'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2='0' where gen2='$who'";
@@ -1028,7 +1059,7 @@ function process_57(&$general) {
//군주 교체
$query = "update general set resturn='SUCCESS',level='12' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 태수,군사,시중이었다면 해제
// 태수,군사,종사이었다면 해제
$query = "update city set gen1='0' where gen1='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2='0' where gen2='{$general['no']}'";
+3 -5
View File
@@ -138,7 +138,7 @@ function commandButton() {
$db = DB::db();
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
$nation = $db->queryFirstRow("select permission,penalty,nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
'nation'=>0,
'level'=>0,
'secretlimit'=>99,
@@ -150,15 +150,13 @@ function commandButton() {
$templates = new \League\Plates\Engine(__dir__.'/templates');
$showSecret = false;
if($me['level'] >= 2){
$permission = checkSecretPermission($me);
if($permission >= 1){
$showSecret = true;
}
else if($me['level']== 0){
$showSecret = false;
}
else if($me['belong'] >= $nation['secretlimit']){
$showSecret = true;
}
return $templates->render('commandButton', [
'bgColor'=>$bgColor,
+10 -10
View File
@@ -68,25 +68,25 @@ function processGoldIncome() {
// 기본량도 안될경우
if($nation['gold'] < GameConst::$basegold) {
$realoutcome = 0;
// 실지급
// 실지급
$ratio = 0;
//기본량은 넘지만 요구량이 안될경우
} elseif($nation['gold'] - GameConst::$basegold < $outcome) {
$realoutcome = $nation['gold'] - GameConst::$basegold;
$nation['gold'] = GameConst::$basegold;
// 실지급
// 실지급
$ratio = $realoutcome / $originoutcome;
} else {
$realoutcome = $outcome;
$nation['gold'] -= $realoutcome;
// 실지급
// 실지급
$ratio = $realoutcome / $originoutcome;
}
$adminLog[] = StringUtil::padStringAlignRight((string)$nation['name'],12," ")
." // 세금 : ".StringUtil::padStringAlignRight((string)$income,6," ")
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
." // 실제 : ".tab2((string)$realoutcome,6," ")
." // 지급 : ".tab2((string)round($ratio*100,2),5," ")
." // 지급 : ".tab2((string)round($ratio*100,2),5," ")
." % // 결과금 : ".tab2((string)$nation['gold'],6," ");
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
@@ -223,7 +223,7 @@ function getGoldIncome($nationNo, $rate, $admin_rate, $type) {
$gen = MYDB_fetch_array($result);
$level3[$gen['no']] = $gen['city'];
}
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($j=0; $j < $count; $j++) {
@@ -391,25 +391,25 @@ function processRiceIncome() {
// 기본량도 안될경우
if($nation['rice'] < GameConst::$baserice) {
$realoutcome = 0;
// 실지급
// 실지급
$ratio = 0;
//기본량은 넘지만 요구량이 안될경우
} elseif($nation['rice'] - GameConst::$baserice < $outcome) {
$realoutcome = $nation['rice'] - GameConst::$baserice;
$nation['rice'] = GameConst::$baserice;
// 실지급
// 실지급
$ratio = $realoutcome / $originoutcome;
} else {
$realoutcome = $outcome;
$nation['rice'] -= $realoutcome;
// 실지급
// 실지급
$ratio = $realoutcome / $originoutcome;
}
$adminLog[] = StringUtil::padStringAlignRight($nation['name'],12," ")
." // 세곡 : ".StringUtil::padStringAlignRight((string)$income,6," ")
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
." // 실제 : ".tab2((string)$realoutcome,6," ")
." // 지급 : ".tab2((string)round($ratio*100,2),5," ")
." // 지급 : ".tab2((string)round($ratio*100,2),5," ")
." % // 결과곡 : ".tab2((string)$nation['rice'],6," ");
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
@@ -467,7 +467,7 @@ function getRiceIncome($nationNo, $rate, $admin_rate, $type) {
$gen = MYDB_fetch_array($result);
$level3[$gen['no']] = $gen['city'];
}
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($j=0; $j < $count; $j++) {
+16 -8
View File
@@ -88,6 +88,7 @@ $mapTheme = $admin['map_theme'];
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/main.js')?>
@@ -105,7 +106,7 @@ $(function(){
setInterval(function(){
refreshMsg();
}, 10000);
}, 5000);
});
</script>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
@@ -303,15 +304,22 @@ else if($session->userGrade == 4){
<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">
<section class="public_message">
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="public">이전 메시지 불러오기</button>
</section>
<div class="board_header bg0">개인 메시지(최고99자)</div>
<section class="private_message">
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="private">이전 메시지 불러오기</button>
</section>
</div><div style="right:0;" class="board_side bg0">
<div class="board_header bg0">국가 메시지(최고99자)</div>
<section class="national_message"></section>
<section class="national_message">
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="national">이전 메시지 불러오기</button>
</section>
<div class="board_header bg0">외교 메시지(최고99자)</div>
<section class="diplomacy_message">
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="diplomacy">이전 메시지 불러오기</button>
</section>
</div></div>
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
</div>
+14
View File
@@ -152,6 +152,20 @@ if($session->userGrade < 5 && !$allowReset){
</div>
</div>
<div class="form-group row">
<label for="join_mode" class="col-sm-3 col-form-label">임관 모드</label>
<div class="col-sm-9">
<div id="join_mode" class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="radio" name="join_mode" value="full" checked>일반
</label>
<label class="btn btn-secondary">
<input type="radio" name="join_mode" value="onlyRandom">랜덤 임관
</label>
</div>
</div>
</div>
<div class="form-group row">
<label for="show_img_level" class="col-sm-3 col-form-label">이미지 표기</label>
<div class="col-sm-9">
+2 -1
View File
@@ -87,7 +87,8 @@ $result = ResetHelper::buildScenario(
$options['extend'],
$options['npcmode'],
$options['show_img_level'],
$options['tournament_trig']
$options['tournament_trig'],
$options['join_mode']
);
$result['affected']=1;
+5 -1
View File
@@ -11,14 +11,18 @@ $result = [
$session = Session::requireGameLogin([])->setReadOnly();
$userID = Session::getUserID();
$generalInfo = DB::db()->queryFirstRow('SELECT `no`, `nation`, `level` from `general` where `owner`=%i', $userID);
$generalInfo = DB::db()->queryFirstRow('SELECT `no`, `nation`, `level`, penalty, permission from `general` where `owner`=%i', $userID);
if(!$generalInfo){
Json::die($result);
}
$permission = checkSecretPermission($generalInfo);
$result['generalID'] = $generalInfo['no'];
$result['myNationID'] = $generalInfo['nation'];
$result['isChief'] = ($generalInfo['level'] == 12);
$result['generalLevel'] = $generalInfo['level'];
$result['permission'] = $permission;
Json::die($result);
+74
View File
@@ -0,0 +1,74 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
$title = Util::getReq('title');
$text = Util::getReq('text');
increaseRefresh("회의실", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
if($title === null || $text === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 입력입니다.'
]);
}
$title = trim($title);
$text = trim($text);
if(!$title && !$text){
Json::die([
'result'=>false,
'reason'=>'제목과 내용이 둘다 비어있습니다.'
]);
}
$permission = checkSecretPermission($me);
if($permission < 0){
Json::die([
'result'=>false,
'reason'=>'국가에 소속되어있지 않습니다.'
]);
}
else if ($isSecretBoard && $permission < 2) {
Json::die([
'result'=>false,
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
]);
}
$db->insert('board', [
'nation_no'=>$me['nation'],
'is_secret'=>$isSecretBoard,
'date'=>TimeUtil::DatetimeNow(),
'general_no'=>$me['no'],
'author'=>$me['name'],
'title'=>$title,
'text'=>$text
]);
Json::die([
'result'=>true,
'reason'=>'success',
'row_id'=>$db->insertId()
]);
+82
View File
@@ -0,0 +1,82 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$articleNo = Util::getReq('articleNo', 'int');
$text = Util::getReq('text');
increaseRefresh("회의실", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
if($articleNo === null || $text === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 입력입니다.'
]);
}
$text = trim($text);
if(!$text){
Json::die([
'result'=>false,
'reason'=>'내용이 비어있습니다.'
]);
}
$article = $db->queryFirstRow('SELECT * FROM board WHERE no = %i AND nation_no = %i', $articleNo, $me['nation']);
if(!$article){
Json::die([
'result'=>false,
'reason'=>'게시물이 없습니다.'
]);
}
$isSecretBoard = $article['is_secret'];
$permission = checkSecretPermission($me);
if($permission < 0){
Json::die([
'result'=>false,
'reason'=>'국가에 소속되어있지 않습니다.'
]);
}
else if ($isSecretBoard && $permission < 2) {
Json::die([
'result'=>false,
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
]);
}
$db->insert('comment', [
'nation_no'=>$me['nation'],
'is_secret'=>$isSecretBoard,
'date'=>TimeUtil::DatetimeNow(),
'document_no'=>$articleNo,
'general_no'=>$me['no'],
'author'=>$me['name'],
'text'=>$text
]);
Json::die([
'result'=>true,
'reason'=>'success',
'row_id'=>$db->insertId()
]);
+73
View File
@@ -0,0 +1,73 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
increaseRefresh("회의실", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
$permission = checkSecretPermission($me);
if($permission < 0){
Json::die([
'result'=>false,
'reason'=>'국가에 소속되어있지 않습니다.'
]);
}
else if ($isSecretBoard && $permission < 2) {
Json::die([
'result'=>false,
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
]);
}
$articles = [];
foreach(
$db->query(
'SELECT * FROM board WHERE nation_no = %i AND is_secret = %i ORDER BY date desc',
$me['nation'],
$isSecretBoard
) as $article
){
//TODO:아이콘 받아오기
$article['comment'] = [];
$articles[$article['no']] = $article;
}
foreach(
$db->query(
'SELECT * FROM comment WHERE nation_no = %i AND is_secret = %i ORDER BY date asc',
$me['nation'],
$isSecretBoard
) as $comment
){
//TODO:아이콘 받아오기?
$articles[$article['no']]['comment'] = $comment;
}
Json::die([
'result'=>true,
'articles'=>$articles,
'reason'=>'success'
]);
+68
View File
@@ -0,0 +1,68 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
increaseRefresh("외교부", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
$permission = checkSecretPermission($me);
if($permission < 0){
Json::die([
'result'=>false,
'reason'=>'국가에 소속되어있지 않습니다.'
]);
}
$letters = [];
foreach(
$db->query(
'SELECT * FROM ng_diplomacy WHERE src_nation_id = %i OR dest_nation_id = %i ORDER BY date desc',
$me['nation'], $me['nation']
) as $letter
){
if($permission < 3){
$letter['detail'] = '(권한이 부족합니다)';
}
$letter['comment'] = [];
$letter['aux'] = Json::decode($letter['aux']);
$letters[$letter['no']] = $letter;
}
$nations = [];
foreach(getAllNationStaticInfo() as $nation){
if($nation['nation'] == 0 || $nation['nation'] == $me['nation']){
continue;
}
$nations[] = $nation;
}
Json::die([
'result'=>true,
'nations'=>$nations,
'letters'=>$letters,
'reason'=>'success'
]);
+84
View File
@@ -0,0 +1,84 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$letterNo = Util::getReq('letterNo', 'int');
$isAgree = Util::getReq('isAgree', 'bool', false);
$reason = Util::getReq('reason', 'string', '');
increaseRefresh("회의실", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
if($letterNo === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 입력입니다.'
]);
}
$permission = checkSecretPermission($me);
if ($permission < 4) {
Json::die([
'result'=>false,
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
]);
}
$reason = trim($reason);
$letter = $db->queryFirstRow('SELECT * FROM ng_diplomacy WHERE no=%i AND dest_nation_id = %i AND state = \'proposed\'', $letterNo, $me['nation']);
if(!$letter){
Json::die([
'result'=>false,
'reason'=>'서신이 없습니다.'
]);
}
$aux = Json::decode($letter['aux']);
if($isAgree){
$aux['dest']['generalName'] = $me['name'];
$db->update('ng_diplomacy', [
'state'=>'activated',
'dest_signer'=>$me['no'],
'aux'=>Json::encode($aux)
], 'no=%i', $letterNo);
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
}
else{
$aux['reason'] = [
'who'=>$me['no'],
'action'=>'disagree',
'reason'=>$reason
];
$db->update('ng_diplomacy', [
'state'=>'cancelled',
'aux'=>Json::encode($aux)
]);
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
}
Json::die([
'result'=>true,
'reason'=>'success'
]);
+146
View File
@@ -0,0 +1,146 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$destNationNo = Util::getReq('destNation', 'int', 0);
$prevNo = Util::getReq('prevNo', 'int', null);
$textBrief = Util::getReq('textBrief');
$textDetail = Util::getReq('textDetail');
increaseRefresh("외교부", 1);
if($prevNo < 1){
$prevNo = null;
}
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
Json::die([
'result'=>false,
'reason'=>'접속 제한입니다.'
]);
}
if($destNationNo == $me['nation']){
Json::die([
'result'=>false,
'reason'=>'자국으로 보낼 수 없습니다.'
]);
}
if($textBrief === null || $textDetail === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 입력입니다.'
]);
}
$textBrief = trim($textBrief);
$textDetail = trim($textDetail);
if(!$textBrief){
Json::die([
'result'=>false,
'reason'=>'요약문이 비어있습니다'
]);
}
$permission = checkSecretPermission($me);
if ($permission < 4) {
Json::die([
'result'=>false,
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
]);
}
$srcNationNo = $me['nation'];
$nations = $db->query('SELECT nation, name, color FROM nation WHERE nation IN (%i, %i)', $srcNationNo, $destNationNo);
if(count($nations) != 2){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 국가입니다.'
]);
}
if($prevNo !== null){
//state는 체크하지 않는걸로 하자. 파기한 것을 재 송신하는 경우도 있을 수 있음.
$prevLetter = $db->queryFirstRow(
'SELECT no, state, aux FROM ng_diplomacy WHERE no = %i AND src_nation_id IN (%i, %i) AND dest_nation_id IN (%i, %i)',
$prevNo,
$srcNationNo, $destNationNo,
$srcNationNo, $destNationNo
);
if(!$prevLetter){
Json::die([
'result'=>false,
'reason'=>'이전 문서가 없습니다.'
]);
}
if($prevLetter['state'] == 'proposed'){
$prevAux = Json::decode($prevLetter['aux']);
$prevAux['reason'] = [
'who'=>$me['no'],
'action'=>'new_letter',
'reason'=>'new_letter'
];
$db->update('ng_diplomacy', [
'state'=>'cancelled',
'aux'=>Json::encode($prevAux)
], 'no=%i', $prevNo);
}
}
if($nations[0]['nation'] == $me['nation']){
//index 순서에 따라 또 모름.
$srcNation = $nations[0];
$destNation = $nations[1];
}
else{
$srcNation = $nations[1];
$destNation = $nations[0];
}
$db->insert('ng_diplomacy', [
'src_nation_id'=>$srcNation['nation'],
'dest_nation_id'=>$destNation['nation'],
'prev_no'=>$prevNo,
'state'=>'proposed',
'text_brief'=>$textBrief,
'text_detail'=>$textDetail,
'date'=>TimeUtil::DatetimeNow(),
'src_signer'=>$me['no'],
'dest_signer'=>null,
'aux'=>Json::encode([
'src'=>[
'nationName'=>$srcNation['name'],
'nationColor'=>$srcNation['color'],
'generalName'=>$me['name']
],
'dest'=>[
'nationName'=>$destNation['name'],
'nationColor'=>$destNation['color']
]
]),
]);
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
Json::die([
'result'=>true,
'reason'=>'success',
'row_id'=>$db->insertId()
]);
+8 -4
View File
@@ -41,6 +41,7 @@ $v->rule('required', [
'scenario',
'fiction',
'extend',
'join_mode',
'npcmode',
'show_img_level'
])->rule('integer', [
@@ -51,8 +52,8 @@ $v->rule('required', [
'extend',
'npcmode',
'show_img_level',
'tournament_trig'
]);
'tournament_trig',
])->rule('in', 'join_mode', ['onlyRandom', 'full']);
if(!$v->validate()){
Json::die([
'result'=>false,
@@ -92,6 +93,7 @@ $extend = (int)$_POST['extend'];
$npcmode = (int)$_POST['npcmode'];
$show_img_level = (int)$_POST['show_img_level'];
$tournament_trig = (int)$_POST['tournament_trig'];
$join_mode = $_POST['join_mode'];
if($reserve_open){
$reserve_open = new \DateTime($reserve_open);
@@ -124,7 +126,8 @@ if($reserve_open){
'npcmode'=>$npcmode,
'show_img_level'=>$show_img_level,
'tournament_trig'=>$tournament_trig,
'gameConf'=>$scenarioObj->getGameConf()
'gameConf'=>$scenarioObj->getGameConf(),
'join_mode'=>$join_mode,
]),
'date'=>$reserve_open->format('Y-m-d H:i:s')
]);
@@ -143,5 +146,6 @@ Json::die(ResetHelper::buildScenario(
$extend,
$npcmode,
$show_img_level,
$tournament_trig
$tournament_trig,
$join_mode
));
+72
View File
@@ -0,0 +1,72 @@
<?php
namespace sammo;
include('lib.php');
include('func.php');
$session = Session::requireGameLogin([]);
$userID = Session::getUserID();
$msgID = Util::getReq('msgID', 'int');
if($msgID === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 범위 입니다.'
]);
}
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
$now = new \DateTime();
$delayTime = false;
if(count($lastMsgGet) >= 10){
try{
if($lastMsgGet[0] !== 'string'){
throw new \Exception('Why not string?');
}
$first = new \DateTime($lastMsgGet[0]);
$diff = $first->diff($now);
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 5){
$delayTime = true;
}
array_shift($lastMsgGet);
}
catch(\Exception $e){
$lastMsgGet = [];
}
}
$lastMsgGet[] = $now;
$session->lastMsgGet = Json::encode($lastMsgGet);
if($delayTime){
sleep(1);
}
$session->setReadOnly();
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
'select `no`, `nation`, `name` from `general` where owner = %i',
$userID
);
if($nationID === null){
Json::die([
'result'=>false,
'reason'=>'장수가 사망했습니다.'
]);
}
$reason = Message::deleteMsg($msgID, $generalID);
if($reason === null){
$result = [
'result'=>true,
'reason'=>'success'
];
}
else{
$result = [
'result'=>false,
'reason'=>$reason
];
}
Json::die($result);
+107
View File
@@ -0,0 +1,107 @@
<?php
namespace sammo;
include('lib.php');
include('func.php');
$session = Session::requireGameLogin([]);
$userID = Session::getUserID();
$reqTo = Util::getReq('to', 'int');
$reqType = Util::getReq('type', 'string');
if($reqTo === null){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 범위 입니다.'
]);
}
if($reqType === null || !in_array($reqType, ['private', 'public', 'national'])){
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 타입입니다.'
]);
}
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
$now = new \DateTime();
$delayTime = false;
if(count($lastMsgGet) >= 10){
try{
if($lastMsgGet[0] !== 'string'){
throw new \Exception('Why not string?');
}
$first = new \DateTime($lastMsgGet[0]);
$diff = $first->diff($now);
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 1){
$delayTime = true;
}
array_shift($lastMsgGet);
}
catch(\Exception $e){
$lastMsgGet = [];
}
}
$lastMsgGet[] = $now;
$session->lastMsgGet = Json::encode($lastMsgGet);
if($delayTime){
sleep(1);
}
$session->setReadOnly();
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
'select `no`, `nation`, `name` from `general` where owner = %i',
$userID
);
if($nationID === null){
Json::die([
'result'=>false,
'reason'=>'장수가 사망했습니다.'
]);
}
$result = [
'private'=>[],
'public'=>[],
'national'=>[],
'diplomacy'=>[],
'result'=>true,
'keepRecent'=>true,
'sequence'=>0,
'nationID'=>$nationID,
'generalName'=>$generalName,
];
$result['result'] = true;
$nextSequence = $reqTo;
if($reqType == 'private'){
$result['private'] = array_map(function(Message $msg) use (&$nextSequence){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
return $msg->toArray();
}, Message::getMessagesFromMailBoxOld($generalID, Message::MSGTYPE_PRIVATE, $reqTo, 20));
}
else if($reqType == 'public'){
$result['public'] = array_map(function(Message $msg)use (&$nextSequence){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
return $msg->toArray();
}, Message::getMessagesFromMailBoxOld(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, $reqTo, 20));
}
else{
$result['national'] = array_map(function(Message $msg)use (&$nextSequence){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
return $msg->toArray();
}, Message::getMessagesFromMailBoxOld(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, $reqTo, 40));
}
Json::die($result);
+77 -18
View File
@@ -4,57 +4,116 @@ namespace sammo;
include('lib.php');
include('func.php');
$session = Session::requireGameLogin([])->setReadOnly();
$session = Session::requireGameLogin([]);
$userID = Session::getUserID();
$reqSequence = Util::getReq('sequence', 'int', 0);
$reqSequence = Util::getReq('sequence', 'int', -1);
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
$now = new \DateTime();
$delayTime = false;
if(count($lastMsgGet) >= 10){
try{
if($lastMsgGet[0] !== 'string'){
throw new \Exception('Why not string?');
}
$first = new \DateTime($lastMsgGet[0]);
$diff = $first->diff($now);
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 1){
$delayTime = true;
}
array_shift($lastMsgGet);
}
catch(\Exception $e){
$lastMsgGet = [];
}
}
$lastMsgGet[] = $now;
$session->lastMsgGet = Json::encode($lastMsgGet);
if($delayTime){
sleep(0.2);
}
$session->setReadOnly();
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
'select `no`, `nation`, `name` from `general` where owner = %i',
$userID
);
$db = DB::db();
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr`,penalty,permission FROM general WHERE `owner`=%i', $userID);
if($nationID === null){
if($me === null){
Json::die([
'result'=>false,
'reason'=>'장수가 사망했습니다.'
]);
}
$generalID = $me['no'];
$nationID = $me['nation'];
$generalName = $me['name'];
$permission = checkSecretPermission($me);
$result = [];
$result['result'] = true;
$result['keepRecent'] = false;
$nextSequence = $reqSequence;
$minSequence = $reqSequence;
$lastType = null;
$result['private'] = array_map(function(Message $msg) use (&$nextSequence){
$result['private'] = array_map(function(Message $msg) use (&$nextSequence, &$minSequence, &$lastType){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
if($msg->id <= $minSequence){
$minSequence = $msg->id;
$lastType = 'private';
}
return $msg->toArray();
}, Message::getMessagesFromMailBox($generalID, Message::MSGTYPE_PRIVATE, 10, $reqSequence));
}, Message::getMessagesFromMailBox($generalID, Message::MSGTYPE_PRIVATE, 20, $reqSequence));
$result['public'] = array_map(function(Message $msg)use (&$nextSequence){
$result['public'] = array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
if($msg->id <= $minSequence){
$minSequence = $msg->id;
$lastType = 'public';
}
return $msg->toArray();
}, Message::getMessagesFromMailBox(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, 10, $reqSequence));
}, Message::getMessagesFromMailBox(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, 20, $reqSequence));
$result['national'] = array_map(function(Message $msg)use (&$nextSequence){
$result['national'] = array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
if($msg->id <= $minSequence){
$minSequence = $msg->id;
$lastType = 'national';
}
return $msg->toArray();
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, 20, $reqSequence));
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, 40, $reqSequence));
$result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence){
$result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType, $permission){
if($msg->id > $nextSequence){
$nextSequence = $msg->id;
}
return $msg->toArray();
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 10, 0));
if($msg->id <= $minSequence){
$minSequence = $msg->id;
$lastType = 'diplomacy';
}
$values = $msg->toArray();
if($permission < 3){
$values['text'] = '(외교 문서입니다)';//TODO: 외교서신이라 읽을 수 없음을 보여줘야함
}
return $values;
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 40, $reqSequence));
if($lastType !== null){
array_pop($result[$lastType]);
$result['keepRecent'] = true;
}
else if($reqSequence <= 0){
$result['keepRecent'] = true;
}
$result['sequence'] = $nextSequence;
$result['nationID'] = $nationID;
+11 -4
View File
@@ -49,7 +49,7 @@ $now = new \DateTime();
$unlimited = new \DateTime('9999-12-31');
$db = DB::db();
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` FROM general WHERE `owner`=%i', $userID);
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr`,penalty,permission FROM general WHERE `owner`=%i', $userID);
if(!$me){
$session->logoutGame();
@@ -70,7 +70,7 @@ if($con >= 2) {
}
$me['icon'] = GetImageURL($me['imgsvr'], $me['picture']);
$permission = checkSecretPermission($me);
$srcNation = getNationStaticInfo($me['nation']);
$src = new MessageTarget($me['no'], $me['name'], $srcNation['nation'], $srcNation['name'], $srcNation['color'], $me['icon']);
@@ -99,19 +99,26 @@ if($mailbox == Message::MAILBOX_PUBLIC) {
// 국가 메세지
if($mailbox >= Message::MAILBOX_NATIONAL) {
if($me['level'] < 5){
if($permission < 4){
$destNationID = $me['nation'];
}
else{
$destNationID = $mailbox - Message::MAILBOX_NATIONAL;
}
if($destNationID == $me['nation']){
$msgType = Message::MSGTYPE_NATIONAL;
}
else{
$msgType = Message::MSGTYPE_DIPLOMACY;
}
$destNation = getNationStaticInfo($destNationID);
$dest = new MessageTarget(0, '', $destNation['nation'], $destNation['name'], $destNation['color']);
$msg = new Message(
Message::MSGTYPE_NATIONAL,
$msgType,
$src,
$dest,
$text,
+16 -1
View File
@@ -32,6 +32,20 @@ if(file_exists(__dir__.'/.htaccess')){
$options = Json::decode($reserved['options']);
$otherTextInfo = [];
if($options['join_mode'] == 'onlyRandom'){
$otherTextInfo[] = '랜덤 임관 전용';
}
if(!$otherTextInfo){
$otherTextInfo = '표준';
}
else{
$otherTextInfo = join(', ', $otherTextInfo);
}
Json::die([
'reserved'=>[
'scenarioName'=>$options['scenarioName'],
@@ -39,7 +53,8 @@ if(file_exists(__dir__.'/.htaccess')){
'fictionMode'=>($options['fiction']?'가상':'사실'),
'npcMode'=>($options['npcmode']?'가능':'불가'),
'openDatetime'=>$reserved['date'],
'gameConf'=>$options['gameConf']
'gameConf'=>$options['gameConf'],
'otherTextInfo'=>$otherTextInfo
],
'game'=>null,
'me'=>null
-2
View File
@@ -56,8 +56,6 @@ $intel = Util::getReq('intel', 'int', 50);
$join = Util::getReq('join'); //쓸모 없음
extractMissingPostToGlobals();
$rootDB = RootDB::db();
//회원 테이블에서 정보확인
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
+157
View File
@@ -0,0 +1,157 @@
function submitArticle(){
var $article = $('#newArticle');
var $title = $article.find('input.titleInput');
var $text = $article.find('input.contentInput');
var title = $.trim($title.val());
var text = $.trim($text.val());
if(!text && !title){
return false;
}
$title.val('');
$text.val('');
$.post({
url:'j_board_article_add.php',
dataType:'json',
data:{
isSecret:isSecretBoard,
title:title,
text:text
}
}).then(function(data){
if(!data){
$title.val(title);
$text.val(text);
alert()
return quickReject('글을 올리는데 실패했습니다.');
}
if(!data.result){
$title.val(title);
$text.val(text);
return quickReject('글을 올리는데 실패했습니다. : '+data.reason);
}
return loadArticles().done(drawArticles);
}, errUnknown)
.fail(function(reason){
alert(reason);
});
return false;
}
function submitComment(){
var $this = $(this);
var $article = $this.parents('.article').eq(0);
var articleNo = $article.data('no');
var $text = $article.find('input.commentText');
var text = $.trim($text.val());
if(!text){
return false;
}
$text.val('');
$.post({
url:'j_board_comment_add.php',
dataType:'json',
data:{
articleNo:articleNo,
text:text
}
}).then(function(data){
if(!data){
$text.val(text);
alert()
return quickReject('댓글을 다는데 실패했습니다.');
}
if(!data.result){
$text.val(text);
return quickReject('댓글을 다는데 실패했습니다. : '+data.reason);
}
return loadArticles().done(drawArticles);
}, errUnknown)
.fail(function(reason){
alert(reason);
});
return false;
}
function drawArticle(articleObj){
var $articleFrame = $('#articleTemplate > .articleFrame');
var $commentFrame = $('#commentTemplate > .comment');
var $article = $articleFrame.clone();
$article.addClass('articleObj')
.data('no', articleObj.no)
.data('author', articleObj.general_no);
$article.find('.author').text(articleObj.author);
$article.find('.title').text(articleObj.title);
$article.find('.date').text(articleObj.date);
//$article.find('.text').text(articleObj.text);
$article.find('.text').html(nl2br(escapeHtml(articleObj.text)));
//TODO: 바꿀 것
var $articleComment = $article.find('ul.commentList');
$.each(articleObj.comment, function(commentObj){
var $comment = $commentFrame.clone();
$comment.find('.author').text(commentObj.author);
//$comment.find('.text').text(commentObj.text);
$comment.find('.text').html(nl2br(escapeHtml(commentObj.text)));
$comment.find('.date').text(commentObj.date);
$articleComment.append($comment);
});
$('#board').append($article);
}
function drawArticles(articlesObj){
var deferred = $.Deferred();
if(!articlesObj){
return quickReject('받아오는데 실패했습니다.');
}
if(!articlesObj.result){
return quickReject('에러가 발생했습니다. : '+articlesObj.reason);
}
$('.articleObj').detach();//첫 버전이니까 일괄 삭제 일괄 로드
$.each(articlesObj.articles, drawArticle);
return true;
}
function loadArticles(){
return $.post({
url:'j_board_get_articles.php',
dataType:'json',
data:{
isSecret:isSecretBoard, //첫 버전이니까 전체 다 불러오자
}
});
}
$(function(){
$('#submitArticle').click(submitArticle);
$('.submitComment').click(submitComment);
loadArticles()
.then(drawArticles, errUnknown)
.fail(function(reason){
alert(reason);
});
});
+23
View File
@@ -216,3 +216,26 @@ jQuery(function($){
});
function errUnknown(){
alert('작업을 실패했습니다.');
}
function quickReject(errMsg){
if(errMsg === undefined){
errMsg = '작업을 실패했습니다.';
}
var deferred = $.Deferred();
deferred.reject(errMsg);
return deferred.promise();
}
function nl2br(text){
return text.replace(/\n/g,"<br>");
}
/*
function br2nl (text) {
return text.replace(/<\s*\/?br\s*[\/]?>/gi, '\n');
}
*/
+23
View File
@@ -0,0 +1,23 @@
$(function() {
$('#citySelector').select2({
theme: 'bootstrap4',
placeholder: "도시를 선택해 주세요.",
allowClear: false,
language: "ko",
containerCss: {
display: "inline-block !important",
color: 'white !important'
},
containerCssClass: 'simple-select2-align-center bg-secondary text-secondary',
dropdownCssClass: 'simple-select2-align-center bg-secondary text-secondary',
});
$('#citySelector').on('select2:select', function(e){
var data = e.params.data;
if(!data.selected || data.disabled){
return;
}
var $obj = $('#citySelector').parents('form');
$obj.submit();
console.log($obj);
});
});
+7 -4
View File
@@ -7,6 +7,7 @@ jQuery(function($){
function guiEditorInit($obj, editable){
var $submitBtn = $obj.find('.submit');
var $noticeInput = $obj.find('.input_form');
var globalVariableName = $noticeInput.data('global');
var $editForm = $obj.find('.edit_form');
var $cancelEdit = $obj.find('.cancel_edit');
@@ -16,7 +17,7 @@ jQuery(function($){
editMode = true;
$cancelEdit.show();
var inputText = $noticeInput.val();
var inputText = window[globalVariableName];
if(!inputText || inputText == '<p></p>'){
inputText = '<p><br></p>';
}
@@ -96,12 +97,12 @@ jQuery(function($){
editMode = false;
$editForm.summernote('destroy');
$cancelEdit.hide();
$editForm.html($noticeInput.val()).addClass('viewer');
$editForm.html(window[globalVariableName]).addClass('viewer');
activeFlip($editForm);
}
$cancelEdit.hide();
$editForm.html($noticeInput.val());
$editForm.html(window[globalVariableName]);
activeFlip($editForm);
if(editable){
$submitBtn.prop('disabled', false);
@@ -116,7 +117,9 @@ jQuery(function($){
enableEditor();
return false;
}
$noticeInput.val($editForm.summernote('code'));
var text = $editForm.summernote('code');
window[globalVariableName] = text;
$noticeInput.val(text);
});
$cancelEdit.click(function(e){
+152
View File
@@ -0,0 +1,152 @@
function submitLetter(){
var $letter = $('#newLetter');
var $brief = $letter.find('input.briefInput');
var $detail = $letter.find('input.detailInput');
var $prevNo = $letter.find('input.prevNo');
var $destNation = $letter.find('input.destNation');
var brief = $.trim($brief.val());
var detail = $.trim($detail.val());
var prevNo = parseInt($prevNo.val());
var destNation = parseInt($destNation.val());
if(prevNo !== null && prevNo < 1){
prevNo = null;
}
if(!brief){
return false;
}
$brief.val('');
$detail.val('');
$.post({
url:'j_diplomacy_send_letter.php',
dataType:'json',
data:{
brief:brief,
detail:detail,
destNation:destNation,
prevNo:prevNo
}
}).then(function(data){
if(!data){
$title.val(title);
$text.val(text);
alert()
return quickReject('외교 서신을 보내는데 실패했습니다.');
}
if(!data.result){
$title.val(title);
$text.val(text);
return quickReject('외교 서신을 보내는데 실패했습니다. : '+data.reason);
}
return loadLetters().done(drawLetters);
}, errUnknown)
.fail(function(reason){
alert(reason);
});
return false;
}
function repondLetter(isAgree){
var $this = $(this);
var $letter = $this.parents('.letter').eq(0);
var letterNo = $letter.data('no');
$.post({
url:'j_diplomacy_respond_letter.php',
dataType:'json',
data:{
letterNo:letterNo,
isAgree:isAgree,
reason:'', //TODO: reason 받기
}
}).then(function(data){
if(!data){
$text.val(text);
alert()
return quickReject('응답을 실패했습니다.');
}
if(!data.result){
$text.val(text);
return quickReject('응답을 실패했습니다. : '+data.reason);
}
return loadArticles().done(drawLetters);
}, errUnknown)
.fail(function(reason){
alert(reason);
});
return false;
}
function drawLetter(letterObj){
var $letterFrame = $('#letterTemplate > .letterFrame');
var $letter = $letterFrame.clone();
$letter.addClass('letterObj')
.data('no', letterObj.no)
//TODO: 국가명, 수뇌명 입력
$letter.find('.date').text(letterObj.date);
$letter.find('.letterNo').text('#'+letterObj.no);
$letter.find('.srcNation').text(letterObj.aux[''])
$letter.find('.brief').html(nl2br(escapeHtml(letterObj.brief)));
$letter.find('.detail').html(nl2br(escapeHtml(letterObj.detail)));
//TODO: 바꿀 것
$('#board').append($letter);
}
function drawLetters(lettersObj){
var deferred = $.Deferred();
if(!lettersObj){
return quickReject('받아오는데 실패했습니다.');
}
//TODO: 국가 리스트 출력
if(!lettersObj.result){
return quickReject('에러가 발생했습니다. : '+lettersObj.reason);
}
$('.letterObj').detach();//첫 버전이니까 일괄 삭제 일괄 로드
$.each(lettersObj.letters, drawLetter);
return true;
}
function loadLetters(){
return $.post({
url:'j_diplomacy_get_letters.php',
dataType:'json', //첫 버전이니까 전체 다 불러오자
data:{
}
});
}
$(function(){
$('#submitLetter').click(submitLetter);
$('.respondAgree').click(function(){
return repondLetter(true);
});
$('.respondDisagree').click(function(){
return repondLetter(false);
});
loadLetters()
.then(drawLetters, errUnknown)
.fail(function(reason){
alert(reason);
});
});
+25 -25
View File
@@ -81,13 +81,13 @@ $(function() {
var $win = $('<div id="ext_win" style="padding:0;" title="관직 임명"><table style="padding:0;margin:0;" cellspacing="0" cellpadding="0" border="0"><tr><td width="700px" style="padding:0;"><iframe id="in_frame" src="map.php?type=1&amp;graphic=1" width="700" height="520" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe></td>'+
'<td width="305px" style="padding:0;vertical-align:top;height:520px;"><div style="height:520px;width:305px;overflow-y:scroll;overflow-x:hidden;">'+
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">시중</th></tr></thead><tbody class="content">'+
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">종사</th></tr></thead><tbody class="content">'+
'</tbody></table></div></td></tr></table>'+
'<form name="form1" id="fake_form"><span id="user_name"></span> : <select name="double" id="city_select"></select>'+
'<div id="duty_radio" style="display:inline;">'+
'<input type="radio" id="duty_type1" value="4" name="duty_radio"><label for="duty_type1">태수</label>'+
'<input type="radio" id="duty_type2" value="3" name="duty_radio"><label for="duty_type2">군사</label>'+
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">시중</label>'+
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">종사</label>'+
'</div></form></div>');
$win.hide();
@@ -135,17 +135,17 @@ $(function() {
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
var p종사 = cityInfo.p종사 && currUser.p종사;
//console.log(p태수,p군사,p시중);
//console.log(p태수,p군사,p종사);
$('#duty_type1').button({disabled:!p태수});
$('#duty_type2').button({disabled:!p군사});
$('#duty_type3').button({disabled:!p시중});
$('#duty_type3').button({disabled:!p종사});
var $태수 = cityInfo.$태수;
var $군사 = cityInfo.$군사;
var $시중 = cityInfo.$시중;
var $종사 = cityInfo.$종사;
@@ -222,7 +222,7 @@ $(function() {
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
var p종사 = cityInfo.p종사 && currUser.p종사;
var newInfo = {
지역 : 지역,
@@ -232,12 +232,12 @@ $(function() {
city : cityInfo,
p태수 : p태수,
p군사 : p군사,
p시중 : p시중
p종사 : p종사
};
//console.log(newInfo);
if(p태수 || p군사 || p시중){
if(p태수 || p군사 || p종사){
if(typeof subCityGroupList[지역] == 'undefined'){
subCityGroupList[지역] = [];
}
@@ -296,11 +296,11 @@ $(function() {
}).css('cursor','pointer');
}
var $시중 = cityInfo.$시중.clone();
$city.append($시중);
if(!newInfo.p시중)$시중.css('color','red');
var $종사 = cityInfo.$종사.clone();
$city.append($종사);
if(!newInfo.p종사)$종사.css('color','red');
else{
$시중.click(function(){
$종사.click(function(){
$('#duty_radio :radio:eq(2)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
@@ -389,22 +389,22 @@ $(function() {
$.each(cityList,function(idx,cityInfo){
cityInfo.p태수=false;
cityInfo.p군사=false;
cityInfo.p시중=false;
cityInfo.p종사=false;
});
$.each(userList,function(idx,userInfo){
userInfo.p태수=false;
userInfo.p군사=false;
userInfo.p시중=false;
userInfo.p종사=false;
});
setUserAvailable($selects.eq(1).find("option"),"p태수");
setUserAvailable($selects.eq(3).find("option"),"p군사");
setUserAvailable($selects.eq(5).find("option"),"p시중");
setUserAvailable($selects.eq(5).find("option"),"p종사");
setCityAvailiable($selects.eq(0).find("option"),"p태수");
setCityAvailiable($selects.eq(2).find("option"),"p군사");
setCityAvailiable($selects.eq(4).find("option"),"p시중");
setCityAvailiable($selects.eq(4).find("option"),"p종사");
$.each(cityList,function(idx,cityInfo){
@@ -484,10 +484,10 @@ $(function() {
addBtn($name,cityInfo,userInfo,4,'태수');
addBtn($name,cityInfo,userInfo,3,'군사');
addBtn($name,cityInfo,userInfo,2,'시중');
addBtn($name,cityInfo,userInfo,2,'종사');
//특수 버튼!
if(userInfo.p태수||userInfo.p군사||userInfo.p시중){
if(userInfo.p태수||userInfo.p군사||userInfo.p종사){
var $btn = $('<button>...</button>');
$btn.addClass('for_duty');
if(userInfo.is수뇌){
@@ -594,8 +594,8 @@ $(function() {
if(cityList[cityName].$군사.text() == name){
cityList[cityName].$군사.css('color','lightgreen');
}
if(cityList[cityName].$시중.text() == name){
cityList[cityName].$시중.css('color','lightgreen');
if(cityList[cityName].$종사.text() == name){
cityList[cityName].$종사.css('color','lightgreen');
}
userList[name]={
@@ -606,7 +606,7 @@ $(function() {
val:'-1',
p태수:false,
p군사:false,
p시중:false,
p종사:false,
is수뇌:is수뇌
};
@@ -680,7 +680,7 @@ $(function() {
cityInfo.p태수 = false;
cityInfo.p군사 = false;
cityInfo.p시중 = false;
cityInfo.p종사 = false;
}
@@ -777,12 +777,12 @@ $(function() {
}
//태수,군사,시중
//태수,군사,종사
{
var $baseTr = $this.find('tr:eq(2)');
cityInfo.$태수 = $baseTr.find('td:eq(7)');
cityInfo.$군사 = $baseTr.find('td:eq(9)');
cityInfo.$시중 = $baseTr.find('td:eq(11)');
cityInfo.$종사 = $baseTr.find('td:eq(11)');
}
//기타
+4 -2
View File
@@ -114,7 +114,8 @@ function formSetup(){
extend:"required",
npcmode:"required",
show_img_level:"required",
tournament_trig:"required"
tournament_trig:"required",
join_mode:'required',
},
errorElement: "div",
errorPlacement: function ( error, element ) {
@@ -153,7 +154,8 @@ function formSetup(){
npcmode:$('#npcmode input:radio:checked').val(),
show_img_level:$('#show_img_level input:radio:checked').val(),
tournament_trig:$('#tournament_trig input:radio:checked').val(),
reserve_open:$('#reserve_open').val()
reserve_open:$('#reserve_open').val(),
join_mode:$('#join_mode input:radio:checked').val(),
}
}).then(function(result){
var deferred = $.Deferred();
+8
View File
@@ -0,0 +1,8 @@
{
"typeAcquisition": {
"include": [
"jquery"
]
}
}
-22
View File
@@ -27,7 +27,6 @@ function refreshing(obj, arg1, arg2) {
// if(term <= 0) {
switch(arg1) {
case 0: location.reload(); break;
case 1: go(arg2); break;
case 2: turn(arg2); break;
case 3: arg2.submit(); break;
case 4:
@@ -44,27 +43,6 @@ function moveProcessing(commandtype, turn){
$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
}
function go(type) {
if(type == 1) location.replace('b_nationboard.php');
else if(type == 2) location.replace('b_troop.php');
else if(type == 3) location.replace('b_nationrule.php');
else if(type == 4) location.replace('b_chiefboard.php');
else if(type == 5) location.replace('b_chiefcenter.php');
else if(type == 6) window.open('b_genList.php');
else if(type == 7) location.replace('b_myKingdomInfo.php');
else if(type == 8) location.replace('b_myCityInfo.php');
else if(type == 9) location.replace('b_myGenInfo.php');
else if(type == 10) location.replace('b_myBossInfo.php');
else if(type == 11) location.replace('b_currentCity.php');
else if(type == 12) location.replace('b_myPage.php');
else if(type == 13) location.replace('b_dipcenter.php');
else if(type == 14) location.replace('b_diplomacy.php');
else if(type == 15) window.open('b_tournament.php');
else if(type == 16) window.open('b_betting.php');
else if(type == 17) window.open('b_auction.php');
else if(type == 18) window.open('b_battleCenter.php');
}
function turn(type) {
num = form2.sel.value;
commandlist.location.replace('turn.php?type=' + type + '&sel=' + num);
+134 -26
View File
@@ -23,9 +23,13 @@ function isBrightColor(color){
var messageTemplate = '';
var myGeneralID=null;
var isChief = false;
var sequence =null;
var lastSequence = 0;
var myNation = null;
var lastMsg = null;
var minMsgSeq = {
'private':0x7fffffff,
'public':0x7fffffff,
'national':0x7fffffff,
}
var generalList = {};
@@ -43,32 +47,93 @@ function responseMessage(msgID, response){
}).then(refreshMsg);
}
function deleteMessage(msgID){
$.ajax({
url: 'j_msg_delete.php',
type: 'post',
dataType:'json',
data: {
msgID:msgID
}
}).then(refreshMsg);
}
function refreshMsg(result){
if(result && !result.result){
alert(result.reason);
}
return redrawMsg(fetchMsg());
return redrawMsg(fetchRecentMsg(), true);
}
function fetchMsg(){
function fetchRecentMsg(){
return $.ajax({
url: 'j_msg_get_recent.php',
type: 'post',
dataType:'json',
data: {
sequence:sequence
sequence:lastSequence
}
});
}
function redrawMsg(deferred){
function showOldMsg(msgType){
var oldMsg = $.ajax({
url: 'j_msg_get_old.php',
type: 'post',
dataType:'json',
data: {
to:minMsgSeq[msgType],
type:msgType,
}
});
redrawMsg(oldMsg, false);
}
function redrawMsg(deferred, addFront){
function checkErasable(obj){
var now = moment().format('YYYY-MM-DD HH:mm:ss');
$('.btn-delete-msg').each(function(){
var $btn = $(this);
var eraseUntil = $btn.data('erase_until');
if(eraseUntil < now){
$btn.detach();
}
})
return obj;
}
function checkClear(obj){
if(!obj.result){
var t = $.Deferred();
t.reject();
return t;
}
if(!obj.keepRecent){
var t = $.Deferred();
$('.msg_plate').detach();
lastSequence = null;
console.log('refresh!');
redrawMsg(fetchRecentMsg(), true);
t.reject();
return t;
}
return obj;
}
function registerSequence(obj){
if(!obj.result){
deferred.reject();
return;
var t = $.Deferred();
t.reject();
return t;
}
sequence = obj.sequence;
lastSequence = Math.max(lastSequence, obj.sequence);
$.each(['public', 'private', 'national', 'diplomacy'], function (_, msgType) {
var msgList = obj[msgType];
if(msgList === undefined || msgList.length == 0){
return true;
}
var lastMsg = msgList[msgList.length - 1];
minMsgSeq[msgType] = Math.min(minMsgSeq[msgType], lastMsg.id);
});
return obj;
}
@@ -116,14 +181,10 @@ function redrawMsg(deferred){
return true;
}
if(msgType == 'diplomacy'){
//외교는 항상 새로 그린다
$msgBoard.empty();
}
var needRefreshLastContact = (msgType == 'private');
var now = moment().format('YYYY-MM-DD HH:mm:ss');
//list의 맨 앞이 가장 최신 메시지임.
var $msgs = msgSource.map(function(msg){
@@ -151,11 +212,20 @@ function redrawMsg(deferred){
msg.defaultIcon = pathConfig.sharedIcon+'/default.jpg';
if(msgType == 'diplomacy'){
msg.allowButton = myGeneralLevel>4;
msg.allowButton = permissionLevel>=4;
}
else{
msg.allowButton = true;
}
msg.myGeneralID = myGeneralID;
msg.last5min = moment(msg.time).add(5, 'minute').format('YYYY-MM-DD HH:mm:ss');
msg.now = now;
if(msg.option && msg.option.invalid){
msg.invalidType = 'msg_invalid';
}
else{
msg.invalidType = 'msg_valid';
}
var msgHtml = TemplateEngine(messageTemplate, msg);
@@ -169,11 +239,37 @@ function redrawMsg(deferred){
$msg = $existMsg;
}
if(msg.option && msg.option.parent){
//parent는 삭제.
$('#msg_{0}'.format(msg.option.parent)).detach();
var hideMsg = false;
if(msg.option){
if(msg.option.delete !== undefined){
//delete는 삭제.
$('#msg_{0}'.format(msg.option.delete)).detach();
}
if(msg.option.overwrite !== undefined){
//overwrite는 숨기기.
$.map(msg.option.overwrite, function (overwriteID) {
var $msg = $('#msg_{0}'.format(overwriteID));
$msg.find('.btn-delete-msg').detach();
$msg.find('.msg_content').html('삭제된 메시지입니다.').removeClass('msg_valid').addClass('msg_invalid');
});
}
if(msg.option.hide){
hideMsg = true;
}
}
if(hideMsg){
return null;
}
$msg.find('.btn-delete-msg').click(function(){
if(!confirm("삭제하시겠습니까?")){
return false;
}
deleteMessage(msg.id);
});
$msg.find('button.prompt_yes').click(function(){
if(!confirm("수락하시겠습니까?")){
return false;
@@ -198,12 +294,20 @@ function redrawMsg(deferred){
});
$msgBoard.prepend($msgs);
if(addFront){
$msgBoard.prepend($msgs);
}
else{
$msgBoard.find('.load_old_message').before($msgs);
}
});
}
deferred
.then(checkErasable)
.then(checkClear)
.then(registerSequence)
.then(refineMessageObjs)
.then(printTemplate);
@@ -316,7 +420,7 @@ function refreshMailboxList(obj){
$favorite.append($lastContact);
//TODO:운영자를 추가하는 코드도 넣을 것.
if(myGeneralLevel >= 5){
if(permissionLevel >= 4){
$.each(obj.nation, function(){
var nation = this;
//console.log(nation);
@@ -353,12 +457,10 @@ function registerGlobal(basicInfo){
'color':'#000000',
'nation':'재야'
};
window.lastMsg = {
id : basicInfo.lastContact
};
window.myGeneralID = basicInfo.generalID;
window.isChief = basicInfo.isChief;
window.myGeneralLevel = basicInfo.generalLevel;
window.permissionLevel = basicInfo.permissionLevel;
}
function activateMessageForm(){
@@ -412,7 +514,7 @@ function activateMessageForm(){
jQuery(function($){
//tmp_template.html은 추후 msg.js에 통합될 수 있음
var getTemplate = $.get('js/templates/message.html?3',function(obj){
var getTemplate = $.get('js/templates/message.html?9',function(obj){
messageTemplate = obj;
});
@@ -430,7 +532,7 @@ jQuery(function($){
dataType:'json',
});
var MessageList = fetchMsg();
var MessageList = fetchRecentMsg();
senderList = $.when(senderList, basicInfo)
.then(refreshMailboxList)
@@ -438,6 +540,12 @@ jQuery(function($){
$.when(MessageList, getTemplate, basicInfo, senderList)
.then(function(){
redrawMsg(MessageList);
redrawMsg(MessageList, true);
}).then(function(){
$('.load_old_message').click(function(){
var $this = $(this);
var msgType = $this.data('msg_type');
showOldMsg(msgType);
})
});
});
+5 -3
View File
@@ -12,6 +12,9 @@
</div>
<div class="msg_body">
<div class="msg_header">
<%if(!this.option && !this.option.action && src.id == myGeneralID && now <= last5min && invalidType == 'msg_valid'){%>
<button type="button" data-erase_until="<%last5min%>" class="btn btn btn-outline-warning btn-sm btn-delete-msg" style='float:right'></button>
<%}%>
<%if(msgType == 'private') {%>
<%if(src.name == generalName){%>
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"></span
@@ -37,9 +40,8 @@
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%src.nation%></span>
<%} %>
<span class="msg_time">&lt;<%e(time)%>&gt;</span>
</div>
<div class="msg_content"><%e(text)%></div>
</div>
<div class="msg_content <%invalidType%>"><%e(text)%></div>
<%if(this.option && this.option.action) {%>
<div class="msg_prompt">
<button class="prompt_yes btn_prompt" <%allowButton?'':'disabled="disabled"'%>>>수락</button> <button class="prompt_no btn_prompt" <%allowButton?'':'disabled="disabled"'%>>거절</button>
-1877
View File
@@ -1,1877 +0,0 @@
<?php
namespace sammo;
function processWar($general, $city) {
'@phan-var array<string,int|string|null> $general';
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$templates = new \League\Plates\Engine(__dir__.'/templates');
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getAll();
$year = $admin['year'];
$month = $admin['month'];
$log = [];
$batlog = [];
$batres = [];
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
$alllog = [];
$history = [];
$deadAmount = [
'att'=>0,
'def'=>0
];
$generalCrewType = GameUnitConst::byID($general['crewtype']);
$warphase = $generalCrewType->speed; //병종간 페이즈 수 얻기
// 특기보정 : 돌격
if($general['special2'] == 60) { $warphase += 1; }
$genAtmos = 0;
if($general['item'] == 3) {
//탁주 사용
$genAtmos += 3;
$query = "update general set item=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$josaUl = JosaUtil::pick(getItemName($general['item']), '을');
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
$general['item'] = 0;
} elseif($general['item'] >= 14 && $general['item'] <= 16) {
//의적주, 두강주, 보령압주 사용
$genAtmos += 5;
} elseif($general['item'] >= 19 && $general['item'] <= 20) {
//춘화첩, 초선화 사용
$genAtmos += 7;
}
$genTrain = 0;
if($general['item'] == 4) {
//청주 사용
$genTrain += 3;
$query = "update general set item=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$josaUl = JosaUtil::pick($general['item'], '을');
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
$general['item'] = 0;
} elseif($general['item'] >= 12 && $general['item'] <= 13) {
//과실주, 이강주 사용
$genTrain += 5;
} elseif($general['item'] >= 17 && $general['item'] <= 18) {
//철벽서, 단결도 사용
$genTrain += 7;
}
// 우선 스케일링
$city['def'] *= 10;
$city['wall'] *= 10;
$query = "select level from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$originCity = MYDB_fetch_array($result);
$query = "select nation,level,name,capital,tech,type from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
setLeadershipBonus($general, $nation['level']);
$query = "select nation,level,name,rice,capital,tech,type from nation where nation='{$city['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destnation = MYDB_fetch_array($result) ?: [
'nation'=>0,
'capital'=>0,
'level'=>0,
'rice'=>2000,
'type'=>0,
'tech'=>0
];
//장수수 구함
$query = "select no from general where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
//장수수 구함
$query = "select no from general where nation='{$destnation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destgencount = MYDB_num_rows($result);
if($destgencount < GameConst::$initialNationGenLimit) $destgencount = GameConst::$initialNationGenLimit;
$genAtmosBonus = 0; $genTrainBonus = 0;
$oppAtmosBonus = 0; $oppTrainBonus = 0;
//공격자 수도보정
if($nation['capital'] == $general['city']) { $genAtmosBonus += 5; }
//방어자 수도보정
//if($destnation['capital'] == $city['city']) { $oppTrainBonus += 5; }
//관,진,수진 보정
if($city['level'] == 1) { $oppTrainBonus += 5; } // 방어도시가 수진이면 방어자 방어보정
if($originCity['level'] == 2) { $genAtmosBonus += 5; } // 출병도시가 진이면 공격자 공격보정
if($city['level'] == 3) { $oppTrainBonus += 5; } // 방어도시가 관이면 방어자 방어보정
$josaRo = JosaUtil::pick($city['name'], '로');
$josaYi = JosaUtil::pick($general['name'], '이');
$alllog[] = "<C>●</>{$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <G><b>{$city['name']}</b></>{$josaRo} 진격합니다.";
$log[] = "<C>●</>{$month}월:<G><b>{$city['name']}</b></>{$josaRo} <M>진격</>합니다. <1>$date</>";
// 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상
$query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='{$city['city']}' and nation='{$city['nation']}' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opposecount = MYDB_num_rows($result);
$exp = 0; //병사 소진 시킨 만큼
$opexp = 0;
$exp2 = 1; //능력경험치
$phase = 0;
while($phase < $warphase) {
// 장수가 없어서 도시 공격하려했으나 병량없을시
if($opposecount == 0 && $destnation['nation'] > 0 && $destnation['rice'] <= 0 && $city['supply'] == 1) {
$general['train'] += 1; //훈련 상승
if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; }
$query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[] = "<C>●</>{$month}월:병량 부족으로 <G><b>{$city['name']}</b></>의 수비병들이 <R>패퇴</>합니다.";
$josaUl = JosaUtil::pick($city['name'], '을');
$josaYi = JosaUtil::pick($general['name'], '이');
$history[] = "<C>●</>{$year}{$month}월:<M><b>【패퇴】</b></><D><b>{$destnation['name']}</b></>{$josaYi} 병량 부족으로 <G><b>{$city['name']}</b></>{$josaUl} 뺏기고 말았습니다.";
pushGenLog($general, $log);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($history);
$log = [];
$alllog = [];
$history= [];
//패퇴시 병량보충
$destnation['rice'] += 500;
$query = "update nation set rice='{$destnation['rice']}' where nation='{$destnation['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//내정 피폐
$query = "update city set agri=agri*0.5,comm=comm*0.5,secu=secu*0.5 where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = addConflict($city, $general['nation'], 1);//NOTE: 이 경우 두 국가가 분쟁 중인 경우에는 병량패퇴의 이득이 없다.
ConquerCity($admin, $general, $city, $nation, $destnation);
break;
// 장수가 없어서 도시 공격
} elseif($opposecount == 0) {
$opposeCrewType = GameUnitConst::byId(GameUnitConst::T_CASTLE);
$josaRo = JosaUtil::pick($generalCrewType->name, '로');
$josaYi = JosaUtil::pick($general['name'], '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} {$generalCrewType->name}{$josaRo} 성벽을 공격합니다.";
$log[] = "<C>●</>{$generalCrewType->name}{$josaRo} 성벽을 <M>공격</>합니다.";
$general['train'] += 1; //훈련 상승
if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; }
$query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) {
$phase++;
$myAtt = $generalCrewType->getComputedAttack($general, $nation['tech']);
$myDef = $generalCrewType->getComputedDefence($general, $nation['tech']);
$cityAtt = $opposeCrewType->getComputedAttack($city, $destnation['tech']);
$cityDef = $opposeCrewType->getComputedDefence($city, $destnation['tech']);
// 감소할 병사 수
$cityCrew = GameConst::$armperphase + $myAtt - $cityDef;
$myCrew = GameConst::$armperphase + $cityAtt - $myDef;
if($cityCrew <= 0) { $cityCrew = rand() % 90 + 10; }
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
//훈련 사기따라
$myCrew = getCrew($myCrew, $admin['city_rate']+$oppAtmosBonus, CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
$cityCrew = getCrew($cityCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), $admin['city_rate']+$oppTrainBonus);
//숙련도 따라
$genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, GameUnitConst::T_CASTLE);
$cityCrew *= getDexLog($genDexAtt, ($admin['city_rate']-60)*7200);
$myCrew *= getDexLog(($admin['city_rate']-60)*7200, $genDexDef);
$cityCrew *= $generalCrewType->getAttackCoef($opposeCrewType);
$myCrew *= $generalCrewType->getDefenceCoef($opposeCrewType);
$avoid = 1;
// 병종간 특성
if($generalCrewType->magicCoef) {
$int = Util::round(getGeneralIntel($general, true, true, true, false));
$ratio2 = $int / 100 * $generalCrewType->magicCoef;
// 특기보정 : 신산
if($general['special2'] == 41) { $ratio2 += 0.2; }
if(Util::randBool($ratio2)) {
$ratio = rand() % 100; // 0~99
// 특기보정 : 귀병, 신산, 환술, 신중
if($general['special2'] == 40) { $ratio += 20; }
if($general['special2'] == 41) { $ratio += 20; }
if($general['special2'] == 42) { $ratio += 10; }
if($general['special2'] == 44) { $ratio += 100; }
if($ratio >= 30) {
// 특기보정 : 환술, 집중
if($general['special2'] == 42) { $cityCrew *= 1.3; }
if($general['special2'] == 43) { $cityCrew *= 1.5; }
$type = rand() % 3;
switch($type) {
case 0:
$batlog[] = "<C>●</><D>급습</>을 <C>성공</>했다!";
$cityCrew *= 1.2;
break;
case 1:
$batlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$cityCrew *= 1.4;
break;
case 2:
$batlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$cityCrew *= 1.6;
break;
}
} else {
$type = rand() % 3;
switch($type) {
case 0:
$batlog[] = "<C>●</><D>급습</>을 <R>실패</>했다!";
$cityCrew /= 1.2; $myCrew *= 1.2;
break;
case 1:
$batlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$cityCrew /= 1.4; $myCrew *= 1.4;
break;
case 2:
$batlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$cityCrew /= 1.6; $myCrew *= 1.6;
break;
}
}
}
}
//군주 공격 보정 10%
if($general['level'] == 12) {
$cityCrew = $cityCrew * 1.10;
//참모, 장군 공격 보정 5%
} elseif($general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$cityCrew = $cityCrew * 1.05;
}
//레벨 보정
$cityCrew = $cityCrew * (100 + $general['explevel']/6)/100;
// 특기보정 : 공성, 기병, 돌격, 무쌍, 보병, 견고, 의술(청낭서,태평청령)
if($general['special2'] == 53) { $cityCrew *= 2.00; }
if($general['special2'] == 52) { $cityCrew *= 1.20; }
if($general['special2'] == 60) { $cityCrew *= 1.10; }
if($general['special2'] == 61) { $cityCrew *= 1.10; }
if($general['special2'] == 50) { $myCrew *= 0.90; }
if($general['special2'] == 62) { $myCrew *= 0.90; }
$ratio = rand() % 100; // 0 ~ 99
if(($general['special2'] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $avoid == 1) {
$batlog[] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모
$avoid = 0;
}
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = $generalCrewType->getCriticalRatio($general);
// 특기보정 : 무쌍, 필살
if($general['special2'] == 61) { $ratio += 10; }
if($general['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $avoid == 1) {
$batlog[] = "<C>●</><C>필살</>공격!</>";
$cityCrew = CriticalScore2($cityCrew);
$avoid = 0;
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = $generalCrewType->avoid; //회피율
$ratio2 = Util::round($ratio2 * $general['train'] / 100); //훈련 반영
//특기보정 : 궁병
if($general['special2'] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술
if($general['item'] == 26 || $general['item'] == 25) { $ratio2 += 20; }
LogText('avoid0', [date("Ymd_His"), $generalCrewType->id, $general['train'], $ratio2]);
if($ratio < $ratio2 && $avoid == 1) {
LogText('avoid0', true);
$batlog[] = "<C>●</><C>회피</>했다!</>";
$myCrew /= 5; // 20%만 소모
$avoid = 0;
}
//랜타추가
$cityCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
//특기보정 : 위압
if($general['special2'] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$myCrew = 0;
}
$general['crew'] -= Util::round($myCrew);
$city['def'] -= Util::round($cityCrew);
$city['wall'] -= Util::round($cityCrew);
$tempMyCrew = $myCrew; $tempCityCrew = $cityCrew;
$tempGeneralCrew = $general['crew']; $tempCityDef = $city['def'];
if($city['wall'] <= 0) { $city['wall'] = 0; }
if($general['crew'] <= 0 && $city['def'] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempCityDef / $tempCityCrew;
if($r1 > $r2) {
$offset = Util::round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset;
$general['crew'] -= $offset;
$cityCrew += $tempCityDef;
$city['def'] = 0;
} else {
$offset = Util::round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset;
$city['def'] -= $offset;
$myCrew += $tempGeneralCrew;
$general['crew'] = 0;
}
} elseif($general['crew'] * $city['def'] <= 0) {
if($city['def'] < 0) {
$offset = Util::round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset;
$general['crew'] -= $offset;
$cityCrew += $tempCityDef;
$city['def'] = 0;
}
if($general['crew'] < 0) {
$offset = Util::round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset;
$city['def'] -= $offset;
$myCrew += $tempGeneralCrew;
$general['crew'] = 0;
}
}
$exp += $cityCrew;
$opexp += $myCrew;
$general['crew'] = Util::round($general['crew']);
$cityCrew = Util::round($cityCrew);
$myCrew = Util::round($myCrew);
$batlog[] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$city['def']} (-$cityCrew)</> <Y1>【{$city['name']}】</>";
$mykillnum += $cityCrew; $mydeathnum += $myCrew;
// 중간 쌀 체크
$myRice = Util::round($exp / 50);
// 성격 보정
$myRice = CharExperience($myRice, $general['personal']);
// 쌀 소모
$myRice = ($myRice * 5 * getCrewtypeRice($generalCrewType, $nation['tech']));
// 결과 쌀
$myRice = $general['rice'] - $myRice;
if($myRice <= Util::round($general['crew']/100)) { break; }
if($city['def'] <= 0) { break; }
if($general['crew'] <= 0) { break; }
}
$render_attacker = [
'crewtype' => mb_substr($generalCrewType->name, 0, 2),
'name'=> $general['name'],
'remain_crew' => $general['crew'],
'killed_crew' => -$mydeathnum
];
$render_defender = [
'crewtype' => '성벽',
'name'=> $city['name'],
'remain_crew' => $city['def'],
'killed_crew' => -$mykillnum
];
$res = str_replace(["\r\n", "\r", "\n"], '', $templates->render('small_war_log',[
'year'=>$year,
'month'=>$month,
'war_type'=>'siege',
'war_type_str'=>'→',
'me' => $render_attacker,
'you' => $render_defender,
]));
$log[] = $res;//TODO: $log를 출력할 때 date에 대해선 숨겨야 함.
$batlog[] = $res;
$batres[] = $res;
$deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount['def'] = $deadAmount['def'] + $mykillnum;
// 도시쌀 소모 계산
$opexp = Util::round($opexp / 50 * 0.8);
$rice = Util::round($opexp * 5 * getCrewtypeRice($opposeCrewType, 0) * ($admin['city_rate']/100 - 0.2));
$destnation['rice'] -= $rice;
if($destnation['rice'] < 0) { $destnation['rice'] = 0; }
$query = "update nation set rice='{$destnation['rice']}' where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
pushAdminLog(["성벽 쌀 소모 : $rice"]);
//원래대로 스케일링
$city['def'] = Util::round($city['def'] / 10);
$city['wall'] = Util::round($city['wall'] / 10);
//내정 감소
$dec = Util::round($cityCrew / 10);
$city['agri'] -= $dec;
$city['comm'] -= $dec;
$city['secu'] -= $dec;
if($city['agri'] < 0) { $city['agri'] = 0; }
if($city['comm'] < 0) { $city['comm'] = 0; }
if($city['secu'] < 0) { $city['secu'] = 0; }
// 병사수 변경
$query = "update general set crew='{$general['crew']}',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가
addGenDex($general['no'], $general['atmos'], $general['train'], $general['crewtype'], $mykillnum);
addGenDex($general['no'], $general['atmos'], $general['train'], GameUnitConstBase::T_CASTLE, $mydeathnum);
// 죽은수 기술로 누적
$num = Util::round($mydeathnum * 0.01);
// 국가보정
if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 기술로 누적
$num = Util::round($mykillnum * 0.01);
// 국가보정
if($destnation['type'] == 3 || $destnation['type'] == 13){
$num *= 1.1;
}
if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) {
$num *= 0.9;
}
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//양국 평균 기술가격
//$techRatio = (getTechCost($nation['tech']) + getTechCost($destnation['tech'])) / 2;
$techRatio = 1.0;
// 죽은수 도시 재정으로 누적 60%
$num = Util::round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
// 국가보정
if($destnation['type'] == 1) { $num *= 1.1; }
if($destnation['type'] == 9 || $destnation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num',def='{$city['def']}',wall='{$city['wall']}',agri='{$city['agri']}',comm='{$city['comm']}',secu='{$city['secu']}' where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 도시 재정으로 누적 40%
$num = Util::round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
// 국가보정
if($nation['type'] == 1) { $num *= 1.1; }
if($nation['type'] == 9 || $nation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//분쟁현황에 추가
$city = addConflict($city, $general['nation'], $mykillnum);
// 병사 소진시 성 함락
if($city['def'] <= 0) {
$exp += 1000;
$exp2++;
pushGenLog($general, $log);
pushBatLog($general, $batlog);
pushBatRes($general, $batres);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($history, $year, $month);
$log = [];
$batlog = [];
$batres = [];
$alllog = [];
$history = [];
ConquerCity($admin, $general, $city, $nation, $destnation);
break;
// 공격 장수 병사 소진시 실패 처리
} elseif($general['crew'] <= 0) {
$josaYi = JosaUtil::pick($generalCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
$log[] = "<C>●</>퇴각했습니다.";
$query = "update general set deathnum=deathnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
} elseif($myRice <= Util::round($general['crew']/100)) {
$josaYi = JosaUtil::pick($generalCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
$log[] = "<C>●</>군량 부족으로 퇴각합니다.";
$query = "update general set deathnum=deathnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
}
// 장수 대결
} else {
$oppose = MYDB_fetch_array($result);
setLeadershipBonus($oppose, $destnation['level']);
$opposeCrewType = GameUnitConst::byId($oppose['crewtype']);
$josaYi = JosaUtil::pick($opposeCrewType->name, '이');
$josaWa = JosaUtil::pick($generalCrewType->name, '와');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 ".$generalCrewType->name."{$josaWa} <Y>{$oppose['name']}</>의 ".$opposeCrewType->name."{$josaYi} 대결합니다.";
$josaUl = JosaUtil::pick($opposeCrewType->name, '을');
$josaRo = JosaUtil::pick($generalCrewType->name, '로');
$log[] = "<C>●</>".$generalCrewType->name."{$josaRo} <Y>{$oppose['name']}</>의 ".$opposeCrewType->name."{$josaUl} <M>공격</>합니다.";
$josaUl = JosaUtil::pick($generalCrewType->name, '을');
$opplog[] = "<C>●</>".$opposeCrewType->name."{$josaRo} <Y>{$general['name']}</>의 ".$generalCrewType->name."{$josaUl} <M>수비</>합니다.";
$oppAtmos = 0;
if($oppose['item'] == 3) {
//탁주 사용
$oppAtmos += 3;
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$josaUl = JosaUtil::pick($oppose['item'], '을');
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
$oppose['item'] = 0;
} elseif($oppose['item'] >= 14 && $oppose['item'] <= 16) {
//의적주, 두강주, 보령압주 사용
$oppAtmos += 5;
} elseif($oppose['item'] >= 19 && $oppose['item'] <= 20) {
//춘화첩, 초선화 사용
$oppAtmos += 7;
}
$oppTrain = 0;
if($oppose['item'] == 4) {
//청주 사용
$oppTrain += 3;
$query = "update general set item=0 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$josaUl = JosaUtil::pick($oppose['item'], '을');
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
$oppose['item'] = 0;
} elseif($oppose['item'] >= 12 && $oppose['item'] <= 13) {
//과실주, 이강주 사용
$oppTrain += 5;
} elseif($oppose['item'] >= 17 && $oppose['item'] <= 18) {
//철벽서, 단결도 사용
$oppTrain += 7;
}
$general['train'] += 1; //훈련 상승
if($general['train'] > GameConst::$maxTrainByWar) { $general['train'] = GameConst::$maxTrainByWar; }
$oppose['train'] += 1; //훈련 상승
if($oppose['train'] > GameConst::$maxTrainByWar) { $oppose['train'] = GameConst::$maxTrainByWar; }
$query = "update general set recwar='{$general['turntime']}',train='{$general['train']}',warnum=warnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set recwar='{$general['turntime']}',train='{$oppose['train']}',warnum=warnum+1 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//특기보정 : 저격(수극), 활무기저격
$snipe = false;
$snipeItem = false;
if(!$snipe && $general['special2'] == 70 && Util::randBool(1/3)){
$snipe = true;
}
if(!$snipe && in_array($general['weap'], [10, 14, 18, 22]) && Util::randBool(1/5)){
$snipe = true;
}
if(!$snipe && $general['item'] == 2){
if(Util::randBool(1/5)){
$snipe = true;
$snipeItem = true;
}
//수극을 사용했지만 저격 실패한 케이스도 '필요하면' 넣을 것.(밸런스)
}
if($snipe) {
//수극 사용
if($snipeItem) {
$josaUl = JosaUtil::pick($general['item'], '을');
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
$general['item'] = 0;
$db->update('general', ['item'=>0], 'no=%i', $general['no']);
}
$log[] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[] = "<C>●</>상대에게 <R>저격</>당했다!";
$oppbatlog[] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상
$oppose['injury'] += rand() % 41 + 20; // 20 ~ 60
if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
}
else if($snipeItem) {
$db->update('general', ['item'=>0], 'no=%i', $general['no']);
$josaYi = JosaUtil::pick($general['item'], '이');
$batlog[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaYi} 빗나갑니다!";
$general['item'] = 0;
}
//특기보정 : 저격(수극), 활무기저격
$snipe = false;
$snipeItem = false;
if(!$snipe && $oppose['special2'] == 70 && Util::randBool(1/3)){
$snipe = true;
}
if(!$snipe && in_array($oppose['weap'], [10, 14, 18, 22]) && Util::randBool(1/5)){
$snipe = true;
}
if(!$snipe && $oppose['item'] == 2){
if(Util::randBool(1/5)){
$snipe = true;
$snipeItem = true;
}
//수극을 사용했지만 저격 실패한 케이스도 '필요하면' 넣을 것.(밸런스)
}
if($snipe) {
//수극 사용
if($snipeItem) {
$josaUl = JosaUtil::pick($oppose['item'], '을');
$opplog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaUl} 사용!";
$oppose['item'] = 0;
$db->update('general', ['item'=>0], 'no=%i', $oppose['no']);
}
$oppbatlog[] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[] = "<C>●</>상대에게 <R>저격</>당했다!";
$log[] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상
$general['injury'] += rand() % 41 + 20; // 20 ~ 60
if($general['injury'] > 80) { $general['injury'] = 80; }
}
else if($snipeItem) {
$db->update('general', ['item'=>0], 'no=%i', $oppose['no']);
$josaYi = JosaUtil::pick($oppose['item'], '이');
$oppbatlog[] = "<C>●</><C>".getItemName($oppose['item'])."</>{$josaYi} 빗나갑니다!";
$oppose['item'] = 0;
}
$mykillnum = 0; $mydeathnum = 0;
$opkillnum = 0; $opdeathnum = 0;
while($phase < $warphase) {
$phase++;
$myAtt = $generalCrewType->getComputedAttack($general, $nation['tech']);
$myDef = $generalCrewType->getComputedDefence($general, $nation['tech']);
$opAtt = $opposeCrewType->getComputedAttack($oppose, $destnation['tech']);
$opDef = $opposeCrewType->getComputedDefence($oppose, $destnation['tech']);
// 감소할 병사 수
$myCrew = GameConst::$armperphase + $opAtt - $myDef;
$opCrew = GameConst::$armperphase + $myAtt - $opDef;
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
if($opCrew <= 0) { $opCrew = rand() % 90 + 10; }
//훈련 사기따라
$myCrew = getCrew($myCrew, CharAtmos($oppose['atmos']+$oppAtmos+$oppAtmosBonus, $oppose['personal']), CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
$opCrew = getCrew($opCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), CharTrain($oppose['train']+$oppTrain+$oppTrainBonus, $oppose['personal']));
//숙련도 따라
$genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, $oppose['crewtype']);
$oppDexAtt = getGenDex($oppose, $oppose['crewtype']);
$oppDexDef = getGenDex($oppose, $general['crewtype']);
$opCrew *= getDexLog($genDexAtt, $oppDexDef);
$myCrew *= getDexLog($oppDexAtt, $genDexDef);
$myAvoid = 1;
$opAvoid = 1;
// 병종간 특성
if($generalCrewType->magicCoef) {
$int = Util::round(getGeneralIntel($general, true, true, true, false));
$ratio2 = $int / 100 * $generalCrewType->magicCoef;
// 특기보정 : 신산
if($general['special2'] == 41) { $ratio2 += 0.2; }
if(Util::randBool($ratio2)) {
$ratio = rand() % 100;
// 특기보정 : 귀병, 신산, 환술, 신중
if($general['special2'] == 40) { $ratio += 20; }
if($general['special2'] == 41) { $ratio += 20; }
if($general['special2'] == 42) { $ratio += 10; }
if($general['special2'] == 44) { $ratio += 100; }
if($ratio >= 30) {
// 특기보정 : 환술, 집중
if($general['special2'] == 42) { $opCrew *= 1.3; }
if($general['special2'] == 43) { $opCrew *= 1.5; }
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$myCrew *= 1.2;
} else {
$batlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>위보</>에 당했다!";
$opCrew *= 1.2;
}
break;
case 1:
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$myCrew *= 1.4;
} else {
$batlog[] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>매복</>에 당했다!";
$opCrew *= 1.4;
}
break;
case 2:
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$myCrew *= 1.6;
} else {
$batlog[] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>반목</>에 당했다!";
$opCrew *= 1.6;
// 특기보정 : 반계
if($general['special2'] == 45) { $opCrew *= 2; }
}
break;
case 3:
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>화계</>를 되돌렸다!";
$myCrew *= 1.8;
} else {
$batlog[] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>화계</>에 당했다!";
$opCrew *= 1.8;
}
break;
case 4:
$ratio = rand() % 100;
// 특기보정 : 반계
if($oppose['special2'] == 45 && $ratio > 70) {
$batlog[] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$oppbatlog[] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$myCrew *= 2.0;
} else {
$batlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$oppbatlog[] = "<C>●</><D>혼란</>에 당했다!";
$opCrew *= 2.0;
}
break;
}
} else {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$batlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>위보</>를 간파했다!";
$opCrew /= 1.1; $myCrew *= 1.1;
break;
case 1:
$batlog[] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>매복</>을 간파했다!";
$opCrew /= 1.2; $myCrew *= 1.2;
break;
case 2:
$batlog[] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>반목</>을 간파했다!";
$opCrew /= 1.3; $myCrew *= 1.3;
break;
case 3:
$batlog[] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>화계</>를 간파했다!";
$opCrew /= 1.4; $myCrew *= 1.4;
break;
case 4:
$batlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$oppbatlog[] = "<C>●</><D>혼란</>을 간파했다!";
$opCrew /= 1.5; $myCrew *= 1.5;
break;
}
}
}
}
// 상대 장수 병종간 특성
if($opposeCrewType->magicCoef) {
$int = Util::round(getGeneralIntel($oppose, true, true, true, false));
$ratio2 = $int / 100 * $opposeCrewType->magicCoef;
// 특기보정 : 신산
if($oppose['special2'] == 41) { $ratio2 += 0.2; }
if(Util::randBool($ratio2)) {
$ratio = rand() % 100;
// 특기보정 : 귀병, 신산, 환술, 신중
if($oppose['special2'] == 40) { $ratio += 20; }
if($oppose['special2'] == 41) { $ratio += 20; }
if($oppose['special2'] == 42) { $ratio += 10; }
if($oppose['special2'] == 44) { $ratio += 100; }
if($ratio >= 30) {
// 특기보정 : 환술, 집중
if($oppose['special2'] == 42) { $myCrew *= 1.3; }
if($oppose['special2'] == 43) { $myCrew *= 1.5; }
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[] = "<C>●</><D>위보</>를 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>위보</>를 되돌렸다!";
$opCrew *= 1.2;
} else {
$oppbatlog[] = "<C>●</><D>위보</>를 <C>성공</>했다!";
$batlog[] = "<C>●</><D>위보</>에 당했다!";
$myCrew *= 1.2;
}
break;
case 1:
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[] = "<C>●</><D>매복</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>매복</>을 되돌렸다!";
$opCrew *= 1.4;
} else {
$oppbatlog[] = "<C>●</><D>매복</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>매복</>에 당했다!";
$myCrew *= 1.4;
}
break;
case 2:
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[] = "<C>●</><D>반목</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>반목</>을 되돌렸다!";
$opCrew *= 1.6;
} else {
$oppbatlog[] = "<C>●</><D>반목</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>반목</>에 당했다!";
$myCrew *= 1.6;
// 특기보정 : 반계
if($oppose['special2'] == 45) { $myCrew *= 2; }
}
break;
case 3:
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[] = "<C>●</><D>화계</>를 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>화계</>을 되돌렸다!";
$opCrew *= 1.8;
} else {
$oppbatlog[] = "<C>●</><D>화계</>를 <C>성공</>했다!";
$batlog[] = "<C>●</><D>화계</>에 당했다!";
$myCrew *= 1.8;
}
break;
case 4:
$ratio = rand() % 100;
// 특기보정 : 반계
if($general['special2'] == 45 && $ratio > 70) {
$oppbatlog[] = "<C>●</><D>혼란</>을 <R>역으로</> 당했다!";
$batlog[] = "<C>●</><C>반계</>로 상대의 <D>혼란</>을 되돌렸다!";
$opCrew *= 2.0;
} else {
$oppbatlog[] = "<C>●</><D>혼란</>을 <C>성공</>했다!";
$batlog[] = "<C>●</><D>혼란</>에 당했다!";
$myCrew *= 2.0;
}
break;
}
} else {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$oppbatlog[] = "<C>●</><D>위보</>를 <R>실패</>했다!";
$batlog[] = "<C>●</><D>위보</>를 간파했다!";
$myCrew /= 1.1; $opCrew *= 1.1;
break;
case 1:
$oppbatlog[] = "<C>●</><D>매복</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>매복</>을 간파했다!";
$myCrew /= 1.2; $opCrew *= 1.2;
break;
case 2:
$oppbatlog[] = "<C>●</><D>반목</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>반목</>을 간파했다!";
$myCrew /= 1.3; $opCrew *= 1.3;
break;
case 3:
$oppbatlog[] = "<C>●</><D>화계</>를 <R>실패</>했다!";
$batlog[] = "<C>●</><D>화계</>를 간파했다!";
$myCrew /= 1.4; $opCrew *= 1.4;
break;
case 4:
$oppbatlog[] = "<C>●</><D>혼란</>을 <R>실패</>했다!";
$batlog[] = "<C>●</><D>혼란</>을 간파했다!";
$myCrew /= 1.5; $opCrew *= 1.5;
break;
}
}
}
}
// 특기보정: 돌격
//XXX: 목우!!!!
if($oppose['crewtype'] == 43 && $general['special2'] != 60) { // 목우
$r = 0;
$r += $oppose['atmos'] + $oppAtmos + $oppAtmosBonus;
$r += $oppose['train'] + $oppTrain + $oppTrainBonus;
$ratio = rand() % 400; // 최대 50% 저지
if($ratio < $r && $opAvoid == 1) {
$batlog[] = "<C>●</><R>저지</>당했다!</>";
$oppbatlog[] = "<C>●</>상대를 <C>저지</>했다!</>";
$opAvoid = 0;
continue;
}
}
$opCrew *= $generalCrewType->getAttackCoef($opposeCrewType);
$myCrew *= $generalCrewType->getDefenceCoef($opposeCrewType);
//군주 공격 보정 10%
if($general['level'] == 12) {
$opCrew = $opCrew * 1.10;
//참모, 장군 공격 보정 5%
} elseif($general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$opCrew = $opCrew * 1.05;
}
//상대장수 관직 보정
//군주 방어 보정 10%
if($oppose['level'] == 12) {
$opCrew = $opCrew * 0.90;
//참모, 모사 방어 보정 5%
} elseif($oppose['level'] == 11 || $oppose['level'] == 9 || $oppose['level'] == 7 || $oppose['level'] == 5) {
$opCrew = $opCrew * 0.95;
} elseif($oppose['level'] == 4 && $oppose['no'] == $city['gen1']) { // 태수 보정
$opCrew = $opCrew * 0.95;
} elseif($oppose['level'] == 3 && $oppose['no'] == $city['gen2']) { // 군사 보정
$opCrew = $opCrew * 0.95;
} elseif($oppose['level'] == 2 && $oppose['no'] == $city['gen3']) { // 시중 보정
$opCrew = $opCrew * 0.95;
}
//레벨 보정
$myCrew = $myCrew * (max(1, 100 - $general['explevel']/3)/100);
$opCrew = $opCrew / (max(1, 100 - $general['explevel']/3)/100);
$myCrew = $myCrew / (max(1, 100 - $oppose['explevel']/3)/100);
$opCrew = $opCrew * (max(1, 100 - $oppose['explevel']/3)/100);
// 특기보정 : 기병, 돌격, 무쌍, 보병, 견고, 척사, 의술(청낭서, 태평청령)
if($general['special2'] == 52) { $opCrew *= 1.20; }
if($general['special2'] == 60) { $opCrew *= 1.10; }
if($general['special2'] == 61) { $opCrew *= 1.10; }
if($general['special2'] == 50) { $myCrew *= 0.90; }
if($general['special2'] == 62) { $myCrew *= 0.90; }
if($general['special2'] == 75) {
if($opposeCrewType->reqCities || $opposeCrewType->reqRegions)
{
$opCrew *= 1.1; $myCrew *= 0.9;
}
}
$ratio = rand() % 100; // 0 ~ 99
if(($general['special2'] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $myAvoid == 1) {
$batlog[] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모
$myAvoid = 0;
}
// 상대 특기보정 : 기병, 무쌍, 보병, 견고, 척사, 의술(청낭서, 태평청령)
if($oppose['special2'] == 52) { $myCrew *= 1.10; }
if($oppose['special2'] == 61) { $myCrew *= 1.10; }
if($oppose['special2'] == 50) { $opCrew *= 0.80; }
if($oppose['special2'] == 62) { $myCrew *= 1.10; }
if($oppose['special2'] == 75) {
if($generalCrewType->reqCities || $generalCrewType->reqRegions)
{
$myCrew *= 1.1; $opCrew *= 0.9;
}
}
$ratio = rand() % 100; // 0 ~ 99
if(($oppose['special2'] == 73 || $oppose['item'] == 23 || $oppose['item'] == 24) && $ratio > 80 && $opAvoid == 1) {
$oppbatlog[] = "<C>●</><C>치료</>했다!</>";
$opCrew /= 1.5; // 66%만 소모
$opAvoid = 0;
}
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = $generalCrewType->getCriticalRatio($general);
// 특기보정 : 무쌍, 필살
if($general['special2'] == 61) { $ratio += 10; }
if($general['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $myAvoid == 1) {
$batlog[] = "<C>●</><C>필살</>공격!</>";
$oppbatlog[] = "<C>●</>상대의 <R>필살</>공격!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
// 특기보정 : 격노
if($oppose['special2'] == 74) {
if(rand() % 100 < 50) {
$batlog[] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$oppbatlog[] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
}
}
}
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = $opposeCrewType->getCriticalRatio($oppose);
// 특기보정 : 필살
if($oppose['special2'] == 71) { $ratio += 20; }
if($ratio >= $rd && $opAvoid == 1) {
$oppbatlog[] = "<C>●</><C>필살</>공격!</>";
$batlog[] = "<C>●</>상대의 <R>필살</>공격!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
// 특기보정 : 격노
if($general['special2'] == 74) {
if(rand() % 100 < 33) {
$oppbatlog[] = "<C>●</>필살 공격에 상대가 <R>진노</>했다!</>";
$batlog[] = "<C>●</>상대의 필살 공격에 <C>진노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
$warphase++;
} elseif(rand() % 100 < 33) {
$oppbatlog[] = "<C>●</>필살 공격에 상대가 <R>격노</>했다!</>";
$batlog[] = "<C>●</>상대의 필살 공격에 <C>격노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
}
}
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = $generalCrewType->avoid; //회피율
$ratio2 = Util::round($ratio2 * $general['train'] / 100); //훈련 반영
//특기보정 : 돌격, 궁병
if($oppose['special2'] == 60) { $ratio2 -= 100; }
if($general['special2'] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술
if($general['item'] == 26 || $general['item'] == 25) { $ratio2 += 20; }
LogText('avoid1', [date("Ymd_His"), $generalCrewType->id, $general['train'], $ratio2]);
if($ratio < $ratio2 && $myAvoid == 1) {
// 특기보정 : 격노
if($oppose['special2'] == 74 && rand() % 100 < 50) {
$batlog[] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$oppbatlog[] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
} else {
LogText('avoid1', true);
$batlog[] = "<C>●</><C>회피</>했다!</>";
$oppbatlog[] = "<C>●</>상대가 <R>회피</>했다!</>";
$myCrew /= 5; // 20%만 소모
$myAvoid = 0;
}
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = $opposeCrewType->avoid; //회피율
$ratio2 = Util::round($ratio2 * $oppose['train'] / 100); //훈련 반영
// 특기보정 : 돌격, 궁병
if($general['special2'] == 60) { $ratio2 -= 100; }
if($oppose['special2'] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술
if($oppose['item'] == 26 || $oppose['item'] == 25) { $ratio2 += 20; }
LogText('avoid2', [date("Ymd_His"), $opposeCrewType->id, $oppose['train'], $ratio2]);
if($ratio < $ratio2 && $opAvoid == 1) {
// 특기보정 : 격노
if($general['special2'] == 74 && rand() % 100 < 33) {
$oppbatlog[] = "<C>●</>회피 시도에 상대가 <R>진노</>했다!</>";
$batlog[] = "<C>●</>상대의 회피 시도에 <C>진노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
$warphase++;
} elseif($general['special2'] == 74 && rand() % 100 < 33) {
$oppbatlog[] = "<C>●</>회피 시도에 상대가 <R>격노</>했다!</>";
$batlog[] = "<C>●</>상대의 회피 시도에 <C>격노</>했다!</>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
} else {
LogText('avoid2', true);
$oppbatlog[] = "<C>●</><C>회피</>했다!</>";
$batlog[] = "<C>●</>상대가 <R>회피</>했다!</>";
$opCrew /= 5; // 20%만 소모
$opAvoid = 0;
}
}
//랜타추가
$opCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
//특기보정 : 위압
if($general['special2'] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$oppbatlog[] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$myCrew = 0;
}
//특기보정: 위압
if($oppose['special2'] == 63 && $phase == 1 && $oppose['crew'] >= 1000 && $oppose['atmos'] >= 90 && $oppose['train'] >= 90) {
$batlog[] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$oppbatlog[] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$opCrew = 0;
}
$general['crew'] -= Util::round($myCrew);
$oppose['crew'] -= Util::round($opCrew);
$tempMyCrew = $myCrew; $tempOpCrew = $opCrew;
$tempGeneralCrew = $general['crew']; $tempOpposeCrew = $oppose['crew'];
if($general['crew'] <= 0 && $oppose['crew'] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempOpposeCrew / $tempOpCrew;
if($r1 > $r2) {
$offset = Util::round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset;
$general['crew'] -= $offset;
$opCrew += $tempOpposeCrew;
$oppose['crew'] = 0;
} else {
$offset = Util::round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset;
$oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew;
$general['crew'] = 0;
}
} elseif($general['crew'] * $oppose['crew'] <= 0) {
if($oppose['crew'] < 0) {
$offset = Util::round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset;
$general['crew'] -= $offset;
$opCrew += $tempOpposeCrew;
$oppose['crew'] = 0;
}
if($general['crew'] < 0) {
$offset = Util::round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset;
$oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew;
$general['crew'] = 0;
}
}
$exp += $opCrew;
$opexp += $myCrew;
$general['crew'] = Util::round($general['crew']);
$oppose['crew'] = Util::round($oppose['crew']);
$myCrew = Util::round($myCrew);
$opCrew = Util::round($opCrew);
$batlog[] = "<C>●</> $phase : <Y1>【{$general['name']}】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$oppose['crew']} (-$opCrew)</> <Y1>【{$oppose['name']}】</>";
$oppbatlog[] = "<C>●</> $phase : <Y1>【{$oppose['name']}】</> <C>{$oppose['crew']} (-$opCrew)</> VS <C>{$general['crew']} (-$myCrew)</> <Y1>【{$general['name']}】</>";
$mykillnum += $opCrew; $mydeathnum += $myCrew;
$opkillnum += $myCrew; $opdeathnum += $opCrew;
// 중간 쌀 체크
$myRice = Util::round($exp / 50);
// 성격 보정
$myRice = CharExperience($myRice, $general['personal']);
// 쌀 소모
$myRice = ($myRice * 5 * getCrewtypeRice($generalCrewType, $nation['tech']));
// 결과 쌀
$myRice = $general['rice'] - $myRice;
// 중간 쌀 체크
$opRice = Util::round($opexp / 50 * 0.8);
// 성격 보정
$opRice = CharExperience($opRice, $oppose['personal']);
// 쌀 소모
$opRice = ($opRice * 5 * getCrewtypeRice($opposeCrewType, $destnation['tech']));
// 결과 쌀
$opRice = $oppose['rice'] - $opRice;
if($opRice <= Util::round($oppose['crew']/100)) { break; }
if($myRice <= Util::round($general['crew']/100)) { break; }
if($oppose['crew'] <= 0) { break; }
if($general['crew'] <= 0) { break; }
}
$render_attacker = [
'crewtype' => mb_substr($generalCrewType->name, 0, 2),
'name'=> $general['name'],
'remain_crew' => $general['crew'],
'killed_crew' => -$mydeathnum
];
$render_defender = [
'crewtype' => mb_substr($opposeCrewType->name, 0, 2),
'name'=> $oppose['name'],
'remain_crew' => $oppose['crew'],
'killed_crew' => -$opdeathnum
];
$res = str_replace(["\r\n", "\r", "\n"], '', $templates->render('small_war_log',[
'year'=>$year,
'month'=>$month,
'war_type'=>'attack',
'war_type_str'=>'→',
'me' => $render_attacker,
'you' => $render_defender,
]));
$oppres = str_replace(["\r\n", "\r", "\n"], '', $templates->render('small_war_log',[
'year'=>$year,
'month'=>$month,
'war_type'=>'defense',
'war_type_str'=>'←',
'me' => $render_defender,
'you' => $render_attacker,
]));
$log[] = $res;
$batlog[] = $res;
$batres[] = $res;
$opplog[] = $oppres;
$oppbatlog[] = $oppres;
$oppbatres[] = $oppres;
$deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount['def'] = $deadAmount['def'] + $opdeathnum;
// 상대장수 부상
$ratio = rand() % 100;
if($ratio >= 95) {
$opplog[] = "<C>●</>전투중 <R>부상</>당했다!";
$oppose['injury'] += rand() % 71 + 10; // 10 ~ 80
if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
}
// 병사수 변경
$query = "update general set injury='{$oppose['injury']}',crew='{$oppose['crew']}',killcrew=killcrew+'$opkillnum',deathcrew=deathcrew+'$opdeathnum' where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가
addGenDex($oppose['no'], $general['atmos'], $general['train'], $oppose['crewtype'], $opkillnum * 0.9);
addGenDex($oppose['no'], $general['atmos'], $general['train'], $general['crewtype'], $opdeathnum * 0.9);
// 죽은수 기술로 누적
$num = Util::round($mydeathnum * 0.01);
// 국가보정
if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $year, $nation['tech'])) { $num = intdiv($num, 4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 장수 부상
$ratio = rand() % 100;
if($ratio >= 95) {
$log[] = "<C>●</>전투중 <R>부상</>당했다!";
$general['injury'] += rand() % 71 + 10; // 10 ~ 80
if($general['injury'] > 80) { $general['injury'] = 80; }
}
// 병사수 변경
$query = "update general set injury='{$general['injury']}',crew='{$general['crew']}',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가
addGenDex($general['no'], $general['atmos'], $general['train'], $general['crewtype'], $mykillnum);
addGenDex($general['no'], $general['atmos'], $general['train'], $oppose['crewtype'], $mydeathnum);
// 죽은수 기술로 누적
$num = Util::round($opdeathnum * 0.01);
// 국가보정
if($destnation['type'] == 3 || $destnation['type'] == 13) { $num *= 1.1; }
if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한
if(TechLimit($admin['startyear'], $year, $destnation['tech'])) { $num = intdiv($num, 4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//양국 평균 기술가격
//$techRatio = (getTechCost($nation['tech']) + getTechCost($destnation['tech'])) / 2;
$techRatio = 1.0;
// 죽은수 도시 재정으로 누적 60%
$num = Util::round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
// 국가보정
if($destnation['type'] == 1) { $num *= 1.1; }
if($destnation['type'] == 9 || $destnation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 도시 재정으로 누적 40%
$num = Util::round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
// 국가보정
if($nation['type'] == 1) { $num *= 1.1; }
if($nation['type'] == 9 || $nation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 상대 병사 소진이나 쌀 소진시 다음 장수
if($oppose['crew'] <= 0 || ($opRice <= Util::round($oppose['crew']/100) && $general['crew'] > 0)) {
if($opRice <= Util::round($oppose['crew']/100)) {
$josaYi = JosaUtil::pick($opposeCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 {$opposeCrewType->name}{$josaYi} 패퇴했습니다.";
$log[] = "<C>●</><Y>{$oppose['name']}</>의 {$opposeCrewType->name}{$josaYi} 패퇴했습니다.";
$opplog[] = "<C>●</>군량 부족으로 패퇴합니다.";
} else {
$josaYi = JosaUtil::pick($opposeCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$oppose['name']}</>의 {$opposeCrewType->name}{$josaYi} 전멸했습니다.";
$log[] = "<C>●</><Y>{$oppose['name']}</>의 {$opposeCrewType->name}{$josaYi} 전멸했습니다.";
$opplog[] = "<C>●</>전멸했습니다.";
}
$opposecount--;
$general['atmos'] *= 1.1; //사기 증가
if($general['atmos'] > GameConst::$maxAtmosByWar) { $general['atmos'] = GameConst::$maxAtmosByWar; }
$query = "update general set atmos='{$general['atmos']}',killnum=killnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$exp2++;
// 상대장수 경험 등등 증가
$opexp = Util::round($opexp / 50 * 0.8);
// 성격 보정
$opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모
$oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($opposeCrewType, $destnation['tech']));
if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set deathnum=deathnum+1,rice='{$oppose['rice']}',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opexp = 0;
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
$oppose = null;
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
// 공격 장수 병사 소진이나 쌀 소진시 실패 처리
} elseif($general['crew'] <= 0 || $myRice <= Util::round($general['crew']/100)) {
if($myRice <= Util::round($general['crew']/100)) {
$josaYi = JosaUtil::pick($generalCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
$log[] = "<C>●</>군량 부족으로 퇴각합니다.";
$opplog[] = "<C>●</><Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
} else {
$josaYi = JosaUtil::pick($generalCrewType->name, '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
$log[] = "<C>●</>퇴각했습니다.";
$opplog[] = "<C>●</><Y>{$general['name']}</>의 {$generalCrewType->name}{$josaYi} 퇴각했습니다.";
}
// 경험치 상승
if($opposeCrewType->armType == GameUnitConst::T_WIZARD) { // 귀병
$oppose['intel2']++;
} elseif($opposeCrewType->armType == GameUnitConst::T_SIEGE) { // 차병
$oppose['leader2']++;
} else {
$oppose['power2']++;
}
$oppose['atmos'] *= 1.1; //사기 증가
if($oppose['atmos'] > GameConst::$maxAtmosByWar) { $oppose['atmos'] = GameConst::$maxAtmosByWar; }
// 상대장수 경험 등등 증가
$opexp = Util::round($opexp / 50 * 0.8);
// 성격 보정
$opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모
$oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($opposeCrewType, $destnation['tech']));
if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set rice='{$oppose['rice']}',leader2='{$oppose['leader2']}',power2='{$oppose['power2']}',intel2='{$oppose['intel2']}',atmos='{$oppose['atmos']}',experience=experience+'$opexp',dedication=dedication+'$opexp',killnum=killnum+1 where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set deathnum=deathnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opexp = 0;
$opplog = checkAbility($oppose, $opplog);
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
// $josaYi = JosaUtil::pick($general['name'], '이');
// $alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} }<G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
// $log[] = "<C>●</> <G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
break;
} else {
// 무승부일때 로그 남김
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
}
}
}
if(isset($oppose)){
//마지막 페이즈에 장수가 전멸하지 않은 경우. 쌀 소모 후속 처리
// 상대장수 경험 등등 증가(페이즈 초과시)
$opexp = Util::round($opexp / 50 * 0.8);
// 성격 보정
$opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모
$oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($opposeCrewType, $destnation['tech']));
if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set rice='{$oppose['rice']}',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='{$oppose['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
// 경험치 상승
if($generalCrewType->armType == GameUnitConst::T_WIZARD) { // 귀병
$general['intel2'] += $exp2;
} elseif($generalCrewType->armType == GameUnitConst::T_SIEGE) { // 차병
$general['leader2'] += $exp2;
} else {
$general['power2'] += $exp2;
}
$query = "update general set leader2='{$general['leader2']}',power2='{$general['power2']}',intel2='{$general['intel2']}' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 공헌, 명성 상승
$exp = Util::round($exp / 50);
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
// 쌀 소모
$general['rice'] -= ($exp * 5 * getCrewtypeRice($generalCrewType, $nation['tech']));
if($general['rice'] < 0) { $general['rice'] = 0; }
$query = "update general set rice='{$general['rice']}',dedication=dedication+'$exp',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = checkAbility($general, $log);
pushGenLog($general, $log);
pushBatLog($general, $batlog);
pushBatRes($general, $batres);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($history);
return $deadAmount;
}
function CriticalScore2($score) {
$score = Util::round($score * (rand()%8 + 13)/10); // 1.3~2.0
return $score;
}
//0 0 : 100 100 이면 최고 무한대 차이
//30 30 : 100 100 이면 최고 3.3배 차이
//60 60 : 100 100 이면 최고 1.6배 차이
function getCrew($crew, $youatmos, $mytrain) {
$ratio = $youatmos / $mytrain;
$crew = $crew * $ratio;
return $crew;
}
function getCrewtypeRice($crewtype, $tech) {
$cost = $crewtype->rice / 10;
return $cost * getTechCost($tech);
}
//////////////////////////////////////////////////////////////
// 표준 공 / 수 반환 수치는 약 0이 되게 (100~550)
//////////////////////////////////////////////////////////////
function addConflict($city, $nationID, $mykillnum) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$nationlist = [];
$killnum = [0];
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
$conflict = Json::decode($city['conflict']);
if(!$conflict || $city['def'] == 0){ // 선타, 막타 보너스
$mykillnum *= 1.05;
}
if (!$conflict) {
$conflict[$nationID] = $mykillnum;
}
else if(key_exists($nationID, $conflict)){
$conflict[$nationID] += $mykillnum;
arsort($conflict);
}
else{
$conflict[$nationID] = $mykillnum;
arsort($conflict);
$nation = getNationStaticInfo($nationID);
$josaYi = JosaUtil::pick($nation['name'], '이');
pushWorldHistory(["<C>●</>{$year}{$month}월:<M><b>【분쟁】</b></><D><b>{$nation['name']}</b></>{$josaYi} <G><b>{$city['name']}</b></> 공략에 가담하여 분쟁이 발생하고 있습니다."]);
}
$rawConflict = Json::encode($conflict);
$city['conflict'] = $rawConflict;
$db->update('city', [
'conflict'=>$rawConflict
], 'city=%i',$city['city']);
return $city;
}
function DeleteConflict($nation) {
$db = DB::db();
foreach($db->queryAllLists('SELECT city, conflict FROM city WHERE conflict!=%s', '{}') as list($cityID, $rawConflict)){
$conflict = Json::decode($rawConflict);
if(!$conflict || !is_array($conflict)){
continue;
}
if(!key_exists($nation, $conflict)){
continue;
}
unset($conflict[$nation]);
$db->update('city', [
'conflict'=>Json::encode($conflict)
], 'city=%i', $cityID);
}
}
function getConquerNation($city) : int {
$conflict = Json::decode($city['conflict']);
return Util::array_first_key($conflict);
}
function ConquerCity($admin, $general, $city, $nation, $destnation) {
'@phan-var array<string,mixed> $city';
$db = DB::db();
$connect=$db->get();
$alllog = [];
$log = [];
$history = [];
if($destnation['nation'] > 0) {
$destnationName = "<D><b>{$destnation['name']}</b></>의";
} else {
$destnationName = "공백지인";
}
$year = $admin['year'];
$month = $admin['month'];
$josaUl = JosaUtil::pick($city['name'], '을');
$josaYiNation = JosaUtil::pick($nation['name'], '이');
$josaYiGen = JosaUtil::pick($general['name'], '이');
$josaYiCity = JosaUtil::pick($city['name'], '이');
$alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYiGen} <G><b>{$city['name']}</b></> 공략에 <S>성공</>했습니다.";
$log[] = "<C>●</><G><b>{$city['name']}</b></> 공략에 <S>성공</>했습니다.";
$history[] = "<C>●</>{$year}{$month}월:<S><b>【지배】</b></><D><b>{$nation['name']}</b></>{$josaYiNation} <G><b>{$city['name']}</b></>{$josaUl} 지배했습니다.";
pushGeneralHistory($general, "<C>●</>{$year}{$month}월:<G><b>{$city['name']}</b></>{$josaUl} <S>함락</>시킴");
pushNationHistory($nation, "<C>●</>{$year}{$month}월:<Y>{$general['name']}</>{$josaYiGen} {$destnationName} <G><b>{$city['name']}</b></>{$josaUl} <S>점령</>");
pushNationHistory($destnation, "<C>●</>{$year}{$month}월:<D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>에 의해 <G><b>{$city['name']}</b></>{$josaYiCity} <span class='ev_highlight'>함락</span>");
$query = "select city from city where nation='{$city['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
// 국가 멸망시
//TODO: 국가 멸망 코드를 별도로 작성
if($citycount == 1 && $city['nation'] != 0) {
$query = "select nation,name,gold,rice from nation where nation='{$city['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losenation = MYDB_fetch_array($result);
$josaYi = JosaUtil::pick($losenation['name'], '이');
$josaUl = JosaUtil::pick($losenation['name'], '을');
$history[] = "<C>●</>{$year}{$month}월:<R><b>【멸망】</b></><D><b>{$losenation['name']}</b></>{$josaYi} 멸망하였습니다.";
pushNationHistory($nation, "<C>●</>{$year}{$month}월:<D><b>{$losenation['name']}</b></>{$josaUl} 정복");
$query = "select no, nation from general where nation='{$general['nation']}' and level='12'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ruler = MYDB_fetch_array($result);
//다굴치는 나라들 전방설정을 위해 미리 얻어옴
$query = "select you from diplomacy where me='{$losenation['nation']}' and state<2";
$dipResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipCount = MYDB_num_rows($dipResult);
$loseGeneralGold = 0;
$loseGeneralRice = 0;
//멸망국 장수들 역사 기록 및 로그 전달
$josaYi = JosaUtil::pick($losenation['name'], '이');
$genlog = ["<C>●</><D><b>{$losenation['name']}</b></>{$josaYi} <R>멸망</>했습니다."];
// 국가 백업
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $city['nation']);
$oldNationGenerals = $db->query('SELECT * FROM general WHERE nation=%i', $city['nation']);
$oldNation['generals'] = array_map(function($gen){
//다른 코드와는 다르게 공용으로 쓰므로 남겨둠
return $gen['no'];
}, $oldNationGenerals);
$oldNation['aux'] = Json::decode($oldNation['aux']);
foreach($oldNationGenerals as $gen){
$loseGold = intdiv($gen['gold'] * (rand()%30+20), 100);
$loseRice = intdiv($gen['rice'] * (rand()%30+20), 100);
$genlog[1] = "<C>●</>도주하며 금<C>$loseGold</> 쌀<C>$loseRice</>을 분실했습니다.";
$query = "update general set gold=gold-{$loseGold},rice=rice-{$loseRice} where no={$gen['no']}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
pushGenLog($gen, $genlog);
pushGeneralHistory($gen, "<C>●</>{$year}{$month}월:<D><b>{$losenation['name']}</b></>{$josaYi} <R>멸망</>");
pushOldNationStop($gen['no'], $city['nation']);
$loseGeneralGold += $loseGold;
$loseGeneralRice += $loseRice;
//모두 등용장 발부
if($nation['name'] == "강족" || $nation['name'] == "저족" || $nation['name'] == "흉노족"
|| $nation['name'] == "남만족" || $nation['name'] == "산월족" || $nation['name'] == "오환족"
|| $nation['name'] == "왜족") {
//등용장 미발부
} elseif(Util::randBool(0.5)) {
$msg = ScoutMessage::buildScoutMessage($general['no'], $gen['no']);
if($msg){
$msg->send(true);
}
}
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
if($gen['npc'] >= 2 && $gen['npc'] <= 8 && rand() % 100 < 10) {
$commissionCommand = EncodeCommand(0, 0, $nation['nation'], 25); //임관
$query = "update general set turn0='$commissionCommand' where no={$gen['no']}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
unset($genlog[1]);
// 승전국 보상
$losenation['gold'] -= GameConst::$basegold;
$losenation['rice'] -= GameConst::$baserice;
if($losenation['gold'] < 0) { $losenation['gold'] = 0; }
if($losenation['rice'] < 0) { $losenation['rice'] = 0; }
$losenation['gold'] += $loseGeneralGold;
$losenation['rice'] += $loseGeneralRice;
$losenation['gold'] = intdiv($losenation['gold'], 2);
$losenation['rice'] = intdiv($losenation['gold'], 2);
// 기본량 제외 금쌀50% + 장수들 분실 금쌀50% 흡수
$query = "update nation set gold=gold+'{$losenation['gold']}',rice=rice+'{$losenation['rice']}' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//아국 수뇌부에게 로그 전달
$query = "select no,name,nation from general where nation='{$general['nation']}' and level>='9'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$genlog[0] = "<C>●</><D><b>{$losenation['name']}</b></> 정복으로 금<C>{$losenation['gold']}</> 쌀<C>{$losenation['rice']}</>을 획득했습니다.";
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result);
pushGenLog($gen, $genlog);
}
//분쟁기록 모두 지움
DeleteConflict($city['nation']);
// 전 장수 공헌 명성치 깎음
$query = "update general set dedication=dedication*0.5,experience=experience*0.9 where nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 전 도시 공백지로
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='{}',term=0 where nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 전 장수 소속 무소속으로, 재야로, 부대 탈퇴
$query = "update general set nation='0',belong='0',level='0',troop='0' where nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대도 삭제
$query = "delete from troop where nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 삭제
$query = "delete from diplomacy where me='{$city['nation']}' or you='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$city['nation'],
'data'=>Json::encode($oldNation)
]);
// 국가 삭제
$query = "delete from nation where nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아까 얻어온 다굴국들 전방설정
for($i=0; $i < $dipCount; $i++) {
$dip = MYDB_fetch_array($dipResult);
//전방설정
SetNationFront($dip['you']);
}
// 멸망이 아니면
} else {
// 태수,군사,시중은 일반으로...
$db->update('general',[
'level'=>1
], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]);
//수도였으면 긴급 천도
if(isset($destnation['capital']) && $destnation['capital'] == $city['city']) {
$minCity = findNextCapital($city['city'], $destnation['nation']);
$minCityName = CityConst::byID($minCity)->name;
$josaYi = JosaUtil::pick($destnation['name'], '이');
$history[] = "<C>●</>{$year}{$month}월:<M><b>【긴급천도】</b></><D><b>{$destnation['name']}</b></>{$josaYi} 수도가 함락되어 <G><b>$minCityName</b></>으로 긴급천도하였습니다.";
//아국 수뇌부에게 로그 전달
$query = "select no,name,nation from general where nation='{$destnation['nation']}' and level>='5'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$genlog = ["<C>●</>수도가 함락되어 <G><b>$minCityName</b></>으로 <M>긴급천도</>합니다."];
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result);
pushGenLog($gen, $genlog);
}
//천도
$query = "update nation set capital='$minCity',gold=gold*0.5,rice=rice*0.5 where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//보급도시로 만듬
$query = "update city set supply=1 where city='$minCity'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//수뇌부 이동
$query = "update general set city='$minCity' where nation='{$destnation['nation']}' and level>='5'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//장수 사기 감소
$query = "update general set atmos=atmos*0.8 where nation='{$destnation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
refreshNationStaticInfo();
}
}
$general['atmos'] *= 1.1; //사기 증가
if($general['atmos'] > GameConst::$maxAtmosByWar) { $general['atmos'] = GameConst::$maxAtmosByWar; }
$conquerNation = getConquerNation($city);
if($conquerNation == $general['nation']) {
// 이동 및 사기 변경
$query = "update general set city='{$city['city']}',atmos='{$general['atmos']}',killnum=killnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($city['level'] > 3) {
// 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
// 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//전방설정
SetNationFront($nation['nation']);
SetNationFront($destnation['nation']);
} else {
$query = "select name,nation from nation where nation='$conquerNation'";
$conquerResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$conquerNationArray = MYDB_fetch_array($conquerResult);
$josaUl = JosaUtil::pick($city['name'], '을');
$josaYi = JosaUtil::pick($conquerNationArray['name'], '이');
$history[] = "<C>●</>{$year}{$month}월:<Y><b>【분쟁협상】</b></><D><b>{$conquerNationArray['name']}</b></>{$josaYi} 영토분쟁에서 우위를 점하여 <G><b>{$city['name']}</b></>{$josaUl} 양도받았습니다.";
pushNationHistory($nation, "<C>●</>{$year}{$month}월:<G><b>{$city['name']}</b></>{$josaUl} <D><b>{$conquerNationArray['name']}</b></>에 <Y>양도</>");
pushNationHistory($conquerNationArray, "<C>●</>{$year}{$month}월:<D><b>{$nation['name']}</b></>에서 <G><b>{$city['name']}</b></>{$josaUl} <S>양도</> 받음");
// 이동X 및 사기 변경
$query = "update general set atmos='{$general['atmos']}',killnum=killnum+1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = [
'supply'=>1,
'term'=>0,
'conflict'=>'{}',
'agri'=>$db->sqleval('agri*0.7'),
'comm'=>$db->sqleval('comm*0.7'),
'secu'=>$db->sqleval('secu*0.7'),
'nation'=>$conquerNation,
'gen1'=>0,
'gen2'=>0,
'gen3'=>0
];
if($city['level'] > 3) {
$query['def'] = 1000;
$query['wall'] = 1000;
} else {
// 도시 소속 변경, 태수,군사,시중 초기화
$query['def'] = $db->sqleval('def2/2');
$query['wall'] = $db->sqleval('wall2/2');
}
$db->update('city', $query, 'city=%i', (int)$city['city']);
//전방설정
SetNationFront($destnation['nation']);
SetNationFront($conquerNation);
}
pushGenLog($general, $log);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($history);
}
function findNextCapital(int $capitalID, int $nationID):int{
$distList = searchDistance($capitalID, 99, true);
$cities = [];
foreach(
DB::db()->query(
'SELECT city, pop FROM city WHERE nation=%i and city!=%i',
$nationID,
$capitalID
) as $row
){
$cities[$row['city']] = $row['pop'];
};
foreach($distList as $dist=>$distSubList){
$maxCityPop = 0;
$minCity = 0;
foreach($distSubList as $cityID){
if(!key_exists($cityID, $cities)){
continue;
}
$cityPop = $cities[$cityID];
if($cityPop < $maxCityPop){
continue;
}
$minCity = $cityID;
$maxCityPop = $cityPop;
}
if($minCity){
return $minCity;
}
}
throw new \RuntimeException('도시가 남지 않았는데 긴천을 시도하고 있습니다');
}
+50 -19
View File
@@ -31,7 +31,7 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
}
$gameStor = KVStorage::getStorage($db, 'game_env');
[$startYear, $year, $month, $cityRate] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'city_rate']);
[$startYear, $year, $month, $cityRate, $joinMode] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'city_rate', 'join_mode']);
$attacker = new WarUnitGeneral($rawAttacker, $rawAttackerCity, $rawAttackerNation, true, $year, $month);
@@ -111,6 +111,30 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
$attackerIncTech = $attacker->getDead() * 0.01 * getNationTechMultiplier($rawAttackerNation['type']);
$defenderIncTech = $attacker->getKilled() * 0.01 * getNationTechMultiplier($rawDefenderNation['type']);
$attackerGenCnt = $rawAttackerNation['gennum'];
$defenderGenCnt = $rawDefenderNation['gennum'];
$attackerGenCnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $rawAttackerNation['nation']);
$defenderGenCnt_eff = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc != 5', $rawDefenderNation['nation']);
if($attackerGenCnt_eff < GameConst::$initialNationGenLimit){
$attackerGenCnt = GameConst::$initialNationGenLimit;
$attackerGenCnt_eff = GameConst::$initialNationGenLimit;
}
if($defenderGenCnt_eff < GameConst::$initialNationGenLimit){
$defenderGenCnt = GameConst::$initialNationGenLimit;
$defenderGenCnt_eff = GameConst::$initialNationGenLimit;
}
if($attackerGenCnt != $attackerGenCnt_eff){
$attackerIncTech *= $attackerGenCnt / $attackerGenCnt_eff;
}
if($defenderGenCnt != $defenderGenCnt_eff){
$defenderIncTech *= $defenderGenCnt / $defenderGenCnt_eff;
}
if(TechLimit($startYear, $year, $rawAttackerNation['tech'])){
$attackerIncTech /= 4;
}
@@ -124,8 +148,8 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
$updateAttackerNation['totaltech'] = Util::round($attackerTotalTech);
$updateDefenderNation['totaltech'] = Util::round($defenderTotalTech);
$updateAttackerNation['tech'] = Util::round($attackerTotalTech / max(GameConst::$initialNationGenLimit, $rawAttackerNation['gennum']));
$updateDefenderNation['tech'] = Util::round($defenderTotalTech / max(GameConst::$initialNationGenLimit, $rawDefenderNation['gennum']));
$updateAttackerNation['tech'] = Util::round($attackerTotalTech / $attackerGenCnt);
$updateDefenderNation['tech'] = Util::round($defenderTotalTech / $defenderGenCnt);
$db->update('nation', $updateAttackerNation, 'nation=%i', $attackerNationID);
$db->update('nation', $updateDefenderNation, 'nation=%i', $defenderNationID);
@@ -154,7 +178,8 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
'startyear'=>$startYear,
'year'=>$year,
'month'=>$month,
'city_rate'=>$cityRate
'city_rate'=>$cityRate,
'join_mode'=>$joinMode,
], $attacker->getRaw(), $city->getRaw(), $rawAttackerNation, $rawDefenderNation);
}
@@ -179,15 +204,21 @@ function extractBattleOrder($general){
return 0;
}
return (
$general['leader'] +
$general['power'] +
$general['intel'] +
getWeapEff($general['weap']) +
getHorseEff($general['horse']) +
getBookEff($general['book']) +
$general['crew'] / 100
);
$staticNation = getNationStaticInfo($general['nation']);
setLeadershipBonus($general, $staticNation['level']);
$realStat =
getGeneralLeadership($general, true, true, true, true) +
getGeneralPower($general, true, true, true, true) +
getGeneralIntel($general, true, true, true, true);
$fullStat =
getGeneralLeadership($general, false, true, true, true) +
getGeneralPower($general, false, true, true, true) +
getGeneralIntel($general, false, true, true, true);
$totalStat = ($realStat + $fullStat) / 2;
$totalCrew = $general['crew'] / 10000 * $general['train'] * $general['atmos'];
return $totalStat + $totalCrew / 100;
}
function processWar_NG(
@@ -560,7 +591,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
$loseGeneralRice += $loseRice;
//모두 등용장 발부
if(Util::randBool(0.5)) {
if($admin['join_mode'] != 'onlyRandom' && Util::randBool(0.5)) {
$msg = ScoutMessage::buildScoutMessage($general['no'], $gen['no']);
if($msg){
$msg->send(true);
@@ -568,7 +599,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
}
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
if($gen['npc'] >= 2 && $gen['npc'] <= 8 && rand() % 100 < 10) {
if($admin['join_mode'] != 'onlyRandom' && $gen['npc'] >= 2 && $gen['npc'] <= 8 && rand() % 100 < 10) {
$commissionCommand = EncodeCommand(0, 0, $nation['nation'], 25); //임관
$query = "update general set turn0='$commissionCommand' where no={$gen['no']}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -632,7 +663,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
$renewFront = true;
// 멸망이 아니면
} else {
// 태수,군사,시중은 일반으로...
// 태수,군사,종사은 일반으로...
$db->update('general',[
'level'=>1
], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]);
@@ -679,11 +710,11 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
$query = "update general set city='{$city['city']}' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($city['level'] > 3) {
// 도시 소속 변경, 태수,군사,시중 초기화
// 도시 소속 변경, 태수,군사,종사 초기화
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
// 도시 소속 변경, 태수,군사,시중 초기화
// 도시 소속 변경, 태수,군사,종사 초기화
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
@@ -717,7 +748,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
$query['def'] = 1000;
$query['wall'] = 1000;
} else {
// 도시 소속 변경, 태수,군사,시중 초기화
// 도시 소속 변경, 태수,군사,종사 초기화
$query['def'] = $db->sqleval('def2/2');
$query['wall'] = $db->sqleval('wall2/2');
}
+39 -31
View File
@@ -686,6 +686,9 @@ function command_25($turn, $command) {
$connect=$db->get();
$userID = Session::getUserID();
$gameStor->cacheValues(['year','startyear','month','join_mode']);
$onlyRandom = $gameStor->join_mode == 'onlyRandom';
starter("임관");
$query = "select no,nations from general where owner='{$userID}'";
@@ -700,11 +703,31 @@ function command_25($turn, $command) {
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg,gennum FROM nation ORDER BY rand()');
echo "
foreach($nationList as &$nation){
if ($onlyRandom && TimeUtil::IsRangeMonth($gameStor->init_year, $gameStor->init_month, 1, $gameStor->year, $gameStor->month) && $nation['gennum'] >= GameConst::$initialNationGenLimitForRandInit) {
$nation['availableJoin'] = false;
}
else if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
$nation['availableJoin'] = false;
}
else if($nation['scout'] == 1) {
$nation['availableJoin'] = false;
}
else{
$nation['availableJoin'] = true;
}
}
unset($nation);
?>
국가에 임관합니다.<br>
이미 임관/등용되었던 국가는 다시 임관할 없습니다.<br>
바로 군주의 위치로 이동합니다.<br>
<?php if($onlyRandom): ?>
랜덤 임관 대상 국가는 아래에서 확인할 있습니다.<br>
<?php else: ?>
임관할 국가를 목록에서 선택하세요.<br>
<?php endif; ?>
!!! 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!<br>
??? 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.<br>
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.<br>
@@ -712,37 +735,24 @@ function command_25($turn, $command) {
<form name=form1 action=c_double.php method=post>
<select name=double size=1 style=color:white;background-color:black>
<option value=99 style=color:white;background-color:black;>!!!</option>
<option value=98 style=color:white;background-color:black;>???</option>";
<option value=98 style=color:white;background-color:black;>???</option>
$scoutStr = "";
foreach($nationList as $nation){
if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit) {
echo "
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;> {$nation['name']} </option>";
} elseif($nation['scout'] == 1) {
echo "
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;> {$nation['name']} </option>";
} elseif(in_array($nation['nation'], $joinedNations)) {
/*
echo "
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red; disabled> {$nation['name']} </option>";
*/
} else {
echo "
<option value={$nation['nation']} style=color:{$nation['color']};> {$nation['name']} </option>";
}
}
echo "
<?php foreach($nationList as $nation): ?>
<?php if(!$nation['availableJoin']): ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;background-color:red;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php else: ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<input type=submit value=임관>
<input type=hidden name=command value=$command>";
for($i=0; $i < count($turn); $i++) {
echo "
<input type=hidden name=turn[] value=$turn[$i]>";
}
echo "
</form>";
<input type=hidden name=command value=<?=$command?>>
<?php foreach(range(0, count($turn) - 1) as $i): ?>
<input type=hidden name=turn[] value=<?=$turn[$i]?>>
<?php endforeach; ?>
</form>
<?php
echo getInvitationList($nationList);
ender();
@@ -1729,7 +1739,6 @@ function command_61($turn, $command) {
타국에게 불가침을 제의합니다.<br>
제의할 국가를 목록에서 선택하세요.<br>
배경색은 현재 제의가 불가능한 국가는 <font color=red>붉은색</font>, 현재 불가침중인 국가는 <font color=blue>푸른색</font>으로 표시됩니다.<br>
비고는 불가침시 세부 조건등을 지정하는 곳입니다.(최대 45) <font color=magenta>※유저 편의를 위한 것일뿐 시스템적으로 보장하지는 않습니다.</font><br>
<form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>";
@@ -1786,7 +1795,6 @@ function command_61($turn, $command) {
<option value=20>20</option>
</select>
<br>
비고 : <input type=text name=note size=45 maxlength=45 style=text-align:left;color:white;background-color:black>
<input type=submit value=불가침>
<input type=hidden name=command value=$command>";
for($i=0; $i < count($turn); $i++) {
+9 -14
View File
@@ -64,8 +64,10 @@ class DiplomaticMessage extends Message{
return [self::INVALID, '송신자가 외교서신을 처리할 수 없습니다.'];
}
if(!$general || $general['level'] < 5){
return [self::INVALID, '해당 국가의 수뇌가 아닙니다.'];
$permission = checkSecretPermission($general);
if(!$general || $permission < 4){
return [self::INVALID, '해당 국가의 외교권자 아닙니다.'];
}
return [self::ACCEPTED, ''];
@@ -73,7 +75,6 @@ class DiplomaticMessage extends Message{
protected function noAggression(){
$year = Util::array_get($this->msgOption['year']);
$option = Util::array_get($this->msgOption['option'])??'';
if($year < 1 || $year > 30){
return [self::INVALID, '올바르지 않은 불가침 서신입니다.'];
}
@@ -81,7 +82,7 @@ class DiplomaticMessage extends Message{
$this->diplomacyDetail = "{$year}";
$helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID);
$chk = $helper->noAggression($year, $option);
$chk = $helper->noAggression($year);
if($chk[0] !== self::ACCEPTED){
return $chk;
}
@@ -272,7 +273,7 @@ class DiplomaticMessage extends Message{
$gameStor = KVStorage::getStorage($db, 'game_env');
$general = $db->queryFirstRow(
'SELECT `name`, `level` FROM general WHERE `no`=%i AND nation=%i',
'SELECT `name`, `level`, `permission`, `penalty` FROM general WHERE `no`=%i AND nation=%i',
$receiverID,
$this->dest->nationID
);
@@ -284,13 +285,6 @@ class DiplomaticMessage extends Message{
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
$db->update('diplomacy', [
'reserved'=>'',
'showing'=>null
], '(me=%s AND you=%s) OR (you=%s AND me=%s)',
$this->src->nationID, $this->dest->nationID,
$this->src->nationID, $this->dest->nationID
);
if($result !== self::ACCEPTED){
pushGenLog(['no'=>$receiverID], ["<C>●</>{$reason} {$this->diplomacyName} 실패."]);
if($result === self::DECLINED){
@@ -333,7 +327,6 @@ class DiplomaticMessage extends Message{
$this->dest->generalID = $receiverID;
$this->dest->generalName = $general['name'];
$this->msgOption['used'] = true;
$this->invalidate();
$this->validDiplomacy = false;
$josaYi = JosaUtil::pick($this->src->nationName, '이');
@@ -345,9 +338,11 @@ class DiplomaticMessage extends Message{
new \DateTime(),
new \DateTime('9999-12-31'),
[
'delete'=>$this->id
'delete'=>$this->id,
'silence'=>true,
]
);
$this->invalidate();
$newMsg->send();
return self::ACCEPTED;
+8 -15
View File
@@ -273,7 +273,7 @@ class Diplomacy{
return $prev;
}
public function noAggression(int $when, string $option){
public function noAggression(int $when){
$chk = $this->checkValidNation();
$chk = $this->checkNotWar($chk);
$chk = $this->checkAlreadyMerging($chk);
@@ -286,8 +286,7 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>7,
'term'=>$when*12,
'fixed'=>$option
'term'=>$when*12
],
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
$this->srcNation['nation'], $this->destNation['nation'],
@@ -308,8 +307,7 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>2,
'term'=>0,
'fixed'=>''
'term'=>0
],
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
$this->srcNation['nation'], $this->destNation['nation'],
@@ -330,8 +328,7 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>2,
'term'=>0,
'fixed'=>''
'term'=>0
],
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
$this->srcNation['nation'], $this->destNation['nation'],
@@ -356,16 +353,14 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>4,
'term'=>24,
'fixed'=>''
'term'=>24
],
'me=%i AND you=%i',
$this->srcNation['nation'], $this->destNation['nation']);
$db->update('diplomacy',[
'state'=>3,
'term'=>24,
'fixed'=>''
'term'=>24
],
'you=%i AND me=%i',
$this->srcNation['nation'], $this->destNation['nation']);
@@ -389,16 +384,14 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>6,
'term'=>24,
'fixed'=>''
'term'=>24
],
'me=%i AND you=%i',
$this->srcNation['nation'], $this->destNation['nation']);
$db->update('diplomacy',[
'state'=>5,
'term'=>24,
'fixed'=>''
'term'=>24
],
'you=%i AND me=%i',
$this->srcNation['nation'], $this->destNation['nation']);
+2
View File
@@ -191,6 +191,8 @@ class Personnel{
$setValues['killturn'] = $this->killturn;
}
$setValues['permission'] = 'normal';
$db->update('general', $setValues, 'no=%i', $generalID);
$db->update('general', $setSenderValues, 'no=%i', $this->senderID);
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
+3
View File
@@ -74,6 +74,9 @@ class GameConstBase
/** @var int 최대 기술 레벨 */
public static $maxTechLevel = 12;
/** @var int 초기 제한시 장수 제한 */
public static $initialNationGenLimitForRandInit = 3;
/** @var int 초기 제한시 장수 제한 */
public static $initialNationGenLimit = 10;
+3 -3
View File
@@ -68,7 +68,7 @@ class GameUnitConstBase{
],
[
3, self::T_FOOTMAN, '자객병',
100, 150, 7, 20, 0, 10, 10,
100, 150, 8, 20, 0, 10, 10,
2000, ['저'], null, 0,
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
@@ -84,7 +84,7 @@ class GameUnitConstBase{
],
[
5, self::T_FOOTMAN, '등갑병',
100, 250, 7, 5, 0, 13, 10,
100, 225, 7, 5, 0, 13, 10,
1000, null, ['남중'], 0,
[self::T_ARCHER=>1.2, self::T_CAVALRY=>0.8, self::T_SIEGE=>1.2],
[self::T_ARCHER=>0.8, self::T_CAVALRY=>1.2, self::T_SIEGE=>0.8],
@@ -181,7 +181,7 @@ class GameUnitConstBase{
],
[
26, self::T_CAVALRY, '맹수병',
250, 200, 6, 0, 0, 16, 16,
250, 175, 6, 0, 0, 16, 16,
2000, ['남만'], null, 0,
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>0.8, self::T_SIEGE=>1.2],
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>1.2, self::T_SIEGE=>0.8],
+126 -24
View File
@@ -149,7 +149,7 @@ class Message
];
$action = Util::array_get($option['action'], null);
if ($msgType === self::MSGTYPE_DIPLOMACY) {
if ($msgType === self::MSGTYPE_DIPLOMACY && $action !== null) {
$objMessage = new DiplomaticMessage(...$args);
} elseif ($action === 'scout') {
$objMessage = new ScoutMessage(...$args);
@@ -184,7 +184,7 @@ class Message
return false;
}
public static function getMessageByID(int $messageID) : Message
public static function getMessageByID(int $messageID) : ?Message
{
$db = DB::db();
$now = new \DateTime();
@@ -217,7 +217,7 @@ class Message
$where->add('type = %s', $msgType);
$where->add('valid_until > %s', $date);
if ($fromSeq > 0) {
$where->add('id > %i', $fromSeq);
$where->add('id >= %i', $fromSeq);
}
if ($limit > 0) {
@@ -231,6 +231,95 @@ class Message
}, $db->query('SELECT * FROM `message` WHERE %l ORDER BY id DESC %? ', $where, $limitSql));
}
/**
* @param int $mailbox 메일 사서함.
* @param string $msgType 메일 타입. MSGTYPE 하나.
* @param int $toSeq 가져오고자 하는 위치. $toSeq보다 '작은' seq만 가져온다.
* @param int $limit 가져오고자 하는 .
* @return Message[]
*/
public static function getMessagesFromMailBoxOld(int $mailbox, string $msgType, int $toSeq, int $limit = 20)
{
$db = DB::db();
if (!static::isValidMsgType($msgType)) {
throw new \InvalidArgumentException('올바르지 않은 $msgType');
}
$date = (new \DateTime())->format('Y-m-d H:i:s');
$where = new \WhereClause('and');
$where->add('mailbox = %i', $mailbox);
$where->add('type = %s', $msgType);
$where->add('valid_until > %s', $date);
$where->add('id < %i', $toSeq);
if ($limit > 0) {
$limitSql = $db->sqleval('LIMIT %i', $limit);
} else {
$limitSql = new \MeekroDBEval('');
}
return array_map(function ($row) {
return static::buildFromArray($row);
}, $db->query('SELECT * FROM `message` WHERE %l ORDER BY id DESC %? ', $where, $limitSql));
}
public static function deleteMsg(int $msgID, int $generalID):?string{
$msgObj = static::getMessageByID($msgID);
if($msgObj=== null){
return '메시지가 없습니다';
}
if($msgObj->src->generalID != $generalID){
return '본인의 메시지만 삭제할 수 있습니다.';
}
if($msgObj->msgType == Message::MSGTYPE_DIPLOMACY){
return '외교 메시지는 삭제할 수 없습니다.';
}
$prev5min = new \DateTime();
$prev5min->sub(new \DateInterval('PT5M'));
if($msgObj->date < $prev5min){
return '5분 이내의 메시지만 삭제할 수 있습니다.';
}
$msgOption = [
'hide'=>true,
'silence'=>true,
'overwrite'=>[$msgObj->id]
];
if($msgObj->msgType == Message::MSGTYPE_PRIVATE || $msgObj->msgType == Message::MSGTYPE_NATIONAL){
$receiveID = $msgObj->msgOption['receiverMessageID']??null;
if($receiveID !== null){
$msgObj2 = static::getMessageByID($receiveID);
if($msgObj2 !== null){
$msgObj2->invalidate(null, false);
$msgOption['overwrite'][] = [$msgObj2->id];
}
}
}
$in1min = new \DateTime();
$in1min->add(new \DateInterval('PT1M'));
$newMsg = new Message(
$msgObj->msgType,
$msgObj->src,
$msgObj->dest,
"req_del_msg",
new \DateTime(),
$in1min,
$msgOption
);
$msgObj->invalidate(null, false);
$newMsg->send(false);
return null;
}
protected function sendRaw(int $mailbox):array{
//NOTE:: 여기선 검증하지 않는다.
@@ -268,7 +357,7 @@ class Message
}
private function sendToSender():array{
if($this->sendCnt > 0){
if($this->sendCnt > 1){
throw new \RuntimeException('이미 전송한 메일입니다.');
}
if($this->msgType === self::MSGTYPE_PRIVATE && $this->src->generalID !== $this->dest->generalID){
@@ -281,15 +370,17 @@ class Message
}
private function sendToReceiver() : array{
if($this->sendCnt > 1 || $this->isInboxMail){
if($this->sendCnt > 0 || $this->isInboxMail){
throw new \RuntimeException('이미 전송한 메일입니다.');
}
if($this->msgType === self::MSGTYPE_PRIVATE){
//XXX: 알림을 이런식으로 보내는게 맞는가에 대한 의문 있음
DB::db()->update('general', [
'newmsg'=>1
], 'no=%i',$this->dest->generalID);
if(!($this->msgOption['silence']??false)){
//XXX: 알림을 이런식으로 보내는게 맞는가에 대한 의문 있음
DB::db()->update('general', [
'newmsg'=>1
], 'no=%i',$this->dest->generalID);
}
return $this->sendRaw($this->dest->generalID);
}
@@ -305,18 +396,7 @@ class Message
}
public function send(bool $sendDestOnly=false):int{
if(!$sendDestOnly){
list($senderMailbox, $sendID) = $this->sendToSender();
if($sendID){
$this->mailbox = $senderMailbox;
$this->isInboxMail = false;
$this->id = $sendID;
$this->msgOption['senderMessageID'] = $sendID;
$this->sendCnt = 1;
}
}
list($receiverMailbox, $receiveID) = $this->sendToReceiver();
[$receiverMailbox, $receiveID] = $this->sendToReceiver();
if(!$receiveID && !$sendDestOnly){
return $sendID;
}
@@ -324,17 +404,39 @@ class Message
$this->isInboxMail = true;
$this->id = $receiveID;
$this->msgOption['receiverMessageID'] = $receiveID;
$this->sendCnt = 2;
$this->sendCnt = 1;
if(!$sendDestOnly){
[$senderMailbox, $sendID] = $this->sendToSender();
if($sendID){
$this->mailbox = $senderMailbox;
$this->isInboxMail = false;
$this->id = $sendID;
$this->msgOption['senderMessageID'] = $sendID;
$this->sendCnt = 2;
}
}
return $receiveID;
}
public function invalidate(array $newMsgOption=null){
public function invalidate(?array $newMsgOption=null, bool $hideMsg=true){
if($newMsgOption !== null){
$this->msgOption = $newMsgOption;
}
$this->validUntil = new \DateTime('2000-12-31');
$this->msgOption['invalid'] = true;
if($hideMsg){
$this->validUntil = new \DateTime('2000-12-31');
}
else{
if(key_exists('receiverMessageID', $this->msgOption)){
$this->msgOption['originalText'] = $this->msg;
}
$this->msg = '삭제된 메시지입니다.';
}
$db = DB::db();
$db->update('message', [
+26 -1
View File
@@ -41,6 +41,10 @@ class ResetHelper{
];
}
if(!file_exists($servRoot.'/logs/preserved')){
mkdir($servRoot.'/logs/preserved', 0755);
}
if(!file_exists($servRoot.'/logs/.htaccess')){
@file_put_contents($servRoot.'/logs/.htaccess', 'Deny from all');
}
@@ -49,6 +53,23 @@ class ResetHelper{
@file_put_contents($servRoot.'/data/.htaccess', 'Deny from all');
}
$dir = new \DirectoryIterator($servRoot.'/logs');
foreach ($dir as $fileinfo) {
/** @var \DirectoryIterator $fileinfo */
if (!$fileinfo->isDir() || $fileinfo->isDot()) {
continue;
}
$basename = $fileinfo->getFilename();
if($basename == 'preserved'){
continue;
}
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
exec("move ".escapeshellarg($servRoot.'/logs/'.$basename)." ".escapeshellarg($servRoot.'/logs/preserved/'.$basename));
} else {
exec("mv ".escapeshellarg($servRoot.'/logs/'.$basename)." ".escapeshellarg($servRoot.'/logs/preserved/'.$basename));
}
}
$prefix = DB::prefix();
AppConf::getList()[$prefix]->closeServer();
@@ -107,7 +128,8 @@ class ResetHelper{
int $extend,
int $npcmode,
int $show_img_level,
int $tournament_trig
int $tournament_trig,
string $join_mode
):array{
//FIXME: 분리할 것
if(120 % $turnterm != 0){
@@ -193,6 +215,8 @@ class ResetHelper{
'startyear'=>$startyear,
'year'=> $year,
'month'=> $month,
'init_year'=> $year,
'init_month'=>$month,
'map_theme' => $scenarioObj->getMapTheme(),
'msg'=>'공지사항',//TODO:공지사항
'maxgeneral'=>GameConst::$defaultMaxGeneral,
@@ -207,6 +231,7 @@ class ResetHelper{
'killturn'=>$killturn,
'genius'=>GameConst::$defaultMaxGenius,
'show_img_level'=>$show_img_level,
'join_mode'=>$join_mode,
'npcmode'=>$npcmode,
'extended_general'=>$extend,
'fiction'=>$fiction,
+6 -1
View File
@@ -524,6 +524,11 @@ class WarUnitGeneral extends WarUnit{
}
yield true;
if($specialWar == 45){
$oppose->activateSkill('계략약화');
}
yield true;
if(
$specialWar == 63 &&
$this->getPhase() == 0 &&
@@ -705,7 +710,7 @@ class WarUnitGeneral extends WarUnit{
if(
$specialWar == 45 &&
$oppose->hasActivatedSkill('계략') &&
Util::randBool(0.3)
Util::randBool(0.4)
){
$this->activateSkill('반계');
$oppose->deactivateSkill('계략');
+80 -62
View File
@@ -14,24 +14,24 @@
"npcMax":95
},
"general":[
[0, "아이유", null, 0, null, 90, 56, 100, 0, 160, 250, null, null],
[0, "걸스데이민아", null, 0, null, 96, 52, 95, 0, 160, 250, null, null],
[0, "구하라", null, 0, null, 95, 91, 57, 0, 160, 250, null, null],
[0, "손나은", null, 0, null, 92, 54, 92, 0, 160, 250, null, null],
[0, "윤아", null, 0, null, 94, 94, 62, 0, 160, 250, null, null],
[0, "걸스데이소진", null, 0, null, 86, 94, 70, 0, 160, 250, null, null],
[0, "수지", null, 0, null, 100, 58, 95, 0, 160, 250, null, null],
[0, "정예인", null, 0, null, 90, 90, 65, 0, 160, 250, null, null],
[0, "혜리", null, 0, null, 90, 68, 90, 0, 160, 250, null, null],
[0, "은하", null, 0, null, 88, 69, 87, 0, 160, 250, null, null],
[0, "슈", null, 0, null, 92, 54, 80, 0, 160, 250, null, null],
[0, "소원", null, 0, null, 90, 85, 60, 0, 160, 250, null, null],
[0, "보아", null, 0, null, 95, 99, 96, 0, 160, 250, null, null],
[0, "김세정", null, 0, null, 100, 92, 100, 0, 160, 250, null, null],
[0, "나라", null, 0, null, 94, 97, 65, 0, 160, 250, null, null],
[0, "서지수", null, 0, null, 90, 89, 63, 0, 160, 250, null, null],
[0, "양파", null, 0, null, 85, 54, 92, 0, 160, 250, null, null],
[0, "앨리스", null, 0, null, 90, 90, 67, 0, 160, 250, null, null],
[0, "아이유", null, 0, null, 90, 56, 100, 0, 160, 250, "의협", "집중"],
[0, "걸스데이 민아", null, 0, null, 96, 52, 95, 0, 160, 250, "대의", "환술"],
[0, "구하라", null, 0, null, 95, 91, 57, 0, 160, 250, "출세", "무쌍"],
[0, "손나은", null, 0, null, 92, 54, 92, 0, 160, 250, "안전", "귀병"],
[0, "윤아", null, 0, null, 94, 94, 62, 0, 160, 250, "출세", "위압"],
[0, "걸스데이 소진", null, 0, null, 86, 94, 70, 0, 160, 250, "할거", "무쌍"],
[0, "수지", null, 0, null, 100, 58, 95, 0, 160, 250, "정복", "신중"],
[0, "정예인", null, 0, null, 90, 90, 65, 0, 160, 250, "패권", "위압"],
[0, "혜리", null, 0, null, 90, 68, 90, 0, 160, 250, "유지", "환술"],
[0, "은하", null, 0, null, 88, 69, 87, 0, 160, 250, "안전", "환술"],
[0, "슈", null, 0, null, 92, 54, 80, 0, 160, 250, "패권", "신중"],
[0, "소원", null, 0, null, 90, 85, 60, 0, 160, 250, "왕좌", "필살"],
[0, "보아", null, 0, null, 95, 99, 96, 0, 160, 250, "왕좌", "위압"],
[0, "김세정", null, 0, null, 100, 92, 100, 0, 160, 250, "의협", "집중"],
[0, "나라", null, 0, null, 94, 97, 65, 0, 160, 250, "대의", "무쌍"],
[0, "서지수", null, 0, null, 90, 89, 63, 0, 160, 250, "할거", "필살"],
[0, "양파", null, 0, null, 85, 54, 92, 0, 160, 250, "대의", "환술"],
[0, "앨리스", null, 0, null, 90, 90, 67, 0, 160, 250, "유지", "위압"],
[0, "효린", null, 0, null, 40, 72, 97, 0, 160, 250, null, null],
[0, "보라", null, 0, null, 82, 81, 68, 0, 160, 250, null, null],
[0, "소유", null, 0, null, 70, 68, 81, 0, 160, 250, null, null],
@@ -41,11 +41,11 @@
[0, "은정", null, 0, null, 70, 60, 72, 0, 160, 250, null, null],
[0, "큐리", null, 0, null, 70, 61, 58, 0, 160, 250, null, null],
[0, "보람", null, 0, null, 72, 60, 60, 0, 160, 250, null, null],
[0, "티아라소연", null, 0, null, 71, 58, 77, 0, 160, 250, null, null],
[0, "티아라 소연", null, 0, null, 71, 58, 77, 0, 160, 250, null, null],
[0, "라임", null, 0, null, 78, 70, 74, 0, 160, 250, null, null],
[0, "유영", null, 0, null, 70, 53, 64, 0, 160, 250, null, null],
[0, "서영", null, 0, null, 65, 67, 62, 0, 160, 250, null, null],
[0, "헬여름", null, 0, null, 63, 62, 63, 0, 160, 250, null, null],
[0, "헬로비너스 여름", null, 0, null, 63, 62, 63, 0, 160, 250, null, null],
[0, "남지현", null, 0, null, 80, 62, 74, 0, 160, 250, null, null],
[0, "허가윤", null, 0, null, 70, 64, 82, 0, 160, 250, null, null],
[0, "전지윤", null, 0, null, 69, 61, 69, 0, 160, 250, null, null],
@@ -59,12 +59,12 @@
[0, "한나", null, 0, null, 40, 43, 41, 0, 160, 250, null, null],
[0, "김한별", null, 0, null, 60, 41, 57, 0, 160, 250, null, null],
[0, "김한샘", null, 0, null, 31, 41, 40, 0, 160, 250, null, null],
[0, "블랙핑크지수", null, 0, null, 83, 73, 80, 0, 160, 250, null, null],
[0, "블랙핑크제니", null, 0, null, 84, 70, 82, 0, 160, 250, null, null],
[0, "블랙핑크 지수", null, 0, null, 83, 73, 80, 0, 160, 250, null, null],
[0, "블랙핑크 제니", null, 0, null, 84, 70, 82, 0, 160, 250, null, null],
[0, "로제", null, 0, null, 80, 70, 87, 0, 160, 250, null, null],
[0, "리사", null, 0, null, 80, 74, 84, 0, 160, 250, null, null],
[0, "수민", null, 0, null, 66, 62, 72, 0, 160, 250, null, null],
[0, "소나무민재", null, 0, null, 60, 61, 80, 0, 160, 250, null, null],
[0, "소나무 민재", null, 0, null, 60, 61, 80, 0, 160, 250, null, null],
[0, "디애나", null, 0, null, 68, 73, 64, 0, 160, 250, null, null],
[0, "나현", null, 0, null, 71, 79, 57, 0, 160, 250, null, null],
[0, "의진", null, 0, null, 76, 80, 61, 0, 160, 250, null, null],
@@ -72,20 +72,20 @@
[0, "뉴썬", null, 0, null, 60, 61, 59, 0, 160, 250, null, null],
[0, "유라", null, 0, null, 80, 70, 61, 0, 160, 250, null, null],
[0, "지민", null, 0, null, 69, 66, 72, 0, 160, 250, null, null],
[0, "AOA유나", null, 0, null, 74, 54, 68, 0, 160, 250, null, null],
[0, "AOA 유나", null, 0, null, 74, 54, 68, 0, 160, 250, null, null],
[0, "혜정", null, 0, null, 74, 57, 65, 0, 160, 250, null, null],
[0, "AOA민아", null, 0, null, 75, 62, 58, 0, 160, 250, null, null],
[0, "AOA 민아", null, 0, null, 75, 62, 58, 0, 160, 250, null, null],
[0, "설현", null, 0, null, 90, 78, 59, 0, 160, 250, null, null],
[0, "찬미", null, 0, null, 68, 62, 60, 0, 160, 250, null, null],
[0, "AOA초아", null, 0, null, 80, 58, 74, 0, 160, 250, null, null],
[0, "AOA 초아", null, 0, null, 80, 58, 74, 0, 160, 250, null, null],
[0, "솔빈", null, 0, null, 80, 66, 62, 0, 160, 250, null, null],
[0, "해인", null, 0, null, 67, 63, 60, 0, 160, 250, null, null],
[0, "라붐유정", null, 0, null, 66, 61, 71, 0, 160, 250, null, null],
[0, "라붐소연", null, 0, null, 80, 58, 70, 0, 160, 250, null, null],
[0, "라붐 유정", null, 0, null, 66, 61, 71, 0, 160, 250, null, null],
[0, "라붐 소연", null, 0, null, 80, 58, 70, 0, 160, 250, null, null],
[0, "지엔", null, 0, null, 61, 60, 62, 0, 160, 250, null, null],
[0, "율희", null, 0, null, 60, 54, 60, 0, 160, 250, null, null],
[0, "효정", null, 0, null, 78, 54, 59, 0, 160, 250, null, null],
[0, "오마이걸미미", null, 0, null, 51, 57, 55, 0, 160, 250, null, null],
[0, "오마이걸 미미", null, 0, null, 51, 57, 55, 0, 160, 250, null, null],
[0, "유아", null, 0, null, 73, 81, 70, 0, 160, 250, null, null],
[0, "승희", null, 0, null, 69, 76, 78, 0, 160, 250, null, null],
[0, "지호", null, 0, null, 69, 67, 62, 0, 160, 250, null, null],
@@ -104,8 +104,8 @@
[0, "정윤혜", null, 0, null, 75, 59, 60, 0, 160, 250, null, null],
[0, "조현영", null, 0, null, 79, 60, 63, 0, 160, 250, null, null],
[0, "경리", null, 0, null, 80, 82, 64, 0, 160, 250, null, null],
[0, "나혜미", null, 0, null, 72, 67, 60, 0, 160, 250, null, null],
[0, "나소진", null, 0, null, 73, 63, 59, 0, 160, 250, null, null],
[0, "나인뮤지스 혜미", null, 0, null, 72, 67, 60, 0, 160, 250, null, null],
[0, "나인뮤지스 소진", null, 0, null, 73, 63, 59, 0, 160, 250, null, null],
[0, "금조", null, 0, null, 70, 60, 54, 0, 160, 250, null, null],
[0, "손성아", null, 0, null, 69, 63, 60, 0, 160, 250, null, null],
[0, "박민하", null, 0, null, 90, 73, 57, 0, 160, 250, null, null],
@@ -123,7 +123,7 @@
[0, "모모", null, 0, null, 80, 88, 63, 0, 160, 250, null, null],
[0, "사나", null, 0, null, 83, 83, 64, 0, 160, 250, null, null],
[0, "지효", null, 0, null, 73, 63, 86, 0, 160, 250, null, null],
[0, "트와이스미나", null, 0, null, 79, 87, 66, 0, 160, 250, null, null],
[0, "트와이스 미나", null, 0, null, 79, 87, 66, 0, 160, 250, null, null],
[0, "다현", null, 0, null, 78, 66, 68, 0, 160, 250, null, null],
[0, "채영", null, 0, null, 70, 68, 67, 0, 160, 250, null, null],
[0, "쯔위", null, 0, null, 100, 72, 61, 0, 160, 250, null, null],
@@ -132,13 +132,13 @@
[0, "미료", null, 0, null, 60, 57, 82, 0, 160, 250, null, null],
[0, "가인", null, 0, null, 67, 77, 80, 0, 160, 250, null, null],
[0, "하나", null, 0, null, 66, 62, 64, 0, 160, 250, null, null],
[0, "구구단미미", null, 0, null, 69, 60, 63, 0, 160, 250, null, null],
[0, "구구단나영", null, 0, null, 80, 62, 83, 0, 160, 250, null, null],
[0, "구구단 미미", null, 0, null, 69, 60, 63, 0, 160, 250, null, null],
[0, "구구단 나영", null, 0, null, 80, 62, 83, 0, 160, 250, null, null],
[0, "해빈", null, 0, null, 70, 60, 86, 0, 160, 250, null, null],
[0, "소이", null, 0, null, 66, 61, 64, 0, 160, 250, null, null],
[0, "샐리", null, 0, null, 68, 66, 67, 0, 160, 250, null, null],
[0, "구구단미나", null, 0, null, 80, 70, 63, 0, 160, 250, null, null],
[0, "구구단혜연", null, 0, null, 63, 64, 66, 0, 160, 250, null, null],
[0, "구구단 미나", null, 0, null, 80, 70, 63, 0, 160, 250, null, null],
[0, "구구단 혜연", null, 0, null, 63, 64, 66, 0, 160, 250, null, null],
[0, "최유정", null, 0, null, 70, 80, 67, 0, 160, 250, null, null],
[0, "김도연", null, 0, null, 81, 81, 68, 0, 160, 250, null, null],
[0, "지수연", null, 0, null, 64, 62, 74, 0, 160, 250, null, null],
@@ -160,14 +160,14 @@
[0, "은서", null, 0, null, 68, 63, 60, 0, 160, 250, null, null],
[0, "다영", null, 0, null, 71, 60, 62, 0, 160, 250, null, null],
[0, "다원", null, 0, null, 65, 60, 60, 0, 160, 250, null, null],
[0, "우주소녀수빈", null, 0, null, 66, 61, 61, 0, 160, 250, null, null],
[0, "우주소녀 수빈", null, 0, null, 66, 61, 61, 0, 160, 250, null, null],
[0, "선의", null, 0, null, 70, 62, 59, 0, 160, 250, null, null],
[0, "우주소녀여름", null, 0, null, 58, 60, 60, 0, 160, 250, null, null],
[0, "우주소녀 여름", null, 0, null, 58, 60, 60, 0, 160, 250, null, null],
[0, "미기", null, 0, null, 63, 63, 61, 0, 160, 250, null, null],
[0, "루다", null, 0, null, 81, 67, 66, 0, 160, 250, null, null],
[0, "연정", null, 0, null, 68, 58, 83, 0, 160, 250, null, null],
[0, "윤채경", null, 0, null, 80, 64, 70, 0, 160, 250, null, null],
[0, "김채원", null, 0, null, 67, 60, 63, 0, 160, 250, null, null],
[0, "에이프릴 김채원", null, 0, null, 67, 60, 63, 0, 160, 250, null, null],
[0, "양예나", null, 0, null, 70, 61, 68, 0, 160, 250, null, null],
[0, "레이첼", null, 0, null, 68, 62, 62, 0, 160, 250, null, null],
[0, "이진솔", null, 0, null, 69, 56, 70, 0, 160, 250, null, null],
@@ -183,7 +183,7 @@
[0, "가은", null, 0, null, 60, 59, 63, 0, 160, 250, null, null],
[0, "가희", null, 0, null, 67, 90, 62, 0, 160, 250, null, null],
[0, "전효성", null, 0, null, 88, 87, 84, 0, 160, 250, null, null],
[0, "송은", null, 0, null, 80, 68, 77, 0, 160, 250, null, null],
[0, "송은", null, 0, null, 80, 68, 77, 0, 160, 250, null, null],
[0, "정하나", null, 0, null, 68, 63, 70, 0, 160, 250, null, null],
[0, "한선화", null, 0, null, 79, 59, 71, 0, 160, 250, null, null],
[0, "베이비소울", null, 0, null, 71, 60, 70, 0, 160, 250, null, null],
@@ -207,7 +207,7 @@
[0, "혜린", null, 0, null, 86, 60, 86, 0, 160, 250, null, null],
[0, "유니스", null, 0, null, 75, 58, 73, 0, 160, 250, null, null],
[0, "기희현", null, 0, null, 86, 66, 70, 0, 160, 250, null, null],
[0, "다이아제니", null, 0, null, 71, 66, 68, 0, 160, 250, null, null],
[0, "다이아 제니", null, 0, null, 71, 66, 68, 0, 160, 250, null, null],
[0, "정채연", null, 0, null, 79, 63, 66, 0, 160, 250, null, null],
[0, "은진", null, 0, null, 66, 67, 63, 0, 160, 250, null, null],
[0, "예빈", null, 0, null, 68, 65, 67, 0, 160, 250, null, null],
@@ -221,21 +221,21 @@
[0, "세리", null, 0, null, 74, 73, 80, 0, 160, 250, null, null],
[0, "아영", null, 0, null, 78, 76, 64, 0, 160, 250, null, null],
[0, "우희", null, 0, null, 77, 77, 63, 0, 160, 250, null, null],
[0, "달샤벳수빈", null, 0, null, 79, 74, 67, 0, 160, 250, null, null],
[0, "달샤벳 수빈", null, 0, null, 79, 74, 67, 0, 160, 250, null, null],
[0, "효은", null, 0, null, 72, 71, 69, 0, 160, 250, null, null],
[0, "민희", null, 0, null, 69, 73, 66, 0, 160, 250, null, null],
[0, "소영", null, 0, null, 64, 70, 65, 0, 160, 250, null, null],
[0, "혜빈", null, 0, null, 62, 59, 66, 0, 160, 250, null, null],
[0, "연우", null, 0, null, 76, 61, 63, 0, 160, 250, null, null],
[0, "연우", null, 0, null, 82, 79, 63, 0, 160, 250, null, null],
[0, "제인", null, 0, null, 72, 67, 61, 0, 160, 250, null, null],
[0, "모모랜드태하", null, 0, null, 60, 60, 60, 0, 160, 250, null, null],
[0, "모모랜드 태하", null, 0, null, 60, 64, 66, 0, 160, 250, null, null],
[0, "나윤", null, 0, null, 62, 61, 63, 0, 160, 250, null, null],
[0, "데이지", null, 0, null, 68, 63, 59, 0, 160, 250, null, null],
[0, "데이지", null, 0, null, 68, 63, 68, 0, 160, 250, null, null],
[0, "아인", null, 0, null, 72, 57, 69, 0, 160, 250, null, null],
[0, "주이", null, 0, null, 40, 74, 56, 0, 160, 250, null, null],
[0, "낸시", null, 0, null, 80, 69, 67, 0, 160, 250, null, null],
[0, "낸시", null, 0, null, 86, 74, 67, 0, 160, 250, null, null],
[0, "선예", null, 0, null, 80, 61, 78, 0, 160, 250, null, null],
[0, "선미", null, 0, null, 80, 82, 70, 0, 160, 250, null, null],
[0, "선미", null, 0, null, 80, 86, 70, 0, 160, 250, null, null],
[0, "유빈", null, 0, null, 76, 69, 77, 0, 160, 250, null, null],
[0, "혜림", null, 0, null, 69, 63, 67, 0, 160, 250, null, null],
[0, "예은", null, 0, null, 70, 61, 80, 0, 160, 250, null, null],
@@ -247,14 +247,14 @@
[0, "재이", null, 0, null, 80, 70, 70, 0, 160, 250, null, null],
[0, "린지", null, 0, null, 69, 68, 71, 0, 160, 250, null, null],
[0, "예지", null, 0, null, 58, 63, 78, 0, 160, 250, null, null],
[0, "피에스타혜미", null, 0, null, 66, 54, 59, 0, 160, 250, null, null],
[0, "피에스타 혜미", null, 0, null, 66, 54, 59, 0, 160, 250, null, null],
[0, "차오루", null, 0, null, 78, 73, 67, 0, 160, 250, null, null],
[0, "민영", null, 0, null, 76, 72, 81, 0, 160, 250, null, null],
[0, "브브걸유정", null, 0, null, 64, 73, 67, 0, 160, 250, null, null],
[0, "브레이브걸스 유정", null, 0, null, 64, 73, 67, 0, 160, 250, null, null],
[0, "은지", null, 0, null, 70, 73, 68, 0, 160, 250, null, null],
[0, "브브걸유나", null, 0, null, 66, 76, 66, 0, 160, 250, null, null],
[0, "브레브브걸스 유나", null, 0, null, 66, 76, 66, 0, 160, 250, null, null],
[0, "하윤", null, 0, null, 71, 78, 69, 0, 160, 250, null, null],
[0, "베리굿태하", null, 0, null, 78, 75, 78, 0, 160, 250, null, null],
[0, "베리굿 태하", null, 0, null, 78, 75, 78, 0, 160, 250, null, null],
[0, "조현", null, 0, null, 79, 78, 72, 0, 160, 250, null, null],
[0, "서율", null, 0, null, 68, 63, 62, 0, 160, 250, null, null],
[0, "다예", null, 0, null, 70, 62, 64, 0, 160, 250, null, null],
@@ -267,7 +267,7 @@
[0, "이희진", null, 0, null, 63, 54, 78, 0, 160, 250, null, null],
[0, "유지", null, 0, null, 72, 59, 73, 0, 160, 250, null, null],
[0, "다혜", null, 0, null, 70, 67, 63, 0, 160, 250, null, null],
[0, "베스티혜연", null, 0, null, 64, 63, 70, 0, 160, 250, null, null],
[0, "베스티 혜연", null, 0, null, 64, 63, 70, 0, 160, 250, null, null],
[0, "해령", null, 0, null, 81, 70, 76, 0, 160, 250, null, null],
[0, "김보아", null, 0, null, 69, 63, 86, 0, 160, 250, null, null],
[0, "박시현", null, 0, null, 73, 62, 66, 0, 160, 250, null, null],
@@ -291,7 +291,7 @@
[0, "김예원", null, 0, null, 62, 57, 58, 0, 160, 250, null, null],
[0, "서인영", null, 0, null, 73, 78, 68, 0, 160, 250, null, null],
[0, "차희", null, 0, null, 71, 59, 80, 0, 160, 250, null, null],
[0, "멜로디유민", null, 0, null, 79, 55, 78, 0, 160, 250, null, null],
[0, "멜로디 유민", null, 0, null, 79, 55, 78, 0, 160, 250, null, null],
[0, "예인", null, 0, null, 78, 63, 78, 0, 160, 250, null, null],
[0, "여은", null, 0, null, 70, 57, 80, 0, 160, 250, null, null],
[0, "오승희", null, 0, null, 73, 60, 69, 0, 160, 250, null, null],
@@ -301,7 +301,7 @@
[0, "장예은", null, 0, null, 70, 76, 66, 0, 160, 250, null, null],
[0, "엘키", null, 0, null, 78, 71, 60, 0, 160, 250, null, null],
[0, "권은빈", null, 0, null, 76, 73, 68, 0, 160, 250, null, null],
[0, "프리스틴나영", null, 0, null, 73, 75, 70, 0, 160, 250, null, null],
[0, "프리스틴 나영", null, 0, null, 73, 75, 70, 0, 160, 250, null, null],
[0, "로아", null, 0, null, 68, 71, 61, 0, 160, 250, null, null],
[0, "유하", null, 0, null, 70, 68, 65, 0, 160, 250, null, null],
[0, "은우", null, 0, null, 72, 67, 63, 0, 160, 250, null, null],
@@ -312,9 +312,9 @@
[0, "시연", null, 0, null, 66, 62, 66, 0, 160, 250, null, null],
[0, "카일라", null, 0, null, 60, 69, 60, 0, 160, 250, null, null],
[0, "지유", null, 0, null, 72, 63, 66, 0, 160, 250, null, null],
[0, "라니아혜미", null, 0, null, 66, 63, 61, 0, 160, 250, null, null],
[0, "라니아 혜미", null, 0, null, 66, 63, 61, 0, 160, 250, null, null],
[0, "지은", null, 0, null, 61, 60, 56, 0, 160, 250, null, null],
[0, "라니아유민", null, 0, null, 68, 63, 66, 0, 160, 250, null, null],
[0, "라니아 유민", null, 0, null, 68, 63, 66, 0, 160, 250, null, null],
[0, "따보", null, 0, null, 58, 60, 57, 0, 160, 250, null, null],
[0, "제니", null, 0, null, 62, 51, 81, 0, 160, 250, null, null],
[0, "건지", null, 0, null, 72, 53, 84, 0, 160, 250, null, null],
@@ -322,17 +322,17 @@
[0, "나리", null, 0, null, 84, 86, 80, 0, 160, 250, null, null],
[0, "지애", null, 0, null, 63, 81, 72, 0, 160, 250, null, null],
[0, "우주", null, 0, null, 67, 86, 69, 0, 160, 250, null, null],
[0, "와썹수진", null, 0, null, 64, 80, 73, 0, 160, 250, null, null],
[0, "타히티민재", null, 0, null, 62, 63, 66, 0, 160, 250, null, null],
[0, "와썹 수진", null, 0, null, 64, 80, 73, 0, 160, 250, null, null],
[0, "타히티 민재", null, 0, null, 62, 63, 66, 0, 160, 250, null, null],
[0, "미소", null, 0, null, 63, 60, 61, 0, 160, 250, null, null],
[0, "타히티지수", null, 0, null, 61, 57, 67, 0, 160, 250, null, null],
[0, "타히티 지수", null, 0, null, 61, 57, 67, 0, 160, 250, null, null],
[0, "아리", null, 0, null, 72, 69, 64, 0, 160, 250, null, null],
[0, "제리", null, 0, null, 66, 61, 68, 0, 160, 250, null, null],
[0, "아유미", null, 0, null, 80, 68, 69, 0, 160, 250, null, null],
[0, "혜승", null, 0, null, 68, 57, 71, 0, 160, 250, null, null],
[0, "하린", null, 0, null, 70, 60, 66, 0, 160, 250, null, null],
[0, "황정음", null, 0, null, 79, 55, 72, 0, 160, 250, null, null],
[0, "슈가수진", null, 0, null, 83, 54, 63, 0, 160, 250, null, null],
[0, "슈가 수진", null, 0, null, 83, 54, 63, 0, 160, 250, null, null],
[0, "산다라박", null, 0, null, 80, 66, 64, 0, 160, 250, null, null],
[0, "씨엘", null, 0, null, 40, 88, 77, 0, 160, 250, null, null],
[0, "박봄", null, 0, null, 55, 60, 73, 0, 160, 250, null, null],
@@ -351,14 +351,32 @@
[0, "엘린", null, 0, null, 71, 61, 63, 0, 160, 250, null, null],
[0, "소율", null, 0, null, 70, 66, 64, 0, 160, 250, null, null],
[0, "금미", null, 0, null, 73, 63, 61, 0, 160, 250, null, null],
[0, "크레용팝초아", null, 0, null, 72, 67, 65, 0, 160, 250, null, null],
[0, "크레용팝 초아", null, 0, null, 72, 67, 65, 0, 160, 250, null, null],
[0, "웨이", null, 0, null, 70, 65, 60, 0, 160, 250, null, null],
[0, "쥬니엘", null, 0, null, 80, 46, 81, 0, 160, 250, null, null],
[0, "이민", null, 0, null, 64, 50, 83, 0, 160, 250, null, null],
[0, "크리스탈채", null, 0, null, 72, 51, 84, 0, 160, 250, null, null],
[0, "윤미래", null, 0, null, 57, 80, 102, 0, 160, 250, null, null],
[0, "애니", null, 0, null, 58, 92, 88, 0, 160, 250, null, null],
[0, "NS윤지", null, 0, null, 86, 84, 78, 0, 160, 250, null, null]
[0, "NS윤지", null, 0, null, 86, 84, 78, 0, 160, 250, null, null],
[0, "미연", null, 0, null, 89, 69, 88, 0, 160, 250, null, null],
[0, "민니", null, 0, null, 73, 59, 66, 0, 160, 250, null, null],
[0, "여자아이들 수진", null, 0, null, 70, 66, 71, 0, 160, 250, null, null],
[0, "여자아이들 소연", null, 0, null, 74, 81, 90, 0, 160, 250, null, null],
[0, "우기", null, 0, null, 67, 70, 66, 0, 160, 250, null, null],
[0, "슈화", null, 0, null, 71, 59, 78, 0, 160, 250, null, null],
[0, "장원영", null, 0, null, 88, 79, 78, 0, 160, 250, null, null],
[0, "미야와키 사쿠라", null, 0, null, 84, 69, 64, 0, 160, 250, null, null],
[0, "조유리", null, 0, null, 81, 64, 87, 0, 160, 250, null, null],
[0, "최예나", null, 0, null, 79, 74, 68, 0, 160, 250, null, null],
[0, "안유진", null, 0, null, 78, 66, 70, 0, 160, 250, null, null],
[0, "야부키 나코", null, 0, null, 75, 63, 82, 0, 160, 250, null, null],
[0, "권은비", null, 0, null, 79, 77, 70, 0, 160, 250, null, null],
[0, "강혜원", null, 0, null, 73, 70, 68, 0, 160, 250, null, null],
[0, "혼다 히토미", null, 0, null, 70, 71, 70, 0, 160, 250, null, null],
[0, "아이즈원 김채원", null, 0, null, 72, 65, 73, 0, 160, 250, null, null],
[0, "김민주", null, 0, null, 80, 66, 74, 0, 160, 250, null, null],
[0, "이채연", null, 0, null, 71, 87, 65, 0, 160, 250, null, null]
],
"general_ex":[
],
+5
View File
@@ -4,6 +4,10 @@ DROP TABLE IF EXISTS general;
#
DROP TABLE IF EXISTS nation;
#
DROP TABLE IF EXISTS board;
DROP TABLE IF EXISTS comment;
#
DROP TABLE IF EXISTS city;
@@ -21,6 +25,7 @@ DROP TABLE IF EXISTS message;
#
DROP TABLE IF EXISTS diplomacy;
DROP TABLE IF EXISTS ng_diplomacy;
#
DROP TABLE IF EXISTS tournament;
+51 -126
View File
@@ -41,6 +41,7 @@ CREATE TABLE `general` (
`dex30` INT(8) NULL DEFAULT '0',
`dex40` INT(8) NULL DEFAULT '0',
`level` INT(2) NULL DEFAULT '0',
`permission` ENUM('normal','auditor','ambassador') NULL DEFAULT 'normal',
`gold` INT(6) NULL DEFAULT '1000',
`rice` INT(6) NULL DEFAULT '1000',
`crew` INT(5) NULL DEFAULT '0',
@@ -150,6 +151,7 @@ CREATE TABLE `general` (
`turn23` VARCHAR(50) NULL DEFAULT '[0,0,0,0]',
`recturn` VARCHAR(50) NULL DEFAULT '[0,0,0,0]',
`resturn` VARCHAR(30) NULL DEFAULT '',
`penalty` TEXT NULL DEFAULT '',
PRIMARY KEY (`no`),
INDEX `nation` (`nation`, `npc`),
INDEX `city` (`city`),
@@ -203,130 +205,7 @@ CREATE TABLE `nation` (
`spy` CHAR(255) NOT NULL DEFAULT '{}',
`level` INT(1) NULL DEFAULT '0',
`type` INT(2) NULL DEFAULT '0',
`rule` TEXT NULL DEFAULT '',
`history` MEDIUMTEXT NULL DEFAULT '',
`board0` TEXT NULL DEFAULT '',
`board0_who` INT(6) NULL DEFAULT '0',
`board0_when` DATETIME NULL DEFAULT NULL,
`board1` TEXT NULL DEFAULT '',
`board1_who` INT(6) NULL DEFAULT '0',
`board1_when` DATETIME NULL DEFAULT NULL,
`board2` TEXT NULL DEFAULT '',
`board2_who` INT(6) NULL DEFAULT '0',
`board2_when` DATETIME NULL DEFAULT NULL,
`board3` TEXT NULL DEFAULT '',
`board3_who` INT(6) NULL DEFAULT '0',
`board3_when` DATETIME NULL DEFAULT NULL,
`board4` TEXT NULL DEFAULT '',
`board4_who` INT(6) NULL DEFAULT '0',
`board4_when` DATETIME NULL DEFAULT NULL,
`board5` TEXT NULL DEFAULT '',
`board5_who` INT(6) NULL DEFAULT '0',
`board5_when` DATETIME NULL DEFAULT NULL,
`board6` TEXT NULL DEFAULT '',
`board6_who` INT(6) NULL DEFAULT '0',
`board6_when` DATETIME NULL DEFAULT NULL,
`board7` TEXT NULL DEFAULT '',
`board7_who` INT(6) NULL DEFAULT '0',
`board7_when` DATETIME NULL DEFAULT NULL,
`board8` TEXT NULL DEFAULT '',
`board8_who` INT(6) NULL DEFAULT '0',
`board8_when` DATETIME NULL DEFAULT NULL,
`board9` TEXT NULL DEFAULT '',
`board9_who` INT(6) NULL DEFAULT '0',
`board9_when` DATETIME NULL DEFAULT NULL,
`board10` TEXT NULL DEFAULT '',
`board10_who` INT(6) NULL DEFAULT '0',
`board10_when` DATETIME NULL DEFAULT NULL,
`board11` TEXT NULL DEFAULT '',
`board11_who` INT(6) NULL DEFAULT '0',
`board11_when` DATETIME NULL DEFAULT NULL,
`board12` TEXT NULL DEFAULT '',
`board12_who` INT(6) NULL DEFAULT '0',
`board12_when` DATETIME NULL DEFAULT NULL,
`board13` TEXT NULL DEFAULT '',
`board13_who` INT(6) NULL DEFAULT '0',
`board13_when` DATETIME NULL DEFAULT NULL,
`board14` TEXT NULL DEFAULT '',
`board14_who` INT(6) NULL DEFAULT '0',
`board14_when` DATETIME NULL DEFAULT NULL,
`board15` TEXT NULL DEFAULT '',
`board15_who` INT(6) NULL DEFAULT '0',
`board15_when` DATETIME NULL DEFAULT NULL,
`board16` TEXT NULL DEFAULT '',
`board16_who` INT(6) NULL DEFAULT '0',
`board16_when` DATETIME NULL DEFAULT NULL,
`board17` TEXT NULL DEFAULT '',
`board17_who` INT(6) NULL DEFAULT '0',
`board17_when` DATETIME NULL DEFAULT NULL,
`board18` TEXT NULL DEFAULT '',
`board18_who` INT(6) NULL DEFAULT '0',
`board18_when` DATETIME NULL DEFAULT NULL,
`board19` TEXT NULL DEFAULT '',
`board19_who` INT(6) NULL DEFAULT '0',
`board19_when` DATETIME NULL DEFAULT NULL,
`coreboard0` TEXT NULL DEFAULT '',
`coreboard0_who` INT(6) NULL DEFAULT '0',
`coreboard0_when` DATETIME NULL DEFAULT NULL,
`coreboard1` TEXT NULL DEFAULT '',
`coreboard1_who` INT(6) NULL DEFAULT '0',
`coreboard1_when` DATETIME NULL DEFAULT NULL,
`coreboard2` TEXT NULL DEFAULT '',
`coreboard2_who` INT(6) NULL DEFAULT '0',
`coreboard2_when` DATETIME NULL DEFAULT NULL,
`coreboard3` TEXT NULL DEFAULT '',
`coreboard3_who` INT(6) NULL DEFAULT '0',
`coreboard3_when` DATETIME NULL DEFAULT NULL,
`coreboard4` TEXT NULL DEFAULT '',
`coreboard4_who` INT(6) NULL DEFAULT '0',
`coreboard4_when` DATETIME NULL DEFAULT NULL,
`coreboard5` TEXT NULL DEFAULT '',
`coreboard5_who` INT(6) NULL DEFAULT '0',
`coreboard5_when` DATETIME NULL DEFAULT NULL,
`coreboard6` TEXT NULL DEFAULT '',
`coreboard6_who` INT(6) NULL DEFAULT '0',
`coreboard6_when` DATETIME NULL DEFAULT NULL,
`coreboard7` TEXT NULL DEFAULT '',
`coreboard7_who` INT(6) NULL DEFAULT '0',
`coreboard7_when` DATETIME NULL DEFAULT NULL,
`coreboard8` TEXT NULL DEFAULT '',
`coreboard8_who` INT(6) NULL DEFAULT '0',
`coreboard8_when` DATETIME NULL DEFAULT NULL,
`coreboard9` TEXT NULL DEFAULT '',
`coreboard9_who` INT(6) NULL DEFAULT '0',
`coreboard9_when` DATETIME NULL DEFAULT NULL,
`coreboard10` TEXT NULL DEFAULT '',
`coreboard10_who` INT(6) NULL DEFAULT '0',
`coreboard10_when` DATETIME NULL DEFAULT NULL,
`coreboard11` TEXT NULL DEFAULT '',
`coreboard11_who` INT(6) NULL DEFAULT '0',
`coreboard11_when` DATETIME NULL DEFAULT NULL,
`coreboard12` TEXT NULL DEFAULT '',
`coreboard12_who` INT(6) NULL DEFAULT '0',
`coreboard12_when` DATETIME NULL DEFAULT NULL,
`coreboard13` TEXT NULL DEFAULT '',
`coreboard13_who` INT(6) NULL DEFAULT '0',
`coreboard13_when` DATETIME NULL DEFAULT NULL,
`coreboard14` TEXT NULL DEFAULT '',
`coreboard14_who` INT(6) NULL DEFAULT '0',
`coreboard14_when` DATETIME NULL DEFAULT NULL,
`coreboard15` TEXT NULL DEFAULT '',
`coreboard15_who` INT(6) NULL DEFAULT '0',
`coreboard15_when` DATETIME NULL DEFAULT NULL,
`coreboard16` TEXT NULL DEFAULT '',
`coreboard16_who` INT(6) NULL DEFAULT '0',
`coreboard16_when` DATETIME NULL DEFAULT NULL,
`coreboard17` TEXT NULL DEFAULT '',
`coreboard17_who` INT(6) NULL DEFAULT '0',
`coreboard17_when` DATETIME NULL DEFAULT NULL,
`coreboard18` TEXT NULL DEFAULT '',
`coreboard18_who` INT(6) NULL DEFAULT '0',
`coreboard18_when` DATETIME NULL DEFAULT NULL,
`coreboard19` TEXT NULL DEFAULT '',
`coreboard19_who` INT(6) NULL DEFAULT '0',
`coreboard19_when` DATETIME NULL DEFAULT NULL,
`boardindex` INT(2) NULL DEFAULT '19',
`coreindex` INT(2) NULL DEFAULT '19',
`l12term` INT(4) NULL DEFAULT '0',
`l11term` INT(4) NULL DEFAULT '0',
`l10term` INT(4) NULL DEFAULT '0',
@@ -436,6 +315,36 @@ CREATE TABLE `nation` (
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
##
CREATE TABLE `board` (
`no` INT(11) NOT NULL AUTO_INCREMENT,
`nation_no` INT(11) NOT NULL,
`is_secret` TINYINT(1) NOT NULL,
`date` DATETIME NOT NULL,
`general_no` INT(11) NOT NULL,
`author` VARCHAR(32) NOT NULL,
`title` TEXT NOT NULL,
`text` TEXT NOT NULL,
PRIMARY KEY (`no`),
INDEX `nation_no` (`nation_no`, `is_secret`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
CREATE TABLE `comment` (
`no` INT(11) NOT NULL AUTO_INCREMENT,
`nation_no` INT(11) NOT NULL,
`is_secret` TINYINT(1) NOT NULL,
`date` DATETIME NOT NULL,
`document_no` INT(11) NOT NULL,
`general_no` INT(11) NOT NULL,
`author` VARCHAR(32) NOT NULL,
`text` TEXT NOT NULL,
PRIMARY KEY (`no`),
INDEX `nation_no` (`nation_no`, `is_secret`, `date`),
INDEX `document_no` (`document_no`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
###########################################################################
##
###########################################################################
@@ -645,14 +554,30 @@ create table diplomacy (
`state` INT(6) NULL DEFAULT '0',
`term` INT(6) NULL DEFAULT '0',
`dead` INT(8) NULL DEFAULT '0',
`fixed` CHAR(128) NULL DEFAULT '',
`reserved` CHAR(128) NULL DEFAULT '',
`showing` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`no`),
UNIQUE INDEX `me` (`me`, `you`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `ng_diplomacy` (
`no` INT(11) NOT NULL AUTO_INCREMENT,
`src_nation_id` INT(11) NOT NULL,
`dest_nation_id` INT(11) NOT NULL,
`prev_no` INT(11) NULL DEFAULT NULL,
`state` ENUM('proposed','activated','cancelled') NOT NULL DEFAULT 'proposed',
`text_brief` TEXT NOT NULL,
`text_detail` TEXT NOT NULL,
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`src_signer` INT(11) NOT NULL,
`dest_signer` INT(11) NULL DEFAULT NULL,
`aux` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`no`),
INDEX `by_nation_src` (`src_nation_id`, `dest_nation_id`, `state`, `date`),
INDEX `by_nation_dest` (`dest_nation_id`, `src_nation_id`, `state`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
###########################################################################
##
###########################################################################
@@ -819,4 +744,4 @@ CREATE TABLE IF NOT EXISTS `storage` (
UNIQUE INDEX `key` (`namespace`, `key`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM
ENGINE=MyISAM

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