Compare commits

...
213 Commits
Author SHA1 Message Date
Hide_D 70b1f23a49 빙의 해제용 삭턴 세팅.
- 10분 미만은 30분
- 10분 이하는 60분 대기 필요
2018-05-05 23:25:21 +09:00
Hide_D 5e4493b49a 빙의 목록을 종능 순으로 정렬해서 표현 2018-05-05 23:03:10 +09:00
Hide_D dec24e09cf 빙의시 장수명 빼먹는 버그 수정 2018-05-05 22:52:53 +09:00
Hide_D 95445d8f8a 빙의창에서 만료 후 다른 장수 보기 시 안보이는 문제 해결 2018-05-05 22:46:56 +09:00
Hide_D 683a844a08 빙의 코드 개선
- 유효 기간 관련 늘림.
- 유효 기간 가까워지면 색으로 표시. 만료 표기도 추가
- 다른 장수 보기를 남은 초 기준으로 수정
2018-05-05 22:39:21 +09:00
Hide_D a75eb5b74e 장수 선택 테이블을 schema에 추가 2018-05-05 21:44:15 +09:00
Hide_D 5dfb844c7e 빙의 재선택 시간을 빠르게 2018-05-05 21:40:59 +09:00
Hide_D 20f991a205 빙의시 오래된 데이터 삭제 2018-05-05 21:22:38 +09:00
Hide_D 3c1c339498 장수 빙의 코드 변경 2018-05-05 21:20:15 +09:00
Hide_D 5974028c4d 빙의 장수 기능 추가(선택은 미완) 2018-05-05 19:51:56 +09:00
Hide_D a534b8f812 시나리오 30번 수정 2018-05-05 19:49:22 +09:00
Hide_D cb2fbf1a32 common.js에 iconpath 연산 코드 추가 2018-05-05 19:49:07 +09:00
Hide_D a1392652ae config.css에서 div, button에 적용되던 전역 style 제거
모바일 화면에서 입구 햄버거 버튼 동작
2018-05-05 19:48:38 +09:00
Hide_D 69af23b60a Session에서 requireLogin 인자 이름을 직관적으로 변경 2018-05-05 19:45:10 +09:00
Hide_D 063b3d37a6 exception이 trace 수정하도록 임시 수정 2018-05-05 19:44:22 +09:00
Hide_D ebf9b4b75d 가상 상성인 경우 새 장수는 재야임. 2018-04-30 00:15:43 +09:00
Hide_D 45fd06c195 성인으로 등장시 월이 제대로 로그로 남지 않는 버그 수정 2018-04-30 00:01:11 +09:00
Hide_D 7db3675e71 성인 등장이 꼭 1월이 아니어도 되도록 변경 2018-04-29 23:31:21 +09:00
Hide_D a19661199e Date의 비교 대상 lhs, rhs가 바뀐 버그 수정 2018-04-29 23:13:49 +09:00
Hide_D 953196ec78 예약 오픈 시 데이터를 바로 날리진 않도록 설정 2018-04-29 12:55:16 +09:00
Hide_D d5be6e3e08 내 정보에서 숙련도를 수치로 표기 2018-04-29 04:29:46 +09:00
Hide_D 551b79d8c2 관리자 패널 접속 허용, 접속 제한 쿼리 버그 수정 2018-04-29 04:02:23 +09:00
Hide_D a242b9a20e 주요 메뉴에 상단 바 추가 2018-04-29 03:08:30 +09:00
Hide_D 19e91b2de0 입구 코드 추가 2018-04-29 02:44:09 +09:00
Hide_D a1397e41aa 트래픽 버그 수정 2018-04-29 01:58:59 +09:00
Hide_D 13fccb998e 년도 계산 공식 재 수정. 시나리오 시작시 남은 개월 수를 계산. 반동탁연합 시나리오 외교 추가 2018-04-29 01:47:48 +09:00
Hide_D 1e54220230 연, 월 계산 방식 변경 2018-04-29 01:19:31 +09:00
Hide_D 6b2000bb39 올스타전 내특/전특 2018-04-29 00:53:49 +09:00
Hide_D 5f3fbdb089 KBO 올스타전 리뉴얼 2018-04-29 00:45:12 +09:00
Hide_D 63e888c9b1 특성에 '랜덤', '랜덤전특', '랜점내특' 가능. 0으로 지정 가능 2018-04-29 00:28:06 +09:00
Hide_D e97e702c2e 가상 모드 대응. 랜덤 특성 세팅 추가 2018-04-28 23:55:22 +09:00
Hide_D 657c35f876 git tree 지정이 안되는 업데이트 유저는 기존에 업데이트된 값을 이용하도록 변경 2018-04-28 23:36:35 +09:00
Hide_D bc79250f96 Merge branch 'master' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-28 22:42:01 +09:00
Hide_D dd7846e995 설정 저장용 key_value storage 추가. ROW_FORMAT=DYNAMIC 삭제 2018-04-28 22:01:58 +09:00
Hide_D 8a5483d508 연감 벌점 감소 2018-04-28 21:52:14 +09:00
Hide_D 805053e921 NPC 포상 잘 안주는 문제 우회 시도 2018-04-28 21:04:55 +09:00
Hide_D 170a32a1bd 등용장 메시지 송신이 이상한 문제 해결.
인사부 '공석' 지정 가능
2018-04-28 20:49:38 +09:00
Hide_D 5262d424b4 방랑의 제한 조건 추가 2018-04-28 20:38:19 +09:00
Hide_D 9c3c1045ac 줄간격 문제 해결(inline에 line-height 적용해제) 2018-04-28 20:29:33 +09:00
Hide_D 2d1a3f5da9 많은 버그 수정
커맨드 실행 중 로그아웃 된 경우 버그 수정
국기 변경에 에러 있던 점 수정
등용장 수락시 송신자 명성 안 늘어나는 버그 수정
2018-04-28 20:10:33 +09:00
Hide_D 088260bbc6 npc 재야일때 e_notice 에러 수정 2018-04-28 19:13:18 +09:00
Hide_D 18ebbbc555 oauth_kakao autoload 빼먹은거 수정 2018-04-28 19:10:03 +09:00
Hide_D 80b70a8765 국가 명 너비를 살짝 더 늘림 2018-04-28 18:48:58 +09:00
Hide_D d3d4cce8b5 서버 설명 2018-04-28 18:09:55 +09:00
Hide_D 76bfcd4fa8 베팅 버그 수정 2018-04-28 02:37:47 +09:00
Hide_D 7cbe383a8a 토너먼트 문자열 버그 수정 2018-04-28 02:36:59 +09:00
Hide_D 0488ebf071 무지장 유저장 포상 기준 변경 2018-04-28 02:25:08 +09:00
Hide_D 1cfab53472 문자열 자르기 버그 수정 2018-04-28 01:26:32 +09:00
Hide_D 084c7a2626 선포시 양국 모두 뜨도록 2018-04-28 01:16:00 +09:00
Hide_D 161836a233 상성 가상인 경우 상성이 리셋되지 않는 버그 해결 2018-04-28 01:08:54 +09:00
Hide_D c86ac7d20f 가입 일자 표기, 개인정보 제3자 제공 동의 버튼 추가. 철회 버튼도 추가 2018-04-28 00:23:51 +09:00
Hide_D 20cceec090 IE11에서 javascript 기본 argument 안되는 것 수정 2018-04-28 00:00:46 +09:00
Hide_D 62c6ba362d 개인정보처리방침 & 이용약관 링크 추가 2018-04-27 23:51:57 +09:00
Hide_D 5ed31881e6 PrintElapsedTime 제거 2018-04-27 23:40:50 +09:00
Hide_D 647c51fe0f 외교 서신, 등용장 수락시 올바르지 않을 경우 alert
건국 시 장수 이름과 같아도 건국 가능하도록 변경
2018-04-27 23:08:55 +09:00
Hide_D a2d3ac9e70 시나리오 생성시 장수의 NPC 메시지가 입력되지 않는 버그 해결 2018-04-27 22:51:39 +09:00
Hide_D 20f74f6645 각 페이지에 서버 이름 표기 2018-04-27 22:36:29 +09:00
Hide_D 0bb1ed6f18 서버 리셋 시 서버 이름을 받아오도록 설정 2018-04-27 22:28:16 +09:00
Hide_D 2102a852cb 가상, 사실 거꾸로 표기한 점 수정 2018-04-27 22:21:43 +09:00
Hide_D 0cfb80b7bf 카카오 로그인 버튼을 직관적으로 변경 2018-04-27 22:09:57 +09:00
Hide_D 4297ea9e40 로그인 & 가입 버튼 추가 2018-04-27 21:37:37 +09:00
Hide_D 0ce36e93bd 예약 오픈 테이블은 리셋에도 유지하도록 변경 2018-04-25 21:31:39 +09:00
Hide_D 18bd5f4246 NPC 대사 제대로 안하는 버그 수정 2018-04-25 21:25:04 +09:00
Hide_D 2e7bcd9038 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-25 21:04:50 +09:00
Hide_D bfef0c28bc 리셋 시 폐쇄를 외부에서 하면 예약 리셋이 안되던 버그 수정 2018-04-25 21:04:41 +09:00
Hide_D b447065651 scenario 30번 수정 2018-04-25 18:12:08 +09:00
Hide_D f540f87e77 KBO 올스타전 시나리오 추가 2018-04-25 18:04:01 +09:00
Hide_D 6ebe3454af 예약 안내 조건 버그 수정 2018-04-25 08:15:55 +09:00
Hide_D 7e00500870 예약 리셋시 초기화 에러 표기 가능하도록 변경 2018-04-25 03:10:09 +09:00
Hide_D bc37dd1df7 '폐쇄 여부'를 server_basic_info에서 판단하도록 설정 2018-04-25 03:07:02 +09:00
Hide_D 77aca09f53 상성 여부로 메시지 변경 2018-04-25 03:02:31 +09:00
Hide_D 23fb1194ee 서버 예약 오픈을 UI에 통합 2018-04-25 02:56:11 +09:00
Hide_D 6253b757ec 기본 예약 리셋 동작 2018-04-25 02:13:40 +09:00
Hide_D 9122342fb9 FIXME: 리셋 헬퍼 꼴보기 싫으니 분리할 것 2018-04-25 00:44:33 +09:00
Hide_D fb42a32089 리셋 코드를 별도 코드로 분리 2018-04-25 00:43:09 +09:00
Hide_D 5c7f4c43ae 리셋 시 토너먼트 개최 여부도 같이 설정 2018-04-25 00:28:26 +09:00
Hide_D 3da256cc29 토너먼트 타이틀 정보 약간 개선 2018-04-25 00:05:08 +09:00
Hide_D 717c576cba n장 끼리 포상 제대로 안하는 버그 수정 2018-04-24 02:16:50 +09:00
Hide_D ddb4011b5d 몰수 조건 강화 2018-04-24 02:12:04 +09:00
Hide_D 48207b9300 포상 조건 재 수정. 무지장이라도 금쌀이 너무 적으면 주긴 함 2018-04-24 01:58:07 +09:00
Hide_D 388afe6fb4 CityHelper에서 getAllNationCities가 올바르게 동작하지 않던 버그 해결 2018-04-24 01:15:05 +09:00
Hide_D 99b459766a 무지장 헌납 로직 추가
포상 로직에서 무지장. 사망 예정장은 제외
2018-04-24 00:53:26 +09:00
Hide_D 230fc5ba53 훼섭은 닫히던 문제 마저 수정 2018-04-23 23:51:47 +09:00
Hide_D 9c266b7b1c 불가침 수락 년도 제대로 안보이는 버그 수정 2018-04-23 23:51:02 +09:00
Hide_D 603599d666 업데이트 후 서버를 닫지 않도록 변경 2018-04-23 23:48:59 +09:00
Hide_D b3cd29ac95 명전 테이블에 unique index가 안걸려있던 버그 수정 2018-04-23 01:21:05 +09:00
Hide_D a4beab86c2 도시 정보 턴 시간값을 +1 2018-04-22 12:24:42 +09:00
Hide_D 3a84e0d064 run_daemon 고도화. 1분에 4번 부름 2018-04-22 02:35:21 +09:00
Hide_D 31f1eb2d28 턴 실행 데몬 2018-04-22 02:18:51 +09:00
Hide_D d73c0c6f0c 남귀병이 기술 1등급 병종이었다니! 2018-04-22 01:32:25 +09:00
Hide_D 36409cf066 game, nation, city, general을 myisam으로 변경 2018-04-21 23:47:02 +09:00
Hide_D 556e1059f9 인사부 버그 수정
메인 페이지에서 재야 인사 에러 안나게 수정
2018-04-21 23:19:29 +09:00
Hide_D 131a6cb6c3 건국 버그 수정 2018-04-21 23:08:51 +09:00
Hide_D 598943eb1b 방랑군 상태에서 세력 도시 클릭 불가. 인사부 가능.
설치시 운영자 삭턴
시나리오 29 재 디자인
지도에서 로그인 유저 검사
2018-04-21 22:43:46 +09:00
Hide_D bf746393b8 천인강림 시나리오 리 밸런싱 2018-04-21 21:52:17 +09:00
Hide_D 70b6997436 연감에서 장수 로그 컬럼 길이 연장 2018-04-21 21:10:03 +09:00
Hide_D b26c6a04c0 삭턴 버그로 생긴 버그 수정 2018-04-21 17:27:45 +09:00
Hide_D 4f262a03e4 command_Single 동작 변경 2018-04-21 16:18:07 +09:00
Hide_D a0ca3dc3f6 TODO 추가 2018-04-21 15:59:05 +09:00
Hide_D f58736277f 삭턴 버그 수정 2018-04-21 15:58:41 +09:00
Hide_D 473cae169e 퀘섭 빙의시 계정이름이 아니라 닉네임으로 기록하도록 변경 2018-04-21 14:14:41 +09:00
Hide_D 4b956385bd 메시지 전송을 위해 일괄 2018-04-21 13:16:50 +09:00
Hide_D 481494a885 전체 메시지 안 보내지던 것 수정
10초마다 메시지
2018-04-21 13:06:10 +09:00
Hide_D 243604d6c1 30초마다 메시지 폴링! 2018-04-21 12:28:32 +09:00
Hide_D dc97c71e0b 1월을 놓치면 태어나지 않으므로 Date 기준을 ==에서 >=로 변경 2018-04-21 12:20:55 +09:00
Hide_D e6b4832b5d index.php에 level 없는 버그 2018-04-21 11:49:55 +09:00
Hide_D 00ac67e8ac 시나리오 시작 년도 수정 2018-04-21 11:11:25 +09:00
Hide_D 953b609b32 임관, 장수 선택시 설명 색 변경 2018-04-21 10:54:07 +09:00
Hide_D a5875be39b 쿼리 인덱스 2018-04-21 10:48:55 +09:00
Hide_D 0f45de8384 부상 코드 2018-04-21 10:47:09 +09:00
Hide_D d119200287 서버 업데이트 순서 틀림 2018-04-21 10:43:21 +09:00
Hide_D b9fa0bea6e mkdir 권한 변경 2018-04-21 10:42:30 +09:00
Hide_D 3a28180700 도시 정보 주석 제거 2018-04-21 10:17:24 +09:00
Hide_D 5b6f456d5c 도시 정보 업데이트 2018-04-21 10:15:04 +09:00
Hide_D fb1ae6ea88 투표율 안보이는 버그 수정 2018-04-21 08:56:54 +09:00
Hide_D 50582a0e8b 내무부에 textarea 적용 2018-04-21 07:57:41 +09:00
Hide_D 8fe3d0258a 건국되지 않았을 때 버튼 처리 변경 2018-04-21 07:57:26 +09:00
Hide_D f2537b20de allButton 예제 2018-04-20 02:19:42 +09:00
Hide_D 31d6850e6e 게시판 리스트 변경 2018-04-20 02:17:38 +09:00
Hide_D 31468d5425 전력전 비율을 50% -> 40%로 내림 2018-04-19 22:55:11 +09:00
Hide_D 688b839315 지도 배경 그림이 올바르지 않은 버그 수정 2018-04-19 22:50:40 +09:00
Hide_D fa4c9046fc Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-04-19 20:08:31 +09:00
Hide_D c7560f9113 체섭에서 세션 시간 가져옮 2018-04-19 20:08:05 +09:00
Hide_D f7e3966310 부운영자 계정 권한 지정 2018-04-19 10:35:49 +09:00
Hide_D 7359237da4 항복 권고시 divide 0 나올 수 있는 문제 우회 2018-04-19 02:56:55 +09:00
Hide_D d617203c05 reply 추가 2018-04-19 02:55:35 +09:00
Hide_D 910526ba44 oauth 버그 2018-04-19 02:50:00 +09:00
Hide_D c1842703d7 Session ID 변경 2018-04-19 02:43:10 +09:00
Hide_D 2f9d2e2bc2 추방시 color 필요하던 점 2018-04-19 02:36:11 +09:00
Hide_D 20d7e005a0 도움말 에러 2018-04-19 02:34:44 +09:00
Hide_D 0ce5a88e49 NPC 추방시 warning 2018-04-19 02:34:38 +09:00
Hide_D 4af10fb485 유니크 아이템 warning 2018-04-19 02:34:28 +09:00
Hide_D f872113e99 토너먼트 warning 제거 2018-04-19 01:55:31 +09:00
Hide_D f33fefd188 도시에서 턴이 4개만 보이는 버그 수정 2018-04-19 01:53:02 +09:00
Hide_D 8c2f4f9dc9 Message 마지막 인자가 없엇 ㅓ터지는 버그 수정 2018-04-19 01:51:27 +09:00
Hide_D 3b6e7c5c28 몰수 시 NPC 반항 에러 2018-04-19 01:50:01 +09:00
Hide_D 595c11a9a7 NPC 사령턴이 '미설정'일때 2018-04-19 01:45:35 +09:00
Hide_D 1ab7b57885 숙련 단련 로그 버그 수정 2018-04-19 01:40:20 +09:00
Hide_D 07130e6022 선포 옵션 변경 2018-04-19 01:38:28 +09:00
Hide_D 2cc2f7eb23 NPC 몰수를 더 잘하도록 설정 2018-04-19 01:30:31 +09:00
Hide_D c798ac49b9 선포 메시지 버그 2018-04-19 01:21:28 +09:00
Hide_D a8796edbd3 체크 방식 유형 변경 2018-04-19 01:16:38 +09:00
Hide_D a4ead74cb2 등용장 로그 이상하게 뜨는것 수정 2018-04-19 00:27:35 +09:00
Hide_D 0beb00c5e5 등용장 탈때 삭턴 NULL되는 버그 수정 2018-04-19 00:26:09 +09:00
Hide_D 3d43690303 훈사 80 못 고치는 버그 수정 2018-04-19 00:22:26 +09:00
Hide_D 938c819e9a 베팅장 INF 수정 2018-04-19 00:19:56 +09:00
Hide_D 889ced68ed 베팅장 warning 우회 2018-04-19 00:18:31 +09:00
Hide_D de97384424 베팅창 warning 수정 2018-04-19 00:17:30 +09:00
Hide_D f6ffc20a23 등용장 장수열전 기록 안되는 버그 수정 2018-04-19 00:10:19 +09:00
Hide_D c0ec82051f $cities 변수 없음 수정 2018-04-19 00:04:30 +09:00
Hide_D 91273522c0 오탈자 수정 2018-04-19 00:03:46 +09:00
Hide_D 20a475466d 등용장 '등용장 안 타지는' 버그 수정 2018-04-18 23:54:48 +09:00
Hide_D 10b6a4ff6e 등용장 버그 고침(송신자에게도 감) 2018-04-18 23:48:47 +09:00
Hide_D 2a4e59d6e2 등용장 버그 수정(임관 국가) 2018-04-18 23:44:49 +09:00
Hide_D c016ea7c52 등용장 버그 수정 2018-04-18 23:44:17 +09:00
Hide_D 00bece9c9c 임관금지 거꾸로된것 수정 2018-04-18 23:42:27 +09:00
Hide_D 44ed61c14e touchmode 삭제 다른 방안을 찾아보는걸로 2018-04-18 23:24:33 +09:00
Hide_D 002b7ae534 등용장 버그 수정 2018-04-18 23:20:47 +09:00
Hide_D 63000bdd22 등용장 버그 수정 2018-04-18 23:18:55 +09:00
Hide_D 20fd52b32d 등용장 버그 수정 2018-04-18 23:17:55 +09:00
Hide_D 7a3064d37b 첩보시 병종 메시지 수정 2018-04-18 23:16:05 +09:00
Hide_D 7fea0a41c6 지도 수준을 없앰 2018-04-18 22:57:38 +09:00
Hide_D e701540d7f 외교 서신 (이)가 2018-04-18 22:37:00 +09:00
Hide_D 5187ebbf52 추방 몰수 선포 등 상황에서 메시지 안 나타나는 버그 수정 2018-04-18 22:34:13 +09:00
Hide_D df26c511b5 금쌀 2500단위도 추가 2018-04-18 22:18:39 +09:00
Hide_D 0e650da34a 메시지창 정렬.
몰/포 1200, 1500 추가
2018-04-18 22:16:59 +09:00
Hide_D 2c382da773 부대가 없더라도 부대 가입 버튼이 뜨는 버그 해결 2018-04-18 22:05:58 +09:00
Hide_D e709ee5db8 불필요한 array_get 삭제. 모병 칸 버튼을 징병->모병 2018-04-18 22:03:01 +09:00
Hide_D d550415b65 세션 설정시 오타 수정 2018-04-18 22:00:11 +09:00
Hide_D 9ec144e8f6 사령부 인덱스 버그 2018-04-18 21:58:01 +09:00
Hide_D 9458307612 사령부 표기 수정 2018-04-18 21:55:22 +09:00
Hide_D 915c5fcd8e npc 몰포 버그 수정 2018-04-18 21:51:44 +09:00
Hide_D 0df1293139 체결 메시지에도 년도 뜨도록 수정 2018-04-18 21:46:26 +09:00
Hide_D 9bcd18c42e 모,징병시 특성 병종이 2000 만 넘어도 뜨는 문제 해결 2018-04-18 21:42:09 +09:00
Hide_D 1c853107b7 불가침 제의 서신 수정 2018-04-18 21:38:56 +09:00
Hide_D 3f21e28ef7 유저에게 포상량이 확실히 더 많아짐 2018-04-18 21:24:00 +09:00
Hide_D 61244fcef9 추가한 커밋에서 불필요한 npc 코드 제거 2018-04-18 21:17:39 +09:00
Hide_D 03c930ce7d npc가 유저에게 포상, 몰수하는 기준을 더 후하게 잡음 2018-04-18 21:16:49 +09:00
Hide_D f57c4967f2 NPC 삼/팜 버그 마저 수정 2018-04-18 13:56:36 +09:00
Hide_D 49f40d56b0 회피 잘못 적용되는 버그 수정 2018-04-18 10:13:32 +09:00
Hide_D 190fcabbac NPC 삼팜 버그 2018-04-18 09:43:58 +09:00
Hide_D 8bccf449ad NPC 감찰부에서 장수 행동 2018-04-18 09:38:32 +09:00
Hide_D f7dc1a588b 능력치 받아올 때 general이 NULL인 경우도 대응 2018-04-18 09:24:10 +09:00
Hide_D 0eb91c6301 버튼들 '뒤로 가기' 가능하도록 직접 링크로 변경 2018-04-18 00:08:12 +09:00
Hide_D 0fa4d88ea9 lock 파일 경로 체크 2018-04-18 00:01:40 +09:00
Hide_D 18e355b701 bool 변수 받는 문제 해결. 전콘 안 고를 수 있도록 선택 2018-04-17 23:39:36 +09:00
Hide_D 1cb877503d 불가침 합의 시 년 표기가 이상한 문제 2018-04-17 23:30:48 +09:00
Hide_D b65e691255 벌점 안 쌓이는 버그 수정 2018-04-17 23:17:16 +09:00
Hide_D a4ee43f12b 세력도 아래 안보이는 것 해결 2018-04-17 23:04:37 +09:00
Hide_D f71c61a55b 특수 권한 유저 추가 2018-04-17 22:57:10 +09:00
Hide_D 418130f4cd bool 변환에서 false 조건 하나 더 추가 2018-04-17 22:44:39 +09:00
Hide_D 1566aa0243 국가색 새로 2018-04-17 22:15:11 +09:00
Hide_D ab546f66f0 국가간 갠메 2018-04-17 22:13:36 +09:00
Hide_D fc021dae54 등용장 살림 2018-04-17 22:03:23 +09:00
Hide_D 58a7b3afe1 등용장 잠시 살림 2018-04-17 22:03:08 +09:00
Hide_D 72f41df5d2 사령부 warning 2018-04-17 21:59:48 +09:00
Hide_D 8fd6b91cf7 아이템 습득시 warning 해결 2018-04-17 21:57:03 +09:00
Hide_D cf2ace32d1 로그아웃 버튼 삭제 2018-04-17 21:39:08 +09:00
Hide_D 05c4f721f2 메시지창 모바일에서 안보이는 것 해결 2018-04-17 21:37:59 +09:00
Hide_D b2096cc274 불가침 서신 개월수 안보이는 문제 해결, 개월수 년으로 보이는 문제 해결 2018-04-17 21:35:13 +09:00
Hide_D 067df49914 29번 능력치 변경 2018-04-17 20:59:16 +09:00
Hide_D 6961298e53 이미지 못 불러오는 문제 해결 2018-04-17 20:48:49 +09:00
Hide_D 3e6523002c 이벤트 메시지 변경 2018-04-17 20:43:18 +09:00
Hide_D c26add7b04 29번 시나리오 급조 2018-04-17 20:40:56 +09:00
Hide_D 12d50fec03 장수 등록 시 scenario 값과 show_img_level 값 2018-04-17 20:16:04 +09:00
Hide_D a43bbc9f23 proc.php 2018-04-17 20:09:35 +09:00
Hide_D 2bec3b253c proc readonly 2018-04-17 20:09:11 +09:00
Hide_D a69f256168 약관 추가 2018-04-17 20:08:15 +09:00
Hide_D d7fb88eed6 TimeZone 세팅 2018-04-17 19:23:05 +09:00
Hide_D bfd79f479e 파일 경로를 절대 경로로 변경 2018-04-17 19:21:30 +09:00
Hide_D 7ec3fcc78e 대문자 GAME 수정 2018-04-17 19:11:09 +09:00
Hide_DandGogs 858a09b429 Merge branch 'devel' of devsam/core into master 2018-04-17 04:33:14 +09:00
Hide_DandGogs c2298efaf0 Merge branch 'devel' of devsam/core into master 2018-04-13 02:27:07 +09:00
153 changed files with 4128 additions and 1684 deletions
+1
View File
@@ -30,6 +30,7 @@ d_pic/*.png
d_setting/*.php
*/d_setting/*.php
*/d_setting/templates/*.php
**/old/*
test.php
+20 -37
View File
@@ -1,14 +1,16 @@
@charset "utf-8";
* { margin: 0px; padding: 0px; }
body { color:white; background-color:black; border-width:1px; border-color:gray; }
body {
color:white; background-color:black; font-family: '맑은 고딕';
}
table {
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
padding: 0px;
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';
}
th, td {
border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
@@ -16,21 +18,15 @@ th, td {
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';
}
a.just_link {
text-decoration: none;
}
div {
margin:0px;
padding: 0px;
word-break: break-all;
font-family: '맑은 고딕';
}
.with_border{
margin:0;
border: solid 1px;
border-spacing: 0px;
border-collapse: separate;
@@ -45,6 +41,8 @@ div {
line-height:50px;
font-size: 30px; font-weight: bold;
text-align: center;
color:white;
padding:0;
}
.legacy_layout div {
@@ -53,20 +51,9 @@ div {
font-size: 13px;
word-break: break-all;
text-align: center;
font-family: '맑은 고딕'; line-height: 110%;
font-family: '맑은 고딕';;
}
font { font-family: '맑은 고딕'; line-height: 110%; }
/*
input {
width: 100px; height: 18px;
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
*/
.obj_fill{
display:block;
width:100%;
@@ -77,28 +64,20 @@ button.with_skin {
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
button.with_skin:disabled {
background-color:#333333;
}
input.with_skin {
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
select {
width: 100px; height: 18px;
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
line-height: 110%;
}
button {
width: 100px; height: 20px;
background-color: black; color: white;
font-family: '맑은 고딕';
font-size: 13px;
input.with_skin:disabled {
background-color: #333333;
}
.font0 { font-size: 10px; }
@@ -107,3 +86,7 @@ button {
.font3 { font-size: 20px; }
.font4 { font-size: 30px; }
.font5 { font-size: 50px; }
caption.section_title {
caption-side:top;
}
+4 -92
View File
@@ -1,5 +1,9 @@
@charset "utf-8";
body{
line-height: 1.3;
}
#server_notice {
margin:10px 0;
border: none;
@@ -55,77 +59,6 @@
text-align:center;
}
/*Legacy*/
#Entrance_00 {
width: 800px;
position: absolute; top: 50px; left: 50%;
margin-left: -400px;
border: none;
}
#Entrance_0004 {
width: 52px; height: 52px;
position: absolute; top: 0px; left: -62px;
border: 1px solid white;
}
#Entrance_0005 {
width: 160px; height: 600px;
position: absolute; top: 62px; left: -170px;
}
#Entrance_0006 {
width: 160px; height: 600px;
position: absolute; top: 62px; left: 810px;
}
#Entrance_0000 {
width: 800px; height: 134px;
position: absolute; top: 0px; left: 0px;
}
#Entrance_000000 {
width: 798px; height: 50px;
position: absolute; top: 0px; left: 0px;
font-size: 30px; font-weight: bold;
}
#Entrance_000001 {
width: 798px; height: 20px;
position: absolute; top: 52px; left: 0px;
border: none;
}
#Entrance_00000000 {
width: 98px; height: 20px;
position: absolute; top: 0px; left: 0px;
}
#Entrance_00000001 {
width: 398px; height: 20px;
position: absolute; top: 0px; left: 100px;
}
#Entrance_00000002 {
width: 178px; height: 20px;
position: absolute; top: 0px; left: 500px;
}
#Entrance_00000003 {
width: 118px; height: 20px;
position: absolute; top: 0px; left: 680px;
}
#Entrance_000002 {
width: 798px; height: 64px;
position: absolute; top: 74px; left: 0px;
border: none;
}
.Entrance_ServerList {
width: 800px; height: 64px;
border: none;
@@ -198,24 +131,3 @@
.Entrance_Hwe {
color: red; font-size: 15px; font-weight: bold;
}
#Entrance_0001 {
width: 800px; height: 130px;
position: absolute; top: 154px; left: 0px;
}
#Entrance_000100 {
width: 798px; height: 50px;
position: absolute; top: 0px; left: 0px;
font-size: 30px; font-weight: bold;
}
#Entrance_000101 {
width: 200px; height: 50px;
position: absolute; top: 65px; left: 150px;
}
#Entrance_000102 {
width: 200px; height: 50px;
position: absolute; top: 65px; left: 450px;
}
+42 -1
View File
@@ -62,8 +62,21 @@ input::-webkit-input-placeholder {
}
.col-form-label{
text-align:center;
}
.terms{
max-height: 200px; overflow: auto;
max-height: 200px; overflow-y: auto;
}
.terms pre{
width:100%;
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
.vertical-center {
@@ -73,3 +86,31 @@ input::-webkit-input-placeholder {
display: flex;
align-items: center;
}
#btn_kakao_login{
cursor: pointer;
height:46px;
width:116px;
background-color: transparent;
color:transparent;
border:0;
background-size: 100%; /* To fill the dimensions of container (button), or */
background-repeat: no-repeat;
background-position: bottom center;
margin-top:5px;
background-image:url('../oauth_kakao/kakao_login_join.png');
}
#btn_kakao_login:hover {
background-image:url('../oauth_kakao/kakao_login_join_ov.png');
}
#bottom_box{
position:fixed;
bottom:0;
width:100%;
left:0;
}
#bottom_box .container{
text-align:center;
}
+10 -172
View File
@@ -21,6 +21,7 @@
right: 6px;
margin:6px;
height:40px;
line-height:40px;
}
#btn_delete_me{
@@ -37,15 +38,15 @@
#image_upload_filename{
position:absolute;
height:16px;
height:20px;
left:10px;
width:130px;
top:16px;
top:12px;
}
#image_upload_fake_btn{
top:16px;
height:20px;
top:12px;
height:22px;
right:10px;
position:absolute;
}
@@ -53,8 +54,7 @@
#image_upload{
opacity: 0;
position:absolute;
top:16px;
height:22px;
top:12px;
left:0;
height:20px;
width:100%;
@@ -70,7 +70,6 @@
bottom:0;
left:0;
width:50%;
height:20px;
}
#btn_remove_icon{
@@ -78,171 +77,10 @@
bottom:0;
right:0;
width:50%;
height:20px;
}
#EntranceManage_00 {
width: 500px; height: 409px;
z-index: 2;
}
#EntranceManage_0000 {
width: 498px; height: 50px;
}
#EntranceManage_0001 {
width: 100px; height: 30px;
}
#EntranceManage_0002 {
width: 498px; height: 25px;
}
#EntranceManage_0003 {
width: 98px; height: 84px;
line-height: 84px;
}
#EntranceManage_0004 {
width: 148px; height: 84px;
line-height: 84px;
}
#EntranceManage_0005 {
width: 98px; height: 84px;
line-height: 84px;
}
#EntranceManage_0006 {
width: 148px; height: 84px;
text-align: left;
}
#EntranceManage_000600 {
width: 80px; height: 17px;
}
#EntranceManage_000601 {
width: 80px; height: 17px;
}
#EntranceManage_000602 {
width: 80px; height: 17px;
}
#EntranceManage_000603 {
width: 144px; height: 20px;
}
#EntranceManage_0007 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0008 {
width: 148px; height: 64px;
line-height: 64px;
}
#EntranceManage_0009 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0010 {
width: 148px; height: 64px;
line-height: 64px;
}
#EntranceManage_0011 {
width: 98px; height: 20px;
}
#EntranceManage_0012 {
width: 148px; height: 20px;
}
#EntranceManage_0013 {
width: 248px; height: 20px;
}
#EntranceManage_0014 {
width: 98px; height: 64px;
line-height: 64px;
}
#EntranceManage_0015 {
width: 148px; height: 64px;
}
#EntranceManage_001500 {
width: 64px; height: 64px;
}
#EntranceManage_001501 {
width: 64px; height: 64px;
}
#EntranceManage_0016 {
width: 248px; height: 64px;
}
#EntranceManage_001600 {
width: 100px; height: 16px;
display: none;
}
#EntranceManage_001601 {
width: 70px; height: 20px;
}
#EntranceManage_001602 {
width: 85px; height: 20px;
}
#EntranceManage_001603 {
width: 85px; height: 20px;
}
#EntranceManage_0017 {
width: 98px; height: 100px;
line-height: 100px;
}
#EntranceManage_0018 {
width: 398px; height: 100px;
text-align: left;
}
#EntranceManage_0019 {
width: 149px; height: 20px;
}
#EntranceManage_0020 {
width: 500px; height: 20px;
border: none;
}
#EntranceManage_002000 {
width: 500px;
}
#EntranceManage_00200000 {
width: 498px; height: 20px;
}
.EntranceManage_Sequence {
width: 48px; height: 20px;
}
.EntranceManage_Date {
width: 148px; height: 20px;
}
.EntranceManage_Amount {
width: 148px; height: 20px;
}
.EntranceManage_Cumul {
width: 148px; height: 20px;
#third_use_disallow{
display:none;
margin-left:10px;
width:40px;
}
+5 -1
View File
@@ -2,11 +2,14 @@
namespace sammo;
define('ROOT', realpath(__dir__.'/..'));
date_default_timezone_set('Asia/Seoul');
mb_internal_encoding("UTF-8");
mb_http_output('UTF-8');
mb_regex_encoding('UTF-8');
ini_set("session.cache_expire", 10080); // minutes
ini_set("session.gc_maxlifetime", 604800); // seconds
function getFriendlyErrorType($type)
{
switch($type)
@@ -79,6 +82,7 @@ function logExceptionByCustomHandler(\Throwable $e){
], Json::PRETTY);
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
echo $e->getTraceAsString();
throw $e;
}
set_exception_handler('\\sammo\\logExceptionByCustomHandler');
+7
View File
@@ -216,6 +216,13 @@ $result = Util::generateFileUsingSimpleTemplate(
true
);
$result = Util::generateFileUsingSimpleTemplate(
__dir__.'/templates/menu.orig.js',
ROOT.'/d_shared/menu.js',
[],
true
);
if ($result !== true) {
Json::die([
'result'=>false,
+11
View File
@@ -2,6 +2,7 @@
DROP TABLE IF EXISTS `system`;
DROP TABLE IF EXISTS `member`;
DROP TABLE IF EXISTS `member_log`;
DROP TABLE IF EXISTS `config`;
-- 시스템 테이블
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
@@ -25,6 +26,7 @@ CREATE TABLE `member` (
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
`PW` CHAR(128) NOT NULL,
`salt` CHAR(16) NOT NULL,
`third_use` INT(1) NOT NULL DEFAULT '0',
`NAME` VARCHAR(64) NOT NULL,
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
`IMGSVR` INT(1) NULL DEFAULT '0',
@@ -54,3 +56,12 @@ CREATE TABLE `member_log` (
INDEX `member` (`member_no`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
CREATE TABLE `config` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`key` VARCHAR(50) NOT NULL,
`value` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `key` (`key`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+8
View File
@@ -0,0 +1,8 @@
window.sammo_menu = [
['/bbs/board', '삼모게시판', '_blank'],
['/bbs/tip', '팁/강좌', '_blank'],
['/bbs/news', '삼국 일보', '_blank'],
['/bbs/history2', '개인 열전', '_blank'],
['/bbs/history3', '국가 열전', '_blank'],
['/bbs/patch', '패치 내역', '_blank']
];
+1 -1
View File
@@ -5,7 +5,7 @@ include "lib.php";
include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) {
if($session->userGrade < 4) {
?><!DOCTYPE html>
<!DOCTYPE html>
<html>
+1 -1
View File
@@ -6,7 +6,7 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5){
if($session->userGrade < 4){
header('location:_119.php');
die();
}
+17 -21
View File
@@ -24,6 +24,8 @@ if(!$generalID){
$db = DB::db();
$connect=$db->get();
$src = MessageTarget::buildQuick($session->generalID);
switch($btn) {
case "전체 접속허용":
$db->update('general', [
@@ -96,12 +98,10 @@ switch($btn) {
break;
case "특기 부여":
list($year, $month) = $db->queryFirstList('select `year`, `month` from `game` where `no`=1');
$src = MessageTarget::buildQuick($session->generalID);
$text = "특기 부여!";
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
$specialWar = SpecialityConst::pickSpecialWar($general);
@@ -116,10 +116,9 @@ switch($btn) {
break;
case "경험치1000":
$src = MessageTarget::buildQuick($session->generalID);
$text = $btn." 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -128,10 +127,9 @@ switch($btn) {
break;
case "공헌치1000":
$src = MessageTarget::buildQuick($session->generalID);
$text = $btn." 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -140,10 +138,9 @@ switch($btn) {
break;
case "보숙10000":
$src = MessageTarget::buildQuick($session->generalID);
$text = "보병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -151,10 +148,9 @@ switch($btn) {
], '`no` IN %li', $genlist);
break;
case "궁숙10000":
$src = MessageTarget::buildQuick($session->generalID);
$text = "궁병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -165,7 +161,7 @@ switch($btn) {
$src = MessageTarget::buildQuick($session->generalID);
$text = "기병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -176,7 +172,7 @@ switch($btn) {
$src = MessageTarget::buildQuick($session->generalID);
$text = "귀병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -187,7 +183,7 @@ switch($btn) {
$src = MessageTarget::buildQuick($session->generalID);
$text = "차병숙련도+10000 지급!";
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
$db->update('general',[
@@ -195,19 +191,19 @@ switch($btn) {
], '`no` IN %li', $genlist);
break;
case "접속 허용":
$db->update('genera',[
$db->update('general',[
'con'=>0
], '`no` IN %li', $genlist);
break;
case "접속 제한":
$db->update('genera',[
$db->update('general',[
'con'=>1000
], '`no` IN %li', $genlist);
break;
case "메세지 전달":
$text = $msg;
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
break;
@@ -221,7 +217,7 @@ switch($btn) {
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
@@ -245,7 +241,7 @@ switch($btn) {
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
@@ -269,7 +265,7 @@ switch($btn) {
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
@@ -293,7 +289,7 @@ switch($btn) {
}
foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new DateTime(), new DateTime('9999-12-31'), []);
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true);
}
-1
View File
@@ -1630,7 +1630,6 @@ if($isgen == "장수공격" || $isgen == "성벽공격") {
</table>
</form>
</body>
<?php PrintElapsedTime(); ?>
</html>
<?php
+1 -2
View File
@@ -36,7 +36,7 @@ if ($con >= 2) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명장일람</title>
<title><?=UniqueConst::$serverName?>: 명장일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -344,7 +344,6 @@ for ($i=0; $i < 4; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -201,7 +201,6 @@ if ($select == 0) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -18,7 +18,7 @@ increaseRefresh("왕조일람", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -202,7 +202,6 @@ if ($select == 0) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -41,7 +41,7 @@ if ($type <= 0 || $type > 15) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>장수일람</title>
<title><?=UniqueConst::$serverName?>: 장수일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript" src="../e_lib/jquery-3.2.1.min.js"></script>
@@ -194,7 +194,6 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
<script type="text/javascript">
$(document).ready(function() {
$("#viewType").val("<?=$type?>").attr("selected", "selected");
+1 -2
View File
@@ -14,7 +14,7 @@ increaseRefresh("명예의전당", 2);
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명예의 전당</title>
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -118,7 +118,6 @@ for ($i=0; $i < 21; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -4
View File
@@ -15,13 +15,13 @@ $userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("연감", 5);
increaseRefresh("연감", 2);
$query = "select startyear,year,month,conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$query = "select map,con,turntime from general where owner='{$userID}'";
$query = "select con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
@@ -77,7 +77,7 @@ if ($month <= 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>연감</title>
<title><?=UniqueConst::$serverName?>: 연감</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
@@ -159,6 +159,5 @@ reloadWorldMap({
neutralView:true
});
</script>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -28,7 +28,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력일람</title>
<title><?=UniqueConst::$serverName?>: 세력일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -248,7 +248,6 @@ echo"
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -26,7 +26,7 @@ $sel[$type] = "selected";
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>빙의일람</title>
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -124,7 +124,6 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+3 -4
View File
@@ -17,7 +17,7 @@ $query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select map,con,turntime from general where owner='{$userID}'";
$query = "select con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -29,7 +29,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>세력도</title>
<title><?=UniqueConst::$serverName?>: 세력도</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
@@ -67,7 +67,7 @@ $(function(){
</tr>
<tr>
<td colspan=2 valign=top>
<?php getWorldHistoryRecent(34); ?>
<?=getWorldHistoryRecent(34)?>
</td>
</tr>
</table>
@@ -75,7 +75,6 @@ $(function(){
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+11 -12
View File
@@ -22,15 +22,15 @@ $refresh = [];
$online = [];
$curonline = getOnlineNum();
$visibleLogs = min(11, count($log));
for ($i=0; $i < $visibleLogs; $i++) {
$parse = explode("|", $log[count($log)-$visibleLogs+$i]);
$date[$i] = trim($parse[0]);
$year[$i] = trim($parse[1]);
$month[$i] = trim($parse[2]);
$refresh[$i] = trim($parse[3]);
$online[$i] = trim($parse[4]);
foreach($log as $i=>$value){
$parse = Json::decode($value);
$date[$i] = $parse[0];
$year[$i] = $parse[1];
$month[$i] = $parse[2];
$refresh[$i] = $parse[3];
$online[$i] = $parse[4];
}
if ($game['maxrefresh'] == 0) {
$game['maxrefresh'] = 1;
}
@@ -47,7 +47,7 @@ if ($game['maxonline'] < $curonline) {
<!DOCTYPE html>
<html>
<head>
<title>트래픽정보</title>
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -63,7 +63,7 @@ if ($game['maxonline'] < $curonline) {
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
<?php
for ($i=0; $i < $visibleLogs; $i++) {
foreach($log as $i=>$value){
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
if ($w >= 100) {
$w -= 0.1;
@@ -133,7 +133,7 @@ $dt = date('H:i');
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
<?php
for ($i=0; $i < $visibleLogs; $i++) {
foreach($log as $i=>$value){
$w = round($online[$i] / $game['maxonline'] * 100, 1);
if ($w >= 100) {
$w -= 0.1;
@@ -264,7 +264,6 @@ for ($i=0; $i < $count; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+20 -16
View File
@@ -28,7 +28,7 @@ if ($vote[0] == "") {
<!DOCTYPE html>
<html>
<head>
<title>설문조사</title>
<title><?=UniqueConst::$serverName?>: 설문조사</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -198,22 +198,19 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
<tr>
";
$memCount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
if ($memCount == 0) {
$memCount = 1;
}
$memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
$totalVote = [];
$nationVoteCount = [[0]];
$nationVote = [[]];
$nationVoteCount = [];
$nationVote = [];
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
$nation = $row['nation'];
$vote = $row['vote'];
$ownVote = $row['vote'];
$cnt = $row['cnt'];
if (!isset($totalVote[$vote])) {
$totalVote[$vote] = 0;
if (!isset($totalVote[$ownVote])) {
$totalVote[$ownVote] = 0;
}
if (!isset($nationVoteCount[$nation])) {
@@ -221,17 +218,17 @@ if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
$nationVote[$nation] = [];
}
if (!isset($nationVote[$nation][$vote])) {
$nationVote[$nation][$vote] = 0;
if (!isset($nationVote[$nation][$ownVote])) {
$nationVote[$nation][$ownVote] = 0;
}
$totalVote[$vote] += $cnt;
$totalVote[$ownVote] += $cnt;
$nationVoteCount[$nation] += $cnt;
$nationVote[$nation][$vote] += $cnt;
$nationVote[$nation][$ownVote] += $cnt;
}
for ($i=0; $i < $voteTypeCount; $i++) {
$per = round(($totalVote[$i]??0) / $memCount * 100, 1);
$per = round(($totalVote[$i]??0) * 100 / $memCount, 1);
// if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
@@ -293,8 +290,16 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$memCount = MYDB_num_rows($result);
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
if($memCount == 0){
$percentage = 100;
}
else{
$percentage = round($voteCount / $memCount * 100, 1);
}
echo "
<tr>
@@ -328,7 +333,6 @@ if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -58,7 +58,7 @@ if ($msg2 == "") {
<!DOCTYPE html>
<html>
<head>
<title>거래장</title>
<title><?=UniqueConst::$serverName?>: 거래장</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -299,6 +299,5 @@ for ($i=0; $i < $count; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+22 -7
View File
@@ -75,7 +75,7 @@ $sel[$type] = "selected";
<html>
<head>
<title>감찰부</title>
<title><?=UniqueConst::$serverName?>: 감찰부</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -100,20 +100,23 @@ $sel[$type] = "selected";
<?php
switch ($type) {
default:
case 0: $query = "select no,name from general where nation='{$me['nation']}' order by turntime desc"; break;
case 1: $query = "select no,name from general where nation='{$me['nation']}' order by recwar desc"; break;
case 2: $query = "select no,name from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
case 3: $query = "select no,name from general where nation='{$me['nation']}' order by warnum desc"; break;
case 0: $query = "select no,name,npc from general where nation='{$me['nation']}' order by turntime desc"; break;
case 1: $query = "select no,name,npc from general where nation='{$me['nation']}' order by recwar desc"; break;
case 2: $query = "select no,name,npc from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
case 3: $query = "select no,name,npc from general where nation='{$me['nation']}' order by warnum desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($result);
$npc = 0;
for ($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수
if ($gen == 0) {
$gen = $general['no'];
}
if($gen == $general['no']){
$npc = $general['npc'];
}
if ($gen == $general['no']) {
echo "
<option selected value={$general['no']}>{$general['name']}</option>";
@@ -153,11 +156,23 @@ for ($i=0; $i < $gencount; $i++) {
<?=getBatResRecent($gen, 24)?>
</td>
</tr>
<?php if($npc > 1): ?>
<tr>
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>&nbsp;</font></td>
</tr>
<tr>
<td valign=top>
<?=getGenLogRecent($gen, 24)?>
</td>
<td valign=top>
</td>
</tr>
<?php endif; ?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+41 -14
View File
@@ -37,7 +37,13 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
$str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime();
if($str2){
$str2 = ', '.$str2;
}
$str3 = getTournamentTerm();
if($str3){
$str3 = ', '.$str3;
}
?>
<!DOCTYPE html>
@@ -47,13 +53,13 @@ $str3 = getTournamentTerm();
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>베팅장</title>
<title><?=UniqueConst::$serverName?>: 베팅장</title>
<style>
body { color:white; background-color:black; border-width:1px; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
table { font-family:'맑은 고딕';}
font { font-family:'맑은 고딕';}
input { font-family:'맑은 고딕';height:20px }
select { font-family:'굴림'; }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
@@ -67,7 +73,7 @@ select { font-family:'굴림'; line-height:100%; }
</table>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet']?> / 내 투자 금액 : <?=$me['bet']?>)</font></td></tr>
</table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10px;word-break:break-all; id=bg0>
@@ -77,7 +83,11 @@ select { font-family:'굴림'; line-height:100%; }
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
for ($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -102,7 +112,11 @@ for ($i=0; $i < 1; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -143,7 +157,11 @@ for ($i=0; $i < 2; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -184,7 +202,11 @@ for ($i=0; $i < 4; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -225,7 +247,11 @@ for ($i=0; $i < 8; $i++) {
$cent[$i] = "<font color=white>";
}
for ($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result);
$general = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'win'=>0
];
if ($general['name'] == "") {
$general['name'] = "-";
}
@@ -268,10 +294,12 @@ for ($i=0; $i < 16; $i++) {
}
for ($i=0; $i < 16; $i++) {
$bet[$i] = @round($admin['bet'] / $admin["bet{$i}"], 2);
if ($bet[$i] == 0) {
if($admin["bet{$i}"] == 0){
$bet[$i] = "∞";
}
else{
$bet[$i] = round($admin['bet'] / $admin["bet{$i}"], 2);
}
}
for ($i=0; $i < 16; $i++) {
@@ -405,6 +433,5 @@ for ($i=0; $i < 4; $i++) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -25,7 +25,7 @@ if($me['level'] < 5) {
<!DOCTYPE html>
<html>
<head>
<title>기밀실</title>
<title><?=UniqueConst::$serverName?>: 기밀실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -69,7 +69,6 @@ for($i=0; $i < 20; $i++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+14 -11
View File
@@ -58,13 +58,24 @@ $nation = MYDB_fetch_array($result);
$lv = getNationChiefLevel($nation['level']);
$turn = [];
$gen = [[],[],[],[],[],[],[],[],[],[],[],[]];
for($i=12; $i >= $lv; $i--) {
$turn[$i] = getCoreTurn($nation, $i);
$query = "select name,turntime,npc from general where level={$i} and nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen[$i] = MYDB_fetch_array($result);
$gen[$i] = MYDB_fetch_array($result)??[
'npc'=>0,
'name'=>'',
'turntime'=>''
];
}
for($i= $lv - 1; $i>=5; $i--){
$gen[$i] = [
'npc'=>0,
'name'=>'',
'turntime'=>''
];
}
?>
@@ -72,7 +83,7 @@ for($i=12; $i >= $lv; $i--) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>사령부</title>
<title><?=UniqueConst::$serverName?>: 사령부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript">
@@ -110,13 +121,6 @@ for($i=12; $i >= $lv; $i--) {
for($k=0; $k < 2; $k++) {
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $k;
if(!isset($gen[$l4])){
$gen[$l4] = [
'npc'=>0,
'name'=>0
];
}
if ($gen[$l4]['npc'] >= 2) { $gen[$l4]['name'] = "<font color=cyan>".($gen[$l4]['name']??'')."</font>"; }
elseif($gen[$l4]['npc'] == 1) { $gen[$l4]['name'] = "<font color=skyblue>".($gen[$l4]['name']??'')."</font>"; }
if ($gen[$l3]['npc'] >= 2) { $gen[$l3]['name'] = "<font color=cyan>".($gen[$l3]['name']??'')."</font>"; }
@@ -188,7 +192,6 @@ for($k=0; $k < 2; $k++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+144 -120
View File
@@ -25,24 +25,39 @@ $query = "select nation,level,spy from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result);
$templates = new \League\Plates\Engine('templates');
?>
<!DOCTYPE html>
<html>
<head>
<title>도시정보</title>
<title><?=UniqueConst::$serverName?>: 도시정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link href="../d_shared/common.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<style>
#general_list tr td{
text-align:center;
}
#general_list tr td:last-child{
text-align:left;
padding-left:1em;
}
.general_turn_text{
font-size:x-small;
}
</style>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td>도 시 정 보<br><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr>
<td width=998>
<form name=cityselect method=get>도시선택 :
@@ -160,44 +175,44 @@ if($city['trade'] == 0) {
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg2>
<tr>
<td colspan=12 align=center style=color:"<?=newColor($nation['color'])?>"; bgcolor=<?=$nation['color']?>>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
</tr>
<tr>
<td align=center width=48 id=bg1>주민</td>
<td align=center width=48 class=bg1>주민</td>
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
<td align=center width=48 id=bg1>농업</td>
<td align=center width=48 class=bg1>농업</td>
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
<td align=center width=48 id=bg1>상업</td>
<td align=center width=48 class=bg1>상업</td>
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
<td align=center width=48 id=bg1>치안</td>
<td align=center width=48 class=bg1>치안</td>
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
<td align=center width=48 id=bg1>수비</td>
<td align=center width=48 class=bg1>수비</td>
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
<td align=center width=48 id=bg1>성벽</td>
<td align=center width=48 class=bg1>성벽</td>
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
</tr>
<tr>
<td align=center id=bg1>민심</td>
<td align=center class=bg1>민심</td>
<td align=center><?=$city['rate']?></td>
<td align=center id=bg1>시세</td>
<td align=center class=bg1>시세</td>
<td align=center><?=$city['trade']?>%</td>
<td align=center id=bg1>인구</td>
<td align=center class=bg1>인구</td>
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
<td align=center id=bg1>태수</td>
<td align=center class=bg1>태수</td>
<td align=center><?=$gen1['name']??'-'?></td>
<td align=center id=bg1>군사</td>
<td align=center class=bg1>군사</td>
<td align=center><?=$gen2['name']??'-'?></td>
<td align=center id=bg1>시중</td>
<td align=center class=bg1>시중</td>
<td align=center><?=$gen3['name']??'-'?></td>
</tr>
<tr>
<td align=center id=bg1>장수</td>
<td align=center class=bg1>장수</td>
<td colspan=11>
<?php
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
@@ -212,6 +227,26 @@ if($city['trade'] == 0) {
</td>
</tr>
</table>
<br>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<thead>
<tr>
<td width=64 align=center class=bg1>얼 굴</td>
<td width=98 align=center class=bg1>이 름</td>
<td width=48 align=center class=bg1>통솔</td>
<td width=48 align=center class=bg1>무력</td>
<td width=48 align=center class=bg1>지력</td>
<td width=78 align=center class=bg1>관 직</td>
<td width=28 align=center class=bg1>守</td>
<td width=78 align=center class=bg1>병 종</td>
<td width=78 align=center class=bg1>병 사</td>
<td width=48 align=center class=bg1>훈련</td>
<td width=48 align=center class=bg1>사기</td>
<td width=310 align=center class=bg1>명 령</td>
</tr></thead><tbody class='bg0' id='general_list'>
<?php
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -224,127 +259,116 @@ foreach(getAllNationStaticInfo() as $nation){
$nationlevel[$nation['nation']] = $nation['level'];
}
if($gencount != 0) {
echo "
<br>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width=64 align=center id=bg1>얼 굴</td>
<td width=98 align=center id=bg1>이 름</td>
<td width=48 align=center id=bg1>통솔</td>
<td width=48 align=center id=bg1>무력</td>
<td width=48 align=center id=bg1>지력</td>
<td width=78 align=center id=bg1>관 직</td>
<td width=28 align=center id=bg1>守</td>
<td width=78 align=center id=bg1>병 종</td>
<td width=78 align=center id=bg1>병 사</td>
<td width=48 align=center id=bg1>훈련</td>
<td width=48 align=center id=bg1>사기</td>
<td width=310 align=center id=bg1>명 령</td>
</tr>";
}
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nationInfo = getNationStaticInfo($general['nation']);
if($general['nation'] != 0 && $general['nation'] == $myNation['nation']){
$ourGeneral = true;
}
else{
$ourGeneral = false;
}
$isNPC = $general['npc']>1;
$wounded = $general['injury'];
$name = $general['name'];
$nameText = formatName($name, $general['npc']);
$leadership = $general['leader'];
$power = $general['power'];
$intel = $general['intel'];
$leadershipText = formatWounded($leadership, $general['injury']);
$powerText = formatWounded($power, $general['injury']);
$intelText = formatWounded($intel, $general['injury']);
$level = $general['level'];
$levelText = getLevel($general['level']);
if($general['level'] == 12) {
$lbonus = $nationlevel[$general['nation']] * 2;
$leadershipBonus = $nationInfo['level'] * 2;
} elseif($general['level'] >= 5) {
$lbonus = $nationlevel[$general['nation']];
$leadershipBonus = $nationInfo['level'];
} else {
$lbonus = 0;
$leadershipBonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
$leadershipBonusText = formatLeadershipBonus($leadershipBonus);
if($ourGeneral){
$defenceMode = $general['mode'];
$defenceModeText = formatDefenceMode($defenceMode);
$crewType = $general['crewtype'];
$crewTypeText = GameUnitConst::byId($crewType)->name;
$crew = $general['crew'];
$train = $general['train'];
$atmos = $general['atmos'];
}
else{
$defenceMode = 0;
$defenceModeText = '';
$crewType = 0;
$crewTypeText = '';
$crew = $general['crew'];
$train = -1;
$atmos = -1;
}
if($general['injury'] > 0) {
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
$leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>";
} else {
$leader = "{$general['leader']}{$lbonus}";
$power = "{$general['power']}";
$intel = "{$general['intel']}";
$nation = $general['nation'];
$nationName = $nationInfo['name'];
if($ourGeneral && !$isNPC){
$turnText = [];
foreach(getTurn($general, 1) as $turnRawIdx=>$turn){
$turnIdx = $turnRawIdx+1;
$turnText[] = "{$turnIdx} : $turn";
}
$turnText = join('<br>', $turnText);
}
else{
$turnText = '';
}
if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>{$general['name']}</font>"; }
elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>{$general['name']}</font>"; }
$imageTemp = GetImageURL($general['imgsvr']);
echo "
<tr>
<td align=center height=64></td>
<td align=center>{$general['name']}</td>
<td align=center>$leader</td>
<td align=center>$power</td>
<td align=center>$intel</td>
<td align=center>".getLevel($general['level'])."</td>";
//아국장수이거나 보는 사람이 운영자일때 보여줌
if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || $session->userGrade >= 5) {
switch($general['mode']) {
case 0: $mode = "×"; break;
case 1: $mode = "○"; break;
case 2: $mode = "◎"; break;
}
echo "
<td align=center>$mode</td>
<td align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
<td align=center>{$general['crew']}</td>
<td align=center>{$general['train']}</td>
<td align=center>{$general['atmos']}</td>";
if($general['npc'] >= 2) {
echo "
<td>NPC 장수";
} else {
echo "
<td>
<font size=1>";
$turn = getTurn($general, 1);
for($i=0; $i < 4; $i++) {
$k = $i+1;
echo "
&nbsp;&nbsp;$k : $turn[$i]<br>";
}
echo "
</font>";
}
} elseif($general['nation'] != 0) {
echo "
<td align=center>?</td>
<td align=center>?</td>
<td align=center>{$general['crew']}</td>
<td align=center>?</td>
<td align=center>?</td>
<td>【{$nationname[$general['nation']]}】 장수";
} else {
echo "
<td align=center>?</td>
<td align=center>?</td>
<td align=center>{$general['crew']}</td>
<td align=center>?</td>
<td align=center>?</td>
<td>&nbsp; 재 야";
}
echo "
</td>
</tr>";
echo $templates->render('cityGeneral', [
'ourGeneral'=>$ourGeneral,
'isNPC'=>$isNPC,
'wounded'=>$wounded,
'name'=>$name,
'nameText'=>$nameText,
'leadership'=>$leadership,
'leadershipText'=>$leadershipText,
'leadershipBonus'=>$leadershipBonus,
'leadershipBonusText'=>$leadershipBonusText,
'level'=>$level,
'levelText'=>$levelText,
'power'=>$power,
'powerText'=>$powerText,
'intel'=>$intel,
'intelText'=>$intelText,
'defenceMode'=>$defenceMode,
'defenceModeText'=>$defenceModeText,
'crewType'=>$crewType,
'crewTypeText'=>$crewTypeText,
'crew'=>$crew,
'train'=>$train,
'atmos'=>$atmos,
'nation'=>$nation,
'nationName'=>$nationName,
'turnText'=>$turnText
]);
}
?>
</tbody>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+43 -47
View File
@@ -48,27 +48,27 @@ if ($me['level'] >= 5) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내무부</title>
<title><?=UniqueConst::$serverName?>: 내무부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td>내 무 부<br><?=backButton()?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
<tr>
<td width=100 align=center id=bg1>국 가 명</td>
<td width=50 align=center id=bg1>국력</td>
<td width=40 align=center id=bg1>장수</td>
<td width=40 align=center id=bg1>속령</td>
<td width=80 align=center id=bg1>상태</td>
<td width=60 align=center id=bg1>기간</td>
<td width=100 align=center id=bg1>종 료 시 점</td>
<td align=center id=bg1>비 고</td>
<td width=100 align=center class=bg1>국 가 명</td>
<td width=50 align=center class=bg1>국력</td>
<td width=40 align=center class=bg1>장수</td>
<td width=40 align=center class=bg1>속령</td>
<td width=80 align=center class=bg1>상태</td>
<td width=60 align=center class=bg1>기간</td>
<td width=100 align=center class=bg1>종 료 시 점</td>
<td align=center class=bg1>비 고</td>
</tr>
<?php
$query = "select year,month from game limit 1";
@@ -220,65 +220,62 @@ if ($budgetricediff > 0) {
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<form name=form1 method=post action=c_dipcenter.php>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메세지</td></tr>
<tr><td colspan=2 id=bg1>국가 방침 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=msg value='<?=$nation['msg']?>'><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=1000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=500 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=green>예 산 &amp; 정 책</td></tr>
<tr>
<td colspan=2>
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<?php
echo "
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr>
<td colspan=2 align=center id=bg1>자금 예산</td>
<td colspan=2 align=center id=bg1>병량 예산</td>
<td colspan=2 align=center class=bg1>자금 예산</td>
<td colspan=2 align=center class=bg1>병량 예산</td>
</tr>
<tr>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>{$nation['gold']}</td>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>{$nation['rice']}</td>
<td width=248 align=right class=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center><?=$nation['gold']?></td>
<td width=248 align=right class=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center><?=$nation['rice']?></td>
</tr>
<tr>
<td align=right id=bg1>단기수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$deadIncome</td>
<td align=right id=bg1>둔전수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincomeList[1]</td>
<td align=right class=bg1>단기수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$deadIncome?></td>
<td align=right class=bg1>둔전수입&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincomeList[1]?></td>
</tr>
<tr>
<td align=right id=bg1>세 금&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$goldincomeList[0]</td>
<td align=right id=bg1>세 곡&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincomeList[0]</td>
<td align=right class=bg1>세 금&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$goldincomeList[0]?></td>
<td align=right class=bg1>세 곡&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincomeList[0]?></td>
</tr>
<tr>
<td align=right id=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$goldincome / -$goldoutcome</td>
<td align=right id=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+$riceincome / -$riceoutcome</td>
<td align=right class=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$goldincome?> / -<?=$goldoutcome?></td>
<td align=right class=bg1>수입 / 지출&nbsp;&nbsp;&nbsp;</td>
<td align=center>+<?=$riceincome?> / -<?=$riceoutcome?></td>
</tr>
<tr>
<td align=right id=bg1>국고 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
<td align=right id=bg1>병량 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center>{$budgetrice} ({$budgetricediff})</td>
</tr>";
?>
<td align=right class=bg1>국고 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center><?=$budgetgold?> (<?=$budgetgolddiff?>)</td>
<td align=right class=bg1>병량 예산&nbsp;&nbsp;&nbsp;</td>
<td align=center><?=$budgetrice?> (<?=$budgetricediff?>)</td>
</tr>
<tr>
<td align=right id=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn?> name=btn value=세율></td>
<td align=right id=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급율></td>
</tr>
<tr>
<td align=right id=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td>
<td align=right class=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read?> name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['secretlimit']?>>년 <input type=<?=$btn?> name=btn value=기밀권한></td>
<td align=right id=bg1>임관&전쟁 변경 가능</td>
<td align=right class=bg1>임관&amp;전쟁 변경 가능</td>
<td align=center>무제한</td>
</tr>
<tr>
@@ -307,10 +304,9 @@ if ($nation['war'] == 0) {
<tr><td colspan=2 height=10></td></tr>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; class=bg0>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+4 -5
View File
@@ -16,7 +16,7 @@ $query = "select turnterm from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,map from general where owner='{$userID}'";
$query = "select no,nation from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -78,7 +78,7 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>중원정보</title>
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
<script src="../e_lib/jquery-3.2.1.min.js"></script>
<script src="../d_shared/common_path.js"></script>
<script src="js/common.js"></script>
@@ -236,10 +236,10 @@ for($i=0; $i < $nationcount; $i++) {
<td width=698 height=420>
<?=getMapHtml()?>
</td>
<td width=98 valign=top><?=$nationStr?></td>
<td width=101 valign=top><?=$nationStr?></td>
<td width=78 valign=top><?=$powerStr?></td>
<td width=58 valign=top><?=$genStr?></td>
<td width=58 valign=top><?=$cityStr?></td>
<td width=55 valign=top><?=$cityStr?></td>
</tr>
</table>
<br>
@@ -248,6 +248,5 @@ for($i=0; $i < $nationcount; $i++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -54,7 +54,7 @@ $sel[$type] = "selected";
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>암행부</title>
<title><?=UniqueConst::$serverName?>: 암행부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -210,6 +210,5 @@ echo "
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+6 -2
View File
@@ -30,7 +30,7 @@ if($meLevel == 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>인사부</title>
<title><?=UniqueConst::$serverName?>: 인사부</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
<script type="text/javascript">
@@ -205,7 +205,10 @@ if($meLevel >= 5 && $nation['l11set'] == 0) {
$query = "select name,city from general where nation='{$me['nation']}' and level='11'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($general){
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
}
}
echo "
</td>
@@ -257,8 +260,10 @@ for($i=10; $i >= $lv; $i--) {
$query = "select name,city from general where nation='{$me['nation']}' and level={$i}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($general){
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
}
}
echo "</td></form>";
if($i % 2 == 1) { echo "</tr>"; }
}
@@ -504,6 +509,5 @@ for($j=0; $j < $citycount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력도시</title>
<title><?=UniqueConst::$serverName?>: 세력도시</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -192,7 +192,6 @@ for ($j=0; $j < $citycount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -37,7 +37,7 @@ $sel = [$type => "selected"];
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력장수</title>
<title><?=UniqueConst::$serverName?>: 세력장수</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -195,7 +195,6 @@ for($j=0; $j < $gencount; $j++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -26,7 +26,7 @@ if($me['level'] == 0) {
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력정보</title>
<title><?=UniqueConst::$serverName?>: 세력정보</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -160,7 +160,6 @@ echo"
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+33 -34
View File
@@ -5,16 +5,12 @@ include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$map = Util::getReq('map', 'int', 0);
$mode = Util::getReq('mode', 'int', 2);
$tnmt = Util::getReq('tnmt', 'int', 1);
$detachNPC = Util::getReq('detachNPC', 'bool');
extractMissingPostToGlobals();
if($map < 0 || $map > 2){
$map = 0;
}
if($mode < 0 || $mode > 2){
$mode = 2;
}
@@ -32,50 +28,57 @@ $connect=$db->get();
increaseRefresh("내정보", 1);
$query = "select myset from general where owner='{$userID}'";
$query = "select no,npc,mode,tnmt,myset from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
if ($me['myset'] > 0) {
$submit = 'submit';
} else {
$submit = 'hidden';
}
if ($btn == "설정저장" && $me['myset'] > 0) {
if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
if ($me['myset'] > 1) {
$submit = 'submit';
} else {
$submit = 'hidden';
}
$me['myset'] -= 1;
$db->update('general', [
'myset'=>$db->sqleval('myset-1'),
'map'=>$map,
'mode'=>$mode,
'tnmt'=>$tnmt
], 'owner=%i', $userID);
}
$query = "select no,map,mode,tnmt,myset from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
if($me['npc'] == 1 && $detachNPC){
$turnterm = $db->queryFirstField('SELECT turnterm FROM game LIMIT 1');
if($turnterm < 10){
$targetKillTurn = 30 / $turnterm;
}
else{
$targetKillTurn = 60 / $turnterm;
}
$db->update('general', [
'killturn'=>$targetKillTurn
], 'owner=%i AND npc=1', $userID);
$me['killturn']=$targetKillTurn;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내정보</title>
<title><?=UniqueConst::$serverName?>: 내정보</title>
<link href="../d_shared/common.css" rel="stylesheet">
<link rel=stylesheet href="css/common.css">
<script type="text/javascript">
function go(type) {
if(type == 0){
location.replace('c_vacation.php');
}
}
</script>
</head>
@@ -89,28 +92,25 @@ function go(type) {
<?php myInfo(); ?>
<?php myInfo2(); ?>
</td>
<td width=50% valign=top>
<td width=50% valign=top style="padding-left:4ch;">
<form name=form1 action=b_myPage.php method=post>
&nbsp;&nbsp;&nbsp;&nbsp;지도수준
<input type=radio name=map value=0 <?=$me['map']==0?"checked":""; ?>>상세
<input type=radio name=map value=1 <?=$me['map']==1?"checked":""; ?>>간단
<input type=radio name=map value=2 <?=$me['map']==2?"checked":""; ?>>생략
】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;토너먼트 【
토너먼트
<input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
<input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
】<br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;수비 【
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
수비 【
<input type=radio name=mode value=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
<input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
<input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
</form>
&nbsp;&nbsp;&nbsp;&nbsp;휴 가 신 청<br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=휴가신청 onclick='go(0)'>
휴 가 신 청<br>
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
빙의 해제용 삭턴 조절<br>
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>
</td>
</tr>
<tr>
@@ -142,7 +142,6 @@ function go(type) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -20,7 +20,7 @@ $me = MYDB_fetch_array($result);
<!DOCTYPE html>
<html>
<head>
<title>회의실</title>
<title><?=UniqueConst::$serverName?>: 회의실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -64,7 +64,6 @@ for($i=0; $i < 20; $i++) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+1 -2
View File
@@ -15,7 +15,7 @@ increaseRefresh("국법", 1);
<!DOCTYPE html>
<html>
<head>
<title>국법</title>
<title><?=UniqueConst::$serverName?>: 국법</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -52,7 +52,6 @@ if($me['level'] >= 5) {
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+11 -6
View File
@@ -43,12 +43,12 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>토너먼트</title>
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
<style>
body { color:white; background-color:black; border-width:1px; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
table { font-family:'맑은 고딕'; }
font { font-family:'맑은 고딕'; }
input { font-family:'맑은 고딕'; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
@@ -176,10 +176,16 @@ if ($session->userGrade >= 5) {
$str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime();
if($str2){
$str2 = ', '.$str2;
}
$str3 = getTournamentTerm();
if($str3){
$str3 = ', '.$str3;
}
?>
<tr><td colspan=8>운영자 메세지 : <font color=orange size=5><?=$admin['tnmt_msg']?></font></td></tr>
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.", ".$str2.", ".$str3?>)</font></td></tr>
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type?> (<?=$str1.$str2.$str3?>)</font></td></tr>
<tr><td colspan=8 align=center id=bg2><font color=magenta size=5>16강 승자전</font></td></tr>
<tr><td height=10 colspan=8 align=center></td></tr>
<?php
@@ -504,6 +510,5 @@ if ($admin['tournament'] == 2 || $admin['tournament'] == 3) {
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
+4 -3
View File
@@ -25,7 +25,7 @@ $troopcount = MYDB_num_rows($result);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>부대편성</title>
<title><?=UniqueConst::$serverName?>: 부대편성</title>
<link rel='stylesheet' href='../d_shared/common.css' type='text/css'>
<link rel='stylesheet' href='css/common.css' type='text/css'>
@@ -123,7 +123,9 @@ for($i=0; $i < $troopcount; $i++) {
}
}
if($me['troop'] == 0) {
if ($troopcount == 0) {
}
else if($me['troop'] == 0) {
echo"
<input type=submit name=btn value='부 대 가 입'>";
} else {
@@ -158,7 +160,6 @@ echo "
<tr><td><?=banner()?> </td></tr>
</table>
</form>
<?php PrintElapsedTime(); ?>
</body>
</html>
+26 -20
View File
@@ -32,37 +32,43 @@ if($me['level'] < 5) {
}
if($btn == "국가방침") {
$msg = BadTag2Code(addslashes(SQ2DQ($msg)));
$query = "update nation set msg='$msg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$msg == mb_substr($msg, 0, 1000);
//$msg = StringUtil::
$db->update('nation', [
'msg'=>BadTag2Code($msg)
], 'nation=%i',$me['nation']);
} elseif($btn == "임관권유") {
$scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg)));
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$scoutmsg == mb_substr($msg, 0, 500);
$db->update('nation', [
'scoutmsg'=>BadTag2Code($scoutmsg)
], 'nation=%i',$me['nation']);
} elseif($btn == "세율") {
if($rate < 5) { $rate = 5; }
if($rate > 30) { $rate = 30; }
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "지급율") {
if($bill < 20) { $bill = 20; }
if($bill > 200) { $bill = 200; }
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bill = Util::valueFit($bill, 20, 200);
$db->update('nation', [
'bill'=>$bill
], 'nation=%i',$me['nation']);
} elseif($btn == "기밀권한") {
if($secretlimit < 1) { $secretlimit = 1; }
if($secretlimit > 99) { $secretlimit = 99; }
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$secretlimit = Util::valueFit($secretlimit, 1, 99);
$db->update('nation', [
'secretlimit'=>$secretlimit
], 'nation=%i',$me['nation']);
} elseif($btn == "임관 금지") {
$query = "update nation set scout='1' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'scout'=>1
], 'nation=%i',$me['nation']);
} elseif($btn == "임관 허가") {
$query = "update nation set scout='0' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'scout'=>0
], 'nation=%i',$me['nation']);
} elseif($btn == "전쟁 금지") {
$query = "update nation set war='1' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('nation', [
'war'=>1
], 'nation=%i',$me['nation']);
} elseif($btn == "전쟁 허가") {
$query = "update nation set war='0' where nation='{$me['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+25 -5
View File
@@ -20,7 +20,7 @@ $userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
$query = "select startyear,year,month from game limit 1";
$query = "select startyear,year,month,scenario from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
@@ -41,6 +41,7 @@ if($meLevel < 5){
if($btn == "임명") {
if($genlist !== 0){
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -49,9 +50,11 @@ if($btn == "임명") {
header('location:b_myBossInfo.php');
exit();
}
}
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) {
if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
header('location:b_myBossInfo.php');
exit();
@@ -74,13 +77,13 @@ if($btn == "임명") {
}
//나와 대상 장수는 국가가 같아야 함
if($me['nation'] != $general['nation']){
if($genlist != 0 && $me['nation'] != $general['nation']){
header('location:b_myBossInfo.php');
exit();
}
if($btn == "추방") {
$query = "select name,l{$meLevel}set,chemi from nation where nation='{$me['nation']}'";
$query = "select name,l{$meLevel}set,chemi,color from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
@@ -165,7 +168,24 @@ if($btn == "추방") {
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
}
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$str,
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
//국가 기술력 그대로
+1
View File
@@ -7,6 +7,7 @@ include "func.php";
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num', 'int');
$reply = Util::getReq('reply');
extractMissingPostToGlobals();
+1 -1
View File
@@ -60,7 +60,7 @@ if($btn == '참가') {
}
$map = [];
for($i=0; $i < 8; $i++) {
if($occupied[$i] == 0) {
if(!Util::array_get($occupied[$i])) {
$map[] = $i;
}
}
+4
View File
@@ -80,6 +80,10 @@ function myCommandList() {
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(!$me){
echo "로그인 되어있지 않습니다.";
return;
}
$turn = getTurn($me, 2);
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
+4 -3
View File
@@ -3,11 +3,12 @@
html, body{
background-color:black;
color:white;
line-height:1.3;
}
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
table { font-family:'맑은 고딕'; }
font { font-family:'맑은 고딕'; }
input { font-family:'맑은 고딕'; font-size:13px; }
select { font-family:'굴림'; line-height:100%; }
/* */
+20 -2
View File
@@ -9,6 +9,11 @@
}
/*임시용 끝*/
#message_board{
height:1370px;
position:relative;
}
#message_board section{
overflow-y:auto;
overflow-x:hidden;
@@ -70,19 +75,32 @@
color:white;
}
.message_input_form{
position:relative;
}
#msg_input{
color:white;
background-color:black;
font-size:12px;
width:720px;
width:715px;
margin:0 2px;
height:15px;
}
#msg_submit{
position:absolute;
right:0;
margin-right:2px;
}
#mailbox_list{
float:left;
color:white;
background-color:black;
font-size:12px;
width:160px;
height:20px;
}
.board_header{
@@ -91,10 +109,10 @@
}
.board_side{
position:absolute;
height:1370px;
width:498px;
overflow-y: hidden;
display:inline-block;
border-left:groove 1px;
border-right:groove 1px;
border-bottom:groove 1px;
+48
View File
@@ -0,0 +1,48 @@
.container{
width:1000px;
margin:0 auto;
}
.card_holder{
text-align:center;
}
.general_card{
width:100px;
display:inline-block;
}
.general_card h4 {
margin:0;
}
.general_card p {
margin:0;
}
.general_card .select_btn {
width:100%;
}
.general_card label {
display: block;
padding-left: 15px;
text-indent: -15px;
}
.general_card input {
width: 13px;
height: 13px;
padding: 0;
margin:0;
vertical-align: bottom;
position: relative;
top: -1px;
*overflow: hidden;
}
#outdate_token{
color:red;
display:none;
}
+1
View File
@@ -3,6 +3,7 @@ namespace sammo;
class UniqueConst{
public static $serverID = '_tK_serverID_';
public static $serverName = '_tK_serverName_';
private function __construct(){}
@@ -0,0 +1,22 @@
<div class="buttonPlate bg1">
<div>
<a href="a_status.php" target="_blank"><button class="toolbarButton">세력도</button></a>
<a href="a_kingdomList.php" target="_blank"><button class="toolbarButton">세력일람</button></a>
<a href="a_genList.php" target="_blank"><button class="toolbarButton">장수일람</button></a>
<a href="a_bestGeneral.php" target="_blank"><button class="toolbarButton">명장일람</button></a>
<a href="a_history.php" target="_blank"><button class="toolbarButton">연감</button></a>
<a href="a_hallOfFame.php" target="_blank"><button class="toolbarButton">명예의전당</button></a>
<a href="a_emperior.php" target="_blank"><button class="toolbarButton">왕조일람</button></a>
<a href="a_traffic.php" target="_blank"><button class="toolbarButton">접속량정보</button></a>
</div>
<div>
<a href="/bbs/board" target="_blank"><button class="toolbarButton2">삼모게시판</button></a>
<a href="/bbs/tip" target="_blank"><button class="toolbarButton">팁/강좌</button></a>
<a href="/bbs/news" target="_blank"><button class="toolbarButton">삼국 일보</button></a>
<a href="/bbs/history2" target="_blank"><button class="toolbarButton">개인 열전</button></a>
<a href="/bbs/history3" target="_blank"><button class="toolbarButton">국가 열전</button></a>
<a href="/bbs/patch" target="_blank"><button class="toolbarButton">패치 내역</button></a>
<a href="../i_other/help.php" target="_blank"><button class="toolbarButton">튜토리얼</button></a>
<a href="<?=$site?>" target="_blank"><button class="toolbarButton"><?=$call?></button></a>
</div>
</div>
+78 -75
View File
@@ -556,15 +556,13 @@ function commandTable() {
} else {
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
}
//TODO:등용장 재 디자인
//xxx:등용장 일단 끔
/*
if($me['level'] >= 1 && $city['supply'] != 0) {
addCommand("등용(자금{$develcost5}+장수가치)", 22);
} else {
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
}
*/
if($me['no'] == $troop['no'] && $citycount > 0 && $city['supply'] != 0 && $city['nation'] == $me['nation']) {
addCommand("집합(통솔경험)", 26);
} else {
@@ -646,7 +644,13 @@ function commandTable() {
if($me['level'] == 12) {
addCommand("선양", 54);
if($citycount != 0) {
if ($admin['year'] + 3 < $admin['startyear']) {
addCommand("방랑", 47, 0);
}
else{
addCommand("방랑", 47);
}
addCommand("해산", 56, 0);
} else {
addCommand("방랑", 47, 0);
@@ -998,11 +1002,17 @@ function generalInfo2($no) {
if($dex30 > 100) { $dex30 = 100; }
if($dex40 > 100) { $dex40 = 100; }
$general['dex0'] = getDexCall($general['dex0']);
$general['dex10'] = getDexCall($general['dex10']);
$general['dex20'] = getDexCall($general['dex20']);
$general['dex30'] = getDexCall($general['dex30']);
$general['dex40'] = getDexCall($general['dex40']);
$general['dex0_text'] = getDexCall($general['dex0']);
$general['dex10_text'] = getDexCall($general['dex10']);
$general['dex20_text'] = getDexCall($general['dex20']);
$general['dex30_text'] = getDexCall($general['dex30']);
$general['dex40_text'] = getDexCall($general['dex40']);
$general['dex0_short'] = sprintf('%.1fK', $general['dex0']/1000);
$general['dex10_short'] = sprintf('%.1fK', $general['dex10']/1000);
$general['dex20_short'] = sprintf('%.1fK', $general['dex20']/1000);
$general['dex30_short'] = sprintf('%.1fK', $general['dex30']/1000);
$general['dex40_short'] = sprintf('%.1fK', $general['dex40']/1000);
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr><td align=center colspan=6 id=bg1><b>추 가 정 보</b></td></tr>
@@ -1038,30 +1048,35 @@ function generalInfo2($no) {
</tr>
</table>
<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr><td align=center colspan=3 id=bg1><b>숙 련 도</b></td></tr>
<tr><td align=center colspan=4 id=bg1><b>숙 련 도</b></td></tr>
<tr height=16>
<td width=64 align=center id=bg1><b>보병</b></td>
<td width=64>  {$general['dex0']}</td>
<td width=366 align=center>".bar($dex0, 16)."</td>
<td width=40> {$general['dex0_text']}</td>
<td width=60 align=right>{$general['dex0_short']}&nbsp;</td>
<td width=330 align=center>".bar($dex0, 16)."</td>
</tr>
<tr height=16>
<td align=center id=bg1><b>궁병</b></td>
<td>  {$general['dex10']}</td>
<td> {$general['dex10_text']}</td>
<td align=right>{$general['dex10_short']}&nbsp;</td>
<td align=center>".bar($dex10, 16)."</td>
</tr>
<tr height=16>
<td align=center id=bg1><b>기병</b></td>
<td>  {$general['dex20']}</td>
<td> {$general['dex20_text']}</td>
<td align=right>{$general['dex20_short']}&nbsp;</td>
<td align=center>".bar($dex20, 16)."</td>
</tr>
<tr height=16>
<td align=center id=bg1><b>귀병</b></td>
<td>  {$general['dex30']}</td>
<td> {$general['dex30_text']}</td>
<td align=right>{$general['dex30_short']}&nbsp;</td>
<td align=center>".bar($dex30, 16)."</td>
</tr>
<tr height=16>
<td align=center id=bg1><b>차병</b></td>
<td>  {$general['dex40']}</td>
<td> {$general['dex40_text']}</td>
<td align=right>{$general['dex40_short']}&nbsp;</td>
<td align=center>".bar($dex40, 16)."</td>
</tr>
</table>";
@@ -1128,23 +1143,6 @@ function nationMsg() {
echo "<font color=orange>".$nation['msg']."</font>";
}
function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $tocolor, $msg) {
if($nation == 0) { $nation = 0; }
if($fromcolor == "") { $fromcolor = "#FFFFFF"; }
if($to == "") { $to = "재야"; }
if($tocolor == "") { $tocolor = "#FFFFFF"; }
$date = date('Y-m-d H:i:s');
if($type == 1) { $file = "_all_msg.txt"; }
else { $file = "_nation_msg{$nation}.txt"; }
$fp = fopen("logs/{$file}", "a");
//로그 파일에 기록
$str = "{$type}|".StringUtil::padStringAlignRight($from,12," ")."|".StringUtil::padStringAlignRight($to,12," ")."|".$date."|".$msg."|".$fromcolor."|".$tocolor."|".$picture."|".$imgsvr;
fwrite($fp, "{$str}\n");
fclose($fp);
}
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
$db = DB::db();
$connect=$db->get();
@@ -1264,6 +1262,7 @@ function cutDay($date, int $turnterm) {
function increaseRefresh($type="", $cnt=1) {
//FIXME: 로그인, 비로그인 시 처리가 명확하지 않음
$session = Session::getInstance();
$userID = $session->userID;
$generalID = $session->generalID;
$date = date('Y-m-d H:i:s');
@@ -1280,14 +1279,14 @@ function increaseRefresh($type="", $cnt=1) {
'connect'=>$db->sqleval('connect + %i', $cnt),
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
'refresh'=>$db->sqleval('refresh + %i', $cnt)
], 'owner=%i', $generalID);
], 'owner=%i', $userID);
}
$date = date('Y_m_d H:i:s');
$date2 = substr($date, 0, 10);
$online = getOnlineNum();
file_put_contents(
"logs/_{$date2}_refresh.txt",
__dir__."/logs/_{$date2}_refresh.txt",
sprintf(
"%s, %s, %s, %s, %s, %d\n",
$date,
@@ -1324,7 +1323,7 @@ function increaseRefresh($type="", $cnt=1) {
}
if($str != "") {
file_put_contents(
"logs/_{$date2}_ipcheck.txt",
__dir__."/logs/_{$date2}_ipcheck.txt",
sprintf(
"%s, %s, %s%s\n",
$session->userName,
@@ -1361,19 +1360,21 @@ function updateTraffic() {
$date = date('Y-m-d H:i:s');
//일시|년|월|총갱신|접속자|최다갱신자
file_put_contents(__dir__."/logs/_traffic.txt",
StringUtil::padStringAlignRight($date,20," ")
."|".StringUtil::padStringAlignRight($game['year'],3," ")
."|".StringUtil::padStringAlignRight($game['month'],2," ")
."|".StringUtil::padStringAlignRight($game['refresh'],8," ")
."|".StringUtil::padStringAlignRight($online,5," ")
."|".StringUtil::padStringAlignRight($user['name']."(".$user['refresh'].")",20," ")
Json::encode([
$date,
$game['year'],
$game['month'],
$game['refresh'],
$online,
$user['name']."(".$user['refresh'].")"
])."\n"
, FILE_APPEND);
}
function CheckOverhead() {
//서버정보
$db = DB::db();
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from GAME LIMIT 1');
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
@@ -1523,7 +1524,7 @@ function checkTurn() {
// 파일락 획득
//FIXME:이미 DB 테이블로 lock을 시도하는데 이게 따로 필요한가?
$fp = fopen('lock.txt', 'r');
$fp = fopen(__dir__.'/lock.txt', 'r');
if(!flock($fp, LOCK_EX)) {
return;
}
@@ -1786,25 +1787,27 @@ function addAge() {
function turnDate($curtime) {
$db = DB::db();
$connect=$db->get();
$query = "select startyear,starttime,turnterm,year,month from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
$turn = $admin['starttime'];
$curturn = cutTurn($curtime, $admin['turnterm']);
$num = 0;
$term = $admin['turnterm']*60;
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term);
$term = $admin['turnterm'];
$year = $admin['startyear'] + intdiv($num, 12);
$month = 1 + (12+$num) % 12;
$num = intdiv((strtotime($curturn) - strtotime($turn)), $term*60);
$date = $admin['startyear'] * 12;
$date += $num;
$year = intdiv($date, 12);
$month = 1 + $date % 12;
// 바뀐 경우만 업데이트
if($admin['month'] != $month || $admin['year'] != $year) {
$query = "update game set year='$year',month='$month'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('game', [
'year'=>$year,
'month'=>$month
], true);
}
return [$year, $month];
@@ -1821,8 +1824,8 @@ function triggerTournament() {
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
if($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) {
$type = rand() % 6; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
//전력전 50%, 통, 일, 설 각 17%
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
//전력전 40%, 통, 일, 설 각 20%
if($type > 3) { $type = 0; }
startTournament($admin['tnmt_trig'], $type);
}
@@ -2204,11 +2207,11 @@ function uniqueItem($general, $log, $vote=0) {
$occupied[$gen[$type]] = 1;
}
for($i=7; $i <= 26; $i++) {
if($occupied[$i] == 0) {
if(!Util::array_get($occupied[$i])) {
$item[] = $i;
}
}
$it = $item[rand() % count($item)];
$it = $item[rand() % count($item)]??0;
$query = "update general set {$type}='$it' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -2221,13 +2224,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getWeapName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getWeapName($it)."</>(을)를 습득했습니다!";
}
break;
case 1:
@@ -2235,13 +2238,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getBookName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getBookName($it)."</>(을)를 습득했습니다!";
}
break;
case 2:
@@ -2249,13 +2252,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getHorseName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getHorseName($it)."</>(을)를 습득했습니다!";
}
break;
case 3:
@@ -2263,13 +2266,13 @@ function uniqueItem($general, $log, $vote=0) {
$alllog[0] = "<C>●</>{$game['month']}월:<Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$game['year']}{$game['month']}월:<C>".getItemName($it)."</>(을)를 습득");
if($vote == 0) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 1) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 2) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
} elseif($vote == 3) {
$history[0] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
$history[] = "<C>●</>{$game['year']}{$game['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>(이)가 <C>".getItemName($it)."</>(을)를 습득했습니다!";
}
break;
}
+15 -10
View File
@@ -1,7 +1,8 @@
<?php
namespace sammo;
function getTurn($general, $type, $font=1) {
function getTurn(array $general, $type, $font=1) {
//TODO: 왜 'Type' 인가. 그냥 count로 하자.
$str = [];
$db = DB::db();
$connect=$db->get();
@@ -532,13 +533,15 @@ function processCommand($no) {
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(intval($command[0]) == 0 && $session->userGrade < 5) {
} elseif($command[0] == 0) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn='{$admin['killturn']}' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//FIXME: 운영자 같이 사망하면 안되는 인물에 대한 처리가 필요
//연속턴 아닌경우 텀 리셋
if($general['term']%100 != $command[0]) {
$query = "update general set term=0 where no='{$general['no']}'";
@@ -570,7 +573,7 @@ function processCommand($no) {
case 17: process_17($general); break; //소집해제
case 21: process_21($general); break; //이동
//case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
case 25: process_25($general); break; //임관
case 26: process_26($general); break; //집합
case 28: process_28($general); break; //귀환
@@ -681,19 +684,21 @@ where nation='{$general['nation']}'
function command_Single($turn, $command) {
if(!$turn){
header('location:commandlist.php');
return;
}
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
$command = EncodeCommand(0, 0, 0, $command);
$count = count($turn);
$str = "con=con";
for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$command}'";
$setValues = [];
foreach($turn as $turnIdx){
$setValues["turn{$turnIdx}"] = $command;
}
$query = "update general set {$str} where owner='{$userID}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', $setValues, 'owner=%i',$userID);
header('location:commandlist.php');
}
-3
View File
@@ -397,9 +397,6 @@ function getBill(int $dedication) : int{
}
function getCost(int $armtype) : int {
//FIXME: 정말로 side effect가 없으려면 query는 밖으로 이동해야함.
//TODO: 병종 값이 column으로 들어있는건 전혀 옳지 않음. key->value 형태로 바꿔야함
return GameUnitConst::byID($armtype)->cost;
}
+18 -18
View File
@@ -5,7 +5,7 @@ namespace sammo;
function delStepLog() {
$date = date('Y_m_d');
@unlink("logs/_{$date}_steplog.txt");
@unlink(__dir__."/logs/_{$date}_steplog.txt");
}
function pushRawFileLog($path, $lines){
@@ -50,81 +50,81 @@ function eraseTnmtFightLogAll(){
}
function eraseTnmtFightLog(int $group){
$filepath = "logs/fight{$group}.txt";
$filepath = __dir__."/logs/fight{$group}.txt";
if(file_exists($filepath)){
@unlink($filepath);
}
}
function pushTnmtFightLog(int $group, $log) {
pushRawFileLog("logs/fight{$group}.txt", $log);
pushRawFileLog(__dir__."/logs/fight{$group}.txt", $log);
}
function getTnmtFightLogAll(int $group) {
return join('<br>',getFormattedFileLogAll("logs/fight{$group}.txt"));
return join('<br>',getFormattedFileLogAll(__dir__."/logs/fight{$group}.txt"));
}
function pushSabotageLog($log) {
pushRawFileLog("logs/_sabotagelog.txt", $log);
pushRawFileLog(__dir__."/logs/_sabotagelog.txt", $log);
}
function getSabotageLogRecent($count) {
return join('<br>', getFormattedFileLogRecent("logs/_sabotagelog.txt", $count, 150));
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/_sabotagelog.txt", $count, 150));
}
function pushProcessLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_processlog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_processlog.txt", $log);
}
function pushStepLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_steplog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_steplog.txt", $log);
}
function pushLockLog($log) {
$date = date('Y_m_d');
pushRawFileLog("logs/_{$date}_locklog.txt", $log);
pushRawFileLog(__dir__."/logs/_{$date}_locklog.txt", $log);
}
function pushAdminLog($log) {
pushRawFileLog("logs/_adminlog.txt", $log);
pushRawFileLog(__dir__."/logs/_adminlog.txt", $log);
}
function pushAuctionLog($log) {
pushRawFileLog("logs/_auctionlog.txt", $log);
pushRawFileLog(__dir__."/logs/_auctionlog.txt", $log);
}
function getAuctionLogRecent(int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/_auctionlog.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/_auctionlog.txt", $count, 300)));
}
function pushGenLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/gen{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/gen{$no}.txt", $log);
}
function getGenLogRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/gen{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/gen{$no}.txt", $count, 300)));
}
function pushBatRes($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/batres{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/batres{$no}.txt", $log);
}
function getBatResRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/batres{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batres{$no}.txt", $count, 300)));
}
function pushBatLog($general, $log) {
$no = Util::toInt($general['no']);
pushRawFileLog("logs/batlog{$no}.txt", $log);
pushRawFileLog(__dir__."/logs/batlog{$no}.txt", $log);
}
function getBatLogRecent(int $no, int $count) {
return join('<br>', array_reverse(getFormattedFileLogRecent("logs/batlog{$no}.txt", $count, 300)));
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/batlog{$no}.txt", $count, 300)));
}
//DB-based
+12 -7
View File
@@ -51,7 +51,7 @@ function getWorldMap($req){
}
$session = Session::getInstance();
$generalID = $session->generalID;
$userID = $session->userID;
$db = DB::db();
@@ -60,13 +60,18 @@ function getWorldMap($req){
$year = Util::toInt($game['year']);
$month = Util::toInt($game['month']);
if($generalID && ($req->showMe || !$req->neutralView)){
$city = $db->queryFirstRow(
'select `city`, `nation` from `general` where `no`=%i',
$generalID);
$general = $db->queryFirstRow(
'select `no`, `city`, `nation` from `general` where `owner`=%i',
$userID);
$myCity = Util::toInt($city['city']);
$myNation = Util::toInt($city['nation']);
if($general && ($req->showMe || !$req->neutralView)){
if($session->generalID !== $general['no']){
$session->logoutGame()->loginGame();
}
$myCity = Util::toInt($general['city']);
$myNation = Util::toInt($general['nation']);
if(!$req->showMe){
$myCity = null;
+152 -37
View File
@@ -192,7 +192,15 @@ function processAI($no) {
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$nation = MYDB_fetch_array($result)??[
'nation'=>0,
'color'=>'#000000',
'name'=>'재야',
'level'=>0,
'gold'=>0,
'rice'=>0,
'tech'=>0,
];
$coreCommand = array();
if($general['level'] >= 5) {
@@ -261,6 +269,7 @@ function processAI($no) {
}
$tech = getTechCost($nation['tech']);
$resrc = $tech * 700;//XXX: 왜 700이지?
if($general['atmos'] >= 90 && $general['train'] >= 90) {
if($general['mode'] == 0) {
@@ -276,20 +285,26 @@ function processAI($no) {
//운영자메시지 출력 하루 6번..?
//특별 메세지 있는 경우 출력 하루 4번
switch($admin['turnterm']) {
case 0: $term = 1; break;
case 1: $term = 1; break;
case 2: $term = 2; break;
case 3: $term = 3; break;
case 4: $term = 6; break;
case 5: $term = 12; break;
case 6: $term = 30; break;
case 7: $term = 60; break;
}
if($general['npcid'] == 2000 && rand()%(24*$term) < 6) {
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
} elseif($general['npcmsg'] != "" && rand()%(24*$term) < 3) {
PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
$term = $admin['turnterm'];
if($general['npcmsg'] && Util::randBool($term / (6*60))) {
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$general['npcmsg'],
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
//재야인경우
@@ -571,35 +586,100 @@ function processAI($no) {
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
else { $type = "rice"; $type2 = 2; }
if($nation[$type] < 1000) { // 몰수
if($nation[$type] < $type2*3000) { // 몰수
// 몰수 대상
$query = "select no,{$type} from general where nation='{$general['nation']}' and no!='{$general['no']}' and {$type}>3000 order by {$type} desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result);
if($SelGen['no'] != 0) {
$amount = intdiv($SelGen[$type], 5000)*10 + 10;
if($amount > 100) $amount = 100;
list($npcGenID, $npcGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc >= 2 ORDER BY %b DESC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$type
);
list($userGenID, $userGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND %b>3000 AND npc < 2 ORDER BY %b DESC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$type
);
if($npcGenID === null && $userGenID === null){
$genID = 0;
$genValue = 0;
}
else if($npcGenID === null || $userGenValue > $npcGenValue * 4){
$genID = $userGenID;
$genValue = $userGenValue;
}
else{
$genID = $npcGenID;
$genValue = $npcGenValue;
}
if($genID){
$amount = min(100, intdiv($genValue, 5000)*10 + 10);
// 몰수
$command = EncodeCommand($type2, $SelGen['no'], $amount, 24); // 금,쌀 1000단위 몰수
$command = EncodeCommand($type2, $genID, $amount, 24); // 금,쌀 1000단위 몰수
}
} else { // 포상
// 포상 대상
$query = "select no from general where nation='{$general['nation']}' and no!='{$general['no']}' and killturn>=5 order by {$type} limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result);
if($SelGen['no'] != 0) {
$amount = intdiv(($nation[$type]-GameConst::$baserice), 5000)*10 + 10;
if($amount > 100) $amount = 100;
list($npcGenID, $npcGenValue, $npcLeadership) = $db->queryFirstList(
'SELECT `no`, %b, leader FROM general WHERE nation=%i AND `no`!=%i AND npc >= 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
$resrc,
$type
);
list($userGenID, $userGenValue) = $db->queryFirstList(
'SELECT `no`, %b FROM general WHERE nation=%i AND `no`!=%i AND npc < 2 AND killturn > 5 AND (leader >= 40 OR %b < %i) ORDER BY %b ASC LIMIT 1',
$type,
$general['nation'],
$general['no'],
$type,
($type=='gold')?21000:3000,
$type
);
if($npcGenID === null && $userGenID === null){
$genID = 0;
}
else if($npcGenID === null || ($userGenValue !== null && $userGenValue < $npcGenValue * 3)){
$genID = $userGenID;
}
else{
$genID = $npcGenID;
}
if ($genID) {
if($genID === $npcGenID){
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
if($npcLeadership < 40){
$amount = min($amount, intdiv($resrc, 1000)*10 + 10);
}
}
else{
$amount = min(100, intdiv(($nation[$type]-($type=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 2000)*10 + 10);
}
// 포상
$command = EncodeCommand($type2, $SelGen['no'], $amount, 23); // 금 1000단위 포상
$command = EncodeCommand($type2, $genID, $amount, 23); // 금,쌀 1000단위 포상
}
}
}
}
if(isset($command)){
$query = "update nation set l{$general['level']}turn0='$command' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
}
}
}
$command = EncodeCommand(0, 0, 0, 1);
//일반 할일
@@ -635,6 +715,41 @@ function processAI($no) {
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return;
}
if($general['leader'] < 40){
//무지장인데
if(
(($nation['rice'] - GameConst::$baserice) * 3 <= $general['rice'] && $general['rice'] >= $resrc + 2100) ||
($general['rice'] >= 11000)
){
//쌀을 많이 들고 있다면
$amount = $general['rice'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$command = EncodeCommand(0, 2, $amount, 44); //헌납
$db->update('general', [
'turn0'=>$command
], 'no=%i',$general['no']);
return;
}
if(
(($nation['gold'] - GameConst::$basegold) * 3 <= $general['gold'] && $general['gold'] >= $resrc + 2100) ||
($general['gold'] >= 12000)
){
//금을 많이 들고 있다면
$amount = $general['gold'] * 0.9;
$amount = intdiv(Util::valueFit($amount, $resrc + 700, 10000), 100);
$command = EncodeCommand(0, 1, $amount, 44); //헌납
$db->update('general', [
'turn0'=>$command
], 'no=%i',$general['no']);
return;
}
}
//국가 병량이 없을때 바로 헌납
if($nation['rice'] < 2000 && $general['rice'] > 200) {
$amount = intdiv($general['rice'] - 200, 100) + 1;
@@ -653,7 +768,7 @@ function processAI($no) {
// ┃조┃ ┃쌀삼
// 0┗━┻━━━━┻━━━> G
// 100 700
$resrc = $tech * 700;
$target = array();
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
@@ -663,11 +778,11 @@ function processAI($no) {
if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
elseif($general['gold'] < 100) { //금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
$command = EncodeCommand(0, 1, $amount, 49); //팜
} elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
$command = EncodeCommand(0, 2, $amount, 49); //삼
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
else {
@@ -743,12 +858,12 @@ function processAI($no) {
else { $command = EncodeCommand(0, 0, 0, 1); }
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
//금이 더 많으면 매매
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$amount = intdiv(($general['gold'] - $general['rice']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
//쌀이 더 많으면 매매
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
$amount = intdiv(($general['rice'] - $general['gold']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
//자원, 병사 모두 충족
@@ -777,11 +892,11 @@ function processAI($no) {
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold']), 100 / 2); // 100단위
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice']), 100 / 2); // 100단위
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
+27 -9
View File
@@ -13,6 +13,9 @@ namespace sammo;
* @return int|float 계산된 능력치
*/
function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$leadership = $general['leader'];
if($withInjury){
$leadership *= (100 - $general['injury']) / 100;
@@ -47,6 +50,9 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
* @return int|float 계산된 능력치
*/
function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$power = $general['power'];
if($withInjury){
$power *= (100 - $general['injury']) / 100;
@@ -78,6 +84,10 @@ function getGeneralPower(&$general, $withInjury, $withItem, $withStatAdjust, $us
* @return int|float 계산된 능력치
*/
function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $useFloor = true){
if($general === null){
return 0;
}
$intel = $general['intel'];
if($withInjury){
$intel *= (100 - $general['injury']) / 100;
@@ -1673,7 +1683,16 @@ function process_31(&$general) {
$typecount = [];
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result);
if($gen['crew'] != 0) { $typecount[$gen['crewtype']]++; $crew += $gen['crew']; }
if($gen['crew'] != 0) {
if(!key_exists($gen['crewtype'], $typecount)){
$typecount[$gen['crewtype']] = 1;
}
else{
$typecount[$gen['crewtype']]+=1;
}
$crew += $gen['crew'];
}
}
if(!key_exists($destination, $dist)) {
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$city['name']}</b></>(을)를 살피는 것 같습니다.";
@@ -1689,13 +1708,9 @@ function process_31(&$general) {
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$city['name']}</b></>의 많은 정보를 얻었습니다. <1>$date</>";
$msg[] = "【<S>병종</>】";
foreach(GameUnitConst::all() as $unit){
if($typecount[$unit->id] == 0){
continue;
}
$unitStr = mb_substr($unit->name, 0, 2);
$msg[] = "{$unitStr}:{$typecount[$unit->id]}";
foreach($typecount as $crewtype=>$cnt){
$crewtypeText = mb_substr(GameUnitConst::byID($crewtype)->name, 0, 2);
$msg[] = "{$crewtypeText}:{$cnt}";
}
$log[] = join(' ', $msg);
@@ -1743,6 +1758,9 @@ function process_31(&$general) {
{
$cities = array_map('intval', explode("|", $nation['spy']));
}
else{
$cities = [];
}
$exist = 0;
for($i=0; $i < count($cities); $i++) {
if(intdiv($cities[$i], 10) == $destination) {
@@ -1803,7 +1821,7 @@ function process_41(&$general) {
} elseif($crewexp == 0) {
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
} else {
$type = intdiv($general['crewtype'], 10) * 10;
$type = intdiv($general['crewtype'], 10);
switch($type) {
case 0: $crewstr = '보병'; break;
case 1: $crewstr = '궁병'; break;
+45 -6
View File
@@ -173,7 +173,24 @@ function process_24(&$general) {
case 4: $str = "몰수로 인한 사기 저하는 몰수로 얻은 물자보다 더 손해란걸 모른단 말인가!"; break;
}
PushMsg(1, 0, $gen['picture'], $gen['imgsvr'], "{$gen['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
$src = new MessageTarget(
$gen['no'],
$gen['name'],
$gen['nation'],
$nation['name'],
$nation['color'],
GetImageURL($gen['imgsvr'], $gen['picture'])
);
$msg = new Message(
Message::MSGTYPE_PUBLIC,
$src,
$src,
$str,
new \DateTime(),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
@@ -644,7 +661,7 @@ function process_61(&$general) {
Message::MSGTYPE_DIPLOMACY,
$src,
$dest,
"{$srcNation['name']}의 불가침 제의 서신",
"{$srcNation['name']} {$when} 불가침 제의 서신",
$now,
$validUntil,
[
@@ -756,11 +773,33 @@ function process_62(&$general) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】{$admin['year']}{$admin['month']}월:{$younation['name']}에 선전포고";
$youmsg = "【외교】{$admin['year']}{$admin['month']}월:{$nation['name']}에서 선전포고";
$text = "【외교】{$admin['year']}{$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
PushMsg(2, $nation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}", $nation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation['nation'], $general['picture'], $general['imgsvr'], "{$general['name']}:{$nation['name']}", $nation['color'], $younation['name'], $younation['color'], $youmsg);
$src = new MessageTarget(
$general['no'],
$general['name'],
$general['nation'],
$nation['name'],
$nation['color'],
GetImageURL($general['imgsvr'], $general['picture'])
);
$dest = new MessageTarget(
0,
'',
$younation['nation'],
$younation['name'],
$younation['color']
);
$msg = new Message(
Message::MSGTYPE_NATIONAL,
$src,
$dest,
$text,
new \DateTime($general['turntime']),
new \DateTime('9999-12-31'),
[]
);
$msg->send();
}
pushWorldHistory($history, $admin['year'], $admin['month']);
+2 -10
View File
@@ -47,16 +47,8 @@ function process_22(&$general) {
$ded = CharDedication($ded, $general['personal']);
$msg = ScoutMessage::buildScoutMessage($general['no'], $who, $reason);
$msg->send(true);
/*
sendScoutMsg([
'id' => $general['no'],
'nation_id' => Util::array_get($general['nation'], 0)
],[
'id' => $you['no'],
'nation_id' => Util::array_get($you['nation'], 0)
],$date);
*/
$general['intel2']++;
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -576,7 +568,7 @@ function process_46(&$general) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$query = "select nation from nation where name='{$general['makenation']}'";
$query = "select nation from nation where nation!={$general['nation']} AND name='{$general['makenation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
+1 -1
View File
@@ -27,7 +27,7 @@ function Tag2Code(string $str) {
function BadTag2Code(string $str) {
/* FIXME: 제대로된 tag 변환 코드 사용 */
$str = str_replace("<script", "<sorry", $str);
$str = str_replace("<embed", "<sorry", $str);
$str = str_replace("</script", "</sorry", $str);
return $str;
}
+45 -4
View File
@@ -75,7 +75,13 @@ function allButton() {
$call = "설문조사";
}
if(\file_exists("d_setting/templates/allButton.php")){
$templates = new \League\Plates\Engine('d_setting/templates');
}
else{
$templates = new \League\Plates\Engine('templates');
}
return $templates->render('allButton', [
'call' => $call,
@@ -95,10 +101,12 @@ function commandButton() {
$db = DB::db();
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
$nation = $db->queryFirstRow("select nation,color,secretlimit from nation where nation=%i",$me['nation']);
if($nation['color'] == "") { $nation['color'] = "#000000"; }
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
'nation'=>0,
'level'=>0,
'secretlimit'=>99,
'color'=>'#000000'
];
$bgColor = Util::array_get($nation['color'])?:'#000000';
$fgColor = newColor($bgColor);
@@ -119,11 +127,44 @@ function commandButton() {
'bgColor'=>$bgColor,
'fgColor'=>$fgColor,
'meLevel'=>$me['level'],
'nationLevel'=>$nation['level'],
'showSecret'=>$showSecret
]);
}
function formatWounded(int $value, int $wound): string{
if($wound == 0){
return "$value";
}
$woundedValue = intdiv($value * (100 - $wound), 100);
return "<font color=red>$woundedValue</font>";
}
function formatDefenceMode(int $value): string{
switch($value) {
case 0: return "×"; break;
case 1: return ""; break;
case 2: return ""; break;
}
return '??';
}
function formatLeadershipBonus(int $value): string{
if($value == 0){
return '';
}
return "<font color=cyan>+{$value}</font>";
}
function formatName(string $name, int $npc): string{
if($npc==1){
$name = "<font color='skyblue'>$name</font>";
}
else if($npc>1){
$name = "<font color='cyan'>$name</font>";
}
return $name;
}
function getMapHtml(){
//NOTE: 필요한가?
+1 -1
View File
@@ -117,7 +117,7 @@ function getTournamentTerm() {
$admin = MYDB_fetch_array($result);
switch($admin['tnmt_auto']) {
case 0: $str = '설정 안됨'; break;
case 0: $str = ''; break;
case 1: $str = "경기당 12분"; break;
case 2: $str = "경기당 7분"; break;
case 3: $str = "경기당 3분"; break;
+17 -6
View File
@@ -18,7 +18,7 @@ if (!$userID) {
}
$me = $db->queryFirstRow(
'SELECT no,con,turntime,newmsg,newvote,map from general where owner = %i',
'SELECT no,con,turntime,newmsg,newvote,`level` from general where owner = %i',
$userID
);
@@ -58,7 +58,7 @@ $scenario = $admin['scenario_text'];
<!DOCTYPE html>
<html>
<head>
<title>메인</title>
<title><?=UniqueConst::$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="../e_lib/jquery-3.2.1.min.js"></script>
@@ -74,6 +74,10 @@ $(function(){
reloadWorldMap({
hrefTemplate:'b_currentCity.php?citylist={0}'
});
setInterval(function(){
refreshMsg();
}, 10000);
});
</script>
<link href="css/normalize.css" rel="stylesheet">
@@ -211,6 +215,14 @@ if ($session->userGrade >= 5) {
</td></tr>
";
}
else if($session->userGrade == 4){
echo "
<tr><td colspan=5>
<input type=button value=시뮬 onclick=window.open('_simul.php')>
<input type=button value=119 onclick=window.open('_119.php')>
</td></tr>
";
}
?>
@@ -249,7 +261,7 @@ if ($session->userGrade >= 5) {
<tr>
<td width=646 align=right>
<?php commandTable(); ?>
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로그아웃' onclick=location.replace('logout_process.php')><br>
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로비로' onclick=location.replace('../')><br>
</td>
</tr>
</form>
@@ -286,12 +298,12 @@ if ($session->userGrade >= 5) {
내용 없이 '서신전달&amp;갱신' 누르면 메세지창이 갱신됩니다.
</div>
<div><?=allButton()?></div>
<div id="message_board"><div class="board_side bg0">
<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 class="board_side bg0">
</div><div style="right:0;" class="board_side bg0">
<section class="diplomacy_message">
</section>
@@ -299,7 +311,6 @@ if ($session->userGrade >= 5) {
<section class="national_message"></section>
</div></div>
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
<?php PrintElapsedTime(); ?>
</div>
<?php
if ($con == 1) {
+41 -2
View File
@@ -155,15 +155,54 @@ if($session->userGrade < 5){
<input type="radio" name="show_img_level" value="1">전콘
</label>
<label class="btn btn-secondary active">
<input type="radio" name="show_img_level" value="2" checked>전콘, 병종
<input type="radio" name="show_img_level" value="2">전콘, 병종
</label>
<label class="btn btn-secondary">
<input type="radio" name="show_img_level" value="3">전콘, 병종, NPC
<input type="radio" name="show_img_level" value="3" checked>전콘, 병종, NPC
</label>
</div>
</div>
</div>
<div class="form-group row">
<label for="tournament_trig" class="col-sm-3 col-form-label">토너먼트 자동 시작<br>경기 단위</label>
<div class="col-sm-9" id="tournament_trig">
<div id="tournament_trig" class="btn-group-toggle btn-group flex-wrap" data-toggle="buttons">
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="0">안함
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="1">12( 5)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="2">7( 10시간)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="3">3( 4시간)
</label>
<label class="btn btn-secondary w-25 active">
<input type="radio" name="tournament_trig" value="4" checked>1( 82)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="5">30( 41)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="6">15( 21)
</label>
<label class="btn btn-secondary w-25">
<input type="radio" name="tournament_trig" value="7">5( 7)
</label>
</div>
</div>
</div>
<div class="form-group row">
<label for="reserve_open" class="col-sm-3 col-form-label">오픈 예약</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="reserve_open" id="reserve_open" placeholder="YYYY-MM-DD hh:mm" value="" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
+91
View File
@@ -0,0 +1,91 @@
<?php
namespace sammo;
include 'lib.php';
include "func.php";
$db = DB::db();
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
if(!$reserved){
Json::die([
'result'=>true,
'affected'=>0,
'status'=>'no_reserved'
]);
}
$reservedDate = new \DateTime($reserved['date']);
$now = new \DateTime();
$status = 'not_yet';
if ($db->queryFirstField("SHOW TABLES LIKE 'game'")) {
list($isUnited, $lastTurn) = $db->queryFirstList('SELECT isUnited, turntime FROM game LIMIT 1');
}
else{
$isUnited = 2;
$lastTurn = '2000-01-01';
}
if($lastTurn !== null){
$lastTurn = new \DateTime($lastTurn);
}
if($lastTurn === null){
//이미 리셋된 상태임
}
else if(file_exists(__dir__.'/.htaccess')){
//일단 서버는 닫혀 있음
}
else if(
$isUnited == 2 &&
$now->getTimestamp() - $lastTurn->getTimestamp() > $reservedDate->getTimestamp() - $now->getTimestamp()
){
//정지 상태 & 중간 넘음
AppConf::getList()[DB::prefix()]->closeServer();
$status = 'closed';
}
else if(
$isUnited > 0 &&
$now->getTimestamp() - $lastTurn->getTimestamp() > ($reservedDate->getTimestamp() - $now->getTimestamp()) * 2
){
//천통 & 비정지 상태 & 2/3 넘음
AppConf::getList()[DB::prefix()]->closeServer();
$status = 'closed';
}
else if($reservedDate->getTimestamp() - $now->getTimestamp() <= 60*10){
//어쨌든 간에 10분 남았다면.
AppConf::getList()[DB::prefix()]->closeServer();
$status = 'closed';
}
if($now < $reservedDate){
Json::die([
'result'=>true,
'affected'=>0,
'status'=>$status
]);
}
$options = Json::decode($reserved['options']);
$result = ResetHelper::buildScenario(
$options['turnterm'],
$options['sync'],
$options['scenario'],
$options['fiction'],
$options['extend'],
$options['npcmode'],
$options['show_img_level'],
$options['tournament_trig']
);
$result['affected']=1;
$prefix = DB::prefix();
AppConf::getList()[$prefix]->openServer();
Json::die($result);
+1
View File
@@ -19,5 +19,6 @@ if(!$generalInfo){
$result['generalID'] = $generalInfo['no'];
$result['myNationID'] = $generalInfo['nation'];
$result['isChief'] = ($generalInfo['level'] == 12);
$result['generalLevel'] = $generalInfo['level'];
Json::die($result);
+169
View File
@@ -0,0 +1,169 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
const VALID_SECOND = 90;
const PICK_MORE_SECOND = 10;
const KEEP_CNT = 3;
$refresh = Util::getReq('refresh', 'bool', false);
$keepResult = Util::getReq('keep', 'array_int', []);
$session = Session::requireLogin([])->setReadOnly();
$userID = Session::getUserID();
$oNow = new \DateTimeImmutable();
$now = $oNow->format('Y-m-d H:i:s');
$db = DB::db();
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
if($oldGeneral !== null){
Json::die([
'result'=>false,
'reason'=>'이미 장수가 생성되었습니다'
]);
}
list(
$maxgeneral,
$turnterm,
$npcmode
) = $db->queryFirstList('SELECT maxgeneral,turnterm,npcmode from game limit 1');
if(!$npcmode){
Json::die([
'result'=>false,
'reason'=>'빙의 가능한 서버가 아닙니다'
]);
}
$token = $db->queryFirstRow('SELECT * FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
$pickResult = [];
if($token && $refresh){
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
$nowT = $oNow->getTimestamp();
if($nowT >= $pickMoreFrom){
$oldPickResult = Json::decode($token['pick_result']);
foreach($keepResult as $keepId){
if(\key_exists($keepId, $oldPickResult) && $oldPickResult[$keepId]['keepCnt'] > 0){
$pickResult[$keepId] = $oldPickResult[$keepId];
$pickResult[$keepId]['keepCnt']-=1;
}
}
if(count($pickResult) == count($oldPickResult)){
$refresh = false;
}
}
else{
Json::die([
'result'=>false,
'reason'=>'아직 다시 뽑을 수 없습니다',
]);
}
}
if($token && !$refresh){
$pickMoreFrom = (new \DateTime($token['pick_more_from']))->getTimestamp();
$nowT = $oNow->getTimestamp();
Json::die([
'result'=>true,
'pick'=>Json::decode($token['pick_result']),
'pickMoreFrom'=>$token['pick_more_from'],
'pickMoreSeconds'=>$pickMoreFrom-$nowT,
'validUntil'=>$token['valid_until']
]);
}
$candidates = [];
$weight = [];
foreach($db->query('SELECT `no`, `name`, leader, power, intel, imgsvr, picture, special, special2 FROM general WHERE npc=2') as $general){
$general['special'] = \sammo\SpecialityConst::DOMESTIC[$general['special']][0]??'-';
$general['special2'] = \sammo\SpecialityConst::WAR[$general['special2']][0]??'-';
$candidates[$general['no']] = $general + ['keepCnt'=>KEEP_CNT];
$allStat = $general['leader'] + $general['power'] + $general['intel'];
$weight[$general['no']] = pow($allStat, 1.5);
}
foreach($db->queryFirstColumn('SELECT pick_result FROM select_npc_token WHERE `owner`!=%i AND valid_until >=%s', $userID, $now) as $reserved){
$reserved = Json::decode($reserved);
foreach(array_keys($reserved) as $reservedNPC){
if(key_exists($reservedNPC, $weight)){
unset($candidates[$reservedNPC]);
unset($weight[$reservedNPC]);
}
}
}
$pickLimit = min(count($candidates), 5);
while(count($pickResult) < $pickLimit){
$generalID = Util::choiceRandomUsingWeight($weight);
if(!key_exists($generalID, $pickResult)){
$pickResult[$generalID] = $candidates[$generalID];
}
}
$newNonce = mt_rand(0, 0xfffffff);
$validSecond = max(VALID_SECOND, $turnterm*40);
$pickMoreSecond = max(PICK_MORE_SECOND, $turnterm*10);
$validUntil = $oNow->add(new \DateInterval(sprintf('PT%dS', $validSecond)));
$pickMoreFrom = $oNow->add(new \DateInterval(sprintf('PT%dS', $pickMoreSecond)));
$db->delete('select_npc_token', 'valid_until < %s', $now);
$inserted = 0;
if($token){
$db->update('select_npc_token', [
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
'pick_more_from'=>$pickMoreFrom->format('Y-m-d H:i:s'),
'pick_result'=>Json::encode($pickResult),
'nonce'=>$newNonce
], 'owner = %i AND nonce = %i', $userID, $token['nonce']);
if($db->affectedRows()){
$inserted = -1;
}
}
else{
$db->insertIgnore('select_npc_token', [
'owner'=>$userID,
'valid_until'=>$validUntil->format('Y-m-d H:i:s'),
'pick_more_from'=>'2000-01-01 01:00:00',
'pick_result'=>Json::encode($pickResult),
'nonce'=>$newNonce
]);
if($db->affectedRows()){
$inserted = 1;
}
}
if($inserted === 0){
Json::die([
'result'=>false,
'reason'=>'중복 요청, 다시 랜덤 토큰을 확인해주세요'
]);
}
Json::die([
'result'=>true,
'pick'=>$pickResult,
'pickMoreFrom'=>($inserted===-1)?$pickMoreFrom->format('Y-m-d H:i:s'):'2000-01-01 01:00:00',
'pickMoreSeconds'=>($inserted===-1)?$pickMoreSecond:0,
'validUntil'=>$validUntil->format('Y-m-d H:i:s')
]);
+44 -160
View File
@@ -28,7 +28,8 @@ $v->rule('required', [
'fiction',
'extend',
'npcmode',
'show_img_level'
'show_img_level',
'tournament_trig'
]);
if(!$v->validate()){
Json::die([
@@ -44,173 +45,56 @@ $fiction = (int)$_POST['fiction'];
$extend = (int)$_POST['extend'];
$npcmode = (int)$_POST['npcmode'];
$show_img_level = (int)$_POST['show_img_level'];
$tournament_trig = (int)$_POST['tournament_trig'];
if(120 % $turnterm != 0){
$reserve_open = Util::getReq('reserve_open');
if($reserve_open){
$reserve_open = new \DateTime($reserve_open);
$db = DB::db();
if (!$db->queryFirstField("SHOW TABLES LIKE 'game'")) {
$clearResult = ResetHelper::clearDB();
if(!$clearResult['result']){
Json::die($clearResult);
}
}
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
Json::die([
'result'=>false,
'reason'=>'turnterm은 120의 약수여야 합니다.'
]);
}
if(!file_exists(__dir__.'/logs') || !file_exists(__dir__.'/data')){
if(!is_writable(__dir__)){
Json::die([
'result'=>false,
'reason'=>'logs, data 디렉토리를 생성할 권한이 없습니다.'
'reason'=>'예약 테이블이 없음!'
]);
}
mkdir(__dir__.'/logs', 0644);
mkdir(__dir__.'/data', 0644);
}
if(!is_writable(__dir__.'/logs')){
Json::die([
'result'=>false,
'reason'=>'logs 디렉토리의 쓰기 권한이 없습니다'
]);
}
if(!is_writable(__dir__.'/data')){
Json::die([
'result'=>false,
'reason'=>'data 디렉토리의 쓰기 권한이 없습니다'
]);
}
if(!is_writable(__dir__.'/d_setting')){
Json::die([
'result'=>false,
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다'
]);
}
if(!file_exists(__dir__.'/logs/.htaccess')){
@file_put_contents(__dir__.'/logs/.htaccess', 'Deny from all');
}
if(!file_exists(__dir__.'/data/.htaccess')){
@file_put_contents(__dir__.'/data/.htaccess', 'Deny from all');
}
$db = DB::db();
$mysqli_obj = $db->get();
$scenarioObj = new Scenario($scenario, false);
$startyear = $scenarioObj->getYear()??GameConst::$defaultStartYear;
FileUtil::delInDir("logs");
FileUtil::delInDir("data");
$result = Util::generateFileUsingSimpleTemplate(
__DIR__.'/d_setting/UniqueConst.orig.php',
__DIR__.'/d_setting/UniqueConst.php',[
'serverID'=>DB::prefix().'_'.Util::randomStr(8)
], true
);
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
while(true){
if (!$mysqli_obj->more_results()) {
break;
}
if(!$mysqli_obj->next_result()){
break;
}
}
}
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
while(true){
if (!$mysqli_obj->more_results()) {
break;
}
if(!$mysqli_obj->next_result()){
break;
}
}
}
$db->insert('plock', [
'plock'=>1
]);
CityConst::build();
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 현재 시간을 1월로 맞춤
$starttime = cutTurn($turntime, $turnterm);
$month = 1;
$year = $startyear;
} else {
// 현재 시간과 동기화
list($starttime, $yearPulled, $month) = cutDay($turntime, $turnterm);
if($yearPulled){
$year = $startyear-1;
}
else{
$year = $startyear;
}
}
$killturn = 4800 / $turnterm;
if($npcmode == 1) { $killturn = intdiv($killturn, 3); }
$env = [
'scenario'=>$scenario,
'scenario_text'=>$scenarioObj->getTitle(),
'startyear'=>$startyear,
'year'=> $year,
'month'=> $month,
'msg'=>'공지사항',//TODO:공지사항
'maxgeneral'=>GameConst::$defaultMaxGeneral,
'maxnation'=>GameConst::$defaultMaxNation,
'conlimit'=>300,
'gold_rate'=>100,
'rice_rate'=>100,
'turntime'=>$turntime,
'starttime'=>$starttime,
$scenarioObj = new Scenario($scenario, true);
$db->delete('reserved_open', true);
$db->insert('reserved_open', [
'options'=>Json::encode([
'turnterm'=>$turnterm,
'killturn'=>$killturn,
'genius'=>GameConst::$defaultMaxGenius,
'show_img_level'=>$show_img_level,
'sync'=>$sync,
'scenario'=>$scenario,
'scenarioName'=>$scenarioObj->getTitle(),
'fiction'=>$fiction,
'extend'=>$extend,
'npcmode'=>$npcmode,
'extended_general'=>$extend,
'fiction'=>$fiction
];
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
$db->insert('general', [
'owner'=>$admin['no'],
'name'=>$admin['name'],
'picture'=>$admin['picture'],
'imgsvr'=>$admin['imgsvr'],
'turntime'=>$turntime,
'killturn'=>null
'show_img_level'=>$show_img_level,
'tournament_trig'=>$tournament_trig
]),
'date'=>$reserve_open->format('Y-m-d H:i:s')
]);
Json::die([
'result'=>true,
'reason'=>'예약'
]);
}
$db->insert('game', $env);
$scenarioObj->build($env);
$db->update('plock', [
'plock'=>0
], true);
LogHistory(1);
$prefix = DB::prefix();
AppConf::getList()[$prefix]->closeServer();
Json::die([
'result'=>true
]);
Json::die(ResetHelper::buildScenario(
$turnterm,
$sync,
$scenario,
$fiction,
$extend,
$npcmode,
$show_img_level,
$tournament_trig
));
+2
View File
@@ -93,6 +93,8 @@ if($result !== true){
]);
}
ResetHelper::clearDB();
AppConf::getList()[$prefix]->closeServer();
Json::die([
+4 -4
View File
@@ -44,16 +44,16 @@ if($msg === null){
'reason'=>'올바르지 않은 메시지'
]);
}
$reason = 'success';
if($msgResponse){
$result = $msg->agreeMessage($general['no']);
$result = $msg->agreeMessage($general['no'], $reason);
}
else{
$result = $msg->declineMessage($general['no']);
$result = $msg->declineMessage($general['no'], $reason);
}
Json::die([
'result' => $result===DiplomaticMessage::ACCEPTED,
'reason' => 'result'
'reason' => $reason
]);
+112
View File
@@ -0,0 +1,112 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$pick = Util::getReq('pick', 'int');
if(!$pick){
Json::die([
'result'=>false,
'reason'=>'장수를 선택하지 않았습니다'
]);
}
$session = Session::requireLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$rootDB = RootDB::db();
$oNow = new \DateTimeImmutable();
$now = $oNow->format('Y-m-d H:i:s');
$userNick = RootDB::db()->queryFirstField('SELECT `NAME` FROM member WHERE `NO`=%i',$userID);
if(!$userNick){
Json::die([
'result'=>false,
'reason'=>'멤버 정보를 가져오지 못했습니다.'
]);
}
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
if(!$pickResult){
Json::die([
'result'=>false,
'reason'=>'유효한 장수 목록이 없습니다.'
]);
}
$pickResult = Json::decode($pickResult);
if(!key_exists($pick, $pickResult)){
Json::die([
'result'=>false,
'reason'=>'선택한 장수가 목록에 없습니다.'
]);
}
$pickedNPC = $pickResult[$pick];
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
list(
$year,
$month,
$maxgeneral,
$npcmode
) = $db->queryFirstList('SELECT year,month,maxgeneral,npcmode from game limit 1');
if(!$npcmode){
Json::die([
'result'=>false,
'reason'=>'빙의 가능한 서버가 아닙니다'
]);
}
if ($gencount >= $maxgeneral) {
Json::die([
'result'=>false,
'reason'=>'더 이상 등록 할 수 없습니다.'
]);
}
//등록 시작
$db->update('general', [
'name2'=>$userNick,
'npc'=>1,
'killturn'=>6,
'mode'=>2,
'owner'=>$userID,
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
if(!$db->affectedRows()){
Json::die([
'result'=>false,
'reason'=>'장수 등록에 실패했습니다.'
]);
}
$db->delete('select_npc_token', 'owner=%i or valid_until < %s', $userID, $now);
pushGeneralHistory($pickedNPC, "<C>●</>{$year}{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>(이)가 빙의되다.");
//pushGenLog($me, $mylog);
pushGeneralPublicRecord(["<C>●</>{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>(이)가 <S>빙의</>됩니다!"], $year, $month);
pushAdminLog(["가입 : {$userID} // {$session->userName} // {$pick} // ".getenv("REMOTE_ADDR")]);
$rootDB->insert('member_log', [
'member_no' => $userID,
'date'=>date('Y-m-d H:i:s'),
'action_type'=>'make_general',
'action'=>Json::encode([
'server'=>DB::prefix(),
'type'=>'npc',
'generalID'=>$npc['no'],
'generalName'=>$npc['name']
])
]);
Json::die([
'result'=>true,
'reason'=>'success'
]);
+36 -1
View File
@@ -4,13 +4,48 @@ namespace sammo;
include "lib.php";
$session = Session::requireLogin([
'game'=>'x',
'game'=>null,
'me'=>null
])->setReadOnly();
$userID = Session::getUserID();
if(!class_exists('\\sammo\\DB')){
Json::die([
'game'=>null,
'me'=>null
]);
}
$db = DB::db();
if(file_exists(__dir__.'/.htaccess')){
$reserved = $db->queryFirstRow(
'SELECT * FROM reserved_open ORDER BY `date` ASC LIMIT 1'
);
if(!$reserved){
Json::die([
'game'=>null,
'me'=>null
]);
}
$options = Json::decode($reserved['options']);
Json::die([
'reserved'=>[
'scenarioName'=>$options['scenarioName'],
'turnterm'=>$options['turnterm'],
'fictionMode'=>($options['fiction']?'가상':'사실'),
'npcMode'=>($options['npcmode']?'가능':'불가'),
'openDatetime'=>$reserved['date']
],
'game'=>null,
'me'=>null
]);
}
//TODO: 천통시에도 예약 오픈 알림이 필요..?
$game = $db->queryFirstRow('SELECT isUnited, npcMode, year, month, scenario, scenario_text, maxgeneral as maxUserCnt, turnTerm from game where `no`=1');
$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
+3 -3
View File
@@ -29,7 +29,7 @@ $connect=$db->get();
<!DOCTYPE html>
<html>
<head>
<title>장수생성</title>
<title><?=UniqueConst::$serverName?>: 장수생성</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link href="../d_shared/common.css" rel="stylesheet">
<link rel='stylesheet' href="css/common.css">
@@ -71,10 +71,10 @@ for ($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
if ($nation['scoutmsg'] == "") {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:{newColor({$nation['color']})};background-color:{$nation['color']}>-</td></tr>";
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
} else {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:{newColor({$nation['color']})};background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
}
}
?>
+3 -5
View File
@@ -8,7 +8,6 @@ $v = new Validator($_POST + $_GET);
$v
->rule('required', [
'name',
'pic',
'leader',
'power',
'intel'
@@ -18,7 +17,6 @@ $v
'power',
'intel',
'character',
'pic'
])
->rule('lengthBetween', 'name', 1, 6)
->rule('min', [
@@ -46,7 +44,7 @@ $userID = Session::getUserID();
$name = Util::getReq('name');
$name = StringUtil::removeSpecialCharacter($name);
$pic = Util::getReq('pic', 'int', 0);
$pic = (int)Util::getReq('pic', 'bool', 0);
$character = Util::getReq('character', 'int', 0);
$leader = Util::getReq('leader', 'int', 50);
@@ -59,7 +57,7 @@ extractMissingPostToGlobals();
$rootDB = RootDB::db();
//회원 테이블에서 정보확인
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name` FROM member WHERE no=%i', $userID);
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
if (!$member) {
MessageBox("잘못된 접근입니다!!!");
@@ -70,7 +68,7 @@ if (!$member) {
$db = DB::db();
########## 동일 정보 존재여부 확인. ##########
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,turnterm,genius,npcmode from game limit 1');
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,scenario,show_img_level,turnterm,genius,npcmode from game limit 1');
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
+10
View File
@@ -119,3 +119,13 @@ var TemplateEngine = function (html, options) {
catch (err) { console.error("'" + err.message + "'", " in \n\nCode:\n", code, "\n"); }
return result;
}
function getIconPath(imgsvr, picture){
// ../d_shared/common_path.js 필요
if(!imgsvr){
return pathConfig.sharedIcon+'/'+picture;
}
else{
return pathConfig.root+'/d_pic/'+picture;
}
}
+4 -1
View File
@@ -113,6 +113,7 @@ function formSetup(){
extend:"required",
npcmode:"required",
show_img_level:"required",
tournament_trig:"required"
},
errorElement: "div",
errorPlacement: function ( error, element ) {
@@ -149,7 +150,9 @@ function formSetup(){
fiction:$('#fiction input:radio:checked').val(),
extend:$('#extend input:radio:checked').val(),
npcmode:$('#npcmode input:radio:checked').val(),
show_img_level:$('#show_img_level 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()
}
}).then(function(result){
var deferred = $.Deferred();
+1 -70
View File
@@ -84,7 +84,7 @@ function reloadWorldMap(option){
else if(month <= 6){
$world_map.addClass('map_summer');
}
else if(month <= 6){
else if(month <= 9){
$world_map.addClass('map_fall');
}
else{
@@ -366,65 +366,8 @@ function reloadWorldMap(option){
var $map_body = $('.world_map .map_body');
//터치스크린 탭
$objs.on('touchstart', function(e){
var $this = $(this);
var touchMode = $this.data('touchMode');
if($tooltip_city.data('target') != $this.data('id')){
$this.data('touchMode', 1);
}
else if(touchMode === undefined){
$this.data('touchMode', 1);
}
else{
$this.data('touchMode', touchMode + 1);
}
$map_body.data('touchMode', 1);
$tooltip_city.data('target', $this.data('id'));
});
$objs.on('touchend', function(e){
var $this = $(this);
var position = $this.parent().position();
$tooltip_city.html($this.data('text'));
var nation_text = $this.data('nation');
if(nation_text){
$tooltip_nation.html(nation_text).show();
}
else{
$tooltip_nation.html('').hide();
}
$tooltip.css({'top': position.top + 25, 'left': position.left + 35}).show();
var touchMode = $this.data('touchMode');
if(touchMode <= 1){
return false;
}
//xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다.
$this.data('touchMode', 0);
});
$map_body.on('touchend',function(e){
//위의 touchend bind에 해당하지 않는 경우 -> 빈 지도 터치
$tooltip.hide();
});
//Mouse over 모드 작동
$map_body.on('mousemove', function(e){
if($(this).data('touchMode')){
return true;
}
var parentOffset = $map_body.offset();
var relX = e.pageX - parentOffset.left;
var relY = e.pageY - parentOffset.top;
@@ -433,10 +376,6 @@ function reloadWorldMap(option){
});
$objs.on('mouseenter', function(e){
if($map_body.data('touchMode')){
return true;
}
var $this = $(this);
$tooltip_city.data('target', $this.data('id'));
@@ -457,15 +396,7 @@ function reloadWorldMap(option){
});
$objs.on('click', function(e){
//xxx: touchend 다음 click 이벤트가 갈 수도 있고, 안 갈 수도 있다.
var touchMode = $(this).data('touchMode');
if(touchMode === undefined){
return;
}
if(touchMode === 1){
return false;
}
});
+26 -4
View File
@@ -42,7 +42,10 @@ function responseMessage(msgID, response){
}).then(refreshMsg);
}
function refreshMsg(){
function refreshMsg(result){
if(result && !result.result){
alert(result.reason);
}
return redrawMsg(fetchMsg());
}
@@ -60,8 +63,6 @@ function fetchMsg(){
function redrawMsg(deferred){
console.log(deferred);
function registerSequence(obj){
if(!obj.result){
deferred.reject();
@@ -216,7 +217,8 @@ function refreshMailboxList(obj){
generalList = {};
//TODO:수뇌인 경우 각국에 대해 외교 국메를 넣을 수 있어야함.
$.each(obj.nation, function(){
var nation = this;
@@ -284,6 +286,25 @@ function refreshMailboxList(obj){
$favorite.append($lastContact);
//TODO:운영자를 추가하는 코드도 넣을 것.
if(myGeneralLevel >= 5){
$.each(obj.nation, function(){
var nation = this;
//console.log(nation);
var $nation = $('<option value="{0}">{1}</option>'.format(nation.mailbox,nation.name));
$nation.css('background-color', nation.color);
if(isBrightColor(nation.color)){
$nation.css('color', 'black');
}
else{
$nation.css('color', 'white');
}
$favorite.append($nation);
});
}
$mailboxList.prepend($favorite);
if(!oldSelected){
@@ -307,6 +328,7 @@ function registerGlobal(basicInfo){
};
myGeneralID = basicInfo.generalID;
isChief = basicInfo.isChief;
myGeneralLevel = basicInfo.generalLevel;
}
function activateMessageForm(){
+134
View File
@@ -0,0 +1,134 @@
var templateGeneralCard =
'<div class="general_card">\
<h4 class="bg1 with_border"><%name%></h4>\
<h4><img src="<%iconPath%>" height=64 width=64></h4>\
<p><%leader%> / <%power%> / <%intel%><br>\
<%special%> / <%special2%></p>\
<button type="subject" class="with_skin with_border select_btn" value="<%no%>" name="pick">빙의하기</button>\
<label><input <%keepCnt?"":disabled="disabled"%> type="checkbox" value="<%no%>" name="keep[]" class="keep_select">보관(<%keepCnt%>)</label>\
</div>';
function pickGeneral(){
$btn = $(this);
$.post({
url:'j_select_npc.php',
dataType:'json',
data:{
pick:$btn.val()
}
}).then(function(result){
if(!result.result){
alert(result.reason);
location.refresh();
}
alert('빙의에 성공했습니다.');
location.href = './';
});
return false;
}
function updateOutdateTimer(){
var $validUntilText = $('#valid_until_text');
var now = Date.now();
var validUntil = $validUntilText.data('until');
if(validUntil <= 0){
return;
}
else if(validUntil < now){
$validUntilText.data('until',0);
$('#valid_until').hide();
$('#outdate_token').show();
return;
}
else if(validUntil - now <= 30000){
$validUntilText.css('color', "rgb(255, {0}, {0})".format(255*(validUntil - now)/30000));
}
setTimeout(updateOutdateTimer, 1000);
}
function updatePickMoreTimer(){
var $btn = $('#btn_pick_more');
var now = Date.now();
var remain = ($btn.data('available') - now) / 1000;
if(remain <= 0){
$btn.prop('disabled', false)
$btn.html('다른 장수 보기');
return;
}
$btn.html('다른 장수 보기({0}초)'.format(Math.ceil(remain)));
setTimeout(updatePickMoreTimer, 250);
}
function printGenerals(value){
$('.card_holder').empty();
$('#valid_until').show();
$('#valid_until_text').html(value.validUntil).data('until', (new Date(value.validUntil)).getTime()).css('color','white');
$('#outdate_token').hide();
var time = Date.now() + value.pickMoreSeconds*1000;
$('#btn_pick_more').data('available', time).prop('disabled',true);
var pick = $.map(value.pick, function(value, key) {
return value;
});
pick.sort(function(lhs, rhs){
var lsum = lhs.leader+lhs.power+lhs.intel;
var rsum = rhs.leader+rhs.power+rhs.intel;
return lsum - rsum;
});
$.each(pick, function(idx, cardData){
cardData.iconPath = getIconPath(cardData.imgsvr, cardData.picture);
var $card = $(TemplateEngine(templateGeneralCard, cardData));
console.log($card);
$('.card_holder').append($card);
$card.find('.select_btn').click(pickGeneral);
});
updatePickMoreTimer();
updateOutdateTimer();
}
$(function($){
$.post('j_get_select_npc_token.php').then(function(value){
if(!value.result){
alert(value.reason);
return;
}
console.log(value);
printGenerals(value);
});
$('#btn_pick_more').click(function(){
var generals = $.map($('.keep_select:checked'), function(value){
return $(value).val();
});
console.log(generals);
$.post({
url:'j_get_select_npc_token.php',
dataType:'json',
data:{
refresh:true,
keep:generals
}
}).then(function(result){
if(!result.result){
alert(result.reason);
location.refresh();
}
console.log(result);
printGenerals(result);
});
});
});
-8
View File
@@ -26,7 +26,6 @@ include "MYDB.php";
// 각종 변수
define('STEP_LOG', true);
define('PROCESS_LOG', true);
$_startTime = microtime(true);
ob_start();
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
@@ -55,13 +54,6 @@ function MessageBox($str)
echo "<script>alert('$str');</script>";
}
function PrintElapsedTime()
{
global $_startTime;
$_endTime = round(microtime(true) - $_startTime, 3);
echo "<table width=1000 align=center style=font-size:10px;><tr><td align=right>경과시간 : {$_endTime}초</td></tr></table>";
}
function LogText($prefix, $variable)
{
$text = sprintf('%s : %s'."\n", $prefix, var_export($variable, true));
+1 -15
View File
@@ -19,24 +19,10 @@ extractMissingPostToGlobals();
increaseRefresh("턴입력", 1);
if(!$turn || $commandtype === null){
header('location:./');
header('location:commandlist.php');
die();
}
$query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,con from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) {
header('location:./');
exit();
}
$count = count($turn);
for($i=0; $i < $count; $i++) {
if($turn[$i] == 100 || $turn[$i] == 99 || $turn[$i] == 98) {
+3 -1
View File
@@ -4,8 +4,10 @@ namespace sammo;
include "lib.php";
include "func.php";
$session = Session::getInstance()->setReadOnly();
$db = DB::db();
$connect=$db->get();
increaseRefresh("자동", 2);
//increaseRefresh("자동", 2);
checkTurn();
+1 -1
View File
@@ -1159,7 +1159,7 @@ function processWar($general, $city) {
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->defence; //회피율
$ratio2 = GameUnitConst::byID($oppose['crewtype'])->avoid; //회피율
$ratio2 = Util::round($ratio2 * $oppose['train'] / 100); //훈련 반영
// 특기보정 : 돌격, 궁병
if($general['special2'] == 60) { $ratio2 -= 100; }
+22 -16
View File
@@ -58,7 +58,7 @@ switch($commandtype) {
case 17: command_Single($turn, 17); break; //소집해제
case 21: command_21( $turn, 21); break; //이동
//case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인
case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인
case 23: command_23( $turn, 23); break; //포상
case 24: command_24( $turn, 24); break; //몰수
case 25: command_25( $turn, 25); break; //임관
@@ -166,11 +166,7 @@ function ender($type=0) {
echo banner();
echo "
</td></tr>
</table>";
PrintElapsedTime();
echo "
</table>
</body>
</html>
";
@@ -594,7 +590,7 @@ function calc(cost, formnum) {
<form name=form{$i} action=c_double.php>
<td valign=center>
<input type=text name=double maxlength=3 size=3 value=$crew style=text-align:right;color:white;background-color:black>00<input type=button value=계산 onclick='calc($baseCost, $i)'><br>
<input type=text name=cost maxlength=5 size=5 readonly style=text-align:right;color:white;background-color:black> <input type=submit value=>
<input type=text name=cost maxlength=5 size=5 readonly style=text-align:right;color:white;background-color:black> <input type=submit value=>
<input type=hidden name=third value={$i}>
<input type=hidden name=command value=$command>";
@@ -860,7 +856,10 @@ function command_23($turn, $command) {
<option value=8>800</option>
<option value=9>900</option>
<option value=10>1000</option>
<option value=12>1200</option>
<option value=15>1500</option>
<option value=20>2000</option>
<option value=25>2500</option>
<option value=30>3000</option>
<option value=40>4000</option>
<option value=50>5000</option>
@@ -935,7 +934,10 @@ function command_24($turn, $command) {
<option value=8>800</option>
<option value=9>900</option>
<option value=10>1000</option>
<option value=12>1200</option>
<option value=15>1500</option>
<option value=20>2000</option>
<option value=25>2500</option>
<option value=30>3000</option>
<option value=40>4000</option>
<option value=50>5000</option>
@@ -1448,7 +1450,10 @@ function command_43($turn, $command) {
<option value=8>800</option>
<option value=9>900</option>
<option value=10>1000</option>
<option value=12>1200</option>
<option value=15>1500</option>
<option value=20>2000</option>
<option value=25>2500</option>
<option value=30>3000</option>
<option value=40>4000</option>
<option value=50>5000</option>
@@ -1496,7 +1501,10 @@ function command_44($turn, $command) {
<option value=8>800</option>
<option value=9>900</option>
<option value=10>1000</option>
<option value=12>1200</option>
<option value=15>1500</option>
<option value=20>2000</option>
<option value=25>2500</option>
<option value=30>3000</option>
<option value=40>4000</option>
<option value=50>5000</option>
@@ -1540,7 +1548,7 @@ function command_46($turn, $command) {
continue;
}
if(isset($nationcolor[$nation['color']])){
if(!isset($nationcolor[$nation['color']])){
$nationcolor[$nation['color']] = 1;
}
else{
@@ -1720,7 +1728,10 @@ function command_49($turn, $command) {
<option value=8>800</option>
<option value=9>900</option>
<option value=10>1000</option>
<option value=12>1200</option>
<option value=15>1500</option>
<option value=20>2000</option>
<option value=25>2500</option>
<option value=30>3000</option>
<option value=40>4000</option>
<option value=50>5000</option>
@@ -1774,7 +1785,7 @@ function command_51($turn, $command) {
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
if($myNation['power'] / $nation['power'] <= 3 || !isClose($me['nation'], $nation['nation'])) {
if($myNation['power'] <= $nation['power'] * 3 || !isClose($me['nation'], $nation['nation'])) {
echo "<option style=color:{$nation['color']};background-color:red; value={$nation['nation']}>【 {$nation['name']} 】</option>";
} else {
echo "<option style=color:{$nation['color']} value={$nation['nation']}>【 {$nation['name']} 】</option>";
@@ -2759,12 +2770,7 @@ function command_81($turn, $command) {
continue;
}
if(isset($nationcolor[$nation['color']])){
$nationcolor[$nation['color']] = 1;
}
else{
$nationcolor[$nation['color']]++;
}
$colorUsed[$nation['color']]+=1;
}
$colorUsedCnt = 0;
@@ -2787,7 +2793,7 @@ function command_81($turn, $command) {
<form name=form1 action=c_double.php method=post>
색깔 : <select name=double size=1>";
foreach(GetNationColors() as $idx=>$color) {
if($colorUsed[$color] > 0){
if($colorUsed[$color]>0){
continue;
}
echo "<option value={$idx} style=background-color:{$color};color:".newColor($color).";>국가명</option>";
+4 -3
View File
@@ -29,13 +29,14 @@ class CityHelper{
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
$id = $city['id'];
$name = $city['name'];
$nationID = $city['nation'];
$list[$id] = $city;
$listInv[$city['name']] = $city;
if(!key_exists($id, $listByNation)){
$listByNation[$id] = [];
if(!key_exists($nationID, $listByNation)){
$listByNation[$nationID] = [];
}
$listByNation[$id][] = $city;
$listByNation[$nationID][] = $city;
}
self::$list = $list;
+10 -7
View File
@@ -16,6 +16,7 @@ class DiplomaticMessage extends Message{
protected $diplomaticType = '';
protected $diplomacyName = '';
protected $diplomacyDetail = '';
protected $validDiplomacy = true;
public function __construct(
@@ -77,18 +78,20 @@ class DiplomaticMessage extends Message{
return [self::INVALID, '올바르지 않은 불가침 서신입니다.'];
}
$this->diplomacyDetail = "{$year}";
$helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID);
$chk = $helper->noAggression($year, $option);
if($chk[0] !== self::ACCEPTED){
return $chk;
}
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 <C>$when</>년 불가침에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 <C>$when</>년 불가침에 합의했습니다.";
$youlog[] = "<C>●</><D><b>{$this->dest->nationName}</b></>(와)과 <C>$year</>년 불가침에 성공했습니다.";
$mylog[] = "<C>●</><D><b>{$this->src->nationName}</b></>(와)과 <C>$year</>년 불가침에 합의했습니다.";
pushGenLog(['no'=>$this->dest->generalID], $mylog);
pushGenLog(['no'=>$this->src->generalID], $youlog);
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$when}년 불가침 성공");
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$when}년 불가침 수락");
pushGeneralHistory(['no'=>$this->src->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->dest->nationName}</b></>(와)과 {$year}년 불가침 성공");
pushGeneralHistory(['no'=>$this->dest->generalID], "<C>●</>{$helper->year}{$helper->month}월:<D><b>{$this->src->nationName}</b></>(와)과 {$year}년 불가침 수락");
return $chk;
}
@@ -212,7 +215,7 @@ class DiplomaticMessage extends Message{
/**
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 반환
*/
public function agreeMessage(int $receiverID):int{
public function agreeMessage(int $receiverID, string &$reason):int{
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
if(!$this->id){
@@ -294,7 +297,7 @@ class DiplomaticMessage extends Message{
self::MSGTYPE_NATIONAL,
$this->dest,
$this->src,
"【외교】{$year}{$month}월: {$this->src->nationName} {$this->dest->nationName}에게 제안한 {$this->diplomacyName} 동의.",
"【외교】{$year}{$month}월: {$this->src->nationName}(이)가 {$this->dest->nationName}에게 제안한 {$this->diplomacyDetail}{$this->diplomacyName} 동의.",
new \DateTime(),
new \DateTime('9999-12-31'),
[
@@ -315,7 +318,7 @@ class DiplomaticMessage extends Message{
return self::DECLINED;
}
public function declineMessage(int $receiverID):int{
public function declineMessage(int $receiverID, string &$reason):int{
if(!$this->id){
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
}
+1 -1
View File
@@ -282,7 +282,7 @@ class Diplomacy{
$db = DB::db();
$db->update('diplomacy',[
'state'=>7,
'term'=>$when,
'term'=>$when*12,
'fixed'=>$option
],
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
+10 -8
View File
@@ -11,6 +11,7 @@ use \sammo\ScoutMessage;
class Personnel{
protected $nation = null;//TODO: 상속체로 변경.
protected $senderID = null;
public $valid = false;
public $startYear = 0;
@@ -18,7 +19,7 @@ class Personnel{
public $month = 0;
public $killturn = 0;
public function __construct(int $nationID){
public function __construct(int $nationID, int $senderID){
$db = DB::db();
$nation = $db->queryFirstRow(
'SELECT nation, `name`, `level`, capital, scout FROM nation WHERE nation=%i',
@@ -29,6 +30,7 @@ class Personnel{
return;
}
$this->senderID = $senderID;
$this->nation = $nation;
$this->valid = true;
@@ -51,7 +53,7 @@ class Personnel{
return [ScoutMessage::INVALID, '초반제한 중입니다.'];
}
if(!$this->nation['scout']){
if($this->nation['scout']){
return [ScoutMessage::INVALID, '현재 임관금지 중인 국가입니다.'];
}
@@ -67,7 +69,7 @@ class Personnel{
return [ScoutMessage::DECLINED, '군주는 등용장을 수락할 수 없습니다.'];
}
if(strpos($general['nations'], ",{$this->nation['nation']},") >= 0){
if(strpos($general['nations'], ",{$this->nation['nation']},") !== false){
return [ScoutMessage::DECLINED, '이미 임관했었던 국가입니다.'];
}
@@ -100,7 +102,7 @@ class Personnel{
$isTroopLeader = false;
if($general['troop']){
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop = %i', $general['troop']);
if($troopLeader == $receiverID){
if($troopLeader == $generalID){
$isTroopLeader = true;
}
}
@@ -179,12 +181,12 @@ class Personnel{
$setValues['dedication'] = $db->sqleval('experience + %i', 100);//XXX: 상수
}
if($me['npc'] < 2){
$setValues['killturn'] = $killturn;
if($general['npc'] < 2){
$setValues['killturn'] = $this->killturn;
}
$db->update('general', $setValues, 'no=%i', $receiverID);
$db->update('general', $setSenderValues, 'no=%i', $this->src->generalID);
$db->update('general', $setValues, 'no=%i', $generalID);
$db->update('general', $setSenderValues, 'no=%i', $this->senderID);
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
$db->update('nation', $setScoutNationValues, 'nation=%i', $this->nation['nation']);
if($setOriginalCityValues){
+6 -4
View File
@@ -50,14 +50,16 @@ class Date extends \sammo\Event\Condition{
}
$lhs = [
$this->year,
$this->month
];
$rhs = [
$this->year!==null?(int)$env['year']:null,
$this->month!==null?(int)$env['month']:null
];
$rhs = [
$this->year,
$this->month
];
$value = false;
switch($this->cmp){
case '==': $value = ($lhs == $rhs); break;
+1 -1
View File
@@ -73,7 +73,7 @@ class GameUnitConst{
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true, ['저렴하고 튼튼합니다.']],
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true, ['저렴하고 강력합니다.']],
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true, ['백병전에도 능숙합니다.']],
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 0, false, ['전투를 포기하고 계략에 몰두합니다.']],
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 1000, false, ['전투를 포기하고 계략에 몰두합니다.']],
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true, ['고도로 훈련된 귀병입니다.']],
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true, ['갑주를 두른 귀병입니다.']],
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true, ['날카로운 무기를 가진 귀병입니다.']],
+1 -1
View File
@@ -68,7 +68,7 @@ class GameUnitDetail{
if(!key_exists($this->recruitCondition, $ownCities)){
return false;
}
if($cityLevel == '특'){
if($cityLevel == CityConst::$levelMap['특']){
if ($tech < 3000) {
return false;
}
+214
View File
@@ -0,0 +1,214 @@
<?php
namespace sammo;
class ResetHelper{
private function __construct(){
}
static public function clearDB(){
$servRoot = realpath(__dir__.'/../');
if(!file_exists($servRoot.'/logs') || !file_exists($servRoot.'/data')){
if(!is_writable($servRoot)){
return [
'result'=>false,
'reason'=>'logs, data 디렉토리를 생성할 권한이 없습니다.'
];
}
mkdir($servRoot.'/logs', 0644);
mkdir($servRoot.'/data', 0644);
}
if(!is_writable($servRoot.'/logs')){
return [
'result'=>false,
'reason'=>'logs 디렉토리의 쓰기 권한이 없습니다'
];
}
if(!is_writable($servRoot.'/data')){
return [
'result'=>false,
'reason'=>'data 디렉토리의 쓰기 권한이 없습니다'
];
}
if(!is_writable($servRoot.'/d_setting')){
return [
'result'=>false,
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다'
];
}
if(!file_exists($servRoot.'/logs/.htaccess')){
@file_put_contents($servRoot.'/logs/.htaccess', 'Deny from all');
}
if(!file_exists($servRoot.'/data/.htaccess')){
@file_put_contents($servRoot.'/data/.htaccess', 'Deny from all');
}
$prefix = DB::prefix();
AppConf::getList()[$prefix]->closeServer();
$db = DB::db();
$mysqli_obj = $db->get();
FileUtil::delInDir($servRoot."/logs");
FileUtil::delInDir($servRoot."/data");
$result = Util::generateFileUsingSimpleTemplate(
$servRoot.'/d_setting/UniqueConst.orig.php',
$servRoot.'/d_setting/UniqueConst.php',[
'serverID'=>DB::prefix().'_'.Util::randomStr(8),
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
], true
);
if($mysqli_obj->multi_query(file_get_contents($servRoot.'/sql/reset.sql'))){
while(true){
if (!$mysqli_obj->more_results()) {
break;
}
if(!$mysqli_obj->next_result()){
break;
}
}
}
if($mysqli_obj->multi_query(file_get_contents($servRoot.'/sql/schema.sql'))){
while(true){
if (!$mysqli_obj->more_results()) {
break;
}
if(!$mysqli_obj->next_result()){
break;
}
}
}
return [
'result'=>true
];
}
static public function buildScenario(
int $turnterm,
int $sync,
int $scenario,
int $fiction,
int $extend,
int $npcmode,
int $show_img_level,
int $tournament_trig
):array{
//FIXME: 분리할 것
if(120 % $turnterm != 0){
return [
'result'=>false,
'reason'=>'turnterm은 120의 약수여야 합니다.'
];
}
if($tournament_trig < 0 || $tournament_trig > 7){
return [
'result'=>false,
'reason'=>'올바르지 않은 토너먼트 주기입니다.'
];
}
$clearResult = self::clearDB();
if(!$clearResult['result']){
return $clearResult;
}
$scenarioObj = new Scenario($scenario, false);
$startyear = $scenarioObj->getYear()??GameConst::$defaultStartYear;
$db = DB::db();
$db->insert('plock', [
'plock'=>1
]);
CityConst::build();
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 현재 시간을 1월로 맞춤
$starttime = cutTurn($turntime, $turnterm);
$month = 1;
$year = $startyear;
} else {
// 현재 시간과 동기화
list($starttime, $yearPulled, $month) = cutDay($turntime, $turnterm);
if($yearPulled){
$year = $startyear-1;
}
else{
$year = $startyear;
}
}
$killturn = 4800 / $turnterm;
if($npcmode == 1) { $killturn = intdiv($killturn, 3); }
$env = [
'scenario'=>$scenario,
'scenario_text'=>$scenarioObj->getTitle(),
'startyear'=>$startyear,
'year'=> $year,
'month'=> $month,
'msg'=>'공지사항',//TODO:공지사항
'maxgeneral'=>GameConst::$defaultMaxGeneral,
'maxnation'=>GameConst::$defaultMaxNation,
'conlimit'=>300,
'gold_rate'=>100,
'rice_rate'=>100,
'turntime'=>$turntime,
'starttime'=>$starttime,
'turnterm'=>$turnterm,
'killturn'=>$killturn,
'genius'=>GameConst::$defaultMaxGenius,
'show_img_level'=>$show_img_level,
'npcmode'=>$npcmode,
'extended_general'=>$extend,
'fiction'=>$fiction,
'tnmt_trig'=>$tournament_trig
];
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
$db->insert('general', [
'owner'=>$admin['no'],
'name'=>$admin['name'],
'picture'=>$admin['picture'],
'imgsvr'=>$admin['imgsvr'],
'turntime'=>$turntime,
'killturn'=>9999
]);
}
$db->insert('game', $env);
$scenarioObj->build($env);
$db->update('plock', [
'plock'=>0
], true);
LogHistory(1);
$prefix = DB::prefix();
AppConf::getList()[$prefix]->closeServer();
return [
'result'=>true
];
}
}
+8 -3
View File
@@ -64,7 +64,7 @@ class Scenario{
list(
$affinity, $name, $pictureID, $nationID, $locatedCity,
$leadership, $power, $intel, $birth, $death, $ego,
$leadership, $power, $intel, $level, $birth, $death, $ego,
$char, $text
) = $rawGeneral;
@@ -83,6 +83,7 @@ class Scenario{
$leadership,
$power,
$intel,
$level,
$birth,
$death,
$ego,
@@ -279,12 +280,14 @@ class Scenario{
private function buildDiplomacy($env){
$this->initFull();
$monthDiff = ($env['year'] * 12) + ($env['month'] - 1) - ($env['startyear'] * 12);
$db = DB::db();
foreach($this->diplomacy as $diplomacy){
list($me, $you, $state, $remain) = $diplomacy;
$db->update('diplomacy', [
'state'=>$state,
'term'=>$remain
'term'=>$remain - $monthDiff
], '(me = %i AND you = %i) OR (me = %i AND you = %i)', $me, $you, $you, $me);
}
}
@@ -312,6 +315,8 @@ class Scenario{
$nation->build($env);
}
refreshNationStaticInfo();
CityHelper::flushCache();
$remainGenerals = $this->buildGenerals($env);
@@ -321,7 +326,7 @@ class Scenario{
$actions[] = ['DeleteEvent'];
$this->events[] = [
'cond'=>['Date', '==', $targetYear, '1'],
'cond'=>['Date', '>=', $targetYear, '1'],
'action'=>$actions
];
}
+57 -12
View File
@@ -53,6 +53,27 @@ class NPC{
$this->ego = $ego;
$this->text = $text;
$general = [
'leader'=>$leadership,
'power'=>$power,
'intel'=>$intel
];
if($char === '랜덤전특'){
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
}
else if($char === '랜덤내특'){
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
}
else if($char === '랜덤'){
if(Util::randBool(2/3)){
$this->charWar = \sammo\SpecialityConst::pickSpecialWar($general);
}
else{
$this->charDomestic = \sammo\SpecialityConst::pickSpecialDomestic($general);
}
}
else{
$char = \sammo\SpecCall($char);
if($char < 40){
$this->charDomestic = $char;
@@ -61,14 +82,12 @@ class NPC{
$this->charWar = $char;
}
}
}
public function build($env=[]){
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
$nationID = $this->nationID;
if(!\sammo\getNationStaticInfo($nationID)){
$nationID = 0;
};
$isFictionMode = (Util::array_get($env['fiction'], 0)!=0);
$year = $env['year'];
$month = $env['month'];
@@ -82,19 +101,45 @@ class NPC{
return false; //예약.
}
$db = DB::db();
$isNewGeneral = ($age == \sammo\GameConst::$adultAge);
if($age == \sammo\GameConst::$adultAge && $month == 1){
\sammo\pushWorldHistory(["<C>●</>1월:<Y>$name</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
$nationID = $this->nationID;
if($isFictionMode && $isNewGeneral){
$nationID = 0;
}
if($this->ego == null){
if(!\sammo\getNationStaticInfo($nationID)){
$nationID = 0;
};
$db = DB::db();
if($isNewGeneral){
\sammo\pushWorldHistory(["<C>●</>{$month}월:<Y>{$name}</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
}
if($this->ego == null || $isFictionMode){
$ego = mt_rand(0, 9);//TODO: 나중에 성격을 따로 분리할 경우 클래스를 참조.
}
else{
$ego = \sammo\CharCall($this->ego);
}
$affinity = $this->affinity;
$charWar = $this->charWar;
$charDomestic = $this->charDomestic;
if($affinity === 0 || $isFictionMode){
$affinity = mt_rand(1, 150);
}
if($isFictionMode){
$charWar = 0;
$charDomestic = 0;
}
$name = 'ⓝ'.$this->name;
$pictureID = $this->pictureID;
@@ -137,7 +182,7 @@ class NPC{
'npcid'=>$npcID,
'npc'=>2,
'npc_org'=>2,
'affinity'=>$this->affinity,
'affinity'=>$affinity,
'name'=>$name,
'picture'=>$picture,
'nation'=>$nationID,
@@ -162,9 +207,9 @@ class NPC{
'age'=>$age,
'belong'=>1,
'personal'=>$ego,
'special'=>$this->charDomestic,
'special'=>$charDomestic,
'specage'=>$specage,
'special2'=>$this->charWar,
'special2'=>$charWar,
'specage2'=>$specage2,
'npcmsg'=>$this->text,
'makelimit'=>0,
+19 -12
View File
@@ -32,7 +32,7 @@ class ScoutMessage extends Message{
$this->validScout = false;
}
if($this->validUntil <= new DateTime()){
if($this->validUntil <= new \DateTime()){
$this->validScout = false;
}
}
@@ -55,7 +55,7 @@ class ScoutMessage extends Message{
/**
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 반환
*/
public function agreeMessage(int $receiverID):int{
public function agreeMessage(int $receiverID, string &$reason):int{
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
if(!$this->id){
@@ -72,7 +72,7 @@ class ScoutMessage extends Message{
return $result;
}
$helper = new Engine\Personnel($this->src->nationID);
$helper = new Engine\Personnel($this->src->nationID, $this->src->generalID);
list($result, $reason) = $helper->scoutGeneral($receiverID);
@@ -96,6 +96,13 @@ class ScoutMessage extends Message{
['no'=>$this->src->generalID],
["<C>●</><Y>{$this->dest->generalName}</> 등용에 성공했습니다."]
);
pushGeneralHistory(
['no'=>$this->src->generalID],
"<C>●</>{$helper->year}{$helper->month}월:<Y>{$this->dest->generalName}</> 등용에 성공");
pushGeneralHistory(
['no'=>$this->dest->generalID],
"<C>●</>{$helper->year}{$helper->month}월:<D>{$this->src->nationName}</>(으)로 망명"
);
pushGeneralPublicRecord(
["<C>●</>{$helper->month}월:<Y>{$this->dest->generalName}</>(이)가 <D><b>{$this->src->nationName}</b></>(으)로 <S>망명</>하였습니다."],
$helper->year,
@@ -106,12 +113,12 @@ class ScoutMessage extends Message{
self::MSGTYPE_PRIVATE,
$this->src,
$this->dest,
"{$scoutNation['name']}(으)로 등용 제의 수락",
"{$this->src->nationName}(으)로 등용 제의 수락",
new \DateTime(),
new \DateTime('9999-12-31'),
Json::encode([
[
'delete'=>$this->id
])
]
);
$newMsg->send(true);
@@ -127,19 +134,19 @@ class ScoutMessage extends Message{
self::MSGTYPE_PRIVATE,
$this->src,
$this->dest,
"{$scoutNation['name']}(으)로 등용 제의 거부",
"{$this->src->nationName}(으)로 등용 제의 거부",
new \DateTime(),
new \DateTime('9999-12-31'),
Json::encode([
[
'delete'=>$this->id
])
]
);
$newMsg->send(true);
return self::DECLINED;
}
public function declineMessage(int $receiverID):int{
public function declineMessage(int $receiverID, string &$reason):int{
if(!$this->id){
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
}
@@ -167,8 +174,8 @@ class ScoutMessage extends Message{
}
$db = DB::db();
$srcGeneral = $db->queryFirstRow('SELECT `name`, nation FROM nation WHERE `no`=%i', $srcGeneralID);
$destGeneral = $db->queryFirstRow('SELECT `name`, nation, `level` FROM nation WHERE `no`=%i', $destGeneralID);
$srcGeneral = $db->queryFirstRow('SELECT `name`, nation FROM general WHERE `no`=%i', $srcGeneralID);
$destGeneral = $db->queryFirstRow('SELECT `name`, nation, `level` FROM general WHERE `no`=%i', $destGeneralID);
if($date === null){
$date = new \DateTime();
}
+91 -44
View File
@@ -26,45 +26,58 @@ class SpecialityConst{
//음수 : 절대값 %, 양수 : 상대적 비중
const DOMESTIC = [
1 => ['경작', 1, self::STAT_INTEL],
2 => ['상재', 1, self::STAT_INTEL],
3 => ['발명', 1, self::STAT_INTEL],
1 => ['경작', 1, [self::STAT_INTEL]],
2 => ['상재', 1, [self::STAT_INTEL]],
3 => ['발명', 1, [self::STAT_INTEL]],
10 => ['축성', 1, self::STAT_POWER],
11 => ['수비', 1, self::STAT_POWER],
12 => ['통찰', 1, self::STAT_POWER],
10 => ['축성', 1, [self::STAT_POWER]],
11 => ['수비', 1, [self::STAT_POWER]],
12 => ['통찰', 1, [self::STAT_POWER]],
20 => ['인덕', 1, self::STAT_LEADERSHIP],
20 => ['인덕', 1, [self::STAT_LEADERSHIP]],
30 => ['거상', -2.5, self::DISABLED],
31 => ['귀모', -2.5, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
30 => ['거상', -2.5, [self::DISABLED]],
31 => ['귀모', -2.5, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
];
const WAR = [
40 => ['귀병', 1, self::STAT_INTEL | self::ARMY_WIZARD | self::REQ_DEXTERITY],
40 => ['귀병', 1, [self::STAT_INTEL | self::ARMY_WIZARD | self::REQ_DEXTERITY]],
41 => ['신산', 1, self::STAT_INTEL | self::ARMY_WIZARD],
42 => ['환술', -5, self::STAT_INTEL | self::ARMY_WIZARD],
43 => ['집중', 1, self::STAT_INTEL | self::ARMY_WIZARD],
44 => ['신중', 1, self::STAT_INTEL | self::ARMY_WIZARD],
45 => ['반계', 1, self::STAT_INTEL | self::ARMY_WIZARD],
41 => ['신산', 1, [self::STAT_INTEL]],
42 => ['환술', -5, [self::STAT_INTEL]],
43 => ['집중', 1, [self::STAT_INTEL]],
44 => ['신중', 1, [self::STAT_INTEL]],
45 => ['반계', 1, [self::STAT_INTEL]],
50 => ['보병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_FOOTMAN],
51 => ['궁병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_ARCHER],
52 => ['기병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_CAVALRY],
53 => ['공성', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_SIEGE],
50 => ['보병', 1, [
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_FOOTMAN,
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_FOOTMAN
]],
51 => ['궁병', 1, [
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_ARCHER,
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_ARCHER
]],
52 => ['기병', 1, [
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_CAVALRY,
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_CAVALRY
]],
53 => ['공성', 1, [
self::STAT_LEADERSHIP | self::REQ_DEXTERITY | self::ARMY_SIEGE,
self::STAT_POWER | self::REQ_DEXTERITY | self::ARMY_SIEGE,
self::STAT_INTEL | self::REQ_DEXTERITY | self::ARMY_SIEGE
]],
60 => ['돌격', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
61 => ['무쌍', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
62 => ['견고', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
63 => ['위압', 1, self::STAT_LEADERSHIP | self::STAT_POWER],
60 => ['돌격', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
61 => ['무쌍', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
62 => ['견고', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
63 => ['위압', 1, [self::STAT_LEADERSHIP, self::STAT_POWER]],
70 => ['저격', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
71 => ['필살', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
72 => ['징병', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
73 => ['의술', -2, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
74 => ['격노', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
75 => ['척사', 1, self::STAT_LEADERSHIP | self::STAT_POWER | self::STAT_INTEL],
70 => ['저격', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
71 => ['필살', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
72 => ['징병', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
73 => ['의술', -2, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
74 => ['격노', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
75 => ['척사', 1, [self::STAT_LEADERSHIP, self::STAT_POWER, self::STAT_INTEL]],
];
public static function getInvDomestic(string $name){
@@ -102,14 +115,18 @@ class SpecialityConst{
private static function calcCondGeneric(array $general) : int {
$myCond = 0;
$leader = $general['leader']??50;
$power = $general['power']??50;
$intel = $general['intel']??50;
if ($leader * 0.95 > $power && $leader * 0.95 > $intel) {
$myCond |= STAT_LEADERSHIP;
$myCond |= self::STAT_LEADERSHIP;
}
else if($power >= $intel){
$myCond |= STAT_POWER;
$myCond |= self::STAT_POWER;
}
else {
$myCond |= STAT_INTEL;
$myCond |= self::STAT_INTEL;
}
return $myCond;
@@ -117,11 +134,11 @@ class SpecialityConst{
private static function calcCondDexterity(array $general) : int {
$dex = [
static::ARMY_FOOTMAN => $general['dex0'],
static::ARMY_ARCHER => $general['dex10'],
static::ARMY_CAVALRY => $general['dex20'],
static::ARMY_WIZARD => $general['dex30'],
static::ARMY_SIEGE => $general['dex40'],
static::ARMY_FOOTMAN => $general['dex0']??0,
static::ARMY_ARCHER => $general['dex10']??0,
static::ARMY_CAVALRY => $general['dex20']??0,
static::ARMY_WIZARD => $general['dex30']??0,
static::ARMY_SIEGE => $general['dex40']??0,
];
$dexSum = array_sum($dex);
@@ -135,7 +152,7 @@ class SpecialityConst{
return 0;
}
if($dexSum){
if(!$dexSum){
return array_rand($dex);
}
@@ -148,11 +165,19 @@ class SpecialityConst{
$myCond = static::calcCondGeneric($general);
foreach(self::DOMESTIC as $id=>list($name, $weight, $cond)){
if(!($cond & $myCond)){
foreach(self::DOMESTIC as $id=>list($name, $weight, $conds)){
$valid = false;
foreach($conds as $cond){
if($cond === ($cond & $myCond)){
$valid = true;
break;
}
}
if(!$valid){
continue;
}
if($weight < 0){
$pAbs[$id] = -$weight;
}
@@ -162,14 +187,21 @@ class SpecialityConst{
}
if($pAbs){
if($pRel){
$pAbs[0] = max(0, 100 - array_sum($pAbs));
}
$id = Util::choiceRandomUsingWeight($pAbs);
if($id){
return $id;
}
}
return Util::choiceRandomUsingWeight($pRel);
$id = Util::choiceRandomUsingWeight($pRel);
if($id){
return $id;
}
return static::pickStatickWar($general);
}
public static function pickSpecialWar(array $general) : int{
@@ -180,8 +212,15 @@ class SpecialityConst{
$myCond = static::calcCondGeneric($general);
$myCond |= static::calcCondDexterity($general);
foreach(self::WAR as $id=>list($name, $weight, $cond)){
if(!($cond & $myCond)){
foreach(self::WAR as $id=>list($name, $weight, $conds)){
$valid = false;
foreach($conds as $cond){
if($cond === ($cond & $myCond)){
$valid = true;
break;
}
}
if(!$valid){
continue;
}
@@ -201,13 +240,21 @@ class SpecialityConst{
}
if($pAbs){
if($pRel){
$pAbs[0] = max(0, 100 - array_sum($pAbs));
}
$id = Util::choiceRandomUsingWeight($pAbs);
if($id){
return $id;
}
}
return Util::choiceRandomUsingWeight($pRel);
$id = Util::choiceRandomUsingWeight($pRel);
if($id){
return $id;
}
return static::pickStatickWar($general);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"title":"【역사모드1】 황건적의 난",
"startYear":184,
"startYear":181,
"life":1,
"fiction":0,
"nation":[
+1 -1
View File
@@ -1,6 +1,6 @@
{
"title":"【역사모드10】 칠종칠금",
"startYear":225,
"startYear":222,
"life":1,
"fiction":0,
"nation":[

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