diff --git a/twe/func.php b/twe/func.php index 0efe532d..318cdd56 100644 --- a/twe/func.php +++ b/twe/func.php @@ -956,7 +956,7 @@ function generalInfo($connect, $no, $skin) { else { $general['mode'] = "수비 안함"; } $weapImage = "{$images}/weap{$general['crewtype']}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }; + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; }; $imageTemp = GetImageURL($general['imgsvr']); echo " @@ -1248,25 +1248,13 @@ function pushBatLog($general, $log) { } function pushAllLog($log) { - $size = count($log); - if($size > 0) { - $fp = fopen("logs/_alllog.txt", "a"); - for($i=0; $i < $size; $i++) { - fwrite($fp, $log[$i]."\n"); - } - fclose($fp); - } + $text = join("\n", $log)."\n"; + file_put_contents(__dir__.'/logs/_alllog.txt', $text, FILE_APPEND); } function pushHistory($history) { - $size = count($history); - if($size > 0) { - $fp = fopen("logs/_history.txt", "a"); - for($i=0; $i < $size; $i++) { - fwrite($fp, $history[$i]."\n"); - } - fclose($fp); - } + $text = join("\n", $history)."\n"; + file_put_contents(__dir__.'/logs/_history.txt', $text, FILE_APPEND); } function getRawLog($path, $count, $line_length, $skin){ diff --git a/twe/func_regnpc.php b/twe/func_regnpc.php index a84f3167..e17611cb 100644 --- a/twe/func_regnpc.php +++ b/twe/func_regnpc.php @@ -8,7 +8,7 @@ function RegNPC($connect) { $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; - $img = $admin['img']; + $img = $admin['show_img_level']; // 상성 이름 사진 국가 도시 통 무 지 급 출생 사망 꿈 특기 RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1001, 1, "소제1",$img,1001, 0, "-", 20, 11, 48, 0, 168, 190, "유지", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1002, 1, "헌제",$img,1002, 0, "-", 17, 13, 61, 0, 170, 250, "안전", "-", "한 왕실을 구해줄 이는 진정 없는 것인가..."); diff --git a/twe/install.php b/twe/install.php index b9c41885..9ec60d8b 100644 --- a/twe/install.php +++ b/twe/install.php @@ -143,20 +143,20 @@ if(Session::getUserGrade(true) < 5){
- +
diff --git a/twe/join.php b/twe/join.php index 7b411def..e719e34f 100644 --- a/twe/join.php +++ b/twe/join.php @@ -231,7 +231,7 @@ for($i=0; $i < $nationcount; $i++) {
= 1 && $member['grade'] >= 1 && $member['picture'] != "") { +if($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "") { $imageTemp = GetImageURL($member['imgsvr']); echo " diff --git a/twe/join_post.php b/twe/join_post.php index 643b345e..cd7c1d40 100644 --- a/twe/join_post.php +++ b/twe/join_post.php @@ -174,7 +174,7 @@ if($id_num) { } //특회 전콘 - if($admin['img'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic == 1) { + if($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic == 1) { $face = $member['picture']; $imgsvr = $member['imgsvr']; } else { diff --git a/twe/old/j_old_install2.php b/twe/old/j_old_install2.php index 0398b3c6..3f7929a6 100644 --- a/twe/old/j_old_install2.php +++ b/twe/old/j_old_install2.php @@ -10,7 +10,7 @@ $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'); +$img = Util::array_get($_POST['show_img_level'],'0'); if(Session::getUserGrade(true) < 5){ die('관리자 아님'); diff --git a/twe/processing.php b/twe/processing.php index 8548bc08..63049316 100644 --- a/twe/processing.php +++ b/twe/processing.php @@ -426,7 +426,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -476,7 +476,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -526,7 +526,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -576,7 +576,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -626,7 +626,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -860,7 +860,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -910,7 +910,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -960,7 +960,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -1010,7 +1010,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " @@ -1060,7 +1060,7 @@ function calc(cost, formnum) { $cst = round($cst); $l = $color[$i]; $weapImage = "{$images}/weap{$i}.jpg"; - if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; } + if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; } echo " diff --git a/twe/scenario_1.php b/twe/scenario_1.php index a5ccb59f..50bcd4ce 100644 --- a/twe/scenario_1.php +++ b/twe/scenario_1.php @@ -45,7 +45,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드1 : 184년 황건적의 난 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_10.php b/twe/scenario_10.php index 5f42344d..68d2e361 100644 --- a/twe/scenario_10.php +++ b/twe/scenario_10.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드10 : 225년 칠종칠금 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_11.php b/twe/scenario_11.php index 218c7dae..85314a8f 100644 --- a/twe/scenario_11.php +++ b/twe/scenario_11.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드11 : 228년 출사표 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_12.php b/twe/scenario_12.php index bd8021a5..b6e61707 100644 --- a/twe/scenario_12.php +++ b/twe/scenario_12.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //IF모드1 : 191년 백마장군의 위세 //국가1 원소 국가2 공손찬 국가3 동탁 국가4 원술 국가5 유언 국가6 마등 국가7 유표 diff --git a/twe/scenario_2.php b/twe/scenario_2.php index 1b0a24a3..d7263ce5 100644 --- a/twe/scenario_2.php +++ b/twe/scenario_2.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_190A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드2 : 190년 반동탁연합 //국가1 동탁 국가2 원소 국가3 유표 국가4 조조 국가5 유언 국가6 원술 국가7 손견 diff --git a/twe/scenario_20.php b/twe/scenario_20.php index e305fd67..a4bb79da 100644 --- a/twe/scenario_20.php +++ b/twe/scenario_20.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드1 : 180년 영웅 난무 //////////////////////////외교////////////////////////////////////////////////// diff --git a/twe/scenario_21.php b/twe/scenario_21.php index ebcf9681..4769c2f3 100644 --- a/twe/scenario_21.php +++ b/twe/scenario_21.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드1 : 180년 영웅 집결 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_23.php b/twe/scenario_23.php index aadd6fe6..a4f3e7b0 100644 --- a/twe/scenario_23.php +++ b/twe/scenario_23.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드3 : 180년 영웅 시대 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_25.php b/twe/scenario_25.php index a5290726..ef439950 100644 --- a/twe/scenario_25.php +++ b/twe/scenario_25.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드5 : 180년 영웅독존 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_26.php b/twe/scenario_26.php index 82b5b8b2..e15b004a 100644 --- a/twe/scenario_26.php +++ b/twe/scenario_26.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드6 : 180년 무풍지대 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_27.php b/twe/scenario_27.php index b1d7087c..827ce20b 100644 --- a/twe/scenario_27.php +++ b/twe/scenario_27.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드7 : 180년 가요대잔치 /* //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_28.php b/twe/scenario_28.php index f60cda6a..7cff4e91 100644 --- a/twe/scenario_28.php +++ b/twe/scenario_28.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //가상모드8 : 180년 확산성 밀리언 아서 /* //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_3.php b/twe/scenario_3.php index 7d2ecccc..ac92e01d 100644 --- a/twe/scenario_3.php +++ b/twe/scenario_3.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드3 : 194년 군웅할거 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_4.php b/twe/scenario_4.php index 0e09bf75..1b05b10b 100644 --- a/twe/scenario_4.php +++ b/twe/scenario_4.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드4 : 196년 황제는 허도로 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_5.php b/twe/scenario_5.php index 3e7f8696..3ba2bef9 100644 --- a/twe/scenario_5.php +++ b/twe/scenario_5.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드5 : 200년 관도대전 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_6.php b/twe/scenario_6.php index 25d999ad..8a0031b4 100644 --- a/twe/scenario_6.php +++ b/twe/scenario_6.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드6 : 202년 원가의 분열 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_7.php b/twe/scenario_7.php index c4e2aa37..bed6e6ff 100644 --- a/twe/scenario_7.php +++ b/twe/scenario_7.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드7 : 207년 적벽대전 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_8.php b/twe/scenario_8.php index 37f9a931..bb2b60e3 100644 --- a/twe/scenario_8.php +++ b/twe/scenario_8.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드8 : 213년 익주 공방전 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/scenario_9.php b/twe/scenario_9.php index 3102977b..d8b6d430 100644 --- a/twe/scenario_9.php +++ b/twe/scenario_9.php @@ -44,7 +44,7 @@ $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $admin = MYDB_fetch_array($result); $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend']; -$img = $admin['img']; +$img = $admin['show_img_level']; //역사모드9 : 219년 삼국정립 //////////////////////////국가1///////////////////////////////////////////////// diff --git a/twe/schema.php b/twe/schema.php index 9120ef19..9d6579ed 100644 --- a/twe/schema.php +++ b/twe/schema.php @@ -584,17 +584,18 @@ $emperior_schema = " $diplomacy_schema = " create table diplomacy ( - no int(6) not null auto_increment, - me int(6) default 0, - you int(6) default 0, - state int(6) default 0, - term int(6) default 0, - dead int(8) default 0, - fixed char(128) default '', - reserved char(128) default '', - showing datetime, + `no` INT(6) NOT NULL AUTO_INCREMENT, + `me` INT(6) NOT NULL, + `you` INT(6) NOT NULL, + `state` INT(6) NULL DEFAULT '0', + `term` INT(6) NULL DEFAULT '0', + `dead` INT(8) NULL DEFAULT '0', + `fixed` CHAR(128) NULL DEFAULT '', + `reserved` CHAR(128) NULL DEFAULT '', + `showing` DATETIME NULL DEFAULT NULL, - PRIMARY KEY (no) + PRIMARY KEY (`no`), + UNIQUE INDEX `me` (`me`, `you`) ) ENGINE=INNODB ROW_FORMAT=DYNAMIC DEFAULT CHARSET=UTF8 "; @@ -702,3 +703,17 @@ $history_schema = " "; +/////////////////////////////////////////////////////////////////////////// +// 이벤트 핸들러 테이블 +/////////////////////////////////////////////////////////////////////////// + +$event_schema = " + CREATE TABLE `event` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `condition` MEDIUMTEXT NOT NULL COMMENT 'json', + `action` MEDIUMTEXT NOT NULL COMMENT 'json', + PRIMARY KEY (`id`) + ) + ENGINE=InnoDB + "; + \ No newline at end of file diff --git a/twe/select_npc.php b/twe/select_npc.php index 95de9a1f..2ddc03fa 100644 --- a/twe/select_npc.php +++ b/twe/select_npc.php @@ -83,7 +83,7 @@ for($i=0; $i < $nationcount; $i++) { = 3) { +if($admin['show_img_level'] >= 3) { ?>
장수 선택
장수