-
diff --git a/twe/install.php b/twe/install.php
index 43790b5c..236511ce 100644
--- a/twe/install.php
+++ b/twe/install.php
@@ -1,8 +1,13 @@
재설치하려면 해당 파일을 지우세요");
+include "lib.php";
- @chmod(".",0707);
+if(getUserGrade(true) < 5){
+ die('관리자 아님');
+}
+
+if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.
재설치하려면 해당 파일을 지우세요");
+
+@chmod(".",0707);
?>
diff --git a/twe/install1.php b/twe/install1.php
index 12e49135..65607892 100644
--- a/twe/install1.php
+++ b/twe/install1.php
@@ -1,6 +1,11 @@
재설치하려면 해당 파일을 지우세요");
+include "lib.php";
+
+if(getUserGrade(true) < 5){
+ die('관리자 아님');
+}
+
+if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.
재설치하려면 해당 파일을 지우세요");
?>
diff --git a/twe/install2.php b/twe/install2.php
index 2a8bbcfb..274e4e30 100644
--- a/twe/install2.php
+++ b/twe/install2.php
@@ -1,5 +1,9 @@
diff --git a/twe/install2_ok.php b/twe/install2_ok.php
deleted file mode 100644
index 818a6551..00000000
--- a/twe/install2_ok.php
+++ /dev/null
@@ -1,384 +0,0 @@
-웹 IRC : http://barosl.com/webirc/흠냐 폭력적/선정적인 전콘/전메는 블럭/삭제 대상이 될 수 있습니다.',
- 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:debug all and 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 ""; break;
- case 1: echo ""; break;
- case 2: echo ""; break;
- case 3: echo ""; break;
- case 4: echo ""; break;
- case 5: echo ""; break;
- case 6: echo ""; break;
- case 7: echo ""; break;
- case 8: echo ""; break;
- case 9: echo ""; break;
- case 10: echo ""; break;
- case 11: echo ""; break;
-
- case 12: echo ""; break;
-
- case 20: echo ""; break;
- case 21: echo ""; break;
- case 22: echo ""; break;
- case 23: echo ""; break;
- case 24: echo ""; break;
- case 25: echo ""; break;
- case 26: echo ""; break;
- case 27: echo ""; break;
- case 28: echo ""; break;
- default: echo ""; 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),"");
-}
-
diff --git a/twe/j_build_conf.php b/twe/j_build_conf.php
new file mode 100644
index 00000000..227f9487
--- /dev/null
+++ b/twe/j_build_conf.php
@@ -0,0 +1,98 @@
+false,
+ 'reason'=>'이미 설정 파일이 존재합니다.'
+ ]);
+}
+
diff --git a/twe/j_drop_settings.php b/twe/j_drop_settings.php
new file mode 100644
index 00000000..8d647a45
--- /dev/null
+++ b/twe/j_drop_settings.php
@@ -0,0 +1,40 @@
+query("DROP TABLE IF EXISTS game");
+// 장수 테이블 삭제
+$db->query("DROP TABLE IF EXISTS general");
+// 국가 테이블 삭제
+$db->query("DROP TABLE IF EXISTS nation");
+// 도시 테이블 삭제
+$db->query("DROP TABLE IF EXISTS city");
+// 부대 테이블 삭제
+$db->query("DROP TABLE IF EXISTS troop");
+// 외교 테이블 삭제
+$db->query("DROP TABLE IF EXISTS diplomacy");
+// 토너먼트 테이블 삭제
+$db->query("DROP TABLE IF EXISTS tournament");
+// 거래 테이블 삭제
+$db->query("DROP TABLE IF EXISTS auction");
+// 통계 테이블 삭제
+$db->query("DROP TABLE IF EXISTS statistic");
+// 연감 테이블 삭제
+$db->query("DROP TABLE IF EXISTS history");
+
+// 삭제
+unlink(__DIR__."/d_setting/conf.php");
+
+delInDir("logs");
+delInDir("data/session");
+@unlink("data/connected.php");
+
diff --git a/twe/j_init_scenario.php b/twe/j_init_scenario.php
new file mode 100644
index 00000000..10cfa58d
--- /dev/null
+++ b/twe/j_init_scenario.php
@@ -0,0 +1,40 @@
+ 디렉토리의 퍼미션을 707로 주십시요","");
+//@fwrite($file," 디렉토리의 퍼미션을 707로 주십시요","");
+@fclose($file);
+@mkdir("data",0707);
+@chmod("data",0707);
+//@chmod("d_setting/conf.php",0707);
+
+$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
+
+MYDB_close($connect);
+
+//echo "";
+echo 'install2.php';//TODO:debug all and replace
+
+// 관리자 테이블 생성
+$db->query($game_schema);
+// 장수 테이블 생성
+$db->query($general_schema);
+// 국가 테이블 생성
+$db->query($nation_schema);
+// 도시 테이블 생성
+$db->query($city_schema);
+// 부대 테이블 생성
+$db->query($troop_schema);
+// 토큰 테이블 생성
+$db->query($token_schema);
+// 외교 테이블 생성
+$db->query($diplomacy_schema);
+// 전당 테이블 생성
+$db->query($hall_schema);
+// 토너먼트 테이블 생성
+$db->query($tournament_schema);
+// 거래 테이블 생성
+$db->query($auction_schema);
+// 통계 테이블 생성
+$db->query($statistic_schema);
+// 연감 테이블 생성
+$db->query($history_schema);
\ No newline at end of file
diff --git a/twe/install_ok.php b/twe/j_install.php
similarity index 91%
rename from twe/install_ok.php
rename to twe/j_install.php
index fbfbe85e..a2d4249a 100644
--- a/twe/install_ok.php
+++ b/twe/j_install.php
@@ -5,7 +5,11 @@ include "func.php";
use utilphp\util as util;
-if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.
재설치하려면 해당 파일을 지우세요");
+if(getUserGrade(true) < 5){
+ die('관리자 아님');
+}
+
+if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.
재설치하려면 해당 파일을 지우세요");
$hostname = util::array_get($_POST['hostname'], '');
@@ -95,12 +99,11 @@ if(!isTable($connect, "statistic",$dbname)) @MYDB_query($statistic_schema, $conn
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 파일 생성 실패
디렉토리의 퍼미션을 707로 주십시요","");
-@fwrite($file," 디렉토리의 퍼미션을 707로 주십시요","");
-@fclose($file);
+//TODO:Template로 기록
+
@mkdir("data",0707);
@chmod("data",0707);
-@chmod("d_setting/set.php",0707);
+@chmod("d_setting/conf.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
diff --git a/twe/j_install2.php b/twe/j_install2.php
new file mode 100644
index 00000000..fc57f0d8
--- /dev/null
+++ b/twe/j_install2.php
@@ -0,0 +1,401 @@
+웹 IRC : http://barosl.com/webirc/흠냐 폭력적/선정적인 전콘/전메는 블럭/삭제 대상이 될 수 있습니다.',
+ 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( "업", 8, 620500, 12500, 11300, 10000, 11700, 12200, 1, "9|18|70|78|80"); // 1 : 업
+insertCity("허창", 8, 587600, 12100, 12400, 10000, 11700, 12500, 2, "10|19|38|71|74|80"); // 2 : 허창
+insertCity("낙양", 8, 835700, 11700, 12000, 10000, 12100, 12400, 2, "70|71|72|74"); // 3 : 낙양
+insertCity("장안", 8, 592300, 11600, 12300, 10000, 12000, 11800, 3, "41|73|86"); // 4 : 장안
+insertCity("성도", 8, 652500, 12300, 12500, 10000, 12500, 12300, 4, "26|27|87"); // 5 : 성도
+insertCity("양양", 8, 583700, 12000, 12600, 10000, 11500, 11700, 6, "51|89"); // 6 : 양양
+insertCity("건업", 8, 638600, 11600, 12300, 10000, 11500, 11900, 7, "31|82|83"); // 7 : 건업
+
+insertCity("북평", 7, 486200, 10200, 9500, 8000, 10300, 9900, 1, "77|90"); // 8 : 북평
+insertCity("남피", 7, 503200, 9900, 10100, 8000, 10100, 10500, 1, "1|36|77"); // 9 : 남피
+insertCity( "완", 7, 472400, 10300, 10000, 8000, 10100, 9900, 2, "2|20|51|71"); // 10 : 완
+insertCity("수춘", 7, 514300, 9900, 9600, 8000, 9900, 9500, 2, "12|20|38|82"); // 11 : 수춘
+insertCity("서주", 7, 485300, 10100, 9800, 8000, 10200, 9700, 2, "11|21|38|39"); // 12 : 서주
+insertCity("강릉", 7, 485000, 10500, 9600, 8000, 9500, 9600, 6, "14|53|88|89"); // 13 : 강릉
+insertCity("장사", 7, 471000, 9700, 9900, 8000, 10000, 10500, 6, "13|15|30|53|54"); // 14 : 장사
+insertCity("시상", 7, 525200, 9800, 10000, 10000, 9900, 9600, 7, "14|56|58|91|92"); // 15 : 시상
+insertCity("위례", 7, 492600, 10000, 9300, 8000, 9800, 10300, 8, "32|33|34|60|79"); // 16 : 위례
+
+insertCity( "계", 6, 388500, 7500, 8000, 6000, 7800, 8100, 1, "35|77"); // 17 : 계
+insertCity("복양", 6, 418500, 8000, 8300, 6000, 8200, 8000, 2, "1|19|78|81"); // 18 : 복양
+insertCity("진류", 6, 395700, 8200, 8000, 6000, 8000, 8300, 2, "2|18|74|80|81"); // 19 : 진류
+insertCity("여남", 6, 383100, 7700, 8100, 6000, 8400, 7700, 2, "10|11|38"); // 20 : 여남
+insertCity("하비", 6, 427800, 8500, 8300, 6000, 8200, 7800, 2, "12|83"); // 21 : 하비
+insertCity("서량", 6, 387400, 7700, 7900, 6000, 8300, 8000, 3, "40|63|64"); // 22 : 서량
+insertCity("하내", 6, 373600, 7700, 8100, 6000, 8100, 8000, 3, "35|42|65|70"); // 23 : 하내
+insertCity("한중", 6, 402700, 7700, 8400, 6000, 8000, 8500, 4, "25|75|86"); // 24 : 한중
+insertCity("상용", 6, 368700, 7800, 7600, 6000, 7700, 8100, 4, "24|51"); // 25 : 상용
+insertCity("덕양", 6, 380300, 8100, 8400, 6000, 7900, 7700, 4, "5|27|44|45"); // 26 : 덕양
+insertCity("강주", 6, 412600, 7900, 8000, 6000, 8400, 8100, 4, "5|26|45|46|47"); // 27 : 강주
+insertCity("건녕", 6, 376500, 8200, 8000, 6000, 8600, 8100, 5, "46|48|49"); // 28 : 건녕
+insertCity("남해", 6, 380300, 8200, 7600, 6000, 8000, 8100, 5, "50|55|59|67"); // 29 : 남해
+insertCity("계양", 6, 395500, 8300, 8000, 6000, 8100, 7700, 6, "14|54|55"); // 30 : 계양
+insertCity( "오", 6, 435500, 7700, 8100, 6000, 7700, 7600, 7, "7|57|92|93"); // 31 : 오
+insertCity("평양", 6, 398200, 7800, 8000, 6000, 8300, 7800, 8, "16|61"); // 32 : 평양
+insertCity("사비", 6, 415700, 7700, 7900, 6000, 7800, 8000, 8, "16|34|93"); // 33 : 사비
+insertCity("계림", 6, 391100, 8000, 7400, 6000, 8100, 7800, 8, "16|33|62|93"); // 34 : 계림
+
+insertCity("진양", 5, 307400, 5600, 5900, 4000, 6400, 5900, 1, "17|23|70"); // 35 : 진양
+insertCity("평원", 5, 307400, 6200, 6500, 4000, 6100, 6300, 1, "9|37|78"); // 36 : 평원
+insertCity("북해", 5, 314600, 5500, 6300, 4000, 6300, 5800, 1, "36|39|79"); // 37 : 북해
+insertCity( "초", 5, 328600, 6000, 6200, 4000, 6200, 5700, 2, "2|11|12|20|81"); // 38 : 초
+insertCity( "패", 5, 287700, 6400, 5800, 4000, 5800, 5900, 2, "12|37|81"); // 39 : 패
+insertCity("천수", 5, 298500, 5900, 6400, 4000, 6000, 5800, 3, "22|41|64|84"); // 40 : 천수
+insertCity("안정", 5, 276400, 5700, 5900, 4000, 5700, 6200, 3, "4|40|85"); // 41 : 안정
+insertCity("홍농", 5, 274800, 5700, 6300, 4000, 5800, 6300, 3, "23|72|73"); // 42 : 홍농
+insertCity("하변", 5, 278500, 5800, 6200, 4000, 6000, 5600, 4, "76|85"); // 43 : 하변
+insertCity("자동", 5, 287000, 5700, 5500, 4000, 6000, 5800, 4, "26|75|76|87"); // 44 : 자동
+insertCity("영안", 5, 315300, 6200, 5900, 4000, 5800, 5900, 4, "26|27|88"); // 45 : 영안
+insertCity("귀양", 5, 274600, 5800, 6100, 4000, 6100, 5800, 5, "27|28|47"); // 46 : 귀양
+insertCity("주시", 5, 282800, 6000, 5900, 4000, 5800, 6300, 5, "27|46|48"); // 47 : 주시
+insertCity("운남", 5, 325800, 6200, 6000, 4000, 6400, 6100, 5, "28|47|66"); // 48 : 운남
+insertCity("남영", 5, 285300, 5900, 6200, 4000, 5800, 5700, 5, "28|54|66"); // 49 : 남영
+insertCity("교지", 5, 319500, 5800, 5900, 4000, 5800, 5900, 5, "29|66"); // 50 : 교지
+insertCity("신야", 5, 278600, 6000, 6200, 4000, 5800, 5500, 6, "6|10|25"); // 51 : 신야
+insertCity("강하", 5, 307400, 5500, 5600, 4000, 5700, 6000, 6, "89|91"); // 52 : 강하
+insertCity("무릉", 5, 319600, 5800, 6300, 4000, 6300, 5800, 6, "13|14|54"); // 53 : 무릉
+insertCity("영릉", 5, 284900, 6200, 5800, 4000, 6200, 6200, 6, "14|30|49|53"); // 54 : 영릉
+insertCity("상동", 5, 276700, 5800, 5900, 4000, 6200, 5800, 6, "29|30|58"); // 55 : 상동
+insertCity("여강", 5, 290500, 5600, 5800, 4000, 6000, 5500, 7, "15|82|91|92"); // 56 : 여강
+insertCity("회계", 5, 300500, 6400, 5900, 4000, 6200, 6400, 7, "31|67"); // 57 : 회계
+insertCity("고창", 5, 280200, 5700, 6200, 4000, 5800, 6300, 7, "15|55|67"); // 58 : 고창
+insertCity( "대", 5, 325600, 6000, 6200, 4000, 5700, 6000, 7, "29|67|94"); // 59 : 대
+insertCity("안평", 5, 293700, 6300, 5900, 4000, 5900, 6300, 8, "16|61|79|90"); // 60 : 안평
+insertCity("졸본", 5, 293900, 5500, 5900, 4000, 6000, 5800, 8, "32|60|68"); // 61 : 졸본
+insertCity("이도", 5, 317400, 5800, 6100, 4000, 5800, 5600, 8, "34|69|93"); // 62 : 이도
+
+insertCity( "강", 4, 209500, 4000, 4200, 2000, 4300, 4000, 3, "22|84"); // 63 : 강
+insertCity( "저", 4, 195700, 4000, 4200, 2000, 4300, 4200, 3, "22|40|85"); // 64 : 저
+insertCity("흉노", 4, 206400, 4000, 4100, 2000, 4000, 3800, 3, "23|84"); // 65 : 흉노
+insertCity("남만", 4, 237800, 4000, 4200, 2000, 4300, 4500, 5, "48|49|50"); // 66 : 남만
+insertCity("산월", 4, 227500, 4000, 3700, 2000, 4300, 3800, 7, "29|57|58|59"); // 67 : 산월
+insertCity("오환", 4, 215300, 4200, 3700, 2000, 4300, 4000, 8, "61|90"); // 68 : 오환
+insertCity( "왜", 4, 206500, 3900, 3700, 2000, 4300, 4100, 8, "62|94"); // 69 : 왜
+
+insertCity("호관", 3, 88700, 1900, 1800, 2000, 9500, 9600, 1, "1|3|23|35"); // 70 : 호관
+insertCity("호로", 3, 111200, 2200, 2100, 2000, 10300, 9800, 2, "2|3|10"); // 71 : 호로
+insertCity("사곡", 3, 100800, 2100, 1900, 2000, 9900, 10100, 3, "3|42"); // 72 : 사곡
+insertCity("함곡", 3, 108100, 2000, 2200, 2000, 10100, 10200, 3, "4|42"); // 73 : 함곡
+insertCity("사수", 3, 95800, 1700, 1900, 2000, 9500, 9600, 2, "2|3|19|80"); // 74 : 사수
+insertCity("양평", 3, 86800, 1900, 1900, 2000, 9700, 9600, 4, "24|44|86"); // 75 : 양평
+insertCity("가맹", 3, 85500, 1700, 1800, 2000, 9600, 9500, 4, "43|44"); // 76 : 가맹
+
+insertCity("역경", 2, 98500, 1800, 1900, 2000, 3900, 4100, 1, "8|9|17"); // 77 : 역경
+insertCity("계교", 2, 101200, 2100, 1900, 2000, 4000, 4200, 1, "1|18|36"); // 78 : 계교
+insertCity("동황", 2, 99200, 1900, 2100, 2000, 3800, 4000, 1, "16|37|60"); // 79 : 동황
+insertCity("관도", 2, 112300, 2200, 2000, 2000, 4200, 4300, 2, "1|2|19|74"); // 80 : 관도
+insertCity("정도", 2, 108500, 2100, 2100, 2000, 4100, 3800, 2, "18|19|38|39"); // 81 : 정도
+insertCity("합비", 2, 99800, 2000, 1900, 2000, 3900, 4100, 2, "7|11|56"); // 82 : 합비
+insertCity("광릉", 2, 100100, 2000, 2100, 2000, 4100, 4000, 2, "7|21"); // 83 : 광릉
+insertCity("적도", 2, 95200, 1800, 1700, 2000, 3800, 3700, 3, "40|63|65"); // 84 : 적도
+insertCity("가정", 2, 93100, 1700, 1700, 2000, 3600, 3800, 3, "41|43|64"); // 85 : 가정
+insertCity("기산", 2, 100500, 1900, 1800, 2000, 4100, 4000, 4, "4|24|75"); // 86 : 기산
+insertCity("면죽", 3, 109300, 2200, 2100, 2000, 10800, 9900, 4, "5|44"); // 87 : 면죽
+insertCity("이릉", 2, 96800, 1800, 1900, 2000, 3900, 4100, 6, "13|45"); // 88 : 이릉
+insertCity("장판", 2, 103200, 2100, 2000, 2000, 4000, 3700, 6, "6|13|52|91"); // 89 : 장판
+insertCity("백랑", 2, 105200, 2200, 1900, 2000, 3800, 4200, 8, "8|60|68"); // 90 : 백랑
+
+insertCity("적벽", 1, 111700, 2300, 2100, 2000, 4200, 4100, 7, "15|52|56|89"); // 91 : 적벽
+insertCity("파양", 1, 103700, 2000, 2200, 2000, 3800, 3800, 7, "15|31|56"); // 92 : 파양
+insertCity("탐라", 1, 113000, 2200, 2100, 2000, 4300, 4100, 8, "31|33|34|62"); // 93 : 탐라
+insertCity("유구", 1, 92100, 1700, 1800, 2000, 3700, 3700, 8, "59|69"); // 94 : 유구
+
+//TODO:debug all and 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 ""; break;
+ case 1: echo ""; break;
+ case 2: echo ""; break;
+ case 3: echo ""; break;
+ case 4: echo ""; break;
+ case 5: echo ""; break;
+ case 6: echo ""; break;
+ case 7: echo ""; break;
+ case 8: echo ""; break;
+ case 9: echo ""; break;
+ case 10: echo ""; break;
+ case 11: echo ""; break;
+
+ case 12: echo ""; break;
+
+ case 20: echo ""; break;
+ case 21: echo ""; break;
+ case 22: echo ""; break;
+ case 23: echo ""; break;
+ case 24: echo ""; break;
+ case 25: echo ""; break;
+ case 26: echo ""; break;
+ case 27: echo ""; break;
+ case 28: echo ""; break;
+ default: echo ""; break;
+}
+*/
+function insertCity($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;
+ }
+
+ getDB()->insert('city',[
+ 'name'=>$name,
+ 'level'=>$level,
+ 'path'=>$path,
+ 'pop'=>$pop,
+ 'pop2'=>$pop2,
+ 'agri'=>$agri,
+ 'agri2'=>$agri2,
+ 'comm'=>$comm,
+ 'comm2'=>$comm2,
+ 'secu'=>$secu,
+ 'secu2'=>$secu2,
+ 'rate'=>50,
+ 'trade'=>100,
+ 'def'=>$def,
+ 'def2'=>$def2,
+ 'wall'=>$wall,
+ 'wall2'=>$wall2,
+ 'gen1'=>0,
+ 'gen2'=>0,
+ 'gen3'=>0,
+ 'region'=>$region
+ ]);
+}
+
diff --git a/twe/install3_ok.php b/twe/j_install3.php
similarity index 75%
rename from twe/install3_ok.php
rename to twe/j_install3.php
index b5d741aa..6d8973a1 100644
--- a/twe/install3_ok.php
+++ b/twe/j_install3.php
@@ -2,6 +2,10 @@
include "lib.php";
include "func.php";
+if(getUserGrade(true) < 5){
+ die('관리자 아님');
+}
+
$connect=dbConn();
LogHistory(1);
diff --git a/twe/j_msgsubmit.php b/twe/j_msgsubmit.php
index c2db0e7f..fda0ea48 100644
--- a/twe/j_msgsubmit.php
+++ b/twe/j_msgsubmit.php
@@ -54,7 +54,7 @@ if(getBlockLevel() == 1 || getBlockLevel() == 3) {
$conlimit = $db->queryFirstField('select conlimit from game where no=1');
-$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`userlevel`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', getUserID());
+$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', getUserID());
if(!$me){
resetSessionGeneralValues();
@@ -65,7 +65,7 @@ if(!$me){
]);
}
-$con = checkLimit($me['userlevel'], $me['con'], $conlimit);
+$con = checkLimit($me['con'], $conlimit);
if($con >= 2) {
returnJson([
'result' => false,
diff --git a/twe/j_server_basic_info.php b/twe/j_server_basic_info.php
new file mode 100644
index 00000000..6a4a5d66
--- /dev/null
+++ b/twe/j_server_basic_info.php
@@ -0,0 +1,94 @@
+'x',
+ 'me'=>'no'
+ ]);
+}
+
+//FIXME:Name이 없는 동명의 함수가 있음
+function getScenarioName($scenario) {
+ switch($scenario) {
+ case 0: $str = "공백지모드"; break;
+ case 1: $str = "역사모드1 : 184년 황건적의 난"; break;
+ case 2: $str = "역사모드2 : 190년 반동탁연합"; break;
+ case 3: $str = "역사모드3 : 194년 군웅할거"; break;
+ case 4: $str = "역사모드4 : 196년 황제는 허도로"; break;
+ case 5: $str = "역사모드5 : 200년 관도대전"; break;
+ case 6: $str = "역사모드6 : 202년 원가의 분열"; break;
+ case 7: $str = "역사모드7 : 207년 적벽대전"; break;
+ case 8: $str = "역사모드8 : 213년 익주 공방전"; break;
+ case 9: $str = "역사모드9 : 219년 삼국정립"; break;
+ case 10: $str = "역사모드10 : 225년 칠종칠금"; break;
+ case 11: $str = "역사모드11 : 228년 출사표"; break;
+
+ case 12: $str = "IF모드1 : 191년 백마장군의 위세"; break;
+
+ case 20: $str = "가상모드1 : 180년 영웅 난무"; break;
+ case 21: $str = "가상모드1 : 180년 영웅 집결"; break;
+ case 22: $str = "가상모드2 : 179년 훼신 집결"; break;
+ case 23: $str = "가상모드3 : 180년 영웅 시대"; break;
+ case 24: $str = "가상모드4 : 180년 결사항전"; break;
+ case 25: $str = "가상모드5 : 180년 영웅독존"; break;
+ case 26: $str = "가상모드6 : 180년 무풍지대"; break;
+ case 27: $str = "가상모드7 : 180년 가요대잔치"; break;
+ case 28: $str = "가상모드8 : 180년 확산성 밀리언 아서"; break;
+ default: $str = "시나리오?"; break;
+ }
+ return $str;
+}
+
+function getTurnTerm($term) {
+ switch($term) {
+ case 0: $str = "120분 턴 서버"; break;
+ case 1: $str = "60분 턴 서버"; break;
+ case 2: $str = "30분 턴 서버"; break;
+ case 3: $str = "20분 턴 서버"; break;
+ case 4: $str = "10분 턴 서버"; break;
+ case 5: $str = "5분 턴 서버"; break;
+ case 6: $str = "2분 턴 서버"; break;
+ case 7: $str = "1분 턴 서버"; break;
+ }
+ return $str;
+}
+
+$db = getDB();
+
+$game = $db->queryFirstRow('SELECT isUnited, npcMode, year, month, scenario, maxgeneral as maxUserCnt, turnTerm from game where `no`=1');
+
+$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
+$genCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` < 2');
+$npcCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` >= 2');
+
+$game['turnTerm'] = getTurnTerm($game['turnTerm']);
+$game['scenario'] = getScenarioName($game['scenario']);
+$game['userCnt'] = $genCnt;
+$game['npcCnt'] = $npcCnt;
+
+$generalID = getGeneralID(false, false);
+$userGrade = getUserGrade();
+$me = [
+ 'blocked'=> ($userGrade == 0)
+];
+
+if($generalID){
+ $general = queryFirstRow('SELECT name, picture, imgsvr from general where no=%i', $generalID);
+ if($general){
+ $me['name'] = $general['name'];
+
+ if($me['imgsvr'] == 0) {
+ $me['picture'] = IMAGE.W.$me['PICTURE'];
+ } else {
+ $me['picture'] = '../d_pic/'.$me['PICTURE'];
+ }
+ }
+}
+
+//TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것.
+jsonReturn([
+ 'game'=>$game,
+ 'me'=>$me
+]);
\ No newline at end of file
diff --git a/twe/join_post.php b/twe/join_post.php
index 01acca2e..c1cde1cd 100644
--- a/twe/join_post.php
+++ b/twe/join_post.php
@@ -179,8 +179,6 @@ if($id_num) {
$face = "default.jpg";
$imgsvr = 0;
}
- //특회
- $userlevel = $member['grade'];
//성격 랜덤시
if($character == 11) $character = rand()%10;
@@ -207,7 +205,6 @@ if($id_num) {
'crew' => 0,
'train' => 0,
'atmos' => 0,
- 'userlevel' => $userlevel,
'level' => 0,
'turntime' => $turntime,
'killturn' => 6,
diff --git a/twe/preprocessing.php b/twe/preprocessing.php
index 804ed7f9..1123d3b2 100644
--- a/twe/preprocessing.php
+++ b/twe/preprocessing.php
@@ -10,11 +10,11 @@ $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,userlevel,con from general where owner='{$_SESSION['noMember']}'";
+$query = "select no,name,nation,con from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
-$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
+$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) {
//echo "";
echo 'index.php';//TODO:debug all and replace
diff --git a/twe/reset.php b/twe/reset.php
index e763976d..26bb2bc8 100644
--- a/twe/reset.php
+++ b/twe/reset.php
@@ -3,10 +3,7 @@ include "lib.php";
include "func.php";
include "schema.php";
-$userID = getUserID();
-$userLevel = toInt(getRootDB()->queryFirstField('select userlevel from member where no=%i',$userID));
-
-if($userLevel < 5){
+if(getUserGrade(true) < 5){
echo '관리자 아님';
die();
}
@@ -17,7 +14,7 @@ $connect = dbConn();
// 삭제
-unlink("d_setting/set.php");
+unlink("d_setting/conf.php");
// DB에 커넥트 하고 DB NAME으로 select DB
$connect = @MYDB_connect($hostname,$user_id,$password) or Error("MySQL-DB Connect Error!!!","");
@@ -28,28 +25,29 @@ delInDir("logs");
delInDir("data/session");
@unlink("data/connected.php");
+
// 관리자 테이블 삭제
-if(isTable($connect, "game",$dbname)) @MYDB_query("drop table game", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "game",$dbname)) @MYDB_query("DROP TABLE IF EXISTS game", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 장수 테이블 삭제
-if(isTable($connect, "gen",$dbname)) @MYDB_query("drop table general", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "gen",$dbname)) @MYDB_query("DROP TABLE IF EXISTS general", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 국가 테이블 삭제
-if(isTable($connect, "nation",$dbname)) @MYDB_query("drop table nation", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "nation",$dbname)) @MYDB_query("DROP TABLE IF EXISTS nation", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 도시 테이블 삭제
-if(isTable($connect, "city",$dbname)) @MYDB_query("drop table city", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "city",$dbname)) @MYDB_query("DROP TABLE IF EXISTS city", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 테이블 삭제
-if(isTable($connect, "troop",$dbname)) @MYDB_query("drop table troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "troop",$dbname)) @MYDB_query("DROP TABLE IF EXISTS troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 토큰 테이블 삭제
-if(isTable($connect, "token",$dbname)) @MYDB_query("drop table token", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "token",$dbname)) @MYDB_query("DROP TABLE IF EXISTS token", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 테이블 삭제
-if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("drop table diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("DROP TABLE IF EXISTS diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 토너먼트 테이블 삭제
-if(isTable($connect, "tournament",$dbname)) @MYDB_query("drop table tournament", $connect) or Error(__LINE__.MYDB_error($connect),"");
+if(isTable($connect, "tournament",$dbname)) @MYDB_query("DROP TABLE IF EXISTS tournament", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 거래 테이블 삭제
-if(isTable($connect, "auction",$dbname)) @MYDB_query("drop table auction", $connect) or Error("drop ".MYDB_error($connect),"");
+if(isTable($connect, "auction",$dbname)) @MYDB_query("DROP TABLE IF EXISTS 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, "statistic",$dbname)) @MYDB_query("DROP TABLE IF EXISTS 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, "history",$dbname)) @MYDB_query("DROP TABLE IF EXISTS history", $connect) or Error("drop ".MYDB_error($connect),"");
// 관리자 테이블 생성
if(!isTable($connect, "game",$dbname)) @MYDB_query($game_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -77,12 +75,12 @@ if(!isTable($connect, "statistic",$dbname)) @MYDB_query($statistic_schema, $conn
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 파일 생성 실패
디렉토리의 퍼미션을 707로 주십시요","");
-@fwrite($file," 디렉토리의 퍼미션을 707로 주십시요","");
+$file=@fopen("d_setting/conf.php","w") or Error("conf.php 파일 생성 실패
디렉토리의 퍼미션을 707로 주십시요","");
+@fwrite($file," 디렉토리의 퍼미션을 707로 주십시요","");
@fclose($file);
@mkdir("data",0707);
@chmod("data",0707);
-@chmod("d_setting/set.php",0707);
+@chmod("d_setting/conf.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
diff --git a/twe/schema.php b/twe/schema.php
index ea696f1e..89cce609 100644
--- a/twe/schema.php
+++ b/twe/schema.php
@@ -87,7 +87,6 @@ CREATE TABLE `general` (
`tnmt` INT(1) NULL DEFAULT '1',
`map` INT(1) NULL DEFAULT '0',
`myset` INT(1) NULL DEFAULT '3',
- `userlevel` INT(1) NULL DEFAULT '1',
`tournament` INT(1) NULL DEFAULT '0',
`vote` INT(1) NULL DEFAULT '0',
`newvote` INT(1) NULL DEFAULT '0',
diff --git a/twe/select_npc_post.php b/twe/select_npc_post.php
index d8daa726..af5a8cb9 100644
--- a/twe/select_npc_post.php
+++ b/twe/select_npc_post.php
@@ -81,9 +81,6 @@ if($admin['npcmode'] != 1) {
exit;
*/
} else {
- //특회
- $userlevel = $member['grade'];
-
$query = "
update general set
name2='{$member['name']}',
@@ -94,7 +91,6 @@ if($admin['npcmode'] != 1) {
mode=2,
map=0,
owner='$userID',
- userlevel='{$userlevel}'
where no='{$npcid}'
";
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
diff --git a/twe/turn.php b/twe/turn.php
index 23a22120..37c00c4c 100644
--- a/twe/turn.php
+++ b/twe/turn.php
@@ -12,11 +12,11 @@ $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,userlevel,con from general where owner='{$_SESSION['noMember']}'";
+$query = "select no,name,nation,con from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
-$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
+$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) {
//echo "";
echo 'index.php';//TODO:debug all and replace
|