Compare commits

...
422 Commits
Author SHA1 Message Date
Hide_D 543fc15553 updateServer 삭제 2018-04-01 03:22:05 +09:00
Hide_D 1804b72638 git fetch && archive로 동작 변경. 2018-04-01 03:21:51 +09:00
Hide_D 9c19e4e92b validator에 errorStr 함수로 묶어서 보여주는 기능 추가 2018-04-01 02:59:54 +09:00
Hide_D b732b9bf40 gitignore에 세부 서버를 ignore 2018-04-01 01:36:40 +09:00
Hide_D 25ec9a2579 파일 위치를 twe에서 hwe로 옮김. 2018-04-01 01:23:44 +09:00
Hide_D 1ddd26c8a1 NPC 생성시 버그 수정
서버 리셋되었을 때 세션 값 안정을 위해 serverID 개념을 추가.
2018-04-01 01:20:35 +09:00
Hide_D 0f97ae8da9 DB 로그인을 utf8이 아니라 utf8mb4로 변경 2018-04-01 00:35:35 +09:00
Hide_D 3ea95da4a6 세션 시작 방식을 Session 클래스를 이용하도록 변경 2018-04-01 00:28:55 +09:00
Hide_D 0b584c7b0d game의 row를 1개로 강제 2018-03-31 23:45:00 +09:00
Hide_D 3875a345c9 game table을 대상으로 하는 update, select에서 no=1 과 관련된 부분을 limit 1 로 변경 2018-03-31 23:21:46 +09:00
Hide_D f78bdc6c6c requireLogin의 동작 방식을 변경, path에 null이 지정되면 json 반환 2018-03-31 22:42:50 +09:00
Hide_D 117f820eaa 서버 리셋에서 디렉토리 초기화 추가
- 서버 선택 창 일부 변경
2018-03-31 20:17:28 +09:00
Hide_D 87c6130d17 Scenario 초기화 버그 수정
리셋 시 로그 초기화
2018-03-31 19:42:16 +09:00
Hide_D 8713bac296 조기 namespace\class 도입으로 new_lib.php 삭제 2018-03-31 19:17:36 +09:00
Hide_D c649e50f42 install_db.php로 대체된 reset.php 삭제 2018-03-31 19:15:40 +09:00
Hide_D 61af601075 테스트용으로 추가했던 코드를 삭제하고, gitignore에 추가 2018-03-31 18:52:42 +09:00
Hide_D 29a21c41ab getTypename 삭제. GameUnitDetail::byID(), ::all()로 대체가능 2018-03-31 18:52:12 +09:00
Hide_D 8dc7f3bad5 scenario 이름은 build시에 db에 넣을 수 있으므로, getScenario() 삭제 2018-03-31 18:33:53 +09:00
Hide_D d09c71c729 CityConst에서 참고 가능한 자료들은 CityConst를 이용하도록 수정
Scenario에서 __construct에서 꼭 다 할 필요는 없는 코드들을 뒤로 미룸.
2018-03-31 18:25:56 +09:00
Hide_D 6fe744f2c1 meekroDB 버그로 우회 2018-03-31 18:01:14 +09:00
Hide_D 6a4c8e236a multi_query warning 나는 문제 해결 2018-03-31 17:18:35 +09:00
Hide_D 17a889ae13 SetNationFront 버그 수정 2018-03-31 16:18:28 +09:00
Hide_D 31d9bac59c Scenario 세팅 과정에 문제 해결
SetNationFront 함수도 수정
2018-03-31 16:06:24 +09:00
Hide_D 71f5311b1d var_dump가 남아있던 버그 수정 2018-03-31 14:32:23 +09:00
Hide_D 8a1ba431e5 cutTurn, cutDay 오동작하는 문제 해결 2018-03-31 14:31:50 +09:00
Hide_D f19707989b 공백지 생성은 가능. 추가 버그 확인 중 2018-03-31 14:13:19 +09:00
Hide_D 8abe3bf638 불필요한 func_install.php 제거 2018-03-31 13:53:21 +09:00
Hide_D 4550754208 db 스키마 기본 문자셋을 utfmb4로 수정
install 시 운영자 셍성
2018-03-31 13:49:53 +09:00
Hide_D 81a439439b cutDay가 변경된 월을 반환하도록 수정
설치 도구를 구현.
2018-03-31 05:44:16 +09:00
Hide_D d9e5d5b2cd 전투 공식을 새로 ㅈ가성한 GameUnitConst와 GameUnitDetail을 따르도록 수정 2018-03-31 05:28:19 +09:00
Hide_D 1ab65c7ac5 관리자 페이지에서 병종 정보, 리셋 데이터 제거 2018-03-31 05:27:59 +09:00
Hide_D 6775c06d3e 병종에 정보 텍스트 포함.
징병, 모병 페이지 내용을 GameUnitConst, GameUnitDetail에 기반하도록 변경
- 추가로 금,쌀을 소수점을  포함하도록 변경
2018-03-31 05:21:47 +09:00
Hide_D c976e55d72 병종 기본 설정 추가 수정 2018-03-31 04:45:12 +09:00
Hide_D a1d37e5697 도시와 병종에 대한 초기 값 클래스 추가
- 도시의 경우 DB 초기화를 위한 build() 함수 포함
2018-03-31 03:57:16 +09:00
Hide_D 63aa31cb92 sql 일괄 동작 재 수정 2018-03-31 00:33:39 +09:00
Hide_D 91232a83eb sql 파일 을 불러오는 동작을 잘못 수행하는 점 해결리 2018-03-31 00:24:06 +09:00
Hide_D 48db8454c9 Validator 추가 2018-03-31 00:23:48 +09:00
Hide_D efb3cab370 valitron 한국어 지원 추가
https://github.com/vlucas/valitron/pull/244
2018-03-30 22:46:50 +09:00
Hide_D ad4ba85f50 Valitron을 composer에 추가 2018-03-30 22:07:41 +09:00
Hide_D e87fff35ee 스킨 기능 삭제 2018-03-29 22:32:23 +09:00
Hide_D 3082a3f0d9 인스톨러 구현 중 2018-03-29 22:19:11 +09:00
Hide_D 8345201cd0 turnterm을 0~7이 아니라 분 단위로 돌도록 개선
- addTurn, cutTurn 함수들을 재 구현
2018-03-29 22:15:35 +09:00
Hide_D 3b8c764544 install_db 과정에서 리셋 버그 수정 2018-03-29 02:38:04 +09:00
Hide_D 622ba5945a 세부 서버 install_db 구현 2018-03-29 02:24:20 +09:00
Hide_D 93e5082fdf Scenario build 마무리 2018-03-29 02:10:01 +09:00
Hide_D 0d4f4d06f3 sql 파일 정리 2018-03-29 01:43:03 +09:00
Hide_D 9719995f94 install_db 작성 준비 2018-03-29 01:37:58 +09:00
Hide_D fd0f5edfe3 build 전까진 실제 장수를 알 수 없는 점 보완 2018-03-29 01:23:58 +09:00
Hide_D 7f01e90573 구 이벤트 삭제 2018-03-29 00:59:52 +09:00
Hide_D 9d9af08ab6 성인 연령 빼먹은거 수정 2018-03-29 00:57:37 +09:00
Hide_D 79d74b1ed1 성인 연령(14세??)를 GameConst로 정의 2018-03-29 00:57:10 +09:00
Hide_D 9392d6f043 old 폴더 내용물 삭제 2018-03-29 00:53:44 +09:00
Hide_D bf81851ce2 시나리오 파일 삭제! 2018-03-29 00:52:54 +09:00
Hide_D a146cb69d0 j_load_scenario.php 에서 볼 수 있는 요약 형태본 추가
- 소소한 버그 수정
2018-03-29 00:50:35 +09:00
Hide_D 39f6056e94 Scenario에서 event를 추가할때 json_encode를 빼먹은 점 수정 2018-03-29 00:38:55 +09:00
Hide_D e56a2fa6fa 게임 내부에 이벤트 핸들러 통합 2018-03-29 00:36:50 +09:00
Hide_D d9de5a39e0 Scenario build 1차 완료
- NPC 생성 로직 수정
- 생성 안된 장수는 event로 넘김
- 완료된 event 삭제하는 action 추가
2018-03-29 00:27:42 +09:00
Hide_D 78260ecf30 game 테이블의 img를 show_img_level로 변경 2018-03-29 00:27:03 +09:00
Hide_D 38986b65f8 시나리오 국가 설정 코드 2018-03-28 20:39:30 +09:00
Hide_D 4326530dec colset을 can_change_flag로 변경. 2018-03-28 20:39:12 +09:00
Hide_D e8e18c059f CityHelper에 '국가명' 한정으론 오작동할 수 있으므로, fallback 추가 2018-03-28 19:16:34 +09:00
Hide_D 907ba0b26e CityHelper 추가 2018-03-28 19:14:11 +09:00
Hide_D 78a1ca3651 "-" 대신 명시적인 null 선언 2018-03-28 19:10:04 +09:00
Hide_D e4c1ca7f34 npcmatch -> affinity 2018-03-28 18:15:52 +09:00
Hide_D b7237140c8 Scenario\Nation 클래스 초기화
- 버그 수정
2018-03-28 17:48:05 +09:00
Hide_D f442ae3b97 json에서 장수 등록시 국가 소속 장수를 셀 수 있으므로 genCnt 속성 삭제 2018-03-28 17:30:36 +09:00
Hide_D 9b139e54f4 install.php에 1차적으로 ChangeCity를 물림 2018-03-28 17:20:35 +09:00
Hide_D c1976b5b7a 사실 모드 시나리오들에 초기 내정치 부여 코드 추가 2018-03-28 17:07:30 +09:00
Hide_D 51783c1845 ChangeCity를 시나리오에서 처리할 수 있도록 '조건 방식' 추가 2018-03-28 16:53:59 +09:00
Hide_D 89c45421d8 오타 수정 2018-03-28 06:07:32 +09:00
Hide_D fad29e3faf 이민족 침입 일부 구현 2018-03-28 06:05:16 +09:00
Hide_D b2896d09ec ChangeCity 버그 수정.
RaiseInvader를 하나로 통합
2018-03-28 05:32:31 +09:00
Hide_D 6c84d184fe ChangeCity 추가 버그 수정 2018-03-28 05:07:43 +09:00
Hide_D 7e91b2534f ChangeCity 버그 수정 2018-03-28 05:06:38 +09:00
Hide_D 0675126b82 ChangeCity 액션 추가 2018-03-28 04:59:04 +09:00
Hide_D ee4518fc5c randF 등을 Util로 옮겼으므로 func.php에서 제거 2018-03-28 04:58:57 +09:00
Hide_D dc6596b5ab 자주 사용할 random, 수식 비교 함수 추가 2018-03-28 04:42:13 +09:00
Hide_D 327ea72214 로직 단축 명령 버그 수정 2018-03-28 03:20:12 +09:00
Hide_D 6913fe0313 Condition에 Date 추가.
Condition에 logic 단축 명령 추가
2018-03-28 03:19:05 +09:00
Hide_D e739b7a39f 시나리오에 기본값으로 initialEvents와 events추가 2018-03-28 02:55:42 +09:00
Hide_D a03eac6f2a 시나리오용 EventEngine.... 틀만 완성! 2018-03-28 02:45:44 +09:00
Hide_D 0ad8db5a63 리셋 시 시나리오 정보를 간단히 보여주는 기능 추가 2018-03-27 02:44:28 +09:00
Hide_D 492a7676c6 install.php, install_db.php 분리 2018-03-27 01:14:20 +09:00
Hide_D b9d21c29c0 gitignore에서 d_setting 폴더 관련 변경
- 기타 예전 python 코드에서 사용하던 gitignore 파트 삭제
- 누락되었던 파일 추가
2018-03-27 01:09:55 +09:00
Hide_D 2b9d47870b autoload 순서 변경 2018-03-27 00:42:33 +09:00
Hide_D 88e007ac00 서버 관리 폼 수정
부운영자, 운영자 권한 표기
2018-03-26 23:43:27 +09:00
Hide_D a2100f503f 새 리셋 툴 준비 2018-03-26 00:27:51 +09:00
Hide_D bc2c480986 입구 사소한 버그 수정
- 관리자 페이지가 html여도 되므로 html로 변경
2018-03-25 22:53:15 +09:00
Hide_D 5e29443256 js, css파일 위치 이동 2018-03-25 22:41:30 +09:00
Hide_D bd975e4f79 오래된 유저 삭제 버그 수정 2018-03-25 22:12:00 +09:00
Hide_D 5c415e4f61 샘플 코드 제거 2018-03-25 21:56:56 +09:00
Hide_D 83d619835f 새 회원 관리창 1차 구현 완료. 2018-03-25 21:46:03 +09:00
Hide_D 7a34cc4089 Setting 클래스 변경. 해당 클래스에서 한국어명 등을 모두 관리.
- 해당 클래스를 참조하는 코드들 수정
2018-03-25 17:56:07 +09:00
Hide_D b7c03e5554 로그아웃 관련 __set 버그 해결 2018-03-25 17:28:35 +09:00
Hide_D 503ad43a9e 로그인, 로그아웃시 member_log에 기록 남김 2018-03-25 17:19:07 +09:00
Hide_D 13ee593548 GameConst 클래스의 항목들을 public static으로 변경. 2018-03-25 01:19:37 +09:00
Hide_D bcea562636 js 파일 이동.
md5-min.js 제거
func.php 이동
2018-03-25 01:09:44 +09:00
Hide_D b1bea8dbc2 app.css, config.css를 css디렉토리로 이동 2018-03-25 01:07:29 +09:00
Hide_D 3df5de5eb5 관리자도 로그인할 수 없는 문제 해결 2018-03-25 00:48:44 +09:00
Hide_D c3cb100947 일부 코드 수정
- index.php에서 javascript string 이어붙이기 문제
- RestAPIHelper 클래스
- 세부 서버 Autoload 수정
2018-03-25 00:45:23 +09:00
Hide_D 3fbf1d4b0c class_exists 다시 수정 2018-03-25 00:33:31 +09:00
Hide_D 51d62b54d4 test.php 수정 2018-03-25 00:32:17 +09:00
Hide_D 8c03d1fa31 class_exists에 namespace가 지정되지 않은 문제 해결 2018-03-25 00:30:44 +09:00
Hide_D cab0401dfa 불필요한 autoload 제거
namespace 누락한 파일 수정
2018-03-25 00:24:12 +09:00
Hide_D d777ca97c6 f_config/DB.php 제거
class_exists('RootDB')로 대체 가능
2018-03-25 00:21:06 +09:00
Hide_D 9e1aadf486 getDB(), getRootDB()를 autoload 클래스로 변경
- 각각 DB::db(), RootDB::db()임.
2018-03-25 00:07:37 +09:00
Hide_D bb1a496835 composer autoload 위치 변경
gitignore에 해당 위치의 파일 추가
2018-03-24 23:31:43 +09:00
Hide_D 2cf6d0f01a f_config/app.php 삭제, AppConf 클래스로 통합 2018-03-24 22:50:46 +09:00
Hide_D e97bb32fba autoload 경로에 deny용 .htaccess 추가 2018-03-24 22:14:20 +09:00
Hide_D 0d4c3db333 skin을 삭제하므로, unfont()도 삭제 2018-03-24 22:05:15 +09:00
Hide_D 157ecdbf2a 많은 유틸리티 함수를 Util, FileUtil, WebUtil로 이동 2018-03-24 22:03:54 +09:00
Hide_D b5cba27df9 util 클래스 명을 PSR1에 맞게 Util로 재 명명 2018-03-24 21:31:31 +09:00
Hide_D 002f9ba6cf _Setting, _String, _Time 클래스 재 명명
- autoload로 변환
2018-03-24 21:28:12 +09:00
Hide_D a3f83d1e95 Session 클래스 수정.
- Session클래스 내에서 global setter, getter 재정의
- Session클래스에서 static 함수로 getUserID, getUserGrade 재정의
- 내부 서버에서 getUserID, getUserGrade를 쓰던 것 Session 클래스로 통일
- SESSION.php가 requireLogin 기능을 수행하던것을 Session의 static 함수로 통합
2018-03-24 20:04:55 +09:00
Hide_D 4bcdf8b208 Session을 autoload에 포함 2018-03-24 19:01:13 +09:00
Hide_D 037a29ad02 autoload 경로 재 변경
kakao를 별도의 namespace로 분리
외부 class의 namespace 문제 해결
2018-03-24 18:46:37 +09:00
Hide_D dc507601f5 util 클래스 변경
게임 내부 파일에 대해서 autoloader 적용
2018-03-24 18:22:04 +09:00
Hide_D 462bafe806 autoloader 구성.
class 정의
2018-03-24 18:13:03 +09:00
Hide_D 3363b547d5 firephp 추가 2018-03-24 16:59:04 +09:00
Hide_D 6068e1d618 새 세부 서버 인스톨러 준비 2018-03-24 16:54:51 +09:00
Hide_D 6f186125e3 NULL -> null 2018-03-24 12:38:03 +09:00
Hide_D ec3d0c5f68 index.php 페이지 살짝 수정 2018-03-24 12:35:48 +09:00
Hide_D c307215a85 회원 가입시 닉네임 길이를 mb_strlen으로 해야하는 점 수정
아이디를 대소문자 다 받던 것 수정(소문자로 자동 변경)
2018-03-23 10:19:27 +09:00
Hide_D e4300fa5f6 회원 관리 class이름만 변경 2018-03-22 04:00:37 +09:00
Hide_D 1128f93fcd 회원 관리 페이지 초안 작성 2018-03-22 03:58:25 +09:00
Hide_D 8e6fb7e9cf returnJson 동작 방식 일부 수정 2018-03-22 03:23:15 +09:00
Hide_D ca3b72808a 사용하지 않는 구 클래스 삭제 2018-03-22 03:22:57 +09:00
Hide_D e6c02deacd jquery 구버전 삭제 2018-03-22 03:16:34 +09:00
Hide_D a5110fa1e8 j_login.php를 제외한 모든 기존 login 코드 폐기 2018-03-22 03:15:47 +09:00
Hide_D c699824cfc Lock클래스의 경로가 install 초기 상태에서는 permission이 보장되지 않으므로 수정 2018-03-22 03:13:44 +09:00
Hide_D cc98ed9040 입구 페이지에 session_write_close() 조기 호출 2018-03-22 02:59:24 +09:00
Hide_D f7b2f88910 파일명 변경2 2018-03-22 02:56:05 +09:00
Hide_D ef67f7ec4e 파일명 변경 2018-03-22 02:54:49 +09:00
Hide_D e5ff6b2218 입구 페이지 파일명 정리 2018-03-22 02:50:33 +09:00
Hide_D 23e0ecf17c 추후 업데이트 기능 추가 대비 2018-03-22 02:46:16 +09:00
Hide_D e9672c98ef 일부 미사용 변수 정리
대문 css 정리
2018-03-22 02:40:32 +09:00
Hide_D 683138457f 카카오로그인 버튼 반영.
비밀번호 찾기 위치는 고민중
2018-03-21 03:20:04 +09:00
Hide_D f7a9445954 탈퇴 프로세스 추가 2018-03-21 02:57:59 +09:00
Hide_D f3d7a6a1a7 내 정보 관리 새로 구현
- 비밀번호 수정,
- 전콘 제거, 전콘 변경 기능 추가
2018-03-20 02:59:40 +09:00
Hide_D b27562613e <!DOCTYPE html> 2018-03-19 23:23:05 +09:00
Hide_D 005a495fdb meta charset="UTF-8" 2018-03-19 23:16:57 +09:00
Hide_D 0518671816 유저 권한을 $SESSION을 이용하는 형태로 변경 2018-03-19 22:57:01 +09:00
Hide_D bf5bc5b948 불필요해진 app.js, config.js 제거 2018-03-19 22:27:10 +09:00
Hide_D 280e81250c 불필한 const varname -> string 대체 제거.
필요할 곳은 나중에 처리하는 것으로.
2018-03-19 22:26:07 +09:00
Hide_D c44b836e3e ajax 코드에서 끝부분 sleep 제거 2018-03-19 20:40:00 +09:00
Hide_D 3bdea57318 server action이 없을 경우 에러를 반환하도록 수정 2018-03-19 20:38:47 +09:00
Hide_D ff4addbf28 서버 post를 string으로. 2018-03-19 20:36:37 +09:00
Hide_D 1885c44610 git ignore 추가 2018-03-19 20:23:40 +09:00
Hide_D e483fe93a4 서버 관리 패널 일부 수정 2018-03-19 02:52:50 +09:00
Hide_D efa6cc2889 서버 운영자 페이지 수정 2018-03-19 00:31:04 +09:00
Hide_D 1c4709ea65 Setting 클래스들 접근 방법을 변경
-global 없이 사용가능
-isExist()를 isExists()로 변경
2018-03-19 00:30:52 +09:00
Hide_D 95021f0887 설치시 카카오 계정을 설치하라고 TODO로 넣어두기...만 함 2018-03-18 23:11:31 +09:00
Hide_D 102dff43f4 tmp_kakao를 경로 이동 2018-03-18 13:30:04 +09:00
Hide_D 1a96d55ed7 conf_kakao.orig.php 파일로 이동 2018-03-18 13:30:04 +09:00
Hide_D 4df53fbc7e gitignore에 conf*.php 추가 가능하도록 변경 2018-03-18 13:29:54 +09:00
Hide_D 1ad7d17bbe 메일 전송 기능 삭제. 나중에 필요하면 다시 추가하기로. 2018-03-18 05:48:56 +09:00
Hide_D 6130bd22cb 카카오로그인 연동 방식 변경
-oauth 테이블 삭제
-비밀번호 변경 기능 추가(카카오톡 나에게 보내기)
2018-03-18 05:44:20 +09:00
Hide_D bd26ee858c 설치시 서버의 기본 경로를 받도록 설정 2018-03-18 05:19:28 +09:00
Hide_D b52bd4e4e2 카카오로그인을 이용한 가입, 로그인 프로세스 보완 2018-03-18 04:12:37 +09:00
Hide_D be7df8adac 설치시 system를 누락하여 추가 2018-03-18 02:08:07 +09:00
Hide_D a573969897 서버 선택 창에서 '로그인 된 경우' 정상 작동하지 않는 문제 해결
- 추가로 이미지가 틀어져서 나오는 문제도 해결
2018-03-18 00:44:44 +09:00
Hide_D 2b85cd09bb 관리자 생성시 이전 session이 남아있던 문제 해결 2018-03-18 00:24:33 +09:00
Hide_D 3e44c861e2 인스톨시 권한을 5(부운영자)로 설정한 것을 6으로 변경 2018-03-18 00:21:37 +09:00
Hide_D 2ff8f51b01 기존 인스톨 코드 삭제 2018-03-18 00:16:55 +09:00
Hide_D ce169f356e common install 프로세스 완료. 2018-03-18 00:16:17 +09:00
Hide_D 5a0b358b60 common install에서 conf.php 생성까지 완료 2018-03-17 23:49:32 +09:00
Hide_D 6cb55a1d97 join_form에서 submit버튼 검사 추가 2018-03-17 23:49:17 +09:00
Hide_D cb133bbeaa comment 추가 2018-03-17 23:00:47 +09:00
Hide_D 63ab8bd6f7 공용 테이블 스키마 변경 2018-03-17 22:54:57 +09:00
Hide_D cb30074c54 common_schema.sql 파일을 이동 2018-03-17 22:34:24 +09:00
Hide_D 96e4c08ee9 generateFileUsingSimpleTemplate의 변환 규칙 변경 2018-03-17 22:08:34 +09:00
Hide_D 7f885f7a69 generateFileUsingSimpleTemplate() 함수 작성 2018-03-17 21:42:39 +09:00
Hide_D 065107033b 새로운 설치 코드 준비 2018-03-17 21:21:44 +09:00
Hide_D 7486ff3eec 기존의 삭제할 set.php 2018-03-17 20:03:17 +09:00
Hide_D b16c6c8d23 일부 회원 관리용 버튼 div id 변경 2018-03-17 14:42:57 +09:00
Hide_D 8caa086c38 새 서버 목록 class명 살짝 변경 2018-03-17 07:49:38 +09:00
Hide_D 135254402d 새 서버 선택 페이지 중 '장수 선택', '장수 생성', '입장' 레이아웃을 구현 2018-03-17 07:27:13 +09:00
Hide_D ac28032032 server_basic_info 문법 오류 수정 2018-03-17 06:20:50 +09:00
Hide_D fa56fc0318 서버 선택창 일부 수정.
서버 세부 정보를 받아올 수 있도록 수정 준비
2018-03-17 06:20:22 +09:00
Hide_D d93d5afdee 내부 서버 문법 오류 수정 2018-03-17 06:19:54 +09:00
Hide_D f557e1f241 서버 선택창 추가 변경.
- div absolute로 강제로 띄우는 것을 제거
- '폐쇄중' 까지 정상적으로 띄움
2018-03-17 05:55:55 +09:00
Hide_D cd1456caa7 서버 선택 리스트 재작성 2018-03-17 05:12:11 +09:00
Hide_D fc8dc09945 로그인 기능 임시 추가 2018-03-16 02:40:56 +09:00
Hide_D e2610d7e41 _Session 클래스 일부 변경 2018-03-16 02:40:49 +09:00
Hide_D 3fcaa153f9 회원 가입시 global_salt를 올바르게 사용하지 않는 문제 해결 2018-03-16 02:20:39 +09:00
Hide_D cdae15fd41 사용하지 않는 _Log, _Process 삭제 2018-03-16 01:56:38 +09:00
Hide_D 498ebd6589 사용하지 않는 class._JSON.php 제거 2018-03-16 00:49:04 +09:00
Hide_D 26b1a89688 join, login 위치 변경 2018-03-15 23:33:40 +09:00
Hide_D ee8281dd06 카카오 로그인 상수 GET,POST,DELETE 제거 2018-03-13 19:43:10 +09:00
Hide_D 94181ee3d7 로그인 대문 페이지 재작성 시작 2018-03-13 02:15:39 +09:00
Hide_D d4c75223a8 회원 가입 기록을 남기도록 설정 2018-03-10 04:53:24 +09:00
Hide_D 88c560405e 로그인 프레임 일부 수정 2018-03-10 04:48:25 +09:00
Hide_D 4b1e3e325e 카카오 로그인을 이용한 가입 테스트 2018-03-10 04:16:17 +09:00
Hide_D e00b763f43 bootstrap 추가
sha512 js 추가
2018-03-09 20:33:01 +09:00
Hide_D f3d5922340 PW 암호화에 사용할 globalSalt 개념 추가 2018-03-09 02:59:41 +09:00
Hide_D 704096358b 수정된 DB, SETING.php 동작 안하는 문제 해결 2018-03-09 02:18:59 +09:00
Hide_D 6ffee27f83 index, install 페이지 변경 준비 2018-03-08 00:00:19 +09:00
Hide_D fffd45b2e0 logger 추가 2018-03-07 23:21:06 +09:00
Hide_D 1b70485c9a banner, google_analysis 코드 제거 2018-03-07 21:33:19 +09:00
Hide_D bc3a6cf86e 통합 서버 관리자의 파일 경로 코드를 문자열로 변경. 2018-03-07 21:29:48 +09:00
Hide_D 7206826974 필요하지 않게된 ADODB 제거 2018-03-07 01:03:25 +09:00
Hide_D 0c9be5c53f 루트DB를 관리하는 방식을 통째로 변경
- DB 불러오는 방식을 기존의 set.php에서 conf.php의 getRootDB()를 이용하도록 변경
- ADODB 에 기반한 _DB 클래스 폐기
- DBS.php 폐기
- _Setting 클래스 용도 변경
- 서버 목록 정의 방식을 하나로 모음
- 로그인시 세션에 사용자 등급을 추가
- "참여"(donation) 관련 코드 전면 제거
- 서버 리셋시 부운영자 비밀번호 문제 수정
- 서버 오픈,닫힘 여부를 새 서버 목록 정의 방식에 따르도록 수정
- DBS.php가 폐기 되었으므로 서버 오픈시 기본 정보를 json으로 받아오도록 하기 위하여 기본 준비
-  기존에 남아있던 세부 서버 로그인 처리 파일을 제거(enterPost.php)
- DBS.php 삭제로 전콘 변경시에도 각 서버로 json 호출을 하도록 하는 방식으로 준비
- 전콘을 수동으로 서버에 올린뒤 처리할 수 있도록 하던 legacy 코드 제거
- general 테이블에서 userlevel 컬럼을 삭제하고, 세션에 기록된 userGrade를 이용하도록 변경
- 벌점 제한을 모든 유저 공통으로 하도록 수정
- 세부 서버 리셋을 json ajax로 처리하도록 준비
2018-03-07 00:59:31 +09:00
Hide_D e8a9f73611 개별 서버마다 getDB() 함수를 부를 수 있도록 수정 2018-03-05 02:03:31 +09:00
Hide_D c49dcf8152 레거시 dbConn 함수를 우선 getDB() 함수에 기반하도록 변경 2018-03-05 00:49:31 +09:00
Hide_D 77395dd90e 컬러 코드에 전부 # 추가.
image 파일에는 #이 없어야 하므로 이후 대응 필요
2018-03-04 23:44:20 +09:00
Hide_D 0ab656349e scenario를 json 형태로 추가 2018-03-04 23:30:00 +09:00
Hide_D 8ced95cc5f 이전 코드에 빠진 부분 수정 2018-03-04 23:23:53 +09:00
Hide_D 30e1b365fa 레거시 코드 정리
$a[count($a)] = ""; 의 형태로 된부분을 변경
RegGeneral 함수 계통 손보는 중
2018-03-04 23:21:26 +09:00
Hide_D 536ff0988d adodb를 composer로 불러오도록 2018-03-04 19:06:46 +09:00
Hide_D a8477aed99 func_process에서 인사 관련(거병,건국,선양,하야,등용,임관,인재탐색) 함수를 별도로 분리 2018-03-04 18:53:22 +09:00
Hide_D 7cc5558e33 구 Legacy SQL 명령을 사용하는 함수 수정
increateRefresh(), RegNation(), RegCity()

$connect 인자가 필요없는 함수 수정
push*Log() 류
2018-03-04 18:43:53 +09:00
Hide_D a3791fa6fd func.php, func_rpcoess.php를 용도에 따라 분리 2018-03-04 00:56:04 +09:00
Hide_D 98fd5b450b 전콘 이미지 조건 표기 텍스트 변경 2018-03-03 18:23:01 +09:00
Hide_D 9903f5b624 $_basegold, $_baserice를 GameConst로 변경 2018-03-03 18:22:48 +09:00
Hide_D d1026aae0f command 계열 함수 func_command.php 로 이전
baclButton(), CoreBackButton(), closeButton()을 echo에서 return string 타입으로
2018-03-03 17:46:23 +09:00
Hide_D f66238bb38 등용장 처리 코드 리팩토링 2018-03-02 02:55:29 +09:00
Hide_D bebc7580bd 코드 내의 불필요한 모든 history 제거 2018-03-02 02:02:16 +09:00
Hide_D ea638b8221 addHistory(), addNationHistory()에서 history를 덧붙이는 과정 개선 2018-03-02 00:46:23 +09:00
Hide_D c0dfd42791 pushHistory에 DB connect가 필요하지 않으므로 인자 제거 2018-03-02 00:05:37 +09:00
Hide_D ae2272b249 msgOption에 alert 옵션 추가 2018-03-01 22:50:18 +09:00
Hide_D c48cf824eb 갠메를 이용하는 레거시 코드 제거 2018-03-01 20:33:40 +09:00
Hide_D a72452454c 메시지 전송 과정에서 전송자에 id, nation_id만 필요하도록 변경 2018-03-01 20:18:54 +09:00
Hide_D de4c2e0678 새 메시지 시스템 통합 준비 완료 2018-03-01 18:36:29 +09:00
Hide_D 33cc00cced 새메시지, contact_list 코드를 func_message.php로 이동 2018-03-01 04:44:02 +09:00
Hide_D dcb2903578 로그인되지 않은 경우에는 리스트 출력 없음 2018-03-01 04:35:08 +09:00
Hide_D 7af3c6e91a 새메시지, contact_list 추가 2018-03-01 04:30:24 +09:00
Hide_D 9e7450f977 array_map의 보완을 위한 dict_map 추가. python의 map과 유사하게 동작 2018-03-01 04:17:15 +09:00
Hide_D 3e7fdf8e90 새메시지용 basic_info 코드 추가 2018-03-01 03:48:57 +09:00
Hide_D 32207277d5 j_map.php에서 generalID가 세션에 지정되지 않은 경우를 대비 2018-03-01 03:48:32 +09:00
Hide_D 1f33908063 basic_info에 이젠 필요없는 lastContact 삭제 2018-03-01 03:34:03 +09:00
Hide_D 4b0352d8f0 새메시지, refreshMailboxList() 가 여러번 불릴 것에 대비 2018-03-01 03:31:31 +09:00
Hide_D e79a12cbc6 새메시지, 즐겨찾기 대상을 동적으로 계산하도록 수정 2018-03-01 03:26:00 +09:00
Hide_D 401167ca31 새메시지 변수명 정리 2018-03-01 02:58:35 +09:00
Hide_D 7efc03813b 간단한 국가 정보를 가져오는 코드들을 일부 통합. 2018-02-26 01:46:13 +09:00
Hide_D 2cd7d525a4 단순 국가 정보를 받아올 때 query하지 않고 저장된 값을 쓰도록 변경 2018-02-24 17:41:04 +09:00
Hide_D b28603d16f refeshNationStaticInfo 함수 추가
getNationStaticInfo 함수에 level 추가
2018-02-24 02:47:50 +09:00
Hide_D e5d923643d general 테이블에서 갠메 파트 제거 2018-02-22 02:09:59 +09:00
Hide_D 34cd58d8f3 메시지 전송 시스템을 새 시스템에 맞게 수정
국가의 기본 정보를 중복 쿼리 없이 받아오는 함수 추가
  - 해당 함수를 위해 국가색, 건국 등의 국가 정보가 바뀌는 경우 refresh
새 메시지 시스템 적용을 위해 메인 페이지 틀 변경
2018-02-22 02:04:54 +09:00
Hide_D 2fb005ec6d 메시지의 valid 여부를 option에서 제거 2018-02-22 01:08:06 +09:00
Hide_D 7ac82d2293 sendMessage sendRawMessage에 $validUntil 추가 2018-02-21 22:47:07 +09:00
Hide_D 86e42bb986 message db schema에 valid_until 추가 2018-02-21 22:42:57 +09:00
Hide_D 1450715c56 새 메시지, 메시지 수락/거절 동작 방식 변경 2018-02-21 22:37:54 +09:00
Hide_D a0314dad47 CriticalRatioDomestic 버그 수정(TM) 2018-02-21 12:51:48 +09:00
Hide_D c6fa91d022 scssphp 추가 2018-02-21 10:41:15 +09:00
Hide_D ba0439ece2 tm서버에 적용된 패치 수정을 같이 적용 2018-02-20 01:34:44 +09:00
Hide_D 5c96329b33 계략시 적 장수도 제대로 반영하도록 2018-02-19 00:39:19 +09:00
Hide_D cd16f832e2 계략에서 상대 도시 장수의 능력치를 처리하지 않는 문제 수정 2018-02-19 00:11:42 +09:00
Hide_D 63b897b9ac 내정 성공 확률을 기존 서버와 동일하게 변경 2018-02-18 21:47:40 +09:00
Hide_D 3b636a8b46 전투시에도 무력/지력 1/4씩 반영하도록 수정 2018-02-18 03:33:53 +09:00
Hide_D 68ace3f1dd 내정 시 무력/지력 1/4씩 추가 보너스 반영
- getGeneralLeadership 함수 추가
- getGeneralPower 함수 추가
- getGeneralIntel 함수 추가
- CriticalRatio 함수를 CriticalRatioDomestic 함수로 리팩토링
- 내정에 한해 lbonus를 계산하는 setLeadershipBonus 함수 추가
- 계략시 부상 정도를 반영하도록 수정
2018-02-18 03:15:14 +09:00
Hide_D 868a572175 전콘 변경시 이전 파일명을 제대로 추적하도록 변경 2018-02-18 01:39:34 +09:00
Hide_D b3166e2f00 deletePost unlink시 Windows에서 오동작 수정 2018-02-18 01:06:40 +09:00
Hide_D 20bf949a17 전콘 파일명을 랜덤하게 변경 2018-02-18 00:58:39 +09:00
Hide_D 47bdb068d5 npc_login 우회 기능 삭제 2018-02-17 23:47:38 +09:00
Hide_D 6610662f74 명예의 전당 등록 기준을 45세 이후로 수정 2018-02-17 18:24:09 +09:00
Hide_D 9329ea1668 호황/재난의 증감이 해당 도시의 치안에 따르도록 변경 2018-02-17 16:47:40 +09:00
Hide_D b47285c545 새메시지, 클라이언트 단 메시지 시스템 1차 완성 2018-02-13 01:01:02 +09:00
Hide_D cd243ce950 수락, 거절 전송을 위한 dummy 생성 2018-02-13 00:08:19 +09:00
Hide_D 6f8ac8dc6f 새메시지, 로딩 즉시 필요한 데이터들을 모두 비동기로 불러오도록 변경 2018-02-12 23:57:12 +09:00
Hide_D 5d04b208a6 기본 정보를 basic_info.json으로 분리함. 2018-02-12 23:35:03 +09:00
Hide_D 7d465c444d 새메시지, mailboxList를 처리하는 코드 일부 추가 2018-02-12 22:42:05 +09:00
Hide_D 8a2d4c3540 generalID와 isChief를 sender_list에서 알려주도록 수정 2018-02-12 22:38:58 +09:00
Hide_D e864af0b6d 새메시지, 출력 방식 수정 2018-02-12 21:41:11 +09:00
Hide_D 63be06c98f 새메시지, json 파일을 일관성있게 수정 2018-02-12 21:40:50 +09:00
Hide_D 420469ef75 resetSessionGeneralValues() 를 lib.php로 이동 2018-02-12 21:36:58 +09:00
Hide_D ff2d5373f0 새메시지, 기본틀 완성. 2018-02-12 02:53:08 +09:00
Hide_D 4166093296 새메시지. 초기 버전 업로드 2018-02-12 01:55:55 +09:00
Hide_D db29e7d020 테스트용 pic 파일 위치 잘못된 것 수정 2018-02-12 01:54:45 +09:00
Hide_D ecd067be8e 새메시지, js 구현 준비 2018-02-12 01:15:01 +09:00
Hide_D 26d526f47c 다른 경로에서 lib.php를 불러왔을 때 생기는 문제 해결 2018-02-12 01:14:32 +09:00
Hide_D 18e663c529 템플릿 출력 준비
템플릿에 option 확인 기능 추가
현재 수뇌 여부도 반환
2018-02-11 05:30:34 +09:00
Hide_D 0a7d9cbe21 반환 값에 generalID가 있어야할 것 같아서 추가 2018-02-11 00:44:14 +09:00
Hide_D d49803baed String.prototype.format을 common.js로 이동 2018-02-11 00:13:11 +09:00
Hide_D 6052b3c577 메시지 예제 초기 데이터 준비
예제용 이미지 추가
fresh_result.json에 갠메, 전메, 국메, 외교 추가
2018-02-10 23:49:43 +09:00
Hide_D 75c99904c6 sendRawMessage가 DB 스키마와 맞지 않는 버그 해결 2018-02-10 22:05:50 +09:00
Hide_D da75e3c72a msg 기본 틀 준비 2018-02-10 20:26:43 +09:00
Hide_D efbdd28c6f json으로 받아온 내용을 출력하긴 위한 template 준비
common.js 파일 추가
메시지를 변환하기 위한 msg_template.html 작성
2018-02-10 18:51:03 +09:00
Hide_D 4993e8239c msgsubmit의 response를 변경 2018-02-10 01:13:55 +09:00
Hide_D 669e2d5141 DB Object에서 MYSQLI_OPT_INT_AND_FLOAT_NATIVE 켬. 2018-02-09 03:23:25 +09:00
Hide_D 1d8f973d48 diplomacy코드를 mailbox는 9000번대, diplomacy type만 지정하는 방식으로 변경 2018-02-09 03:05:00 +09:00
Hide_D b4669d6fcb 주석 추가 2018-02-09 03:00:58 +09:00
Hide_D 0e6eada718 오타수정 2018-02-09 02:59:49 +09:00
Hide_D 46eda74a6f 외교서신을 위한 mailbox code로 8000번대 지정 2018-02-09 02:58:45 +09:00
Hide_D 76226a2470 매 0분 0초에 나타나는 이벤트들을 분리 2018-02-09 02:43:14 +09:00
Hide_D d985cbdf6c message 테이블 변경 2018-02-09 02:38:16 +09:00
Hide_D d8a39290f6 특기 등장 확률을 randF가 아닌 randBool로 변경 2018-02-09 02:13:36 +09:00
Hide_D 4b414c0879 실수를 줄이기 위한 randBool 함수 추가 2018-02-09 02:11:58 +09:00
Hide_D 191226289d message 클래스는 변경한 table 구조에 맞게 변경 2018-02-09 02:10:38 +09:00
Hide_D 1eb3944b8a dictionary(php에선 associative array) 여부 확인하는 코드 추가
메시지 전송 코드를 message에 json을 이용하도록 변경. 외교 서신 등을 위한 $option을 추가
2018-02-09 02:02:38 +09:00
Hide_D 8b20985668 json_encode시 null을 없애기 위한 코드 추가 2018-02-09 01:32:44 +09:00
Hide_D 47016d7224 메시지 코드 준비 2018-02-04 22:55:33 +09:00
Hide_D c90af2df2c <O> 태그를 실험삼아 없애봄 2018-02-04 21:55:39 +09:00
Hide_D 9addefb79e 서버 정보를 span으로 바꿈 2018-02-04 20:03:26 +09:00
Hide_D b1841e1e93 임시로 전투 로그를 template화 해봄. 2018-02-04 19:39:25 +09:00
Hide_D ecca899a82 global 변수로 지정된 값을 GameConst의 형태로 변경중 2018-02-04 16:53:01 +09:00
Hide_D c914fd2aa8 서버 차단용 htaccess에 1분짜리 cache control을 추가 2018-02-04 05:43:46 +09:00
Hide_D 001d7037c5 새 메시지 시스템 준비 2018-02-04 05:37:41 +09:00
Hide_D df63869a29 각종 상수값들을 쓸 수 있는 GameConst 준비 2018-02-04 05:25:29 +09:00
Hide_D 5ed33b1cda general table의 no_member를 의미에 더 맞도록 owner로 변경.
general table의 user_id, password column 삭제. 코드도 이를 참조하지 않고 owner를 이용하도록 변경
2018-02-04 04:40:35 +09:00
Hide_D e42643d439 toInt에 강제 변환 기능 추가(=intval에 null만 추가) 2018-02-04 04:33:25 +09:00
Hide_D 2708b48bd9 vender 디렉토리를 검색에서 제외 2018-02-04 04:23:42 +09:00
Hide_D 4624e511fc 권한 없이도 reset.php에 접속하면 초기화 가능한 문제 해결 -_-; 2018-02-04 04:22:30 +09:00
Hide_D 26ab9044f0 귀모 내특 확률이 잘못 계산되던 문제 2018-02-04 04:00:37 +09:00
Hide_D 8866a05c01 id, pw 삭제중(진행중) 2018-02-03 06:10:04 +09:00
Hide_D 924864288c 스탯 주사위 폐기 2018-02-03 06:04:17 +09:00
Hide_D 7336847d04 main.php -> index.php 2018-02-03 05:30:12 +09:00
Hide_D 02dce232fd 불필요해진 파일들 삭제 2018-02-03 05:26:43 +09:00
Hide_D 76a5b9a214 세션 폴더 삭제 2018-02-03 05:23:20 +09:00
Hide_D 2516dd0166 주소가 고정되어있던 SVN deploy 코드 폐기 2018-02-03 05:22:07 +09:00
Hide_D 9c6deadf11 입장 절차를 바로 링크로 변경 2018-02-03 05:08:12 +09:00
Hide_D 172bf9bbbc 로그 저장시 noMember가 아니라 id로 저장되도록 우회 2018-02-03 05:01:50 +09:00
Hide_D 7729236a11 로그인 시 p_id를 같이 생성하도록 변경 2018-02-03 04:54:27 +09:00
Hide_D e957a91b19 p_id를 noMember 기반으로 변경 2018-02-03 04:49:54 +09:00
Hide_D ecac4b6edb 세션 테이블을 뒤집어 엎는 중.
session 디렉토리 제거. 서버의 자체 session으로 관리함. 필요하다면 자동로그인을 추가함.

login_process.php를 이용하지 않고 자체적으로 세션을 관리하도록 처리 중.
2018-02-03 04:39:22 +09:00
Hide_D e536e2d4ca 내부 전역 변수값 처리를 위해 함수 정리
conf.php에 getServPrefix 추가. 이후 같은 db에서 다른 서버를 운용할때 사용 가능할 것으로 예상.

$_SESSION 값을 직접 받아서 처리하지 않도록 하기위한 용도로 getUserID(), getGeneralID(), getGeneralName() 을 설정

$_SESSION['p_id']를 p_no로 착각하여 구현한 부분 수정

int|null 변환을 위한 toInt 함수 추가

func_string.php에서 null이 입력될 경우 일부 처리

각 서버에 계정이 생성되었는지 확인하는 isSigned()함수 추가
2018-02-03 03:36:34 +09:00
Hide_D 0bd51726c3 새 맵 최종 적용. 구형 map.php 제거 2018-02-02 22:50:58 +09:00
Hide_D 43836e9757 map.php를 모두 새 지도 형식으로 변경 2018-02-02 22:41:41 +09:00
Hide_D f435ce2d4c Merge branch 'php5_debug' of https://storage.hided.net/gogs/devsam/core into php5_debug 2018-02-02 22:26:54 +09:00
Hide_D 9ef4e2debb json 반환시 캐싱하지 않도록 설정.
연감용 json 반환에는 캐싱할 수 있도록 설정
2018-02-02 09:36:49 +09:00
Hide_D 75fb281264 func_map.php를 통해 현재 지도 값을 받아오는 코드 추가
j_map.php를 통해 지도를 json 형태로 열람하는 코드 추가

연감의 저장코드를 http를 통해 지도를 받아오는 방식에서 func_map.php를 이용하는 방식으로 변경

map.js에서 반환값이 올바른지 확인하는 코드 추가

b_CurrentCity.php의 도시 정보 값을 get으로도 받을 수 있도록 변경

map.js에서 재야 상태일때 올바르게 처리하도록 변경
2018-02-02 09:36:14 +09:00
Hide_D 9c2d4217b8 json 반환시 캐싱하지 않도록 설정.
연감용 json 반환에는 캐싱할 수 있도록 설정
2018-02-02 01:21:16 +09:00
Hide_D f85443cf17 map.js에서 재야 상태일때 올바르게 처리하도록 변경 2018-02-02 01:07:30 +09:00
Hide_D e9fc23b8ee 반환하는 모든 값 중 int가 되어야하는 값들을 변경 2018-02-02 01:03:03 +09:00
Hide_D 438511972e func_map.php에서 연관배열을 일반 배열로 착각한 버그 수정
func_map.php에서 result를 설정하지 않은 버그 수정

main.php에서 지도를 제대로 불러오도록 수정

map.js에서 국가가 재야인 경우 국가 tooltip을 띄우지 않도록 수정

b_CurrentCity.php의 도시 정보 값을 get으로도 받을 수 있도록 변경
2018-02-02 00:55:02 +09:00
Hide_D 0841950366 func_map.php를 통해 현재 지도 값을 받아오는 코드 추가
j_map.php를 통해 지도를 json 형태로 열람하는 코드 추가

연감의 저장코드를 http를 통해 지도를 받아오는 방식에서 func_map.php를 이용하는 방식으로 변경

map.js에서 반환값이 올바른지 확인하는 코드 추가
2018-02-02 00:30:04 +09:00
Hide_D 1a4d82f871 map.php 대신 j_map.php를 사용하도록 준비 2018-02-01 17:58:13 +09:00
Hide_D 2db446a06d json 기반 지도를 출력하도록 코드를 추가 2018-02-01 17:39:57 +09:00
Hide_D 9005d5c8be err.txt 삭제 2018-02-01 16:16:31 +09:00
Hide_D 4d925b111d 임관, 전쟁 켬/끔 제한 삭제 2018-02-01 00:45:34 +09:00
Hide_D 3b862b53eb 충돌 병합 2018-02-01 00:41:27 +09:00
Hide_D 45ae19d74b 충돌 병함 2018-02-01 00:40:40 +09:00
Hide_D 402910ba78 array_rand는 키를 반환하므로 값을 적용하도록 수정 2018-02-01 00:37:52 +09:00
Hide_D fd8ab0e4b0 새 지도 map.html 디버깅 코드 제거, 실제 데이터로 이식 준비 2018-01-31 17:32:49 +09:00
Hide_D 1352009350 단순 모드도 추가 2018-01-31 17:24:45 +09:00
Hide_D 9efb83323a 내 도시 강조 추가 2018-01-31 15:38:06 +09:00
Hide_D 54c7bf3a04 새 지도 테스트를 위한 goCity.php 예제 추가 2018-01-31 14:12:34 +09:00
Hide_D 8f3c4ded62 새지도에서 touchend와 click이 동시에 발생할때 생기는 문제 해결 2018-01-31 14:10:51 +09:00
Hide_D 907b490747 새 지도 터치스크린 이벤트 분리 2018-01-31 11:49:36 +09:00
Hide_D d5fecd0388 새 지도에서 터치스크린에서 1터치 -> tooltip, 2터치 -> 클릭 으로 동작하도록 변경 2018-01-31 10:59:11 +09:00
Hide_D 70e226c6d5 새맵 디버깅용 2018-01-31 03:32:48 +09:00
Hide_D f4a89ea376 새지도 수도 표기 버그 해결 2018-01-31 03:30:16 +09:00
Hide_D 2958b73b16 수도 깃발 추가 2018-01-31 03:25:25 +09:00
Hide_D 3bbd9b2fbc 새지도 깃발끊김 추가 2018-01-31 03:21:10 +09:00
Hide_D e9828cd38e 새지도 이벤트 표시 추가 2018-01-31 03:02:32 +09:00
Hide_D ce0fab873b 새 지도에서 배경, 도시가 정상적으로 보이도록 수정 2018-01-31 02:32:37 +09:00
Hide_D 7542248641 새 지도 이미지 준비. 아직 충돌 많음. 2018-01-30 17:57:22 +09:00
Hide_D f2f32347f1 새 지도 코드에서 예제로 사용할 result.json 손봄
새 지도 코드에서 (detail, basic), (click, select)를 같이 사용할 수 있도록 정비
2018-01-30 15:28:43 +09:00
Hide_D 783400d071 common.css의 body를 main.css로 이동 2018-01-30 13:40:52 +09:00
Hide_D 6177ea97d2 동적으로 생성하는 map 파일 중간 작업까지 완료. 2018-01-30 02:56:12 +09:00
Hide_D 8307451842 잠시 맵 만듦 2018-01-29 23:38:09 +09:00
Hide_D 8e18116f22 stylesheet.php 사용하는 남은 참조 제거 2018-01-29 22:58:56 +09:00
Hide_D 3b8b62ac9b 기본 stylesheet를 common.css로 변경 2018-01-29 22:56:31 +09:00
Hide_D ae0c2de758 font-size:13;을 font-size:13px;로 변경
allButton.php를 template로 이동.
2018-01-29 22:54:40 +09:00
Hide_D a1cb2da6c1 banner frame 제거 2018-01-29 22:09:15 +09:00
Hide_D d2abd6daf2 oncontextmenu, ondragstart 금지 코드 수정. 우클릭 가능하도록. 2018-01-29 22:08:15 +09:00
Hide_D a4ecf23dd0 css 기본틀 추가
bar() 함수 수정. 막대 수정
2018-01-29 22:04:50 +09:00
Hide_D 01eef993fb doctype 추가. 2018-01-29 22:00:38 +09:00
Hide_D 32893d6692 func.php에 빼먹은 php파일 include 2018-01-29 21:58:19 +09:00
Hide_D 20593b0e44 composer 사용으로 날려먹은 util 단축을 살림. 2018-01-29 21:55:38 +09:00
Hide_D a78d93f282 returnJson(); 추가 2018-01-29 21:46:44 +09:00
Hide_D 55d15bb562 message에 만약을 위해 aux 추가 2018-01-29 20:14:06 +09:00
Hide_D b7923e04a4 sammo를 쓰는 일부 파일을 getRootDB()를 이용하도록 수정
메시지 DB 형태 변경.

메시지를 전송하는 별도의 함수 sendMessage(), sendRawMessage() 생성

j_msgsubmit.php 전면 수정

가능한 메일함을 구해오는 getMailboxList() 함수 추가

CheckBlock를 getBlockLevel로 변경하고, 내부 구현 수정
2018-01-29 02:14:41 +09:00
Hide_D 6d30e40cd3 '참여' 텍스트 1차 제거 DB는 다음에 2018-01-28 23:56:01 +09:00
Hide_D dc56de8afd newRootDB(), newDB가 이전의 코드 수정으로 new를 수행하는 경우가 줄어들었으므로 getRootDB(), newDB() 로 이름 변경 2018-01-28 21:44:08 +09:00
Hide_D 373bcde70b e_lib 코드들을 composer로 이동
func_http 삭제. guzzle로 대체

php 파일에서 include, require 앞에 있는 구문들을 전부 뒤로 이동.
2018-01-28 21:38:04 +09:00
Hide_D d422c03003 외부 코드를 Composer 기반으로 변경 2018-01-28 19:25:31 +09:00
Hide_D 8a181055a0 queryFirstField을 queryFirstField로 변경. 헷갈려. 2018-01-28 18:20:32 +09:00
Hide_D ca2b345075 regnpc를 별도로 분리. 2018-01-28 06:03:45 +09:00
Hide_D 88add40d4c gamerule에 해당하는 일부 함수 분리. 2018-01-28 06:02:19 +09:00
Hide_D 207f190e0b j_msgsubmit도 " 기호 제거 2018-01-28 05:45:55 +09:00
Hide_D 5ac2f4e27d converter에서 많은 "를 '로 변경.
- html tag의 attribute에서 안전하게 "를 쓰기 위하여
  - PHP 변수가 들어가는 경우를 줄이기 위한 카운트
2018-01-28 05:43:33 +09:00
Hide_D da73997385 meekroDB 에서는 숫자는 %i임 2018-01-28 05:35:47 +09:00
Hide_D 1a5e67233f isLock, lock, unlock 개선 2018-01-28 05:32:52 +09:00
Hide_D 1b675eabe2 onlinenum을 단순화 2018-01-28 05:27:11 +09:00
Hide_D 7a6040bd4d func_template 분리.
func_template의 함수를 <?=func()?> 형식으로 사용할 수 있도록 수정
2018-01-28 05:22:57 +09:00
Hide_D 9ec48f5f09 func.php 파일을 file, legacy, converter로 분리.
message 클래스에서 nation이 NULL경우 예외 처리
2018-01-28 04:56:20 +09:00
Hide_D 0c0c4fa547 newDB 함수 사용시 static 변수로 DB Object를 보관하도록 설정. 모든 update 명령은 global lock 하에서 통제되므로 이 방식을 사용할 수 있음. 2018-01-28 04:17:13 +09:00
Hide_D 221652405f template와 message 클래스 변수가 일치하도록 수정 2018-01-28 04:09:33 +09:00
Hide_D 9b45ca41fa 메시지 관련 template 준비중 2018-01-28 03:44:27 +09:00
Hide_D 3ecee6a9e8 필살 확률을 15%로 고정 2018-01-27 07:05:52 +09:00
Hide_D 3f38b6b675 수비, 성벽 강화의 성공을 무력 기준으로 올바르게 변경 2018-01-27 06:42:52 +09:00
Hide_D dd2f45c5bd 유저장에서 거상 삭제. NPC의 경우 아직 남겨둠 2018-01-27 06:34:13 +09:00
Hide_D 2037e9b6af 등용장 삭제 2018-01-27 06:18:07 +09:00
Hide_D 86dfbe6bec 연감이 62che.com에서만 동작하는 문제 해결 2018-01-27 06:04:24 +09:00
Hide_D 82110d98ef 갠메 전송 시스템 추가 2018-01-22 02:05:08 +09:00
Hide_D 67e2f8342e \r\n 마저 제거 2018-01-21 18:26:15 +09:00
Hide_D 8c3cc7649f \r\n 마저 제거 2018-01-21 18:25:59 +09:00
Hide_D d080e5ec2c \r\n을 \n으로 변경. 메모장에서 열 것도 아니고..
로그인 확인 등 몇몇 유틸 함수 새 db 라이브러리 기준으로 추가
ajax 기반 msgsubmit 작업중
2018-01-21 16:58:19 +09:00
Hide_D 47d5a07a81 conf에 return hint 추가
메시지 전송 준비
2018-01-21 06:08:39 +09:00
Hide_D 60e7ee5c38 메시지 테이블 추가 2018-01-21 04:27:08 +09:00
Hide_D f48500dd71 config 설정 방식을 함수를 이용하도록 변경 2018-01-21 03:52:45 +09:00
Hide_D 6b7f0f8a14 BLOCKBODY 의미 없음. 삭제. 2018-01-21 03:00:24 +09:00
Hide_D a4aa0ba476 array 참조 문제 마저 해결 2018-01-21 02:09:20 +09:00
Hide_D dd28eb768f 새로운 설정 파일을 위한 gitignore 확보
처리하지 않고 남겨둔 array 참조 해결

main.js 를 별도로 이동
2018-01-21 01:45:09 +09:00
Hide_D 3515fc637e login_process를 일단 변경
func_string의 Fill 계열 함수 마저 static으로 변경

전메, 갠메 파일 열기 실패시 에러 반환
main.php 파일에 jQuery + js 파일 열수 있도록
2018-01-20 15:19:51 +09:00
Hide_D 1848af9f09 log 파일이 없을 때는 빈 텍스트를 리턴하도록 2018-01-20 06:00:17 +09:00
Hide_D 3e629c5c54 stylesheet를 우선 기본값으로 보여주도록 수정 2018-01-20 05:43:50 +09:00
Hide_D a39a1e8612 아이디 생성 가능 2018-01-20 05:35:11 +09:00
Hide_D 9e3182bf2a phpmailer5 최신버전으로 갱신 2018-01-20 04:32:15 +09:00
Hide_D 0df2484b8e 임시 메일 테스트를 위해 @localhost 사용가능하도록
String static 함수 문제 해결
2018-01-20 04:23:46 +09:00
Hide_D 3aaf7c8328 set.php 변경 메일 전송 준비 2018-01-20 04:19:03 +09:00
Hide_D 9c27544fb7 참여 정보가 없을 시 에러가 발생하지 않도록 변경 2018-01-20 04:09:21 +09:00
Hide_D 8fa3af0fb8 warning 확인을 위해 가능한 모든 replace 태그를 무효화함
index.php에 대한 iframe 일부 삭제
2018-01-20 04:00:59 +09:00
revofpla 8bf5433300 [php5_debug] jQuery 3.2.1로 고고 2018-01-18 17:40:00 +09:00
revofpla f9fe123431 [php5_debug] 경매 따옴표 누락 추가 2018-01-18 00:41:42 +09:00
revofpla 7b77d8ced9 [php5_debug] 잡다 오류 수정 2018-01-18 00:33:36 +09:00
revofpla 711600403f [php5_debug] 명장일람 디스플레이 부분 수정 2018-01-17 23:48:12 +09:00
revofpla fb84886f94 [php5_debug] 사소한 오류들 수정 2018-01-17 23:17:03 +09:00
revofpla d99707c3d7 [php5_debug] 따옴표 누락, 변수 초기화 누락(특히 log와 alllog) 수정 2018-01-17 22:35:02 +09:00
revofpla 4b9c72c354 Merge branch 'php5_debug' of https://storage.hided.net/gogs/devsam/core into php5_debug 2018-01-17 20:42:02 +09:00
revofpla df31672a32 [php5_debug] 따옴표 누락, 변수 초기화 미비 등등 문법적 문제 수정 2018-01-17 20:41:27 +09:00
Hide_D 37e8fae843 시뮬레이터 $POST 변수 설정 2018-01-17 20:16:00 +09:00
revofpla 7816fc1eba [php5_debug] undefined 에다가 뭐 때려박는거 금지! 2018-01-17 20:01:06 +09:00
Hide_D 4c17e908ca _simul 마저 수정 성벽 공격 가능 2018-01-17 19:59:59 +09:00
Hide_D 4823e0de54 che 폴더 날림.
시뮬레이터 살림
2018-01-17 19:58:30 +09:00
revofpla b354a00b6f [php5_debug] jquery라는 좋은게 있음 써야지;;; 2018-01-17 19:27:49 +09:00
revofpla 009524edf3 [php5_debug] 지도 출력 관련 로직 예외처리 추가 및 내 정보의 array 호출에 따옴표 누락 수정 2018-01-17 18:54:48 +09:00
revofpla 90ac479770 [php5_debug] 내 정보의 전투로그 및 전투기록도 offset 문제가 없도록 개선 2018-01-17 17:58:46 +09:00
revofpla 55fb7d6e92 [php5_debug] 적절한 최적화로 이런 모드가 필요없게 해야 할 것이기에 과감하게 삭제함. 2018-01-17 17:53:18 +09:00
revofpla 33ffaa573d [php5_debug] general 테이블의 skin정보는 실시간으로 땡겨오는게 맞다고 판단함. 2018-01-17 17:47:16 +09:00
revofpla 793f0055e6 [php5_debug] 사실 재야일때는 국가정보 패널의 대부분 정보가 '해당 없음'으로 나와야 맞지 않을까 싶으요.... 2018-01-17 17:37:35 +09:00
revofpla 0ddd8b1bae Revert "[php5_debug] 사실 재야일때는 국가정보 패널의 대부분 정보가 '해당 없음'으로 나와야 맞지 않을까 싶으요...."
This reverts commit 32ca97ed4d.
2018-01-17 17:36:09 +09:00
1291 changed files with 114923 additions and 167650 deletions
+28 -106
View File
@@ -5,116 +5,38 @@
!.vscode/extensions.json
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
.static_storage/
.media/
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# 체섭 ignore
*.log
logs/*.txt
d_log/*.txt
d_setting/set.php
set.php
config.php
d_log/*.zip
sess_*
*/logs/*.txt
err.txt
che/.htaccess
kwe/.htaccess
pwe/.htaccess
twe/.htaccess
hwe/.htaccess
d_pic/*.jpg
d_pic/*.gif
d_pic/*.png
d_setting/*.php
!d_setting/*.orig.php
!d_setting/_*.php
*/d_setting/*.php
!*/d_setting/*.orig.php
!*/d_setting/_*.php
**/old/*
test.php
/che
/kwe
/pwe
/twe
+1 -3
View File
@@ -7,12 +7,10 @@
"**/.DS_Store": true,
"**/logs/*.txt": true,
"**/session/sess*":true,
"**/che": true,
},
"search.exclude": {
"**/che": true,
"e_lib/*":true,
"vendor/*":true
},
}
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
namespace sammo;
if(!defined('ROOT')){
define('ROOT', '.');
}
require_once(ROOT.'/f_config/config.php');
require_once(ROOT.W.F_CONFIG.W.APP.PHP);
require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
-4
View File
@@ -1,4 +0,0 @@
Deny from all
SetEnvIf X-Forwarded-For ^192\.168\.0\.1 env_allow_1
Allow from env=env_allow_1
Allow from 192.168.0.1
-40
View File
@@ -1,40 +0,0 @@
<?php
function MYDB_connect($host, $id, $pw) {
$conn = mysqli_connect($host, $id, $pw);
mysqli_query($conn, 'set names utf8');
return $conn;
}
function MYDB_select_db($db, $connect) {
return mysqli_select_db($connect, $db);
}
function MYDB_query($query, $connect) {
return mysqli_query($connect, $query);
}
function MYDB_num_rows($result) {
return mysqli_num_rows($result);
}
function MYDB_fetch_array($result) {
return mysqli_fetch_array($result);
}
function MYDB_fetch_row($result) {
return mysqli_fetch_row($result);
}
function MYDB_list_tables($db, $connect) {
return mysqli_query($connect, "show tables");
}
function MYDB_error($connect) {
return mysqli_error($connect);
}
function MYDB_close($connect) {
return mysqli_close($connect);
}
-54
View File
@@ -1,54 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect=dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select turntime,tnmt_time from game";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select plock from plock";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$plock = MYDB_fetch_array($result);
?>
<html>
<head>
<title>삼국지 모의전투 PHP (유기체서버)</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<form action=_119_b.php method=post>
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$admin[turntime];?><br>
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$admin[tnmt_time];?><br>
봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br>
락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock[plock]>0?"동결중":"가동중";?><br>
</form>
</body>
</html>
-223
View File
@@ -1,223 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$admin = getAdmin($connect);
?>
<html>
<head>
<title>게임관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>게 임 관 리<br><?php backButton(); ?></td></tr>
</table>
<form name=form1 method=post action=_admin1_submit.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td width=110 align=right>운영자메세지</td>
<td colspan=3><input type=textarea size=90 style=color:white;background-color:black; name=msg value='<?=$admin[msg];?>'><input type=submit name=btn value=변경></td></td>
</tr>
<tr><td width=110 align=right>중원정세추가</td>
<td colspan=3><input type=textarea size=90 maxlength=80 style=color:white;background-color:black; name=log><input type=submit name=btn value=로그쓰기></td></td>
</tr>
<tr><td width=110 align=right>쿼리 요청</td>
<td colspan=3><input type=textarea size=90 maxlength=150 style=color:white;background-color:black; name=q><input type=submit name=btn value=요청></td></td>
</tr>
<tr>
<td width=110 align=right>시작시간변경</td>
<td width=285><input type=text size=20 maxlength=20 style=color:white;background-color:black;text-align:right; name=starttime value='<?=$admin[starttime];?>'><input type=submit name=btn value=변경1></td>
<td width=110 align=right>현재도시훈사</td>
<td width=285><?=$admin[city_rate];?></td>
</tr>
<tr>
<td width=110 align=right>최대 장수</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=maxgeneral value=<?=$admin[maxgeneral];?>><input type=submit name=btn value=변경2></td>
<td width=110 align=right>최대 국가</td>
<td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin[maxnation];?>><input type=submit name=btn value=변경3></td>
</tr>
<tr>
<td width=110 align=right>기준 장수수</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=gen_rate value=<?=$admin[normgeneral];?>><input type=submit name=btn value=변경5></td>
<td width=110 align=right>현재 수입률</td>
<td width=285><?=$admin[gold_rate];?>%</td>
</tr>
<tr>
<td width=110 align=right>시작 년도</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin[startyear];?>'><input type=submit name=btn value=변경4></td>
<td width=110 align=right>최근 갱신 시간</td>
<td width=285>&nbsp;<?=$admin[turntime]?></td>
</tr>
<tr>
<td width=110 align=right>턴시간</td>
<td colspan=3><input type=submit name=btn value=1분턴><input type=submit name=btn value=2분턴><input type=submit name=btn value=5분턴><input type=submit name=btn value=10분턴><input type=submit name=btn value=20분턴><input type=submit name=btn value=30분턴><input type=submit name=btn value=60분턴><input type=submit name=btn value=120분턴></td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td align=right><input type=submit name=btn value=변경6></td>
<td align=center>공격</td>
<td align=center>방어</td>
<td align=center>기동</td>
<td align=center>회피</td>
<td align=center>가격</td>
<td align=center>군량</td>
</tr>
<?php
for($i=0; $i <= 5; $i++) {
$att = $admin["att{$i}"];
$def = $admin["def{$i}"];
$spd = $admin["spd{$i}"];
$avd = $admin["avd{$i}"];
$cst = $admin["cst{$i}"];
$ric = $admin["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=att{$i} value=$att></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=def{$i} value=$def></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=spd{$i} value=$spd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=avd{$i} value=$avd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=cst{$i} value=$cst></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=ric{$i} value=$ric></td>
</tr>";
}
echo "
<tr><td colspan=7 height=5></td></tr>";
for($i=10; $i <= 14; $i++) {
$att = $admin["att{$i}"];
$def = $admin["def{$i}"];
$spd = $admin["spd{$i}"];
$avd = $admin["avd{$i}"];
$cst = $admin["cst{$i}"];
$ric = $admin["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=att{$i} value=$att></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=def{$i} value=$def></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=spd{$i} value=$spd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=avd{$i} value=$avd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=cst{$i} value=$cst></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=ric{$i} value=$ric></td>
</tr>";
}
echo "
<tr><td colspan=7 height=5></td></tr>";
for($i=20; $i <= 27; $i++) {
$att = $admin["att{$i}"];
$def = $admin["def{$i}"];
$spd = $admin["spd{$i}"];
$avd = $admin["avd{$i}"];
$cst = $admin["cst{$i}"];
$ric = $admin["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=att{$i} value=$att></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=def{$i} value=$def></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=spd{$i} value=$spd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=avd{$i} value=$avd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=cst{$i} value=$cst></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=ric{$i} value=$ric></td>
</tr>";
}
echo "
<tr><td colspan=7 height=5></td></tr>";
for($i=30; $i <= 38; $i++) {
$att = $admin["att{$i}"];
$def = $admin["def{$i}"];
$spd = $admin["spd{$i}"];
$avd = $admin["avd{$i}"];
$cst = $admin["cst{$i}"];
$ric = $admin["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=att{$i} value=$att></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=def{$i} value=$def></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=spd{$i} value=$spd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=avd{$i} value=$avd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=cst{$i} value=$cst></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=ric{$i} value=$ric></td>
</tr>";
}
echo "
<tr><td colspan=7 height=5></td></tr>";
for($i=40; $i <= 43; $i++) {
$att = $admin["att{$i}"];
$def = $admin["def{$i}"];
$spd = $admin["spd{$i}"];
$avd = $admin["avd{$i}"];
$cst = $admin["cst{$i}"];
$ric = $admin["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=att{$i} value=$att></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=def{$i} value=$def></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=spd{$i} value=$spd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=avd{$i} value=$avd></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=cst{$i} value=$cst></td>
<td align=center><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=ric{$i} value=$ric></td>
</tr>";
}
echo "
<tr><td colspan=7 height=5></td></tr>";
?>
</table>
</form>
<form name=form2 method=post action=reset.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=9>리 셋 요 청</td></tr>
<tr>
<td align=right>HOSTNAME</td>
<td align=center><input type=text size=12 maxlength=50 style=color:white;background-color:black; name=hostname value=localhost></td>
<td align=center>DB_ID</td>
<td align=center><input type=text size=12 maxlength=12 style=color:white;background-color:black; name=user_id></td>
<td align=center>PASSWORD</td>
<td align=center><input type=password size=12 maxlength=12 style=color:white;background-color:black; name=password></td>
<td align=center>DB_NAME</td>
<td align=center><input type=text size=12 maxlength=12 style=color:white;background-color:black; name=dbname></td>
<td align=center><input type=submit value=요청></td>
</tr>
</table>
</form>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-180
View File
@@ -1,180 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$admin = getAdmin($connect);
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "<script>location.replace('_admin1.php');</script>";
}
switch($btn) {
case "변경":
$msg = addslashes(SQ2DQ($msg));
$query = "update game set msg='$msg' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "요청":
$query = $q;
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "로그쓰기":
$lognum = $admin[historyindex] + 1;
if($lognum >= 29) { $lognum = 0; }
$history[0] = "<R>★</><S>{$log}</>";
pushHistory($connect, $history);
break;
case "변경1":
$query = "update game set starttime='$starttime' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "변경2":
$query = "update game set maxgeneral='$maxgeneral' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "변경3":
$query = "update game set maxnation='$maxnation' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "변경4":
$query = "update game set startyear='$startyear' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "변경5":
$query = "update game set normgeneral='$gen_rate' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "1분턴":
case "2분턴":
case "5분턴":
case "10분턴":
case "20분턴":
case "30분턴":
case "60분턴":
case "120분턴":
switch($btn) {
case "1분턴": $turnterm = 7; $unit = 60; break;
case "2분턴": $turnterm = 6; $unit = 120; break;
case "5분턴": $turnterm = 5; $unit = 300; break;
case "10분턴": $turnterm = 4; $unit = 600; break;
case "20분턴": $turnterm = 3; $unit = 1200; break;
case "30분턴": $turnterm = 2; $unit = 1800; break;
case "60분턴": $turnterm = 1; $unit = 3600; break;
case "120분턴": $turnterm = 0; $unit = 7200; break;
}
$turn = ($admin[year] - $admin[startyear]) * 12 + $admin[month] - 1;
$starttime = date("Y-m-d H:i:s", strtotime($admin[turntime]) - $turn * $unit);
$starttime = cutTurn($starttime, $turnterm);
$query = "update game set turnterm='$turnterm',starttime='$starttime' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 턴시간이 길어지는 경우 랜덤턴 배정
if($turnterm < $admin[turnterm]) {
$query = "select no from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$turntime = getRandTurn($turnterm);
$query = "update general set turntime='$turntime' where no='$gen[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
// 턴시간이 너무 멀리 떨어진 선수 제대로 보정
} else {
$query = "select no,turntime from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$num = floor((strtotime($gen[turntime]) - strtotime($admin[turntime])) / $unit);
if($num > 0) {
$gen[turntime] = date("Y-m-d H:i:s", strtotime($gen[turntime]) - $unit * $num);
$query = "update general set turntime='$gen[turntime]' where no='$gen[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
$history[count($history)] = "<R>★</>턴시간이 <C>$btn</>으로 변경됩니다.";
pushHistory($connect, $history);
break;
case "변경6":
$query = "update game set att0='$att0',def0='$def0',spd0='$spd0',avd0='$avd0',ric0='$ric0',cst0='$cst0' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att1='$att1',def1='$def1',spd1='$spd1',avd1='$avd1',ric1='$ric1',cst1='$cst1' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att2='$att2',def2='$def2',spd2='$spd2',avd2='$avd2',ric2='$ric2',cst2='$cst2' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att3='$att3',def3='$def3',spd3='$spd3',avd3='$avd3',ric3='$ric3',cst3='$cst3' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att4='$att4',def4='$def4',spd4='$spd4',avd4='$avd4',ric4='$ric4',cst4='$cst4' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att5='$att5',def5='$def5',spd5='$spd5',avd5='$avd5',ric5='$ric5',cst5='$cst5' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att10='$att10',def10='$def10',spd10='$spd10',avd10='$avd10',ric10='$ric10',cst10='$cst10' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att11='$att11',def11='$def11',spd11='$spd11',avd11='$avd11',ric11='$ric11',cst11='$cst11' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att12='$att12',def12='$def12',spd12='$spd12',avd12='$avd12',ric12='$ric12',cst12='$cst12' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att13='$att13',def13='$def13',spd13='$spd13',avd13='$avd13',ric13='$ric13',cst13='$cst13' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att14='$att14',def14='$def14',spd14='$spd14',avd14='$avd14',ric14='$ric14',cst14='$cst14' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att20='$att20',def20='$def20',spd20='$spd20',avd20='$avd20',ric20='$ric20',cst20='$cst20' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att21='$att21',def21='$def21',spd21='$spd21',avd21='$avd21',ric21='$ric21',cst21='$cst21' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att22='$att22',def22='$def22',spd22='$spd22',avd22='$avd22',ric22='$ric22',cst22='$cst22' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att23='$att23',def23='$def23',spd23='$spd23',avd23='$avd23',ric23='$ric23',cst23='$cst23' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att24='$att24',def24='$def24',spd24='$spd24',avd24='$avd24',ric24='$ric24',cst24='$cst24' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att25='$att25',def25='$def25',spd25='$spd25',avd25='$avd25',ric25='$ric25',cst25='$cst25' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att26='$att26',def26='$def26',spd26='$spd26',avd26='$avd26',ric26='$ric26',cst26='$cst26' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att27='$att27',def27='$def27',spd27='$spd27',avd27='$avd27',ric27='$ric27',cst27='$cst27' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att30='$att30',def30='$def30',spd30='$spd30',avd30='$avd30',ric30='$ric30',cst30='$cst30' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att31='$att31',def31='$def31',spd31='$spd31',avd31='$avd31',ric31='$ric31',cst31='$cst31' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att32='$att32',def32='$def32',spd32='$spd32',avd32='$avd32',ric32='$ric32',cst32='$cst32' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att33='$att33',def33='$def33',spd33='$spd33',avd33='$avd33',ric33='$ric33',cst33='$cst33' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att34='$att34',def34='$def34',spd34='$spd34',avd34='$avd34',ric34='$ric34',cst34='$cst34' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att35='$att35',def35='$def35',spd35='$spd35',avd35='$avd35',ric35='$ric35',cst35='$cst35' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att36='$att36',def36='$def36',spd36='$spd36',avd36='$avd36',ric36='$ric36',cst36='$cst36' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att37='$att37',def37='$def37',spd37='$spd37',avd37='$avd37',ric37='$ric37',cst37='$cst37' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att38='$att38',def38='$def38',spd38='$spd38',avd38='$avd38',ric38='$ric38',cst38='$cst38' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att40='$att40',def40='$def40',spd40='$spd40',avd40='$avd40',ric40='$ric40',cst40='$cst40' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att41='$att41',def41='$def41',spd41='$spd41',avd41='$avd41',ric41='$ric41',cst41='$cst41' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att42='$att42',def42='$def42',spd42='$spd42',avd42='$avd42',ric42='$ric42',cst42='$cst42' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set att43='$att43',def43='$def43',spd43='$spd43',avd43='$avd43',ric43='$ric43',cst43='$cst43' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
}
//echo "<script>location.replace('_admin1.php');</script>";
echo '_admin1.php';//TODO:replace
-149
View File
@@ -1,149 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select conlimit,conweight from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
?>
<html>
<head>
<title>회원관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>회 원 관 리<br><?php backButton(); ?></td></tr>
</table>
<form name=form1 method=post action=_admin2_submit.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=80 align=center>접속제한</td>
<td width=713 align=center><input type=submit name=btn value='전체 접속허용'><input type=submit name=btn value='전체 접속제한'></td>
</tr>
<tr>
<td width=80 align=center>제한등급</td>
<td width=713 align=center>
<input type=text size=3 maxlength=3 name=conweight value=<?=$admin[conweight];?> style=color:white;background-color:black;font-size:13;>
<input type=submit name=btn value='접속가중치'>
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=80 align=center rowspan=12>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=blue>특별회원</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=105 rowspan=12>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,userlevel,block from general order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
$style = "style=;";
if($general[block] > 0) { $style .= "background-color:red;"; }
if($general[npc] >= 2) { $style .= "color:cyan;"; }
elseif($general[npc] == 1) { $style .= "color:skyblue;"; }
if($general[con] > $admin[conlimit]) { $style .= "color:red;"; }
if($general[userlevel] > 2) { $style .= "color:blue;"; }
echo "
<option value=$general[no] $style>$general[name]</option>";
}
echo "
</select>
</td>
<td width=100 align=center>아이템 지급</td>
<td width=504>
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
for($i=0; $i < 27; $i++) {
echo "
<option value={$i}>{$i}</option>";
}
?>
</select>
<input type=submit name=btn value='무기지급'>
<input type=submit name=btn value='책지급'>
<input type=submit name=btn value='말지급'>
<input type=submit name=btn value='도구지급'>
</td>
</tr>
<tr>
<td width=100 align=center>블럭</td>
<td width=504>
<input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br>
1단계:발언권, 2단계:턴블럭
</td>
</tr>
<tr>
<td align=center>강제 사망</td>
<td><input type=submit name=btn value='강제 사망'></td>
</tr>
<tr>
<td align=center>이벤트</td>
<td><input type=submit name=btn value='특기 부여'><input type=submit name=btn value='공헌치1000'><input type=submit name=btn value='경험치1000'></td>
</tr>
<tr>
<td align=center>이벤트2</td>
<td><input type=submit name=btn value='보숙10000'><input type=submit name=btn value='궁숙10000'><input type=submit name=btn value='기숙10000'><input type=submit name=btn value='귀숙10000'><input type=submit name=btn value='차숙10000'></td>
</tr>
<tr>
<td align=center>특별회원</td>
<td><input type=submit name=btn value='특별회원 임명'><input type=submit name=btn value='특별회원 해제'></td>
</tr>
<tr>
<td align=center>접속제한</td>
<td><input type=submit name=btn value='접속 허용'><input type=submit name=btn value='접속 제한'></td>
</tr>
<tr>
<td align=center>턴설정</td>
<td><input type=submit name=btn value='00턴'><input type=submit name=btn value='랜덤턴'></td>
</tr>
<tr>
<td align=center>NPC해제</td>
<td><input type=submit name=btn value='NPC해제'><input type=submit name=btn value='하야입력'><input type=submit name=btn value='방랑해산'><input type=submit name=btn value='NPC설정'></td>
</tr>
<tr>
<td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr>
</table>
</form>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-432
View File
@@ -1,432 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "<script>location.replace('_admin2.php');</script>";
}
switch($btn) {
case "전체 접속허용":
$query = "update general set con=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "전체 접속제한":
$query = "update general set con=1000";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "접속가중치":
$query = "update game set conweight='$conweight' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case "블럭 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=0 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "1단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=1,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "2단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set gold=0,rice=0,block=2,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "3단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set gold=0,rice=0,block=3,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "무한삭턴":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set killturn=8000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "강제 사망":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set turn0=0,killturn=0,turntime='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특기 부여":
$query = "select year,month from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = $btn." 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select no,leader,power,intel,history from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$special2 = getSpecial2($connect, $general[leader], $general[power], $general[intel]);
$query = "update general set specage2=age,special2='$special2' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[0] = "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!";
$general = addHistory($connect, $general, "<C>●</>$admin[year]$admin[month]월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득");
pushGenLog($general, $log);
}
break;
case "경험치1000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = $btn." 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set experience=experience+1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "공헌치1000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = $btn." 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dedication=dedication+1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "보숙10000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = "보병숙련도+10000 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dex0=dex0+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "궁숙10000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = "궁병숙련도+10000 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dex10=dex10+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "기숙10000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = "기병숙련도+10000 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dex20=dex20+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "귀숙10000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = "귀병숙련도+10000 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dex30=dex30+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "차숙10000":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$msg = "차병숙련도+10000 지급!";
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set dex40=dex40+10000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 임명":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=3 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "접속 허용":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set con=0 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "접속 제한":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set con=1000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "메세지 전달":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "무기지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set weap='0' where no='$genlist[$i]'";
} else {
$query = "update general set weap='$weap' where no='$genlist[$i]' and weap<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "책지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set book='0' where no='$genlist[$i]'";
} else {
$query = "update general set book='$weap' where no='$genlist[$i]' and book<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "말지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set horse='0' where no='$genlist[$i]'";
} else {
$query = "update general set horse='$weap' where no='$genlist[$i]' and horse<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "도구지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set item='0' where no='$genlist[$i]'";
} else {
$query = "update general set item='$weap' where no='$genlist[$i]' and item<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "NPC해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set npc=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "하야입력":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set turn0='00000000000045' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "방랑해산":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set turn0='00000000000047',turn1='00000000000056' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "NPC설정":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set npc=2 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "00턴":
$query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
for($i=0; $i < sizeof($genlist); $i++) {
$turntime = getRandTurn($admin[turnterm]);
$cutTurn = cutTurn($turntime, $admin[turnterm]);
$query = "update general set turntime='$cutTurn' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "랜덤턴":
$query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
for($i=0; $i < sizeof($genlist); $i++) {
$turntime = getRandTurn($admin[turnterm]);
$query = "update general set turntime='$turntime' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
}
//echo "<script>location.replace('_admin2.php');</script>";
echo '_admin2.php';//TODO:replace
-100
View File
@@ -1,100 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
//$admin = getAdmin($connect);
?>
<html>
<head>
<title>특별회원</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>특 별 회 원<br><?php backButton(); ?></td></tr>
</table>
<form name=form1 method=post action=_admin3_submit.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=80 align=center rowspan=5>회원선택<br><br><font color=orange>무장</font><br><font color=skyblue>지장</font></td>
<td width=105 rowspan=5>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,power,intel from general where userlevel>2 order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
if($general[power] >= $general[intel]) {
echo "
<option value=$general[no] style=color:orange;>$general[name]</option>";
} else {
echo "
<option value=$general[no] style=color:skyblue;>$general[name]</option>";
}
}
echo "
</select>
</td>
<td width=100 align=center>아이템 지급</td>
<td width=504>
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
for($i=0; $i < 27; $i++) {
echo "
<option value={$i}>{$i}</option>";
}
?>
</select>
<input type=submit name=btn value='무기지급'>
<input type=submit name=btn value='책지급'>
<input type=submit name=btn value='말지급'>
<input type=submit name=btn value='도구지급'>
</td>
</tr>
<tr>
<td align=center>특별회원</td>
<td><input type=submit name=btn value='특별회원 해제'></td>
</tr>
<tr>
<td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr>
</table>
</form>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-134
View File
@@ -1,134 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$admin = getAdmin($connect);
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 4) {
echo "<script>location.replace('_admin3.php');</script>";
}
switch($btn) {
case "무기지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set weap='0' where no='$genlist[$i]'";
} else {
$query = "update general set weap='$weap' where no='$genlist[$i]' and weap<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "책지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set book='0' where no='$genlist[$i]'";
} else {
$query = "update general set book='$weap' where no='$genlist[$i]' and book<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "말지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set horse='0' where no='$genlist[$i]'";
} else {
$query = "update general set horse='$weap' where no='$genlist[$i]' and horse<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "도구지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set item='0' where no='$genlist[$i]'";
} else {
$query = "update general set item='$weap' where no='$genlist[$i]' and item<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "메세지 전달":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
}
//echo "<script>location.replace('_admin3.php');</script>";
echo '_admin3.php';//TODO:replace
-193
View File
@@ -1,193 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
?>
<html>
<head>
<title>멀티관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>멀 티 관 리<br><?php backButton(); ?></td></tr>
</table>
<form name=form1 method=post action=_admin4_submit.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=80 align=center rowspan=3>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=blue>특별회원</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=105 rowspan=3>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,userlevel,block from general where ip!='' order by npc,ip";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
$style = "style=;";
if($general[block] > 0) { $style .= "background-color:red;"; }
if($general[npc] >= 2) { $style .= "color:cyan;"; }
elseif($general[npc] == 1) { $style .= "color:skyblue;"; }
if($general[con] > $admin[conlimit]) { $style .= "color:red;"; }
if($general[userlevel] > 2) { $style .= "color:blue;"; }
echo "
<option value=$general[no] $style>$general[name]</option>";
}
echo "
</select>";
?>
</td>
<td width=100 align=center>블럭</td>
<td width=504>
<input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br>
1단계:발언권, 2단계:턴블럭
</td>
</tr>
<tr>
<td align=center>강제 사망</td>
<td><input type=submit name=btn value='강제 사망'></td>
</tr>
<tr>
<td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td align=center width=100>장수명</td>
<td align=center width=180>최근로그인</td>
<td align=center width=129>IP</td>
<td align=center width=100>ID</td>
<td align=center width=278>-</td>
</tr>
<tr>
<?php
$query = "select substring_index(ip,'.',3) as ip2 from general where ip!='' and npc<2 group by ip2 having count(*)>1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ipCount = MYDB_num_rows($result);
$genName = "";
$genDate = "";
$genIP = "";
$genID = "";
$conMsg = "";
for($i=0; $i < $ipCount; $i++) {
$ip = MYDB_fetch_array($result);
$query = "select name,ip,lastconnect,user_id,block,conmsg from general where ip like '$ip[ip2]%' and npc<2 order by ip";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult);
for($k=0; $k < $genCount; $k++) {
$gen = MYDB_fetch_array($genResult);
if($gen[block] > 0) $genName .= "<font color=magenta>{$gen[name]}</font><br>";
else $genName .= $gen[name]."<br>";
$genDate .= $gen[lastconnect]."<br>";
$genIP .= $gen[ip]."<br>";
$genID .= $gen[user_id]."<br>";
$conMsg .= $gen[conmsg]."<br>";
}
$genName .= "<br>";
$genDate .= "<br>";
$genIP .= "<br>";
$genID .= "<br>";
$conMsg .= "<br>";
}
echo "
<td align=right>$genName</td>
<td>$genDate</td>
<td>$genIP</td>
<td>$genID</td>
<td>$conMsg</td>";
?>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td align=center width=100>장수명</td>
<td align=center width=180>최근로그인</td>
<td align=center width=129>Password</td>
<td align=center width=100>ID</td>
<td align=center width=278>-</td>
</tr>
<tr>
<?php
$query = "select password from general where npc<2 group by password having count(*)>1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ipCount = MYDB_num_rows($result);
$genName = "";
$genDate = "";
$genIP = "";
$genID = "";
$conMsg = "";
for($i=0; $i < $ipCount; $i++) {
$ip = MYDB_fetch_array($result);
$query = "select name,password,lastconnect,user_id,block,conmsg from general where password='$ip[password]' and npc<2";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult);
for($k=0; $k < $genCount; $k++) {
$gen = MYDB_fetch_array($genResult);
if($gen[block] > 0) $genName .= "<font color=magenta>{$gen[name]}</font><br>";
else $genName .= $gen[name]."<br>";
$genDate .= $gen[lastconnect]."<br>";
$genIP .= substr($gen[password],0,10)." ...<br>";
$genID .= $gen[user_id]."<br>";
$conMsg .= $gen[conmsg]."<br>";
}
$genName .= "<br>";
$genDate .= "<br>";
$genIP .= "<br>";
$genID .= "<br>";
$conMsg .= "<br>";
}
echo "
<td align=right>$genName</td>
<td>$genDate</td>
<td>$genIP</td>
<td>$genID</td>
<td>$conMsg</td>";
?>
</tr>
</table>
</form>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-107
View File
@@ -1,107 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "<script>location.replace('_admin4.php');</script>";
}
switch($btn) {
case "블럭 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=0 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "1단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=1,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "2단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=2,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "3단계 블럭":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set block=3,killturn=24 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id];
}
$connect = dbConn("sammo");
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($uid); $i++) {
//블럭정보
$query = "update MEMBER set block_num=block_num+1,block_date='$date' where id='$uid[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "무한삭턴":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set killturn=8000 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "강제 사망":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set turn0=0,killturn=0,turntime='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "메세지 전달":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$query = "select msgindex from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
}
//echo "<script>location.replace('_admin4.php');</script>";
echo '_admin4.php'; //TODO:replace
-313
View File
@@ -1,313 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
if($type == 0) {
$type = 0;
}
if($type2 == 0) {
$type2 = 0;
}
$sel[$type] = "selected";
$sel2[$type2] = "selected";
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
?>
<html>
<head>
<title>일제정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>일 제 정 보<br><?php closeButton(); ?></td></tr>
<tr><td>
<form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[0];?> value=0>국력</option>
<option <?=$sel[1];?> value=1>장수</option>
<option <?=$sel[2];?> value=2>기술</option>
<option <?=$sel[3];?> value=3>국고</option>
<option <?=$sel[4];?> value=4>병량</option>
<option <?=$sel[5];?> value=5>평금</option>
<option <?=$sel[6];?> value=6>평쌀</option>
<option <?=$sel[7];?> value=7>평통</option>
<option <?=$sel[8];?> value=8>평무</option>
<option <?=$sel[9];?> value=9>평지</option>
<option <?=$sel[10];?> value=10>평Lv</option>
<option <?=$sel[11];?> value=11>접속률</option>
<option <?=$sel[12];?> value=12>단기접</option>
<option <?=$sel[13];?> value=13>보숙</option>
<option <?=$sel[14];?> value=14>궁숙</option>
<option <?=$sel[15];?> value=15>기숙</option>
<option <?=$sel[16];?> value=16>귀숙</option>
<option <?=$sel[17];?> value=17>차숙</option>
</select>
<select name=type2 size=1>
<option <?=$sel2[0];?> value=0>국력</option>
<option <?=$sel2[1];?> value=1>국가별성향</option>
<option <?=$sel2[2];?> value=2>국가성향</option>
<option <?=$sel2[3];?> value=3>장수성격</option>
<option <?=$sel2[4];?> value=4>장수특기</option>
<option <?=$sel2[5];?> value=5>병종수</option>
<option <?=$sel2[6];?> value=6>기타</option>
</select>
<input type=submit value='정렬하기'>
</form>
<form name=form2 method=post action=_admin5_submit.php>
<select name=nation size=1 style=color:white;background-color:black>";
<option value=0>재야</option>";
<?php
$query = "select nation,name,color,scout,scoutmsg,gennum from nation order by power";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
echo "
<option value={$nation[nation]}>{$nation[name]}</option>";
}
?>
</select>
<input type=submit name=btn value='국가변경'>
</form>
</td></tr>
</table>
<table align=center width=1600 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13; id=bg0>
<tr id=bg1>
<td align=center>국명</td>
<td align=center>접률</td>
<td align=center>단접</td>
<td align=center>국력</td>
<td align=center>단합</td>
<td align=center>장수</td>
<td align=center>속령</td>
<td align=center>기술</td>
<td align=center>전략</td>
<td align=center>국고</td>
<td align=center>병량</td>
<td align=center>평금</td>
<td align=center>평쌀</td>
<td align=center>평통</td>
<td align=center>평무</td>
<td align=center>평지</td>
<td align=center>평Lv</td>
<td align=center>보숙</td>
<td align=center>궁숙</td>
<td align=center>기숙</td>
<td align=center>귀숙</td>
<td align=center>차숙</td>
<td align=center>총병</td>
<td align=center>인구</td>
<td align=center>인구율</td>
<td align=center>농업</td>
<td align=center>상업</td>
<td align=center>치안</td>
<td align=center>성벽</td>
<td align=center>수비</td>
<td align=center>국명</td>
</tr>
<?php
$query = "
SELECT
A.nation,
A.name,
A.power,
A.chemi,
A.color,
A.tech,
A.tricklimit,
A.gold,
A.rice,
COUNT(B.nation) AS gennum,
ROUND(AVG(B.connect), 1) AS connect,
ROUND(AVG(B.con), 1) AS con,
ROUND(AVG(B.dex0)) AS dex0,
ROUND(AVG(B.dex10)) AS dex10,
ROUND(AVG(B.dex20)) AS dex20,
ROUND(AVG(B.dex30)) AS dex30,
ROUND(AVG(B.dex40)) AS dex40
FROM nation A, general B
WHERE A.nation=B.nation
GROUP BY B.nation
";
switch($type) {
case 0: $query .= " order by power desc"; break;
case 1: $query .= " order by gennum desc"; break;
case 2: $query .= " order by A.tech desc"; break;
case 3: $query .= " order by A.gold desc"; break;
case 4: $query .= " order by A.rice desc"; break;
case 5: $query .= " order by avg(B.gold) desc"; break;
case 6: $query .= " order by avg(B.rice) desc"; break;
case 7: $query .= " order by avg(B.leader) desc"; break;
case 8: $query .= " order by avg(B.power) desc"; break;
case 9: $query .= " order by avg(B.intel) desc"; break;
case 10: $query .= " order by avg(B.explevel) desc"; break;
case 11: $query .= " order by avg(B.connect) desc"; break;
case 12: $query .= " order by avg(B.con) desc"; break;
case 13: $query .= " order by avg(B.dex0) desc"; break;
case 14: $query .= " order by avg(B.dex10) desc"; break;
case 15: $query .= " order by avg(B.dex20) desc"; break;
case 16: $query .= " order by avg(B.dex30) desc"; break;
case 17: $query .= " order by avg(B.dex40) desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result);
for($i=0; $i < $nationCount; $i++) {
$nation = MYDB_fetch_array($result);
$query = "select COUNT(*) as cnt,
ROUND(AVG(gold)) as avgg,
ROUND(AVG(rice)) as avgr,
SUM(leader) as leader, ROUND(AVG(leader), 1) as avgl,
ROUND(AVG(power), 1) as avgp,
ROUND(AVG(intel), 1) as avgi,
ROUND(AVG(explevel), 1) as avge,
SUM(crew) as crew
from general where nation='$nation[nation]'";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($genResult);
$query = "select COUNT(*) as cnt,
SUM(pop) as pop, SUM(pop2) as pop2,
ROUND(SUM(pop)/SUM(pop2)*100, 2) as rate,
ROUND(SUM(agri)/SUM(agri2)*100, 2) as agri,
ROUND(SUM(comm)/SUM(comm2)*100, 2) as comm,
ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu,
ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall,
ROUND(SUM(def)/SUM(def2)*100, 2) as def
from city where nation='$nation[nation]'";
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityResult);
echo "
<tr>
<td align=center style=background-color:$nation[color];color:".newColor($nation[color]).";>$nation[name]</td>
<td align=center>&nbsp;{$nation[connect]}&nbsp;</td>
<td align=center>&nbsp;{$nation[con]}&nbsp;</td>
<td align=center>&nbsp;{$nation[power]}&nbsp;</td>
<td align=center>&nbsp;{$nation[chemi]}&nbsp;</td>
<td align=center>&nbsp;{$gen[cnt]}&nbsp;</td>
<td align=center>&nbsp;{$city[cnt]}&nbsp;</td>
<td align=center>&nbsp;{$nation[tech]}&nbsp;</td>
<td align=center>&nbsp;{$nation[tricklimit]}&nbsp;</td>
<td align=center>&nbsp;{$nation[gold]}&nbsp;</td>
<td align=center>&nbsp;{$nation[rice]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgg]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgr]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgl]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgp]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgi]}&nbsp;</td>
<td align=center>&nbsp;{$gen[avge]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex0]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex10]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex20]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex30]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex40]}&nbsp;</td>
<td align=center>&nbsp;{$gen[crew]}/{$gen[leader]}00&nbsp;</td>
<td align=center>&nbsp;{$city[pop]}/{$city[pop2]}&nbsp;</td>
<td align=center>&nbsp;{$city[rate]}%&nbsp;</td>
<td align=center>&nbsp;{$city[agri]}%&nbsp;</td>
<td align=center>&nbsp;{$city[comm]}%&nbsp;</td>
<td align=center>&nbsp;{$city[secu]}%&nbsp;</td>
<td align=center>&nbsp;{$city[wall]}%&nbsp;</td>
<td align=center>&nbsp;{$city[def]}%&nbsp;</td>
<td align=center style=background-color:$nation[color];color:".newColor($nation[color]).";>$nation[name]</td>
</tr>
";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php TrickLog(20, $me[skin]); ?></td></tr>
</table>
<table align=center width=1760 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13; id=bg0>
<tr id=bg1>
<td width=30 align=center>년</td>
<td width=30 align=center>월</td>
<td width=50 align=center>국가수</td>
<td width=50 align=center>장수수</td>
<?php
switch($type2) {
default:
case 0: echo "<td width=1600>국력(국력,장수수,도시수,인구/100,최대인구/100,국가자원/100,장수자원/100,능력치,숙련/1000,경험공헌/100)</td>"; break;
case 1: echo "<td width=1600>국가별성향</td>"; break;
case 2: echo "<td width=1600>국가성향</td>"; break;
case 3: echo "<td width=1600>장수성격</td>"; break;
case 4: echo "<td width=1600>장수특기</td>"; break;
case 5: echo "<td width=1600>병종수</td>"; break;
case 6: echo "<td width=1600>기타</td>"; break;
}
?>
</tr>
<?php
$query = "select * from statistic where month=1 or no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$stat = MYDB_fetch_array($result);
echo "
<tr>
<td align=center>{$stat[year]}</td>
<td align=center>{$stat[month]}</td>
<td align=center>{$stat[nation_count]}</td>
<td align=center>{$stat[gen_count]}</td>
";
switch($type2) {
default:
case 0: echo "<td>{$stat[power_hist]}</td>"; break;
case 1: echo "<td>{$stat[nation_name]}</td>"; break;
case 2: echo "<td>{$stat[nation_hist]}</td>"; break;
case 3: echo "<td>{$stat[personal_hist]}</td>"; break;
case 4: echo "<td>{$stat[special_hist]}</td>"; break;
case 5: echo "<td>{$stat[crewtype]}</td>"; break;
case 6: echo "<td>{$stat[etc]}</td>"; break;
}
echo "
</tr>
";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-101
View File
@@ -1,101 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
<html>
<head>
<title>접속정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>접 속 정 보<br><?php closeButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[0];?> value=0>접속률</option>
<option <?=$sel[1];?> value=1>총갱신</option>
<option <?=$sel[2];?> value=2>갱신/턴</option>
<option <?=$sel[3];?> value=3>총로그인</option>
<option <?=$sel[4];?> value=4>갱신/로그인</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr id=bg1>
<td align=center width=120>장수명</td>
<td align=center width=50>접속률</td>
<td align=center width=40>시작연령</td>
<td align=center width=40>연령</td>
<td align=center width=80>총갱신</td>
<td align=center width=80>갱신/턴</td>
<td align=center width=80>총로그인</td>
<td align=center width=100>갱신/로그인</td>
</tr>
<?php
switch($type) {
case 0: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by connect desc limit 0,30"; break;
case 1: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by refcnt desc limit 0,30"; break;
case 2: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by ref desc limit 0,30"; break;
case 3: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by logcnt desc limit 0,30"; break;
case 4: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by log desc limit 0,30"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($genresult);
echo "
<tr>
<td align=center>$gen[name]</td>
<td align=center>$gen[connect]</td>
<td align=center>$gen[startage]</td>
<td align=center>$gen[age]</td>
<td align=center>".round($gen[refcnt]/2, 1)."</td>
<td align=center>".round($gen[ref]/2,1)."</td>
<td align=center>$gen[logcnt]</td>
<td align=center>".round($gen[log]/2,1)."</td>
</tr>";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-133
View File
@@ -1,133 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
if($btn == '정렬하기') {
$gen = 0;
}
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
<html>
<head>
<title>로그정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>로 그 정 보<br><?php closeButton(); ?></td></tr>
<tr><td>
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0];?> value=0>최근턴</option>
<option <?=$sel[1];?> value=1>최근전투</option>
<option <?=$sel[2];?> value=2>장수명</option>
<option <?=$sel[3];?> value=3>전투수</option>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
<select name=gen size=1>
<?php
switch($type) {
case 0: $query = "select no,name from general order by turntime desc"; break;
case 1: $query = "select no,name from general order by recwar desc"; break;
case 2: $query = "select no,name from general order by npc,binary(name)"; break;
case 3: $query = "select no,name from general order by warnum desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수
if($gen == 0) {
$gen = $general[no];
}
if($gen == $general[no]) {
echo "
<option selected value={$general[no]}>{$general[name]}</option>";
} else {
echo "
<option value={$general[no]}>{$general[name]}</option>";
}
}
?>
</select>
<input type=submit name=btn value='조회하기'>
</form>
</td></tr>
</table>
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=50% align=center id=bg1><font color=skyblue size=3>장 수 정 보</font></td>
<td width=50% align=center id=bg1><font color=orange size=3>-</font></td>
</tr>
<tr>
<td valign=top>
<?php generalInfo($connect, $gen, $me[skin]); generalInfo2($connect, $gen, $me[skin]); ?>
</td>
<td valign=top>&nbsp;
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>전투 기록</font></td>
</tr>
<tr>
<td valign=top>
<?php MyLog($gen, 24, $me[skin]); ?>
</td>
<td valign=top>
<?php MyBatLog($gen, 24, $me[skin]); ?>
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>장수 열전</font></td>
<td align=center id=bg1><font color=orange size=3>전투 결과</font></td>
</tr>
<tr>
<td valign=top>
<?php MyHistory($connect, $gen, $me[skin]); ?>
</td>
<td valign=top>
<?php MyBatRes($gen, 24, $me[skin]); ?>
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-156
View File
@@ -1,156 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
if($btn == '정렬하기') {
$gen = 0;
}
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
?>
<html>
<head>
<title>외교정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>외 교 정 보<br><?php closeButton(); ?></td></tr>
<tr><td>
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0];?> value=0>상태</option>
</select>
<input type=submit name=btn value='정렬하기'>
</form>
</td></tr>
</table>
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=9 align=center bgcolor=blue>외 교 관 계</td></tr>
<tr>
<td width=100 align=center id=bg1>국 가 명</td>
<td width=100 align=center id=bg1>국 가 명</td>
<td width=80 align=center id=bg1>상 태</td>
<td width=60 align=center id=bg1>기 간</td>
<td align=center id=bg1>비 고</td>
</tr>
<?php
$query = "select nation,name,color from nation";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result);
$nationName[$nation[nation]] = $nation[name];
$nationColor[$nation[nation]] = $nation[color];
}
switch($type) {
case 0: $query = "select * from diplomacy where me < you order by state desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result);
for($i=0; $i < $dipcount; $i++) {
$dip = MYDB_fetch_array($result);
$me = $dip[me];
$you = $dip[you];
$query = "select reserved,showing from diplomacy where you='$me' and me='$you'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result2);
if($dip[state] == 2 && $dip[fixed] == "" && $dip[reserved] == "" && $dip2[reserved] == "") {
continue;
}
switch($dip[state]) {
case 0: $state = "<font color=red>교 전</font>"; break;
case 1: $state = "<font color=magenta>선포중</font>"; break;
case 2: $state = "통 상"; break;
case 3: $state = "<font color=cyan>통합수락중</font>"; break;
case 4: $state = "<font color=cyan>통합제의중</font>"; break;
case 5: $state = "<font color=cyan>합병수락중</font>"; break;
case 6: $state = "<font color=cyan>합병제의중</font>"; break;
case 7: $state = "<font color=green>불가침</font>"; break;
}
$date = date('Y-m-d H:i:s');
$note = "";
if($dip[fixed] != "") {
if($dip[state] == 7) {
$note .= $dip[fixed];
} else {
$note .= "<font color=gray>{$dip[fixed]}</font>";
}
if($dip[reserved] != "" || $dip2[reserved] != "") {
$note .= "<br>";
}
}
if($dip[reserved] != "") {
if($dip[showing] >= $date) {
$note .= "<font color=skyblue>아국측 제의</font>: {$dip[reserved]}";
} else {
$note .= "<font color=gray>아국측 제의: {$dip[reserved]}</font>";
}
if($dip2[reserved] != "") {
$note .= "<br>";
}
}
if($dip2[reserved] != "") {
if($dip2[showing] >= $date) {
$note .= "<font color=limegreen>상대측 제의</font>: {$dip2[reserved]}";
} else {
$note .= "<font color=gray>상대측 제의: {$dip2[reserved]}</font>";
}
}
if($note == "") { $note = "&nbsp;"; }
echo "
<tr>
<td align=center style=color:".newColor($nationColor[$me]).";background-color:{$nationColor[$me]};>$nationName[$me]</td>
<td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td>
<td align=center>$state</td>
<td align=center>$dip[term] 개월</td>
<td align=left style=font-size:7px;>{$note}</td>
</tr>";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-1562
View File
@@ -1,1562 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "시뮬", 2);
$query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select * from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$game = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $game[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($me[userlevel] < 3) {
echo "특별회원이 아닙니다.";
exit();
}
$mydeathnumSum = 0;
$mykillnumSum = 0;
$expSum = 0;
$ricingSum = 0;
$expSum2 = 0;
$ricingSum2 = 0;
if($isgen == "장수평균" || $isgen == "성벽평균") {
$simulCount = 1000;
} else {
$simulCount = 1;
}
if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평균" || $isgen == "성벽평균") {
$msg2 = "";
for($i=0; $i < $simulCount; $i++) {
$general[leader] = $leader1;
$general[power] = $power1;
$general[intel] = $intel1;
$general[crewtype] = $type1;
$general[crew] = $crew1;
$general[train] = $train1;
$general[atmos] = $atmos1;
$general[level] = $level1;
$general[explevel] = $explevel1;
$general[dex0] = $dex10;
$general[dex10] = $dex110;
$general[dex20] = $dex120;
$general[dex30] = $dex130;
$general[dex40] = $dex140;
$oppose[leader] = $leader2;
$oppose[power] = $power2;
$oppose[intel] = $intel2;
$oppose[crewtype] = $type2;
$oppose[crew] = $crew2;
$oppose[train] = $train2;
$oppose[atmos] = $atmos2;
$oppose[level] = $level2;
$oppose[explevel] = $explevel2;
$oppose[dex0] = $dex20;
$oppose[dex10] = $dex210;
$oppose[dex20] = $dex220;
$oppose[dex30] = $dex230;
$oppose[dex40] = $dex240;
$city[def] = $def;
$city[wall] = $wall;
if($isgen == "장수공격" || $isgen == "장수평균") {
$opposecount = 1;
} else {
$opposecount = 0;
}
$warphase = getRate($game, $general[crewtype], "spd"); //병종간 페이즈 수 얻기
// 우선 스케일링
$city[def] *= 10;
$city[wall] *= 10;
$msg = "";
$msg .= "<C>●</>1월:공격장수가 <R>공격</>합니다.<br>";
$exp = 0; //병사 소진 시킨 만큼
$opexp = 0;
$exp2 = 1; //능력경험치
$phase = 0;
while($phase < $warphase) {
// 장수가 없어서 도시 공격
if($opposecount == 0) {
$msg .= "<C>●</>".getTypename($general[crewtype])."(으)로 성을 <M>공격</>합니다.<br>";
$mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) {
$phase++;
$myAtt = getAtt($game, $general, $tech1);
$myDef = getDef($game, $general, $tech1);
$cityAtt = getCityAtt($city);
$cityDef = getCityDef($city);
// 감소할 병사 수
$cityCrew = $_armperphase + $myAtt - $cityDef;
$myCrew = $_armperphase + $cityAtt - $myDef;
$cityweight = $myAtt - $cityDef;
$myweight = $cityAtt - $myDef;
//훈련 사기따라
$myCrew = getCrew($myCrew, $atmos3, $general[train]);
$cityCrew = getCrew($cityCrew, $general[atmos], $train3);
//숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]);
$genDexDef = getGenDex($general, 40);
$cityCrew *= getDexLog($genDexAtt, ($train3-60)*7200);
$myCrew *= getDexLog(($atmos3-60)*7200, $genDexDef);
$avoid = 1;
// 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병
$int = $general[intel] + getBookEff($general[book]);
if($general[crewtype] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60%
}
$ratio = rand() % 1000; // 0~999
if($ratio <= $ratio2) {
$ratio = rand() % 100; // 0~99
if($ratio >= 30) {
$type = rand() % 3;
switch($type) {
case 0:
$msg .= "<C>●</><D>급습</>을 <C>성공</>했다!<br>";
$cityCrew *= 1.2;
break;
case 1:
$msg .= "<C>●</><D>위보</>를 <C>성공</>했다!<br>";
$cityCrew *= 1.4;
break;
case 2:
$msg .= "<C>●</><D>혼란</>을 <C>성공</>했다!<br>";
$cityCrew *= 1.6;
break;
}
} else {
$type = rand() % 3;
switch($type) {
case 0:
$msg .= "<C>●</><D>급습</>을 <R>실패</>했다!<br>";
$cityCrew /= 1.2;
$myCrew *= 1.2;
break;
case 1:
$msg .= "<C>●</><D>위보</>를 <R>실패</>했다!<br>";
$cityCrew /= 1.4;
$myCrew *= 1.4;
break;
case 2:
$msg .= "<C>●</><D>혼란</>을 <R>실패</>했다!<br>";
$cityCrew /= 1.6;
$myCrew *= 1.6;
break;
}
}
}
} elseif($general[crewtype] == 40) { // 정란
$cityCrew = $cityCrew * 1.5;
} elseif($general[crewtype] == 41) { // 충차
$cityCrew = $cityCrew * 2.0;
} elseif($general[crewtype] == 42) { // 벽력거
$cityCrew = $cityCrew * 1.5;
}
//군주, 참모, 장군 공격 보정 5%
if($general[level] == 12 || $general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) {
$cityCrew = $cityCrew * 1.05;
}
//레벨 보정
$cityCrew = $cityCrew * (100 + $general[explevel]/6)/100;
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader], $general[power], $general[intel]);
if($ratio >= $rd && $avoid == 1) {
$msg .= "<C>●</><C>필살</>공격!</><br>";
$cityCrew = CriticalScore2($cityCrew);
$avoid = 0;
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율
if($ratio < $ratio2 && $avoid == 1) {
$msg .= "<C>●</><C>회피</>했다!</><br>";
$myCrew /= 10; // 10%만 소모
$avoid = 0;
}
//랜타추가
$cityCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
$general[crew] -= round($myCrew);
$city[def] -= round($cityCrew);
$city[wall] -= round($cityCrew);
$tempMyCrew = $myCrew; $tempCityCrew = $cityCrew;
$tempGeneralCrew = $general[crew]; $tempCityDef = $city[def];
if($city[wall] <= 0) { $city[wall] = 0; }
if($city[def] < 0) {
$offset = round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset;
$general[crew] -= $offset;
$cityCrew += $tempCityDef;
$city[def] = 0;
}
if($general[crew] < 0) {
$offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset;
$city[def] -= $offset;
$myCrew += $tempGeneralCrew;
$general[crew] = 0;
}
$exp += $cityCrew;
$opexp += $myCrew;
$general[crew] = round($general[crew]);
$cityCrew = round($cityCrew);
$myCrew = round($myCrew);
$myAtt = round($myAtt, 2);
$myDef = round($myDef, 2);
$cityAtt = round($cityAtt, 2);
$cityDef = round($cityDef, 2);
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general[crew] (-$myCrew)</> VS <C>$city[def] (-$cityCrew)</> <Y1>【성벽】</><br>";
$mykillnum += $cityCrew; $mydeathnum += $myCrew;
if($city[def] <= 0) { break; }
if($general[crew] <= 0) { break; }
}
// 도시쌀 소모 계산
$opexp = round($opexp / 50);
$rice = round($opexp * 4 * getCrewtypeRice($game, 0, 0) * ($train3/100 - 0.2));
//원래대로 스케일링
$city[def] = round($city[def] / 10);
$city[wall] = round($city[wall] / 10);
//내정 감소
$dec = round($cityCrew / 10);
$city[agri] -= $dec;
$city[comm] -= $dec;
$city[secu] -= $dec;
if($city[agri] < 0) { $city[agri] = 0; }
if($city[comm] < 0) { $city[comm] = 0; }
if($city[secu] < 0) { $city[secu] = 0; }
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
$msg .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
// $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</>   ";
// $msg2 .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
if($city[def] == 0 || $general[crew] == 0) {
break;
}
// 장수 대결
} else {
$msg .= "<C>●</>".getTypename($general[crewtype])."(으)로 <Y>수비장수</>의 ".getTypename($oppose[crewtype])."(을)를 공격합니다.<br>";
$mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) {
$phase++;
$myAtt = getAtt($game, $general, $tech1);
$myDef = getDef($game, $general, $tech1);
$opAtt = getAtt($game, $oppose, $tech2);
$opDef = getDef($game, $oppose, $tech2);
// 감소할 병사 수
$myCrew = $_armperphase + $opAtt - $myDef;
$opCrew = $_armperphase + $myAtt - $opDef;
//훈련 사기따라
$myCrew = getCrew($myCrew, $oppose[atmos], $general[train]);
$opCrew = getCrew($opCrew, $general[atmos], $oppose[train]);
//숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]);
$genDexDef = getGenDex($general, $oppose[crewtype]);
$oppDexAtt = getGenDex($oppose, $oppose[crewtype]);
$oppDexDef = getGenDex($oppose, $general[crewtype]);
$opCrew *= getDexLog($genDexAtt, $oppDexDef);
$myCrew *= getDexLog($oppDexAtt, $genDexDef);
$myAvoid = 1;
$opAvoid = 1;
// 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병
$int = $general[intel] + getBookEff($general[book]);
if($general[crewtype] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60%
}
$ratio = rand() % 1000; // 0~999
if($ratio <= $ratio2) {
$ratio = rand() % 100;
if($ratio >= 30) {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$msg .= "<C>●</><D>위보</>를 <C>성공</>했다!<br>";
$opCrew *= 1.2;
break;
case 1:
$msg .= "<C>●</><D>매복</>을 <C>성공</>했다!<br>";
$opCrew *= 1.4;
break;
case 2:
$msg .= "<C>●</><D>반목</>을 <C>성공</>했다!<br>";
$opCrew *= 1.6;
break;
case 3:
$msg .= "<C>●</><D>화계</>를 <C>성공</>했다!<br>";
$opCrew *= 1.8;
break;
case 4:
$msg .= "<C>●</><D>혼란</>을 <C>성공</>했다!<br>";
$opCrew *= 2.0;
break;
}
} else {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$msg .= "<C>●</><D>위보</>를 <R>실패</>했다!<br>";
$opCrew /= 1.1;
$myCrew *= 1.1;
break;
case 1:
$msg .= "<C>●</><D>매복</>을 <R>실패</>했다!<br>";
$opCrew /= 1.2;
$myCrew *= 1.2;
break;
case 2:
$msg .= "<C>●</><D>반목</>을 <R>실패</>했다!<br>";
$opCrew /= 1.3;
$myCrew *= 1.3;
break;
case 3:
$msg .= "<C>●</><D>화계</>를 <R>실패</>했다!<br>";
$opCrew /= 1.4;
$myCrew *= 1.4;
break;
case 4:
$msg .= "<C>●</><D>혼란</>을 <R>실패</>했다!<br>";
$opCrew /= 1.5;
$myCrew *= 1.5;
break;
}
}
}
}
// 상대 장수 병종간 특성
if(floor($oppose[crewtype]/10) == 3) { // 귀병
$int = $oppose[intel] + getBookEff($oppose[book]);
if($oppose[crewtype] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50%
} elseif($oppose[crewtype] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60%
}
$ratio = rand() % 1000; // 0~999
if($ratio <= $ratio2) {
$ratio = rand() % 100;
if($ratio >= 30) {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$msg .= "<C>●</><D>위보</>에 당했다!<br>";
$myCrew *= 1.2;
break;
case 1:
$msg .= "<C>●</><D>매복</>에 당했다!<br>";
$myCrew *= 1.4;
break;
case 2:
$msg .= "<C>●</><D>반목</>에 당했다!<br>";
$myCrew *= 1.6;
break;
case 3:
$msg .= "<C>●</><D>화계</>에 당했다!<br>";
$myCrew *= 1.8;
break;
case 4:
$msg .= "<C>●</><D>혼란</>에 당했다!<br>";
$myCrew *= 2.0;
break;
}
} else {
$type = rand() % 5; // 0~4
switch($type) {
case 0:
$msg .= "<C>●</><D>위보</>를 간파했다!<br>";
$myCrew /= 1.1;
$opCrew *= 1.1;
break;
case 1:
$msg .= "<C>●</><D>매복</>을 간파했다!<br>";
$myCrew /= 1.2;
$opCrew *= 1.2;
break;
case 2:
$msg .= "<C>●</><D>반목</>을 간파했다!<br>";
$myCrew /= 1.3;
$opCrew *= 1.3;
break;
case 3:
$msg .= "<C>●</><D>화계</>를 간파했다!<br>";
$myCrew /= 1.4;
$opCrew *= 1.4;
break;
case 4:
$msg .= "<C>●</><D>혼란</>을 간파했다!<br>";
$myCrew /= 1.5;
$opCrew *= 1.5;
break;
}
}
}
}
if($oppose[crewtype] == 43) { // 목우
$r = 0;
$r += $oppose[atmos];
$r += $oppose[train];
$ratio = rand() % 400; // 최대 50% 저지
if($ratio < $r && $opAvoid == 1) {
$msg .= "<C>●</><R>저지</>당했다!</><br>";
$opAvoid = 0;
continue;
}
}
// my 입장 상성
// 보병계열 > 궁병계열
if(floor($general[crewtype]/10) == 0 && floor($oppose[crewtype]/10) == 1) {
$myCrew *= 0.8;
$opCrew *= 1.2;
}
// 궁병계열 > 기병계열
if(floor($general[crewtype]/10) == 1 && floor($oppose[crewtype]/10) == 2) {
$myCrew *= 0.8;
$opCrew *= 1.2;
}
// 기병계열 > 보병계열
if(floor($general[crewtype]/10) == 2 && floor($oppose[crewtype]/10) == 0) {
$myCrew *= 0.8;
$opCrew *= 1.2;
}
// 차병계열
if(floor($general[crewtype]/10) == 4) {
$myCrew *= 1.2;
$opCrew *= 0.8;
}
// op 입장 상성
// 보병계열 > 궁병계열
if(floor($oppose[crewtype]/10) == 0 && floor($general[crewtype]/10) == 1) {
$opCrew *= 0.8;
$myCrew *= 1.2;
}
// 궁병계열 > 기병계열
if(floor($oppose[crewtype]/10) == 1 && floor($general[crewtype]/10) == 2) {
$opCrew *= 0.8;
$myCrew *= 1.2;
}
// 기병계열 > 보병계열
if(floor($oppose[crewtype]/10) == 2 && floor($general[crewtype]/10) == 0) {
$opCrew *= 0.8;
$myCrew *= 1.2;
}
// 차병계열
if(floor($oppose[crewtype]/10) == 4) {
$opCrew *= 1.2;
$myCrew *= 0.8;
}
//군주, 참모, 장군 공격 보정 5%
if($general[level] == 12 || $general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) {
$opCrew = $opCrew * 1.05;
}
//상대장수 관직 보정
//군주, 참모, 모사 방어 보정 5%
if($oppose[level] == 12 || $oppose[level] == 11 || $oppose[level] == 9 || $oppose[level] == 7 || $oppose[level] == 5) {
$opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 4 && $oppose[no] == $city[gen1]) { // 태수 보정
$opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 3 && $oppose[no] == $city[gen2]) { // 군사 보정
$opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 2 && $oppose[no] == $city[gen3]) { // 시중 보정
$opCrew = $opCrew * 0.95;
}
//레벨 보정
$myCrew = $myCrew * ((100 - $general[explevel]/3)/100);
$opCrew = $opCrew / ((100 - $general[explevel]/3)/100);
$myCrew = $myCrew / ((100 - $oppose[explevel]/3)/100);
$opCrew = $opCrew * ((100 - $oppose[explevel]/3)/100);
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader], $general[power], $general[intel]);
if($ratio >= $rd && $myAvoid == 1) {
$msg .= "<C>●</><C>필살</>공격!</><br>";
$opCrew = CriticalScore2($opCrew);
$myAvoid = 0;
}
//크리
$rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($oppose[leader], $oppose[power], $oppose[intel]);
if($ratio >= $rd && $opAvoid == 1) {
$msg .= "<C>●</>상대의 <R>필살</>공격!</><br>";
$myCrew = CriticalScore2($myCrew);
$opAvoid = 0;
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율
if($ratio < $ratio2 && $myAvoid == 1) {
$msg .= "<C>●</><C>회피</>했다!</><br>";
$myCrew /= 10; // 10%만 소모
$myAvoid = 0;
}
//회피
$ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $oppose[crewtype], "avd"); //회피율
if($ratio < $ratio2 && $opAvoid == 1) {
$msg .= "<C>●</>상대가 <R>회피</>했다!</><br>";
$opCrew /= 10; // 10%만 소모
$opAvoid = 0;
}
//랜타추가
$opCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
$general[crew] -= round($myCrew);
$oppose[crew] -= round($opCrew);
$tempMyCrew = $myCrew; $tempOpCrew = $opCrew;
$tempGeneralCrew = $general[crew]; $tempOpposeCrew = $oppose[crew];
if($general[crew] <= 0 && $oppose[crew] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempOpposeCrew / $tempOpCrew;
if($r1 > $r2) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset;
$general[crew] -= $offset;
$opCrew += $tempOpposeCrew;
$oppose[crew] = 0;
} else {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset;
$oppose[crew] -= $offset;
$myCrew += $tempGeneralCrew;
$general[crew] = 0;
}
} elseif($general[crew] * $oppose[crew] <= 0) {
if($oppose[crew] < 0) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset;
$general[crew] -= $offset;
$opCrew += $tempOpposeCrew;
$oppose[crew] = 0;
}
if($general[crew] < 0) {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset;
$oppose[crew] -= $offset;
$myCrew += $tempGeneralCrew;
$general[crew] = 0;
}
}
$exp += $opCrew;
$opexp += $myCrew;
$general[crew] = round($general[crew]);
$oppose[crew] = round($oppose[crew]);
$myCrew = round($myCrew);
$opCrew = round($opCrew);
$myAtt = round($myAtt, 2);
$myDef = round($myDef, 2);
$opAtt = round($opAtt, 2);
$opDef = round($opDef, 2);
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general[crew] (-$myCrew)</> VS <C>$oppose[crew] (-$opCrew)</> <Y1>【수비장수】</><br>";
$mykillnum += $opCrew; $mydeathnum += $myCrew;
if($oppose[crew] <= 0) { break; }
if($general[crew] <= 0) { break; }
}
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
// $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</>   ";
}
}
// 공헌, 명성 상승
$exp = round($exp / 50);
$ricing = ($exp * 5 * getCrewtypeRice($game, $general[crewtype], $tech1));
$msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricing<br>";
// $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricing<br>";
$msg = ConvertLog($msg, 1);
$mydeathnumSum += $mydeathnum;
$mykillnumSum += $mykillnum;
$expSum += $exp;
$ricingSum += $ricing;
$expSum2 += $dec;
$ricingSum2 += $rice;
}
$mydeathnumSum /= $simulCount;
$mykillnumSum /= $simulCount;
$expSum /= $simulCount;
$ricingSum /= $simulCount;
$expSum2 /= $simulCount;
$ricingSum2 /= $simulCount;
if($isgen == "성벽평균") {
$msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "<R>★</>【성벽】내정 감소량 : $expSum2 【성벽】쌀 소모 : $ricingSum2<br>";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricingSum<br>";
} elseif($isgen == "장수평균") {
$msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricingSum<br>";
}
$msg2 = ConvertLog($msg2, 1);
} else {
$leader1 = 70;
$power1 = 70;
$intel1 = 10;
$type1 = 0;
$crew1 = 7000;
$train1 = 100;
$atmos1 = 100;
$level1 = 1;
$explevel1 = 20;
$leader2 = 70;
$power2 = 70;
$intel2 = 10;
$type2 = 0;
$crew2 = 7000;
$train2 = 100;
$atmos2 = 100;
$level2 = 1;
$explevel2 = 20;
$def = 7000;
$wall = 7000;
$train3 = $game[city_rate];
$atmos3 = $game[city_rate];
}
switch($level1) {
case 12: $sellevel1[12] = "selected"; break;
case 11: $sellevel1[11] = "selected"; break;
case 10: $sellevel1[10] = "selected"; break;
case 9: $sellevel1[9] = "selected"; break;
case 8: $sellevel1[8] = "selected"; break;
case 7: $sellevel1[7] = "selected"; break;
case 6: $sellevel1[6] = "selected"; break;
case 5: $sellevel1[5] = "selected"; break;
case 1: $sellevel1[1] = "selected"; break;
}
switch($level2) {
case 12: $sellevel2[12] = "selected"; break;
case 11: $sellevel2[11] = "selected"; break;
case 10: $sellevel2[10] = "selected"; break;
case 9: $sellevel2[9] = "selected"; break;
case 8: $sellevel2[8] = "selected"; break;
case 7: $sellevel2[7] = "selected"; break;
case 6: $sellevel2[6] = "selected"; break;
case 5: $sellevel2[5] = "selected"; break;
case 1: $sellevel2[1] = "selected"; break;
}
switch($type1) {
case 0: $sel1[0] = "selected"; break;
case 1: $sel1[1] = "selected"; break;
case 2: $sel1[2] = "selected"; break;
case 3: $sel1[3] = "selected"; break;
case 4: $sel1[4] = "selected"; break;
case 5: $sel1[5] = "selected"; break;
case 10: $sel1[10] = "selected"; break;
case 11: $sel1[11] = "selected"; break;
case 12: $sel1[12] = "selected"; break;
case 13: $sel1[13] = "selected"; break;
case 14: $sel1[14] = "selected"; break;
case 20: $sel1[20] = "selected"; break;
case 21: $sel1[21] = "selected"; break;
case 22: $sel1[22] = "selected"; break;
case 23: $sel1[23] = "selected"; break;
case 24: $sel1[24] = "selected"; break;
case 25: $sel1[25] = "selected"; break;
case 26: $sel1[26] = "selected"; break;
case 27: $sel1[27] = "selected"; break;
case 30: $sel1[30] = "selected"; break;
case 31: $sel1[31] = "selected"; break;
case 32: $sel1[32] = "selected"; break;
case 33: $sel1[33] = "selected"; break;
case 34: $sel1[34] = "selected"; break;
case 35: $sel1[35] = "selected"; break;
case 36: $sel1[36] = "selected"; break;
case 37: $sel1[37] = "selected"; break;
case 38: $sel1[38] = "selected"; break;
case 40: $sel1[40] = "selected"; break;
case 41: $sel1[41] = "selected"; break;
case 42: $sel1[42] = "selected"; break;
case 43: $sel1[43] = "selected"; break;
}
switch($type2) {
case 0: $sel2[0] = "selected"; break;
case 1: $sel2[1] = "selected"; break;
case 2: $sel2[2] = "selected"; break;
case 3: $sel2[3] = "selected"; break;
case 4: $sel2[4] = "selected"; break;
case 5: $sel2[5] = "selected"; break;
case 10: $sel2[10] = "selected"; break;
case 11: $sel2[11] = "selected"; break;
case 12: $sel2[12] = "selected"; break;
case 13: $sel2[13] = "selected"; break;
case 14: $sel2[14] = "selected"; break;
case 20: $sel2[20] = "selected"; break;
case 21: $sel2[21] = "selected"; break;
case 22: $sel2[22] = "selected"; break;
case 23: $sel2[23] = "selected"; break;
case 24: $sel2[24] = "selected"; break;
case 25: $sel2[25] = "selected"; break;
case 26: $sel2[26] = "selected"; break;
case 27: $sel2[27] = "selected"; break;
case 30: $sel2[30] = "selected"; break;
case 31: $sel2[31] = "selected"; break;
case 32: $sel2[32] = "selected"; break;
case 33: $sel2[33] = "selected"; break;
case 34: $sel2[34] = "selected"; break;
case 35: $sel2[35] = "selected"; break;
case 36: $sel2[36] = "selected"; break;
case 37: $sel2[37] = "selected"; break;
case 38: $sel2[38] = "selected"; break;
case 40: $sel2[40] = "selected"; break;
case 41: $sel2[41] = "selected"; break;
case 42: $sel2[42] = "selected"; break;
case 43: $sel2[43] = "selected"; break;
}
switch($tech1) {
case 0: $tch1[0] = "selected"; break;
case 1000: $tch1[1] = "selected"; break;
case 2000: $tch1[2] = "selected"; break;
case 3000: $tch1[3] = "selected"; break;
case 4000: $tch1[4] = "selected"; break;
case 5000: $tch1[5] = "selected"; break;
case 6000: $tch1[6] = "selected"; break;
case 7000: $tch1[7] = "selected"; break;
case 8000: $tch1[8] = "selected"; break;
case 9000: $tch1[9] = "selected"; break;
case 10000: $tch1[10] = "selected"; break;
}
switch($tech2) {
case 0: $tch2[0] = "selected"; break;
case 1000: $tch2[1] = "selected"; break;
case 2000: $tch2[2] = "selected"; break;
case 3000: $tch2[3] = "selected"; break;
case 4000: $tch2[4] = "selected"; break;
case 5000: $tch2[5] = "selected"; break;
case 6000: $tch2[6] = "selected"; break;
case 7000: $tch2[7] = "selected"; break;
case 8000: $tch2[8] = "selected"; break;
case 9000: $tch2[9] = "selected"; break;
case 10000: $tch2[10] = "selected"; break;
}
switch($dex10) {
case 0: $dx10[0] = "selected"; break;
case 2500: $dx10[1] = "selected"; break;
case 7500: $dx10[2] = "selected"; break;
case 15000: $dx10[3] = "selected"; break;
case 25000: $dx10[4] = "selected"; break;
case 37500: $dx10[5] = "selected"; break;
case 52500: $dx10[6] = "selected"; break;
case 70000: $dx10[7] = "selected"; break;
case 90000: $dx10[8] = "selected"; break;
case 112500: $dx10[9] = "selected"; break;
case 137500: $dx10[10] = "selected"; break;
case 165000: $dx10[11] = "selected"; break;
case 195000: $dx10[12] = "selected"; break;
case 227500: $dx10[13] = "selected"; break;
case 262500: $dx10[14] = "selected"; break;
case 300000: $dx10[15] = "selected"; break;
case 340000: $dx10[16] = "selected"; break;
case 382500: $dx10[17] = "selected"; break;
case 427500: $dx10[18] = "selected"; break;
}
switch($dex110) {
case 0: $dx110[0] = "selected"; break;
case 2500: $dx110[1] = "selected"; break;
case 7500: $dx110[2] = "selected"; break;
case 15000: $dx110[3] = "selected"; break;
case 25000: $dx110[4] = "selected"; break;
case 37500: $dx110[5] = "selected"; break;
case 52500: $dx110[6] = "selected"; break;
case 70000: $dx110[7] = "selected"; break;
case 90000: $dx110[8] = "selected"; break;
case 112500: $dx110[9] = "selected"; break;
case 137500: $dx110[10] = "selected"; break;
case 165000: $dx110[11] = "selected"; break;
case 195000: $dx110[12] = "selected"; break;
case 227500: $dx110[13] = "selected"; break;
case 262500: $dx110[14] = "selected"; break;
case 300000: $dx110[15] = "selected"; break;
case 340000: $dx110[16] = "selected"; break;
case 382500: $dx110[17] = "selected"; break;
case 427500: $dx110[18] = "selected"; break;
}
switch($dex120) {
case 0: $dx120[0] = "selected"; break;
case 2500: $dx120[1] = "selected"; break;
case 7500: $dx120[2] = "selected"; break;
case 15000: $dx120[3] = "selected"; break;
case 25000: $dx120[4] = "selected"; break;
case 37500: $dx120[5] = "selected"; break;
case 52500: $dx120[6] = "selected"; break;
case 70000: $dx120[7] = "selected"; break;
case 90000: $dx120[8] = "selected"; break;
case 112500: $dx120[9] = "selected"; break;
case 137500: $dx120[10] = "selected"; break;
case 165000: $dx120[11] = "selected"; break;
case 195000: $dx120[12] = "selected"; break;
case 227500: $dx120[13] = "selected"; break;
case 262500: $dx120[14] = "selected"; break;
case 300000: $dx120[15] = "selected"; break;
case 340000: $dx120[16] = "selected"; break;
case 382500: $dx120[17] = "selected"; break;
case 427500: $dx120[18] = "selected"; break;
}
switch($dex130) {
case 0: $dx130[0] = "selected"; break;
case 2500: $dx130[1] = "selected"; break;
case 7500: $dx130[2] = "selected"; break;
case 15000: $dx130[3] = "selected"; break;
case 25000: $dx130[4] = "selected"; break;
case 37500: $dx130[5] = "selected"; break;
case 52500: $dx130[6] = "selected"; break;
case 70000: $dx130[7] = "selected"; break;
case 90000: $dx130[8] = "selected"; break;
case 112500: $dx130[9] = "selected"; break;
case 137500: $dx130[10] = "selected"; break;
case 165000: $dx130[11] = "selected"; break;
case 195000: $dx130[12] = "selected"; break;
case 227500: $dx130[13] = "selected"; break;
case 262500: $dx130[14] = "selected"; break;
case 300000: $dx130[15] = "selected"; break;
case 340000: $dx130[16] = "selected"; break;
case 382500: $dx130[17] = "selected"; break;
case 427500: $dx130[18] = "selected"; break;
}
switch($dex140) {
case 0: $dx140[0] = "selected"; break;
case 2500: $dx140[1] = "selected"; break;
case 7500: $dx140[2] = "selected"; break;
case 15000: $dx140[3] = "selected"; break;
case 25000: $dx140[4] = "selected"; break;
case 37500: $dx140[5] = "selected"; break;
case 52500: $dx140[6] = "selected"; break;
case 70000: $dx140[7] = "selected"; break;
case 90000: $dx140[8] = "selected"; break;
case 112500: $dx140[9] = "selected"; break;
case 137500: $dx140[10] = "selected"; break;
case 165000: $dx140[11] = "selected"; break;
case 195000: $dx140[12] = "selected"; break;
case 227500: $dx140[13] = "selected"; break;
case 262500: $dx140[14] = "selected"; break;
case 300000: $dx140[15] = "selected"; break;
case 340000: $dx140[16] = "selected"; break;
case 382500: $dx140[17] = "selected"; break;
case 427500: $dx140[18] = "selected"; break;
}
switch($dex20) {
case 0: $dx20[0] = "selected"; break;
case 2500: $dx20[1] = "selected"; break;
case 7500: $dx20[2] = "selected"; break;
case 15000: $dx20[3] = "selected"; break;
case 25000: $dx20[4] = "selected"; break;
case 37500: $dx20[5] = "selected"; break;
case 52500: $dx20[6] = "selected"; break;
case 70000: $dx20[7] = "selected"; break;
case 90000: $dx20[8] = "selected"; break;
case 112500: $dx20[9] = "selected"; break;
case 137500: $dx20[10] = "selected"; break;
case 165000: $dx20[11] = "selected"; break;
case 195000: $dx20[12] = "selected"; break;
case 227500: $dx20[13] = "selected"; break;
case 262500: $dx20[14] = "selected"; break;
case 300000: $dx20[15] = "selected"; break;
case 340000: $dx20[16] = "selected"; break;
case 382500: $dx20[17] = "selected"; break;
case 427500: $dx20[18] = "selected"; break;
}
switch($dex210) {
case 0: $dx210[0] = "selected"; break;
case 2500: $dx210[1] = "selected"; break;
case 7500: $dx210[2] = "selected"; break;
case 15000: $dx210[3] = "selected"; break;
case 25000: $dx210[4] = "selected"; break;
case 37500: $dx210[5] = "selected"; break;
case 52500: $dx210[6] = "selected"; break;
case 70000: $dx210[7] = "selected"; break;
case 90000: $dx210[8] = "selected"; break;
case 112500: $dx210[9] = "selected"; break;
case 137500: $dx210[10] = "selected"; break;
case 165000: $dx210[11] = "selected"; break;
case 195000: $dx210[12] = "selected"; break;
case 227500: $dx210[13] = "selected"; break;
case 262500: $dx210[14] = "selected"; break;
case 300000: $dx210[15] = "selected"; break;
case 340000: $dx210[16] = "selected"; break;
case 382500: $dx210[17] = "selected"; break;
case 427500: $dx210[18] = "selected"; break;
}
switch($dex220) {
case 0: $dx220[0] = "selected"; break;
case 2500: $dx220[1] = "selected"; break;
case 7500: $dx220[2] = "selected"; break;
case 15000: $dx220[3] = "selected"; break;
case 25000: $dx220[4] = "selected"; break;
case 37500: $dx220[5] = "selected"; break;
case 52500: $dx220[6] = "selected"; break;
case 70000: $dx220[7] = "selected"; break;
case 90000: $dx220[8] = "selected"; break;
case 112500: $dx220[9] = "selected"; break;
case 137500: $dx220[10] = "selected"; break;
case 165000: $dx220[11] = "selected"; break;
case 195000: $dx220[12] = "selected"; break;
case 227500: $dx220[13] = "selected"; break;
case 262500: $dx220[14] = "selected"; break;
case 300000: $dx220[15] = "selected"; break;
case 340000: $dx220[16] = "selected"; break;
case 382500: $dx220[17] = "selected"; break;
case 427500: $dx220[18] = "selected"; break;
}
switch($dex230) {
case 0: $dx230[0] = "selected"; break;
case 2500: $dx230[1] = "selected"; break;
case 7500: $dx230[2] = "selected"; break;
case 15000: $dx230[3] = "selected"; break;
case 25000: $dx230[4] = "selected"; break;
case 37500: $dx230[5] = "selected"; break;
case 52500: $dx230[6] = "selected"; break;
case 70000: $dx230[7] = "selected"; break;
case 90000: $dx230[8] = "selected"; break;
case 112500: $dx230[9] = "selected"; break;
case 137500: $dx230[10] = "selected"; break;
case 165000: $dx230[11] = "selected"; break;
case 195000: $dx230[12] = "selected"; break;
case 227500: $dx230[13] = "selected"; break;
case 262500: $dx230[14] = "selected"; break;
case 300000: $dx230[15] = "selected"; break;
case 340000: $dx230[16] = "selected"; break;
case 382500: $dx230[17] = "selected"; break;
case 427500: $dx230[18] = "selected"; break;
}
switch($dex240) {
case 0: $dx240[0] = "selected"; break;
case 2500: $dx240[1] = "selected"; break;
case 7500: $dx240[2] = "selected"; break;
case 15000: $dx240[3] = "selected"; break;
case 25000: $dx240[4] = "selected"; break;
case 37500: $dx240[5] = "selected"; break;
case 52500: $dx240[6] = "selected"; break;
case 70000: $dx240[7] = "selected"; break;
case 90000: $dx240[8] = "selected"; break;
case 112500: $dx240[9] = "selected"; break;
case 137500: $dx240[10] = "selected"; break;
case 165000: $dx240[11] = "selected"; break;
case 195000: $dx240[12] = "selected"; break;
case 227500: $dx240[13] = "selected"; break;
case 262500: $dx240[14] = "selected"; break;
case 300000: $dx240[15] = "selected"; break;
case 340000: $dx240[16] = "selected"; break;
case 382500: $dx240[17] = "selected"; break;
case 427500: $dx240[18] = "selected"; break;
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>전투시뮬레이션</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<style type="text/css">
<!--
select { background-color:black;color:white; }
input { background-color:black;color:white; }
-->
</style>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<form method=post action=_simul.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr id=bg1>
<td>공격장수</td>
<td>상대장수</td>
<td>상대성벽</td>
</tr>
<tr>
<td>관직
<select name=level1 size=1>
<option <?=$sellevel1[1];?> value=1>일반</option>
<option <?=$sellevel1[5];?> value=5>제3모사</option>
<option <?=$sellevel1[6];?> value=6>제3장군</option>
<option <?=$sellevel1[7];?> value=7>제2모사</option>
<option <?=$sellevel1[8];?> value=8>제2장군</option>
<option <?=$sellevel1[9];?> value=9>제1모사</option>
<option <?=$sellevel1[10];?> value=10>제1장군</option>
<option <?=$sellevel1[11];?> value=11>참모</option>
<option <?=$sellevel1[12];?> value=12>군주</option>
</select>
</td>
<td>관직
<select name=level2 size=1>
<option <?=$sellevel2[1];?> value=1>일반</option>
<option <?=$sellevel2[5];?> value=5>제3모사</option>
<option <?=$sellevel2[6];?> value=6>제3장군</option>
<option <?=$sellevel2[7];?> value=7>제2모사</option>
<option <?=$sellevel2[8];?> value=8>제2장군</option>
<option <?=$sellevel2[9];?> value=9>제1모사</option>
<option <?=$sellevel2[10];?> value=10>제1장군</option>
<option <?=$sellevel2[11];?> value=11>참모</option>
<option <?=$sellevel2[12];?> value=12>군주</option>
</select>
</td>
<td>-</td>
<tr>
<td>Lv <input size=2 maxlength=2 name=explevel1 value=<?=$explevel1;?>></td>
<td>Lv <input size=2 maxlength=2 name=explevel2 value=<?=$explevel2;?>></td>
<td>-</td>
</tr>
<tr>
<td>통솔 <input size=3 maxlength=3 name=leader1 value=<?=$leader1;?>></td>
<td>통솔 <input size=3 maxlength=3 name=leader2 value=<?=$leader2;?>></td>
<td>-</td>
</tr>
<tr>
<td>무력 <input size=3 maxlength=3 name=power1 value=<?=$power1;?>></td>
<td>무력 <input size=3 maxlength=3 name=power2 value=<?=$power2;?>></td>
<td>-</td>
</tr>
<tr>
<td>지력 <input size=3 maxlength=3 name=intel1 value=<?=$intel1;?>></td>
<td>지력 <input size=3 maxlength=3 name=intel2 value=<?=$intel2;?>></td>
<td>-</td>
</tr>
<tr>
<td>병종
<select name=type1 size=1>
<option value=0>--------</option>
<option <?=$sel1[0];?> value=0>보병</option>
<option <?=$sel1[1];?> value=1>청주병</option>
<option <?=$sel1[2];?> value=2>수병</option>
<option <?=$sel1[3];?> value=3>자객병</option>
<option <?=$sel1[4];?> value=4>근위병</option>
<option <?=$sel1[5];?> value=5>등갑병</option>
<option value=0>--------</option>
<option <?=$sel1[10];?> value=10>궁병</option>
<option <?=$sel1[11];?> value=11>궁기병</option>
<option <?=$sel1[12];?> value=12>연노병</option>
<option <?=$sel1[13];?> value=13>강궁병</option>
<option <?=$sel1[14];?> value=14>석궁병</option>
<option value=0>--------</option>
<option <?=$sel1[20];?> value=20>기병</option>
<option <?=$sel1[21];?> value=21>백마병</option>
<option <?=$sel1[22];?> value=22>중장기병</option>
<option <?=$sel1[23];?> value=23>돌격기병</option>
<option <?=$sel1[24];?> value=24>철기병</option>
<option <?=$sel1[25];?> value=25>수렵기병</option>
<option <?=$sel1[26];?> value=26>맹수병</option>
<option <?=$sel1[27];?> value=27>호표기병</option>
<option value=0>--------</option>
<option <?=$sel1[30];?> value=30>귀병</option>
<option <?=$sel1[31];?> value=31>신귀병</option>
<option <?=$sel1[32];?> value=32>백귀병</option>
<option <?=$sel1[33];?> value=33>흑귀병</option>
<option <?=$sel1[34];?> value=34>악귀병</option>
<option <?=$sel1[35];?> value=35>남귀병</option>
<option <?=$sel1[36];?> value=36>황귀병</option>
<option <?=$sel1[37];?> value=37>천귀병</option>
<option <?=$sel1[38];?> value=38>마귀병</option>
<option value=0>--------</option>
<option <?=$sel1[40];?> value=40>정란</option>
<option <?=$sel1[41];?> value=41>충차</option>
<option <?=$sel1[42];?> value=42>벽력거</option>
<option <?=$sel1[43];?> value=43>목우</option>
</select>
</td>
<td>병종
<select name=type2 size=1>
<option value=0>--------</option>
<option <?=$sel2[0];?> value=0>보병</option>
<option <?=$sel2[1];?> value=1>청주병</option>
<option <?=$sel2[2];?> value=2>수병</option>
<option <?=$sel2[3];?> value=3>자객병</option>
<option <?=$sel2[4];?> value=4>근위병</option>
<option <?=$sel2[5];?> value=5>등갑병</option>
<option value=0>--------</option>
<option <?=$sel2[10];?> value=10>궁병</option>
<option <?=$sel2[11];?> value=11>궁기병</option>
<option <?=$sel2[12];?> value=12>연노병</option>
<option <?=$sel2[13];?> value=13>강궁병</option>
<option <?=$sel2[14];?> value=14>석궁병</option>
<option value=0>--------</option>
<option <?=$sel2[20];?> value=20>기병</option>
<option <?=$sel2[21];?> value=21>백마병</option>
<option <?=$sel2[22];?> value=22>중장기병</option>
<option <?=$sel2[23];?> value=23>돌격기병</option>
<option <?=$sel2[24];?> value=24>철기병</option>
<option <?=$sel2[25];?> value=25>수렵기병</option>
<option <?=$sel2[26];?> value=26>맹수병</option>
<option <?=$sel2[27];?> value=27>호표기병</option>
<option value=0>--------</option>
<option <?=$sel2[30];?> value=30>귀병</option>
<option <?=$sel2[31];?> value=31>신귀병</option>
<option <?=$sel2[32];?> value=32>백귀병</option>
<option <?=$sel2[33];?> value=33>흑귀병</option>
<option <?=$sel2[34];?> value=34>악귀병</option>
<option <?=$sel2[35];?> value=35>남귀병</option>
<option <?=$sel2[36];?> value=36>황귀병</option>
<option <?=$sel2[37];?> value=37>천귀병</option>
<option <?=$sel2[38];?> value=38>마귀병</option>
<option value=0>--------</option>
<option <?=$sel2[40];?> value=40>정란</option>
<option <?=$sel2[41];?> value=41>충차</option>
<option <?=$sel2[42];?> value=42>벽력거</option>
<option <?=$sel2[43];?> value=43>목우</option>
</select>
</td>
<td>성벽 <input size=4 maxlength=4 name=wall value=<?=$wall;?>></td>
</tr>
<tr>
<td>병력 <input size=5 maxlength=5 name=crew1 value=<?=$crew1;?>></td>
<td>병력 <input size=5 maxlength=5 name=crew2 value=<?=$crew2;?>></td>
<td>수비 <input size=4 maxlength=4 name=def value=<?=$def;?>></td>
</tr>
<tr>
<td>훈련 <input size=3 maxlength=3 name=train1 value=<?=$train1;?>></td>
<td>훈련 <input size=3 maxlength=3 name=train2 value=<?=$train2;?>></td>
<td>훈련 <input size=3 maxlength=3 name=train3 value=<?=$train3;?>></td>
</tr>
<tr>
<td>사기 <input size=3 maxlength=3 name=atmos1 value=<?=$atmos1;?>></td>
<td>사기 <input size=3 maxlength=3 name=atmos2 value=<?=$atmos2;?>></td>
<td>사기 <input size=3 maxlength=3 name=atmos3 value=<?=$atmos3;?>></td>
</tr>
<tr>
<td>기술
<select name=tech1 size=1>
<option <?=$tch1[0];?> value=0>0등급</option>
<option <?=$tch1[1];?> value=1000>1등급</option>
<option <?=$tch1[2];?> value=2000>2등급</option>
<option <?=$tch1[3];?> value=3000>3등급</option>
<option <?=$tch1[4];?> value=4000>4등급</option>
<option <?=$tch1[5];?> value=5000>5등급</option>
<option <?=$tch1[6];?> value=6000>6등급</option>
<option <?=$tch1[7];?> value=7000>7등급</option>
<option <?=$tch1[8];?> value=8000>8등급</option>
<option <?=$tch1[9];?> value=9000>9등급</option>
<option <?=$tch1[10];?> value=10000>10등급</option>
</select>
</td>
<td>기술
<select name=tech2 size=1>
<option <?=$tch2[0];?> value=0>0등급</option>
<option <?=$tch2[1];?> value=1000>1등급</option>
<option <?=$tch2[2];?> value=2000>2등급</option>
<option <?=$tch2[3];?> value=3000>3등급</option>
<option <?=$tch2[4];?> value=4000>4등급</option>
<option <?=$tch2[5];?> value=5000>5등급</option>
<option <?=$tch2[6];?> value=6000>6등급</option>
<option <?=$tch2[7];?> value=7000>7등급</option>
<option <?=$tch2[8];?> value=8000>8등급</option>
<option <?=$tch2[9];?> value=9000>9등급</option>
<option <?=$tch2[10];?> value=10000>10등급</option>
</select>
</td>
<td>-</td>
</tr>
<tr>
<td>보
<select name=dex10 size=1>
<option <?=$dx10[0];?> value=0>F</option>
<option <?=$dx10[1];?> value=2500>E-</option>
<option <?=$dx10[2];?> value=7500>E</option>
<option <?=$dx10[3];?> value=15000>E+</option>
<option <?=$dx10[4];?> value=25000>D-</option>
<option <?=$dx10[5];?> value=37500>D</option>
<option <?=$dx10[6];?> value=52500>D+</option>
<option <?=$dx10[7];?> value=70000>C-</option>
<option <?=$dx10[8];?> value=90000>C</option>
<option <?=$dx10[9];?> value=112500>C+</option>
<option <?=$dx10[10];?> value=137500>B-</option>
<option <?=$dx10[11];?> value=165000>B</option>
<option <?=$dx10[12];?> value=195000>B+</option>
<option <?=$dx10[13];?> value=227500>A-</option>
<option <?=$dx10[14];?> value=262500>A</option>
<option <?=$dx10[15];?> value=300000>A+</option>
<option <?=$dx10[16];?> value=340000>S</option>
<option <?=$dx10[17];?> value=382500>SS</option>
<option <?=$dx10[18];?> value=427500>SSS</option>
</select>
<select name=dex110 size=1>
<option <?=$dx110[0];?> value=0>F</option>
<option <?=$dx110[1];?> value=2500>E-</option>
<option <?=$dx110[2];?> value=7500>E</option>
<option <?=$dx110[3];?> value=15000>E+</option>
<option <?=$dx110[4];?> value=25000>D-</option>
<option <?=$dx110[5];?> value=37500>D</option>
<option <?=$dx110[6];?> value=52500>D+</option>
<option <?=$dx110[7];?> value=70000>C-</option>
<option <?=$dx110[8];?> value=90000>C</option>
<option <?=$dx110[9];?> value=112500>C+</option>
<option <?=$dx110[10];?> value=137500>B-</option>
<option <?=$dx110[11];?> value=165000>B</option>
<option <?=$dx110[12];?> value=195000>B+</option>
<option <?=$dx110[13];?> value=227500>A-</option>
<option <?=$dx110[14];?> value=262500>A</option>
<option <?=$dx110[15];?> value=300000>A+</option>
<option <?=$dx110[16];?> value=340000>S</option>
<option <?=$dx110[17];?> value=382500>SS</option>
<option <?=$dx110[18];?> value=427500>SSS</option>
</select>
<select name=dex120 size=1>
<option <?=$dx120[0];?> value=0>F</option>
<option <?=$dx120[1];?> value=2500>E-</option>
<option <?=$dx120[2];?> value=7500>E</option>
<option <?=$dx120[3];?> value=15000>E+</option>
<option <?=$dx120[4];?> value=25000>D-</option>
<option <?=$dx120[5];?> value=37500>D</option>
<option <?=$dx120[6];?> value=52500>D+</option>
<option <?=$dx120[7];?> value=70000>C-</option>
<option <?=$dx120[8];?> value=90000>C</option>
<option <?=$dx120[9];?> value=112500>C+</option>
<option <?=$dx120[10];?> value=137500>B-</option>
<option <?=$dx120[11];?> value=165000>B</option>
<option <?=$dx120[12];?> value=195000>B+</option>
<option <?=$dx120[13];?> value=227500>A-</option>
<option <?=$dx120[14];?> value=262500>A</option>
<option <?=$dx120[15];?> value=300000>A+</option>
<option <?=$dx120[16];?> value=340000>S</option>
<option <?=$dx120[17];?> value=382500>SS</option>
<option <?=$dx120[18];?> value=427500>SSS</option>
</select>
<select name=dex130 size=1>
<option <?=$dx130[0];?> value=0>F</option>
<option <?=$dx130[1];?> value=2500>E-</option>
<option <?=$dx130[2];?> value=7500>E</option>
<option <?=$dx130[3];?> value=15000>E+</option>
<option <?=$dx130[4];?> value=25000>D-</option>
<option <?=$dx130[5];?> value=37500>D</option>
<option <?=$dx130[6];?> value=52500>D+</option>
<option <?=$dx130[7];?> value=70000>C-</option>
<option <?=$dx130[8];?> value=90000>C</option>
<option <?=$dx130[9];?> value=112500>C+</option>
<option <?=$dx130[10];?> value=137500>B-</option>
<option <?=$dx130[11];?> value=165000>B</option>
<option <?=$dx130[12];?> value=195000>B+</option>
<option <?=$dx130[13];?> value=227500>A-</option>
<option <?=$dx130[14];?> value=262500>A</option>
<option <?=$dx130[15];?> value=300000>A+</option>
<option <?=$dx130[16];?> value=340000>S</option>
<option <?=$dx130[17];?> value=382500>SS</option>
<option <?=$dx130[18];?> value=427500>SSS</option>
</select>
<select name=dex140 size=1>
<option <?=$dx140[0];?> value=0>F</option>
<option <?=$dx140[1];?> value=2500>E-</option>
<option <?=$dx140[2];?> value=7500>E</option>
<option <?=$dx140[3];?> value=15000>E+</option>
<option <?=$dx140[4];?> value=25000>D-</option>
<option <?=$dx140[5];?> value=37500>D</option>
<option <?=$dx140[6];?> value=52500>D+</option>
<option <?=$dx140[7];?> value=70000>C-</option>
<option <?=$dx140[8];?> value=90000>C</option>
<option <?=$dx140[9];?> value=112500>C+</option>
<option <?=$dx140[10];?> value=137500>B-</option>
<option <?=$dx140[11];?> value=165000>B</option>
<option <?=$dx140[12];?> value=195000>B+</option>
<option <?=$dx140[13];?> value=227500>A-</option>
<option <?=$dx140[14];?> value=262500>A</option>
<option <?=$dx140[15];?> value=300000>A+</option>
<option <?=$dx140[16];?> value=340000>S</option>
<option <?=$dx140[17];?> value=382500>SS</option>
<option <?=$dx140[18];?> value=427500>SSS</option>
</select>
</td>
<td>보
<select name=dex20 size=1>
<option <?=$dx20[0];?> value=0>F</option>
<option <?=$dx20[1];?> value=2500>E-</option>
<option <?=$dx20[2];?> value=7500>E</option>
<option <?=$dx20[3];?> value=15000>E+</option>
<option <?=$dx20[4];?> value=25000>D-</option>
<option <?=$dx20[5];?> value=37500>D</option>
<option <?=$dx20[6];?> value=52500>D+</option>
<option <?=$dx20[7];?> value=70000>C-</option>
<option <?=$dx20[8];?> value=90000>C</option>
<option <?=$dx20[9];?> value=112500>C+</option>
<option <?=$dx20[10];?> value=137500>B-</option>
<option <?=$dx20[11];?> value=165000>B</option>
<option <?=$dx20[12];?> value=195000>B+</option>
<option <?=$dx20[13];?> value=227500>A-</option>
<option <?=$dx20[14];?> value=262500>A</option>
<option <?=$dx20[15];?> value=300000>A+</option>
<option <?=$dx20[16];?> value=340000>S</option>
<option <?=$dx20[17];?> value=382500>SS</option>
<option <?=$dx20[18];?> value=427500>SSS</option>
</select>
<select name=dex210 size=1>
<option <?=$dx210[0];?> value=0>F</option>
<option <?=$dx210[1];?> value=2500>E-</option>
<option <?=$dx210[2];?> value=7500>E</option>
<option <?=$dx210[3];?> value=15000>E+</option>
<option <?=$dx210[4];?> value=25000>D-</option>
<option <?=$dx210[5];?> value=37500>D</option>
<option <?=$dx210[6];?> value=52500>D+</option>
<option <?=$dx210[7];?> value=70000>C-</option>
<option <?=$dx210[8];?> value=90000>C</option>
<option <?=$dx210[9];?> value=112500>C+</option>
<option <?=$dx210[10];?> value=137500>B-</option>
<option <?=$dx210[11];?> value=165000>B</option>
<option <?=$dx210[12];?> value=195000>B+</option>
<option <?=$dx210[13];?> value=227500>A-</option>
<option <?=$dx210[14];?> value=262500>A</option>
<option <?=$dx210[15];?> value=300000>A+</option>
<option <?=$dx210[16];?> value=340000>S</option>
<option <?=$dx210[17];?> value=382500>SS</option>
<option <?=$dx210[18];?> value=427500>SSS</option>
</select>
<select name=dex220 size=1>
<option <?=$dx220[0];?> value=0>F</option>
<option <?=$dx220[1];?> value=2500>E-</option>
<option <?=$dx220[2];?> value=7500>E</option>
<option <?=$dx220[3];?> value=15000>E+</option>
<option <?=$dx220[4];?> value=25000>D-</option>
<option <?=$dx220[5];?> value=37500>D</option>
<option <?=$dx220[6];?> value=52500>D+</option>
<option <?=$dx220[7];?> value=70000>C-</option>
<option <?=$dx220[8];?> value=90000>C</option>
<option <?=$dx220[9];?> value=112500>C+</option>
<option <?=$dx220[10];?> value=137500>B-</option>
<option <?=$dx220[11];?> value=165000>B</option>
<option <?=$dx220[12];?> value=195000>B+</option>
<option <?=$dx220[13];?> value=227500>A-</option>
<option <?=$dx220[14];?> value=262500>A</option>
<option <?=$dx220[15];?> value=300000>A+</option>
<option <?=$dx220[16];?> value=340000>S</option>
<option <?=$dx220[17];?> value=382500>SS</option>
<option <?=$dx220[18];?> value=427500>SSS</option>
</select>
<select name=dex230 size=1>
<option <?=$dx230[0];?> value=0>F</option>
<option <?=$dx230[1];?> value=2500>E-</option>
<option <?=$dx230[2];?> value=7500>E</option>
<option <?=$dx230[3];?> value=15000>E+</option>
<option <?=$dx230[4];?> value=25000>D-</option>
<option <?=$dx230[5];?> value=37500>D</option>
<option <?=$dx230[6];?> value=52500>D+</option>
<option <?=$dx230[7];?> value=70000>C-</option>
<option <?=$dx230[8];?> value=90000>C</option>
<option <?=$dx230[9];?> value=112500>C+</option>
<option <?=$dx230[10];?> value=137500>B-</option>
<option <?=$dx230[11];?> value=165000>B</option>
<option <?=$dx230[12];?> value=195000>B+</option>
<option <?=$dx230[13];?> value=227500>A-</option>
<option <?=$dx230[14];?> value=262500>A</option>
<option <?=$dx230[15];?> value=300000>A+</option>
<option <?=$dx230[16];?> value=340000>S</option>
<option <?=$dx230[17];?> value=382500>SS</option>
<option <?=$dx230[18];?> value=427500>SSS</option>
</select>
<select name=dex240 size=1>
<option <?=$dx240[0];?> value=0>F</option>
<option <?=$dx240[1];?> value=2500>E-</option>
<option <?=$dx240[2];?> value=7500>E</option>
<option <?=$dx240[3];?> value=15000>E+</option>
<option <?=$dx240[4];?> value=25000>D-</option>
<option <?=$dx240[5];?> value=37500>D</option>
<option <?=$dx240[6];?> value=52500>D+</option>
<option <?=$dx240[7];?> value=70000>C-</option>
<option <?=$dx240[8];?> value=90000>C</option>
<option <?=$dx240[9];?> value=112500>C+</option>
<option <?=$dx240[10];?> value=137500>B-</option>
<option <?=$dx240[11];?> value=165000>B</option>
<option <?=$dx240[12];?> value=195000>B+</option>
<option <?=$dx240[13];?> value=227500>A-</option>
<option <?=$dx240[14];?> value=262500>A</option>
<option <?=$dx240[15];?> value=300000>A+</option>
<option <?=$dx240[16];?> value=340000>S</option>
<option <?=$dx240[17];?> value=382500>SS</option>
<option <?=$dx240[18];?> value=427500>SSS</option>
</select>
</td>
<td>-</td>
</tr>
<tr>
<td>-</td>
<td>
<input type=submit name=isgen value=장수공격>
<?='<input type=submit name=isgen value=장수평균>';?>
</td>
<td>
<input type=submit name=isgen value=성벽공격>
<?='<input type=submit name=isgen value=성벽평균>';?>
</td>
</tr>
<tr><td colspan=3>
<?php
if($isgen == "장수공격" || $isgen == "성벽공격") {
echo $msg;
} elseif($isgen == "장수평균" || $isgen == "성벽평균") {
echo $msg2;
}
?>
</td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr id=bg1>
<td align=right></td>
<td align=center>공격</td>
<td align=center>방어</td>
<td align=center>기동</td>
<td align=center>회피</td>
<td align=center>가격</td>
<td align=center>군량</td>
<td width=500 align=center>-</td>
</tr>
<?php
for($i=0; $i <= 5; $i++) {
printSimul($game, $i);
}
echo "
<tr><td height=5 colspan=8 id=bg1></td></tr>";
for($i=10; $i <= 14; $i++) {
printSimul($game, $i);
}
echo "
<tr><td height=5 colspan=8 id=bg1></td></tr>";
for($i=20; $i <= 27; $i++) {
printSimul($game, $i);
}
echo "
<tr><td height=5 colspan=8 id=bg1></td></tr>";
for($i=30; $i <= 38; $i++) {
printSimul($game, $i);
}
echo "
<tr><td height=5 colspan=8 id=bg1></td></tr>";
for($i=40; $i <= 43; $i++) {
printSimul($game, $i);
}
echo "
<tr><td height=5 colspan=8 id=bg1></td></tr>";
?>
</table>
</form>
</body>
<?php PrintElapsedTime(); ?>
</html>
<?php
function printSimul($game, $i) {
$att = $game["att{$i}"];
$def = $game["def{$i}"];
$spd = $game["spd{$i}"];
$avd = $game["avd{$i}"];
$cst = $game["cst{$i}"];
$ric = $game["ric{$i}"];
echo "
<tr>
<td align=right>".getTypename($i)."</td>
<td align=center>$att</td>
<td align=center>$def</td>
<td align=center>$spd</td>
<td align=center>$avd</td>
<td align=center>$cst</td>
<td align=center>$ric</td>
<td align=center>-</td>
</tr>";
}
-279
View File
@@ -1,279 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "명장일람", 2);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명장일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>명 장 일 람<br><?php closeButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form name=form1 action=a_bestGeneral.php method=post>
<tr><td align=center>
<input type=submit name=btn value='유저 보기'>
<input type=submit name=btn value='NPC 보기'>
</td></tr>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<?php
if($btn == "NPC 보기") { $sel = "npc>=2"; }
else { $sel = "npc<2"; }
$query = "select nation,name,color from nation";
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
$nationName[$nation[nation]] = $nation[name];
$nationColor[$nation[nation]] = $nation[color];
}
$type = array(
"명 성",
"계 급",
"계 략 성 공",
"전 투 횟 수",
"승 리",
"승 률",
"사 살",
"살 상 률",
"보 병 숙 련 도",
"궁 병 숙 련 도",
"기 병 숙 련 도",
"귀 병 숙 련 도",
"차 병 숙 련 도",
"전 력 전 승 률",
"통 솔 전 승 률",
"일 기 토 승 률",
"설 전 승 률",
"베 팅 투 자 액",
"베 팅 당 첨",
"베 팅 수 익 금",
"베 팅 수 익 률"
);
for($i=0; $i < 21; $i++) {
switch($i) {
case 0: $query = "select nation,no,name,picture,imgsvr,experience as data from general where $sel order by data desc limit 0,10"; break;
case 1: $query = "select nation,no,name,picture,imgsvr,dedication as data from general where $sel order by data desc limit 0,10"; break;
case 2: $query = "select nation,no,name,picture,imgsvr,firenum as data from general where $sel order by data desc limit 0,10"; break;
case 3: $query = "select nation,no,name,picture,imgsvr,warnum as data from general where $sel order by data desc limit 0,10"; break;
case 4: $query = "select nation,no,name,picture,imgsvr,killnum as data from general where $sel order by data desc limit 0,10"; break;
case 5: $query = "select nation,no,name,picture,imgsvr,killnum/warnum*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
case 6: $query = "select nation,no,name,picture,imgsvr,killcrew as data from general where $sel order by data desc limit 0,10"; break;
case 7: $query = "select nation,no,name,picture,imgsvr,killcrew/deathcrew*10000 as data from general where warnum>=10 and $sel order by data desc limit 0,10"; break;
case 8: $query = "select nation,no,name,picture,imgsvr,dex0 as data from general where $sel order by data desc limit 0,10"; break;
case 9: $query = "select nation,no,name,picture,imgsvr,dex10 as data from general where $sel order by data desc limit 0,10"; break;
case 10: $query = "select nation,no,name,picture,imgsvr,dex20 as data from general where $sel order by data desc limit 0,10"; break;
case 11: $query = "select nation,no,name,picture,imgsvr,dex30 as data from general where $sel order by data desc limit 0,10"; break;
case 12: $query = "select nation,no,name,picture,imgsvr,dex40 as data from general where $sel order by data desc limit 0,10"; break;
case 13: $query = "select nation,no,name,picture,imgsvr,ttw/(ttw+ttd+ttl)*10000 as data from general where $sel and (ttw+ttd+ttl)>=50 order by data desc limit 0,10"; break;
case 14: $query = "select nation,no,name,picture,imgsvr,tlw/(tlw+tld+tll)*10000 as data from general where $sel and (tlw+tld+tll)>=50 order by data desc limit 0,10"; break;
case 15: $query = "select nation,no,name,picture,imgsvr,tpw/(tpw+tpd+tpl)*10000 as data from general where $sel and (tpw+tpd+tpl)>=50 order by data desc limit 0,10"; break;
case 16: $query = "select nation,no,name,picture,imgsvr,tiw/(tiw+tid+til)*10000 as data from general where $sel and (tiw+tid+til)>=50 order by data desc limit 0,10"; break;
case 17: $query = "select nation,no,name,picture,imgsvr,betgold as data from general where $sel order by data desc limit 0,10"; break;
case 18: $query = "select nation,no,name,picture,imgsvr,betwin as data from general where $sel order by data desc limit 0,10"; break;
case 19: $query = "select nation,no,name,picture,imgsvr,betwingold as data from general where $sel order by data desc limit 0,10"; break;
case 20: $query = "select nation,no,name,picture,imgsvr,betwingold/betgold*10000 as data from general where $sel and betgold >= 1000 order by data desc limit 0,10"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
<tr>";
for($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result);
if($i != 2) {
$name[$k] = $gen[name];
$nation[$k] = $nationName[$gen[nation]];
$data[$k] = $gen[data];
$color[$k] = $nationColor[$gen[nation]];
$pic[$k] = $gen[picture];
} else {
$name[$k] = "???";
$nation[$k] = "???";
$data[$k] = $gen[data];
$color[$k] = $_basecolor4;
$gen[imgsvr] = 0;
$pic[$k] = "9999.jpg";
}
if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen[imgsvr]);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
if($i == 5 || $i == 7 || $i == 20) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
if($i >= 13 && $i <= 16) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
echo "<td align=center>{$data[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
}
echo "
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
";
$type = array(
"명 마",
"명 검",
"명 서",
"도 구"
);
$call = array(
"horse",
"weap",
"book",
"item"
);
$func = array(
"getHorseName",
"getWeapName",
"getBookName",
"getItemName"
);
for($i=0; $i < 4; $i++) {
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2>";
for($k=26; $k > 16; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$name[$k] = $gen[name];
$nation[$k] = $nationName[$gen[nation]];
$color[$k] = $nationColor[$gen[nation]];
$pic[$k] = $gen[picture];
if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen[imgsvr]);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
echo "
<tr align=center id=bg2>";
for($k=16; $k > 6; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$name[$k] = $gen[name];
$nation[$k] = $nationName[$gen[nation]];
$color[$k] = $nationColor[$gen[nation]];
$pic[$k] = $gen[picture];
if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen[imgsvr]);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-199
View File
@@ -1,199 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "왕조일람", 2);
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style="font-size:13;word-break:break-all;color:white;background-color:black" id=bg0>
<tr><td>역 대 왕 조<br>
<input type=button value='창 닫기' onclick=window.close()><br>
</td></tr>
</table>
<?php
if($select == 0) {
$query = "select * from emperior order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$empcount = MYDB_num_rows($result);
for($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
echo "
<form action=a_emperior.php method=post>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0>
<tr>
<td bgcolor=skyblue align=center colspan=8>
<font size=5>$emperior[phase]</font>
<input type=submit value='자세히'>
<input type=hidden name=select value='$emperior[no]'>
</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=8>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font>
</td>
</tr>
<tr>
<td id=bg1 align=center width=123>국 력</td>
<td align=center width=123>$emperior[power]</td>
<td id=bg1 align=center width=123>장 수</td>
<td align=center width=123>$emperior[gennum]</td>
<td id=bg1 align=center width=123>속 령</td>
<td align=center width=123>$emperior[citynum]</td>
<td id=bg1 align=center width=123>성 향</td>
<td align=center width=123>$emperior[type]</td>
</tr>
<tr>
<td id=bg1 width=123 align=center>황 제</td>
<td width=123 align=center>$emperior[l12name]</td>
<td id=bg1 width=123 align=center>승 상</td>
<td width=123 align=center>$emperior[l11name]</td>
<td id=bg1 width=123 align=center>위 장 군</td>
<td width=123 align=center>$emperior[l10name]</td>
<td id=bg1 width=123 align=center>사 공</td>
<td width=123 align=center>$emperior[l9name]</td>
</tr>
</table>
</form>";
}
} else {
$query = "select * from emperior where no='$select'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior[l12pic]}
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<font size=5>$emperior[phase]</font>
<input type=submit value='전체보기'>
<input type=hidden name=select value='0'>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[nation_count]</td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[gen_count]</td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5>$emperior[nation_name]</td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5>$emperior[nation_hist]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5>$emperior[personal_hist]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5>$emperior[special_hist]</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=6>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2>$emperior[power]</td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2>$emperior[type]</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2>$emperior[gennum]</td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2>$emperior[citynum]</td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2>$emperior[pop]</td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2>$emperior[poprate]</td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2>$emperior[gold]</td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2>$emperior[rice]</td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l12name]</td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l11name]</td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l10name]</td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l9name]</td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l8name]</td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l7name]</td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l6name]</td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l5name]</td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5>$emperior[tiger]</td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5>$emperior[eagle]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5>$emperior[gen]</td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5>".ConvertLog($emperior[history], 1)."</td>
</tr>
</table>
";
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all;color:white; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-200
View File
@@ -1,200 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "왕조일람", 2);
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>왕조일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>역 대 왕 조<br>
<input type=button value='창 닫기' onclick=window.close()><br>
</td></tr>
</table>
<?php
if($select == 0) {
$query = "select * from emperior_table order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$empcount = MYDB_num_rows($result);
for($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
echo "
<form action=a_emperior2.php method=post>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td bgcolor=skyblue align=center colspan=8>
<font size=5>$emperior[phase]</font>
<input type=submit value='자세히'>
<input type=hidden name=select value='$emperior[no]'>
</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=8>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font>
</td>
</tr>
<tr>
<td id=bg1 align=center width=123>국 력</td>
<td align=center width=123>$emperior[power]</td>
<td id=bg1 align=center width=123>장 수</td>
<td align=center width=123>$emperior[gennum]</td>
<td id=bg1 align=center width=123>속 령</td>
<td align=center width=123>$emperior[citynum]</td>
<td id=bg1 align=center width=123>성 향</td>
<td align=center width=123>$emperior[type]</td>
</tr>
<tr>
<td id=bg1 width=123 align=center>황 제</td>
<td width=123 align=center>$emperior[l12name]</td>
<td id=bg1 width=123 align=center>승 상</td>
<td width=123 align=center>$emperior[l11name]</td>
<td id=bg1 width=123 align=center>위 장 군</td>
<td width=123 align=center>$emperior[l10name]</td>
<td id=bg1 width=123 align=center>사 공</td>
<td width=123 align=center>$emperior[l9name]</td>
</tr>
</table>
</form>";
}
} else {
$query = "select * from emperior_table where no='$select'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior[l12pic]}
echo "
<form action=a_emperior2.php method=post>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<font size=5>$emperior[phase]</font>
<input type=submit value='전체보기'>
<input type=hidden name=select value='0'>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[nation_count]</td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[gen_count]</td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5>$emperior[nation_name]</td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5>$emperior[nation_hist]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5>$emperior[personal_hist]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5>$emperior[special_hist]</td>
</tr>
<tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=6>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2>$emperior[power]</td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2>$emperior[type]</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2>$emperior[gennum]</td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2>$emperior[citynum]</td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2>$emperior[pop]</td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2>$emperior[poprate]</td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2>$emperior[gold]</td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2>$emperior[rice]</td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l12name]</td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l11name]</td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l10name]</td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l9name]</td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l8name]</td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l7name]</td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l6name]</td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332>$emperior[l5name]</td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5>$emperior[tiger]</td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5>$emperior[eagle]</td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5>$emperior[gen]</td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5>".ConvertLog($emperior[history], 1)."</td>
</tr>
</table>
</form>";
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-182
View File
@@ -1,182 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "장수일람", 2);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($type == 0) {
$type = 9;
}
$sel[$type] = "selected";
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>장수일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>장 수 일 람<br><?php closeButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1];?> value=1>국가</option>
<option <?=$sel[2];?> value=2>통솔</option>
<option <?=$sel[3];?> value=3>무력</option>
<option <?=$sel[4];?> value=4>지력</option>
<option <?=$sel[5];?> value=5>명성</option>
<option <?=$sel[6];?> value=6>계급</option>
<option <?=$sel[7];?> value=7>관직</option>
<option <?=$sel[8];?> value=8>삭턴</option>
<option <?=$sel[9];?> value=9>벌점</option>
<option <?=$sel[10];?> value=10>Lv</option>
<option <?=$sel[11];?> value=11>성격</option>
<option <?=$sel[12];?> value=12>내특</option>
<option <?=$sel[13];?> value=13>전특</option>
<option <?=$sel[14];?> value=14>연령</option>
<option <?=$sel[15];?> value=15>NPC</option>
<option <?=$sel[16];?> value=16>특별</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<?php
$query = "select nation,name,level from nation";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$nationname[0] = "-";
for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result);
$nationname[$nation[nation]] = $nation[name];
$nationlevel[$nation[nation]] = $nation[level];
}
switch($type) {
case 1: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
case 2: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
case 3: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
case 4: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
case 5: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
case 6: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
case 7: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
case 8: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
case 9: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
case 10: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
case 11: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
case 12: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
case 13: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
case 14: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
case 15: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
case 16: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by userlevel desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=64 align=center id=bg1>얼 굴</td>
<td width=100 align=center id=bg1>이 름</td>
<td width=50 align=center id=bg1>연령</td>
<td width=50 align=center id=bg1>성격</td>
<td width=90 align=center id=bg1>특기</td>
<td width=50 align=center id=bg1>레 벨</td>
<td width=100 align=center id=bg1>국 가</td>
<td width=60 align=center id=bg1>명 성</td>
<td width=60 align=center id=bg1>계 급</td>
<td width=80 align=center id=bg1>관 직</td>
<td width=45 align=center id=bg1>통솔</td>
<td width=45 align=center id=bg1>무력</td>
<td width=45 align=center id=bg1>지력</td>
<td width=45 align=center id=bg1>삭턴</td>
<td width=84 align=center id=bg1>벌점</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nation = $nationname[$general[nation]];
if($general[level] == 12) {
$lbonus = $nationlevel[$general[nation]] * 2;
} elseif($general[level] >= 5) {
$lbonus = $nationlevel[$general[nation]];
} else {
$lbonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
}
if($general[injury] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100);
$power = floor($general[power] * (100 - $general[injury])/100);
$intel = floor($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]}";
}
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; }
else { $name = "$general[name]"; }
$general[connect] = round($general[connect] / 10, 0) * 10;
$imageTemp = GetImageURL($general[imgsvr]);
echo "
<tr>
<td align=center><img src={$imageTemp}/{$general[picture]}></img></td>
<td align=center>$name</td>
<td align=center>$general[age]세</td>
<td align=center>".getGenChar($general[personal])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td>
<td align=center>Lv ".getExpLevel($general[experience])."</td>
<td align=center>{$nation}</td>
<td align=center>".getHonor($general[experience])."</td>
<td align=center>".getDed($general[dedication])."</td>
<td align=center>"; echo getLevel($general[level]); echo "</td>
<td align=center>$leader</td>
<td align=center>$power</td>
<td align=center>$intel</td>
<td align=center>$general[killturn]</td>
<td align=center>$general[connect]"; echo "<br>【".getConnect($general[connect])."】</td>
</tr>";
}
echo "
</table>
";
MYDB_close($connect);
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-103
View File
@@ -1,103 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "명예의전당", 2);
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>명예의 전당</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13;word-break:break-all; id=bg0>
<tr><td>명 예 의 전 당<br><?php closeButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<?php
$type = array(
"명 성",
"계 급",
"계 략 성 공",
"전 투 횟 수",
"승 리",
"승 률",
"사 살",
"살 상 률",
"보 병 숙 련 도",
"궁 병 숙 련 도",
"기 병 숙 련 도",
"귀 병 숙 련 도",
"차 병 숙 련 도",
"전 력 전 승 률",
"통 솔 전 승 률",
"일 기 토 승 률",
"설 전 승 률",
"베 팅 투 자 액",
"베 팅 당 첨",
"베 팅 수 익 금",
"베 팅 수 익 률"
);
for($i=0; $i < 21; $i++) {
$query = "select * from hall where type={$i} order by rank";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
<tr>";
for($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result);
$name[$k] = $gen[name];
$nation[$k] = $gen[nation];
$data[$k] = $gen[data];
$color[$k] = $gen[color];
$pic[$k] = $gen[picture];
if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
/*
if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen[imgsvr]);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
*/
}
// echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
if($i == 5 || $i == 7 || $i == 20) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
if($i >= 13 && $i <= 16) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
echo "<td align=center>{$data[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=Font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-137
View File
@@ -1,137 +0,0 @@
<?php
$yearmonth = $_POST['yearmonth'];
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "연감", 5);
$query = "select startyear,year,month,conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
$query = "select year,month from history order by no limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$history = MYDB_fetch_array($result);
$s = ($history[year]*12) + $history[month];
$query = "select year,month from history order by no desc limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$history = MYDB_fetch_array($result);
$e = ($history[year]*12) + $history[month];
if(!$yearmonth) {
$year = $admin['year'];
$month = $admin['month'] - 1;
} else {
$year = substr($yearmonth, 0, 3) - 0;
$month = substr($yearmonth, 3, 2) - 0;
if($btn == "◀◀ 이전달") {
$month -= 1;
} elseif($btn == "다음달 ▶▶") {
$month += 1;
}
}
$now = ($year*12) + $month;
if($now < $s) { $now = $s; }
if($now > $e) { $now = $e; }
$year = floor($now / 12);
$month = $now % 12;
if($month <= 0) {
$year -= 1;
$month += 12;
}
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>연감</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>연 감<br><?php closeButton(); ?></td></tr>
<tr><td>
<form name=form1 method=post>
년월 선택 :
<input type=submit name=btn value="◀◀ 이전달">
<select name=yearmonth size=1>
<?php
$query = "select year,month from history";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$histCount = MYDB_num_rows($result);
for($i=0; $i < $histCount; $i++) {
$history = MYDB_fetch_array($result);
$value = "".$history['year']._String::Fill2($history['month'], 2, "0");
if($history['year'] == $year && $history['month'] == $month) {
echo "
<option selected value={$value}>{$history['year']}년 {$history['month']}월</option>";
} else {
echo "
<option value={$value}>{$history['year']}년 {$history['month']}월</option>";
}
}
$query = "select log,genlog,nation,power,gen,city from history where year='$year' and month='$month'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$history = MYDB_fetch_array($result);
?>
</select>
<input type=submit name=btn value='조회하기'>
<input type=submit name=btn value="다음달 ▶▶">
</form>
</td></tr>
</table>
<table align=center width=1000 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
<tr height=520>
<td width=698>
<iframe src='map_history.php?year=<?=$year;?>&month=<?=$month;?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe>
</td>
<td width=98 valign=top><?=$history['nation'];?></td>
<td width=78 valign=top><?=$history['power'];?></td>
<td width=58 valign=top><?=$history['gen'];?></td>
<td width=58 valign=top><?=$history['city'];?></td>
</tr>
<tr><td colspan=5 align=center id=bg1>중 원 정 세</td></tr>
<tr>
<td colspan=5 valign=top>
<?=$history['log']?>
</td>
</tr>
<tr><td colspan=5 align=center id=bg1>장 수 동 향</td></tr>
<tr>
<td colspan=5 valign=top>
<?=$history['genlog']?>
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-246
View File
@@ -1,246 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "세력일람", 2);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>세 력 일 람<br><?php closeButton(); ?></td></tr>
</table>
<?php
$query = "select nation,name,color,level,type,power,gennum,capital from nation order by power desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); //국가정보
$query = "select city,name from city where nation='$nation[nation]'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
$query = "select npc,name,city from general where nation='$nation[nation]' and level='12'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level12 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='11'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level11 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='10'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level10 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='9'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level9 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='8'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level8 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='7'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level7 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='6'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level6 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='5'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level5 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
if($level12[name] == "") { $l12 = "-"; }
elseif($level12[npc] >= 2) { $l12 = "<font color=cyan>$level12[name]</font>"; }
elseif($level12[npc] == 1) { $l12 = "<font color=skyblue>$level12[name]</font>"; }
else { $l12 = $level12[name]; }
if($level11[name] == "") { $l11 = "-"; }
elseif($level11[npc] >= 2) { $l11 = "<font color=cyan>$level11[name]</font>"; }
elseif($level11[npc] == 1) { $l11 = "<font color=skyblue>$level11[name]</font>"; }
else { $l11 = $level11[name]; }
if($level10[name] == "") { $l10 = "-"; }
elseif($level10[npc] >= 2) { $l10 = "<font color=cyan>$level10[name]</font>"; }
elseif($level10[npc] == 1) { $l10 = "<font color=skyblue>$level10[name]</font>"; }
else { $l10 = $level10[name]; }
if($level9[name] == "") { $l9 = "-"; }
elseif($level9[npc] >= 2) { $l9 = "<font color=cyan>$level9[name]</font>"; }
elseif($level9[npc] == 1) { $l9 = "<font color=skyblue>$level9[name]</font>"; }
else { $l9 = $level9[name]; }
if($level8[name] == "") { $l8 = "-"; }
elseif($level8[npc] >= 2) { $l8 = "<font color=cyan>$level8[name]</font>"; }
elseif($level8[npc] == 1) { $l8 = "<font color=skyblue>$level8[name]</font>"; }
else { $l8 = $level8[name]; }
if($level7[name] == "") { $l7 = "-"; }
elseif($level7[npc] >= 2) { $l7 = "<font color=cyan>$level7[name]</font>"; }
elseif($level7[npc] == 1) { $l7 = "<font color=skyblue>$level7[name]</font>"; }
else { $l7 = $level7[name]; }
if($level6[name] == "") { $l6 = "-"; }
elseif($level6[npc] >= 2) { $l6 = "<font color=cyan>$level6[name]</font>"; }
elseif($level6[npc] == 1) { $l6 = "<font color=skyblue>$level6[name]</font>"; }
else { $l6 = $level6[name]; }
if($level5[name] == "") { $l5 = "-"; }
elseif($level5[npc] >= 2) { $l5 = "<font color=cyan>$level5[name]</font>"; }
elseif($level5[npc] == 1) { $l5 = "<font color=skyblue>$level5[name]</font>"; }
else { $l5 = $level5[name]; }
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr>
<td colspan=8 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 {$nation[name]} 】</td>
</tr>
<tr>
<td width=123 align=center id=bg1>성 향</td>
<td width=123 align=center><font color=yellow>".getNationType($nation[type])."</font></td>
<td width=123 align=center id=bg1>작 위</td>
<td width=123 align=center>".getNationLevel($nation[level])."</td>
<td width=123 align=center id=bg1>국 력</td>
<td width=123 align=center>{$nation[power]}</td>
<td width=123 align=center id=bg1>장수 / 속령</td>
<td width=123 align=center>{$gencount} / {$citycount}</td>
</tr>
<tr>
<td align=center id=bg1>".getLevel(12, $nation[level])."</td>
<td align=center>$l12</td>
<td align=center id=bg1>".getLevel(11, $nation[level])."</td>
<td align=center>$l11</td>
<td align=center id=bg1>".getLevel(10, $nation[level])."</td>
<td align=center>$l10</td>
<td align=center id=bg1>".getLevel( 9, $nation[level])."</td>
<td align=center>$l9</td>
</tr>
<tr>
<td align=center id=bg1>".getLevel( 8, $nation[level])."</td>
<td align=center>$l8</td>
<td align=center id=bg1>".getLevel( 7, $nation[level])."</td>
<td align=center>$l7</td>
<td align=center id=bg1>".getLevel( 6, $nation[level])."</td>
<td align=center>$l6</td>
<td align=center id=bg1>".getLevel( 5, $nation[level])."</td>
<td align=center>$l5</td>
</tr>
<tr>
<td colspan=8>";
if($nation[level] > 0) {
echo "속령 일람 : ";
for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) {
echo "<font color=cyan>[{$city[name]}]</font>, ";
} else {
echo "$city[name], ";
}
}
} else {
$query = "select name from city where city='$level12[city]'"; // 군주 위치 도시 이름
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityResult);
echo "현재 위치 : <font color=yellow>$city[name]</font>";
}
echo"
</td>
</tr>
<tr>
<td colspan=8> 장수 일람 : ";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>$general[name]</font>, "; }
elseif($general[npc] == 1) { echo "<font color=skyblue>$general[name]</font>, "; }
else { echo "$general[name], "; }
}
echo"
</td>
</tr>
</table>
<br>";
}
//재야
$query = "select npc,name from general where nation='0'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
$query = "select name from city where nation='0'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr>
<td colspan=5 align=center>【 재 야 】</td>
</tr>
<tr>
<td width=498 align=center>&nbsp;</td>
<td width=123 align=center id=bg1>장 수</td>
<td width=123 align=center>{$gencount}</td>
<td width=123 align=center id=bg1>속 령</td>
<td width=123 align=center>{$citycount}</td>
</tr>
<tr>
<td colspan=5> 속령 일람 : ";
for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult);
echo "$city[name], ";
}
echo"
</td>
</tr>
<tr>
<td colspan=5> 장수 일람 : ";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>$general[name]</font>, "; }
elseif($general[npc] == 1) { echo "<font color=skyblue>$general[name]</font>, "; }
else { echo "$general[name], "; }
}
echo"
</td>
</tr>
</table>";
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-117
View File
@@ -1,117 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "빙의일람", 2);
if($type == 0) {
$type = 1;
}
$sel[$type] = "selected";
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>빙의일람</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>빙 의 일 람<br><?php closeButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1];?> value=1>이름</option>
<option <?=$sel[2];?> value=2>국가</option>
<option <?=$sel[3];?> value=3>종능</option>
<option <?=$sel[4];?> value=4>통솔</option>
<option <?=$sel[5];?> value=5>무력</option>
<option <?=$sel[6];?> value=6>지력</option>
<option <?=$sel[7];?> value=7>명성</option>
<option <?=$sel[8];?> value=8>계급</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<?php
$query = "select nation,name from nation";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$nationname[0] = "-";
for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result);
$nationname[$nation[nation]] = $nation[name];
}
switch($type) {
case 1: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by binary(name)"; break;
case 2: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by nation"; break;
case 3: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by sum desc"; break;
case 4: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by leader"; break;
case 5: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by power"; break;
case 6: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by intel"; break;
case 7: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by experience"; break;
case 8: $query = "select npc,nation,name,name2,special,special2,personal,leader,power,intel,leader+power+intel as sum,explevel,experience,dedication from general where npc=1 order by dedication"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=102 align=center id=bg1>희생된 장수</td>
<td width=102 align=center id=bg1>악령 이름</td>
<td width=68 align=center id=bg1>레벨</td>
<td width=118 align=center id=bg1>국가</td>
<td width=68 align=center id=bg1>성격</td>
<td width=88 align=center id=bg1>특기</td>
<td width=68 align=center id=bg1>종능</td>
<td width=68 align=center id=bg1>통솔</td>
<td width=68 align=center id=bg1>무력</td>
<td width=68 align=center id=bg1>지력</td>
<td width=78 align=center id=bg1>명성</td>
<td width=78 align=center id=bg1>계급</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$nation = $nationname[$general[nation]];
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; }
else { $name = "$general[name]"; }
echo "
<tr>
<td align=center>{$name}</td>
<td align=center>{$general[name2]}</td>
<td align=center>Lv {$general[explevel]}</td>
<td align=center>{$nation}</td>
<td align=center>".getGenChar($general[personal])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td>
<td align=center>$general[sum]</td>
<td align=center>$general[leader]</td>
<td align=center>$general[power]</td>
<td align=center>$general[intel]</td>
<td align=center>{$general[experience]}</td>
<td align=center>{$general[dedication]}</td>
</tr>";
}
echo "
</table>
";
MYDB_close($connect);
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-58
View File
@@ -1,58 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "세력도", 2);
checkTurn($connect);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력도</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1200 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>세 력 도<br><?php closeButton(); ?></td></tr>
</table>
<table align=center width=1200 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr height=520>
<td width=498 valign=top>
<?php AllLog(34, $me[skin]); ?>
</td>
<td width=698>
<iframe src='map.php?type=2&graphic=<?=$me[map];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe>
</td>
</tr>
<tr>
<td colspan=2 valign=top>
<?php History(34, $me[skin]); ?>
</td>
</tr>
</table>
<table align=center width=1200 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-257
View File
@@ -1,257 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "갱신정보", 2);
$query = "select year,month,refresh,maxrefresh,maxonline from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$game = MYDB_fetch_array($result);
$fp = @fopen("logs/_traffic.txt", "r");
@fseek($fp, -1000, SEEK_END);
$file = @fread($fp, 1000);
@fclose($fp);
$log = explode("\r\n",$file);
$str = "";
for($i=0; $i < $count; $i++) { $str .= ConvertLog($log[count($log)-2-$i], $skin)."<br>"; }
echo $str;
$curonline = onlinenum($connect);
for($i=0; $i < 11; $i++) {
$parse = explode("|", $log[count($log)-12+$i]);
$date[$i] = trim($parse[0]);
$year[$i] = trim($parse[1]);
$month[$i] = trim($parse[2]);
$refresh[$i] = trim($parse[3]);
$online[$i] = trim($parse[4]);
}
if($game[maxrefresh] == 0) { $game[maxrefresh] = 1; }
if($game[maxrefresh] < $game[refresh]) { $game[maxrefresh] = $game[refresh]; }
if($game[maxonline] == 0) { $game[maxonline] = 1; }
if($game[maxonline] < $curonline) { $game[maxonline] = $curonline; }
?>
<html>
<head>
<title>트래픽정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>트 래 픽 정 보<br><?php closeButton(); ?></td></tr>
</table>
<br>
<table align=center width=1016 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all;>
<tr><td align=left>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
<?php
for($i=0; $i < 11; $i++) {
$w = round($refresh[$i] / $game[maxrefresh] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($refresh[$i] < 10 && $w < 3) { $w = 3; }
elseif($refresh[$i] < 100 && $w < 6) { $w = 6; }
elseif($refresh[$i] < 1000 && $w < 9) { $w = 9; }
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = substr($date[$i], 11, 5);
echo "
<tr height=30>
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$refresh[$i]}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
";
}
$w = round($game[refresh] / $game[maxrefresh] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($game[refresh] < 10 && $w < 3) { $w = 3; }
elseif($game[refresh] < 100 && $w < 6) { $w = 6; }
elseif($game[refresh] < 1000 && $w < 9) { $w = 9; }
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = date('H:i');
echo "
<tr height=30>
<td width=100 align=center>{$game[year]}년 {$game[month]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$game[refresh]}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
<tr>
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game[maxrefresh]}</td>
</tr>
";
?>
</table>
</td>
<td align=right>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
<?php
for($i=0; $i < 11; $i++) {
$w = round($online[$i] / $game[maxonline] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($online[$i] < 10 && $w < 3) { $w = 3; }
elseif($online[$i] < 100 && $w < 6) { $w = 6; }
elseif($online[$i] < 1000 && $w < 9) { $w = 9; }
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = substr($date[$i], 11, 5);
echo "
<tr height=30>
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$online[$i]}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
";
}
$w = round($curonline / $game[maxonline] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($curonline < 10 && $w < 3) { $w = 3; }
elseif($curonline < 100 && $w < 6) { $w = 6; }
elseif($curonline < 1000 && $w < 9) { $w = 9; }
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = date('H:i');
echo "
<tr height=30>
<td width=100 align=center>{$game[year]}년 {$game[month]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$curonline}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
<tr>
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game[maxonline]}</td>
</tr>
";
?>
</table>
</td></tr>
</table>
<br>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=3 align=center id=bg2><font size=5>주 의 대 상 자 (순간과도갱신)</font></td></tr>
<?php
$query = "select sum(refresh) as refresh,sum(connect) as connect from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$user = MYDB_fetch_array($result);
$user[connect] = round($user[connect], 1);
$maxrefresh = $user[refresh];
$w = round($maxrefresh / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1);
$color = getColor($w);
echo "
<tr id=bg2>
<td width=98 align=center>주의대상자</td>
<td width=98 align=center>벌점(순간갱신)</td>
<td width=798 align=center>전체 대비</td>
</tr>
<tr>
<td align=center>접속자 총합</td>
<td align=center>{$user[connect]}({$maxrefresh})</td>
<td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color}>&nbsp;</td>
<td width={$w2}%>&nbsp;</td>
</tr>
</table>
</td>
</tr>
";
$query = "select name,refresh,connect from general order by refresh desc limit 0,5";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$user = MYDB_fetch_array($result);
$w = round($user[refresh] / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1);
$color = getColor($w);
echo "
<tr>
<td width=98 align=center>{$user[name]}</td>
<td width=98 align=center>{$user[connect]}({$user[refresh]})</td>
<td width=798 align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color}>&nbsp;</td>
<td width={$w2}%>&nbsp;</td>
</tr>
</table>
</td>
</tr>
";
}
?>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
<?php
function getColor($per) {
$r = getHex($per);
$b = getHex(100 - $per);
$color = $r . "00" . $b;
return $color;
}
function getHex($dec) {
$hex = floor($dec * 255 / 100);
$code = getHexCode(floor($hex / 16));
$code .= getHexCode($hex % 16);
return $code;
}
function getHexCode($hex) {
switch($hex) {
case 0: return "0"; case 1: return "1"; case 2: return "2"; case 3: return "3";
case 4: return "4"; case 5: return "5"; case 6: return "6"; case 7: return "7";
case 8: return "8"; case 9: return "9"; case 10: return "A"; case 11: return "B";
case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";
}
}
-338
View File
@@ -1,338 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "설문조사", 1);
$query = "select no,userlevel,vote from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select develcost,voteopen,vote,votecomment from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$vote = explode("|", $admin[vote]);
if($vote[0] == "") {
$vote[0] = "-";
}
?>
<html>
<head>
<title>설문조사</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<script type="text/javascript">
function captureKey(e) {
if(e.keyCode == 13 && e.srcElement.type == 'text') {
form1.btn.value = '댓글';
form1.btn.click();
return false;
}
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>설 문 조 사<br><?php closeButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form name=form1 action=c_vote.php method=post>
<tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin[develcost]*5;?>금과 추첨으로 유니크템 증정!)</font></td></tr>
<?php
if($me[userlevel] >= 5) {
echo "
<tr>
<td width=48 align=center><input type=submit name=btn value='알림'></td>
<td width=98 align=center><input type=submit name=btn value='수정'></td>
<td width=848 align=left><input type=text name=title style=width:848;></td>
</tr>
";
}
$vote[0] = Tag2Code($vote[0]);
echo "
<tr>
<td colspan=2 width=148 align=center id=bg1>제 목</td>
<td width=848 align=left>&nbsp;{$vote[0]}</td>
</tr>
";
$query = "select no from general where vote>0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$voteCount = MYDB_num_rows($result);
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$allCount = MYDB_num_rows($result);
$percentage = round($voteCount / $allCount * 100, 1);
$voteTypeCount = count($vote);
for($i=1; $i < $voteTypeCount; $i++) {
echo "
<tr>
<td width=48 align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$i}.</td>
<td width=98 align=center>
";
if($me[vote] == 0 && $me[no] > 0) {
echo "
<input type=radio name=sel value={$i}>
";
} elseif($admin[voteopen] >= 1 || $me[userlevel] >= 5) {
$query = "select no from general where vote='{$i}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$vCount = MYDB_num_rows($result);
$per = @round($vCount / $voteCount * 100, 1);
echo "{$vCount} 표 ({$per}%)";
} else {
echo "추후공개";
}
$vote[i] = Tag2Code($vote[i]);
echo "
</td>
<td align=left>&nbsp;{$vote[$i]}</td>
</tr>
";
}
echo "
<tr>
";
if($me[vote] == 0 && $me[no] > 0) {
echo "
<td align=center>투표</td>
<td align=center><input type=submit name=btn value='투표'></td>
";
} else {
echo "
<td colspan=2 align=center>결산</td>
";
}
echo "
<td align=left>&nbsp;투표율 : {$voteCount} / {$allCount} ({$percentage} %)</td>
</tr>
";
if($me[userlevel] >= 5) {
echo "
<tr>
<td align=center><input type=submit name=btn value='리셋'></td>
<td align=center><input type=submit name=btn value='추가'></td>
<td align=left><input type=text name=str style=width:848;></td>
</tr>
";
}
if($admin[votecomment] != "") {
$comment = explode("|", $admin[votecomment]);
$commentCount = count($comment);
} else {
$commentCount = 0;
}
echo "
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td colspan=4 align=center id=bg1>댓 글</td>
</tr>
";
for($i=0; $i < $commentCount; $i++) {
$cmt = explode(":", $comment[$i]);
$cmt[2] = Tag2Code($cmt[2]);
$j = $i+1;
echo "
<tr>
<td width=28 align=center>{$j}.</td>
<td width=83 align=center>{$cmt[0]}</td>
<td width=83 align=center>{$cmt[1]}</td>
<td width=788 align=left>&nbsp;{$cmt[2]}</td>
</tr>
";
}
if($me[no] > 0) {
echo "
<tr>
<td width=108 colspan=2 align=center>-</td>
<td width=83 align=center><input type=submit name=btn value='댓글'></td>
<td align=left><input type=text name=comment maxlength=60 style=width:798; onkeydown='return captureKey(event)'></td>
</tr>
";
}
?>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=3 align=center id=bg2><font size=5>
전 체 통 계
<?php
if($me[userlevel] >= 5) {
echo "
<input type=submit name=btn value='숨김'>
<input type=submit name=btn value='전체통계만'>
<input type=submit name=btn value='전부'>";
}
echo "
</font></td></tr>";
if($admin[voteopen] >= 1 || $me[userlevel] >= 5) {
echo "
<tr>
<td width=98 align=center>전 체</td>
<td width=128 align=center>{$voteCount} / {$allCount} ({$percentage} %)</td>
<td width=768 align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
";
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
$query = "select nation,vote from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$vote = MYDB_fetch_array($result);
$totalVote[$vote[vote]]++;
if($vote[vote] > 0) { $nationVoteCount[$vote[nation]]++; }
$nationVote[$vote[nation]][$vote[vote]]++;
}
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($totalVote[$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$totalVote[$i]}</td>
";
}
echo "
</tr>
</table>
</td>
</tr>
";
}
if($admin[voteopen] >= 2 || $me[userlevel] >= 5) {
$query = "select no from general where nation=0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
if(!$nationVoteCount[0]) { $nationVoteCount[0] = 0; }
$percentage = @round($nationVoteCount[0] / $memCount * 100, 1);
echo "
<tr>
<td align=center bgcolor=black>재 야</td>
<td align=center>{$nationVoteCount[0]} / {$memCount} ({$percentage} %)</td>
<td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
";
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($nationVote[0][$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$nationVote[0][$i]}</td>
";
}
echo "
</tr>
</table>
</td>
</tr>
";
$query = "select nation,color,name,gennum from nation order by gennum desc";
$nationResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($nationResult);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationResult);
$query = "select no from general where nation='{$nation[nation]}' and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
if(!$nationVoteCount[$nation[nation]]) { $nationVoteCount[$nation[nation]] = 0; }
$percentage = @round($nationVoteCount[$nation[nation]] / $memCount * 100, 1);
echo "
<tr>
<td align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>{$nation[name]}</td>
<td align=center>{$nationVoteCount[$nation[nation]]} / {$memCount} ({$percentage} %)</td>
<td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
";
for($k=0; $k < $voteTypeCount; $k++) {
$per = @round($nationVote[$nation[nation]][$k] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getColor($k).">{$nationVote[$nation[nation]][$k]}</td>
";
}
echo "
</tr>
</table>
</td>
</tr>
";
}
}
?>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
<?php
function getColor($type) {
if($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
case 0: $color = "black"; break;
case 1: $color = "red"; break;
case 2: $color = "orange"; break;
case 3: $color = "yellow"; break;
case 4: $color = "green"; break;
case 5: $color = "blue"; break;
case 6: $color = "navy"; break;
case 7: $color = "purple"; break;
}
return $color;
}
function getNewColor($type) {
if($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
case 2: $color = "black"; break;
case 3: $color = "black"; break;
default:$color = "white"; break;
}
return $color;
}
-14
View File
@@ -1,14 +0,0 @@
<!--<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
-->
-260
View File
@@ -1,260 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "거래장", 2);
$query = "select no,special,skin,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
$query = "select no from auction where no1='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tradeCount = MYDB_num_rows($result);
$query = "select no from auction where no2='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount;
if($me[userlevel] >= 5 || ($me[special] != 30 && $btCount < 1) || ($me[special] == 30 && $btCount < 3)) {
$btn = "submit";
} else {
$btn = "hidden";
}
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
if($msg == "") $msg = "-";
if($msg2 == "") $msg2 = "-";
?>
<html>
<head>
<title>거래장</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>거 래 장<br><?php closeButton(); ?></td></tr>
<tr><td align=center id=bg2><font color=orange size=6><b>거 래 장</b></font><input type=button value='갱신' onclick=location.replace('b_auction.php')></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form method=post action=c_auction.php>
<tr><td colspan=11 align=center bgcolor=orange><font size=5>팝 니 다</font></td></tr>
<tr align=center id=bg1>
<td width=68>거래번호</td>
<td width=48>선택</td>
<td width=98>판매자</td>
<td width=118>물품</td>
<td width=88>수량</td>
<td width=88>시작판매가</td>
<td width=88>현재판매가</td>
<td width=88>즉시판매가</td>
<td width=48>단가</td>
<td width=98>구매 예정자</td>
<td width=148>거래종료</td>
</tr>
<?php
$query = "select * from auction where type=0 order by expire";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$chk = 0;
for($i=0; $i < $count; $i++) {
$auction = MYDB_fetch_array($result);
$itemname = GetStuffName($auction[stuff]);
$radio = ""; $alert = ""; $alert2 = "";
if($auction[no1] == $me[no]) { $radio = " disabled"; }
elseif($auction[no2] > 0 && $auction[amount] * 2 <= $auction[value] && $auction[stuff] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($auction[no2] > 0 && $auction[topv] <= $auction[value]) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($chk == 0) { $radio = " checked"; $chk = 1; }
$pv = round($auction[value] * 100 / $auction[amount]) / 100 + 0.001;
$pv = substr($pv, 0, 4);
if($auction[stuff] != 0) { $pv = '-'; }
echo "
<tr align=center>
<td>{$auction[no]}</td>
<td><input type=radio name=sel value={$auction[no]}{$radio}></td>
<td>{$auction[name1]}</td>
<td>{$itemname}</td>
<td>{$auction[amount]}</td>
<td>금 {$auction[cost]}</td>
<td>{$alert}금 {$auction[value]}{$alert2}</td>
<td>{$alert}금 {$auction[topv]}{$alert2}</td>
<td>{$alert}{$pv}{$alert2}</td>
<td>{$alert}{$auction[name2]}{$alert2}</td>
<td>{$auction[expire]}</td>
</tr>
";
}
?>
<tr height=25>
<td align=center id=bg1>등록결과</td>
<td colspan=10><?=ConvertLog($msg);?></td>
</tr>
<tr>
<td align=center id=bg1>입찰등록</td>
<td colspan=10>
 지불할 금액: <input type=text style=color:white;background-color:black; size=6 maxlength=6 name=value>
<input type=<?=$btn;?> name=btn value='구매시도' onclick='return confirm("정말 입찰하시겠습니까?");'>
</td>
</tr>
<tr>
<td align=center id=bg1>거래등록</td>
<td colspan=10>
 종료: <input type=text style=color:white;background-color:black; size=2 maxlength=2 name=term value=12>턴 후
 물품: <select size=1 name=stuff style=color:white;background-color:black;>
<option style=color:white; value=0>쌀</option>
</select>
 판매량: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=amount value=1000>
 시작가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=cost value=500>
 즉구가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=topv value=2000>
<input type=<?=$btn;?> name=btn value='판매' onclick='return confirm("정말 판매하시겠습니까?");'>
</td>
</tr>
<tr>
<td colspan=11>
ㆍ<font color=cyan>Hint</font>) 거래자가 판매(물품 판매, 금 수령), 입찰자가 구매(물품 구입, 금 지불).<br>
ㆍ<font color=cyan>Hint</font>) 단가가 1.00보다 높을수록 판매자 유리.<br>
ㆍ<font color=cyan>Hint</font>) 단가가 1.00보다 낮을수록 입찰자 유리.<br>
</td>
</tr>
</form>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form method=post action=c_auction.php>
<tr><td colspan=11 align=center bgcolor=skyblue><font size=5>삽 니 다</font></td></tr>
<tr align=center id=bg1>
<td width=68>거래번호</td>
<td width=48>선택</td>
<td width=98>구매자</td>
<td width=118>물품</td>
<td width=88>수량</td>
<td width=88>시작구매가</td>
<td width=88>현재구매가</td>
<td width=88>즉시구매가</td>
<td width=48>단가</td>
<td width=98>판매 예정자</td>
<td width=148>거래종료</td>
</tr>
<?php
$query = "select * from auction where type=1 order by expire";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$chk = 0;
for($i=0; $i < $count; $i++) {
$auction = MYDB_fetch_array($result);
$itemname = GetStuffName($auction[stuff]);
$radio = ""; $alert = ""; $alert2 = "";
if($auction[no1] == $me[no]) { $radio = " disabled"; }
elseif($auction[no2] > 0 && $auction[amount] >= $auction[value] * 2 && $auction[stuff] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($auction[no2] > 0 && $auction[topv] >= $auction[value]) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($chk == 0) { $radio = " checked"; $chk = 1; }
$pv = round($auction[value] * 100 / $auction[amount]) / 100 + 0.001;
$pv = substr($pv, 0, 4);
if($auction[stuff] != 0) { $pv = '-'; }
echo "
<tr align=center>
<td>{$auction[no]}</td>
<td><input type=radio name=sel value={$auction[no]}{$radio}></td>
<td>{$auction[name1]}</td>
<td>{$itemname}</td>
<td>{$auction[amount]}</td>
<td>금 {$auction[cost]}</td>
<td>{$alert}금 {$auction[value]}{$alert2}</td>
<td>{$alert}금 {$auction[topv]}{$alert2}</td>
<td>{$alert}{$pv}{$alert2}</td>
<td>{$alert}{$auction[name2]}{$alert2}</td>
<td>{$auction[expire]}</td>
</tr>
";
}
?>
<tr height=25>
<td align=center id=bg1>등록결과</td>
<td colspan=10><?=ConvertLog($msg2);?></td>
</tr>
<tr>
<td align=center id=bg1>입찰등록</td>
<td colspan=10>
 수령할 금액: <input type=text style=color:white;background-color:black; size=6 maxlength=6 name=value>
<input type=<?=$btn;?> name=btn value='판매시도' onclick='return confirm("정말 입찰하시겠습니까?");'>
</td>
</tr>
<tr>
<td align=center id=bg1>거래등록</td>
<td colspan=10>
 종료: <input type=text style=color:white;background-color:black; size=2 maxlength=2 name=term value=12>턴 후
 물품: <select size=1 name=stuff style=color:white;background-color:black;>
<option style=color:white; value=0>쌀</option>
</select>
 구입량: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=amount value=1000>
 시작가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=cost value=2000>
 즉구가: <input type=text style=color:white;background-color:black; size=5 maxlength=5 name=topv value=500>
<input type=<?=$btn;?> name=btn value='구매' onclick='return confirm("정말 구매하시겠습니까?");'>
</td>
</tr>
<tr>
<td colspan=11>
ㆍ<font color=cyan>Hint</font>) 거래자가 구매(물품 구매, 금 지불), 입찰자가 판매(물품 판매, 금 수령).<br>
ㆍ<font color=cyan>Hint</font>) 단가가 1.00보다 낮을수록 구매자 유리.<br>
ㆍ<font color=cyan>Hint</font>) 단가가 1.00보다 높을수록 입찰자 유리.<br>
</td>
</tr>
</form>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td align=center id=bg2><font size=5>최 근 기 록</font></td></tr>
<tr><td>
<?=AuctionLog(20, $me[skin]);?>
</td></tr>
<tr><td align=center id=bg2><font size=5>도 움 말</font></td></tr>
<tr><td>
<font color=white size=2>
ㆍ판매거래는 거래자가 판매할 물품을 거래하면, 구입을 희망하는 사람이 현재가보다 높게 입찰하여 구입하는 방식입니다.<br>
ㆍ<font color=cyan>Hint</font>) 쌀이 귀한 경우는 입찰자가 많아서 자연스레 단가가 오르게 됩니다. (해당 물품을 사려는 가격이 오름)<br>
ㆍ<font color=cyan>Hint</font>) 쌀이 흔한 경우는 초기 가격을 낮게 책정해야 판매가 가능할 겁니다.<br>
ㆍ구매거래는 거래자가 구입할 물품을 거래하면, 판매를 희망하는 사람이 현재가보다 낮게 입찰하여 판매하는 방식입니다.<br>
ㆍ<font color=cyan>Hint</font>) 쌀이 흔한 경우는 입찰자가 많아서 자연스레 단가가 내리게 됩니다. (해당 물품을 팔려는 가격이 내림)<br>
ㆍ<font color=cyan>Hint</font>) 쌀이 귀한 경우는 초기 가격을 높게 책정해야 구입이 가능할 겁니다.<br>
ㆍ마감임박때 입찰하는 경우 입찰후 1턴 후로 종료시간이 연장됩니다.<br>
ㆍ즉시구매가로 입찰하는 경우 입찰후 1턴 후로 종료시간이 결정됩니다.<br>
ㆍ악용 방지를 위해 50% ~ 200%의 가격에서 거래시작이 가능합니다.<br>
ㆍ악용 방지를 위해 즉시판매가는 110% 이상, 즉시구매가는 90% 이하의 시세로 가능합니다.<br>
ㆍ악용 방지를 위해 즉시판매가는 시작판매가의 110% 이상, 즉시구매가는 시작구매가의 90% 이하로 가능합니다.<br>
ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다. 거상 특기 소유자는 1인당 도합 3건입니다.<br>
ㆍ기본금쌀 1000은 거래에 사용되지 못합니다.<br>
ㆍ유찰될 때는 거래 과실자에게 거래금의 1%가 벌금으로 부과됩니다.<br>
ㆍ<font color=magenta>10단위로 거래가 가능합니다. 1자리는 반올림 처리 됩니다.</font><br>
ㆍ<font color=red>★ 최고가 거래 ★</font> 혹은 <font color=red>★ 최저가 거래 ★</font> 는 암거래 및 악용의 가능성이니 감시 부탁드립니다.<br>
ㆍ거래와 입찰은 취소가 불가능하니 주의하세요!<br>
ㆍ<font color=cyan>Hint</font>) 단가는 금/쌀로 쌀1을 거래하기 위한 금의 양입니다.<br>
ㆍ<font color=cyan>Hint</font>) 단가가 높으면(>1.00) 쌀이 비싸므로 판매가 이득입니다.<br>
ㆍ<font color=cyan>Hint</font>) 단가가 낮으면(<1.00) 금이 비싸므로 구매가 이득입니다.<br>
ㆍ즐거운 거래!
</font>
</td></tr>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-142
View File
@@ -1,142 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "감찰부", 2);
//전투 추진을 위해 갱신
checkTurn($connect);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
//재야인 경우
$meLevel = $me[level];
if($meLevel == 0 || ($meLevel == 1 && $me[belong] < $nation[secretlimit])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
}
//잘못된 접근
if($general[nation] != $me[nation]) {
$gen = 0;
}
if($btn == '정렬하기') {
$gen = 0;
}
if($type == 0) {
$type = 0;
}
$sel[$type] = "selected";
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<title>감찰부</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>감 찰 부<br><?php closeButton(); ?></td></tr>
<tr><td>
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0];?> value=0>최근턴</option>
<option <?=$sel[1];?> value=1>최근전투</option>
<option <?=$sel[2];?> value=2>장수명</option>
<option <?=$sel[3];?> value=3>전투수</option>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
<select name=gen size=1>
<?php
switch($type) {
case 0: $query = "select no,name from general where nation='{$me[nation]}' order by turntime desc"; break;
case 1: $query = "select no,name from general where nation='{$me[nation]}' order by recwar desc"; break;
case 2: $query = "select no,name from general where nation='{$me[nation]}' order by npc,binary(name)"; break;
case 3: $query = "select no,name from general where nation='{$me[nation]}' order by warnum desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수
if($gen == 0) {
$gen = $general[no];
}
if($gen == $general[no]) {
echo "
<option selected value={$general[no]}>{$general[name]}</option>";
} else {
echo "
<option value={$general[no]}>{$general[name]}</option>";
}
}
?>
</select>
<input type=submit name=btn value='조회하기'>
</form>
</td></tr>
</table>
<table width=1000 align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=50% align=center id=bg1><font color=skyblue size=3>장 수 정 보</font></td>
<td width=50% align=center id=bg1><font color=orange size=3>장 수 열 전</font></td>
</tr>
<tr>
<td valign=top>
<?php generalInfo($connect, $gen, $me[skin]); generalInfo2($connect, $gen, $me[skin]); ?>
</td>
<td valign=top>
<?php MyHistory($connect, $gen, $me[skin]); ?>
</td>
</tr>
<tr>
<td align=center id=bg1><font color=orange size=3>전투 기록</font></td>
<td align=center id=bg1><font color=orange size=3>전투 결과</font></td>
</tr>
<tr>
<td valign=top>
<?php MyBatLog($gen, 24, $me[skin]); ?>
</td>
<td valign=top>
<?php MyBatRes($gen, 24, $me[skin]); ?>
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-339
View File
@@ -1,339 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "베팅장", 1);
checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select conlimit,tournament,phase,tnmt_type,develcost,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
switch($admin[tnmt_type]) {
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break;
}
$str1 = getTournament($admin[tournament]);
$str2 = getTournamentTime($connect);
$str3 = getTournamentTerm($connect);
?>
<html>
<?php if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); } ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>베팅장</title>
<style>
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=$images;?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images;?>/back_green.jpg); }
#bg2 { background-image:url(<?=$images;?>/back_blue.jpg); }
</style>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>베 팅 장<br><?php closeButton(); ?></td></tr>
</table>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type;?> (<?=$str1.", ".$str2.", ".$str3;?>)</font></td></tr>
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin[bet];?> / 내 투자 금액 : <?=$me[bet];?>)</font></td></tr>
</table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<tr align=center><td height=10 colspan=16></td></tr>
<tr align=center>
<?php
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
echo "<td colspan=16>{$general[name]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 1; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━━━━━━━━━━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━━━━━━━━━━━━━━━┓"."</font>";
echo "<td colspan=16>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 2; $i++) {
echo "<td colspan=8>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=40 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 2; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━┓"."</font>";
echo "<td colspan=8>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 4; $i++) {
echo "<td colspan=4>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=30 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 4; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━┓"."</font>";
echo "<td colspan=4>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 8; $i++) {
echo "<td colspan=2>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=20 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 8; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━┓"."</font>";
echo "<td colspan=2>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "<td width=70>{$gen[$i]}</td>";
}
$query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
for($i=0; $i < 16; $i++) {
$myBet[$i] = $me["bet{$i}"];
}
for($i=0; $i < 16; $i++) {
$bet[$i] = @round($admin[bet] / $admin["bet{$i}"], 2);
if($bet[$i] == 0) { $bet[$i] = "∞"; }
}
for($i=0; $i < 16; $i++) {
$gold[$i] = round($myBet[$i] * $bet[$i]);
}
?>
</tr>
</table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr align=center><td height=10 colspan=16></td></tr>
<?php
echo "
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "<td width=70><font color=skyblue>{$bet[$i]}</font></td>";
}
?>
</tr>
<tr align=center>
<td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td>
<td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td>
</tr>
<tr align=center>
<?php
for($i=0; $i < 16; $i++) {
echo "<td><font color=orange>{$myBet[$i]}</font></td>";
}
?>
</tr>
<tr align=center>
<td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td>
<td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td><td>∥</td>
</tr>
<tr align=center>
<?php
for($i=0; $i < 16; $i++) {
echo "<td><font color=cyan>{$gold[$i]}</font></td>";
}
echo "
</tr>
<tr align=center><td height=10 colspan=16></td></tr>";
if($admin[tournament] == 6) {
echo "
<form method=post action=c_betting.php>
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "
<td>
<select size=1 name=gold{$i} style=color:white;background-color:black;>
<option style=color:white; value=10>금10</option>
<option style=color:white; value=20>금20</option>
<option style=color:white; value=50>금50</option>
<option style=color:white; value=100>금100</option>
<option style=color:white; value=200>금200</option>
<option style=color:white; value=500>금500</option>
<option style=color:white; value=1000>최대</option>
</select>
</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "
<td><input type=submit name=btn{$i} value=베팅! style=width:100%;color:white;background-color:black;></td>";
}
echo "
</tr>
</form>";
}
?>
<tr align=center>
<td height=30 colspan=16>
<font color=skyblue size=4>배당률</font> × <font color=orange size=4>베팅금</font> = <font color=cyan size=4>적중시 환수금</font><br>
<font color=skyblue size=4>( 베팅후 500원 이하일땐 베팅이 불가능합니다. )</font>
</td>
</tr>
<tr align=center><td height=10 colspan=16></td></tr>
</table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr align=center><td height=50 colspan=4 id=bg2><font color=yellow size=6>토너먼트 랭킹</font></td></tr>
<tr align=center><td colspan=4 id=bg2><font color=skyblue size=3>순위 / 장수명 / 능력치 / 경기수 / 승리 / 무승부 / 패배 / 집계점수 / 우승횟수</font></td></tr>
<tr align=center>
<?php
$type1 = Array("전 력 전", "통 솔 전", "일 기 토", "설 전");
$type2 = Array("종합", "통솔", "무력", "지력");
$type3 = Array("tt", "tl", "tp", "ti");
$type4 = Array("total", "leader", "power", "intel");
for($i=0; $i < 4; $i++) {
$grp = $i;
echo "
<td>
<table align=center width=280 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=9 align=center style=color:white;background-color:black;><font size=4>{$type1[$i]}</font></td></tr>
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$type2[$i]}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>勝</td></tr>";
$query = "select npc,name,leader,power,intel,leader+power+intel as total,{$type3[$i]}p as prize,{$type3[$i]}w+{$type3[$i]}d+{$type3[$i]}l as game,{$type3[$i]}w as win,{$type3[$i]}d as draw,{$type3[$i]}l as lose,{$type3[$i]}g as gl from general order by gl desc, game desc, win desc, draw desc, lose, no limit 0,30";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 30; $k++) {
$general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$type4[$i]], $general[game], $general[win], $general[draw], $general[lose], $general[gl], $general[prize], 0);
}
echo "
</table>
</td>";
}
?>
</tr>
<tr>
<td colspan=16>
ㆍ토너먼트의 16강 대진표가 완성되면, 베팅 기간이 주어집니다.<br>
ㆍ유저들의 베팅 상황에 따라 배당률이 실시간 결정되며, 자신의 베팅금에 따른 예상 환급금을 알 수 있습니다.<br>
ㆍ베팅은 16슬롯에 각각 베팅 가능하며, 도합 최대 금 1000씩 베팅 가능합니다.<br>
ㆍ소지금 500원 이하일땐 베팅이 불가능합니다.
ㆍ삼모와 더불어 토너먼트, 베팅기능으로 즐거운 삼모 되세요!<br>
</td>
</tr>
</table>
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-71
View File
@@ -1,71 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "기밀실", 1);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] < 5) {
echo "수뇌부가 아닙니다.";
exit();
}
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<title>기밀실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>기 밀 실<br><?php backButton(); ?></td></tr>
<form name=form1 method=post action=c_chiefboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998;height:200;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
</form>
</table>
<br>
<?php
$nation = getNation($connect, $me[nation]);
//20개 메세지
$index = $nation[coreindex];
for($i=0; $i < 20; $i++) {
$who = "coreboard{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($nation["coreboard{$index}"] != '') { msgprint($connect, $nation["coreboard{$index}"], $general[name], $general[picture], $general[imgsvr], $nation["coreboard{$index}_when"], $index, 1); }
$index--;
if($index < 0) { $index = 19; }
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-175
View File
@@ -1,175 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "사령부", 1);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
}
if($me[level] >= 5) { $btn = "submit"; $btn2 = "button"; }
else { $btn = "hidden"; $btn2 = "hidden"; }
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
$date = date('Y-m-d H:i:s');
// 명령 목록
$query = "select year,month,turnterm from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "
select nation,level,
l12turn0,l12turn1,l12turn2,l12turn3,l12turn4,l12turn5,l12turn6,l12turn7,l12turn8,l12turn9,l12turn10,l12turn11,
l11turn0,l11turn1,l11turn2,l11turn3,l11turn4,l11turn5,l11turn6,l11turn7,l11turn8,l11turn9,l11turn10,l11turn11,
l10turn0,l10turn1,l10turn2,l10turn3,l10turn4,l10turn5,l10turn6,l10turn7,l10turn8,l10turn9,l10turn10,l10turn11,
l9turn0, l9turn1, l9turn2, l9turn3, l9turn4, l9turn5, l9turn6, l9turn7, l9turn8, l9turn9, l9turn10, l9turn11,
l8turn0, l8turn1, l8turn2, l8turn3, l8turn4, l8turn5, l8turn6, l8turn7, l8turn8, l8turn9, l8turn10, l8turn11,
l7turn0, l7turn1, l7turn2, l7turn3, l7turn4, l7turn5, l7turn6, l7turn7, l7turn8, l7turn9, l7turn10, l7turn11,
l6turn0, l6turn1, l6turn2, l6turn3, l6turn4, l6turn5, l6turn6, l6turn7, l6turn8, l6turn9, l6turn10, l6turn11,
l5turn0, l5turn1, l5turn2, l5turn3, l5turn4, l5turn5, l5turn6, l5turn7, l5turn8, l5turn9, l5turn10, l5turn11
from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$lv = getNationChiefLevel($nation[level]);
for($i=12; $i >= $lv; $i--) {
$turn[$i] = getCoreTurn($connect, $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);
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>사령부</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<script type="text/javascript">
function turn(type) {
if(type == 0) location.replace('turn_push_core.php');
else if(type == 1) location.replace('turn_pop_core.php');
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>사 령 부<input type=button value='갱신' onclick=location.replace('b_chiefcenter.php')><br><?php backButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=10 align=center bgcolor=skyblue>수뇌부 일정</td></tr>
<tr><td colspan=10 align=center>
<?php
$year = $admin[year];
$month = $admin[month];
$date = substr(date('Y-m-d H:i:s'), 14);
for($i=12; $i >= $lv; $i--) {
$totaldate[$i] = $gen[$i][turntime];
$turntime[$i] = substr($gen[$i][turntime], 14);
}
for($k=0; $k < 2; $k++) {
$l4 = 12 - $k; $l3 = 10 - $k; $l2 = 8 - $k; $l1 = 6 - $k;
if ($gen[$l4][npc] >= 2) { $gen[$l4][name] = "<font color=cyan>".$gen[$l4][name]."</font>"; }
elseif($gen[$l4][npc] == 1) { $gen[$l4][name] = "<font color=skyblue>".$gen[$l4][name]."</font>"; }
if ($gen[$l3][npc] >= 2) { $gen[$l3][name] = "<font color=cyan>".$gen[$l3][name]."</font>"; }
elseif($gen[$l3][npc] == 1) { $gen[$l3][name] = "<font color=skyblue>".$gen[$l3][name]."</font>"; }
if ($gen[$l2][npc] >= 2) { $gen[$l2][name] = "<font color=cyan>".$gen[$l2][name]."</font>"; }
elseif($gen[$l2][npc] == 1) { $gen[$l2][name] = "<font color=skyblue>".$gen[$l2][name]."</font>"; }
if ($gen[$l1][npc] >= 2) { $gen[$l1][name] = "<font color=cyan>".$gen[$l1][name]."</font>"; }
elseif($gen[$l1][npc] == 1) { $gen[$l1][name] = "<font color=skyblue>".$gen[$l1][name]."</font>"; }
echo "
<tr>
<td align=center id=bg1>.</td>
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation[level])." : {$gen[$l4][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation[level])." : {$gen[$l3][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation[level])." : {$gen[$l2][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation[level])." : {$gen[$l1][name]}</b></td>
<td align=center id=bg1>.</td>
</tr>
";
for($i=0; $i < 12; $i++) {
$turndate[$l4] = substr($totaldate[$l4], 11, 5);
$turndate[$l3] = substr($totaldate[$l3], 11, 5);
$turndate[$l2] = substr($totaldate[$l2], 11, 5);
$turndate[$l1] = substr($totaldate[$l1], 11, 5);
$j = $i + 1;
$td4 = ($turndate[$l4] == "") ? "-" : $turndate[$l4];
$td3 = ($turndate[$l3] == "") ? "-" : $turndate[$l3];
$td2 = ($turndate[$l2] == "") ? "-" : $turndate[$l2];
$td1 = ($turndate[$l1] == "") ? "-" : $turndate[$l1];
$tn4 = ($turn[$l4][$i] == "") ? "-" : $turn[$l4][$i];
$tn3 = ($turn[$l3][$i] == "") ? "-" : $turn[$l3][$i];
$tn2 = ($turn[$l2][$i] == "") ? "-" : $turn[$l2][$i];
$tn1 = ($turn[$l1][$i] == "") ? "-" : $turn[$l1][$i];
echo "
<tr>
<td width=28 align=center id=bg0><b>$j</b></td>
<td width=58 align=center bgcolor=black><b>$td4</b></td>
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn4</td>
<td width=58 align=center bgcolor=black><b>$td3</b></td>
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn3</td>
<td width=58 align=center bgcolor=black><b>$td2</b></td>
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn2</td>
<td width=58 align=center bgcolor=black><b>$td1</b></td>
<td width=173 align=center height=24 style=table-layout:fixed; id=bg2>$tn1</td>
<td width=28 align=center id=bg0><b>$j</b></td>
</tr>
";
if($totaldate[$l4] != "") { $totaldate[$l4] = addTurn($totaldate[$l4], $admin[turnterm]); }
if($totaldate[$l3] != "") { $totaldate[$l3] = addTurn($totaldate[$l3], $admin[turnterm]); }
if($totaldate[$l2] != "") { $totaldate[$l2] = addTurn($totaldate[$l2], $admin[turnterm]); }
if($totaldate[$l1] != "") { $totaldate[$l1] = addTurn($totaldate[$l1], $admin[turnterm]); }
}
if($k == 0) {
echo "<form action=processing.php method=post><tr><td colspan=5 align=right>";
CoreTurnTable();
echo "</td><td colspan=5>
<input type={$btn2} style=background-color:$_basecolor2;color:white;width:58;font-size:13; value='미루기▼' onclick='turn(0)'>
<input type={$btn2} style=background-color:$_basecolor2;color:white;width:58;font-size:13; value='▲당기기' onclick='turn(1)'>
<br>";
CoreCommandTable($connect);
echo "<input type={$btn} style=background-color:$_basecolor2;color:white;width:55;font-size:13; value='실 행'></td></tr></form>";
}
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-352
View File
@@ -1,352 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "현재도시", 1);
$query = "select skin,no,nation,userlevel,level,city from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$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);
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<title>도시정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>도 시 정 보<br><?php backButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=998>
<form name=cityselect method=post>도시선택 :
<select name=citylist size=1 style=color:white;background-color:black;width:798;>
<?php
if($_POST[citylist] == '') { $_POST[citylist] = $me[city]; }
// 재야일때는 현재 도시만
$valid = 0;
if($me[level] == 0) {
$query = "select city,name,nation from city where city='$me[city]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
echo "
<option value=$city[city]";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】";
if($city[nation] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국==";
else echo "타국==";
echo "============================================</option>";
} else {
// 아국 도시들 선택
$query = "select city,name,nation from city where nation='$me[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value=$city[city]";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】";
if($city[nation] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국==";
else echo "타국==";
echo "============================================</option>";
}
// 아국 장수가 있는 타국 도시들 선택
$query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me[nation]' and B.nation!='$me[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value=$city[city]";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】";
if($city[nation] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국==";
else echo "타국==";
echo "============================================</option>";
}
}
if($myNation[level] > 0) {
// 첩보도시도 목록에 추가
$where = 'city=0';
$citys = explode("|", $myNation[spy]);
for($i=0; $i < count($citys); $i++) {
$city = floor($citys[$i]/10);
$where .= " or city='{$city}'";
}
$query = "select city,name,nation from city where {$where}";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value=$city[city]";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】";
if($city[nation] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국==";
else echo "타국==";
echo "============================================</option>";
}
}
echo "
</select>
<input type=submit value='도 시 선 택'>
<p align=center>명령 화면에서 도시를 클릭하셔도 됩니다.</p>
</form>
</td>
</tr>
</table>
<br>";
// 첩보된 도시까지만 허용
if($valid == 0 && $me[userlevel] < 5) {
$_POST[citylist] = $me[city];
}
$query = "select * from city where city='$_POST[citylist]'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
$query = "select nation,name,color from nation where nation='$city[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$query = "select name from general where no='$city[gen1]'"; // 태수 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($genresult);
$query = "select name from general where no='$city[gen2]'"; // 군사 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($genresult);
$query = "select name from general where no='$city[gen3]'"; // 시중 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult);
if($city[trade] == 0) {
$city[trade] = "- ";
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
</table>
<?php
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr>
<td colspan=12 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 ".getRegion($city[region])." | ".getCityLevel($city[level])." 】 $city[name]</td>
</tr>
<tr>
<td align=center width=48 id=bg1>주민</td>
<td align=center width=112>$city[pop]/$city[pop2]</td>
<td align=center width=48 id=bg1>농업</td>
<td align=center width=108>$city[agri]/$city[agri2]</td>
<td align=center width=48 id=bg1>상업</td>
<td align=center width=108>$city[comm]/$city[comm2]</td>
<td align=center width=48 id=bg1>치안</td>
<td align=center width=108>$city[secu]/$city[secu2]</td>
<td align=center width=48 id=bg1>수비</td>
<td align=center width=108>$city[def]/$city[def2]</td>
<td align=center width=48 id=bg1>성벽</td>
<td align=center width=108>$city[wall]/$city[wall2]</td>
</tr>
<tr>
<td align=center id=bg1>민심</td>
<td align=center>$city[rate]</td>
<td align=center id=bg1>시세</td>
<td align=center>{$city[trade]}%</td>
<td align=center id=bg1>인구</td>
<td align=center>".round($city[pop]/$city[pop2]*100, 2)." %</td>
<td align=center id=bg1>태수</td>
<td align=center>";echo $gen1[name]==''?"-":"$gen1[name]";echo "</td>
<td align=center id=bg1>군사</td>
<td align=center>";echo $gen2[name]==''?"-":"$gen2[name]";echo "</td>
<td align=center id=bg1>시중</td>
<td align=center>";echo $gen3[name]==''?"-":"$gen3[name]";echo "</td>
</tr>
<tr>
<td align=center id=bg1>장수</td>
<td colspan=11>";
$query = "select name from general where city='$city[city]' and nation='$city[nation]'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
if($gencount == 0) echo "-";
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($genresult);
echo "$general[name], ";
}
echo "
</td>
</tr>
</table>";
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4 from general where city='$city[city]' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
$query = "select nation,level,name from nation"; // 국가 이름 목록
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
$nationname[$nation[nation]] = $nation[name];
$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:13;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);
if($general[level] == 12) {
$lbonus = $nationlevel[$general[nation]] * 2;
} elseif($general[level] >= 5) {
$lbonus = $nationlevel[$general[nation]];
} else {
$lbonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
}
if($general[injury] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100);
$power = floor($general[power] * (100 - $general[injury])/100);
$intel = floor($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]}";
}
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"; echo $me[skin]==2?" background={$imageTemp}/{$general[picture]}":""; echo " 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]) || $me[userlevel] >= 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>".getTypename($general[crewtype])."</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($connect, $general, 1);
for($i=0; $i < 5; $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>";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-298
View File
@@ -1,298 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "내무부", 1);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
}
if($me[level] >= 5) { $btn = "submit"; $read = ""; }
else { $btn = "hidden"; $read = "readonly"; }
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내무부</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>내 무 부<br><?php backButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<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>
</tr>
<?php
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select nation,name,color,power,gennum from nation order by power desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result);
// 아국표시
if($nation[nation] == $me[nation]) {
//속령수
$query = "select city from city where nation='$nation[nation]'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result2);
echo "
<tr>
<td align=center style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td>
<td align=center>$nation[power]</td>
<td align=center>$nation[gennum]</td>
<td align=center>$citycount</td>
<td align=center>-</td>
<td align=center>-</td>
<td align=center>-</td>
<td align=left style=font-size:7px;>-</td>
</tr>";
continue;
}
$query = "select state,term,fixed,reserved,showing from diplomacy where me='$me[nation]' and you='$nation[nation]'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result2);
$query = "select reserved,showing from diplomacy where you='$me[nation]' and me='$nation[nation]'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result2);
//속령수
$query = "select city from city where nation='$nation[nation]'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result2);
switch($dip[state]) {
case 0: $state = "<font color=red>교 전</font>"; break;
case 1: $state = "<font color=magenta>선포중</font>"; break;
case 2: $state = "통 상"; break;
case 3: $state = "<font color=cyan>통합수락중</font>"; break;
case 4: $state = "<font color=cyan>통합제의중</font>"; break;
case 5: $state = "<font color=cyan>합병수락중</font>"; break;
case 6: $state = "<font color=cyan>합병제의중</font>"; break;
case 7: $state = "<font color=green>불가침</font>"; break;
}
$term = $admin[year] * 12 + $admin[month] + $dip[term];
$year = floor($term / 12);
$month = $term % 12;
if($month == 0) {
$month = 12;
$year--;
}
$date = date('Y-m-d H:i:s');
$note = "";
if($dip[fixed] != "") {
if($dip[state] == 7) {
$note .= $dip[fixed];
} else {
$note .= "<font color=gray>{$dip[fixed]}</font>";
}
if($dip[reserved] != "" || $dip2[reserved] != "") {
$note .= "<br>";
}
}
if($dip[showing] >= $date) {
if($dip[reserved] != "") {
$note .= "<font color=skyblue>아국측 제의</font>: ".$dip[reserved];
if($dip2[reserved] != "") {
$note .= "<br>";
}
}
}
if($dip2[showing] >= $date) {
if($dip2[reserved] != "") {
$note .= "<font color=limegreen>상대측 제의</font>: ".$dip2[reserved];
}
}
if($note == "") { $note = "&nbsp;"; }
echo "
<tr>
<td align=center style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td>
<td align=center>$nation[power]</td>
<td align=center>$nation[gennum]</td>
<td align=center>$citycount</td>
<td align=center>$state</td>";
if($dip[term] != 0) {
echo"
<td align=center>$dip[term] 개월</td>
<td align=center>{$year}年 {$month}月</td>";
} else {
echo"
<td align=center>-</td>
<td align=center>-</td>";
}
echo "
<td align=left style=font-size:7px;>{$note}</td>
</tr>";
}
echo "
</table>
";
$query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,myset,scoutmsg,secretlimit from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$query = "select gold_rate,rice_rate from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
// 금 수지
$deadIncome = getDeadIncome($connect, $nation[nation], $nation[type], $admin[gold_rate]);
$goldincomeList = getGoldIncome($connect, $nation[nation], $nation[rate], $admin[gold_rate], $nation[type]);
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
$goldoutcome = getGoldOutcome($connect, $nation[nation], $nation[bill]);
$riceincomeList = getRiceIncome($connect, $nation[nation], $nation[rate], $admin[rice_rate], $nation[type]);
$riceincome = $riceincomeList[0] + $riceincomeList[1];
$riceoutcome = getRiceOutcome($connect, $nation[nation], $nation[bill]);
$budgetgold = $nation[gold] + $goldincome - $goldoutcome + $deadIncome;
$budgetrice = $nation[rice] + $riceincome - $riceoutcome;
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
$budgetricediff = $riceincome - $riceoutcome;
if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; }
else { $budgetgolddiff = "$budgetgolddiff"; }
if($budgetricediff > 0) { $budgetricediff = "+{$budgetricediff}"; }
else { $budgetricediff = "$budgetricediff"; }
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form name=form1 method=post action=c_dipcenter.php>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</td></tr>
<tr><td colspan=2 id=bg1>국가 방침 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=msg value='<?=$nation[msg];?>'><input type=<?=$btn;?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=scoutmsg value='<?=$nation[scoutmsg];?>'><input type=<?=$btn;?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
<tr>
<td colspan=2>
<table width=998 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<?php
echo "
<tr>
<td colspan=2 align=center id=bg1>자금 예산</td>
<td colspan=2 align=center id=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>
</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>
</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>
</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>
</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>";
?>
<tr>
<td align=right id=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=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=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=center><?=$nation[myset];?> 회</td>
</tr>
<tr>
<td colspan=4 align=center>
<?php
if($nation[myset] > 0) {
if($nation[scout] == 0) {
echo "
<input type=$btn name=btn value='임관 금지'>";
} else {
echo "
<input type=$btn name=btn value='임관 허가'>";
}
if($nation[war] == 0) {
echo "
<input type=$btn name=btn value='전쟁 금지'>";
} else {
echo "
<input type=$btn name=btn value='전쟁 허가'>";
}
}
?>
</td>
</tr>
</table>
<tr><td colspan=2>기밀 권한이란, 암행부를 열람할 수 있는 일반 장수의 최소 사관 년수를 의미합니다.</td></tr>
<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:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-222
View File
@@ -1,222 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "중원정보", 1);
$query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,skin,map,userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select nation,color,name,power,gennum from nation where level>0 order by power desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
$nationStr = "";
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result);
$query = "select city from city where nation='$nation[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
$nationnum[count($nationnum)] = $nation[nation];
$nationname[$nation[nation]] = $nation[name];
$nationcolor[$nation[nation]] = $nation[color];
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation[color]).";background-color:$nation[color];>$nation[name]</font><br>";
$powerStr .= "국력 $nation[power]<br>";
$genStr .= "장수 $nation[gennum]<br>";
$cityStr .= "속령 $citycount<br>";
}
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>중원정보</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>중 원 정 보<br><?php backButton(); ?></td></tr>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=<?=$nationcount+1;?> align=center bgcolor=blue>외 교 현 황</td></tr>
<?php
echo "
<tr>
<td align=center width=108 style=background-color:$_basecolor2;>&nbsp;</td>";
if($nationcount != 0) {
$width = floor(888 / $nationcount);
}
for($i=0; $i < $nationcount; $i++) {
echo "
<td align=center width={$width} style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
}
echo "
</tr>";
for($i=0; $i < $nationcount; $i++) {
$query = "select you,state from diplomacy where me='$nationnum[$i]'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount2 = MYDB_num_rows($dipresult);
for($k=0; $k < $nationcount2; $k++) {
$dip = MYDB_fetch_array($dipresult);
$state[$dip[you]] = $dip[state];
}
echo "
<tr>
<td align=center style=background-color:{$nationcolor[$nationnum[$i]]};color:".newColor($nationcolor[$nationnum[$i]]).";>{$nationname[$nationnum[$i]]}</td>";
for($k=0; $k < $nationcount; $k++) {
if($i == $k) {
$str = "";
} else {
switch($state[$nationnum[$k]]) {
case 0: $str = "<font color=red>★</font>"; break;
case 1: $str = "<font color=magenta>▲</font>"; break;
case 2:
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation] || $me[userlevel] >= 4) { $str = "ㆍ"; }
else { $str = "?"; }
// $str = "ㆍ";
break;
case 3: $str = "<font color=cyan>○</font>"; break;
case 4: $str = "<font color=cyan>○</font>"; break;
case 5: $str = "<font color=cyan>◎</font>"; break;
case 6: $str = "<font color=cyan>◎</font>"; break;
case 7:
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation] || $me[userlevel] >= 4) { $str = "<font color=green>@</font>"; }
else { $str = "?"; }
// $str = "<font color=limegreen>@</font>";
break;
}
}
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation]) { $backcolor = "style=background-color:$_basecolor3;"; }
else { $backcolor = ""; }
echo "
<td align=center $backcolor>$str</td>";
}
echo "
</tr>
";
}
?>
<tr><td colspan=<?=$nationcount+1;?> align=center>불가침 : <font color=limegreen>@</font>, 통합 : <font color=cyan>○</font>, 합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
</table>
<?php
$query = "select city,name,conflict,conflict2 from city where conflict like '%|%'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
if($citycount != 0) {
echo "
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=2 align=center bgcolor=magenta>분 쟁 현 황</td></tr>";
}
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result);
if($city[conflict] != "") {
$nation = explode("|", $city[conflict]);
$killnum = explode("|", $city[conflict2]);
$seq = mySort($killnum); // 큰 순서대로 순서를 구한다.
$sum = 0;
for($k=0; $k < count($killnum); $k++) {
$sum += $killnum[$k];
}
echo "
<tr>
<td align=center width=48>$city[name]</td>
<td width=948>";
for($k=0; $k < count($nation); $k++) {
$per = 100*$killnum[$seq[$k]] / $sum;
$graph1 = $per / 100 * 798;
$per = round($per, 1);
echo "
<table border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=98 align=right style=color:".newColor($nationcolor[$nation[$seq[$k]]]).";background-color:{$nationcolor[$nation[$seq[$k]]]};>{$nationname[$nation[$seq[$k]]]}&nbsp;</td>
<td width=48 align=right>{$per}%&nbsp;</td>
<td width=$graph1 style=background-color:{$nationcolor[$nation[$seq[$k]]]};></td>
<td width=*></td>
</tr>
</table>";
}
echo "
</td>
</tr>
<tr><td colspan=2 height=5 id=bg1></td></tr>";
}
}
function mySort($killnum) {
for($i=0; $i < count($killnum); $i++) {
$seq[$i] = $i;
}
for($i=0; $i < count($killnum); $i++) {
$max = 0;
for($k=0; $k < count($killnum); $k++) {
if($max < $killnum[$k]) {
$max = $killnum[$k];
$index = $k;
}
}
$seq[$i] = $index;
$killnum[$index] = 0;
}
return $seq;
}
echo "
</table>
<br>";
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td colspan=5 align=center bgcolor=green><font size=3>중 원 지 도</font></td>
</tr>
<tr>
<td width=698 height=420>
<iframe src='map.php?type=2&graphic={$me[map]}' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe>
</td>
<td width=98 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>
</tr>
</table>
<br>";
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-199
View File
@@ -1,199 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "암행부", 2);
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select level,secretlimit from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit();
}
if($type == 0) {
$type = 7;
}
$sel[$type] = "selected";
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<?php if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); } ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>암행부</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>암 행 부<br><?php closeButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1];?> value=1>자금</option>
<option <?=$sel[2];?> value=2>군량</option>
<option <?=$sel[3];?> value=3>도시</option>
<option <?=$sel[4];?> value=4>병종</option>
<option <?=$sel[5];?> value=5>병사</option>
<option <?=$sel[6];?> value=6>삭제턴</option>
<option <?=$sel[7];?> value=7>턴</option>
<option <?=$sel[8];?> value=8>부대</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<?php
$query = "select troop,name from troop where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troopCount = MYDB_num_rows($result);
for($i=0; $i < $troopCount; $i++) {
$troop = MYDB_fetch_array($result);
$troopName[$troop[troop]] = $troop[name];
}
$cityname = CityNameArray();
switch($type) {
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by gold desc"; break;
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by rice desc"; break;
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by city"; break;
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crewtype desc"; break;
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crew desc"; break;
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by killturn"; break;
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by turntime"; break;
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by troop desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=98 align=center id=bg1>이 름</td>
<td width=98 align=center id=bg1>통무지</td>
<td width=98 align=center id=bg1>부 대</td>
<td width=58 align=center id=bg1>자 금</td>
<td width=58 align=center id=bg1>군 량</td>
<td width=48 align=center id=bg1>도시</td>
<td width=28 align=center id=bg1>守</td>
<td width=58 align=center id=bg1>병 종</td>
<td width=68 align=center id=bg1>병 사</td>
<td width=48 align=center id=bg1>훈련</td>
<td width=48 align=center id=bg1>사기</td>
<td width=148 align=center id=bg1>명 령</td>
<td width=58 align=center id=bg1>삭턴</td>
<td width=58 align=center id=bg1>턴</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$city = $cityname[$general[city]];
$troop = $troopName[$general[troop]] == "" ? "-" : $troopName[$general[troop]];
if($general[level] == 12) {
$lbonus = $nation[level] * 2;
} elseif($general[level] >= 5) {
$lbonus = $nation[level];
} else {
$lbonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
}
if($general[injury] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100);
$power = floor($general[power] * (100 - $general[injury])/100);
$intel = floor($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]}";
}
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; }
else { $name = "$general[name]"; }
switch($general[mode]) {
case 0: $mode = "×"; break;
case 1: $mode = "○"; break;
case 2: $mode = "◎"; break;
}
echo "
<tr>
<td align=center>$name<br>Lv ".getExpLevel($general[experience])."</td>
<td align=center>{$leader}∥{$power}∥{$intel}</td>
<td align=center>$troop</td>
<td align=center>$general[gold]</td>
<td align=center>$general[rice]</td>
<td align=center>$city</td>
<td align=center>$mode</td>
<td align=center>".getTypename($general[crewtype])."</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>
<font size=3>NPC 장수";
} else {
echo "
<td>
<font size=1>";
$turn = getTurn($connect, $general, 1, 0);
for($i=0; $i < 5; $i++) {
$turn[$i] = _String::SubStrForWidth($turn[$i], 0, 20);
$k = $i+1;
echo "
&nbsp;$k : $turn[$i] <br>";
}
}
echo "
</font>
</td>
<td align=center>$general[killturn]</td>
<td align=center>".substr($general[turntime],14,5)."</td>
</tr>";
}
echo "
</table>
";
MYDB_close($connect);
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-503
View File
@@ -1,503 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "인사부", 1);
//훼섭 추방을 위해 갱신
checkTurn($connect);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$meLevel = $me[level];
if($meLevel == 0) {
echo "재야입니다.";
exit();
}
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>인사부</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<script type="text/javascript">
function out() {
return confirm('정말 추방하시겠습니까?');
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>인 사 부<br><?php backButton(); ?></td></tr>
</table>
<br>
<?php
$cityNames = CityNameArray();
$query = "select nation,name,level,color,l12set,l11set,l10set,l9set,l8set,l7set,l6set,l5set from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보
$lv = getNationChiefLevel($nation[level]);
if($meLevel >= 5) { $btn = "submit"; }
else { $btn = "hidden"; }
$query = "select name,level,picture,imgsvr,belong from general where nation='$nation[nation]' and level>={$lv} order by level desc";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=12; $i >= $lv; $i--) {
$levels = MYDB_fetch_array($genresult);
$level[$levels[level]] = $levels;
}
$query = "select name,picture,killnum from general where nation='$nation[nation]' order by killnum desc limit 5"; // 오호장군
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select name,picture,firenum from general where nation='$nation[nation]' order by firenum desc limit 7"; // 건안칠자
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]} colspan=6>
<font size=5>【 $nation[name] 】</font>
</td>
</tr>
";
for($i=12; $i >= $lv; $i-=2) {
$i1 = $i; $i2 = $i - 1;
$imageTemp1 = GetImageURL($level[$i1][imgsvr]);
$imageTemp2 = GetImageURL($level[$i2][imgsvr]);
echo "
<tr>
<td width=98 align=center id=bg1><font size=4>".getLevel($i1, $nation[level])."</font></td>
<td width=64 height=64 background={$imageTemp1}/{$level[$i1][picture]}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i1][name]==''?"-":$level[$i1][name]; echo " ({$level[$i1][belong]}년)</font></td>
<td width=98 align=center id=bg1><font size=4>".getLevel($i2, $nation[level])."</font></td>
<td width=64 height=64 background={$imageTemp2}/{$level[$i2][picture]}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i2][name]==''?"-":$level[$i2][name]; echo " ({$level[$i2][belong]}년)</font></td>
</tr>
";
}
echo "
<tr>
<td width=98 align=center id=bg1>오호장군【승전】</td>
<td colspan=5>
";
$tigernum = MYDB_num_rows($tigerresult);
for($i=0; $i < $tigernum; $i++) {
$tiger = MYDB_fetch_array($tigerresult);
if($tiger[killnum] > 0) {
echo "{$tiger[name]}【{$tiger[killnum]}】, ";
}
}
echo "
</td>
</tr>
<tr>
<td width=98 align=center id=bg1>건안칠자【계략】</td>
<td colspan=5>
";
$eaglenum = MYDB_num_rows($eagleresult);
for($i=0; $i < $eaglenum; $i++) {
$eagle = MYDB_fetch_array($eagleresult);
if($eagle[firenum] > 0) {
echo "{$eagle[name]}【{$eagle[firenum]}】, ";
}
}
echo "
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form method=post action=c_myBossInfo.php>
<tr><td colspan=6 height=5></td></tr>
<tr><td colspan=2 align=center bgcolor=red>추 방</td></tr>
<tr>
<td width=498 align=right id=bg1>대상 장수</td>
<td width=498>
";
if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
echo "
<select name=outlist size=1 style=color:white;background-color:black;>";
$query = "select no,name,level from general where nation='$me[nation]' and level!='12' and no!='$me[no]' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
echo "
<option value={$general[no]}>{$general[name]}</option>";
}
echo "
</select>
<input type=$btn name=btn value=추방 onclick='return out()'>";
}
$query = "select name,city from general where nation='$me[nation]' and level=12";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
echo "
</td>
</tr>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=4 height=5></td></tr>
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
<tr>
<td width=98 align=right id=bg1>".getLevel(12, $nation[level])."</td>
<td width=398>{$general[name]} 【{$cityNames[$general[city]]}】</td>
<td width=98 align=right id=bg1>".getLevel(11, $nation[level])."</td>
<form method=post action=c_myBossInfo.php>
<td width=398>
";
if($meLevel >= 5 && $nation[l11set] == 0) {
echo "
<select name=genlist size=1 maxlength=15 style=color:white;background-color:black;>
<option value=0>____공석____</option>";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
if($general[level] == 11) {
echo "<option style=color:red; selected value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} elseif($general[level] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
}
}
echo "
</select>
<input type=hidden name=level value=11>
<input type=$btn name=btn value=임명>";
} else {
$query = "select name,city from general where nation='$me[nation]' and level='11'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
echo "{$general[name]} 【{$cityNames[$general[city]]}】";
}
echo "
</td>
</form>
</tr>
";
$querys[10] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[9] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$querys[8] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[7] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$querys[6] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[5] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
for($i=10; $i >= $lv; $i--) {
if($i % 2 == 0) { echo "<tr>"; }
echo "
<td width=98 align=right id=bg1>".getLevel($i, $nation[level])."</td>
<form method=post action=c_myBossInfo.php>
<td width=398>
";
if($meLevel >= 5 && $nation["l{$i}set"] == 0) {
echo "
<select name=genlist size=1 style=color:white;background-color:black;>
<option value=0>____공석____</option>";
$query = $querys[$i];
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($k=0; $k < $gencount; $k++) {
$general = MYDB_fetch_array($result);
if($general[level] == $i) {
echo "<option style=color:red; selected value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} elseif($general[level] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
}
}
echo "
</select>
<input type=hidden name=level value={$i}>
<input type=$btn name=btn value=임명>";
} else {
$query = "select name,city from general where nation='$me[nation]' and level={$i}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
echo "{$general[name]} 【{$cityNames[$general[city]]}】";
}
echo "</td></form>";
if($i % 2 == 1) { echo "</tr>"; }
}
echo "
<tr><td colspan=4>※ <font color=red>빨간색</font>은 현재 임명중인 장수, <font color=orange>노란색</font>은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.</td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=5 height=5></td></tr>
";
if($meLevel >= 5) {
echo "
<tr><td colspan=5 align=center bgcolor=orange>도 시 관 직 임 명</td></tr>
<form method=post action=c_myBossInfo.php>
<tr>
<td colspan=3 align=right id=bg2>태 수 임 명</td>
<td colspan=2>
<select name=citylist size=1 style=color:white;background-color:black;>
";
$query = "select city,name,region from city where nation='$nation[nation]' and gen1set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$region = 0;
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result);
if($region != $city[region]) {
if($region != 0) {
echo "</optgroup>";
}
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>";
$region = $city[region];
}
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>";
}
echo "</optgroup>";
echo "
</select>
<select name=genlist size=1 style=color:white;background-color:black;>
<option value=0>____공석____</option>
";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
if($general[level] == 4) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} elseif($general[level] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
}
}
echo "
</select>
<input type=hidden name=level value=4>
<input type=$btn name=btn value=임명>
</td>
</tr>
</form>
<form method=post action=c_myBossInfo.php>
<tr>
<td colspan=3 align=right id=bg2>군 사 임 명</td>
<td colspan=2>
<select name=citylist size=1 style=color:white;background-color:black;>
";
$query = "select city,name,region from city where nation='$nation[nation]' and gen2set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$region = 0;
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result);
if($region != $city[region]) {
if($region != 0) {
echo "</optgroup>";
}
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>";
$region = $city[region];
}
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>";
}
echo "</optgroup>";
echo "
</select>
<select name=genlist size=1 style=color:white;background-color:black;>
<option value=0>____공석____</option>
";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
if($general[level] == 3) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} elseif($general[level] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
}
}
echo "
</select>
<input type=hidden name=level value=3>
<input type=$btn name=btn value=임명>
</td>
</tr>
</form>
<form method=post action=c_myBossInfo.php>
<tr>
<td colspan=3 align=right id=bg2>시 중 임 명</td>
<td colspan=2>
<select name=citylist size=1 style=color:white;background-color:black;>
";
$query = "select city,name,region from city where nation='$nation[nation]' and gen3set=0 order by region, level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$region = 0;
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result);
if($region != $city[region]) {
if($region != 0) {
echo "</optgroup>";
}
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>";
$region = $city[region];
}
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>";
}
echo "</optgroup>";
echo "
</select>
<select name=genlist size=1 style=color:white;background-color:black;>
<option value=0>____공석____</option>
";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
if($general[level] == 2) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} elseif($general[level] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
} else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>";
}
}
echo "
</select>
<input type=hidden name=level value=2>
<input type=$btn name=btn value=임명>
</td>
</tr>
<tr><td colspan=5>※ <font color=red>빨간색</font>은 현재 임명중인 장수, <font color=orange>노란색</font>은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.</td></tr>
</form>
";
}
echo "
<tr>
<td width=158 align=center id=bg1 colspan=2><font size=4>도 시</font></td>
<td width=278 align=center id=bg1><font size=4>태 수 (사관) 【현재도시】</font></td>
<td width=278 align=center id=bg1><font size=4>군 사 (사관) 【현재도시】</font></td>
<td width=278 align=center id=bg1><font size=4>시 중 (사관) 【현재도시】</font></td>
</tr>
";
$citylevel[1] = "수";
$citylevel[2] = "진";
$citylevel[3] = "관";
$citylevel[4] = "이";
$citylevel[5] = "소";
$citylevel[6] = "중";
$citylevel[7] = "대";
$citylevel[8] = "특";
$query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='$nation[nation]' order by region,level desc,binary(name)"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
$region = 0;
for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult);
$query = "select name,belong,city from general where no='$city[gen1]'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($genresult);
$query = "select name,belong,city from general where no='$city[gen2]'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($genresult);
$query = "select name,belong,city from general where no='$city[gen3]'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult);
if($region != $city[region]) {
echo "
<tr><td colspan=5 height=3 id=bg1></td></tr>
<tr><td colspan=5 id=bg1><font size=4 color=skyblue> 【 ".getRegion($city[region])." 】 </font></td></tr>";
$region = $city[region];
}
$gen1[name] = $gen1[name]==""?"-":$gen1[name]." ({$gen1[belong]}년) 【{$cityNames[$gen1[city]]}】";
$gen2[name] = $gen2[name]==""?"-":$gen2[name]." ({$gen2[belong]}년) 【{$cityNames[$gen2[city]]}】";
$gen3[name] = $gen3[name]==""?"-":$gen3[name]." ({$gen3[belong]}년) 【{$cityNames[$gen3[city]]}】";
if($city[gen1set] == 1) { $gen1[name] = "<font color=orange>".$gen1[name]."</font>"; }
if($city[gen2set] == 1) { $gen2[name] = "<font color=orange>".$gen2[name]."</font>"; }
if($city[gen3set] == 1) { $gen3[name] = "<font color=orange>".$gen3[name]."</font>"; }
echo "
<tr>
<td width=78 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=3>【{$citylevel[$city[level]]}】</font></td>
<td width=78 align=right style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=3>$city[name]&nbsp;&nbsp;</font></td>
<td align=center>$gen1[name]</td>
<td align=center>$gen2[name]</td>
<td align=center>$gen3[name]</td>
</tr>
";
}
?>
<tr><td colspan=5>※ <font color=orange>노란색</font>은 변경 불가능, 하얀색은 변경 가능 관직입니다.</td></tr>
</table>
<br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-173
View File
@@ -1,173 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "세력도시", 1);
$query = "select no,nation,level,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] == 0) {
echo "재야입니다.";
exit();
}
if($type == 0) {
$type = 10;
}
$sel[$type] = "selected";
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력도시</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>세 력 도 시<br><?php backButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1];?> value=1>기본</option>
<option <?=$sel[2];?> value=2>인구</option>
<option <?=$sel[3];?> value=3>인구율</option>
<option <?=$sel[4];?> value=4>민심</option>
<option <?=$sel[5];?> value=5>농업</option>
<option <?=$sel[6];?> value=6>상업</option>
<option <?=$sel[7];?> value=7>치안</option>
<option <?=$sel[8];?> value=8>수비</option>
<option <?=$sel[9];?> value=9>성벽</option>
<option <?=$sel[10];?> value=10>시세</option>
<option <?=$sel[11];?> value=11>지역</option>
<option <?=$sel[12];?> value=12>규모</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<?php
$query = "select nation from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select color,capital from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보
switch($type) {
case 1: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]'"; break;
case 2: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by pop desc"; break;
case 3: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by poprate desc"; break;
case 4: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by rate desc"; break;
case 5: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by agri desc"; break;
case 6: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by comm desc"; break;
case 7: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by secu desc"; break;
case 8: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by def desc"; break;
case 9: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by wall desc"; break;
case 10: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by trade desc"; break;
case 11: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by region,level desc"; break;
case 12: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by level desc, region"; break;
}
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) { $city[name] = "<font color=cyan>[{$city[name]}]</font>"; }
$query = "select name from general where no='$city[gen1]'"; // 태수
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($genresult);
$query = "select name from general where no='$city[gen2]'"; // 군사
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($genresult);
$query = "select name from general where no='$city[gen3]'"; // 시중
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult);
if($type == 10 && $city[region] != $region) {
echo "<br>";
$region = $city[region];
} elseif($type == 11 && $city[level] != $level) {
echo "<br>";
$level = $city[level];
}
if($city[trade] == 0) {
$city[trade] = "- ";
}
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr>
<td colspan=12 style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=2>【 ".getRegion($city[region])." | ".getCityLevel($city[level])." 】 {$city[name]}</font></td>
</tr>
<tr>
<td align=center width=48 id=bg1>주민</td>
<td align=center width=112>$city[pop]/$city[pop2]</td>
<td align=center width=48 id=bg1>농업</td>
<td align=center width=108>$city[agri]/$city[agri2]</td>
<td align=center width=48 id=bg1>상업</td>
<td align=center width=108>$city[comm]/$city[comm2]</td>
<td align=center width=48 id=bg1>치안</td>
<td align=center width=108>$city[secu]/$city[secu2]</td>
<td align=center width=48 id=bg1>수비</td>
<td align=center width=108>$city[def]/$city[def2]</td>
<td align=center width=48 id=bg1>성벽</td>
<td align=center width=108>$city[wall]/$city[wall2]</td>
</tr>
<tr>
<td align=center id=bg1>민심</td>
<td align=center>$city[rate]</td>
<td align=center id=bg1>시세</td>
<td align=center>{$city[trade]}%</td>
<td align=center id=bg1>인구</td>
<td align=center>".round($city[pop]/$city[pop2]*100, 2)." %</td>
<td align=center id=bg1>태수</td>
<td align=center>";echo $gen1[name]==''?"-":"$gen1[name]";echo "</td>
<td align=center id=bg1>군사</td>
<td align=center>";echo $gen2[name]==''?"-":"$gen2[name]";echo "</td>
<td align=center id=bg1>시중</td>
<td align=center>";echo $gen3[name]==''?"-":"$gen3[name]";echo "</td>
</tr>
<tr>
<td align=center id=bg1>장수</td>
<td colspan=11>";
$query = "select npc,name from general where city='$city[city]' and nation='$me[nation]'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
if($gencount == 0) echo "-";
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>{$general[name]}, </font>"; }
elseif($general[npc] == 1) { echo "<font color=skyblue>{$general[name]}, </font>"; }
else { echo "$general[name], "; }
}
echo "
</td>
</tr>
</table>
";
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-173
View File
@@ -1,173 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "세력장수", 1);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] == 0) {
echo "재야입니다.";
exit();
}
if($type == 0) {
$type = 1;
}
$sel[$type] = "selected";
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력장수</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>세 력 장 수<br><?php backButton(); ?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[1];?> value=1>관직</option>
<option <?=$sel[2];?> value=2>계급</option>
<option <?=$sel[3];?> value=3>명성</option>
<option <?=$sel[4];?> value=4>통솔</option>
<option <?=$sel[5];?> value=5>무력</option>
<option <?=$sel[6];?> value=6>지력</option>
<option <?=$sel[7];?> value=7>자금</option>
<option <?=$sel[8];?> value=8>군량</option>
<option <?=$sel[9];?> value=9>병사</option>
<option <?=$sel[10];?> value=10>벌점</option>
<option <?=$sel[11];?> value=11>성격</option>
<option <?=$sel[12];?> value=12>내특</option>
<option <?=$sel[13];?> value=13>전특</option>
<option <?=$sel[14];?> value=14>사관</option>
<option <?=$sel[15];?> value=15>NPC</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<?php
$query = "select level from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
switch($type) {
case 1: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by level desc"; break;
case 2: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by dedication desc"; break;
case 3: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by experience desc"; break;
case 4: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by leader desc"; break;
case 5: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by power desc"; break;
case 6: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by intel desc"; break;
case 7: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by gold desc"; break;
case 8: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by rice desc"; break;
case 9: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by crew desc"; break;
case 10: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by connect desc"; break;
case 11: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by personal"; break;
case 12: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by special desc"; break;
case 13: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by special2 desc"; break;
case 14: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by belong desc"; break;
case 15: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by npc desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;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=78 align=center id=bg1>관 직</td>
<td width=68 align=center id=bg1>계 급</td>
<td width=68 align=center id=bg1>명 성</td>
<td width=68 align=center id=bg1>봉 록</td>
<td width=48 align=center id=bg1>통솔</td>
<td width=48 align=center id=bg1>무력</td>
<td width=48 align=center id=bg1>지력</td>
<td width=68 align=center id=bg1>자 금</td>
<td width=68 align=center id=bg1>군 량</td>
<td width=48 align=center id=bg1>성 격</td>
<td width=78 align=center id=bg1>특 기</td>
<td width=48 align=center id=bg1>사 관</td>
<td width=70 align=center id=bg1>벌점</td>
</tr>";
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
if($general[level] == 12) {
$lbonus = $nation[level] * 2;
} elseif($general[level] >= 5) {
$lbonus = $nation[level];
} else {
$lbonus = 0;
}
if($lbonus > 0) {
$lbonus = "<font color=cyan>+{$lbonus}</font>";
} else {
$lbonus = "";
}
if($general[injury] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100);
$power = floor($general[power] * (100 - $general[injury])/100);
$intel = floor($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]}";
}
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; }
else { $name = "$general[name]"; }
$imageTemp = GetImageURL($general[imgsvr]);
echo "
<tr>
<td align=center"; echo $me[skin]>0?" background={$imageTemp}/{$general[picture]}":""; echo " height=64></td>
<td align=center>$name</td>
<td align=center>"; echo getLevel($general[level], $nation[level]); echo "</td>
<td align=center>".getDed($general[dedication])."</td>
<td align=center>".getHonor($general[experience])."</td>
<td align=center>".getBill($general[dedication])."</td>
<td align=center>$leader</td>
<td align=center>$power</td>
<td align=center>$intel</td>
<td align=center>$general[gold]</td>
<td align=center>$general[rice]</td>
<td align=center>".getGenChar($general[personal])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td>
<td align=center>$general[belong]</td>
<td align=center>$general[connect]"; echo "<br>(".getConnect($general[connect]).")</td>
</tr>";
}
echo "
</table>
";
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-156
View File
@@ -1,156 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "세력정보", 1);
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] == 0) {
echo "재야입니다.";
exit();
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>세력정보</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>세 력 정 보<br><?php backButton(); ?></td></tr>
</table>
<br>
<?php
$query = "select nation,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,history,capital from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보
$query = "select city,name,pop,pop2 from city where nation='$nation[nation]'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) { $cityname[$j] = "<font color=cyan>[{$city[name]}]</font>"; }
else { $cityname[$j] = $city[name]; }
$totalpop += $city[pop];
$maxpop += $city[pop2];
}
$query = "select sum(crew) as totcrew,sum(leader)*100 as maxcrew from general where nation='$nation[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$query = "select gold_rate,rice_rate from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
// 금 수지
$deadIncome = getDeadIncome($connect, $nation[nation], $nation[type], $admin[gold_rate]);
$goldincomeList = getGoldIncome($connect, $nation[nation], $nation[rate], $admin[gold_rate], $nation[type]);
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
$goldoutcome = getGoldOutcome($connect, $nation[nation], $nation[bill]);
$riceincomeList = getRiceIncome($connect, $nation[nation], $nation[rate], $admin[rice_rate], $nation[type]);
$riceincome = $riceincomeList[0] + $riceincomeList[1];
$riceoutcome = getRiceOutcome($connect, $nation[nation], $nation[bill]);
$budgetgold = $nation[gold] + $goldincome - $goldoutcome + $deadIncome;
$budgetrice = $nation[rice] + $riceincome - $riceoutcome;
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
$budgetricediff = $riceincome - $riceoutcome;
if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; }
else { $budgetgolddiff = "$budgetgolddiff"; }
if($budgetricediff > 0) { $budgetricediff = "+{$budgetricediff}"; }
else { $budgetricediff = "$budgetricediff"; }
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr>
<td colspan=8 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 ";echo $me[nation]==0?"공 백 지":"$nation[name]";echo " 】</td>
</tr>
<tr>
<td width=98 align=center id=bg1>총주민</td>
<td width=198 align=center>{$totalpop}/{$maxpop}</td>
<td width=98 align=center id=bg1>총병사</td>
<td width=198 align=center>{$general[totcrew]}/{$general[maxcrew]}</td>
<td width=98 align=center id=bg1>국 력</td>
<td width=298 align=center colspan=3>$nation[power]</td>
</tr>
<tr>
<td align=center id=bg1>국 고</td>
<td align=center>"; echo $nation[gold]==0?"-":"$nation[gold]"; echo "</td>
<td align=center id=bg1>병 량</td>
<td align=center>"; echo $nation[rice]==0?"-":"$nation[rice]"; echo "</td>
<td align=center id=bg1>세 율</td>
<td align=center colspan=3>"; echo $me[nation]==0?"해당 없음":"$nation[rate] %"; echo "</td>
</td>
</tr>
<tr>
<td align=center id=bg1>세금/단기</td>
<td align=center>+$goldincomeList[0] / +$deadIncome</td>
<td align=center id=bg1>세곡/둔전</td>
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
<td align=center id=bg1>지급율</td>
<td align=center colspan=3>"; echo $me[nation]==0?"해당 없음":"$nation[bill] %"; echo "</td>
</tr>
<tr>
<td align=center id=bg1>수입/지출</td>
<td align=center>+$goldincome / -$goldoutcome</td>
<td align=center id=bg1>수입/지출</td>
<td align=center>+$riceincome / -$riceoutcome</td>
<td align=center id=bg1>속 령</td>
<td width=98 align=center>$citycount</td>
<td width=98 align=center id=bg1>장 수</td>
<td width=98 align=center>$nation[gennum]</td>
</tr>
<tr>
<td align=center id=bg1>국고 예산</td>
<td align=center>{$budgetgold} ({$budgetgolddiff})</td>
<td align=center id=bg1>병량 예산</td>
<td align=center>{$budgetrice} ({$budgetricediff})</td>
<td align=center id=bg1>기술력</td>
<td align=center>$nation[tech]</td>
<td align=center id=bg1>작 위</td>
<td align=center>".getNationLevel($nation[level])."</td>
</tr>
<tr>
<td align=center valign=top id=bg1> 속령일람 :</td>
<td colspan=7>";
for($j=0; $j < $citycount; $j++) {
echo "$cityname[$j], ";
}
echo"
</td>
</tr>
<tr>
<td align=center valign=top id=bg1>국가열전</td>
<td colspan=7 id=bg0>".ConvertLog($nation[history], $me[skin])."</td>
</tr>
</table>
<br>";
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-139
View File
@@ -1,139 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "내정보", 1);
$query = "select myset from general where user_id='$_SESSION[p_id]'";
$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($me['myset'] > 1) {
$submit = 'submit';
} else {
$submit = 'hidden';
}
$query = "update general set myset=myset-1,map='$map',mode='$mode',skin='$skin',tnmt='$tnmt' where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select no,skin,map,mode,tnmt,myset from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내정보</title>
<link rel=stylesheet href=stylesheet.php?<?=$me[skin];?> type=text/css>
<script type="text/javascript">
function go(type) {
if(type == 0) location.replace('c_vacation.php');
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>내 정 보<br><?php backButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=50%>
<?php myInfo($connect); ?>
<?php myInfo2($connect); ?>
</td>
<td width=50% valign=top>
<form name=form1 action=b_myPage.php method=post>
&nbsp;&nbsp;&nbsp;&nbsp;스킨 【
<select name=skin>
<option value=0 <?=$me[skin]==0?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 간 단 ===</option>
<option value=1 <?=$me[skin]==1?"selected ":" ";?>style=color:225500;background-color:330000;font-size:13;>=== 표 준 ===</option>
<option value=2 <?=$me[skin]==2?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 계 절 ===</option>
<option value=3 <?=$me[skin]==3?"selected ":" ";?>style=color:ff69b4;background-color:330033;font-size:13;>=== 봄&nbsp;&nbsp;&nbsp;&nbsp; ===</option>
<option value=4 <?=$me[skin]==4?"selected ":" ";?>style=color:225500;background-color:001717;font-size:13;>=== 여 름 ===</option>
<option value=5 <?=$me[skin]==5?"selected ":" ";?>style=color:b8860b;background-color:220000;font-size:13;>=== 가 을 ===</option>
<option value=6 <?=$me[skin]==6?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 겨 울 ===</option>
<option value=7 <?=$me[skin]==7?"selected ":" ";?>style=color:660000;background-color:220000;font-size:13;>=== 주 작 ===</option>
<option value=8 <?=$me[skin]==8?"selected ":" ";?>style=color:006600;background-color:002200;font-size:13;>=== 초 태 ===</option>
<option value=9 <?=$me[skin]==9?"selected ":" ";?>style=color:000066;background-color:000022;font-size:13;>=== 청 룡 ===</option>
<option value=10 <?=$me[skin]==10?"selected ":" ";?>style=color:006666;background-color:002222;font-size:13;>=== 녹 기 ===</option>
<option value=11 <?=$me[skin]==11?"selected ":" ";?>style=color:660066;background-color:220022;font-size:13;>=== 남 황 ===</option>
<option value=12 <?=$me[skin]==12?"selected ":" ";?>style=color:666600;background-color:222200;font-size:13;>=== 황 봉 ===</option>
<option value=13 <?=$me[skin]==13?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 현 무 ===</option>
<option value=14 <?=$me[skin]==14?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 랜 덤 ===</option>
<option value=15 <?=$me[skin]==15?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>==소녀시대===</option>
<option value=16 <?=$me[skin]==16?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 태 연 ===</option>
<option value=17 <?=$me[skin]==17?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 소 원 ===</option>
</select> 】<br><br>
&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;수비 【
<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:<?=$_basecolor2;?>;color:white;width:160;height:30;font-size:13; value=설정저장><br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>설정저장은 이달중 <?=$me['myset'];?>회 남았습니다.</font><br><br>
</form>
&nbsp;&nbsp;&nbsp;&nbsp;휴 가 신 청<br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:160;height:30;font-size:13; value=휴가신청 onclick='go(0)'>
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>전투 기록</font></td>
</tr>
<tr>
<td valign=top>
<?php MyLog($me[no], 24, $me[skin]); ?>
</td>
<td valign=top>
<?php MyBatLog($me[no], 24, $me[skin]); ?>
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>장수 열전</font></td>
<td align=center id=bg1><font color=orange size=3>전투 결과</font></td>
</tr>
<tr>
<td valign=top>
<?php MyHistory($connect, $me[no], $me[skin]); ?>
</td>
<td valign=top>
<?php MyBatRes($me[no], 24, $me[skin]); ?>
</td>
</tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?></td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-66
View File
@@ -1,66 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "회의실", 1);
$query = "select skin,no,nation from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<title>회의실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>회 의 실<br><?php backButton(); ?></td></tr>
<form name=form1 method=post action=c_nationboard.php>
<tr><td align=center>
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830;>
</td>
</tr>
<tr><td>
<textarea name=msg style=color:white;background-color:black;width:998;height:200;></textarea><br>
<input type=submit value=저장하기>
<input type=hidden name=num value=-1>
</td></tr>
</form>
</table>
<br>
<?php
$nation = getNation($connect, $me[nation]);
//20개 메세지
$index = $nation[boardindex];
for($i=0; $i < 20; $i++) {
$who = "board{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($nation["board{$index}"] != '') { msgprint($connect, $nation["board{$index}"], $general[name], $general[picture], $general[imgsvr], $nation["board{$index}_when"], $index, 0); }
$index--;
if($index < 0) { $index = 19; }
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-50
View File
@@ -1,50 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "국법", 1);
?>
<html>
<head>
<title>국법</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>국 법<br><?php backButton(); ?></td></tr>
<tr><td>
<?php
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select rule from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($me[level] >= 5) {
echo "
<form name=form1 method=post action=c_nationrule.php>
<textarea name=msg style=color:white;background-color:black;width:998;height:500;>$nation[rule]</textarea><br>
<input type=submit value=저장하기>
</form>";
} else {
echo "
<textarea name=msg style=color:white;background-color:black;width:998;height:500; readonly>$nation[rule]</textarea><br>";
}
?>
</td></tr>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-405
View File
@@ -1,405 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "토너먼트", 1);
checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select conlimit,tournament,phase,tnmt_msg,tnmt_type,develcost,tnmt_trig from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
switch($admin[tnmt_type]) {
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break;
}
?>
<html>
<?php if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); } ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>토너먼트</title>
<style>
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=$images;?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images;?>/back_green.jpg); }
#bg2 { background-image:url(<?=$images;?>/back_blue.jpg); }
</style>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=2000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>삼모전 토너먼트<br><?php closeButton(); ?></td></tr>
</table>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<?php
if($me[userlevel] >= 5) {
echo "
<form method=post action=c_tournament.php>
<tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr>
<tr><td colspan=8>
<input type=button value='갱신' onclick='location.reload()'>";
switch($admin[tnmt_trig]) {
case 0: $sel[0] = "selected"; break;
case 1: $sel[1] = "selected"; break;
case 2: $sel[2] = "selected"; break;
case 3: $sel[3] = "selected"; break;
case 4: $sel[4] = "selected"; break;
case 5: $sel[5] = "selected"; break;
case 6: $sel[6] = "selected"; break;
case 7: $sel[7] = "selected"; break;
}
if($admin[tournament] == 0) {
echo "
<select name=auto size=1 style=color:white;background-color:black;>
<option style=color:white; value=0>수동진행</option>
<option style=color:white; value=1>12분 05일</option>
<option style=color:white; value=2>07분 10시</option>
<option style=color:white; value=3>03분 04시</option>
<option style=color:white; value=4>01분 82분</option>
<option style=color:white; value=5>30초 41분</option>
<option style=color:white; value=6>15초 21분</option>
<option style=color:white; value=7>05초 07분</option>
</select>
<select name=type size=1 style=color:white;background-color:black;>
<option style=color:white; value=0>전력전</option>
<option style=color:white; value=1>통솔전</option>
<option style=color:white; value=2>일기토</option>
<option style=color:white; value=3>설전</option>
</select>
<input type=submit name=btn value='개최'>
<select name=trig size=1 style=color:white;background-color:black;>
<option style=color:white; value=0 {$sel[0]}>수동진행</option>
<option style=color:white; value=1 {$sel[1]}>12분 05일</option>
<option style=color:white; value=2 {$sel[2]}>07분 10시</option>
<option style=color:white; value=3 {$sel[3]}>03분 04시</option>
<option style=color:white; value=4 {$sel[4]}>01분 82분</option>
<option style=color:white; value=5 {$sel[5]}>30초 41분</option>
<option style=color:white; value=6 {$sel[6]}>15초 21분</option>
<option style=color:white; value=7 {$sel[7]}>05초 07분</option>
</select>
<input type=submit name=btn value='자동개최설정'>
<input type=submit name=btn value='포상'>
<input type=submit name=btn value='회수'>"; }
else {
echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>";
}
switch($admin[tournament]) {
case 1:
echo "<select name=gen size=1 style=color:white;background-color:black;>";
$query = "select no,name,npc,tnmt,leader,power,intel,leader+power+intel as total from general where tournament=0 and gold>='$admin[develcost]' order by {$tp3} desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
for($i=0; $i < $genCount; $i++) {
$general = MYDB_fetch_array($result);
if($general[npc] >= 2) { $npc = "cyan"; }
elseif($general[npc] == 1) { $npc = "skyblue"; }
elseif($general[tnmt] > 0) { $npc = "blue"; }
else { $npc = "white"; }
echo "<option style=color:{$npc}; value={$general[no]}>[{$general[$tp3]}]{$general[name]}</option>";
}
echo "
</select>
<input type=submit name=btn value='투입'>
<input type=submit name=btn value='무명투입'>
<input type=submit name=btn value='쪼렙투입'>
<input type=submit name=btn value='일반투입'>
<input type=submit name=btn value='굇수투입'>
<input type=submit name=btn value='랜덤투입'>
<input type=submit name=btn value='쪼렙전부투입'>
<input type=submit name=btn value='일반전부투입'>
<input type=submit name=btn value='굇수전부투입'>
<input type=submit name=btn value='랜덤전부투입'>
<input type=submit name=btn value='무명전부투입'>";
break;
case 2: echo "<input type=submit name=btn value='예선'><input type=submit name=btn value='예선전부'>"; break;
case 3: echo "<input type=submit name=btn value='추첨'><input type=submit name=btn value='추첨전부'>"; break;
case 4: echo "<input type=submit name=btn value='본선'><input type=submit name=btn value='본선전부'>"; break;
case 5: echo "<input type=submit name=btn value='배정'>"; break;
case 6: echo "<input type=submit name=btn value='베팅마감'>"; break;
case 7: echo "<input type=submit name=btn value='16강'>"; break;
case 8: echo "<input type=submit name=btn value='8강'>"; break;
case 9: echo "<input type=submit name=btn value='4강'>"; break;
case 10: echo "<input type=submit name=btn value='결승'>"; break;
}
echo "
</td></tr>
</form>";
} elseif($me[no] > 0 && $me[tournament] == 0 && $admin[tournament] == 1) {
echo "<form method=post action=c_tournament.php><tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm(\"참가비 금{$admin[develcost]}이 필요합니다. 참가하시겠습니까?\")'></td></tr></form>";
} else {
echo "<tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'></td></tr>";
}
$str1 = getTournament($admin[tournament]);
$str2 = getTournamentTime($connect);
$str3 = getTournamentTerm($connect);
?>
<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 id=bg2><font color=magenta size=5>16강 승자전</font></td></tr>
<tr><td height=10 colspan=8 align=center></td></tr>
<?php
echo "
<tr>
<td colspan=8>
<table align=center width=2000 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr align=center>";
$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);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
echo "<td colspan=16>{$general[name]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 1; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓"."</font>";
echo "<td colspan=16>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 2; $i++) {
echo "<td colspan=8>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=40 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 2; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━━━━━━┓"."</font>";
echo "<td colspan=8>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 4; $i++) {
echo "<td colspan=4>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=30 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 4; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━━━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━┓"."</font>";
echo "<td colspan=4>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 8; $i++) {
echo "<td colspan=2>{$gen[$i]}</td>";
}
echo "
</tr>
<tr align=center>";
$query = "select npc,name,win from tournament where grp>=20 order by grp, grp_no";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name];
}
for($i=0; $i < 8; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>";
$line[$i*2] = $line[$i*2]."┏━━━━"."</font>";
$line[$i*2+1] = $line[$i*2+1]."━━━━┓"."</font>";
echo "<td colspan=2>{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}</td>";
}
echo "
</tr>
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "<td width=125>{$gen[$i]}</td>";
}
echo"
</tr>";
$query = "select tournament,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$betting = MYDB_fetch_array($result);
for($i=0; $i < 16; $i++) {
$bet[$i] = @round($betting[bet] / $betting["bet{$i}"], 2);
if($bet[$i] == 0) { $bet[$i] = "∞"; }
}
echo "
<tr align=center>";
for($i=0; $i < 16; $i++) {
echo "<td><font color=skyblue>{$bet[$i]}</font></td>";
}
echo "
</tr>
<tr align=center><td height=10 colspan=16></td></tr>
<tr align=center><td colspan=16><font color=skyblue size=4>배당률이 낮을수록 베팅된 금액이 많고 유저들이 우승후보로 많이 선택한 장수입니다.</font></td></tr>
</table>
</td>
</tr>";
if($admin[tournament] >= 7 || $admin[tournament] == 0) { printFighting($admin[tournament], $admin[phase]); }
echo "
<tr><td height=10 colspan=8 align=center></td></tr>
<tr><td colspan=8 align=center id=bg2><font color=orange size=5>조별 본선 순위</font></td></tr>
<tr>";
$num = Array("一", "二", "三", "四", "五", "六", "七", "八");
for($i=0; $i < 8; $i++) {
$grp = $i + 10;
echo "
<td>
<table align=center width=250 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
$query = "select npc,name,ldr,pwr,itl,ldr+pwr+itl as tot,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 4; $k++) {
$general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$tp], $general[game], $general[win], $general[draw], $general[lose], $general[gd], $general[gl], $general[prmt]);
}
echo "
</table>
</td>";
}
echo "</tr>";
if($admin[tournament] == 4 || $admin[tournament] == 5) { printFighting($admin[tournament], $admin[phase]); }
echo "
<tr><td colspan=8 align=center id=bg2><font color=yellow size=5>조별 예선 순위</font></td></tr>
<tr>";
for($i=0; $i < 8; $i++) {
$grp = $i;
echo "
<td>
<table align=center width=250 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
$query = "select npc,name,ldr,pwr,itl,ldr+pwr+itl as tot,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 8; $k++) {
$general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$tp], $general[game], $general[win], $general[draw], $general[lose], $general[gd], $general[gl], $general[prmt]);
}
echo "
</table>
</td>";
}
if($admin[tournament] == 2 || $admin[tournament] == 3) { printFighting($admin[tournament], $admin[phase]); }
?>
</tr>
<tr><td colspan=8>
<font color=white size=2>
ㆍ예선은 홈&어웨이 풀리그로 진행됩니다. (총 14경기)<br>
ㆍ상위 4명이 본선에 진출하게 되며 조추첨을 통해 조가 배정됩니다.<br>
ㆍ각 조1위가 시드1로 랜덤하게 조에 배정되며, 역시 각 조2위가 시드2로 랜덤하게 조에 배정됩니다.<br>
ㆍ그후 남은 3, 4위는 완전 랜덤하게 모든 조에 랜덤하게 배정됩니다.<br>
ㆍ본선은 개인당 3경기를 치르게 되며 승점(승3, 무1, 패0), 득실, 참가순서(시드)에 따라 순위를 매깁니다.<br>
ㆍ각 조 1, 2위는 16강에 지정된 위치에 배정됩니다.<br>
ㆍ16강부터는 1경기 토너먼트로 진행됩니다.<br>
ㆍ참가비는 금20~140이며, 성적에 따라 금과 약간의 명성이 포상으로 주어집니다.<br>
ㆍ16강자 100, 8강자 300, 4강자 600, 준우승자 1200, 우승자 2000 (220년 기준)<br>
ㆍ즐거운 삼토!
</font>
</td></tr>
</table>
<table align=center width=2000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php closeButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
-161
View File
@@ -1,161 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "부대편성", 1);
$query = "select skin,no,nation,troop from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select * from troop where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troopcount = MYDB_num_rows($result);
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>부대편성</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>부 대 편 성<br><?php backButton(); ?></td></tr>
</table>
<form name=form1 method=post action=c_troop.php>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td align=center width=64 id=bg1>선 택</td>
<td align=center width=98 id=bg1>부 대 정 보</td>
<td align=center width=64 id=bg1>부 대 장</td>
<td align=center width=662 id=bg1 style=table-layout:fixed;word-break:break-all;>장 수</td>
<td align=center width=98 id=bg1 style=table-layout:fixed;word-break:break-all;>부대장행동</td>
</tr>
<?php
for($i=0; $i < $troopcount; $i++) {
$troop = MYDB_fetch_array($result);
$genlist = "";
$query = "select no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5 from general where troop='$troop[troop]'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$genlist .= $general[name].", ";
if($troop[no] == $general[no]) {
$picture = $general[picture];
$imageTemp = GetImageURL($general[imgsvr]);
$name = $general[name];
$turntime = $general[turntime];
$query = "select name from city where city='$general[city]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult);
$cityname = $city[name];
$turn = "";
for($k=0; $k < 5; $k++) {
$m = $k+1;
if($general["turn{$k}"] == 26) {
$turn .= "&nbsp;$m : 집합<br>";
} else {
$turn .= "&nbsp;$m : <br>";
}
}
}
}
$genlist .= "({$gencount}명)";
if($me[troop] == 0) {
echo "
<tr>
<td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop[troop]}'></td>
<td align=center >$troop[name]<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td>
<td rowspan=2>$turn</td>
</tr>
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
<tr><td colspan=5>";
} else {
echo "
<tr>
<td align=center rowspan=2>&nbsp;</td>
<td align=center >$troop[name]<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td>
<td rowspan=2>";
if($troop[no] == $me[no]) {
$query = "select no,name from general where troop='$troop[troop]' and no!='$me[no]' order by binary(name)";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genresult);
echo "
<select name=gen size=3 style=color:white;background-color:black;font-size:13;width:98;>";
for($k=0; $k < $genCount; $k++) {
$general = MYDB_fetch_array($genresult);
echo "
<option value=$general[no]>$general[name]</option>";
}
echo "
</select><br>
<input type=submit name=btn value='부 대 추 방' style=width:100;height:25;>";
} else {
echo $turn;
}
echo "
</td>
</tr>
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
<tr><td colspan=5>";
}
}
if($me[troop] == 0) {
echo"
<input type=submit name=btn value='부 대 가 입'>";
} else {
echo"
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm(\"정말 부대를 탈퇴하시겠습니까?\")'>";
}
echo "
</td></tr>
</table>
<br>";
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=80 id=bg1>부 대 명</td>
<td width=100><input type=text style=color:white;background-color:black; size=12 maxlength=6 name=name></td>";
if($me[troop] == 0) {
echo "
<td><input type=submit name=btn value='부 대 창 설'></td>";
} else {
echo "
<td><input type=submit name=btn value='부 대 변 경'></td>";
}
echo "
</tr>
</table>";
MYDB_close($connect);
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</form>
<?php PrintElapsedTime(); ?>
</body>
</html>
-216
View File
@@ -1,216 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "입찰", 1);
$query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,gold,rice,special,userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no from auction where no1='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tradeCount = MYDB_num_rows($result);
$query = "select no from auction where no2='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount;
switch($admin[turnterm]) {
case 0: $unit = 7200; break;
case 1: $unit = 3600; break;
case 2: $unit = 1800; break;
case 3: $unit = 1200; break;
case 4: $unit = 600; break;
case 5: $unit = 300; break;
case 6: $unit = 120; break;
case 7: $unit = 60; break;
}
$amount = round($amount / 10) * 10;
$cost = round($cost / 10) * 10;
$topv = round($topv / 10) * 10;
$value = round($value / 10) * 10;
if($term > 24) $term = 24;
$valid = 1;
if($me[userlevel] >= 5 || ($me[special] != 30 && $btCount < 1) || ($me[special] == 30 && $btCount < 3)) {
} else {
$msg = "ㆍ<O>더이상 등록할 수 없습니다.</>";
$msg2 = "ㆍ<O>더이상 등록할 수 없습니다.</>";
$valid = 0;
$btn = "hidden";
}
if($btn == "판매") {
if($stuff != 0) {
$msg = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0;
}
if($term < 0 || $term > 24) {
$msg = "ㆍ<O>종료기한은 1 ~ 24 턴 이어야 합니다.</>";
$valid = 0;
}
if($amount < 100 || $amount > 10000) {
$msg = "ㆍ<O>거래량은 100 ~ 10000 이어야 합니다.</>";
$valid = 0;
}
if($cost > $amount * 2 || $cost * 2 < $amount) {
$msg = "ㆍ<O>시작판매가는 50% ~ 200% 이어야 합니다.</>";
$valid = 0;
}
if($topv < $amount*1.1 || $topv > $amount * 2) {
$msg = "ㆍ<O>즉시판매가는 110% ~ 200% 이어야 합니다.</>";
$valid = 0;
}
if($topv < $cost*1.1) {
$msg = "ㆍ<O>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</>";
$valid = 0;
}
if($amount > $me[rice] - 1000) {
$msg = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "구매시도") {
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result);
if($value == $auction[topv]) {
$valid = 2;
}
if(!$auction) {
$msg = "ㆍ<O>종료된 거래입니다.</>";
$valid = 0;
}
/*
if($stuff != 0) {
$msg = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0;
}
*/
if($auction[no2] > 0 && $value <= $auction[value]) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0;
}
if($value < $auction[value]) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0;
}
if($value > $auction[topv]) {
$msg = "ㆍ<O>즉시판매가보다 높을 수 없습니다.</>";
$valid = 0;
}
if($value > $me[gold] - 1000) {
$msg = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) {
$msg = "ㆍ<O>즉시판매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "구매") {
if($stuff != 0) {
$msg2 = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0;
}
if($term < 0 || $term > 24) {
$msg2 = "ㆍ<O>종료기한은 1 ~ 24 턴 이어야 합니다.</>";
$valid = 0;
}
if($amount < 100 || $amount > 10000) {
$msg2 = "ㆍ<O>거래량은 100 ~ 10000 이어야 합니다.</>";
$valid = 0;
}
if($cost > $amount * 2 || $cost * 2 < $amount) {
$msg2 = "ㆍ<O>시작구매가는 50% ~ 200% 이어야 합니다.</>";
$valid = 0;
}
if($topv < $amount * 0.5 || $topv > $amount * 0.9) {
$msg2 = "ㆍ<O>즉시구매가는 50% ~ 90% 이어야 합니다.</>";
$valid = 0;
}
if($topv > $cost * 0.9) {
$msg2 = "ㆍ<O>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</>";
$valid = 0;
}
if($cost > $me[gold] - 1000) {
$msg2 = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg2 = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "판매시도") {
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result);
if($value == $auction[topv]) {
$valid = 2;
}
if(!$auction) {
$msg2 = "ㆍ<O>종료된 거래입니다.</>";
$valid = 0;
}
if($stuff != 0) {
$msg2 = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0;
}
if($auction[no2] > 0 && $value >= $auction[value]) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0;
}
if($value > $auction[value]) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0;
}
if($value < $auction[topv]) {
$msg2 = "ㆍ<O>즉시구매가보다 낮을 수 없습니다.</>";
$valid = 0;
}
if($value > $me[rice] - 1000) {
$msg2 = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0;
}
if($valid == 1) {
$msg2 = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) {
$msg2 = "ㆍ<O>즉시구매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
Submit("b_auction.php", $msg, $msg2);
-42
View File
@@ -1,42 +0,0 @@
<?php
// $btn0~15, $gold0~15
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "베팅", 1);
$query = "select tournament,phase,tnmt_type,develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($admin[tournament] != 6) {
echo "<script>location.replace('b_betting.php');</script>";
exit();
}
$query = "select gold,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
for($i=0; $i < 16; $i++) {
if(${"btn{$i}"} == "베팅!") {
$gold = ${"gold{$i}"};
$mebet = $me["bet{$i}"];
if($gold >= 10 && $gold <= 1000) {
if($gold + 500 <= $me[gold] && $gold + $mebet <= 1000 && $gold + $me[bet] <= 1000) {
$query = "update general set gold=gold-'$gold',bet{$i}=bet{$i}+'$gold',betgold=betgold+'$gold' where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set bet{$i}=bet{$i}+'$gold' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
}
?>
<!--<script>location.replace('b_betting.php');</script>//TODO:replace-->
b_betting.php
-51
View File
@@ -1,51 +0,0 @@
<?php
// $title, $msg, $num
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$query = "select no,nation from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($connect, $me[nation]);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation[coreindex] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='$me[no]',coreboard{$num}_when='$date' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set coreindex='$num' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["coreboard{$num}"]."|".$me[no]."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set coreboard{$num}='$newmsg' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
//echo "<script>location.replace('b_chiefboard.php');</script>";
echo 'b_chiefboard.php';//TODO:replace
?>
</body>
</html>
-62
View File
@@ -1,62 +0,0 @@
<?php
// $btn, $msg, $scoutmsg, $rate, $bill, $secretlimit
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$btn = $_POST[btn];
//내가 수뇌부이어야함
if($me[level] < 5) {
echo "<script>location.replace('b_myBossInfo.php');</script>";
exit();
}
if($btn == "국가방침") {
$msg = BadTag2Code(addslashes(SQ2DQ($msg)));
$query = "update nation set msg='$msg' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} 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),"");
} 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),"");
} 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),"");
} elseif($btn == "임관 금지") {
$query = "update nation set myset=myset-1,scout='1' where nation='$me[nation]' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "임관 허가") {
$query = "update nation set myset=myset-1,scout='0' where nation='$me[nation]' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전쟁 금지") {
$query = "update nation set myset=myset-1,war='1' where nation='$me[nation]' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전쟁 허가") {
$query = "update nation set myset=myset-1,war='0' where nation='$me[nation]' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//echo "<script>location.replace('b_dipcenter.php');</script>";
echo 'b_dipcenter.php';//TODO:replace
-127
View File
@@ -1,127 +0,0 @@
<?php
// $turn, $command, $cost, $name, $nationname, $note, $double, $third, $fourth
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
if($command < 0) { $command = 0; }
if($double < 0) { $double = 0; }
if($third < 0) { $third = 0; }
if($fourth < 0) { $fourth = 0; }
$double = round($double, 0);
$third = round($third, 0);
$fourth = round($fourth, 0);
if($command > 99) { $command = 0; }
if($double > 9999) { $double = 9999; }
if($third > 9999) { $third = 9999; }
if($fourth > 9999) { $fourth = 9999; }
$comStr = EncodeCommand($fourth, $third, $double, $command);
// 건국
if($command == 46) {
$name = addslashes(SQ2DQ($name));
$name = str_replace("|", "", $name);
$name = str_replace(" ", "", $name);
$name = str_replace(" ", "", $name);
if($name == "") { $name = "무명"; }
$name = _String::SubStrForWidth($name, 0, 12);
$query = "update general set makenation='{$name}' where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn);
$str = "con=con";
for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$comStr}'";
}
$query = "update general set {$str} where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>location.replace('main.php');</script>";
//통합제의
} elseif($command == 53) {
$query = "select nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] >= 5) {
$nationname = addslashes(SQ2DQ($nationname));
$nationname = str_replace("|", "", $nationname);
$nationname = str_replace(" ", "", $nationname);
$nationname = str_replace(" ", "", $nationname);
if($nationname == "") { $nationname = "무명"; }
$nationname = _String::SubStrForWidth($nationname, 0, 12);
$query = "update general set makenation='{$nationname}' where level>=5 and nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn);
$str = "type=type";
for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'";
}
$query = "update nation set {$str} where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
echo "<script>location.replace('b_chiefcenter.php');</script>";
//불가침
} elseif($command == 61) {
$query = "select nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[level] >= 5) {
$note = addslashes(SQ2DQ($note));
$note = str_replace("|", "", $note);
$note = str_replace(" ", "", $note);
$note = str_replace(" ", "", $note);
$note = _String::SubStrForWidth($note, 0, 90);
$query = "update diplomacy set reserved='{$note}' where me='$me[nation]' and you='$double'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn);
$str = "type=type";
for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'";
}
$query = "update nation set {$str} where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
echo "<script>location.replace('b_chiefcenter.php');</script>";
//포상, 몰수, 발령, 항복권고, 원조
//선전포고, 종전, 파기, 초토화, 천도, 증축, 감축
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
//국기변경
} elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(($command == 23 || $command == 24 || $command == 27) && $me[no] == $third) {
// 자기자신에게 악용 금지
} elseif($me[level] >= 5) {
$count = sizeof($turn);
$str = "type=type";
for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'";
}
$query = "update nation set {$str} where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
echo "<script>location.replace('b_chiefcenter.php');</script>";
} else {
$count = sizeof($turn);
$str = "con=con";
for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$comStr}'";
}
$query = "update general set {$str} where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>location.replace('main.php');</script>";
}
-118
View File
@@ -1,118 +0,0 @@
<?php
// $msg, $genlist
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
increaseRefresh($connect, "서신전달", 1);
if(CheckBlock($connect) == 1 || CheckBlock($connect) == 3) {
$msg = "";
$genlist = 0;
}
$query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,msgindex,userlevel,con,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { echo "<script>window.top.main.location.replace('main.php');</script>"; exit(); }
$msg = str_replace("|", "", $msg);
$msg = trim($msg);
$msg = _String::SubStrForWidth($msg, $s, 198);
$date = date('Y-m-d H:i:s');
// 전체 메세지
if($genlist == 9999 && str_replace(" ", "", $msg) != "") {
if($me[nation] == 0) {
$nation[name] = '재야';
$nation[color] = 'FFFFFF';
} else {
$query = "select nation,name,color from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
}
PushMsg(1, 0, $me[picture], $me[imgsvr], "{$me[name]}:", $nation[color], $nation[name], $nation[color], $msg);
// 국가 메세지
} elseif($genlist >= 9000 && $msg != "") {
if($me[nation] == 0) {
$nation[name] = '재야';
$nation[color] = 'FFFFFF';
} else {
$query = "select nation,name,color from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
}
$genlist -= 9000;
$query = "select nation,name,color from nation where nation='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dest = MYDB_fetch_array($result);
if($nation[nation] == $dest[nation]) {
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:", $nation[color], $dest[name], $dest[color], $msg);
} else {
//타국에 보내는 경우
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], $msg);
// 수뇌이면 발송, 아니면 자국으로 돌림
if($me[level] >= 5) {
PushMsg(3, $dest[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], $msg);
} else {
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], "반송");
}
}
// 개인 메세지
} elseif($genlist > 0 && $msg != "") {
$query = "select name,msgindex from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
//발신, 수신인 코딩
$who = $me[no] * 10000 + $genlist;
$msg = addslashes(SQ2DQ($msg));
$query = "select msg{$me[msgindex]}_when as priv_when from general where no='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$prev_msg = MYDB_fetch_array($result);
$diff_second = strtotime($date) - strtotime($prev_msg[priv_when]);
if($diff_second < 3) {
$who = 1 * 10000 + $me[no]; // 운영자가 본인에게
$msg = "개인메세지는 3초당 1건만 보낼 수 있습니다!";
//자신에게 표시
$me[msgindex]++;
if($me[msgindex] >= 10) { $me[msgindex] = 0; }
$query = "update general set msgindex='$me[msgindex]',msg{$me[msgindex]}='$msg',msg{$me[msgindex]}_type='10',msg{$me[msgindex]}_who='$who',msg{$me[msgindex]}_when='$date',newmsg=1 where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
//자신에게 표시
$me[msgindex]++;
if($me[msgindex] >= 10) { $me[msgindex] = 0; }
$query = "update general set msgindex='$me[msgindex]',msg{$me[msgindex]}='$msg',msg{$me[msgindex]}_type='9',msg{$me[msgindex]}_who='$who',msg{$me[msgindex]}_when='$date' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 상대에게 발송
$you[msgindex]++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_type='10',msg{$you[msgindex]}_who='$who',msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$fp = fopen("logs/_gen_msg.txt", "a");
//로그 파일에 기록
fwrite($fp, _String::Fill($me[name],12," ")." > "._String::Fill($you[name],12," ")." | {$msg}\r\n");
fclose($fp);
}
//echo "<script>location.replace('msglist.php');</script>";
echo 'msglist.php';//TODO:replace
-256
View File
@@ -1,256 +0,0 @@
<?php
// $btn, $level, $genlist, $outlist
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select startyear,year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$meLevel = $me[level];
$query = "select no from general where nation='$me[nation]' and level=12";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ruler = MYDB_fetch_array($result);
if($btn == "임명") {
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general[level] == 12 || $meLevel < 5 || ($general[nation] != $me[nation] && $genlist != 0)) {
echo "<script>location.replace('b_myBossInfo.php');</script>";
exit();
}
} elseif($btn == "추방") {
$query = "select no,name,gold,rice,nation,troop,level,history,npc,picture,imgsvr from general where no='$outlist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general[level] == 12 || $meLevel < 5 || ($general[nation] != $me[nation] && $outlist != 0)) {
echo "<script>location.replace('b_myBossInfo.php');</script>";
exit();
}
}
if($btn == "추방") {
$query = "select name,l{$meLevel}set,chemi from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
//이미 지정했다면 무시
if($nation["l{$meLevel}set"] == 0 && $general[level] > 0 && $general[level] < 12) {
$query = "select no from diplomacy where me='$general[nation]' and state>='3' and state<='4'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount1 = MYDB_num_rows($dipresult);
$query = "select no from diplomacy where me='$general[nation]' and state>='5' and state<='6'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount2 = MYDB_num_rows($dipresult);
$gold = 0;
$rice = 0;
// 금쌀1000이상은 남김
if($general[gold] > 1000) {
$gold = $general[gold] - 1000;
$general[gold] = 1000;
}
if($general[rice] > 1000) {
$rice = $general[rice] - 1000;
$general[rice] = 1000;
}
if($dipcount1 > 0) {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:통합에 반대하던 <Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다.";
$log[count($log)] = "<C>●</>통합에 반대하다가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다.";
// 재야로, 국가 무소속으로
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general[gold]',rice='$general[rice]' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($dipcount2 > 0) {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:합병에 반대하던 <Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다.";
$log[count($log)] = "<C>●</>합병에 반대하다가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다.";
// 재야로, 국가 무소속으로
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general[gold]',rice='$general[rice]' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>추방</>당하였습니다.";
$log[count($log)] = "<C>●</><D><b>$nation[name]</b></>에서 <R>추방</>당하였습니다.";
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
$query = "update general set level=0,nation=0,belong=0,betray=betray+1,makelimit='12',gold='$general[gold]',rice='$general[rice]',dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
// 부대 처리
$query = "select no from troop where troop='$general[troop]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result);
//부대장일 경우
if($troop[no] == $general[no]) {
// 모두 탈퇴
$query = "update general set troop='0' where troop='$general[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제
$query = "delete from troop where troop='$general[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set troop='0' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
// 도시관직해제
$query = "update city set gen1='0' where gen1='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2='0' where gen2='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen3='0' where gen3='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general[npc] >= 2 && ($admin[scenario] == 0 || rand()%100 == 0)) {
switch(rand()%5) {
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
case 2: $str = "어디 추방해가면서 잘되나 보자... 꼭 복수하겠다..."; break;
case 3: $str = "인덕이 제일이거늘... 추방이 웬말인가... 저주한다!"; break;
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
}
PushMsg(1, 0, $general[picture], $general[imgsvr], "{$general[name]}:", $nation[color], $nation[name], $nation[color], $str);
}
//국가 기술력 그대로
$query = "select no from general where nation='$general[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gennum = $gencount;
if($gencount < 10) $gencount = 10;
$nation[chemi] -= 1;
if($nation[chemi] < 0) { $nation[chemi] = 0; }
if($admin[year] < $admin[startyear]+3) {
//초반엔 군주 부상 증가(엔장 임관지양)
$query = "update general set injury=injury+1 where no='$ruler[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation[chemi]',gold=gold+'$gold',rice=rice+'$rice' where nation='$general[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
//이번분기는 추방불가(초반 제외)
$query = "update nation set l{$meLevel}set=1,totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation[chemi]',gold=gold+'$gold',rice=rice+'$rice' where nation='$general[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$general = addHistory($connect, $general, "<C>●</>$admin[year]$admin[month]월:<D>$nation[name]</>에서 추방됨");
pushGenLog($general, $log);
pushAllLog($alllog);
}
} elseif($btn == "임명" && $level >= 5 && $level <= 11) {
$query = "select l{$level}set,level,chemi from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
// 임명가능 레벨
$lv = getNationChiefLevel($nation[level]);
//이미 지정했다면 무시
if($nation["l{$level}set"] == 0 && $lv <= $level) {
$nation[chemi] -= 1;
if($nation[chemi] < 0) { $nation[chemi] = 0; }
$query = "update nation set chemi='$nation[chemi]' where nation='$general[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 장수 일반으로
$query = "update general set level=1 where nation='$me[nation]' and level='$level'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($genlist != 0) {
$valid = 0;
switch($level) {
case 10: if($general[power] >= $_goodgenpower) { $valid = 1; } break;
case 9: if($general[intel] >= $_goodgenintel) { $valid = 1; } break;
case 8: if($general[power] >= $_goodgenpower) { $valid = 1; } break;
case 7: if($general[intel] >= $_goodgenintel) { $valid = 1; } break;
case 6: if($general[power] >= $_goodgenpower) { $valid = 1; } break;
case 5: if($general[intel] >= $_goodgenintel) { $valid = 1; } break;
default: $valid = 1; break;
}
if($valid == 1) {
// 신임 장수의 원래 자리 해제
$query = "update city set gen1=0 where gen1='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2=0 where gen2='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen3=0 where gen3='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//신임 장수
$query = "update general set level='$level' where no='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//이번분기는 불가
$query = "update nation set l{$level}set=1 where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
} elseif($btn == "임명" && $level >= 2 && $level <= 4 && $citylist > 0) {
switch($level) {
case 4: $lv = 1; break;
case 3: $lv = 2; break;
case 2: $lv = 3; break;
}
$query = "select gen{$lv} from city where city='$citylist'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
$oldlist = $city["gen{$lv}"];
if($oldlist != 0) {
//기존 장수 일반으로
$query = "update general set level=1 where no='$oldlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 자리 공석으로
$query = "update city set gen{$lv}=0 where city='$citylist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
if($genlist != 0) {
$valid = 0;
switch($level) {
case 4: if($general[power] >= $_goodgenpower) { $valid = 1; } break;
case 3: if($general[intel] >= $_goodgenintel) { $valid = 1; } break;
default: $valid = 1; break;
}
if($valid == 1) {
// 신임 장수의 원래 자리 해제
$query = "update city set gen1=0 where gen1='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2=0 where gen2='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen3=0 where gen3='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//신임 장수
$query = "update general set level='$level' where no='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen{$lv}='$genlist',gen{$lv}set='1' where city='$citylist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
//echo "<script>location.replace('b_myBossInfo.php');</script>";
echo 'b_myBossInfo.php'//TODO:replace
-52
View File
@@ -1,52 +0,0 @@
<?php
// $title, $msg, $num
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$query = "select no,nation from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$title = str_replace("|", " ", $title);
$msg = str_replace("|", " ", $msg);
$reply = str_replace("|", " ", $reply);
$title = trim($title);
$msg = trim($msg);
$reply = trim($reply);
$nation = getNation($connect, $me[nation]);
//새글 추가시
if($num == -1 && $title != "" && $msg != "") {
$num = $nation[boardindex] + 1;
if($num >= 20) { $num = 0; }
$msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s');
$query = "update nation set board{$num}='$msg',board{$num}_who='$me[no]',board{$num}_when='$date' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set boardindex='$num' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시
} elseif($num >= 0 && $reply != "") {
$newmsg = $nation["board{$num}"]."|".$me[no]."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set board{$num}='$newmsg' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
//echo "<script>location.replace('b_nationboard.php');</script>";
echo 'b_nationboard.php';//TODO:replace
?>
</body>
</html>
-21
View File
@@ -1,21 +0,0 @@
<?php
// $msg
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select no,nation from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$msg = addslashes(SQ2DQ($msg));
$query = "update nation set rule='$msg' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_nationrule.php');</script>";
echo 'b_nationrule.php';//TODO:replace
-206
View File
@@ -1,206 +0,0 @@
<?php
// $btn, $msg
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select tournament,phase,tnmt_type,develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,userlevel,tournament from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
switch($admin[tnmt_type]) {
case 0: $tp = "total"; $tp2 = "전력전"; $tp3 = "leader+power+intel"; break;
case 1: $tp = "leader"; $tp2 = "통솔전"; $tp3 = "leader"; break;
case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break;
case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
}
if($me[tournament] == 1 && $me[userlevel] < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$query = "update game set tnmt_trig={$trig}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "개최" && $me[userlevel] >= 5) {
startTournament($connect, $auto, $type);
} elseif($btn == "중단" && $me[userlevel] >= 5) {
$query = "update game set tnmt_auto=0, tournament=0, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $me[userlevel] >= 5) || $btn == "참가") {
if($btn == "투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost];
} elseif($btn == "무명투입") {
$general[no] = 0;
$general[name] = "무명장수";
$general[npc] = 2;
$general[leader] = 10;
$general[power] = 10;
$general[intel] = 10;
$general[explevel] = 10;
$general[gold] = 0;
} elseif($btn == "쪼렙투입") {
$sel = rand() % 32;
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost];
} elseif($btn == "일반투입") {
//참가한 사람 평균치
$query = "select AVG({$tp3}) as av from general where tournament=1";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$avgGen = MYDB_fetch_array($genResult);
//그 장수보다 높은장수 수
$query = "select no from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 and {$tp3}>{$avgGen[av]}";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult);
$sel = rand() % 32 + $genCount - 8;
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost];
} elseif($btn == "굇수투입") {
$sel = rand() % 32;
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost];
} elseif($btn == "랜덤투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost];
//참가
} else {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//$admin[develcost]원 참가비
if($general[gold] < $admin[develcost]) { echo "<script>location.replace('b_tournament.php');</script>"; exit(1); }
$general[gold] -= $admin[develcost];
}
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
for($i=0; $i < $grpCount; $i++) {
$grp = MYDB_fetch_array($result);
$occupied[$grp[grp]] = 1;
}
for($i=0; $i < 8; $i++) {
if($occupied[$i] == 0) {
$map[count($map)] = $i;
}
}
if($grpCount < 8) {
$grp = $map[rand() % count($map)];
$query = "select grp from tournament where grp='$grp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$grp', '$grpCount', '$general[horse]', '$general[weap]', '$general[book]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=1,gold='$general[gold]' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select grp from tournament where grp<10 group by grp having count(*)=8";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
if($grpCount >= 8) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $me[userlevel] >= 5) {
$z = 0;
for($i=0; $i < 8; $i++) {
$query = "select grp from tournament where grp='$i'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result);
for($k=$grpCount; $k < 8; $k++) {
$code[$z++] = $i * 10 + $k;
}
}
//섞기
for($i=0; $i < $z; $i++) {
$index = rand() % $z;
$temp = $code[$i];
$code[$i] = $code[$index];
$code[$index] = $temp;
}
for($i=0; $i < $z; $i++) {
$sel = rand() % 32;
if($btn == "쪼렙전부투입") {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} limit {$sel},1";
} elseif($btn == "일반전부투입") {
//참가한 사람 평균치
$query = "select AVG({$tp3}) as av from general where tournament=1";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$avgGen = MYDB_fetch_array($genResult);
//그 장수보다 높은장수 수
$query = "select no from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 and {$tp3}>{$avgGen[av]}";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult);
$sel += $genCount - 8;
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1";
} elseif($btn == "굇수전부투입") {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1";
} else {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by rand() limit 0,1";
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$grp = floor($code[$i] / 10);
$grp_no = $code[$i] % 10;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$grp', '$grp_no', '$general[horse]', '$general[weap]', '$general[book]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=1,gold=gold-'$admin[develcost]' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "무명전부투입" && $me[userlevel] >= 5) { fillLowGenAll($connect);
} elseif($btn == "예선" && $me[userlevel] >= 5) { qualify($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "예선전부" && $me[userlevel] >= 5) { qualifyAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "추첨" && $me[userlevel] >= 5) { selection($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "추첨전부" && $me[userlevel] >= 5) { selectionAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "본선" && $me[userlevel] >= 5) { finallySingle($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "본선전부" && $me[userlevel] >= 5) { finallyAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "배정" && $me[userlevel] >= 5) { final16set($connect);
} elseif($btn == "베팅마감" && $me[userlevel] >= 5) {
$dt = date("Y-m-d H:i:s", time() + 60);
$query = "update game set tournament='7',phase='0',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "16강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 16);
} elseif($btn == "8강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 8);
} elseif($btn == "4강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 4);
} elseif($btn == "결승" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 2);
} elseif($btn == "포상" && $me[userlevel] >= 5) { setGift($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]);
} elseif($btn == "회수" && $me[userlevel] >= 5) { setRefund($connect);
} elseif($btn == "메시지" && $me[userlevel] >= 5) {
$msg = addslashes(SQ2DQ($msg));
$query = "update game set tnmt_msg='$msg'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('b_tournament.php');</script> //TODO:replace -->
b_tournament.php
-56
View File
@@ -1,56 +0,0 @@
<?php
// $btn, $name, $troop
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select no,nation,troop from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$name = trim($name);
$name = addslashes(SQ2DQ($name));
if($btn == "부 대 창 설" && $name != "" && $me[troop] == 0) {
$query = "insert into troop (name,nation,no) values ('$name','$me[nation]','$me[no]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select troop from troop where no='$me[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result);
$query = "update general set troop='$troop[troop]' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 변 경" && $name != "") {
$query = "update troop set name='$name' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 추 방" && $gen != 0) {
$query = "update general set troop='0' where no='$gen'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 가 입" && $troop != 0) {
$query = "update general set troop='$troop' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 탈 퇴") {
$query = "select no from troop where troop='$me[troop]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result);
//부대장일 경우
if($troop[no] == $me[no]) {
// 모두 탈퇴
$query = "update general set troop='0' where troop='$me[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제
$query = "delete from troop where troop='$me[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set troop='0' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
echo "<script>location.replace('b_troop.php');</script>";
MYDB_close($connect);
-19
View File
@@ -1,19 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select killturn from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$admin[killturn] *= 3;
$query = "update general set killturn='$admin[killturn]' where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_myPage.php');</script>";
echo 'b_myPage.php'; //TODO:replace
-77
View File
@@ -1,77 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select develcost,vote,votecomment from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,userlevel,vote,name,nation,horse,weap,book,item,npc,history from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($btn == "수정" && $me[userlevel] >= 5) {
if($title != "") {
$vote = explode("|", $admin[vote]);
$vote[0] = addslashes(SQ2DQ($title));
$admin[vote] = implode("|", $vote);
$query = "update game set vote='{$admin[vote]}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "추가" && $me[userlevel] >= 5) {
if($str != "") {
$str = addslashes(SQ2DQ($str));
$admin[vote] .= "|{$str}";
$query = "update game set vote='{$admin[vote]}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "리셋" && $me[userlevel] >= 5) {
$query = "update game set voteopen=1,vote='',votecomment='' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set vote='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "알림" && $me[userlevel] >= 5) {
$query = "update general set newvote='1' where vote=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "숨김" && $me[userlevel] >= 5) {
$query = "update game set voteopen=0 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전체통계만" && $me[userlevel] >= 5) {
$query = "update game set voteopen=1 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전부" && $me[userlevel] >= 5) {
$query = "update game set voteopen=2 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "투표" && $me[vote] == 0 && $sel > 0) {
$develcost = $admin[develcost] * 5;
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = array();
$log = uniqueItem($connect, $me, $log, 1);
pushGenLog($me, $log);
} elseif($btn == "댓글" && $comment != "") {
$comment = str_replace("|", " ", $comment);
$comment = str_replace(":", " ", $comment);
$comment = trim($comment);
$comment = addslashes(SQ2DQ($comment));
$query = "select name from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($nation[name] == "") { $nation[name] = "재야"; }
if($admin[votecomment] != "") { $admin[votecomment] .= "|"; }
$admin[votecomment] .= "{$nation[name]}:{$me[name]}:{$comment}";
$query = "update game set votecomment='{$admin[votecomment]}' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('a_vote.php');</script> //TODO:replace -->
a_vote.php
-113
View File
@@ -1,113 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbconn();
?>
<html>
<head>
<title>커맨드리스트</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<script type="text/javascript">
function myclock() {
lastday = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
date = document.clock.clock.value;
year = parseInt(date.substr(0, 4), 10);
month = parseInt(date.substr(5,2), 10);
day = parseInt(date.substr(8, 2), 10);
hour = parseInt(date.substr(11, 2), 10);
min = parseInt(date.substr(14, 2), 10);
sec = parseInt(date.substr(17, 2), 10);
//윤년계산
if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { lastday[1] = 29; }
else { lastday[1] = 28; }
// if(term > 0) term--;
sec++;
if(sec >= 60) { sec = 0; min++; }
if(min >= 60) { min = 0; hour++; }
if(hour >= 24) { hour = 0; day++; }
if(day > lastday[month-1]) { month++; day = 1; }
if(month >= 13) { year++; month = 1; }
if(month < 10) { month = '0' + month; }
if(day < 10) { day = '0' + day; }
if(hour < 10) { hour = '0' + hour; }
if(min < 10) { min = '0' + min; }
if(sec < 10) { sec = '0' + sec; }
date = '' + year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec;
document.clock.clock.value = date;
window.setTimeout("myclock();", 1000);
}
</script>
<?php require('analytics.php'); ?>
</head>
<body OnLoad='myclock()' oncontextmenu='return false'>
<?php
myCommandList($connect);
function myCommandList($connect) {
global $_basecolor, $_basecolor2, $_basecolor3;
global $images;
$date = date('Y-m-d H:i:s');
// 명령 목록
$query = "select year,month,turnterm from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$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 user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$turn = getTurn($connect, $me, 2);
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<form name=clock>
<tr>
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
</tr>";
$year = $admin[year];
$month = $admin[month];
// 실행된 턴시간이면 +1
$cutTurn = cutTurn($me[turntime], $admin[turnterm]);
if($date <= $cutTurn) { $month++; }
$totaldate = $me[turntime];
for($i=0; $i < 24; $i++) {
if($month == 13) {
$month = 1;
$year++;
}
$j = $i + 1;
$turndate = substr($totaldate,11, 5);
echo "
<tr height=28>
<td width=30 align=center height=24 id=bg0><b>$j</b></td>
<td width=75 align=center height=24 id=bg1><b>{$year}年 {$month}月</b></td>
<td width=45 align=center bgcolor=black><b>$turndate</b></td>
<td width=137 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
</tr>";
$month++;
$totaldate = addTurn($totaldate, $admin[turnterm]);
}
echo "
</form>
</table>
";
}
?>
</body>
</html>
-118
View File
@@ -1,118 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
//$when = ($when + 1) * 2;
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,history,name from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,surlimit,history,color from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state,term from diplomacy where me='$me[nation]' and you='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//상대국의 제의조건
$query = "select reserved from diplomacy where me='$you[nation]' and you='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result);
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 불가침 실패.";
} elseif($dip[term] == $when*12 && $dip[state] == 7) {
$mylog[count($mylog)] = "<C>●</>이미 수락했습니다. 불가침 실패.";
} elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($dip[state] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 불가침 실패.";
} elseif($dip[state] == 1) {
$mylog[count($mylog)] = "<C>●</>아국과 선포중입니다. 불가침 실패.";
} elseif($dip[state] == 3 || $dip[state] == 4) {
$mylog[count($mylog)] = "<C>●</>아국과 합병중입니다. 불가침 실패.";
} elseif($mynation[dipmsg] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
// $alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>불가침</>에 합의.";
// $history[count($history)] = "<C>●</>$admin[year]년 $admin[month]월:<Y><b>【불가침】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 불가침 조약을 체결했습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 <C>$when</>년 불가침에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 <C>$when</>년 불가침에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 {$when}년 불가침 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 {$when}년 불가침 수락");
//국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 {$when}년 불가침 합의, 비고: {$dip2[reserved]}";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 {$when}년 불가침 합의, 비고: {$dip2[reserved]}";
PushMsg(2, $me[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg);
PushMsg(3, $you[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg);
$when = $when * 12;
//외교 변경
$query = "update diplomacy set state='7',term='$when',fixed='$dip2[reserved]' where me='$me[nation]' and you='$you[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='7',term='$when',fixed='$dip2[reserved]' where me='$you[nation]' and you='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//조건 지움
$query = "update diplomacy set reserved='' where me='$you[nation]' and you='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 불가침을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 불가침을 거부했습니다.";
//조건 지움
$query = "update diplomacy set reserved='' where me='$you[nation]' and you='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
//pushAllLog($alllog);
//pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-97
View File
@@ -1,97 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,surlimit,history,color from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 파기 실패.";
} elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 파기 실패.";
} elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 파기 실패.";
} elseif($dip[state] != 7) {
$mylog[count($mylog)] = "<C>●</>아국과 불가침중이 아닙니다. 파기 실패.";
} elseif($mynation[dipmsg] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 파기 실패.";
} else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>조약 파기</>에 합의.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【파기】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 불가침을 파기 하였습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 파기에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 파기에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 파기 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 파기 수락");
//외교 변경
$query = "update diplomacy set state='2',term='0' where me='$me[nation]' and you='$you[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='$you[nation]' and you='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 불가침 파기 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 불가침 파기 동의";
PushMsg(2, $me[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg);
PushMsg(3, $you[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 파기를 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 파기를 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushAllLog($alllog);
pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-102
View File
@@ -1,102 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select nation,name,surlimit,history,color from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 종전 실패.";
} elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 종전 실패.";
} elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 종전 실패.";
} elseif($dip[state] != 0 && $dip[state] != 1) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중이 아닙니다. 종전 실패.";
} elseif($mynation[dipmsg] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>종전 합의</> 하였습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【종전】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 <M>종전 합의</> 하였습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 종전에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 종전에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 종전 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 종전 수락");
//외교 변경
$query = "update diplomacy set state='2',term='0' where me='$mynation[nation]' and you='$younation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='$younation[nation]' and you='$mynation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//외교제한
$query = "update nation set surlimit=24 where nation='$mynation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set surlimit=24 where nation='$younation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 종전 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 종전 동의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 종전을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 종전을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushAllLog($alllog);
pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-136
View File
@@ -1,136 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,name,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select round(avg(power)) as power,round(avg(gennum)) as gennum from nation where level>=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$avgnation = MYDB_fetch_array($result);
$query = "select round(std(power)) as power,round(std(gennum)) as gennum from nation where level>=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$stdnation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,surlimit,history,color from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='$you[nation]' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='$me[nation]' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄
$valid = 1;
for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='$acdip[you]' and you='$you[nation]'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult);
if($abdip[state] == 7) {
$valid = 0;
}
}
if($ok == "수락") {
// 서신 보낸 후 멸망 했을때.
if($me[level] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 통합 실패.";
} elseif($mynation[surlimit] > 0) {
$mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($younation[surlimit] > 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 통합 실패.";
} elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 통합 실패.";
} elseif($mynation[power]+$younation[power] > $avgnation[power]+$stdnation[power]) {
$mylog[count($mylog)] = "<C>●</>양국 국력이 너무 높습니다. 통합 실패.";
} elseif($mynation[gennum]+$younation[gennum] > $avgnation[gennum]+$stdnation[gennum]) {
$mylog[count($mylog)] = "<C>●</>양국 장수가 많습니다. 통합 실패.";
} elseif(!isClose($connect, $younation[nation], $mynation[nation])) {
$mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 통합 실패.";
} elseif($dip[state] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 통합 실패.";
} elseif($dipcount != 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 통합 실패.";
} elseif($valid == 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 통합 실패.";
} elseif($mynation[dipmsg] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(이)가 통합에 동의했습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【통합시도】</b></><D><b>$mynation[name]</b></>(와)과 <D><b>$younation[name]</b></>(이)가 통합을 시도합니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 통합에 동의했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>통합</>에 동의하였습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 통합 시도");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 통합 시도");
//외교 변경
$query = "update diplomacy set state='3',term='24' where me='$mynation[nation]' and you='$younation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='4',term='24' where me='$younation[nation]' and you='$mynation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 통합에 합의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 통합에 합의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 항복을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(으)로 항복을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushAllLog($alllog);
pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-162
View File
@@ -1,162 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
$query = "select startyear,year,month,killturn from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,nations,level,troop,history,npc,gold,rice from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select name,nation,level,capital,scout from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($ok == "수락" && $me[level] < 12 && $nation[level] > 0 && $nation[scout] == 0 && $me[nation] != $nation[nation] && $admin[year] >= $admin[startyear]+3 && strpos($me['nations'], ",{$nation['nation']},") === false) {
$youlog[count($youlog)] = "<C>●</><Y>$me[name]</> 등용에 성공했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$nation[name]</b></>(으)로 <S>망명</>하였습니다.";
$mylog[count($mylog)] = "<C>●</><D>$nation[name]</>(으)로 망명하여 수도로 이동합니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<Y>$me[name]</> 등용에 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D>$nation[name]</>(으)로 망명");
// 임관내역 추가
$me['nations'] .= "{$nation['nation']},";
// 국가 변경, 도시 변경, 일반으로, 수도로
$query = "update general set killturn='$admin[killturn]',belong=1,nation='$you[nation]',nations='{$me['nations']}',level=1,city='$nation[capital]' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 재야가 아니면 명성N*10% 공헌N*10%감소
if($me[level] > 0) {
// 1000 1000 남기고 환수
if($me[gold] > 1000) { $gold = $me[gold] - 1000; $me[gold] = 1000; } else { $gold = 0; }
if($me[rice] > 1000) { $rice = $me[rice] - 1000; $me[rice] = 1000; } else { $rice = 0; }
$query = "update general set gold='$me[gold]',rice='$me[rice]',betray=betray+1,dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set gold=gold+'$gold',rice=rice+'$rice' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
//재야이면 100 100 증가
$query = "update general set dedication=dedication+100,experience=experience+100 where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//유저이면 삭턴 리셋
if($me[npc] < 2) {
$query = "update general set killturn='$admin[killturn]' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//태수 군사 시중 해제
switch($me[level]) {
case 4:
$query = "update city set gen1=0 where gen1='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 3:
$query = "update city set gen2=0 where gen2='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 2:
$query = "update city set gen3=0 where gen3='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
}
//등용자 명성, 공헌 상승
$query = "update general set dedication=dedication+100,experience=experience+100 where no='$you[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 처리
$query = "select no from troop where troop='$me[troop]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result);
//부대장일 경우
if($troop[no] == $me[no]) {
// 모두 탈퇴
$query = "update general set troop='0' where troop='$me[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제
$query = "delete from troop where troop='$me[troop]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update general set troop='0' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//국가 기술력 그대로
$query = "select no from general where nation='$nation[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gennum = $gencount;
if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$nation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 국가 기술력 그대로
$query = "select no from general where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$gennum = $gencount;
if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 수정
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[level] == 12) {
$mylog[count($mylog)] = "<C>●</>군주입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation[level] == 0) {
$mylog[count($mylog)] = "<C>●</>없는 국가이거나 방랑군입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation[scout] != 0) {
$mylog[count($mylog)] = "<C>●</>임관 금지중입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($admin[year] < $admin[startyear]+3) {
$mylog[count($mylog)] = "<C>●</>초반 제한중입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) {
$mylog[count($mylog)] = "<C>●</>이미 임관했었던 국가입니다. 등용 수락 불가.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$me[name]</>(이)가 등용을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$nation[name]</>(으)로 망명을 거부했습니다.";
//현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 거부',msg{$num}_type='10' where no='$me[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushAllLog($alllog);
pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-9
View File
@@ -1,9 +0,0 @@
<?php
if(!defined('ROOT')){
define('ROOT', '../..');
}
require_once(ROOT.'/f_config/config.php');
require_once(ROOT.W.F_CONFIG.W.APP.PHP);
require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
-126
View File
@@ -1,126 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbConn();
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result);
$query = "select nation,name,power,gold,rice,surlimit,history,color from nation where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result);
$query = "select nation,name,power,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result);
//아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='$you[nation]' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='$me[nation]' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄
$valid = 1;
for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='$acdip[you]' and you='$you[nation]'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult);
if($abdip[state] == 7) {
$valid = 0;
}
}
if($ok == "수락") {
// 서신 보낸 후 멸망 했을때.
if($me[level] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 투항 실패.";
} elseif($mynation[surlimit] > 0) {
$mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 투항 실패.";
} elseif($younation[surlimit] > 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 투항 실패.";
// } elseif($losecitynum == 0) {
// $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 투항 실패.";
} elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 투항 실패.";
} elseif($younation[power] / $mynation[power] <= 3) {
$mylog[count($mylog)] = "<C>●</>아국과 상대국의 국력차이가 크지 않습니다. 투항 실패.";
} elseif($losecitynum != 0 && !isClose($connect, $younation[nation], $mynation[nation])) {
$mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 투항 실패.";
} elseif($dip[state] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 투항 실패.";
} elseif($dipcount != 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 투항 실패.";
} elseif($valid == 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 투항 실패.";
} elseif($mynation[dipmsg] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else {
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(이)가 합병에 동의했습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【합병시도】</b></><D><b>$mynation[name]</b></>(와)과 <D><b>$younation[name]</b></>(이)가 합병을 시도합니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 합병에 동의했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>합병</>에 동의하였습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 합병 시도");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 합병 시도");
//외교 변경
$query = "update diplomacy set state='5',term='24' where me='$mynation[nation]' and you='$younation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='6',term='24' where me='$younation[nation]' and you='$mynation[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 합병에 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 합병에 동의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg);
}
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 항복을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(으)로 항복을 거부했습니다.";
//현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($me, $mylog);
pushGenLog($you, $youlog);
pushAllLog($alllog);
pushHistory($connect, $history);
echo "<script>location.replace('msglist.php');</script>";
-32
View File
@@ -1,32 +0,0 @@
<?php
$fp = fopen("logs/_db_bug.txt", "a");
fwrite($fp, $message."\r\n");
fclose($fp);
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>에러</title>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body>
<br><br><br><br><br>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td align=center style=background-color:225500;><font color=orange size=5>서 버 에 러</font></td></tr>
<tr>
<td>
<font color=white size=3>두가지 중 한가지 이유일 수 있습니다.<br><br>
1. 현재 서버가 처리중입니다. 몇초 후 아래 버튼을 눌러주세요.<br><br>
2. 오랫동안 이 메세지가 뜰 경우는 서버에 에러가 발생하여 잠시 중단된 상태입니다.<br>
&nbsp;&nbsp;&nbsp;운영자가 처리할 때까지 기다려주세요.</font>
</td>
</tr>
<tr><td align=center><font color=white size=3>잠시 후 아래의 버튼을 눌러주세요.</font></td></tr>
<tr><td align=center><input type=button value='몇초간 지난 후 눌러주세요' onclick=location.replace('index.php')></td></tr>
<tr><td align=center><?=$message;?></td></tr>
</table>
</body>
</html>
-246
View File
@@ -1,246 +0,0 @@
<?php
//////////////////////////장수성격//////////////////////////////////////////////
//은둔 안전 유지 재간 출세 할거 정복 패권 의협 대의 왕좌
////////////////////////////////////////////////////////////////////////
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) {
$query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]);
}
}
// 수도가 이성인경우 옆으로 이전, 또는 랜덤
$query = "select nation from nation where capital=63 or capital=64 or capital=65 or capital=66 or capital=67 or capital=68 or capital=69";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result);
$query = "select city,nation from city where nation='$nation[nation]' order by rand() limit 0,1";
$result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result2);
$query = "update nation set capital='$city[city]' where nation='$nation[nation]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
}
//이벤트1 : 이민족침범
$name = Array( "강족", "저족", "흉노족", "남만족", "산월족", "오환족", "왜족");
$cap = Array( 63, 64, 65, 66, 67, 68, 69);
$query = "select no from general where npc<5";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$eachCount = MYDB_num_rows($result);
$eachCount = round($eachCount / 7) * 2;
for($i=0; $i < 7; $i++) {
RegNation($connect, $name[$i], "800000", 999999, 999999, "중원의 부패를 물리쳐라! 이민족 침범!", 15000, $eachCount, "병가", 0);
}
//////////////////////////외교//////////////////////////////////////////////////
$query = "update game set isUnited=1";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//--------------------------------------------------------------------
for($i=0; $i < 7; $i++) {
$query = "select nation from nation where name='{$name[$i]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$nationNum[$i] = $nation[nation];
$query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation[nation]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//태수,군사,시중 해제
$query = "select gen1,gen2,gen3 from city where city='{$cap[$i]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
//태수 해제
$query = "update general set level=1 where no='{$city[gen1]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//군사 해제
$query = "update general set level=1 where no='{$city[gen2]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//시중 해제
$query = "update general set level=1 where no='{$city[gen3]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "update city set nation='$nation[nation]',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "select nation,level from nation where nation!='$nation[nation]'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($k=0; $k < $count; $k++) {
$your = MYDB_fetch_array($result);
if($your[level] > 0) {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
for($i=0; $i < 7; $i++) {
$query = "update nation set level=1 where nation='$nationNum[$i]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
}
//--------------------------------------------------------------------
//////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기
$gencount = 2001;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
//////////////////////////장수 끝///////////////////////////////////////////////
// 전장수 금쌀 999999
$query = "update general set gold=999999,rice=999999";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지의 이민족들이 <M>궐기</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>이민족의 기세는 그 누구도 막을 수 없을듯 합니다!";
pushHistory($connect, $history);
echo "<script>location.replace('./');</script>";
function RegGeneral3($connect,$turnterm,$gencount,$nation,$level,$name,$leader,$power,$intel,$personal,$special,$msg="") {
$name = "".$name;
$genid = "npc{$gencount}";
$turntime = getRandTurn2($turnterm);
$personal = CharCall($personal);
$special = SpecCall($special);
if($special >= 40) { $special2 = $special; $special = 0; }
else { $special2 = 0; }
$city = rand()%94 + 1;
$age = 15;
$specage = $age;
$specage2 = $age;
$killturn = 9999;
$experience = $age * 100;
$dedication = $age * 100;
$npc = 5;
$npcmatch = 999;
$picture = 'default.jpg';
$crew = $leader * 100;
$crewtype = rand() % 3;
$pw = md5("18071807");
//장수
@MYDB_query("
insert into general (
npcid,npc,npc_org,npcmatch,user_id,password,name,picture,nation,city,
leader,power,intel,experience,dedication,
level,gold,rice,crew,crewtype,train,atmos,tnmt,
weap,book,horse,turntime,killturn,age,belong,personal,special,specage,special2,specage2,npcmsg,
makelimit,
dex0, dex10, dex20, dex30, dex40
) values (
'$gencount','$npc','$npc','$npcmatch','$genid','$pw','$name','$picture','$nation','$city',
'$leader','$power','$intel','$experience','$dedication',
'$level','99999','99999','$crew','$crewtype','100','100','0',
'6','6','6','$turntime','$killturn','$age','1',
'$personal','$special','$specage','$special2','$specage2','$msg',
'0',
450000, 450000, 450000, 450000, 450000
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
-255
View File
@@ -1,255 +0,0 @@
<?php
//////////////////////////장수성격//////////////////////////////////////////////
//은둔 안전 유지 재간 출세 할거 정복 패권 의협 대의 왕좌
////////////////////////////////////////////////////////////////////////
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) {
$query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]);
}
}
// 수도가 이성인경우 옆으로 이전, 또는 랜덤
$query = "select nation from nation where capital=63 or capital=64 or capital=65 or capital=66 or capital=67 or capital=68 or capital=69";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result);
$query = "select city,nation from city where nation='$nation[nation]' order by rand() limit 0,1";
$result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result2);
$query = "update nation set capital='$city[city]' where nation='$nation[nation]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
}
//이벤트2 : 오랑캐궐기
$name = Array( "강족", "저족", "흉노족", "남만족", "산월족", "오환족", "왜족");
$cap = Array( 63, 64, 65, 66, 67, 68, 69);
$query = "select no from general where npc<5";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$eachCount = MYDB_num_rows($result);
$eachCount = round($eachCount / 7) * 2;
$query = "select avg(tech) as tch from nation where level>0";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$info = MYDB_fetch_array($result);
for($i=0; $i < 7; $i++) {
RegNation($connect, $name[$i], "800000", 99999, 99999, "오랑캐여 일어서라! 오랑캐 궐기!", $info[tch]+500, $eachCount, "병가", 0);
}
//////////////////////////외교//////////////////////////////////////////////////
$query = "update game set isUnited=1";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//--------------------------------------------------------------------
for($i=0; $i < 7; $i++) {
$query = "select nation from nation where name='{$name[$i]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$nationNum[$i] = $nation[nation];
$query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation[nation]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//태수,군사,시중 해제
$query = "select gen1,gen2,gen3 from city where city='{$cap[$i]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
//태수 해제
$query = "update general set level=1 where no='{$city[gen1]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//군사 해제
$query = "update general set level=1 where no='{$city[gen2]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//시중 해제
$query = "update general set level=1 where no='{$city[gen3]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "update city set nation='$nation[nation]',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "select nation,level from nation where nation!='$nation[nation]'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($k=0; $k < $count; $k++) {
$your = MYDB_fetch_array($result);
if($your[level] > 0) {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
for($i=0; $i < 7; $i++) {
$query = "update nation set level=1 where nation='$nationNum[$i]'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
}
//--------------------------------------------------------------------
//////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기
$gencount = 2001;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
//////////////////////////장수 끝///////////////////////////////////////////////
// 전장수 금쌀 999999
$query = "update general set gold=999999,rice=999999";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지의 오랑캐들이 <M>궐기</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>그러나 중원의 영웅들이라면 막아낼 수도 있을법 해 보입니다!";
pushHistory($connect, $history);
echo "<script>location.replace('./');</script>";
function RegGeneral3($connect,$turnterm,$gencount,$nation,$level,$name,$leader,$power,$intel,$personal,$special,$msg="") {
$name = "".$name;
$genid = "npc{$gencount}";
$turntime = getRandTurn2($turnterm);
$personal = CharCall($personal);
$special = SpecCall($special);
if($special >= 40) { $special2 = $special; $special = 0; }
else { $special2 = 0; }
$city = rand()%94 + 1;
$age = 15;
$specage = $age;
$specage2 = $age;
$killturn = 9999;
$experience = $age * 100;
$dedication = $age * 100;
$npc = 5;
$npcmatch = 999;
$picture = 'default.jpg';
$crew = $leader * 100;
$crewtype = rand() % 3;
$dex0 = 0;
$dex10 = 0;
$dex20 = 0;
$dex30 = 0;
$dex40 = 0;
$pw = md5("18071807");
//장수
@MYDB_query("
insert into general (
npcid,npc,npc_org,npcmatch,user_id,password,name,picture,nation,city,
leader,power,intel,experience,dedication,
level,gold,rice,crew,crewtype,train,atmos,tnmt,
weap,book,horse,turntime,killturn,age,belong,personal,special,specage,special2,specage2,npcmsg,
makelimit,
dex0, dex10, dex20, dex30, dex40
) values (
'$gencount','$npc','$npc','$npcmatch','$genid','$pw','$name','$picture','$nation','$city',
'$leader','$power','$intel','$experience','$dedication',
'$level','99999','99999','$crew','$crewtype','100','100','0',
'0','0','0','$turntime','$killturn','$age','1',
'$personal','$special','$specage','$special2','$specage2','$msg',
'0',
'$dex0', '$dex10', '$dex20', '$dex30', '$dex40'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
-116
View File
@@ -1,116 +0,0 @@
<?php
//////////////////////////장수성격//////////////////////////////////////////////
//은둔 안전 유지 재간 출세 할거 정복 패권 의협 대의 왕좌
////////////////////////////////////////////////////////////////////////
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) {
$query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]);
}
}
//이벤트3 : NPC추가
//////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기
$gencount = 2001;
for($k=1; $k <= 200; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount, 0, 0, "무명장{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
}
//////////////////////////장수 끝///////////////////////////////////////////////
//////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지에서 인재들이 <M>등장</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원 통일에 보탬이 될듯 합니다!";
pushHistory($connect, $history);
echo "<script>location.replace('./');</script>";
function RegGeneral3($connect,$turnterm,$gencount,$nation,$level,$name,$leader,$power,$intel,$personal,$special,$msg="") {
$name = "".$name;
$genid = "npc{$gencount}";
$turntime = getRandTurn($turnterm);
$personal = CharCall($personal);
$special = SpecCall($special);
if($special >= 40) { $special2 = $special; $special = 0; }
else { $special2 = 0; }
$city = rand()%94 + 1;
$age = 15;
$specage = $age;
$specage2 = $age;
$killturn = 9999;
$experience = $age * 100;
$dedication = $age * 100;
$npc = 2;
$npcmatch = rand() % 150 + 1;
$picture = 'default.jpg';
$crew = 0;
$crewtype = rand() % 3;
$dex0 = rand() % 18000;
$dex10 = rand() % 18000;
$dex20 = rand() % 18000;
$dex30 = rand() % 18000;
$dex40 = rand() % 18000;
$pw = md5("18071807");
//장수
@MYDB_query("
insert into general (
npcid,npc,npc_org,npcmatch,user_id,password,name,picture,nation,city,
leader,power,intel,experience,dedication,
level,gold,rice,crew,crewtype,train,atmos,tnmt,
weap,book,horse,turntime,killturn,age,belong,personal,special,specage,special2,specage2,npcmsg,
makelimit,
dex0, dex10, dex20, dex30, dex40
) values (
'$gencount','$npc','$npc','$npcmatch','$genid','$pw','$name','$picture','$nation','$city',
'$leader','$power','$intel','$experience','$dedication',
'$level','1000','1000','$crew','$crewtype','100','100','0',
'0','0','0','$turntime','$killturn','$age','1',
'$personal','$special','$specage','$special2','$specage2','$msg',
'0',
'$dex0', '$dex10', '$dex20', '$dex30', '$dex40'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
-145
View File
@@ -1,145 +0,0 @@
<?php
//////////////////////////장수성격//////////////////////////////////////////////
//은둔 안전 유지 재간 출세 할거 정복 패권 의협 대의 왕좌
////////////////////////////////////////////////////////////////////////
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[userlevel] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
관리자가 아닙니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
//중복체크
$query = "select no from general where user_id='jwh1807'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($general[no] > 0) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
</head>
<body oncontextmenu='return false'>
이미 있습니다.<br>
";
banner();
echo "
</body>
</html>";
exit();
}
$query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select round(avg(specage)) as specage,round(avg(specage2)) as specage2 from general where npc<2";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//이벤트4 : 유기체 추가
//////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기
$gencount = 2000;
$personal = rand()%10;
$personal = getGenChar($personal);
$leader = 65 + rand()%11;
if(rand()%2 == 0) {
$intel = 10 + rand()%6;
$power = 150 - $leader - $intel;
} else {
$power= 10 + rand()%6;
$intel = 150 - $leader - $power;
}
RegGeneral4($connect,$admin[turnterm],$gencount, 0, 0, "유기체", $leader, $power, $intel, $personal, $general[specage], $general[specage2], "흠... 그럼 어쩔 수 없이 흉노로 가야겠군요."); $gencount++;
//////////////////////////장수 끝///////////////////////////////////////////////
//////////////////////////이벤트///////////////////////////////////////////////
$log[0] = "<C>●</>{$admin[month]}월:<Y>ⓝ유기체</>가 천하에 이름을 알립니다.";
pushAllLog($log);
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>NPC 유기체가 등장합니다. 의병장과 NPC들의 지능 개선을 위해 NPC 두뇌를 체험합니다. 크게 신경쓰진 마세요.";
pushHistory($connect, $history);
echo "<script>location.replace('./');</script>";
function RegGeneral4($connect,$turnterm,$gencount,$nation,$level,$name,$leader,$power,$intel,$personal,$specage,$specage2,$msg="") {
$name = "".$name;
$genid = "jwh1807";
$turntime = getRandTurn($turnterm);
$personal = CharCall($personal);
$city = rand()%94 + 1;
$age = 20;
//전특
$special2 = 0;
//내특
$special = 0;
$killturn = 720;
$experience = 0;
$dedication = 0;
$npc = 3;
$npcmatch = rand() % 150 + 1;
$picture = 'pic_3.jpg';
$crew = 0;
$crewtype = rand() % 3;
$dex0 = 0;
$dex10 = 0;
$dex20 = 0;
$dex30 = 0;
$dex40 = 0;
$pw = md5("18071807");
//장수
@MYDB_query("
insert into general (
npcid,npc,npc_org,npcmatch,user_id,password,name,picture,nation,city,
leader,power,intel,experience,dedication,
level,gold,rice,crew,crewtype,train,atmos,
weap,book,horse,turntime,killturn,age,belong,personal,special,specage,special2,specage2,npcmsg,
makelimit,
dex0, dex10, dex20, dex30, dex40
) values (
'$gencount','$npc','$npc','$npcmatch','$genid','$pw','$name','$picture','$nation','$city',
'$leader','$power','$intel','$experience','$dedication',
'$level','1000','1000','$crew','$crewtype','100','100',
'0','0','0','$turntime','$killturn','$age','1',
'$personal','$special','$specage','$special2','$specage2','$msg',
'0',
'$dex0', '$dex10', '$dex20', '$dex30', '$dex40'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
-7421
View File
File diff suppressed because it is too large Load Diff
-347
View File
@@ -1,347 +0,0 @@
<?php
function GetStuffName($stuff) {
$type1 = $stuff % 10;
$type2 = floor($stuff / 10);
switch($type1) {
case 0: $str = ""; break;
case 1: $str = getWeapName($type2); break;
case 2: $str = getBookName($type2); break;
case 3: $str = getHorseName($type2); break;
case 4: $str = getItemName($type2); break;
default:$str = "?"; break;
}
return $str;
}
function registerAuction($connect) {
$query = "select startyear,year,month,turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
switch($admin[turnterm]) {
case 0: $unit = 7200; break;
case 1: $unit = 3600; break;
case 2: $unit = 1800; break;
case 3: $unit = 1200; break;
case 4: $unit = 600; break;
case 5: $unit = 300; break;
case 6: $unit = 120; break;
case 7: $unit = 60; break;
}
// 장수들 평금,평쌀
$query = "select avg(gold) as gold, avg(rice) as rice,max(gold) as maxgold from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($general[gold] < 1000) { $general[gold] = 1000; }
if($general[gold] > 20000) { $general[gold] = 20000; }
if($general[rice] < 1000) { $general[rice] = 1000; }
if($general[rice] > 20000) { $general[rice] = 20000; }
/*
// 유닉템 등록
$query = "select * from auction where stuff!='0'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
// 유닉템 거래가 없을 경우 1% 확률로 등장
if($count == 0 && rand()%100 < 1) {
// 유닉템 선택
$sel = rand() % 4 + 1;
switch($sel) {
case 1: $type = "weap"; break;
case 2: $type = "book"; break;
case 3: $type = "horse"; break;
case 4: $type = "item"; break;
}
$query = "select no,{$type} from general where {$type}>6";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
if($count < 20) {
for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$occupied[$gen[$type]] = 1;
}
for($i=7; $i <= 26; $i++) {
if($occupied[$i] == 0) {
$item[count($item)] = $i;
}
}
$it = $item[rand() % count($item)];
$stuff = $it * 10 + $sel;
//평균 금의 100%
$amount = 1;
$cost = $general[gold];
$topv = $general[maxgold] * 10;
if($cost < 5000) { $cost = 5000; }
if($topv < 10000) { $topv = 10000; }
$cost = round($cost / 10) * 10;
$topv = round($topv / 10) * 10;
$term = 12;
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ암시장상인', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[0] = "<C>●</>{$admin[month]}월:<C>".GetStuffName($stuff)."</>(이)가 거래장에 등장했습니다!";
$history[0] = "<C>●</>$admin[year]년 $admin[month]월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>(이)가 <C>".GetStuffName($stuff)."</>(을)를 판다는 소문이 돌고 있습니다!";
pushAllLog($alllog);
pushHistory($connect, $history);
}
}
*/
$query = "select * from auction where type='0' and stuff='0' and no1='0'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$count += 5;
// 판매건 등록
if(rand()%$count == 0) {
//평균 쌀의 5% ~ 25%
$mul = rand() % 5 + 1;
$amount = $general[rice] / 20 * $mul;
$cost = $general[gold] / 20 * 0.9 * $mul;
$topv = $amount * 2;
if($cost <= $amount*0.8) { $cost = $amount*0.8; }
if($cost >= $amount*1.2) { $cost = $amount*1.2; }
$amount = round($amount / 10) * 10;
$cost = round($cost / 10) * 10;
$topv = round($topv / 10) * 10;
$term = 3 + rand() % 10;
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ상인', '0', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select * from auction where type='1' and stuff='0' and no1='0'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$count += 5;
// 구매건 등록
if(rand()%$count == 0) {
//평균 쌀의 5% ~ 25%
$mul = rand() % 5 + 1;
$amount = $general[rice] / 20 * $mul;
$cost = $general[gold] / 20 * 1.1 * $mul;
$topv = $amount * 0.5;
if($cost <= $amount*0.8) { $cost = $amount*0.8; }
if($cost >= $amount*1.2) { $cost = $amount*1.2; }
$amount = round($amount / 10) * 10;
$cost = round($cost / 10) * 10;
$topv = round($topv / 10) * 10;
$term = 3 + rand() % 10;
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '0', 'ⓝ상인', '0', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
function processAuction($connect) {
$date = date("Y-m-d H:i:s");
$query = "select year,month from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select * from auction where expire<='$date'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count2 = MYDB_num_rows($result2);
for($i=0; $i < $count2; $i++) {
$auction = MYDB_fetch_array($result2);
// 유닉템 처리
if($auction[stuff] != 0) {
if($auction[no2] == 0) {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, 그러나 입찰자 부재";
pushAuctionLog($connect, $auctionLog);
} else {
$trader[no] = 0;
$trader[name] = 'ⓝ암시장상인';
$trader[gold] = 99999999;
$trader[rice] = 99999999;
$query = "select no,name,gold,rice from general where no='$auction[no2]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidder = MYDB_fetch_array($result);
$sel1 = $auction[stuff] % 10;
$sel2 = floor($auction[stuff] / 10);
switch($sel1) {
case 1: $type = "weap"; break;
case 2: $type = "book"; break;
case 3: $type = "horse"; break;
case 4: $type = "item"; break;
}
// 이미 유닉템이 풀렸는지 검사
$query = "select no from general where {$type}='$sel2'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
// 판매거래만 존재
if($count > 0) {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 아이템 이미 매진!";
} elseif($auction[value] > $bidder[gold] - 1000) {
$gold = round($auction[value] * 0.01);
$bidder[gold] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 <C>".GetStuffName($auction[stuff])."</> 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 <C>".GetStuffName($auction[stuff])."</> 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
} else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, <C>".GetStuffName($auction[stuff])."</> 구입!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 구매";
$auctionLog[0] .= " <M>★ 아이템 거래 ★</>";
$query = "update general set gold=gold-'$auction[value]',{$type}='$sel2' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[0] = "<C>●</>{$admin[month]}월:<Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 구매했습니다!";
$history[0] = "<C>●</>$admin[year]$admin[month]월:<C><b>【암시장】</b></><Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 구매했습니다!";
pushAllLog($alllog);
pushHistory($connect, $history);
}
pushGenLog($trader, $traderLog);
pushGenLog($bidder, $bidderLog);
pushAuctionLog($connect, $auctionLog);
}
} else {
// 쌀 처리
if($auction[no2] == 0) {
// 상인건수가 아닌것만 출력
if($auction[no1] != 0) {
$query = "select no from general where no='$auction[no1]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$trader = MYDB_fetch_array($result);
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction[no]}번 거래 <M>유찰</>!";
if($auction[type] == 0) {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, 그러나 입찰자 부재";
} else {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, 그러나 입찰자 부재";
}
pushGenLog($trader, $traderLog);
pushAuctionLog($connect, $auctionLog);
}
} else {
if($auction[no1] == 0) {
$trader[no] = 0;
$trader[name] = 'ⓝ상인';
$trader[gold] = 99999;
$trader[rice] = 99999;
} else {
$query = "select no,name,gold,rice from general where no='$auction[no1]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$trader = MYDB_fetch_array($result);
}
$query = "select no,name,gold,rice from general where no='$auction[no2]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidder = MYDB_fetch_array($result);
//판매거래
if($auction[type] == 0) {
if($auction[amount] > $trader[rice] - 1000) {
$gold = round($auction[value] * 0.01);
$trader[gold] -= $gold;
if($trader[gold] < 0) $trader[gold] = 0;
$query = "update general set gold='$trader[gold]' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
} elseif($auction[value] > $bidder[gold] - 1000) {
$gold = round($auction[value] * 0.01);
$bidder[gold] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
} else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 쌀 <C>{$auction[amount]}</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, 쌀 <C>{$auction[amount]}</>(을)를 구입!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 구매";
if($auction[value] >= $auction[amount] * 2) {
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
} elseif($auction[value] >= $auction[topv]) {
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
} elseif($auction[value] * 2 <= $auction[amount]) {
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
}
$query = "update general set gold=gold+'$auction[value]',rice=rice-'$auction[amount]' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set gold=gold-'$auction[value]',rice=rice+'$auction[amount]' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($trader, $traderLog);
pushGenLog($bidder, $bidderLog);
pushAuctionLog($connect, $auctionLog);
//구매거래
} else {
if($auction[amount] > $bidder[rice] - 1000) {
$gold = round($auction[value] * 0.01);
$bidder[gold] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
} elseif($auction[value] > $trader[gold] - 1000) {
$gold = round($auction[value] * 0.01);
$trader[gold] -= $gold;
if($trader[gold] < 0) $trader[gold] = 0;
$query = "update general set gold='$trader[gold]' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
} else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, 쌀 <C>{$auction[amount]}</>(을)를 구입!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 쌀 <C>{$auction[amount]}</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 판매";
if($auction[value] >= $auction[amount] * 2) {
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
} elseif($auction[value] * 2 <= $auction[amount]) {
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
} elseif($auction[value] <= $auction[topv]) {
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
}
$query = "update general set gold=gold-'$auction[value]',rice=rice+'$auction[amount]' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set gold=gold+'$auction[value]',rice=rice-'$auction[amount]' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
pushGenLog($trader, $traderLog);
pushGenLog($bidder, $bidderLog);
pushAuctionLog($connect, $auctionLog);
}
}
}
}
$query = "delete from auction where expire<='$date'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
-130
View File
@@ -1,130 +0,0 @@
<?php
include "func_http.php";
function getHistory($count, $year, $month, $isFirst=0) {
$fp = @fopen("logs/_history.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@fclose($fp);
$log = explode("\r\n",$file);
$str = "";
$prefix = "</>{$year}{$month}월:";
for($i=0; $i < $count; $i++) {
$line = $log[count($log)-2-$i];
if($line == "") {
continue;
}
if(strpos($line, $prefix) || $isFirst == 1) {
$str = ConvertLog($line).'<br>'.$str;
} else {
break;
}
}
if($str == "") {
$str = "<C>●</>{$year}{$month}월: 기록 없음";
$str = ConvertLog($str);
}
return $str;
}
function getGenHistory($count, $year, $month, $isFirst=0) {
$fp = @fopen("logs/_alllog.txt", "r");
@fseek($fp, -$count*300, SEEK_END);
$file = @fread($fp, $count*300);
@fclose($fp);
$log = explode("\r\n",$file);
$str = "";
$prefix = "</>{$month}월:";
$year -= 1;
$prefixYear = "</>{$month}월:<C>{$year}</>";
for($i=0; $i < $count; $i++) {
$line = $log[count($log)-2-$i];
if($line == "") {
continue;
}
if(strpos($line, $prefixYear)) {
break;
} elseif(strpos($line, $prefix) || $isFirst == 1) {
$str = ConvertLog($line).'<br>'.$str;
} else {
break;
}
}
if($str == "") {
$str = "<C>●</>{$month}월: 기록 없음";
$str = ConvertLog($str);
}
return $str;
}
function LogHistory($connect, $isFirst=0) {
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', LogHistory Start');
$query = "select startyear,year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
if($isFirst == 1) {
$admin['year'] -= 1;
$admin['month'] = 12;
}
$file = explode('/', __FILE__);
$url = '/'.$file[count($file)-3].'/'.$file[count($file)-2].'/map.php?type=2&graphic=0';
/* 소켓 통신을 통하여 필요한 html정보를 가져옴 */
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', Start HTTP');
$http = new HTTP("62che.com", 80, 10);
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', Connect end, '.$http->GetError());
if($http->GetErr() == true) { return false; }
$http->setHttpVersion("1.1");
$cookie = "";
$http->Get($url, $cookie);
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', Response end, '.$http->GetError());
if($http->GetErr() == true) { return false; }
$map = $http->Response["body"];
$map = str_replace("'", '<_quot_>', $map);
$map = str_replace('"', '<_dquot_>', $map);
$http->Close();
if($http->GetErr() == true) { return false; }
$log = getHistory(20, $admin['year'], $admin['month'], $isFirst);
$genlog = getGenHistory(50, $admin['year'], $admin['month'], $isFirst);
$query = "select nation,color,name,power,gennum from nation where level>0 order by power desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($result);
$nationStr = "";
$powerStr = "";
$genStr = "";
$cityStr = "";
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result);
$query = "select city from city where nation='$nation[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation[color]).";background-color:$nation[color];>$nation[name]</font><br>";
$powerStr .= "국력 $nation[power]<br>";
$genStr .= "장수 $nation[gennum]<br>";
$cityStr .= "속령 $citycount<br>";
}
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', contents collected');
@MYDB_query("
insert into history (
year, month, map, log, genlog, nation, power, gen, city
) values (
'$admin[year]', '$admin[month]', '$map', '$log', '$genlog', '$nationStr', '$powerStr', '$genStr', '$cityStr'
)",
$connect) or Error(__LINE__.MYDB_error($connect),"");
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', LogHistory Finish');
return true;
}
-287
View File
@@ -1,287 +0,0 @@
<?php
class HTTP{
var $Socket, $Server, $Port, $Timeout, $HttpVersion = "1.0", $Url, $Length, $ResponseTime, $ErrNum, $ErrMsg;
var $headers = array();
var $Response = array();
var $Err = false;
var $_chunkedLength =0;
function HTTP($Server, $Port = 80, $Timeout = 30){
$this->Server = $Server;
$this->Port = $Port;
$this->Timeout = $Timeout;
$this->Socket = @fsockopen ($this->Server, $this->Port, $errno, $errstr, $this->Timeout);
if(!$this->Socket){
$this->Error(0, "Socket Connection Fail");
}
}
function setTimeout($Timeout){
$this->Timeout = $Timeout;
}
function setHttpVersion($HttpVersion){
$this->HttpVersion = $HttpVersion;
}
function Head($Url = "/") {
$this->Url = $Url;
$msg = sprintf("HEAD %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
return $this->Read();
}
function isHead($Url = "/"){
$this->Url = $Url;
$msg = sprintf("HEAD %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
if($Cookie != ""){
$msg .= $this->PutCookie($Cookie);
}
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
return $this->isOK();
}
function GetHead($Url = "/") {
$this->Url = $Url;
$msg = sprintf("GET %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
$out = $this->ReadHeader();
return $out;
}
function Get($Url = "/", $Cookie="") {
$this->Url = $Url;
$msg = sprintf("GET %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
if($Cookie != ""){
$msg .= $this->PutCookie($Cookie);
}
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
return $this->Read();
}
function isGet($Url = "/", $Cookie=""){
$this->Url = $Url;
$msg = sprintf("GET %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
if($Cookie != ""){
$msg .= $this->PutCookie($Cookie);
}
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
return $this->isOK();
}
function isGetAll($Url = "/", $Cookie=""){
$this->Url = $Url;
$msg = sprintf("GET %s HTTP/%s\r\n", $this->Url, $this->HttpVersion);
if($Cookie != ""){
$msg .= $this->PutCookie($Cookie);
}
$msg .= $this->PutHead();
$msg .= "\n\n";
fputs($this->Socket, $msg);
$data = $this->Read();
$this->Length = strlen($data);
return $this->isOK($data);
}
function Post($Url, $Data, $Cookie = ""){
$this->Url = $Url;
fputs ($this->Socket,sprintf("POST %s HTTP/%s\r\n", $this->Url, $this->HttpVersion));
if($Cookie != ""){
$this->PutCookie($Cookie);
}
$this->PutHead();
fputs ($this->Socket, "Content-type: application/x-www-form-urlencoded\r\n");
$out = "";
while (list ($k, $v) = each ($Data)) {
if(strlen($out) != 0) $out .= "&";
$out .= rawurlencode($k). "=" .rawurlencode($v);
}
fputs ($this->Socket, "Content-length: ".strlen($out)."\n\n");
fputs ($this->Socket, "$out");
fputs ($this->Socket, "\n");
return $this->Read();
}
function IsPost($Url, $Data, $Cookie = ""){
$this->Url = $Url;
fputs ($this->Socket,sprintf("POST %s HTTP/%s\r\n", $this->Url, $this->HttpVersion));
if($Cookie != ""){
$this->PutCookie($Cookie);
}
$this->PutHead();
fputs ($this->Socket, "Content-type: application/x-www-form-urlencoded\r\n");
$out = "";
while (list ($k, $v) = each ($Data)) {
if(strlen($out) != 0) $out .= "&";
$out .= rawurlencode($k). "=" .rawurlencode($v);
}
fputs ($this->Socket, "Content-length: ".strlen($out)."\n\n");
fputs ($this->Socket, "$out");
fputs ($this->Socket, "\n");
return $this->isOk();
}
function PutHead(){
$msg = "";
$msg .= "Accept: */*\r\n";
$msg .= "Accept-Language: ko\r\n";
$msg .= "Accept-Encoding: gzip, deflate\r\n";
$msg .= "User-Agent: Mozilla/4.0 (compatible; 62che)\r\n";
while (list($name, $value) = each ($this->headers)) {
$msg .= "$name: $value\r\n";
}
$msg .= "Host: ".$this->Server.":".$this->Port."\r\n";
$msg .= "Connection: close\r\n";
return $msg;
}
function AddHeader($name, $value){
$this->headers[$name] = $value;
}
function PutCookie($cookie){
$msg = "";
if(is_array($cookie)){
$out = "";
while (list ($k, $v) = each ($cookie)) {
if(strlen($out) != 0) $out .= ";";
$out .= rawurlencode($k). "=" .rawurlencode($v);
}
$msg = "Cookie: $out\n";
} else {
$msg = "Cookie: $cookie\n";
}
return $msg;
}
function Read(){
$out = $this->ReadHeader();
$chunked = isset($this->Response['transfer-encoding']) && ('chunked' == $this->Response['transfer-encoding']);
$gzipped = isset($this->Response['content-encoding']) && ('gzip' == $this->Response['content-encoding']);
$body = '';
while(!feof($this->Socket)){
if ($chunked) {
$buf = $this->_readChunked();
} else {
$buf = fread($this->Socket, 4096);
}
$body .= $buf;
}
if($gzipped){
$body = gzinflate(substr($body, 10));
}
$this->Response['body'] = $body;
$out .= $body;
return $out;
}
function ReadHeader(){
$out = '';
$buf = $this->_readLine();
if (sscanf($buf, 'HTTP/%s %s', $http_version, $returncode) != 2) {
$this->Error(0,"Malformed response");
return false;
} else {
$this->Response["protocol"] = 'HTTP/' . $http_version;
$this->Response["code"] = intval($returncode);
}
$out .= $buf;
while(!feof($this->Socket)){
$buf = $this->_readLine();
$out .= $buf;
if($buf == "\n" || $buf == "\r\n"){
break;
}
list($name,$value) = split(":",rtrim($buf,"\r\n"),2);
$this->Response[strtolower($name)] = trim($value);
}
$this->Response["header"] = $out;
return $out;
}
function isOk($buffer = ""){
if($buffer == "") $buffer .= fgets($this->Socket, 128);
if(preg_match('/^HTTP\/.* (2\d{2}|3\d{2}).*/', $buffer)){
return true;
}
return false;
}
function _readLine(){
$line = '';
while(!feof($this->Socket)){
$line .= fgets($this->Socket, 4096);
if (substr($line, -2) == "\r\n" || substr($line, -1) == "\n") {
return $line;
}
}
return $line;
}
function _readAll(){
$data = '';
while(!feof($this->Socket)){
$data .= fread($this->Socket, 4096);
}
return $data;
}
function _readChunked(){
// at start of the next chunk?
if (0 == $this->_chunkLength) {
$line = $this->_readLine();
if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) {
$this->_chunkLength = hexdec($matches[1]);
// Chunk with zero length indicates the end
if (0 == $this->_chunkLength) {
$this->_readAll(); // make this an eof()
return '';
}
}
}
$data = fread($this->Socket, $this->_chunkLength);
$this->_chunkLength -= strlen($data);
if (0 == $this->_chunkLength) {
$this->_readLine(); // Trailing CRLF
}
return $data;
}
function Close(){
fclose($this->Socket);
}
function Error($errnum, $errmsg){
$this->Err = true;
$this->ErrNum = $errnum;
$this->ErrMsg = $errmsg;
}
function GetErr() {
return $this->Err;
}
function GetError() {
if($this->Err == true) {
return "{$this->ErrNum}, {$this->ErrMsg}";
} else {
return "No Err";
}
}
}
-6147
View File
File diff suppressed because it is too large Load Diff
-303
View File
@@ -1,303 +0,0 @@
<?php
function getFont($str) {
if(strlen($str) >= 22) { $str = "<font size=1>{$str}</font>"; }
return $str;
}
function unfont($str) {
$str = str_replace("<font color=cyan>", "", $str);
$str = str_replace("<font color=limegreen>", "", $str);
$str = str_replace("<font color=magenta>", "", $str);
$str = str_replace("<font color=red>", "", $str);
$str = str_replace("</font>", "", $str);
return $str;
}
function SQ2DQ($str) {
return str_replace("'", "&#039;", $str);
}
function Tag2Code($str) {
// return htmlspecialchars(nl2br(str_replace(" ", "&nbsp;", $str)));
// $str = str_replace("&", "&amp;", $str);
$str = str_replace("'", "&#039;", $str);
$str = str_replace("\"", "&quot;", $str);
$str = str_replace("<", "&lt", $str);
$str = str_replace(">", "&gt", $str);
// $str = str_replace(" ", "&nbsp;", $str);
// return htmlspecialchars(nl2br($str));
return nl2br($str);
}
function BadTag2Code($str) {
$str = str_replace("<script", "<sorry", $str);
$str = str_replace("<embed", "<sorry", $str);
return $str;
}
function tab($str, $maxsize, $ch) {
$size = strlen($str);
$count = ($maxsize - $size) / 2;
for($i=0; $i < $count; $i++) {
$string = "$string" . $ch;
}
$string = "$string" . "$str";
for($i=0; $i < $count; $i++) {
$string = "$string" . $ch;
}
return $string;
}
function tab2($str, $maxsize, $ch) {
$size = strlen($str);
$count = ($maxsize - $size);
for($i=0; $i < $count; $i++) {
$string = "$string" . $ch;
}
$string = "$string" . "$str";
return $string;
}
class _String {
public static function GetStrLen($str) {
$count = strlen($str);
$len = 0;
for($i=0; $i < $count; ) {
$code = ord($str[$i]);
if($code >= 0xf0) {
$len++;
$i += 4;
} elseif($code >= 0xe0) {
$len++;
$i += 3;
} elseif($code >= 0xc2) {
$len++;
$i += 2;
} else {
$len++;
$i += 1;
}
}
return $len;
}
public static function SubStr($str, $s, $l=1000) {
$count = strlen($str);
$startByte = 0; $isSet = 0;
$endByte = $count;
$len = 0;
for($i=0; $i < $count; ) {
$code = ord($str[$i]);
if($isSet == 0 && $len >= $s) {
$startByte = $i; $isSet = 1;
}
if($isSet == 1 && $len-$s >= $l) {
$endByte = $i;
break;
}
if($code >= 0xf0) {
$len++;
$i += 4;
} elseif($code >= 0xe0) {
$len++;
$i += 3;
} elseif($code >= 0xc2) {
$len++;
$i += 2;
} else {
$len++;
$i += 1;
}
}
$str = substr($str, $startByte, $endByte-$startByte);
return $str;
}
public static function SubStrForWidth($str, $s, $w) {
$count = strlen($str);
$startByte = 0; $isSet = 0;
$endByte = $count; $last = 0;
$len = 0;
$width = 0;
for($i=0; $i < $count; ) {
$code = ord($str[$i]);
if($isSet == 0 && $len >= $s) {
$startByte = $i; $isSet = 1;
$width = 0;
}
if($isSet == 1 && $width == $w) {
$endByte = $i;
break;
}
if($isSet == 1 && $width > $w) {
$endByte = $i - $last;
break;
}
if($code >= 0xf0) {
$len++;
$width += 2;
$last = 4;
$i += 4;
} elseif($code >= 0xe0) {
$len++;
$width += 2;
$last = 3;
$i += 3;
} elseif($code >= 0xc2) {
$len++;
$width += 2;
$last = 2;
$i += 2;
} else {
$len++;
$width += 1;
$last = 1;
$i += 1;
}
}
$str = substr($str, $startByte, $endByte-$startByte);
return $str;
}
public static function CutStrForWidth($str, $s, $w, $ch='..') {
$isCut = 0;
$count = strlen($str);
$startByte = 0; $isSet = 0;
$endByte = $count; $last = 0;
$len = 0;
$width = 0;
for($i=0; $i < $count; ) {
$code = ord($str[$i]);
if($isSet == 0 && $len >= $s) {
$startByte = $i; $isSet = 1;
$width = 0;
}
if($isSet == 1 && $width >= $w) {
$endByte = $i - $last;
$isCut = 1;
break;
}
if($code >= 0xf0) {
$len++;
$width += 2;
$last = 4;
$i += 4;
} elseif($code >= 0xe0) {
$len++;
$width += 2;
$last = 3;
$i += 3;
} elseif($code >= 0xc2) {
$len++;
$width += 2;
$last = 2;
$i += 2;
} else {
$len++;
$width += 1;
$last = 1;
$i += 1;
}
}
if($isCut != 0) {
$str = substr($str, $startByte, $endByte-$startByte) . $ch;
}
return $str;
}
//중간정렬
public static function staticFill($str, $maxsize, $ch) {
$size = strlen($str);
$count = ($maxsize - $size) / 2;
for($i=0; $i < $count; $i++) {
$string = $string.$ch;
}
$string = $string.$str;
for($i=0; $i < $count; $i++) {
$string = $string.$ch;
}
return $string;
}
//우측정렬
public static function Fill2($str, $maxsize, $ch='0') {
$size = strlen($str);
$count = ($maxsize - $size);
$string = '';
for($i=0; $i < $count; $i++) {
$string = $string.$ch;
}
$string = $string.$str;
return $string;
}
public static function EscapeTag($str) {
$str = htmlspecialchars($str);
$str = str_replace("\r\n", "<br>", $str);
$str = str_replace("\n", "<br>", $str);
// return nl2br(htmlspecialchars($str));
// return htmlspecialchars($str);
return $str;
}
public static function NoSpecialCharacter($str) {
$str = str_replace(" ", "", $str);
$str = str_replace("\"", "", $str);
$str = str_replace("'", "", $str);
$str = str_replace("", "", $str);
$str = str_replace("", "", $str);
$str = str_replace("", "", $str);
$str = str_replace("\\", "", $str);
$str = str_replace("/", "", $str);
$str = str_replace("`", "", $str);
$str = str_replace("-", "", $str);
$str = str_replace("=", "", $str);
$str = str_replace("[", "", $str);
$str = str_replace("]", "", $str);
$str = str_replace(";", "", $str);
$str = str_replace(",", "", $str);
$str = str_replace(".", "", $str);
$str = str_replace("~", "", $str);
$str = str_replace("!", "", $str);
$str = str_replace("@", "", $str);
$str = str_replace("#", "", $str);
$str = str_replace("$", "", $str);
$str = str_replace("%", "", $str);
$str = str_replace("^", "", $str);
$str = str_replace("&", "", $str);
$str = str_replace("*", "", $str);
$str = str_replace("(", "", $str);
$str = str_replace(")", "", $str);
$str = str_replace("_", "", $str);
$str = str_replace("+", "", $str);
$str = str_replace("|", "", $str);
$str = str_replace("{", "", $str);
$str = str_replace("}", "", $str);
$str = str_replace(":", "", $str);
$str = str_replace("", "", $str);
$str = str_replace("<", "", $str);
$str = str_replace(">", "", $str);
$str = str_replace("?", "", $str);
$str = str_replace(" ", "", $str);
return $str;
}
}
-991
View File
@@ -1,991 +0,0 @@
<?php
function processTournament($connect) {
$query = "select tournament,phase,tnmt_type,tnmt_auto,tnmt_time,now() as now,TIMESTAMPDIFF(SECOND,tnmt_time,now()) as offset from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
//수동일땐 무시
if($admin[tnmt_auto] == 0) { return; }
$type = $admin[tnmt_type];
$tnmt = $admin[tournament];
$phase = $admin[phase];
//현시간이 스탬프 지나친경우
if($admin[offset] >= 0) {
switch($admin[tnmt_auto]) {
case 1: $unit = 720; break;
case 2: $unit = 420; break;
case 3: $unit = 180; break;
case 4: $unit = 60; break;
case 5: $unit = 30; break;
case 6: $unit = 15; break;
case 7: $unit = 5; break;
}
//업데이트 횟수
$iter = floor($admin[offset] / $unit) + 1;
for($i=0; $i < $iter; $i++) {
switch($tnmt) {
case 1: //신청 마감
fillLowGenAll($connect);
$tnmt = 2; $phase = 0;
break;
case 2: //예선중
qualify($connect, $type, $tnmt, $phase); $phase++;
if($phase >= 56) { $tnmt = 3; $phase = 0; }
break;
case 3: //추첨중
selectionAll($connect, $type, $tnmt, $phase); $phase+=8;
if($phase >= 32) { $tnmt = 4; $phase = 0; }
break;
case 4: //본선중
finallySingle($connect, $type, $tnmt, $phase); $phase++;
if($phase >= 6) { $tnmt = 5; $phase = 0; }
break;
case 5: //배정중
final16set($connect);
$tnmt = 6; $phase = 0;
break;
case 6: //베팅중
$tnmt = 7; $phase = 0;
break;
case 7: //16강중
finalFight($connect, $type, $tnmt, $phase, 16); $phase++;
if($phase >= 8) { $tnmt = 8; $phase = 0; }
break;
case 8: //8강중
finalFight($connect, $type, $tnmt, $phase, 8); $phase++;
if($phase >= 4) { $tnmt = 9; $phase = 0; }
break;
case 9: //4강중
finalFight($connect, $type, $tnmt, $phase, 4); $phase++;
if($phase >= 2) { $tnmt = 10; $phase = 0; }
break;
case 10: //결승중
finalFight($connect, $type, $tnmt, $phase, 2);
$tnmt = 0; $phase = 0;
setGift($connect, $type, $tnmt, $phase);
$i = $iter;
break;
}
//베팅은 무조건 60페이즈후 진행(최대 1시간)
if($tnmt == 6) {
$betTerm = $unit * 60;
if($betTerm > 3600) { $betTerm = 3600; }
//처리 초 더한 날짜
$dt = date("Y-m-d H:i:s", strtotime($admin[tnmt_time]) + $unit * $i + $betTerm);
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
return;
}
if($admin[tnmt_auto] == 1) {
//처리 초 더한 날짜
$dt = date("Y-m-d H:i:s", strtotime($admin[tnmt_time]) + $unit * $i);
$hr = substr($dt, 11, 2);
//지정시간대 넘어가면 중단 20~24시
if($hr < 20) {
$dt = substr($dt, 0, 11)."20:00:00";
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
return;
}
}
}
$second = $unit * $iter;
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time=DATE_ADD(tnmt_time, INTERVAL {$second} SECOND) where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
function getTournamentTerm($connect) {
$query = "select tnmt_auto from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
switch($admin[tnmt_auto]) {
case 1: $str = "경기당 12분"; break;
case 2: $str = "경기당 7분"; break;
case 3: $str = "경기당 3분"; break;
case 4: $str = "경기당 1분"; break;
case 5: $str = "경기당 30초"; break;
case 6: $str = "경기당 15초"; break;
case 7: $str = "경기당 5초"; break;
}
return $str;
}
function getTournamentTime($connect) {
$query = "select tournament,tnmt_time from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$tnmt = $admin[tournament];
$dt = substr($admin[tnmt_time], 11, 5);
switch($tnmt) {
case 1: $tnmt = "개막시간 {$dt}"; break;
case 2: $tnmt = "다음경기 {$dt}"; break;
case 3: $tnmt = "다음추첨 {$dt}"; break;
case 4: $tnmt = "다음경기 {$dt}"; break;
case 5: $tnmt = "16강배정 {$dt}"; break;
case 6: $tnmt = "베팅마감 {$dt}"; break;
case 7: case 8: case 9: case 10:
$tnmt = "다음경기 {$dt}"; break;
default: $tnmt = ""; break;
}
return $tnmt;
}
function getTournament($tnmt) {
switch($tnmt) {
case 0: $tnmt = "<font color=magenta>경기 없음</font>"; break;
case 1: $tnmt = "<font color=orange>참가 모집중</font>"; break;
case 2: $tnmt = "<font color=orange>예선 진행중</font>"; break;
case 3: $tnmt = "<font color=orange>본선 추첨중</font>"; break;
case 4: $tnmt = "<font color=orange>본선 진행중</font>"; break;
case 5: $tnmt = "<font color=orange>16강 배정중</font>"; break;
case 6: $tnmt = "<font color=orange>베팅 진행중</font>"; break;
case 7: $tnmt = "<font color=orange>16강 진행중</font>"; break;
case 8: $tnmt = "<font color=orange>8강 진행중</font>"; break;
case 9: $tnmt = "<font color=orange>4강 진행중</font>"; break;
case 10: $tnmt = "<font color=orange>결승 진행중</font>"; break;
}
return $tnmt;
}
function printRow($k, $npc, $name, $abil, $game, $win, $draw, $lose, $gd, $gl, $prmt) {
if($prmt > 0) { $name = "<font color=orange>".$name."</font>"; }
elseif($npc >= 2) { $name = "<font color=cyan>".$name."</font>"; }
elseif($npc == 1) { $name = "<font color=skyblue>".$name."</font>"; }
echo "<tr align=center><td id=bg2>$k</td><td>$name</td><td>$abil</td><td>$game</td><td>$win</td><td>$draw</td><td>$lose</td><td>$gd</td><td>$gl</td></tr>";
}
function printFightLog($group) {
$fp = @fopen("logs/fight{$group}.txt", "r");
$file = @fread($fp, 3000);
@fclose($fp);
$log = explode("\r\n", $file);
$str = "";
for($i=0; $i < count($log); $i++) { $str .= ConvertLog($log[$i], 1)."<br>"; }
return substr($str, 0, -4);
}
function pushFightLog($group, $log) {
$fp = fopen("logs/fight{$group}.txt", "w");
$size = count($log);
for($i=0; $i < $size; $i++) {
fwrite($fp, $log[$i]."\r\n");
}
fclose($fp);
}
function printFighting($tournament, $phase) {
$code = $tournament * 100 + $phase;
if($code == 0) {
echo "<tr valign=top>";
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "<td>".printFightLog(50)."</td>";
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "</tr>";
} elseif($code <= 300) {
echo "<tr valign=top>";
for($i=0; $i < 8; $i++) {
echo "<td>".printFightLog($i)."</td>";
}
echo "</tr>";
} elseif($code < 400) {
} elseif($code <= 500) {
echo "<tr valign=top>";
for($i=10; $i < 18; $i++) {
echo "<td>".printFightLog($i)."</td>";
}
echo "</tr>";
} elseif($code < 700) {
} elseif($code <= 800) {
echo "<tr valign=top>";
for($i=20; $i < 28; $i++) {
echo "<td>".printFightLog($i)."</td>";
}
echo "</tr>";
} elseif($code <= 900) {
echo "<tr valign=top>";
for($i=30; $i < 34; $i++) {
echo "<td>&nbsp;</td>";
echo "<td>".printFightLog($i)."</td>";
}
echo "</tr>";
} elseif($code <= 1000) {
echo "<tr valign=top>";
for($i=40; $i < 42; $i++) {
echo "<td>&nbsp;</td>";
echo "<td>&nbsp;</td>";
echo "<td>".printFightLog($i)."</td>";
echo "<td>&nbsp;</td>";
}
echo "</tr>";
}
}
function startTournament($connect, $auto, $type) {
for($i=0; $i < 8; $i++) {
@unlink("logs/fight{$i}.txt");
@unlink("logs/fight1{$i}.txt");
@unlink("logs/fight2{$i}.txt");
@unlink("logs/fight3{$i}.txt");
@unlink("logs/fight4{$i}.txt");
@unlink("logs/fight5{$i}.txt");
}
switch($auto) {
case 1: $unit = 60; break;
case 2: $unit = 60; break;
case 3: $unit = 60; break;
case 4: $unit = 60; break;
case 5: $unit = 30; break;
case 6: $unit = 15; break;
case 7: $unit = 5; break;
default:$unit = 60; break;
}
$query = "select year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "update game set tnmt_auto='$auto',tnmt_time=DATE_ADD(now(), INTERVAL {$unit} MINUTE),tournament=1,tnmt_type='$type',phase=0,bet0=0,bet1=0,bet2=0,bet3=0,bet4=0,bet5=0,bet6=0,bet7=0,bet8=0,bet9=0,bet10=0,bet11=0,bet12=0,bet13=0,bet14=0,bet15=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=0,bet0=0,bet1=0,bet2=0,bet3=0,bet4=0,bet5=0,bet6=0,bet7=0,bet8=0,bet9=0,bet10=0,bet11=0,bet12=0,bet13=0,bet14=0,bet15=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "truncate tournament";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
switch($type) {
case 0: $history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>전력전</> 대회가 개최됩니다! 천하의 <O>영웅</>들을 모집하고 있습니다!"; break;
case 1: $history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>통솔전</> 대회가 개최됩니다! 천하의 <O>명사</>들을 모집하고 있습니다!"; break;
case 2: $history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>일기토</> 대회가 개최됩니다! 천하의 <O>용사</>들을 모집하고 있습니다!"; break;
case 3: $history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>설전</> 대회가 개최됩니다! 천하의 <O>책사</>들을 모집하고 있습니다!"; break;
}
pushHistory($connect, $history);
}
function fillLowGenAll($connect) {
$query = "select develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$general[no] = 0;
$general[name] = "무명장수";
$general[npc] = 2;
$general[leader] = 10;
$general[power] = 10;
$general[intel] = 10;
$general[explevel] = 10;
for($i=0; $i < 8; $i++) {
$query = "select grp from tournament where grp='$i'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount[$i] = MYDB_num_rows($result);
}
//자동신청하고, 돈 있고, 아직 참가 안한 장수
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='$admin[develcost]' order by rand() limit 0,64";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
$valid = 1;
while($valid == 1) {
$valid = 0;
//조마다 돌아가며
for($i=0; $i < 8; $i++) {
//비었으면 채우기
if($grpCount[$i] < 8) {
//자동신청 장수 있으면 채우기
if($genCount > 0) {
$genCount--;
$gen = MYDB_fetch_array($result);
$query = "update general set gold=gold-'$admin[develcost]',tournament='1' where no='$gen[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$gen[no]', '$gen[npc]', '$gen[name]', '$gen[leader]', '$gen[power]', '$gen[intel]', '$gen[explevel]', '$i', '$grpCount[$i]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//자동신청 장수 없으면 무명장수
} else {
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$i', '$grpCount[$i]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$grpCount[$i]++;
}
//덜 찼으면 루프 다시
if($grpCount[$i] < 8) {
$valid = 1;
}
}
}
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//0 경기없음
//1 모집중
//2 예선중 28페이즈
//3 본선추첨중
//4 본선중 6페이즈
//5 16강 배정중
//6 베팅
//6 16강
//7 8강
//8 4강
//9 결승
function getTwo($tournament, $phase) {
switch($tournament) {
case 2:
//예선
switch($phase%28) {
case 0: $cand[0] = 0; $cand[1] = 1; break; case 1: $cand[0] = 2; $cand[1] = 3; break; case 2: $cand[0] = 4; $cand[1] = 5; break; case 3: $cand[0] = 6; $cand[1] = 7; break;
case 4: $cand[0] = 0; $cand[1] = 2; break; case 5: $cand[0] = 1; $cand[1] = 3; break; case 6: $cand[0] = 4; $cand[1] = 6; break; case 7: $cand[0] = 5; $cand[1] = 7; break;
case 8: $cand[0] = 0; $cand[1] = 3; break; case 9: $cand[0] = 1; $cand[1] = 6; break; case 10: $cand[0] = 2; $cand[1] = 5; break; case 11: $cand[0] = 4; $cand[1] = 7; break;
case 12: $cand[0] = 0; $cand[1] = 4; break; case 13: $cand[0] = 1; $cand[1] = 5; break; case 14: $cand[0] = 2; $cand[1] = 6; break; case 15: $cand[0] = 3; $cand[1] = 7; break;
case 16: $cand[0] = 0; $cand[1] = 5; break; case 17: $cand[0] = 1; $cand[1] = 4; break; case 18: $cand[0] = 2; $cand[1] = 7; break; case 19: $cand[0] = 3; $cand[1] = 6; break;
case 20: $cand[0] = 0; $cand[1] = 6; break; case 21: $cand[0] = 1; $cand[1] = 7; break; case 22: $cand[0] = 2; $cand[1] = 4; break; case 23: $cand[0] = 3; $cand[1] = 5; break;
case 24: $cand[0] = 0; $cand[1] = 7; break; case 25: $cand[0] = 1; $cand[1] = 2; break; case 26: $cand[0] = 3; $cand[1] = 4; break; case 27: $cand[0] = 5; $cand[1] = 6; break;
}
if($phase >= 28) {
$temp = $cand[0];
$cand[0] = $cand[1];
$cand[1] = $temp;
}
break;
case 4:
//본선
switch($phase%6) {
case 0: $cand[0] = 0; $cand[1] = 1; break; case 1: $cand[0] = 2; $cand[1] = 3; break;
case 2: $cand[0] = 0; $cand[1] = 2; break; case 3: $cand[0] = 1; $cand[1] = 3; break;
case 4: $cand[0] = 0; $cand[1] = 3; break; case 5: $cand[0] = 1; $cand[1] = 2; break;
}
break;
}
return $cand;
}
function qualify($connect, $tnmt_type, $tnmt, $phase) {
$cand = getTwo($tnmt, $phase);
//각 그룹 페이즈 실행
for($i=0; $i < 8; $i++) {
fight($connect, $tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
}
if($phase < 55) {
$query = "update game set phase=phase+1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update game set tournament=3, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 8; $i++) {
$query = "select grp,grp_no,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$i' order by gd desc, gl desc, seq limit 0,4";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 4; $k++) {
$gen = MYDB_fetch_array($result);
$query = "update tournament set prmt='$k' where grp='$gen[grp]' and grp_no='$gen[grp_no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
}
function qualifyAll($connect, $tnmt_type, $tnmt, $phase) {
$start = $phase;
$end = $phase - ($phase % 4) + 4;
for($i=$start; $i < $end; $i++) {
qualify($connect, $tnmt_type, $tnmt, $i);
}
}
function selection($connect, $tnmt_type, $tnmt, $phase) {
//시드1 배정
if($phase < 8) {
$grp = $phase + 10; $grp_no = 0;
$query = "select * from tournament where prmt=1 order by rand() limit 0,1";
//시드2 배정
} elseif($phase < 16) {
$grp = $phase - 8 + 10; $grp_no = 1;
$query = "select * from tournament where prmt=2 order by rand() limit 0,1";
} elseif($phase < 24) {
$grp = $phase - 16 + 10; $grp_no = 2;
$query = "select * from tournament where prmt>2 order by rand() limit 0,1";
} else {
$grp = $phase - 24 + 10; $grp_no = 3;
$query = "select * from tournament where prmt>2 order by rand() limit 0,1";
}
//해당 시드에서 랜덤 선택
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//본선에 추가
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$grp', '$grp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//시드 삭제
$query = "update tournament set prmt=0 where grp='$general[grp]' and grp_no='$general[grp_no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($phase < 31) {
$query = "update game set phase=phase+1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update game set tournament=4, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
function selectionAll($connect, $tnmt_type, $tnmt, $phase) {
$start = $phase;
$end = $phase - ($phase % 8) + 8;
for($i=$start; $i < $end; $i++) {
selection($connect, $tnmt_type, $tnmt, $i);
}
}
function finallySingle($connect, $tnmt_type, $tnmt, $phase) {
$cand = getTwo($tnmt, $phase);
//각 그룹 페이즈 실행
for($i=10; $i < 18; $i++) {
fight($connect, $tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
}
if($phase < 5) {
$query = "update game set phase=phase+1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update game set tournament=5, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=10; $i < 18; $i++) {
$query = "select grp,grp_no,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$i' order by gd desc, gl desc, seq limit 0,2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 2; $k++) {
$gen = MYDB_fetch_array($result);
$query = "update tournament set prmt='$k' where grp='$gen[grp]' and grp_no='$gen[grp_no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
}
}
function finallyAll($connect, $tnmt_type, $tnmt, $phase) {
$start = $phase;
$end = $phase - ($phase % 2) + 2;
for($i=$start; $i < $end; $i++) {
finallySingle($connect, $tnmt_type, $tnmt, $i);
}
}
function final16set($connect) {
//1조1-5조2, 2조1-6조2, 3조1-7조2, 4조1-8조2, 5조1-1조2, 6조1-2조2, 7조1-3조2, 8조1-4조2
$grp = Array(10, 14, 11, 15, 12, 16, 13, 17, 14, 10, 15, 11, 16, 12, 17, 13);
$prmt = Array( 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
for($i=0; $i < 16; $i++) {
$query = "select * from tournament where grp='$grp[$i]' and prmt='$prmt[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//16강에 추가
$newGrp = 20 + floor($i / 2);
$newGrp_no = $i % 2;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "update tournament set prmt=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set tournament=6, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
function finalFight($connect, $tnmt_type, $tnmt, $phase, $type) {
switch($type) {
case 16: $offset = 20; $turn = 7; $next = 7; break;
case 8: $offset = 30; $turn = 3; $next = 8; break;
case 4: $offset = 40; $turn = 1; $next = 9; break;
case 2: $offset = 50; $turn = 0; $next = 0; break;
}
$grp = $phase + $offset;
fight($connect, $tnmt_type, $tnmt, $phase, $grp, 0, 1, 1);
$query = "update game set phase=phase+1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select * from tournament where grp='$grp' and win>0 and (grp_no=0 or grp_no=1)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//x강에 추가
$newGrp = floor($phase / 2) + $offset + 10;
$newGrp_no = $phase % 2;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($phase >= $turn) {
$query = "update game set tournament='$next', phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
}
function setGift($connect, $tnmt_type, $tnmt, $phase) {
$query = "select year,month,develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
switch($tnmt_type) {
case 0: $tp = "전력전"; $tp2 = "tt"; break;
case 1: $tp = "통솔전"; $tp2 = "tl"; break;
case 2: $tp = "일기토"; $tp2 = "tp"; break;
case 3: $tp = "설전"; $tp2 = "ti"; break;
}
//16강자 명성 돈
$cost = $admin[develcost];
$query = "select no,name from tournament where grp>=20 and grp<30";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set experience=experience+25,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액
$genNo[$i] = $general[no];
$genName[$i] = $general[name];
$genGold[$general[no]] = $cost;
$genCall[$general[no]] = "<O>16강 진출</>";
}
//8강자 명성 돈
$cost = $admin[develcost] * 2;
$query = "select no from tournament where grp>=30 and grp<40";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set experience=experience+50,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액
$genGold[$general[no]] += $cost;
$genCall[$general[no]] = "<O>8강 진출</>";
}
//4강자 명성 돈
$cost = $admin[develcost] * 3;
$query = "select no from tournament where grp>=40 and grp<50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set experience=experience+75,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액
$genGold[$general[no]] += $cost;
$genCall[$general[no]] = "<O>4강 진출</>";
}
//결승자 명성 돈
$cost = $admin[develcost] * 6;
$query = "select no from tournament where grp>=50 and grp<60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set experience=experience+150,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액
$genGold[$general[no]] += $cost;
$genCall[$general[no]] = "<O>준우승</>으";
}
//우승자 명성 돈
$cost = $admin[develcost] * 8;
$query = "select no from tournament where grp>=60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set experience=experience+200,gold=gold+'$cost',{$tp2}g={$tp2}g+3,{$tp2}p={$tp2}p+1 where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액
$genGold[$general[no]] += $cost;
$genCall[$general[no]] = "<O>우승</>으";
}
//우승자 이름
$query = "select no,name from tournament where grp=60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//준우승자 이름
$query = "select no,name from tournament where grp=50 and lose=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general2 = MYDB_fetch_array($result);
//자동진행 끝
$query = "update game set tnmt_auto=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//장수열전 기록
$query = "select no,history from general where no={$general[no]}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($result);
$query = "select no,history from general where no={$general2[no]}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($result);
$gen1 = addHistory($connect, $gen1, "<C>●</>{$admin[year]}{$admin[month]}월:<C>{$tp}</> 대회에서 우승");
$gen2 = addHistory($connect, $gen2, "<C>●</>{$admin[year]}{$admin[month]}월:<C>{$tp}</> 대회에서 준우승");
$cost = $admin[develcost] * 20;
$cost2 = $admin[develcost] * 12;
$history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회에서 <Y>{$general[name]}</>(이)가 <C>우승</>, <Y>{$general2[name]}</>(이)가 <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!";
$history[1] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$cost}</>, <S>준우승자</>에겐 <C>{$cost2}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!";
pushHistory($connect, $history);
for($i=0; $i < count($genNo); $i++) {
$general[no] = $genNo[$i];
$general[name] = $genName[$i];
$log[0] = "<S>◆</><C>{$tp}</> 대회의 {$genCall[$genNo[$i]]}로 <C>{$genGold[$genNo[$i]]}</>의 <S>상금</>, 약간의 <S>명성</> 획득!";
pushGenLog($general, $log);
}
//우승자 번호
$query = "select no from tournament where grp=60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
//16강 목록에서 검색
$query = "select grp,grp_no from tournament where grp>=20 and grp<30 and no='$general[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$no = ($general[grp] - 20) * 2 + $general[grp_no];
$query = "select bet{$no},bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$bet = @round($admin[bet] / $admin["bet{$no}"], 2);
//당첨칸에 베팅한 사람들만
$query = "select no,name,gold,bet{$no} as bet from general where bet{$no}>0";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$gold = round($gen[bet] * $bet);
//금 지급
$query = "update general set gold=gold+'$gold',betwingold=betwingold+'$gold',betwin=betwin+1 where no='$gen[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//로그
$log[0] = "<S>◆</><C>{$tp}</> 대회의 베팅 당첨으로 <C>{$gold}</>의 <S>금</> 획득!";
pushGenLog($gen, $log);
}
}
function setRefund($connect) {
$query = "select develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
//16강자 명성 돈
$cost = $admin[develcost];
$query = "select no from tournament where grp<10";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result);
$query = "update general set gold=gold+'$cost' where no='$general[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//자동진행 끝
$query = "update game set tnmt_auto=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//베팅금 환수
$query = "update general set gold=gold+bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//10차이 1.1, 50 차이 1.17, 100차이 1.2
function getLog($lvl1, $lvl2) {
if($lvl1 >= $lvl2) {
$ratio = 1 + log(1+$lvl1-$lvl2, 10) / 10;
} else {
$ratio = 1 - log(1+$lvl2-$lvl1, 10) / 10;
}
return $ratio;
}
//0 : 승무패, 1 : 승패
function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$query = "select *,(ldr+pwr+itl)*7/15 as tot,h,w,b from tournament where grp='$group' and grp_no='$g1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($result);
$query = "select *,(ldr+pwr+itl)*7/15 as tot,h,w,b from tournament where grp='$group' and grp_no='$g2'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($result);
if($type == 0) { $turn = 10; }
else { $turn = 100; }
if($tnmt_type == 0) { $tp = "tot"; $tp2 = "tt"; }
elseif($tnmt_type == 1) { $tp = "ldr"; $tp2 = "tl"; }
elseif($tnmt_type == 2) { $tp = "pwr"; $tp2 = "tp"; }
elseif($tnmt_type == 3) { $tp = "itl"; $tp2 = "ti"; }
$e1 = $energy1 = round($gen1[$tp] * getLog($gen1[lvl], $gen2[lvl]) * 10);
$e2 = $energy2 = round($gen2[$tp] * getLog($gen1[lvl], $gen2[lvl]) * 10);
//아이템 로그
if($gen1[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 포효합니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 그 위용을 뽐냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getHorseName($gen1[h])."</>(을)를 타고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 갈기를 휘날립니다!"; break;
}
}
if($gen1[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>(이)가 번뜩입니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>(이)가 푸르게 빛납니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>에서 살기가 느껴집니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 손에는 <S>".getWeapName($gen1[w])."</>(이)가 쥐어져 있습니다!"; break;
}
}
if($gen1[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 펼쳐듭니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 품에서 꺼냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 들고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 손에는 <S>".getBookName($gen1[b])."</>(이)가 쥐어져 있습니다!"; break;
}
}
if($gen2[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 포효합니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 그 위용을 뽐냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getHorseName($gen2[h])."</>(을)를 타고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 갈기를 휘날립니다!"; break;
}
}
if($gen2[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>(이)가 번뜩입니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>(이)가 푸르게 빛납니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>에서 살기가 느껴집니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 손에는 <S>".getWeapName($gen2[w])."</>(이)가 쥐어져 있습니다!"; break;
}
}
if($gen2[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 펼쳐듭니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 품에서 꺼냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 들고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 손에는 <S>".getBookName($gen2[b])."</>(이)가 쥐어져 있습니다!"; break;
}
}
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</> <C>({$energy1})</> vs <C>({$energy2})</> <Y>{$gen2[name]}</>";
$gd1 = 0; $gd2 = 0;
$phase = 0; $sel = 2;
while($phase < $turn) {
$phase++;
//평타
$damage1 = round($gen2[$tp] * (rand() % 21 + 90) / 130); // 90~110%
$damage2 = round($gen1[$tp] * (rand() % 21 + 90) / 130); // 90~110%
//보너스타
$ratio = rand() % 100;
if($gen1[$tp] >= $ratio) { $damage2 += round($gen1[$tp] * (rand() % 41 + 10) / 130); } // 10~50
$ratio = rand() % 100;
if($gen2[$tp] >= $ratio) { $damage1 += round($gen2[$tp] * (rand() % 41 + 10) / 130); } // 10~50
$critical1 = 0; $critical2 = 0;
//막판 분노
$ratio = rand() % 300;
if($e1 / 5 > $energy1 && $damage1 > $damage2 && $gen1[$tp] >= $ratio) {
$damage2 *= round((rand() % 301 + 200) / 100); // 200 ~ 500%
$critical1 = 1;
if ($tnmt_type == 0) { switch(rand()%2) { case 0: $str = "전력"; break; case 1: $str = "집중"; break; } }
elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 분노의 <M>{$str}</> 공격!";
}
$ratio = rand() % 300;
if($e2 / 5 > $energy2 && $damage2 > $damage1 && $gen2[$tp] >= $ratio) {
$damage1 *= round((rand() % 301 + 200) / 100); // 200 ~ 500%
$critical2 = 1;
if($tnmt_type == 0) { switch(rand()%2) { case 0: $str = "전력"; break; case 1: $str = "집중"; break; } }
elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 분노의 <M>{$str}</> 공격!";
}
//1합 승부
if($phase == 1) {
$ratio = rand() % 400;
if($gen1[$tp]*0.9 > $gen2[$tp] && $gen1[$tp] >= $ratio) {
$damage1 = 0; $damage2 = $e2;
if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>압도</>!"; }
elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>팔문금쇄진</>!"; }
elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>일격 필살</>!"; }
elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>모독 욕설</>!"; }
}
if($gen2[$tp]*0.9 > $gen1[$tp] && $gen2[$tp] >= $ratio) {
$damage2 = 0; $damage1 = $e1;
if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>압도</>!"; }
elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>팔문금쇄진</>!"; }
elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>일격 필살</>!"; }
elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>모독 욕설</>!"; }
}
} else {
$ratio = rand() % 1000;
if($critical1 == 0 && $gen1[$tp] >= $ratio) {
$damage2 *= round((rand() % 151 + 150) / 100); // 150 ~ 300%
$critical1 = 1;
if ($tnmt_type == 0) { switch(rand()%6) { case 0: $str = "참격"; break; case 1: $str = "집중"; break; case 2: $str = "역공"; break; case 3: $str = "반격"; break; case 4: $str = "선제"; break; case 5: $str = "도발"; break; } }
elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>{$str}</>!";
}
$ratio = rand() % 1000;
if($critical2 == 0 && $gen2[$tp] >= $ratio) {
$damage1 *= round((rand() % 151 + 150) / 100); // 150 ~ 300%
$critical2 = 1;
if ($tnmt_type == 0) { switch(rand()%6) { case 0: $str = "참격"; break; case 1: $str = "집중"; break; case 2: $str = "역공"; break; case 3: $str = "반격"; break; case 4: $str = "선제"; break; case 5: $str = "도발"; break; } }
elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>{$str}</>!";
}
}
$energy1 -= $damage1;
$energy2 -= $damage2;
$tDamage1 = $damage1; $tDamage2 = $damage2;
$tEnergy1 = $energy1; $tEnergy2 = $energy2;
if($energy1 <= 0 && $energy2 <= 0) {
$r1 = $tEnergy1 / $tDamage1;
$r2 = $tEnergy2 / $tDamage2;
if($r1 > $r2) {
$offset = round($tEnergy2*$tDamage1/$tDamage2);
$damage1 += $offset; $energy1 -= $offset;
$damage2 += $tEnergy2; $energy2 = 0;
} else {
$offset = round($tEnergy1*$tDamage2/$tDamage1);
$damage2 += $offset; $energy2 -= $offset;
$damage1 += $tEnergy1; $energy1 = 0;
}
} elseif($energy1 * $energy2 <= 0) {
if($energy2 < 0) {
$offset = round($tEnergy2*$tDamage1/$tDamage2);
$damage1 += $offset; $energy1 -= $offset;
$damage2 += $tEnergy2; $energy2 = 0;
}
if($energy1 < 0) {
$offset = round($tEnergy1*$tDamage2/$tDamage1);
$damage2 += $offset; $energy2 -= $offset;
$damage1 += $tEnergy1; $energy1 = 0;
}
}
$gd1 += $damage1; $gd2 += $damage2;
$energy1 = round($energy1); $energy2 = round($energy2);
$damage1 = round($damage1); $damage2 = round($damage2);
$log[count($log)] = "<S>●</> "._String::Fill2($phase, 2, "0")."合 : <C>"._String::Fill2($energy1, 3, "0")."</> <O>(-"._String::Fill2($damage1, 3, "0").")</> vs <O>(-"._String::Fill2($damage2, 3, "0").")</> <C>"._String::Fill2($energy2, 3, "0")."</>";
if($energy1 <= 0 && $energy2 <= 0) {
if($type == 0) { $sel = 2; break; }
else {
$energy1 = round($e1 / 2); $energy2 = round($e2 / 2);
$log[count($log)] = "<S>●</> <O>재대결</>!";
}
}
if($energy1 <= 0) { $sel = 1; break; }
if($energy2 <= 0) { $sel = 0; break; }
}
$query = "select {$tp2}g as gl from general where no='$gen1[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general1 = MYDB_fetch_array($result);
$query = "select {$tp2}g as gl from general where no='$gen2[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general2 = MYDB_fetch_array($result);
switch($sel) {
case 0:
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</> <S>승리</>!";
$gl = round(($gd2 - $gd1) / 50);
$query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g2'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general1[gl] > $general2[gl]) { $gl1 = "+1"; $gl2 = "+0"; }
elseif($general1[gl] == $general2[gl]) { $gl1 = "+2"; $gl2 = "-1"; }
else { $gl1 = "+3"; $gl2 = "-2"; }
$query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 1:
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</> <S>승리</>!";
$gl = round(($gd1 - $gd2) / 50);
$query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g2'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general2[gl] > $general1[gl]) { $gl2 = "+1"; $gl1 = "+0"; }
elseif($general2[gl] == $general1[gl]) { $gl2 = "+2"; $gl1 = "-1"; }
else { $gl2 = "+3"; $gl1 = "-2"; }
$query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
case 2:
$log[count($log)] = "<S>●</> 무승부!";
$query = "update tournament set draw=draw+1 where grp='$group' and (grp_no='$g1' or grp_no='$g2')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general1[gl] > $general2[gl]) { $gl2 = "-1"; $gl1 = "+1"; }
elseif($general1[gl] == $general2[gl]) { $gl2 = "+0"; $gl1 = "+0"; }
else { $gl2 = "+1"; $gl1 = "-1"; }
$query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break;
}
if(($tnmt == 2 && $phs < 55) || ($tnmt == 4 && $phs < 5)) {
$cand = getTwo($tnmt, $phs+1);
$query = "select name from tournament where grp='$group' and grp_no='$cand[0]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($result);
$query = "select name from tournament where grp='$group' and grp_no='$cand[1]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($result);
$log[count($log)] = "--------------- 다음경기 ---------------<br><S>☞</> <Y>{$gen1[name]}</> vs <Y>{$gen2[name]}</>";
}
pushFightLog($group, $log);
}
-9
View File
@@ -1,9 +0,0 @@
<html>
<head>
<title>삼국지 모의전투 유기체서버</title>
<?php require('analytics.php'); ?>
</head>
<frameset id=index name=index cols=100% frameborder=0 border=0>
<frame src=main.php id=main name=main>
</frameset>
</html>
-91
View File
@@ -1,91 +0,0 @@
<?php
include "lib.php";
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
@chmod(".",0707);
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
</head>
<body bgcolor=#000000 text=#ffffff>
<script>
function check_submit() {
if(!document.license.accept.checked) {
alert("라이센스를 읽으시고 동의하시는 분만 삼모넷을 사용하실수 있습니다.\n\n라이센스를 모두 읽으신후 라이센스에 동의하시면 체크를 하신후 설치시작하세요");
return false;
}
return true;
}
function check_view() {
if(document.license.accept.checked) {
if(confirm("라이센스를 모두 읽으시고 동의를 하십니까?")) {
return true;
} else {
return false;
}
}
}
</script>
<br><br><br>
<div align=center>
<form name=license>
<table cellpadding=3 cellspacing=0 width=600 border=0>
<tr>
<td height=30 colspan=3><img src=<?=$images;?>/inst_top.gif></td>
</tr>
<tr>
<td>
<br>
<img src=<?=$images;?>/inst_step1.gif>
<textarea cols=90 rows=15 readonly><?php include "license.txt"; ?></textarea>
<br>
<input type=checkbox name=accept value=1 onclick="return check_view()"> 위의 라이센스를 모두 읽었으며 동의합니다
</td>
</tr>
</form>
<tr>
<td><br>
<img src=<?=$images;?>/inst_step1-2.gif><br><br><br><div align=center>
<?php
if(fileperms(".")==16839||fileperms(".")==16895) $check="1";
if(!$check) {
echo "
<font color=red>현재 707로 퍼미션이 되어 있지 않습니다. 텔넷이나 FTP에서 퍼미션을 조정하세요.</font>
<br>
<br>
<div align=center>
<table border=0>
<tr>
<form method=post action={$_SERVER['PHP_SELF']}>
<td align=center height=30>
<input type=submit value='퍼미션 조정하였습니다' style=height:20px;>
</td>
</form>
</tr>
</table>
";
} else {
echo "
<br><br><div align=center>
<table border=0>
<tr>
<form method=post action=install1.php onsubmit='return check_submit()'>
<td align=center height=30>
<input type=submit text='inst_b_1' border=0 align=absmiddle>
</td>
</form>
</tr>
</table>
";
}
?>
<br>
</td>
</tr>
</table>
</body>
</html>
-85
View File
@@ -1,85 +0,0 @@
<?php
include "lib.php";
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=StyleSheet HREF=style.css type=text/css title=style>
</head>
<script>
function check_submit()
{
if(!write.hostname.value)
{
alert("HostName을 입력하세요");
write.hostname.focus();
return false;
}
if(!write.user_id.value)
{
alert("USER ID 를 입력하세요");
write.user_id.focus();
return false;
}
if(!write.dbname.value)
{
alert("DB Name를 입력하세요");
write.dbname.focus();
return false;
}
return true;
}
</script>
<body bgcolor=#000000 text=#ffffff>
<br><br><br>
<div align=center>
<table cellpadding=0 cellspacing=0 width=600 border=0>
<tr>
<td height=30 colspan=3><img src=<?=$images;?>/inst_top.gif></td>
</tr>
<tr>
<td>
<br>
<img src=<?=$images;?>/inst_step2.gif>
</td>
</tr>
<tr>
<td>
<br>
<form name=write method=post action=install_ok.php onsubmit="return check_submit();">
<table border=0 cellpadding=2 cellspacing=0>
<tr>
<td width=90 align=right style=font-family:Tahoma;font-size:8pt;>Host Name</td>
<td width=90><input type=text name=hostname value='localhost' style=font-family:Tahoma;font-size:8pt;></td>
<td width=300>MySQL DB의 호스트네임을 입력하세요.</font></td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt;>SQL User ID</td>
<td><input type=text name=user_id style=font-family:Tahoma;font-size:8pt;></td>
<td>MySQL계정의 ID를 입력하세요</font></td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt;>Password</td>
<td><input type=password name=password style=font-family:Tahoma;font-size:8pt;></td>
<td>Mysql DB의 패스워드를 입력하세요</font></td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt;>DB Name</td>
<td><input type=text name=dbname style=font-family:Tahoma;font-size:8pt;></td>
<td>Mysql DB의 Name을 입력하세요</font></td>
</tr>
<tr>
<td colspan=3 align=center><br><br><input type=image src=<?=$images;?>/inst_b_2.gif border=0 align=absmiddle></td>
</tr>
</form>
</table>
<br>
</td>
</tr>
</table>
</body>
</html>
-122
View File
@@ -1,122 +0,0 @@
<?php
require "lib.php";
?>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=StyleSheet HREF=style.css type=text/css title=style>
</head>
<body bgcolor=#000000 text=#ffffff>
<br><br><br>
<div align=center>
<table cellpadding=0 cellspacing=0 width=600 border=0>
<tr>
<td height=30 colspan=3><img src=<?=$images;?>/inst_top.gif></td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
</table>
<table border=0 cellpadding=2 cellspacing=0 width=600>
<form name=write method=post action=install2_ok.php>
<tr>
<td colspan=2>
<img src=<?=$images;?>/inst_step3.gif>
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>TurnTerm&nbsp;</td>
<td>
<input type=text name=turnterm size=20 value='1' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:120분, 1:60분, 2:30분, 3:20분, 4:10분, 5:5분, 6:2분, 7:1분
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>TurnTerm&nbsp;</td>
<td>
<input type=text name=sync size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:무동기, 1:13시 시작으로 동기
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>시나리오</td>
<td>
<input type=text name=scenario size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>가상상성</td>
<td>
<input type=text name=fiction size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:사실상성, 1:가상상성
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>확장장수</td>
<td>
<input type=text name=extend size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:비확장, 1:확장장수등장
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>NPC유저</td>
<td>
<input type=text name=npcmode size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:불가능, 1:가능
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>이미지&nbsp;</td>
<td>
<input type=text name=img size=20 value='0' maxlength=20 style=font-family:Tahoma;font-size:8pt>0:없음, 1:전콘, 2:병종, 3:엔장
</td>
</tr>
<tr>
<td align=right style=font-family:Tahoma;font-size:8pt>시나리오 종류</td>
<td>
역사모드<br>
0 : 180년 공백지<br>
1 : 184년 황건적의 난<br>
2 : 190년 반동탁연합<br>
3 : 194년 군웅할거<br>
4 : 196년 황제는 허도로<br>
5 : 200년 관도대전<br>
6 : 202년 원가의 분열<br>
7 : 207년 적벽대전<br>
8 : 213년 익주 공방전<br>
9 : 219년 삼국정립<br>
10 : 225년 칠종칠금<br>
11 : 228년 출사표<br>
IF모드<br>
12 : 191년 백마장군의 위세<br>
가상모드<br>
20 : 180년 영웅 난무<br>
21 : 180년 영웅 집결<br>
22 : 179년 훼신 집결<br>
23 : 180년 영웅 시대<br>
24 : 180년 결사항전<br>
25 : 180년 영웅독존<br>
26 : 180년 무풍지대<br>
27 : 180년 가요대잔치<br>
28 : 180년 확산성 밀리언 아서<br>
</td>
</tr>
<tr>
<td align=center colspan=2><br><br>
<input type=image src=<?=$images;?>/inst_b_3.gif border=0 align=absmiddle>
</td>
</tr>
</form>
</table>
</body>
</html>
-385
View File
@@ -1,385 +0,0 @@
<?php
include "lib.php";
include "func.php";
require('../e_lib/util.php');
$turnterm = util::array_get($_POST['turnterm'],'0');
$sync = util::array_get($_POST['sync'],'0');
$scenario = util::array_get($_POST['scenario'],'0');
$fiction = util::array_get($_POST['fiction'],'0');
$extend = util::array_get($_POST['extend'],'0');
$npcmode = util::array_get($_POST['npcmode'],'0');
$img = util::array_get($_POST['img'],'0');
$connect=dbConn();
switch($scenario) {
case 0: $startyear = 180; break;
case 1: $startyear = 184 - 3; break;
case 2: $startyear = 190 - 3; break;
case 3: $startyear = 194 - 3; break;
case 4: $startyear = 196 - 3; break;
case 5: $startyear = 200 - 3; break;
case 6: $startyear = 202 - 3; break;
case 7: $startyear = 207 - 3; break;
case 8: $startyear = 213 - 3; break;
case 9: $startyear = 219 - 3; break;
case 10: $startyear = 225 - 3; break;
case 11: $startyear = 228 - 3; break;
case 12: $startyear = 191 - 3; break;
case 20: $startyear = 180; break;
case 21: $startyear = 180; break;
case 22: $startyear = 179; break;
case 23: $startyear = 180; break;
case 24: $startyear = 180; break;
case 25: $startyear = 180; break;
case 26: $startyear = 180; break;
case 27: $startyear = 180; break;
case 28: $startyear = 180; break;
default: $startyear = 180; break;
}
// 관리자 등록
$turntime = date('Y-m-d H:i:s');
$lastconnect = $turntime;
$turntime = addTurn($turntime, $turnterm);
$turntime = cutTurn($turntime, $turnterm);
$pw = md5('18071807');
$picture = 'pic_1.jpg';
if($img < 1) { $picture = 'default.jpg'; };
@MYDB_query("
insert into general (
user_id, password, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect, userlevel
) values (
'admin', '$pw', '0', '운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect', '6'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
$pw = md5('12qw!@QW12qw!@QW');
$picture = 'pic_2.jpg';
if($img < 1) { $picture = 'default.jpg'; };
@MYDB_query("
insert into general (
user_id, password, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect, userlevel
) values (
'viceadmin', '$pw', '0', '부운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect', '5'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 게임정보 입력
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 항상 정각으로 설정
$starttime = cutTurn($turntime, $turnterm);
} else {
// 항상 13시로 설정
$starttime = CutDay($turntime);
}
switch($turnterm) {
case 0: $killturn = 40; break;
case 1: $killturn = 80; break;
case 2: $killturn = 160; break;
case 3: $killturn = 240; break;
case 4: $killturn = 480; break;
case 5: $killturn = 960; break;
case 6: $killturn =2400; break;
case 7: $killturn =4800; break;
}
if($npcmode == 1) { $killturn = floor($killturn / 3); }
//락 생성
@MYDB_query("insert into plock ( plock ) values ( 0 )", $connect) or Error(__LINE__.MYDB_error($connect),"");
//게임 정보 생성
@MYDB_query("
insert into game (
year, month, msg,
maxgeneral, normgeneral, maxnation, conlimit, gold_rate, rice_rate,
turntime, starttime, turnterm, killturn,
genius, startyear,scenario,img,npcmode,extend,fiction,
att0, def0, spd0, avd0, cst0, ric0,
att1, def1, spd1, avd1, cst1, ric1,
att2, def2, spd2, avd2, cst2, ric2,
att3, def3, spd3, avd3, cst3, ric3,
att4, def4, spd4, avd4, cst4, ric4,
att5, def5, spd5, avd5, cst5, ric5,
att10, def10, spd10, avd10, cst10, ric10,
att11, def11, spd11, avd11, cst11, ric11,
att12, def12, spd12, avd12, cst12, ric12,
att13, def13, spd13, avd13, cst13, ric13,
att14, def14, spd14, avd14, cst14, ric14,
att20, def20, spd20, avd20, cst20, ric20,
att21, def21, spd21, avd21, cst21, ric21,
att22, def22, spd22, avd22, cst22, ric22,
att23, def23, spd23, avd23, cst23, ric23,
att24, def24, spd24, avd24, cst24, ric24,
att25, def25, spd25, avd25, cst25, ric25,
att26, def26, spd26, avd26, cst26, ric26,
att27, def27, spd27, avd27, cst27, ric27,
att30, def30, spd30, avd30, cst30, ric30,
att31, def31, spd31, avd31, cst31, ric31,
att32, def32, spd32, avd32, cst32, ric32,
att33, def33, spd33, avd33, cst33, ric33,
att34, def34, spd34, avd34, cst34, ric34,
att35, def35, spd35, avd35, cst35, ric35,
att36, def36, spd36, avd36, cst36, ric36,
att37, def37, spd37, avd37, cst37, ric37,
att38, def38, spd38, avd38, cst38, ric38,
att40, def40, spd40, avd40, cst40, ric40,
att41, def41, spd41, avd41, cst41, ric41,
att42, def42, spd42, avd42, cst42, ric42,
att43, def43, spd43, avd43, cst43, ric43
) values (
'$startyear', 1, '삼모전의 매력은 IRC에서의 커뮤니티입니다. 흠냐 채널을 찾아주세요^^ <font color=cyan>웹 IRC</font> : <a target=_blank href=http://barosl.com/webirc/흠냐>http://barosl.com/webirc/흠냐</a><br><font color=orange size=6>폭력적/선정적인 전콘/전메는 블럭/삭제 대상이 될 수 있습니다.</font>',
500, 300, 55, 120, 100, 100,
'$turntime', '$starttime', '$turnterm', '$killturn',
5, '$startyear', '$scenario', '$img', '$npcmode', '$extend', '$fiction',
100, 150, 7, 10, 9, 9, -- 보병
100, 200, 7, 10, 10, 11, -- 청주병(중원)
150, 150, 7, 10, 11, 10, -- 수병(오월)
100, 150, 7, 20, 10, 10, -- 자객병(저)
150, 200, 7, 10, 12, 12, -- 근위병(낙양)
100, 250, 7, 5, 13, 10, -- 등갑병(남중)
100, 100, 7, 20, 10, 10, -- 궁병
100, 100, 8, 30, 11, 12, -- 궁기병(동이)
150, 100, 8, 20, 12, 11, -- 연노병(서촉)
150, 150, 7, 20, 13, 13, -- 강궁병(양양)
200, 100, 7, 20, 13, 13, -- 석궁병(건업)
150, 100, 7, 5, 11, 11, -- 기병
200, 100, 7, 5, 12, 13, -- 백마병(하북)
150, 150, 7, 5, 13, 12, -- 중장기병(서북)
200, 100, 8, 5, 13, 11, -- 돌격기병(흉노)
100, 200, 7, 5, 11, 13, -- 철기병(강)
150, 100, 8, 15, 12, 12, -- 수렵기병(산월)
250, 200, 6, 0, 16, 16, -- 맹수병(남만)
200, 150, 7, 5, 14, 14, -- 호표기병(허창)
80, 80, 7, 5, 9, 9, -- 귀병
80, 80, 7, 20, 10, 10, -- 신귀병(초)
80, 130, 7, 5, 9, 11, -- 백귀병(오환)
130, 80, 7, 5, 11, 9, -- 흑귀병(왜)
130, 130, 7, 0, 12, 12, -- 악귀병(장안)
60, 60, 7, 10, 8, 8, -- 남귀병
110, 110, 7, 0, 13, 10, -- 황귀병(낙양)
80, 130, 7, 15, 11, 12, -- 천귀병(성도)
130, 80, 7, 15, 12, 11, -- 마귀병(업)
100, 100, 6, 0, 15, 5, -- 정란
150, 100, 6, 0, 20, 5, -- 충차
200, 100, 6, 0, 25, 5, -- 벽력거(업)
50, 200, 5, 0, 30, 5 -- 목우(성도)
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 도시정보 입력
// 이름 규모 인구 농업 상업 치안 수비 성벽 지역 경로
insertCity($connect, "", 8, 620500, 12500, 11300, 10000, 11700, 12200, 1, "9|18|70|78|80"); // 1 : 업
insertCity($connect, "허창", 8, 587600, 12100, 12400, 10000, 11700, 12500, 2, "10|19|38|71|74|80"); // 2 : 허창
insertCity($connect, "낙양", 8, 835700, 11700, 12000, 10000, 12100, 12400, 2, "70|71|72|74"); // 3 : 낙양
insertCity($connect, "장안", 8, 592300, 11600, 12300, 10000, 12000, 11800, 3, "41|73|86"); // 4 : 장안
insertCity($connect, "성도", 8, 652500, 12300, 12500, 10000, 12500, 12300, 4, "26|27|87"); // 5 : 성도
insertCity($connect, "양양", 8, 583700, 12000, 12600, 10000, 11500, 11700, 6, "51|89"); // 6 : 양양
insertCity($connect, "건업", 8, 638600, 11600, 12300, 10000, 11500, 11900, 7, "31|82|83"); // 7 : 건업
insertCity($connect, "북평", 7, 486200, 10200, 9500, 8000, 10300, 9900, 1, "77|90"); // 8 : 북평
insertCity($connect, "남피", 7, 503200, 9900, 10100, 8000, 10100, 10500, 1, "1|36|77"); // 9 : 남피
insertCity($connect, "", 7, 472400, 10300, 10000, 8000, 10100, 9900, 2, "2|20|51|71"); // 10 : 완
insertCity($connect, "수춘", 7, 514300, 9900, 9600, 8000, 9900, 9500, 2, "12|20|38|82"); // 11 : 수춘
insertCity($connect, "서주", 7, 485300, 10100, 9800, 8000, 10200, 9700, 2, "11|21|38|39"); // 12 : 서주
insertCity($connect, "강릉", 7, 485000, 10500, 9600, 8000, 9500, 9600, 6, "14|53|88|89"); // 13 : 강릉
insertCity($connect, "장사", 7, 471000, 9700, 9900, 8000, 10000, 10500, 6, "13|15|30|53|54"); // 14 : 장사
insertCity($connect, "시상", 7, 525200, 9800, 10000, 10000, 9900, 9600, 7, "14|56|58|91|92"); // 15 : 시상
insertCity($connect, "위례", 7, 492600, 10000, 9300, 8000, 9800, 10300, 8, "32|33|34|60|79"); // 16 : 위례
insertCity($connect, "", 6, 388500, 7500, 8000, 6000, 7800, 8100, 1, "35|77"); // 17 : 계
insertCity($connect, "복양", 6, 418500, 8000, 8300, 6000, 8200, 8000, 2, "1|19|78|81"); // 18 : 복양
insertCity($connect, "진류", 6, 395700, 8200, 8000, 6000, 8000, 8300, 2, "2|18|74|80|81"); // 19 : 진류
insertCity($connect, "여남", 6, 383100, 7700, 8100, 6000, 8400, 7700, 2, "10|11|38"); // 20 : 여남
insertCity($connect, "하비", 6, 427800, 8500, 8300, 6000, 8200, 7800, 2, "12|83"); // 21 : 하비
insertCity($connect, "서량", 6, 387400, 7700, 7900, 6000, 8300, 8000, 3, "40|63|64"); // 22 : 서량
insertCity($connect, "하내", 6, 373600, 7700, 8100, 6000, 8100, 8000, 3, "35|42|65|70"); // 23 : 하내
insertCity($connect, "한중", 6, 402700, 7700, 8400, 6000, 8000, 8500, 4, "25|75|86"); // 24 : 한중
insertCity($connect, "상용", 6, 368700, 7800, 7600, 6000, 7700, 8100, 4, "24|51"); // 25 : 상용
insertCity($connect, "덕양", 6, 380300, 8100, 8400, 6000, 7900, 7700, 4, "5|27|44|45"); // 26 : 덕양
insertCity($connect, "강주", 6, 412600, 7900, 8000, 6000, 8400, 8100, 4, "5|26|45|46|47"); // 27 : 강주
insertCity($connect, "건녕", 6, 376500, 8200, 8000, 6000, 8600, 8100, 5, "46|48|49"); // 28 : 건녕
insertCity($connect, "남해", 6, 380300, 8200, 7600, 6000, 8000, 8100, 5, "50|55|59|67"); // 29 : 남해
insertCity($connect, "계양", 6, 395500, 8300, 8000, 6000, 8100, 7700, 6, "14|54|55"); // 30 : 계양
insertCity($connect, "", 6, 435500, 7700, 8100, 6000, 7700, 7600, 7, "7|57|92|93"); // 31 : 오
insertCity($connect, "평양", 6, 398200, 7800, 8000, 6000, 8300, 7800, 8, "16|61"); // 32 : 평양
insertCity($connect, "사비", 6, 415700, 7700, 7900, 6000, 7800, 8000, 8, "16|34|93"); // 33 : 사비
insertCity($connect, "계림", 6, 391100, 8000, 7400, 6000, 8100, 7800, 8, "16|33|62|93"); // 34 : 계림
insertCity($connect, "진양", 5, 307400, 5600, 5900, 4000, 6400, 5900, 1, "17|23|70"); // 35 : 진양
insertCity($connect, "평원", 5, 307400, 6200, 6500, 4000, 6100, 6300, 1, "9|37|78"); // 36 : 평원
insertCity($connect, "북해", 5, 314600, 5500, 6300, 4000, 6300, 5800, 1, "36|39|79"); // 37 : 북해
insertCity($connect, "", 5, 328600, 6000, 6200, 4000, 6200, 5700, 2, "2|11|12|20|81"); // 38 : 초
insertCity($connect, "", 5, 287700, 6400, 5800, 4000, 5800, 5900, 2, "12|37|81"); // 39 : 패
insertCity($connect, "천수", 5, 298500, 5900, 6400, 4000, 6000, 5800, 3, "22|41|64|84"); // 40 : 천수
insertCity($connect, "안정", 5, 276400, 5700, 5900, 4000, 5700, 6200, 3, "4|40|85"); // 41 : 안정
insertCity($connect, "홍농", 5, 274800, 5700, 6300, 4000, 5800, 6300, 3, "23|72|73"); // 42 : 홍농
insertCity($connect, "하변", 5, 278500, 5800, 6200, 4000, 6000, 5600, 4, "76|85"); // 43 : 하변
insertCity($connect, "자동", 5, 287000, 5700, 5500, 4000, 6000, 5800, 4, "26|75|76|87"); // 44 : 자동
insertCity($connect, "영안", 5, 315300, 6200, 5900, 4000, 5800, 5900, 4, "26|27|88"); // 45 : 영안
insertCity($connect, "귀양", 5, 274600, 5800, 6100, 4000, 6100, 5800, 5, "27|28|47"); // 46 : 귀양
insertCity($connect, "주시", 5, 282800, 6000, 5900, 4000, 5800, 6300, 5, "27|46|48"); // 47 : 주시
insertCity($connect, "운남", 5, 325800, 6200, 6000, 4000, 6400, 6100, 5, "28|47|66"); // 48 : 운남
insertCity($connect, "남영", 5, 285300, 5900, 6200, 4000, 5800, 5700, 5, "28|54|66"); // 49 : 남영
insertCity($connect, "교지", 5, 319500, 5800, 5900, 4000, 5800, 5900, 5, "29|66"); // 50 : 교지
insertCity($connect, "신야", 5, 278600, 6000, 6200, 4000, 5800, 5500, 6, "6|10|25"); // 51 : 신야
insertCity($connect, "강하", 5, 307400, 5500, 5600, 4000, 5700, 6000, 6, "89|91"); // 52 : 강하
insertCity($connect, "무릉", 5, 319600, 5800, 6300, 4000, 6300, 5800, 6, "13|14|54"); // 53 : 무릉
insertCity($connect, "영릉", 5, 284900, 6200, 5800, 4000, 6200, 6200, 6, "14|30|49|53"); // 54 : 영릉
insertCity($connect, "상동", 5, 276700, 5800, 5900, 4000, 6200, 5800, 6, "29|30|58"); // 55 : 상동
insertCity($connect, "여강", 5, 290500, 5600, 5800, 4000, 6000, 5500, 7, "15|82|91|92"); // 56 : 여강
insertCity($connect, "회계", 5, 300500, 6400, 5900, 4000, 6200, 6400, 7, "31|67"); // 57 : 회계
insertCity($connect, "고창", 5, 280200, 5700, 6200, 4000, 5800, 6300, 7, "15|55|67"); // 58 : 고창
insertCity($connect, "", 5, 325600, 6000, 6200, 4000, 5700, 6000, 7, "29|67|94"); // 59 : 대
insertCity($connect, "안평", 5, 293700, 6300, 5900, 4000, 5900, 6300, 8, "16|61|79|90"); // 60 : 안평
insertCity($connect, "졸본", 5, 293900, 5500, 5900, 4000, 6000, 5800, 8, "32|60|68"); // 61 : 졸본
insertCity($connect, "이도", 5, 317400, 5800, 6100, 4000, 5800, 5600, 8, "34|69|93"); // 62 : 이도
insertCity($connect, "", 4, 209500, 4000, 4200, 2000, 4300, 4000, 3, "22|84"); // 63 : 강
insertCity($connect, "", 4, 195700, 4000, 4200, 2000, 4300, 4200, 3, "22|40|85"); // 64 : 저
insertCity($connect, "흉노", 4, 206400, 4000, 4100, 2000, 4000, 3800, 3, "23|84"); // 65 : 흉노
insertCity($connect, "남만", 4, 237800, 4000, 4200, 2000, 4300, 4500, 5, "48|49|50"); // 66 : 남만
insertCity($connect, "산월", 4, 227500, 4000, 3700, 2000, 4300, 3800, 7, "29|57|58|59"); // 67 : 산월
insertCity($connect, "오환", 4, 215300, 4200, 3700, 2000, 4300, 4000, 8, "61|90"); // 68 : 오환
insertCity($connect, "", 4, 206500, 3900, 3700, 2000, 4300, 4100, 8, "62|94"); // 69 : 왜
insertCity($connect, "호관", 3, 88700, 1900, 1800, 2000, 9500, 9600, 1, "1|3|23|35"); // 70 : 호관
insertCity($connect, "호로", 3, 111200, 2200, 2100, 2000, 10300, 9800, 2, "2|3|10"); // 71 : 호로
insertCity($connect, "사곡", 3, 100800, 2100, 1900, 2000, 9900, 10100, 3, "3|42"); // 72 : 사곡
insertCity($connect, "함곡", 3, 108100, 2000, 2200, 2000, 10100, 10200, 3, "4|42"); // 73 : 함곡
insertCity($connect, "사수", 3, 95800, 1700, 1900, 2000, 9500, 9600, 2, "2|3|19|80"); // 74 : 사수
insertCity($connect, "양평", 3, 86800, 1900, 1900, 2000, 9700, 9600, 4, "24|44|86"); // 75 : 양평
insertCity($connect, "가맹", 3, 85500, 1700, 1800, 2000, 9600, 9500, 4, "43|44"); // 76 : 가맹
insertCity($connect, "역경", 2, 98500, 1800, 1900, 2000, 3900, 4100, 1, "8|9|17"); // 77 : 역경
insertCity($connect, "계교", 2, 101200, 2100, 1900, 2000, 4000, 4200, 1, "1|18|36"); // 78 : 계교
insertCity($connect, "동황", 2, 99200, 1900, 2100, 2000, 3800, 4000, 1, "16|37|60"); // 79 : 동황
insertCity($connect, "관도", 2, 112300, 2200, 2000, 2000, 4200, 4300, 2, "1|2|19|74"); // 80 : 관도
insertCity($connect, "정도", 2, 108500, 2100, 2100, 2000, 4100, 3800, 2, "18|19|38|39"); // 81 : 정도
insertCity($connect, "합비", 2, 99800, 2000, 1900, 2000, 3900, 4100, 2, "7|11|56"); // 82 : 합비
insertCity($connect, "광릉", 2, 100100, 2000, 2100, 2000, 4100, 4000, 2, "7|21"); // 83 : 광릉
insertCity($connect, "적도", 2, 95200, 1800, 1700, 2000, 3800, 3700, 3, "40|63|65"); // 84 : 적도
insertCity($connect, "가정", 2, 93100, 1700, 1700, 2000, 3600, 3800, 3, "41|43|64"); // 85 : 가정
insertCity($connect, "기산", 2, 100500, 1900, 1800, 2000, 4100, 4000, 4, "4|24|75"); // 86 : 기산
insertCity($connect, "면죽", 3, 109300, 2200, 2100, 2000, 10800, 9900, 4, "5|44"); // 87 : 면죽
insertCity($connect, "이릉", 2, 96800, 1800, 1900, 2000, 3900, 4100, 6, "13|45"); // 88 : 이릉
insertCity($connect, "장판", 2, 103200, 2100, 2000, 2000, 4000, 3700, 6, "6|13|52|91"); // 89 : 장판
insertCity($connect, "백랑", 2, 105200, 2200, 1900, 2000, 3800, 4200, 8, "8|60|68"); // 90 : 백랑
insertCity($connect, "적벽", 1, 111700, 2300, 2100, 2000, 4200, 4100, 7, "15|52|56|89"); // 91 : 적벽
insertCity($connect, "파양", 1, 103700, 2000, 2200, 2000, 3800, 3800, 7, "15|31|56"); // 92 : 파양
insertCity($connect, "탐라", 1, 113000, 2200, 2100, 2000, 4300, 4100, 8, "31|33|34|62"); // 93 : 탐라
insertCity($connect, "유구", 1, 92100, 1700, 1800, 2000, 3700, 3700, 8, "59|69"); // 94 : 유구
//TODO:replace
switch($scenario) {
case 0: echo "index.php"; break;
case 1: echo "scenario_1.php"; break;
case 2: echo "scenario_2.php"; break;
case 3: echo "scenario_3.php"; break;
case 4: echo "scenario_4.php"; break;
case 5: echo "scenario_5.php"; break;
case 6: echo "scenario_6.php"; break;
case 7: echo "scenario_7.php"; break;
case 8: echo "scenario_8.php"; break;
case 9: echo "scenario_9.php"; break;
case 10: echo "scenario_10.php"; break;
case 11: echo "scenario_11.php"; break;
case 12: echo "scenario_12.php"; break;
case 20: echo "scenario_20.php"; break;
case 21: echo "scenario_21.php"; break;
case 22: echo "scenario_22.php"; break;
case 23: echo "scenario_23.php"; break;
case 24: echo "scenario_24.php"; break;
case 25: echo "scenario_25.php"; break;
case 26: echo "scenario_26.php"; break;
case 27: echo "scenario_27.php"; break;
case 28: echo "scenario_28.php"; break;
default: echo "install3_ok.php"; break;
}
/*
switch($scenario) {
case 0: echo "<script>location.replace('index.php');</script>"; break;
case 1: echo "<script>location.replace('scenario_1.php');</script>"; break;
case 2: echo "<script>location.replace('scenario_2.php');</script>"; break;
case 3: echo "<script>location.replace('scenario_3.php');</script>"; break;
case 4: echo "<script>location.replace('scenario_4.php');</script>"; break;
case 5: echo "<script>location.replace('scenario_5.php');</script>"; break;
case 6: echo "<script>location.replace('scenario_6.php');</script>"; break;
case 7: echo "<script>location.replace('scenario_7.php');</script>"; break;
case 8: echo "<script>location.replace('scenario_8.php');</script>"; break;
case 9: echo "<script>location.replace('scenario_9.php');</script>"; break;
case 10: echo "<script>location.replace('scenario_10.php');</script>"; break;
case 11: echo "<script>location.replace('scenario_11.php');</script>"; break;
case 12: echo "<script>location.replace('scenario_12.php');</script>"; break;
case 20: echo "<script>location.replace('scenario_20.php');</script>"; break;
case 21: echo "<script>location.replace('scenario_21.php');</script>"; break;
case 22: echo "<script>location.replace('scenario_22.php');</script>"; break;
case 23: echo "<script>location.replace('scenario_23.php');</script>"; break;
case 24: echo "<script>location.replace('scenario_24.php');</script>"; break;
case 25: echo "<script>location.replace('scenario_25.php');</script>"; break;
case 26: echo "<script>location.replace('scenario_26.php');</script>"; break;
case 27: echo "<script>location.replace('scenario_27.php');</script>"; break;
case 28: echo "<script>location.replace('scenario_28.php');</script>"; break;
default: echo "<script>location.replace('install3_ok.php');</script>"; break;
}
*/
function insertCity($connect, $name, $level, $pop2, $agri2, $comm2, $secu2, $def2, $wall2, $region, $path) {
switch($level) {
case 1: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 2: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 3: $pop = 10000; $agri = 100; $comm = 100; $secu = 100; $def = 1000; $wall = 1000; break;
case 4: $pop = 50000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 1000; $wall = 1000; break;
case 5: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 2000; $wall = 2000; break;
case 6: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 3000; $wall = 3000; break;
case 7: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 4000; $wall = 4000; break;
case 8: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 5000; $wall = 5000; break;
}
@MYDB_query("
insert into city (
name, level, path, pop, pop2, agri, agri2, comm, comm2, secu, secu2, rate,
trade, def, def2, wall, wall2, gen1, gen2, gen3, region
) values (
'$name', '$level', '$path', '$pop', '$pop2', '$agri', '$agri2', '$comm', '$comm2', '$secu', '$secu2', 50,
100, '$def', '$def2', '$wall', '$wall2', 0, 0, 0, '$region'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
-10
View File
@@ -1,10 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect=dbConn();
LogHistory($connect, 1);
//echo "<script>location.replace('index.php');</script>";
echo 'index.php'; //TODO:replace
-102
View File
@@ -1,102 +0,0 @@
<?php
include "lib.php";
include "schema.php";
include "func.php";
require "../e_lib/util.php";
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
$hostname = util::array_get($_POST['hostname'], '');
$user_id = util::array_get($_POST['user_id'], '');
$password = util::array_get($_POST['password'], '');
$dbname = util::array_get($_POST['dbname'], '');
// 호스트네임, 아이디, DB네임, 비밀번호의 공백여부 검사
if(isBlank($hostname)) Error("HostName을 입력하세요","");
if(isBlank($user_id)) Error("User ID 를 입력하세요","");
if(isBlank($dbname)) Error("DB NAME을 입력하세요","");
// DB에 커넥트 하고 DB NAME으로 select DB
$connect = MYDB_connect($hostname,$user_id,$password) or Error("MySQL-DB Connect<br>Error!!!","");
if(MYDB_error($connect)) Error(__LINE__.MYDB_error($connect),"");
MYDB_select_db($dbname, $connect) or Error("MySQL-DB Select<br>Error!!!","");
delInDir("logs");
delInDir("data/session");
@unlink("data/connected.php");
// 관리자 테이블 삭제
if(isTable($connect, "game", $dbname)) @MYDB_query("drop table game", $connect) or Error("drop ".MYDB_error($connect),"");
// 락 테이블 삭제
if(isTable($connect, "plock", $dbname)) @MYDB_query("drop table plock", $connect) or Error("drop ".MYDB_error($connect),"");
// 장수 테이블 삭제
if(isTable($connect, "general", $dbname)) @MYDB_query("drop table general", $connect) or Error("drop ".MYDB_error($connect),"");
// 국가 테이블 삭제
if(isTable($connect, "nation", $dbname)) @MYDB_query("drop table nation", $connect) or Error("drop ".MYDB_error($connect),"");
// 도시 테이블 삭제
if(isTable($connect, "city", $dbname)) @MYDB_query("drop table city", $connect) or Error("drop ".MYDB_error($connect),"");
// 부대 테이블 삭제
if(isTable($connect, "troop", $dbname)) @MYDB_query("drop table troop", $connect) or Error("drop ".MYDB_error($connect),"");
// 토큰 테이블 삭제
if(isTable($connect, "token",$dbname)) @MYDB_query("drop table token", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 테이블 삭제
if(isTable($connect, "diplomacy", $dbname)) @MYDB_query("drop table diplomacy", $connect) or Error("drop ".MYDB_error($connect),"");
// 토너먼트 테이블 삭제
if(isTable($connect, "tournament", $dbname)) @MYDB_query("drop table tournament", $connect) or Error("drop ".MYDB_error($connect),"");
// 거래 테이블 삭제
if(isTable($connect, "auction", $dbname)) @MYDB_query("drop table auction", $connect) or Error("drop ".MYDB_error($connect),"");
// 통계 테이블 삭제
if(isTable($connect, "statistic",$dbname)) @MYDB_query("drop table statistic", $connect) or Error("drop ".MYDB_error($connect),"");
// 연감 테이블 삭제
if(isTable($connect, "history",$dbname)) @MYDB_query("drop table history", $connect) or Error("drop ".MYDB_error($connect),"");
// 관리자 테이블 생성
if(!isTable($connect, "game", $dbname)) @MYDB_query($game_schema, $connect) or Error("create game ".MYDB_error($connect),"");
// 락 테이블 생성
if(!isTable($connect, "plock", $dbname)) @MYDB_query($plock_schema, $connect) or Error("create plock ".MYDB_error($connect),"");
// 장수 테이블 생성
if(!isTable($connect, "general", $dbname)) @MYDB_query($general_schema, $connect) or Error("create general ".MYDB_error($connect),"");
// 국가 테이블 생성
if(!isTable($connect, "nation", $dbname)) @MYDB_query($nation_schema, $connect) or Error("create nation ".MYDB_error($connect),"");
// 도시 테이블 생성
if(!isTable($connect, "city", $dbname)) @MYDB_query($city_schema, $connect) or Error("create city ".MYDB_error($connect),"");
// 부대 테이블 생성
if(!isTable($connect, "troop", $dbname)) @MYDB_query($troop_schema, $connect) or Error("create troop ".MYDB_error($connect),"");
// 토큰 테이블 생성
if(!isTable($connect, "token",$dbname)) @MYDB_query($token_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 테이블 생성
if(!isTable($connect, "diplomacy", $dbname)) @MYDB_query($diplomacy_schema, $connect) or Error("create diplomacy ".MYDB_error($connect),"");
// 전당 테이블 생성
if(!isTable($connect, "hall", $dbname)) {
MYDB_query($hall_schema, $connect) or Error("create hall ".MYDB_error($connect),"");
for($i=0; $i < 21; $i++) {
for($j=0; $j < 10; $j++) {
MYDB_query("insert into hall (type, rank) values ({$i}, {$j})", $connect);
}
}
}
// 왕조 테이블 생성
if(!isTable($connect, "emperior",$dbname)) @MYDB_query($emperior_schema, $connect) or Error("create emperior ".MYDB_error($connect),"");
// 토너먼트 테이블 생성
if(!isTable($connect, "tournament",$dbname)) @MYDB_query($tournament_schema, $connect) or Error("create tournament ".MYDB_error($connect),"");
// 거래 테이블 생성
if(!isTable($connect, "auction",$dbname)) @MYDB_query($auction_schema, $connect) or Error("create auction ".MYDB_error($connect),"");
// 통계 테이블 생성
if(!isTable($connect, "statistic",$dbname)) @MYDB_query($statistic_schema, $connect) or Error("create statistic ".MYDB_error($connect),"");
// 연감 테이블 생성
if(!isTable($connect, "history",$dbname)) @MYDB_query($history_schema, $connect) or Error("create history ".MYDB_error($connect),"");
// 파일로 DB 정보 저장
$file=@fopen("d_setting/set.php","w") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fwrite($file,"<?php /*\n$hostname\n$user_id\n$password\n$dbname\n */\n") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fclose($file);
@mkdir("data",0707);
@chmod("data",0707);
@chmod("d_setting/set.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
MYDB_close($connect);
echo "<script>location.replace('install2.php');</script>";
-246
View File
@@ -1,246 +0,0 @@
<?php
include "lib.php";
include "func.php";
require("new_lib.php")
$id = $_POST[id];
$pw = $_POST[pw];
$pwTemp = substr($pw, 0, 32);
$connect = dbConn("sammo");
//회원 테이블에서 정보확인
$query = "select no,name,picture,imgsvr,grade from MEMBER where id='$id' and pw='$pwTemp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$member = MYDB_fetch_array($result);
if(!$member) {
MessageBox("잘못된 접근입니다!!!");
echo "<script>history.go(-1);</script>";
exit(1);
}
$connect = dbConn();
$abil = abilityRand();
//토큰 테이블에서 정보확인
$query = "select id from token where id='{$id}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$token = MYDB_fetch_array($result);
if(!$token) {
//능력치 토큰 생성
$query = "
insert into token (
id, leader, power, intel
) values (
'{$id}', {$abil['leader']}, {$abil['power']}, {$abil['intel']}
)";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
$query = "update token set leader={$abil['leader']},power={$abil['power']},intel={$abil['intel']} where id='{$id}'";
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
}
?>
<html>
<head>
<title>장수생성</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<script type="text/javascript">
function updateToken(type) {
var id = $("#id").val();
var pw = $("#pw").val();
$.ajax({
type: "POST",
url: "join_token.php",
async: false,
data: { id: id, pw: pw, type: type },
success: function(data, textStatus, jqXHR) {
console.log(data);
if(data.result != "rand" && data.result != "leadpow" && data.result != "leadint" && data.result != "powint") {
alert(jqXHR.status+", "+jqXHR.statusText+", "+jqXHR.responseText);
location.replace("index.php");
} else {
$("#leader").text(data.leader);
$("#power").text(data.power);
$("#intel").text(data.intel);
}
},
dataType: 'json',
error: function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.status+", "+jqXHR.statusText+", "+jqXHR.responseText);
location.replace("index.php");
}
});
}
function abilityRand() {
updateToken("rand");
}
function abilityLeadpow() {
updateToken("leadpow");
}
function abilityLeadint() {
updateToken("leadint");
}
function abilityPowint() {
updateToken("powint");
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td>장 수 생 성<br><?php backButton(); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td align=center><?php info($connect, 0, 1); ?></td></tr>
</table>
<?php
$query = "select img,maxgeneral from game where no='1'";
$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
if($gencount >= $admin[maxgeneral]) {
echo "<script>alert('더 이상 등록할 수 없습니다.');</script>";
echo "<script>history.go(-1);</script>";
exit();
}
?>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
<?php
$query = "select name,scoutmsg,color from nation";
$nationresult = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),"");
$nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
if($nation[scoutmsg] == "") {
echo "
<tr><td align=center width=98 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>$nation[name]</td><td width=898 style=color:{newColor($nation[color])};background-color:{$nation[color]}>-</td></tr>";
} else {
echo "
<tr><td align=center width=98 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>$nation[name]</td><td width=898 style=color:{newColor($nation[color])};background-color:{$nation[color]}>$nation[scoutmsg]</td></tr>";
}
}
?>
</table>
<form name=form1 method=post action=join_post.php>
<input type=hidden name=id id=id value='<?=$id;?>'>
<input type=hidden name=pw id=pw value='<?=$pw;?>'>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td colspan=3 align=center id=bg1>장수 생성</td>
</tr>
<tr>
<td width=498 align=right id=bg1>장수명</td>
<td colspan=2>
<input type=text name=name maxlength=6 size=12 style=color:white;background-color:black; value=<?=$member[name]?>>(6글자 이내)
</td>
</tr>
<?php
if($admin[img] >= 1 && $member[grade] >= 1 && $member[picture] != "") {
$imageTemp = GetImageURL($member[imgsvr]);
echo "
<tr>
<td align=right id=bg1>전콘 사용 여부</td>
<td width=64 height=64>
<img src={$imageTemp}/{$member[picture]} border=0>
</td>
<td>
<input type=checkbox name=pic value=1 checked>사용
</td>
</tr>
";
}
?>
<tr>
<td align=center colspan=3>
계정관리에서 자신만을 표현할 수 있는 아이콘을 업로드 해보세요!
</td>
</tr>
<tr>
<td width=498 align=right id=bg1>성격</td>
<td colspan=2>
<select name=character size=1 maxlength=15 style=color:white;background-color:black;>
<option selected value=11>????</option>
<!--
<option value=10>은둔</option>
-->
<option value=9>안전</option>
<option value=8>유지</option>
<option value=7>재간</option>
<option value=6>출세</option>
<option value=5>할거</option>
<option value=4>정복</option>
<option value=3>패권</option>
<option value=2>의협</option>
<option value=1>대의</option>
<option value=0>왕좌</option>
</select> ※보정은 도움말 참고
</td>
</tr>
<tr>
<td width=498 align=right id=bg1>통솔</td>
<td colspan=2><font id=leader><?=$abil['leader'];?></font></td>
</tr>
<tr>
<td width=498 align=right id=bg1>무력</td>
<td colspan=2><font id=power><?=$abil['power'];?></font></td>
</tr>
<tr>
<td width=498 align=right id=bg1>지력</td>
<td colspan=2><font id=intel><?=$abil['intel'];?></font></td>
</tr>
<tr>
<td width=498 align=right id=bg1>능력치 조정</td>
<td colspan=2>
<input type=button value=랜덤형 onclick=abilityRand()>
<input type=button value=통솔무력형 onclick=abilityLeadpow()>
<input type=button value=통솔지력형 onclick=abilityLeadint()>
<input type=button value=무력지력형 onclick=abilityPowint()>
</td>
</tr>
<tr>
<td align=center colspan=3>
<font color=orange>모든 능력치는 ( 10 <= 능력치 <= 75 ) 사이로 잡으셔야 합니다.<br>
그 외의 능력치는 가입되지 않습니다.</font>
</td>
</tr>
<tr>
<td align=center colspan=3>
능력치의 총합은 150입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
임의의 도시에서 재야로 시작하며 건국과 임관은 게임 내에서 실행합니다.
</td>
</tr>
<tr>
<td width=498 align=right><input type=submit name=join value=장수생성></td>
<td colspan=2><input type=reset name=reset value=다시입력></td>
</tr>
</table>
</form>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php backButton(); ?></td></tr>
<tr><td><?php banner(); ?> </td></tr>
</table>
</body>
</html>
-274
View File
@@ -1,274 +0,0 @@
<?php
include "lib.php";
include "func.php";
$id = $_POST[id];
$pw = $_POST[pw];
$name = $_POST[name];
$name = _String::NoSpecialCharacter($name);
$pic = $_POST[pic];
$character = $_POST[character];
$pwTemp = substr($pw, 0, 32);
$connect = dbConn("sammo");
//회원 테이블에서 정보확인
$query = "select no,id,picture,imgsvr,grade from MEMBER where id='$id' and pw='$pwTemp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$member = MYDB_fetch_array($result);
if(!$member) {
MessageBox("잘못된 접근입니다!!!");
echo "<script>history.go(-1);</script>";
exit(1);
}
$date = date('Y-m-d H:i:s');
//등록정보
$query = "update MEMBER set reg_num=reg_num+1,reg_date='$date' where no='$member[no]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$connect = dbConn();
########## 동일 정보 존재여부 확인. ##########
$query = "select year,month,scenario,maxgeneral,turnterm,genius,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no from general where npc<2";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
$query = "select no from general where user_id='$member[id]'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$id_num = MYDB_num_rows($result);
$query = "select no from general where name='$name'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$name_num = MYDB_num_rows($result);
$query = "select * from token where id='$member[id]'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$token_num = MYDB_num_rows($result);
if($token_num == 1) {
$token = MYDB_fetch_array($result);
$leader = $token['leader'];
$power = $token['power'];
$intel = $token['intel'];
} else {
$leader = 0;
$power = 0;
$intel = 0;
}
if($id_num) {
echo("<script>
window.alert('이미 등록하셨습니다!')
history.go(-1)
</script>");
exit;
} elseif($name_num) {
echo("<script>
window.alert('이미 있는 장수입니다. 다른 이름으로 등록해 주세요!')
history.go(-1)
</script>");
exit;
} elseif($token_num != 1) {
echo("<script>
window.alert('능력치 정보가 잘못되었습니다. 운영자에게 문의해 주세요!')
history.go(-1)
</script>");
exit;
} elseif($admin[maxgeneral] <= $gencount) {
echo("<script>
window.alert('더이상 등록할 수 없습니다!')
history.go(-1)
</script>");
exit;
} elseif($id == "") {
echo("<script>
window.alert('ID가 없습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif(_String::GetStrLen($name) < 1) {
echo("<script>
window.alert('이름이 짧습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif($name == "") {
echo("<script>
window.alert('이름이 없습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif(_String::GetStrLen($name) > 6) {
echo("<script>
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif($leader + $power + $intel > 150) {
echo("<script>
window.alert('능력치가 150을 넘어섰습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif($leader > 75 || $leader < 10 || $power > 75 || $power < 10 || $intel > 75 || $intel < 10) {
echo("<script>
window.alert('능력치가 비정상적입니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} elseif($character < 0 || $character > 11) {
echo("<script>
window.alert('성격이 비정상적입니다. 다시 가입해주세요!')
history.go(-1)
</script>");
exit;
} else {
$ratio = rand() % 100;
// 현재 1%
if($ratio == 50 && $admin[genius] > 0) {
$genius = 1;
$query = "update game set genius=genius-1 where no='1'";
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
} else {
$genius = 0;
}
//중, 소 공백지 개수
$query = "select city from city where level>=5 and level<=6 and nation=0";
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$citycount = MYDB_num_rows($result);
// 공백지에서만 태어나게
if($citycount > 0) {
$query = "select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
} else {
$query = "select city from city where level>=5 and level<=6 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
}
$city = $city[city];
$total = rand() % 6;
$pleader = rand() % 100;
$ppower = rand() % 100;
$pintel = rand() % 100;
$rate = $pleader + $ppower + $pintel;
$pleader = floor($pleader / $rate * $total + 0.5);
$ppower = floor($ppower / $rate * $total + 0.5);
$pintel = floor($pintel / $rate * $total + 0.5);
$leader = $leader + $pleader;
$power = $power + $ppower;
$intel = $intel + $pintel;
$age = 20 + ($pleader + $ppower + $pintel) * 2 + (rand() % 2);
// 아직 남았고 천재등록상태이면 특기 부여
if($genius == 1) {
$specage2 = $age;
$special2 = getSpecial2($connect, $leader, $power, $intel);
} else {
$specage2 = round((80 - $age)/3) + $age;
$special2 = 0;
}
//내특
$specage = round((80 - $age)/12) + $age;
$special = 0;
if($admin[scenario] > 0) {
$specage2 = $age + 3;
$specage = $age + 3;
}
$turntime = getRandTurn($admin[turnterm]);
$lastconnect = date('Y-m-d H:i:s');
if($lastconnect >= $turntime) {
$turntime = addTurn($turntime, $admin[turnterm]);
}
//특회 전콘
if($admin[img] >= 1 && $member[grade] >= 1 && $member[picture] != "" && $pic == 1) {
$face = $member[picture];
$imgsvr = $member[imgsvr];
} else {
$face = "default.jpg";
$imgsvr = 0;
}
//특회
$userlevel = $member[grade];
//성격 랜덤시
if($character == 11) $character = rand()%10;
//상성 랜덤
$npcmatch = rand()%150 + 1;
########## 회원정보 테이블에 입력값을 등록한다. ##########
$query = "
insert into general (
user_id, password, name, picture, imgsvr, nation, city, troop, npcmatch,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
userlevel, level, turntime, killturn, lastconnect, makelimit, age, startage, personal, specage, special, specage2, special2
) values (
'$id', '$pwTemp', '$name', '$face', '$imgsvr', '0', '$city', '0', '$npcmatch',
'$leader', '$power', '$intel', '0', '0', '1000', '1000', '0', '0', '0',
'$userlevel', '0', '$turntime', '6', '$lastconnect', '0', '$age', '$age', '$character', '$specage', '$special', '$specage2', '$special2'
)";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select no,name,history from general where user_id='$id'";
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me[name] == "") {
$r = rand() % 999 + 1;
$me[name] = '장수-'.$r;
$query = "update general set name='$me[name]' where user_id='$id'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$cityname = getCity($connect, $city, "name");
if($genius == 1) {
$log[0] = "<C>●</>{$admin[month]}월:<G><b>$cityname[name]</b></>에서 <Y>$me[name]</>(이)라는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$admin[month]}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
$history[0] = "<C>●</>$admin[year]$admin[month]월:<L><b>【천재】</b></><G><b>$cityname[name]</b></>에 천재가 등장했습니다.";
pushHistory($connect, $history);
} else {
$log[0] = "<C>●</>{$admin[month]}월:<G><b>$cityname[name]</b></>에서 <Y>$me[name]</>(이)라는 호걸이 천하에 이름을 알립니다.";
}
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<Y>$me[name]</>, <G>$cityname[name]</>에서 큰 뜻을 품다.");
$mylog[count($mylog)] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
$mylog[count($mylog)] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,";
$mylog[count($mylog)] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~";
$mylog[count($mylog)] = "<C>●</>부디 즐거운 삼모전 되시길 바랍니다 ^^";
$mylog[count($mylog)] = "<C>●</>통솔 <C>$pleader</> 무력 <C>$ppower</> 지력 <C>$pintel</> 의 보너스를 받으셨습니다.";
$mylog[count($mylog)] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
if($genius == 1) {
$mylog[count($mylog)] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
}
pushGenLog($me, $mylog);
pushAllLog($log);
$adminLog[0] = "가입 : {$name} // {$me[name]} // {$id} // ".getenv("REMOTE_ADDR");
pushAdminLog($connect, $adminLog);
MYDB_close($connect);
echo("<script>
window.alert('정상적으로 회원 가입되었습니다. ID : $id \n튜토리얼을 꼭 읽어보세요!');
</script>");
echo("<script>location.replace('index.php');</script>");
}
-57
View File
@@ -1,57 +0,0 @@
<?php
include "lib.php";
include "func.php";
$id = $_POST[id];
$pw = $_POST[pw];
$type = $_POST[type];
$pwTemp = substr($pw, 0, 32);
$connect = dbConn("sammo");
//회원 테이블에서 정보확인
$query = "select no,id,picture,imgsvr,grade from MEMBER where id='$id' and pw='$pwTemp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$member = MYDB_fetch_array($result);
$connect = dbConn();
if(!$member) {
$response['result'] = "error";
echo json_encode($response);
exit;
}
if($type == "rand") {
$response['result'] = "rand";
$abil = abilityRand();
} elseif($type == "leadpow") {
$response['result'] = "leadpow";
$abil = abilityLeadpow();
} elseif($type == "leadint") {
$response['result'] = "leadint";
$abil = abilityLeadint();
} elseif($type == "powint") {
$response['result'] = "powint";
$abil = abilityPowint();
} else {
$response['result'] = "error";
echo json_encode($response);
exit;
}
$query = "update token set leader={$abil['leader']},power={$abil['power']},intel={$abil['intel']} where id='{$id}'";
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$response['leader'] = $abil['leader'];
$response['power'] = $abil['power'];
$response['intel'] = $abil['intel'];
usleep(100*1000);
echo json_encode($response);
-4
View File
File diff suppressed because one or more lines are too long
-180
View File
@@ -1,180 +0,0 @@
<?php
/******************************************************************************
체섭용 인클루드 파일
******************************************************************************/
// W3C P3P 규약설정
// @header ("P3P : CP=\"ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC\"");
//디버그용 매크로
define('__OLINE__',__LINE__);
define('__LINE__',__FILE__." ".__FUNCTION__." ".__LINE__." : ");
ini_set("session.cache_expire", 10080); // minutes
ini_set("session.gc_maxlifetime", 604800); // seconds
ob_start();
include "MYDB.php";
// 각종 변수
define('STEP_LOG', true);
define('PROCESS_LOG', true);
$_startTime = getMicroTime();
$_ver = "서비스중";
$_version = "삼국지 모의전투 PHP HideD v0.1";
$_banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : 유기체(jwh1807@gmail.com), HideD(hided62@gmail.com)";
$_helper = "도움 주신 분들";
$_develrate = 50; // 내정시 최하 민심 설정
$_upgradeLimit = 30; // 능력치 상승 경험치
$_dexLimit = 1000000; // 숙련도 제한치
$_defaultatmos = 40; // 초기 사기치
$_defaulttrain = 40; // 초기 훈련치
$_defaultatmos2 = 70; // 초기 사기치
$_defaulttrain2 = 70; // 초기 훈련치
$_maxtrain = 100; // 최대 훈련치
$_maxatmos = 100; // 인위적으로 올릴 수 있는 최대 사기치
$_maximumatmos = 150; // 최대 사기치
$_maximumtrain = 110; // 최대 훈련치
$_training = 30; // 풀징병시 훈련 1회 상승량
$_atmosing = 0.98; // 훈련시 사기 감소율
$_basefiring = 0.25; // 계략 기본 성공률
$_firing = 300; // 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/$_firing + $_basefiring)
$_firingbase = 100; // 계략시 기본 수치 감소량
$_firingpower = 400; // 계략시 수치 감소량($_firingbase ~ $_firingpower)
$_goodgenleader = 65; // 명장,지장에 사용될 통솔 제한
$_goodgenpower = 65; // 명장에 사용될 무력 제한
$_goodgenintel = 65; // 지장에 사용될 지력 제한
$_basecolor = "000044"; // 기본 배경색깔 푸른색
$_basecolor2 = "225500"; // 기본 배경색깔 초록색
$_basecolor3 = "660000"; // 기본 배경색깔 붉은색
$_basecolor4 = "330000"; // 기본 배경색깔 검붉은색
$_armperphase = 500; // 페이즈당 표준 감소 병사 수
$_basegold = 0; // 기본 국고
$_baserice = 2000; // 기본 병량
$_taxrate = 0.01; // 군량 매매시 세율
//$images = "http://115.68.28.99/images";
//$image = "http://115.68.28.99/image";
//$images = "http://jwh1807.vipweb.kr/images";
//$image = "http://jwh1807.vipweb.kr/image";
$image1 = "../d_pic";
$images = "/images";
$image = "/image";
unset($member);
unset($setup);
// Data, Icon, 세션디렉토리의 쓰기 권한이 없다면 에러 처리
if(!is_writable("data")) Error("Data 디렉토리의 쓰기 권한이 없습니다!");
if(!is_writable("data/session")) Error("세션 디렉토리 data/session의 쓰기 권한이 없습니다!");
session_save_path('data/session');
session_cache_limiter('nocache, must_revalidate');
session_set_cookie_params(0, '/');
session_cache_expire(60); // 60분
// 세션 변수의 등록
session_start();
//첫 등장
if(!isset($_SESSION['p_ip']) || $_SESSION['p_ip'] == "") {
$_SESSION['p_ip'] = getenv("REMOTE_ADDR");
$_SESSION['p_time'] = time();
}
//id, 이름, 국가는 로그인에서
//초과된 세션은 로그아웃(1시간)
if($_SESSION['p_time']+3600 < time()) {
$_SESSION['p_id'] = "";
$_SESSION['p_name'] = "";
$_SESSION['p_nation'] = 0;
$_SESSION['p_time'] = time();
session_destroy();
} else {
$_SESSION['p_time'] = time();
}
// DB가 설정이 되었는지를 검사
if(!file_exists("d_setting/set.php")&&!preg_match("/install/i",$_SERVER['PHP_SELF'])) {
// echo"<meta http-equiv=refresh content='0;url=../'>";
echo $_SERVER['PHP_SELF'].'//'.preg_match("/install/i",$_SERVER['PHP_SELF']);
exit;
}
// MySQL 데이타 베이스에 접근
function dbconn($table = "") {
global $connect, $HTTP_COOKIE_VARS;
$f = @file("d_setting/set.php") or Error("set.php파일이 없습니다. DB설정을 먼저 하십시요!");
for($i=1; $i<= 4; $i++) $f[$i] = trim(str_replace("\n","",$f[$i]));
if(!$connect) $connect = @MYDB_connect($f[1],$f[2],$f[3]) or Error("DB 접속시 에러가 발생했습니다");
if($table != "") { $f[4] = $table; }
@MYDB_select_db($f[4], $connect) or Error("DB Select 에러가 발생했습니다","");
return $connect;
}
// 에러 메세지 출력
function Error($message, $url="") {
global $setup, $connect, $dir, $config_dir;
include "error.php";
if($connect) @MYDB_close($connect);
exit;
}
// 게시판의 생성유무 검사
function isTable($connect, $str, $dbname='') {
if(!$dbname) {
$f=@file("d_setting/set.php") or Error("set.php파일이 없습니다. DB설정을 먼저 하십시요");
for($i=1;$i<=4;$i++) $f[$i]=str_replace("\n","",$f[$i]);
$dbname=$f[4];
}
$result = MYDB_list_tables($dbname, $connect) or Error(__LINE__." : list_table error : ".MYDB_error($connect),"");
$cnt = MYDB_num_rows($result);
for($i=0; $i < $cnt; $i++) {
$tablename = MYDB_fetch_row($result);
if($str == $tablename[0]) return 1;
}
return 0;
}
// 빈문자열 경우 1을 리턴
function isblank($str) {
$temp=str_replace(" ","",$str);
$temp=str_replace("\n","",$temp);
$temp=strip_tags($temp);
$temp=str_replace("&nbsp;","",$temp);
$temp=str_replace(" ","",$temp);
if(preg_match("/[^[:space:]]/i",$temp)) return 0;
return 1;
}
function Debug($str) {
echo "<script>alert('$str');</script>";
}
function MessageBox($str) {
echo "<script>alert('$str');</script>";
}
function getmicrotime() {
$microtimestmp = explode(' ', microtime());
return $microtimestmp[0] + $microtimestmp[1];
}
function PrintElapsedTime() {
global $_startTime;
$_endTime = round(getMicroTime() - $_startTime, 3);
echo "<table width=1000 align=center style=font-size:10;><tr><td align=right>경과시간 : {$_endTime}초</td></tr></table>";
}
function LogText($prefix, $variable){
$fp = fopen('logs/dbg_logs.txt', 'at');
fwrite($fp, sprintf('%s : %s\n', $prefix, var_export($_POST, true)));
fclose($fp);
}
LogText($_SERVER['REQUEST_URI'], $_POST);
extract($_POST, EXTR_SKIP);
//XXX: $_POST를 추출 없이 그냥 쓰는 경우가 많아서 일단 디버깅을 위해 씀!!!! 절대 production 서버에서 사용 금지!
//todo: $_POST로 제공되는 데이터를 각 페이지마다 분석할것.
-80
View File
@@ -1,80 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn("sammo");
$id = $_POST[id];
$pw = $_POST[pw];
$conmsg = $_POST[conmsg];
$pw = substr($pw, 0, 32);
//회원 테이블에서 정보확인
$query = "select no,name from MEMBER where id='$id' and pw='$pw'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$member = MYDB_fetch_array($result);
$connect = dbConn();
DeleteSession();
//회원 테이블에서 정보확인
$query="select no,name,nation,block,killturn from general where user_id='$id'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(!$member) {
MessageBox("아이디나 암호가 올바르지 않습니다!!!");
echo "<script>location.replace('index.php');</script>";
} elseif(!$me) {
MessageBox("캐릭터가 없습니다!!!");
echo "<script>location.replace('index.php');</script>";
} else {
switch($me[block]) {
case 1:
MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break;
case 2:
MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break;
case 3:
MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break;
}
$_SESSION[p_id] = $id;
$_SESSION[p_name] = $me[name];
$_SESSION[p_nation] = $me[nation];
$_SESSION[p_time] = time();
$date = date('Y-m-d H:i:s');
$query="update general set logcnt=logcnt+1,ip='$_SESSION[p_ip]',lastconnect='$date',conmsg='$conmsg' where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>window.top.location.replace('./');</script>";
$date = date('Y_m_d H:i:s');
$date2 = substr($date, 0, 10);
$fp = fopen("logs/_{$date2}_login.txt", "a");
$msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me[name],13," ")._String::Fill2($_SESSION[p_ip],16," ");
fwrite($fp, $msg."\r\n");
fclose($fp);
}
function DeleteSession() {
$session_path = "data/session"; // 세션이저장된 디렉토리
if(!$dir=@opendir($session_path)) echo "디렉토리를 열지못했습니다.";
while($file=@readdir($dir)) {
if(!strstr($file,'sess_')) continue;
if(strpos($file,'sess_')!=0) continue;
if (!$atime=@fileatime("$session_path/$file")) continue;
if (time() > $atime + 86400) { // 10대시 지난시간을 초로 계산해서 적어주시면 됩니다.
// $return = (@unlink("$session_path/$file"));
@unlink("$session_path/$file");
}
}
closedir($dir);
}
MYDB_close($connect);
-36
View File
@@ -1,36 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect=dbConn();
$query = "select no,user_id,password,name from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$_SESSION[p_id] = "";
$_SESSION[p_name] = "";
$_SESSION[p_nation] = 0;
$id = $me[user_id];
$pw = $me[password];
$conmsg = $me[conmsg];
//Ǻ
session_destroy();
//echo "<script>location.replace('start.php');</script>";
echo 'start.php';//TODO:replace
/*
<html>
a
<form name=form1 action=../login.php method=post>
<input type=hidden name=id value='<?=$id;?>'>
<input type=hidden name=pw value='<?=$pw;?>'>
<input type=hidden name=conmsg value='<?=$conmsg;?>'>
</form>
<script>form1.submit();</script>
</html>
*/
-336
View File
@@ -1,336 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
increaseRefresh($connect, "메인", 2);
checkTurn($connect);
$query = "select no,skin,userlevel,con,turntime,newmsg,newvote,map from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
//그새 사망이면
if($me[no] == 0) {
echo "a";
echo "<script>location.replace('start.php');</script>";
exit(0);
}
if($me[newmsg] == 1 && $me[newvote] == 1) {
$query = "update general set newmsg=0,newvote=0 where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[newmsg] == 1) {
$query = "update general set newmsg=0 where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[newvote] == 1) {
$query = "update general set newvote=0 where user_id='$_SESSION[p_id]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
$query = "select develcost,online,conlimit,tournament,tnmt_type,turnterm,scenario,extend,fiction,npcmode,vote from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select plock from plock where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$plock = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
if($me[skin] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
}
$scenario = getScenario($connect);
?>
<html>
<head>
<title>메인</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php?<?=$me[skin];?> type=text/css>
<script type="text/javascript">
//var term = <?=$term;?>; // 갱신 가능 텀
if (document.all) {
document.onkeydown = function () {
var key_f5 = 116; // 116 = F5
var key_enter = 13; // 13 = 엔터
if (key_f5 == event.keyCode) {
event.keyCode=0;
refreshing(0,0);
return false;
} else if(key_enter == event.keyCode) {
event.keyCode=0;
refreshing(4,message);
return false;
}
return true;
}
}
function refreshing(arg1, arg2) {
// if(term <= 0) {
switch(arg1) {
case 0: location.reload(); break;
case 1: go(arg2); break;
case 2: turn(arg2); break;
case 3: arg2.submit(); break;
case 4:
arg2.submit();
message.msg.value = "";
document.getElementById("msg").value = "";
message.msg.focus();
break;
}
// } else {
// alert('<?=$term;?>초가 지나야 합니다!!!\n서버 보호를 위한 조치이니 모두 협조 바랍니다.\n<?=$term;?>초가 지난 후 눌러주세요.\n\n ®유기체서버™');
// }
}
function go(type) {
if(type == 1) location.replace('b_nationboard.php');
else if(type == 2) location.replace('b_troop.php');
else if(type == 3) location.replace('b_nationrule.php');
else if(type == 4) location.replace('b_chiefboard.php');
else if(type == 5) location.replace('b_chiefcenter.php');
else if(type == 6) window.open('b_genList.php');
else if(type == 7) location.replace('b_myKingdomInfo.php');
else if(type == 8) location.replace('b_myCityInfo.php');
else if(type == 9) location.replace('b_myGenInfo.php');
else if(type == 10) location.replace('b_myBossInfo.php');
else if(type == 11) location.replace('b_currentCity.php');
else if(type == 12) location.replace('b_myPage.php');
else if(type == 13) location.replace('b_dipcenter.php');
else if(type == 14) location.replace('b_diplomacy.php');
else if(type == 15) window.open('b_tournament.php');
else if(type == 16) window.open('b_betting.php');
else if(type == 17) window.open('b_auction.php');
else if(type == 18) window.open('b_battleCenter.php');
}
function turn(type) {
num = form2.sel.value;
commandlist.location.replace('turn.php?type=' + type + '&sel=' + num);
}
</script>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<div style="position:absolute; top:15px; left:50%; margin-left: -567px; width: 52px; height: 52px; border: 1px solid white;">심의</div>
<?php $banner_id = $_SESSION[p_id]; ?>
<div style="position:absolute; top:77px; left:50%; margin-left: -675px; width: 160px; height: 600px; border: 1px solid white;">
<?php include('../i_banner/banner.php'); ?>
</div>
<div style="position:absolute; top:77px; left:50%; margin-left: 515px; width: 160px; height: 600px; border: 1px solid white;">
<?php include('../i_banner/banner.php'); ?>
</div>
<div style="position:absolute; top:1720px; left:50%; margin-left: -675px; width: 160px; height: 600px; border: 1px solid white;">
<?php include('../i_banner/banner.php'); ?>
</div>
<div style="position:absolute; top:1720px; left:50%; margin-left: 515px; width: 160px; height: 600px; border: 1px solid white;">
<?php include('../i_banner/banner.php'); ?>
</div>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=5><?php allButton($connect); ?></td></tr>
<tr height=50>
<td colspan=5 align=center><font size=4>삼국지 모의전투 PHP 유기체서버 (<font color=<?=$me[skin]>0?"cyan":"white";?>><?=$scenario;?></font>)</font></td>
</tr>
<?php
$valid = 0;
if($admin[extend] == 0) { $extend = "표준"; }
else { $extend = "확장"; $valid = 1; }
if($admin[fiction] == 0) { $fiction = "사실"; }
else { $fiction = "가상"; $valid = 1; }
if($admin[npcmode] == 0) { $npcmode = "불가능"; }
else { $npcmode = "가능"; $valid = 1; }
if($me[skin] > 0) { $color = "cyan"; }
else { $color = "white"; }
if($valid == 1) {
echo "
<tr height=30>
<td width=398 colspan=2 align=center><font color={$color}>{$scenario}</font></td>
<td width=198 align=center><font color={$color}>NPC수 : {$extend}</font></td>
<td width=198 align=center><font color={$color}>NPC상성 : {$fiction}</font></td>
<td width=198 align=center><font color={$color}>NPC선택 : {$npcmode}</font></td>
</tr>";
}
?>
<tr height=30>
<td width=198 align=center><?php info($connect, 2, $me[skin]); ?></td>
<td width=198 align=center>전체 접속자 수 : <?=$admin[online];?> 명</td>
<td width=198 align=center>턴당 갱신횟수 : <?=$admin[conlimit];?>회</td>
<td width=398 colspan=2 align=center><?php info($connect, 3, $me[skin]); ?></td>
</tr>
<tr height=30>
<td align=center>
<?php
if ($onlineNumber > $thr3) { $state = "(긴급모드)"; }
elseif($onlineNumber > $thr2) { $state = "(안전모드)"; }
elseif($onlineNumber > $thr1) { $state = "(절약모드)"; }
else { $state = ""; }
if($plock[plock] == 0) { echo "<marquee scrollamount=2><font color=cyan>서버 가동중{$state}</font></marquee>"; }
else { echo "<font color=magenta>서버 동결중{$state}</font>"; }
echo "
</td>
<td align=center>
";
switch($admin[tnmt_type]) {
case 0: $str = "전력전"; break;
case 1: $str = "통솔전"; break;
case 2: $str = "일기토"; break;
case 3: $str = "설전"; break;
}
$str2 = getTournament($admin[tournament]);
$str3 = getTournamentTime($connect);
if($admin[tournament] == 0) { echo "<font color=magenta>현재 토너먼트 경기 없음</font>"; }
else { echo "<marquee scrollamount=2>↑<font color=cyan>{$str}</font> {$str2} {$str3}↑</marquee>"; }
echo "
</td>
<td align=center>
";
$query = "select no from auction";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auctionCount = MYDB_num_rows($result);
if($auctionCount > 0) { echo "<marquee scrollamount=2><font color=cyan>{$auctionCount}건</font> 거래 진행중</marquee>"; }
else { echo "<font color=magenta>진행중 거래 없음</font>"; }
echo "
</td>
<td colspan=2 align=center>
";
$vote = explode("|", $admin[vote]);
$vote[0] = Tag2Code($vote[0]);
if($vote[0] == "") { echo "<font color=magenta>진행중 설문 없음</font>"; }
else { echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote[0]</marquee>"; }
echo "
</td>
</tr>";
?>
<tr><td colspan=5>접속중인 국가: <?=onlinenation($connect);?></td></tr>
<tr><td colspan=5><?php adminMsg($connect, $me[skin]); ?></td></tr>
<tr><td colspan=5>【 국가방침 】<?php nationMsg($connect, $me[skin]); ?></td></tr>
<tr><td colspan=5>【 접속자 】<?=onlinegen($connect);?></td></tr>
<?php
if($me[userlevel] >= 5) {
echo "
<tr><td colspan=5>
<input type=button value=게임관리 onclick=location.replace('_admin1.php')>
<input type=button value=회원관리 onclick=location.replace('_admin2.php')>
<input type=button value=특별회원 onclick=location.replace('_admin3.php')>
<input type=button value=멀티관리 onclick=location.replace('_admin4.php')>
<input type=button value=일제정보 onclick=window.open('_admin5.php')>
<input type=button value=접속정보 onclick=window.open('_admin6.php')>
<input type=button value=로그정보 onclick=window.open('_admin7.php')>
<input type=button value=외교정보 onclick=window.open('_admin8.php')>
<input type=button value=시뮬 onclick=window.open('_simul.php')>
<input type=button value=119 onclick=window.open('_119.php')>
</td></tr>
";
}
?>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=698 height=520 colspan=2><iframe src='map.php?type=0&graphic=<?=$me[map];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
<td width=298 rowspan=4><iframe name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
</tr>
<form name=form2 action=preprocessing.php method=post target=commandlist>
<tr>
<td rowspan=3 width=50 valign=top><?php turnTable(); ?></td>
<td width=646><?php cityInfo($connect); ?></td>
</tr>
<tr>
<td width=646 align=right>
<font color=<?=$me[skin]>0?"cyan":"white";?>><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능     반복&수정<b>→</b></font>
<select name=sel size=1 style=color:white;background-color:black;font-size:13;>
<option value=1>1턴</option>
<option value=2>2턴</option>
<option value=3>3턴</option>
<option value=4>4턴</option>
<option value=5>5턴</option>
<option value=6>6턴</option>
<option value=7>7턴</option>
<option value=8>8턴</option>
<option value=9>9턴</option>
<option value=10>10턴</option>
<option value=11>11턴</option>
<option value=12>12턴</option>
</select><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:50;font-size:13; value='반복' onclick='refreshing(2,0)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:80;font-size:13; value='▼미루기' onclick='refreshing(2,1)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:80;font-size:13; value='▲당기기' onclick='refreshing(2,2)'>
</td>
</tr>
<tr>
<td width=646 align=right>
<?php commandTable($connect); ?>
<input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:110;font-size:13; value='실 행' onclick='refreshing(3,form2)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:110;font-size:13; value='갱 신' onclick='refreshing(0,0)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:160;font-size:13; value='로그아웃' onclick=location.replace('logout_process.php')><br>
</td>
</tr>
</form>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=498><?php myNationInfo($connect); ?></td>
<td width=498><?php myInfo($connect); ?></td>
</tr>
<tr><td colspan=2><?php commandButton($connect); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td width=498 align=center id=bg1><b>장수 동향</b></td>
<td width=498 align=center id=bg1><b>개인 기록</b></td>
</tr>
<tr>
<td width=498 ><?php AllLog(15, $me[skin]); ?></td>
<td width=498 ><?php MyLog($me[no], 15, $me[skin]); ?></td>
</tr>
<tr><td width=998 colspan=2 align=center id=bg1><b>중원 정세</b></td></tr>
<tr><td width=998 colspan=2><?php History(15, $me[skin]); ?></td></tr>
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td colspan=2>
<form id=message name=message method=post action=c_msgsubmit.php target=msglist>
<?php genList($connect); ?>
<input type=textarea id=msg name=msg maxlength=99 style=color:white;background-color:black;font-size:13;width:720px;>
<input type=button style=background-color:<?=$_basecolor2;?>;color:white;font-size:13;width:100px; value='서신전달&갱신' onclick='refreshing(4,message)'>
<br>내용 없이 '서신전달&갱신'을 누르면 메세지창이 갱신됩니다.
</form>
</td>
</tr>
<tr><td colspan=2><?php allButton($connect); ?></td></tr>
<tr><td colspan=2>
<iframe name=msglist src='msglist.php' width=1000 height=1375 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe>
</td></tr>
<tr><td colspan=2>
<?php
allButton($connect);
banner();
?>
</td></tr>
</table>
<?php PrintElapsedTime(); ?>
</body>
</html>
<?php
if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); }
if($me[newmsg] == 1) { MessageBox("개인 서신이 도착했습니다!"); }
if($me[newvote] == 1) { $develcost = $admin[develcost]*5; MessageBox("설문조사에 참여하시면 금{$develcost}과 유니크템을 드립니다! (우측 상단 설문조사 메뉴)"); }
-434
View File
@@ -1,434 +0,0 @@
<?php
include "lib.php";
if($graphic == 2) {
echo "
<body bgcolor=black leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 oncontextmenu='return false' onselectstart='return false' ondragstart='return false'>
<font color=white>
지 도 생 략<br>
(개인설정 또는 과부하로 인한 서버의 긴급모드)
</font>
</body>
";
exit();
}
$connect=dbConn();
//<link rel=stylesheet href=stylesheet.php type=text/css>
?>
<html>
<head>
<title>지도</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<script type="text/javascript">
function cityselect(city) {
parent.document.form1.double.value = city;
}
function showLayer(obj, city, nation, event) {
x1 = event.clientX; x2 = event.clientX;
y1 = event.clientY + 10; y2 = event.clientY + 28;
layerObj1 = document.getElementById("city_name");
layerObj2 = document.getElementById("nation_name");
layerObj1.style.left = x1; layerObj2.style.left = x2;
layerObj1.style.top = y1; layerObj2.style.top = y2;
cityname = city.substr(6, city.length-1);
if(cityname == "남만" || cityname == "남영" || cityname == "교지" || cityname == "남해" || cityname == "대") {
layerObj1.style.top = y1 - 60;
layerObj2.style.top = y2 - 60;
} else if(cityname == "오환" || cityname == "졸본" || cityname == "평양" || cityname == "위례" || cityname == "사비"
|| cityname == "계림" || cityname == "탐라" || cityname == "이도" || cityname == "왜" || cityname == "유구") {
layerObj1.style.left = x1 - 110;
layerObj2.style.left = x2 - 110;
} else {
layerObj1.style.left = x1 + 10;
layerObj2.style.left = x2 + 10;
}
document.city_form.city.value = city;
document.nation_form.nation.value = nation;
if(nation == "") { layerObj2.style.visibility = "hidden"; }
else { layerObj2.style.visibility = "visible"; }
layerObj1.style.visibility = "visible";
}
function hideLayer() {
layerObj1 = document.getElementById("city_name");
layerObj2 = document.getElementById("nation_name");
document.city_form.city.value = "";
document.nation_form.nation.value = "";
layerObj1.style.visibility = "hidden";
layerObj2.style.visibility = "hidden";
}
</script>
<?php require('analytics.php'); ?>
</head>
<body bgcolor=black leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 oncontextmenu='return false'>
<div id=city_name class=balloon style=background-color:1EA4FF;position:absolute;visibility:hidden;z-index:6;>
<table border=1 cellspacing=0 cellpadding=0>
<form name=city_form>
<tr><td style=border-width:0;><input type=text size=13 style=background-color:1EA4FF;color:white;border:0; name=city></td></tr>
</form>
</table>
</div>
<div id=nation_name class=balloon style=background-color:1EA4FF;position:absolute;visibility:hidden;z-index:6;>
<table border=1 cellspacing=0 cellpadding=0>
<form name=nation_form>
<tr><td style=border-width:0;><input type=text size=13 style=background-color:1EA4FF;color:white;text-align:right;border:0; name=nation></td></tr>
</form>
</table>
</div>
<?php showMap($connect, $type, $graphic); ?>
</body>
</html>
<?php
function showMap($connect, $type, $graphic) {
global $images;
if(strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE')) {
if(strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE 10')) {
$brouserIE = 0;
} else {
$brouserIE = 1;
}
} else {
$brouserIE = 0;
}
// 맵
$query = "select startyear,year,month from game where no='1'";
$result = MYDB_query($query, $connect) or Error("showMap ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,userlevel,level,city from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select spy from nation where nation='$me[nation]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result);
//도시수
$allcount = 94;
if($admin[year] < $admin[startyear] + 1) {
$color = "magenta";
} elseif($admin[year] < $admin[startyear] + 2) {
$color = "orange";
} elseif($admin[year] < $admin[startyear] + 3) {
$color = "yellow";
} else {
$color = "white";
}
if($admin[month] < 4) { $season = "spring"; }
elseif($admin[month] < 7) { $season = "summer"; }
elseif($admin[month] < 10) { $season = "fall"; }
else { $season = "winter"; }
if($admin[month] < 4) { $mapType = "map1"; }
elseif($admin[month] < 7) { $mapType = "map2"; }
elseif($admin[month] < 10) { $mapType = "map3"; }
else { $mapType = "map4"; }
if($graphic == 0) {
$ltitle = "<img src={$images}/ltitle.jpg></img>";
$ad = "background={$images}/ad.gif";
$season = "background={$images}/{$season}.gif";
$rtitle = "<img src={$images}/rtitle.jpg></img>";
} else {
$ltitle = "&nbsp;";
$ad = "";
$season = "";
$rtitle = ""&nbsp;";";
}
echo "
<table border=0 width=700 cellpadding=0 cellspacing=0 style=font-size:13;>
<tr height=20>
<td width=268 align=left>{$ltitle}</td>
<td width=38 {$ad}></td>
<td width=98>&nbsp;<font color={$color}><b>{$admin[year]}年 {$admin[month]}月</b></font></td>
<td width=18 {$season}></td>
<td width=268 align=right>{$rtitle}</td>
</tr>
<tr>
<td width=700 height=500 colspan=5 background={$images}/{$mapType}.jpg valign=top>
<div style=position:relative;font-size:0;>";
$query = "select nation,name,color,capital from nation";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
$nationcolor[$nation[nation]] = $nation[color];
$nationname[$nation[nation]] = $nation[name];
$nationCapital[$nation[nation]] = $nation[capital];
}
if($type == 0) {
// 운영자의 경우 다 볼 수 있음
if($me[userlevel] >= 5) {
for($i=1; $i <= $allcount; $i++) {
$valid[$i] = 1;
}
} elseif($me[level] == 0) {
// 재야는 내 도시만
$query = "select city,name,nation from city where city='$me[city]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1;
} else {
// 아국 도시
$query = "select city,name from city where nation='$me[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1;
}
// 아국 장수가 있는 타국 도시들 선택
$query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me[nation]' and B.nation!='$me[nation]'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1;
}
// 첩보된 도시
$citys = explode("|", $myNation[spy]);
for($i=0; $i < count($citys); $i++) {
$valid[floor($citys[$i]/10)] = 1;
}
}
}
$x = array(
// 업 허창 낙양 장안 성도 양양 건업 북평 남피 완 수춘 서주 강릉 장사 시상 위례
345, 330, 275, 145, 25, 255, 505, 465, 395, 270, 395, 440, 245, 255, 360, 620,
// 계 복양 진류 여남 하비 서량 하내 한중 상용 덕양 강주 건녕 남해 계양 오 평양
365, 410, 365, 330, 480, 25, 230, 135, 185, 85, 70, 80, 245, 230, 510, 590,
// 사비 계림 진양 평원 북해 초 패 천수 안정 홍농 하변 자동 영안 귀양 주시 운남
605, 655, 295, 440, 470, 365, 430, 70, 95, 210, 45, 75, 115, 90, 30, 30,
// 남영 교지 신야 강하 무릉 영릉 상동 여강 회계 고창 대 안평 졸본 이도 강 저
135, 130, 250, 315, 195, 190, 210, 380, 480, 350, 450, 530, 570, 680, 95, 25,
// 흉노 남만 산월 오환 왜 호관 호로 사곡 함곡 사수 양평 가맹 역경 계교 동황 관도
180, 80, 425, 610, 680, 285, 285, 240, 180, 310, 90, 45, 410, 405, 515, 340,
// 정도 합비 광릉 적도 가정 기산 면죽 이릉 장판 백랑 적벽 파양 탐라 유구
400, 435, 490, 130, 40, 110, 35, 215, 280, 530, 330, 430, 605, 625
);
$y = array(
// 업 허창 낙양 장안 성도 양양 건업 북평 남피 완 수춘 서주 강릉 장사 시상 위례
130, 215, 180, 165, 290, 290, 305, 65, 95, 235, 270, 250, 335, 375, 360, 145,
// 계 복양 진류 여남 하비 서량 하내 한중 상용 덕양 강주 건녕 남해 계양 오 평양
35, 170, 185, 260, 235, 50, 150, 205, 225, 275, 310, 400, 480, 400, 345, 100,
// 사비 계림 진양 평원 북해 초 패 천수 안정 홍농 하변 자동 영안 귀양 주시 운남
205, 200, 60, 115, 155, 230, 220, 105, 145, 175, 190, 245, 295, 360, 345, 415,
// 남영 교지 신야 강하 무릉 영릉 상동 여강 회계 고창 대 안평 졸본 이도 강 저
405, 480, 260, 295, 355, 395, 435, 315, 395, 405, 480, 80, 65, 260, 35, 120,
// 흉노 남만 산월 오환 왜 호관 호로 사곡 함곡 사수 양평 가맹 역경 계교 동황 관도
95, 455, 430, 20, 320, 140, 205, 175, 175, 185, 220, 225, 65, 135, 145, 165,
// 정도 합비 광릉 적도 가정 기산 면죽 이릉 장판 백랑 적벽 파양 탐라 유구
210, 285, 275, 75, 160, 180, 255, 295, 315, 30, 325, 350, 260, 435
);
$query = "select name,level,nation,city,state,region,supply from city";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < $allcount; $i++) {
$city = MYDB_fetch_array($result);
$name = $city[name];
$nation = $nationname[$city[nation]];
$color = $nationcolor[$city[nation]];
$capital = $nationCapital[$city[nation]];
$level = $city[level];
$state = $city[state];
$region = $city[region];
if($me[city] == $city[city]) { $myCity = 1; }
else { $myCity = 0; }
if($capital == $city[city]) { $cap = 1; }
else { $cap = 0; }
city($graphic, $brouserIE,
$type, $name, $nation, $color, $level, $region, $i+1, $valid[$i+1], $x[$i], $y[$i],
$state, $myCity, $city[supply], $cap);
}
echo "
</div>
</td>
</tr>
</table>
";
}
function city($graphic, $brouser, $type, $name, $nation, $color, $level, $region, $city, $valid, $x, $y, $state, $mycity, $supply, $capital) {
global $images;
if($graphic == 0) {
switch($level) {
case 1: $width = 16; $height = 15; break;
case 2: $width = 20; $height = 14; break;
case 3: $width = 14; $height = 14; break;
case 4: $width = 20; $height = 15; break;
case 5: $width = 24; $height = 16; break;
case 6: $width = 26; $height = 18; break;
case 7: $width = 28; $height = 20; break;
case 8: $width = 32; $height = 24; break;
}
} else {
switch($level) {
case 1: $width = 12; $height = 12; break;
case 2: $width = 12; $height = 12; break;
case 3: $width = 14; $height = 14; break;
case 4: $width = 16; $height = 14; break;
case 5: $width = 18; $height = 16; break;
case 6: $width = 20; $height = 16; break;
case 7: $width = 22; $height = 18; break;
case 8: $width = 24; $height = 18; break;
}
}
$x -= floor($width / 2);
$y -= floor($height / 2);
$backwidth = floor($width * 3.0); $backheight = floor($height * 3.0);
$backx = $x - floor(($backwidth - $width)/2);
$backy = $y - floor(($backheight - $height)/2);
$fx = $x + $width - 6;
$fy = $y - 3;
$cx = $x + $width - 4;
$cy = $y - 2;
$ex = $x - 5;
$ey = $y;
// 0 명령화면의 지도(본국 장수 있는 도시 링크),
// 1 전쟁,이동,계략시 지도(전도시 클릭되게),
// 2 사령부 태수임명(본국만 클릭되게)
// 0인 경우 현재도시 링크 생성
if($type == 0 && $valid == 1) { echo "<form name=form$city method=post target=_parent action=b_currentCity.php>"; }
//메인화면
if($graphic == 0) {
if($type == 0 && $valid == 1) {
$tag = "input type=image";
$tail = "><input type=hidden name=citylist value=$city";
//명령중
} elseif($type == 1) {
$tag = "img";
$tail = "onclick='cityselect($city)'";
} else {
$tag = "img";
$tail = "";
}
//성표시
$mid = "src={$images}/cast_{$level}.gif style=width:{$width};height:{$height}; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'";
echo "<div name=city$city style=position:absolute;left:{$x}px;top:{$y}px;z-index:2;font-size:1;><{$tag} {$mid} {$tail}></div>";
//재난표시
if($state > 0) {
$mid2 = "src={$images}/event{$state}.gif style=width:15;height:15; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'";
echo "<div name=state$city style=position:absolute;left:{$ex}px;top:{$ey}px;z-index:3;font-size:1;><{$tag} {$mid2} {$tail}></div>";
}
} else {
//메인화면
if($type == 0 && $valid == 1) {
$tail = " onclick='form{$city}.submit()'><input type=hidden name=citylist value=$city";
//명령중
} elseif($type == 1) {
$tail = "onclick='cityselect($city)'";
} else {
$tail = "";
}
if($color != "") {
$color2 = $color;
} else {
$color2 = "white";
}
//성표시
$mid = "width:{$width};height:{$height};background-color:{$color2}; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'";
echo "<div name=city$city style=position:absolute;left:{$x}px;top:{$y}px;z-index:2;font-size:1;{$mid} {$tail}></div>";
//재난표시
if($state > 0) {
if($state < 10) { $color3 = "blue"; }
elseif($state < 40) { $color3 = "orange"; }
elseif($state < 50) { $color3 = "red"; }
$mid2 = "width:10;height:10;background-color:{$color3}; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'";
echo "<div name=state$city style=position:absolute;left:{$ex}px;top:{$ey}px;z-index:3;font-size:1;{$mid2} {$tail}></div>";
}
}
//공백지 아니면
if($color != "") {
if($graphic == 0) {
//배경국가색
if($brouser == 1) {
echo "<div name=back$city style=position:absolute;left:{$backx}px;top:{$backy}px;z-index:1;background-color:$color;filter:alpha(Opacity:100,style:2,finishOpacity:0);width:{$backwidth};height:{$backheight};></div>";
} else {
echo "
<div name=backlayer$city style=position:absolute;left:{$backx}px;top:{$backy}px;z-index:1;width:{$backwidth};height:{$backheight};>
<img src={$images}/b{$color}.png style=width:{$backwidth};height:{$backheight};></img>
</div>";
}
//깃발표시
if($supply == 1) { $mid3 = "src={$images}/f{$color}.gif style=width:12;height:12; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'"; }
else { $mid3 = "src={$images}/d{$color}.gif style=width:12;height:12; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'"; }
echo "<div name=flag$city style=position:absolute;left:{$fx}px;top:{$fy}px;z-index:4;><{$tag} {$mid3} {$tail}></div>";
//수도표시
if($capital == 1) {
$mid4 = "src={$images}/event51.gif style=width:10;height:10; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()'";
echo "<div name=cap$city style=position:absolute;left:{$cx}px;top:{$cy}px;z-index:5;><{$tag} {$mid4} {$tail}></div>";
}
} else {
//수도표시
if($capital == 1) {
echo "<div name=cap$city style=position:absolute;left:{$cx}px;top:{$cy}px;z-index:5;width:5;height:5;background-color:yellow; onmousemove='showLayer(this,\"".getCityLevel($region, $level)."$name\",\"$nation\", event)' onmouseout='hideLayer()';></div>";
}
}
}
// 0인 경우 현재도시 링크 생성했던거 종료
if($type == 0 && $valid == 1) {
echo "</form>";
}
// 내 도시인 경우 빨간 네모 그리기
if($mycity == 1) {
$width += 8;
$height += 8;
$x -= 4;
$y -= 4;
echo "
<div>
<table border=4 bordercolor=red cellspacing=0 style=position:absolute;left:{$x}px;top:{$y}px;z-index:1;width:{$width};height:{$height};border-style:dotted;font-size:1;>
<tr><td></td></tr>
</table>
</div>";
}
}
function getCityLevel($region, $level) {
switch($region) {
case 1: $str = "【하북|"; break;
case 2: $str = "【중원|"; break;
case 3: $str = "【서북|"; break;
case 4: $str = "【서촉|"; break;
case 5: $str = "【남중|"; break;
case 6: $str = "【 초|"; break;
case 7: $str = "【오월|"; break;
case 8: $str = "【동이|"; break;
}
switch($level) {
case 1: $str .= "수】"; break;
case 2: $str .= "진】"; break;
case 3: $str .= "관】"; break;
case 4: $str .= "이】"; break;
case 5: $str .= "소】"; break;
case 6: $str .= "중】"; break;
case 7: $str .= "대】"; break;
case 8: $str .= "특】"; break;
}
return $str;
}
-43
View File
@@ -1,43 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin(1);
$connect = dbconn();
?>
<html>
<head>
<title>메시지리스트</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php type=text/css>
<?php require('analytics.php'); ?>
</head>
<body oncontextmenu='return false'>
<?php
$query = "select no,nation,skin from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
?>
<table align=center width=1000 height=1375 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr>
<td valign=top width=500>
전체 메세지(최고75자)<br>
<?php MsgFile($me[skin], 1); ?>
<br>
개인 메세지(최고75자)<br>
<?php MsgMe($connect, 2); ?>
</td>
<td valign=top width=500>
<?php MsgDip($connect, 4); ?>
국가 메세지(최고75자)<br>
<?php MsgFile($me[skin], 3, $me[nation]); ?>
</td>
</tr>
</table>
</body>
</html>
-27
View File
@@ -1,27 +0,0 @@
<?php
//임시 땜빵 리팩터링.
require "lib.php";
function dbConnRoot() {
global $connect, $HTTP_COOKIE_VARS;
$f = @file("../d_setting/set.php") or Error("set.php파일이 없습니다. DB설정을 먼저 하십시요!");
for($i=1; $i<= 4; $i++) $f[$i] = trim(str_replace("\n","",$f[$i]));
if(!$connect) $connect = @MYDB_connect($f[1],$f[2],$f[3]) or Error("DB 접속시 에러가 발생했습니다");
@MYDB_select_db($f[4], $connect) or Error("DB Select 에러가 발생했습니다","");
return $connect;
}
class General{
protected
$no, $user_id, $name, $level, $level_exp,
$leadership, $leadership_exp,
$power, $power_exp,
$intel, $intel_exp;
}
class NPCGeneral extends General{
protected
$npc_name, $npcmsg;
}

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