From f2de5a5edab6b56669bdac4c1dbcc8db8e2c8545 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 10 Mar 2018 23:08:22 +0900 Subject: [PATCH 01/13] =?UTF-8?q?localStorage=EC=97=90=20=EC=A0=91?= =?UTF-8?q?=EC=86=8D=20=EC=9E=A5=EC=86=8C=EB=A5=BC=20=EB=B3=B4=EA=B4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i_login/Action.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/i_login/Action.js b/i_login/Action.js index 12331ac..387227b 100644 --- a/i_login/Action.js +++ b/i_login/Action.js @@ -1,3 +1,8 @@ +//localStorage for extremely old browsers +(function(){if(!this.localStorage)if(this.globalStorage)try{this.localStorage=this.globalStorage}catch(e){}else{var a=document.createElement("div");a.style.display="none";document.getElementsByTagName("head")[0].appendChild(a);if(a.addBehavior){a.addBehavior("#default#userdata");var d=this.localStorage={length:0,setItem:function(b,d){a.load("localStorage");b=c(b);a.getAttribute(b)||this.length++;a.setAttribute(b,d);a.save("localStorage")},getItem:function(b){a.load("localStorage");b=c(b);return a.getAttribute(b)}, +removeItem:function(b){a.load("localStorage");b=c(b);a.removeAttribute(b);a.save("localStorage");this.length--;if(0>this.length)this.length=0},clear:function(){a.load("localStorage");for(var b=0;attr=a.XMLDocument.documentElement.attributes[b++];)a.removeAttribute(attr.name);a.save("localStorage");this.length=0},key:function(b){a.load("localStorage");return a.XMLDocument.documentElement.attributes[b]}},c=function(a){return a.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g, +"-")};a.load("localStorage");d.length=a.XMLDocument.documentElement.attributes.length}}})(); + function Login_Import() { ImportAction(HOME+I+LOGIN+W+FINDPW+W+ACTION); ImportAction(HOME+I+LOGIN+W+JOIN+W+ACTION); @@ -20,8 +25,6 @@ function Login_Init() { $(".Login_Emperior").click(function() { window.open('../che/a_emperior.php'); }); $(".Login_Traffic").click(function() { window.open('../che/a_traffic.php'); }); - $("#Login_00010007").focus(Login_DefaultConMsg); - $("#Login_00010008").click(Login_Findpw); $("#Login_00010009").click(Login_Join); $("#Login_00010010").click(Login_Login); @@ -42,15 +45,18 @@ function Login_Enter(e) { function Login_Update() { $("#Login_00010003").val(""); $("#Login_00010005").val(""); - $("#Login_00010007").val(""); + var oldLocation = localStorage.getItem('sammo_login_location'); + if(oldLocation){ + $("#Login_00010007").val(oldLocation); + } + else{ + $("#Login_00010007").val(""); + } + $("#Login_00010003").focus(); } -function Login_DefaultConMsg() { - $("#Login_00010007").val("자택"); -} - function Login_Login() { var id = $("#Login_00010003").val(); var pw = $("#Login_00010005").val(); @@ -78,6 +84,8 @@ function Login_Login() { return; } + localStorage.setItem('sammo_login_location',conmsg); + pw = hex_md5(pw+""+pw)+""+hex_md5(token); Popup_Wait(function() { From 420c2ff032e917db19a86c249d46010766bdae3f Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 10 Mar 2018 23:17:40 +0900 Subject: [PATCH 02/13] =?UTF-8?q?=EB=AC=B4=EC=9E=A5=20=ED=95=84=EC=82=B4?= =?UTF-8?q?=20=ED=99=95=EB=A5=A0=20=EA=B3=84=EC=88=98=EB=A5=BC=201.0?= =?UTF-8?q?=EC=97=90=EC=84=9C=200.7=EB=A1=9C=20=EA=B0=90=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/process_war.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/che_close/process_war.php b/che_close/process_war.php index e69f014..d53b5e8 100644 --- a/che_close/process_war.php +++ b/che_close/process_war.php @@ -1472,6 +1472,9 @@ function CriticalRatio3($general) { if ($crewtype >= 3) { $ratio /= 2; } + else{ + $ratio *= 0.7; + } $ratio = round($ratio); $ratio += 5; From 7be3104660d1bb1d47010a828e9a78a644433910 Mon Sep 17 00:00:00 2001 From: sars Date: Sat, 10 Mar 2018 02:24:43 -0800 Subject: [PATCH 03/13] =?UTF-8?q?=EB=9E=9C=EB=8D=A4=EC=9E=84=EA=B4=80?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=20=EB=A9=94=EC=84=B8=EC=A7=80=20=EB=8B=A4?= =?UTF-8?q?=EB=A5=B4=EA=B2=8C=20=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/func_process.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/che_close/func_process.php b/che_close/func_process.php index e922a6c..d1247d8 100644 --- a/che_close/func_process.php +++ b/che_close/func_process.php @@ -1678,9 +1678,15 @@ function process_25($connect, &$general) { } elseif(strpos($general['nations'], ",{$nation['nation']},") > 0) { $log[count($log)] = "●{$admin[month]}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date"; } else { - $alllog[count($alllog)] = "●{$admin[month]}월:$general[name](이)가 $nation[name]임관했습니다."; - $log[count($log)] = "●{$admin[month]}월:$nation[name]에 임관했습니다. <1>$date"; - $general = addHistory($connect, $general, "●$admin[year]년 $admin[month]월:$nation[name]에 임관"); + if($where == 99 || $where == 98) { + $alllog[count($alllog)] = "●{$admin[month]}월:$general[name](이)가 어쩌다보니 $nation[name]임관했습니다."; + $log[count($log)] = "●{$admin[month]}월:$nation[name]에 랜덤으로 임관했습니다. <1>$date"; + $general = addHistory($connect, $general, "●$admin[year]년 $admin[month]월:$nation[name]에 랜덤임관"); + } else { + $alllog[count($alllog)] = "●{$admin[month]}월:$general[name](이)가 $nation[name]임관했습니다."; + $log[count($log)] = "●{$admin[month]}월:$nation[name]에 임관했습니다. <1>$date"; + $general = addHistory($connect, $general, "●$admin[year]년 $admin[month]월:$nation[name]에 임관"); + } if($gencount < 10) { $exp = 700; } else { $exp = 100; } From 086b579fb5dbaace8dc2d6cf0d7f5b06721fab46 Mon Sep 17 00:00:00 2001 From: sars Date: Sat, 10 Mar 2018 02:27:17 -0800 Subject: [PATCH 04/13] =?UTF-8?q?=EC=8B=9C=EC=9E=91=EB=82=98=EC=9D=B4=2025?= =?UTF-8?q?=EC=84=B8=EB=B6=80=ED=84=B0=2032=EC=84=B8=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/join_post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/che_close/join_post.php b/che_close/join_post.php index 60ed452..793c8bf 100644 --- a/che_close/join_post.php +++ b/che_close/join_post.php @@ -141,7 +141,7 @@ if($id_num) { } $city = $city[city]; - $total = rand() % 6; + $total = 3 + rand() % 3; $pleader = rand() % 100; $ppower = rand() % 100; $pintel = rand() % 100; @@ -154,7 +154,7 @@ if($id_num) { $power = $power + $ppower; $intel = $intel + $pintel; - $age = 20 + ($pleader + $ppower + $pintel) * 2 + (rand() % 2); + $age = 20 + ($pleader + $ppower + $pintel) * 2 - (rand() % 2); // 아직 남았고 천재등록상태이면 특기 부여 if($genius == 1) { $specage2 = $age; From 14e5e1459779b52e7baa103f7ac05c8d307ddbc5 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Mar 2018 02:42:18 +0900 Subject: [PATCH 05/13] =?UTF-8?q?DB=20=EA=B3=84=EC=A0=95=EC=9D=84=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B3=A0?= =?UTF-8?q?=EB=8F=84=20=EB=A6=AC=EC=85=8B=EC=9D=B4=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=9C=20=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이미 기능이 사라진 N생성 버튼 제거 - 기존의 DB까지 포함한 초기화를 '완전 리셋' - 제대로 동작하지 않던 폐쇄중 로그인 변경 - 리셋 프로세스에 권한을 제대로 검사하지 않는 문제 해결 --- che_close/func.php | 2 +- che_close/install.php | 26 +++++++++++++---- che_close/install2.php | 5 +++- che_close/install2_ok.php | 4 +-- che_close/install3_ok.php | 1 + che_close/install_ok.php | 50 +++++++++++++++++++++----------- che_close/lib.php | 55 ++++++++++++++++++++++++++++++++++++ che_close/logout_process.php | 6 +++- che_close/reset.php | 24 +--------------- i_entrance/adminAction.js | 4 +-- i_entrance/adminInc.php | 6 ++-- i_entrance/adminPost.php | 3 ++ 12 files changed, 132 insertions(+), 54 deletions(-) diff --git a/che_close/func.php b/che_close/func.php index cd662c1..96aeb76 100644 --- a/che_close/func.php +++ b/che_close/func.php @@ -90,7 +90,7 @@ function delInDir($dir) { deldir("$dir/$FolderOrFile"); } // recursive else { - unlink("$dir/$FolderOrFile"); + @unlink("$dir/$FolderOrFile"); } } } diff --git a/che_close/install.php b/che_close/install.php index 10f0fc7..04057a2 100644 --- a/che_close/install.php +++ b/che_close/install.php @@ -1,8 +1,23 @@
재설치하려면 해당 파일을 지우세요"); +include "lib.php"; - @chmod(".",0707); +$justReset = isset($_GET['just_reset'])?intval($_GET['just_reset']):0; + +if(file_exists("d_setting/set.php")){ + //DB 리셋만 하려는 것인지 검사 필요. + $connect = dbConn(); + requireUserLevel($connect, 5); + + if(!$justReset){ + error("이미 set.php가 생성되어 있습니다.

재설치하려면 해당 파일을 지우세요"); + } + +} +else{ + $justReset = 0; +} + +@chmod(".",0707); ?> @@ -72,9 +87,10 @@ if(!$check) {

- + diff --git a/che_close/install2.php b/che_close/install2.php index 4f2f068..15f6bf4 100644 --- a/che_close/install2.php +++ b/che_close/install2.php @@ -1,5 +1,8 @@ diff --git a/che_close/install2_ok.php b/che_close/install2_ok.php index 9473682..3891252 100644 --- a/che_close/install2_ok.php +++ b/che_close/install2_ok.php @@ -3,7 +3,7 @@ include "lib.php"; include "func.php"; $connect=dbConn(); - +requireUserLevel($connect, 5); $query = "select count(no) as cnt from general where user_id = 'admin'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -80,7 +80,7 @@ if($img < 1) { $picture = 'default.jpg'; }; $connect ) or Error(__LINE__.MYDB_error($connect),""); -$pw = md5('12qw!@QW12qw!@QW'); +$pw = md5('12');//부운영자는 계정은 만들지만 로그인 가능하게 하진 않는다. $picture = 'pic_2.jpg'; if($img < 1) { $picture = 'default.jpg'; }; diff --git a/che_close/install3_ok.php b/che_close/install3_ok.php index 815739b..5784571 100644 --- a/che_close/install3_ok.php +++ b/che_close/install3_ok.php @@ -3,6 +3,7 @@ include "lib.php"; include "func.php"; $connect=dbConn(); +requireUserLevel($connect, 5); LogHistory($connect, 1); diff --git a/che_close/install_ok.php b/che_close/install_ok.php index f57a9ab..0c0a05d 100644 --- a/che_close/install_ok.php +++ b/che_close/install_ok.php @@ -3,22 +3,38 @@ include "lib.php"; include "schema.sql"; include "func.php"; -if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.

재설치하려면 해당 파일을 지우세요"); +$justReset = isset($_POST['just_reset'])?intval($_POST['just_reset']):0; -// 호스트네임, 아이디, 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
Error!!!",""); -if(MYDB_error($connect)) Error(__LINE__.MYDB_error($connect),""); -MYDB_select_db($dbname, $connect) or Error("MySQL-DB Select
Error!!!",""); +if(file_exists("d_setting/set.php")){ + $connect = dbConn(); + requireUserLevel($connect, 5); + + if(!$justReset){ + error("이미 set.php가 생성되어 있습니다.

재설치하려면 해당 파일을 지우세요"); + } +} +else{ + $justReset = 0; +} + +if(!$justReset){ + // 호스트네임, 아이디, 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
Error!!!",""); + if(MYDB_error($connect)) Error(__LINE__.MYDB_error($connect),""); + MYDB_select_db($dbname, $connect) or Error("MySQL-DB Select
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),""); // 락 테이블 삭제 @@ -77,13 +93,15 @@ 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,"\n") or Error("set.php 파일 생성 실패

디렉토리의 퍼미션을 707로 주십시요",""); -@fclose($file); -@mkdir("data",0707); -@chmod("data",0707); -@chmod("d_setting/set.php",0707); +if(!$justReset){ + // 파일로 DB 정보 저장 + $file=@fopen("d_setting/set.php","w") or Error("set.php 파일 생성 실패

디렉토리의 퍼미션을 707로 주십시요",""); + @fwrite($file,"\n") or Error("set.php 파일 생성 실패

디렉토리의 퍼미션을 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)); diff --git a/che_close/lib.php b/che_close/lib.php index 136369a..677d866 100644 --- a/che_close/lib.php +++ b/che_close/lib.php @@ -163,4 +163,59 @@ function PrintElapsedTime() { $_endTime = round(getMicroTime() - $_startTime, 3); echo "
- /inst_b_1.gif border=0 align=absmiddle> + +
경과시간 : {$_endTime}초
"; } + +function requireUserLevel($connect, $reqLevel=5){ + + if(isset($_SESSION['ownUserLevel']) && $_SESSION['ownUserLevel']>=$reqLevel){ + return; + } + + $p_id = isset($_SESSION['p_id'])?$_SESSION['p_id']:null; + if(!$p_id){ + + $query = "select count(*) as cnt from general where userlevel < 4 limit 1"; + $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $cnt = MYDB_fetch_array($result); + + if($cnt['cnt'] == 0){ + //아직 제대로된 계정이 생성되지 않았다면 넘어간다. + //서버 리셋시 ~ 첫 유저 계정 생성시까지 취약점이 되지만, 구조상 어쩔 수 없다. + return; + } + + echo " + + + 로그인 되지 않음 + + + + + 각 서버에 로그인이 되지 않아 유저 정보를 확인할 수 없습니다. 서버 접속을 수행해주세요.
+ + "; + exit(); + } + + $query = "select userlevel from general where user_id='$p_id'"; + $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $me = MYDB_fetch_array($result); + + if($me['userlevel'] < $reqLevel) { + echo " + + + 권한 부족 + + + + + 충분한 권한이 없습니다.
+ + "; + exit(); + } + + $_SESSION['ownUserLevel'] = $reqLevel; +} ?> diff --git a/che_close/logout_process.php b/che_close/logout_process.php index 00d3c88..20ddb89 100644 --- a/che_close/logout_process.php +++ b/che_close/logout_process.php @@ -12,11 +12,15 @@ $_SESSION[p_id] = ""; $_SESSION[p_name] = ""; $_SESSION[p_nation] = 0; +if(isset($_SEESION['ownUserLevel'])){ + unset($_SESSION['ownUserLevel']); +} + $id = $me[user_id]; $pw = $me[password]; $conmsg = $me[conmsg]; -//Ǻ +//���Ǻ��� ���� session_destroy(); echo ""; diff --git a/che_close/reset.php b/che_close/reset.php index 1ca0907..e3d4ace 100644 --- a/che_close/reset.php +++ b/che_close/reset.php @@ -5,29 +5,7 @@ include "schema.sql"; $connect = dbConn(); -print_r($_SESSION); -$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 " - - -관리메뉴 - - - - -로그인 정보가 없습니다.
관리자라면 폐쇄중 로그인을 1회 실행해 주십시오.
-"; - banner(); - echo " - -"; - - exit(); -} +requireUserLevel($connect, 5); // 삭제 diff --git a/i_entrance/adminAction.js b/i_entrance/adminAction.js index 5fe0f79..868b999 100644 --- a/i_entrance/adminAction.js +++ b/i_entrance/adminAction.js @@ -79,7 +79,7 @@ function Entrance_AdminPost(server, select) { function(response, textStatus) { if(response.result == "SUCCESS") { Popup_WaitHide(); - if(select == 1) { + if(select == 1 || select == 3) { ReplaceFrame(response.installURL); } else { Replace(ENTRANCE+PHP); @@ -102,7 +102,7 @@ function Entrance_AdminNPCCreate(serverDir) { } function Entrance_AdminClosedLogin(serverDir) { - ReplaceFrame(serverDir+'_close'+W+'npc_login'+PHP); + ReplaceFrame(serverDir+'_close'+W+'index'+PHP); } function Entrance_AdminOpen119(serverDir) { diff --git a/i_entrance/adminInc.php b/i_entrance/adminInc.php index 5994943..79c6e8b 100644 --- a/i_entrance/adminInc.php +++ b/i_entrance/adminInc.php @@ -68,11 +68,11 @@ foreach($_serverDirs as $serverDir) {
- + + - - +
diff --git a/i_entrance/adminPost.php b/i_entrance/adminPost.php index 302cea3..39382d6 100644 --- a/i_entrance/adminPost.php +++ b/i_entrance/adminPost.php @@ -40,6 +40,9 @@ if($member['GRADE'] < 6) { rename(ROOT.W.$serverDir, ROOT.W.$serverDir."_rest"); rename(ROOT.W.$serverDir."_close", ROOT.W.$serverDir); $response['result'] = 'SUCCESS'; + } elseif($select == 3) { + $response['installURL'] = ROOT.W."{$serverDir}_close/install.php?just_reset=1"; + $response['result'] = 'SUCCESS'; } } else { $response['result'] = 'FAIL'; From ae6ddd079bb00dc1c9e1f91f5e33507889067b3d Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Mar 2018 04:12:51 +0900 Subject: [PATCH 06/13] =?UTF-8?q?=ED=9A=8C=ED=94=BC=20=EA=B3=B5=EC=8B=9D?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20-=20=ED=9A=8C=ED=94=BC=EC=8B=9C=20?= =?UTF-8?q?=EB=8D=B0=EB=AF=B8=EC=A7=80=EA=B0=80=2010%=20->=2020%=20-=20?= =?UTF-8?q?=ED=9A=8C=ED=94=BC=20=ED=99=95=EB=A5=A0=EC=97=90=20'=ED=9B=88?= =?UTF-8?q?=EB=A0=A8'=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/_simul.php | 3 +++ che_close/process_war.php | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/che_close/_simul.php b/che_close/_simul.php index 7790a72..5421dee 100644 --- a/che_close/_simul.php +++ b/che_close/_simul.php @@ -206,6 +206,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평 //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $general['train'] / 100); //훈련 반영 if($ratio < $ratio2 && $avoid == 1) { $msg .= "회피했다!
"; $myCrew /= 10; // 10%만 소모 @@ -570,6 +571,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평 //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $general['train'] / 100); //훈련 반영 if($ratio < $ratio2 && $myAvoid == 1) { $msg .= "회피했다!
"; $myCrew /= 10; // 10%만 소모 @@ -578,6 +580,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평 //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $oppose[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $oppose['train'] / 100); //훈련 반영 if($ratio < $ratio2 && $opAvoid == 1) { $msg .= "●상대가 회피했다!
"; $opCrew /= 10; // 10%만 소모 diff --git a/che_close/process_war.php b/che_close/process_war.php index d53b5e8..649a4a8 100644 --- a/che_close/process_war.php +++ b/che_close/process_war.php @@ -285,13 +285,14 @@ function processWar($connect, $general, $city) { //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $general['train'] / 100); //훈련 반영 //특기보정 : 궁병 if($general[special2] == 51) { $ratio2 += 20; } //도구 보정 : 둔갑천서, 태평요술 if($general[item] == 26 || $general[item] == 25) { $ratio2 += 20; } if($ratio < $ratio2 && $avoid == 1) { $batlog[count($batlog)] = "회피했다!"; - $myCrew /= 10; // 10%만 소모 + $myCrew /= 5; // 20%만 소모 $avoid = 0; } @@ -1081,6 +1082,7 @@ function processWar($connect, $general, $city) { //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $general['train'] / 100); //훈련 반영 //특기보정 : 돌격, 궁병 if($oppose[special2] == 60) { $ratio2 -= 100; } if($general[special2] == 51) { $ratio2 += 20; } @@ -1096,13 +1098,14 @@ function processWar($connect, $general, $city) { } else { $batlog[count($batlog)] = "회피했다!"; $oppbatlog[count($oppbatlog)] = "●상대가 회피했다!"; - $myCrew /= 10; // 10%만 소모 + $myCrew /= 5; // 20%만 소모 $myAvoid = 0; } } //회피 $ratio = rand() % 100; // 0 ~ 99 $ratio2 = getRate($game, $oppose[crewtype], "avd"); //회피율 + $ratio2 = round($ratio2 * $oppose['train'] / 100); //훈련 반영 // 특기보정 : 돌격, 궁병 if($general[special2] == 60) { $ratio2 -= 100; } if($oppose[special2] == 51) { $ratio2 += 20; } @@ -1124,7 +1127,7 @@ function processWar($connect, $general, $city) { } else { $oppbatlog[count($oppbatlog)] = "회피했다!"; $batlog[count($batlog)] = "●상대가 회피했다!"; - $opCrew /= 10; // 10%만 소모 + $opCrew /= 5; // 20%만 소모 $opAvoid = 0; } } From 0a81754f7e33e0036e35eaaf422419d7369422f3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Mar 2018 21:54:36 +0900 Subject: [PATCH 07/13] =?UTF-8?q?=EB=82=B4=EC=A0=95=20=EC=83=81=EC=8A=B9?= =?UTF-8?q?=EB=9F=89=20=EA=B3=B5=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20-=20?= =?UTF-8?q?=EC=84=B1=EA=B3=B5/=EC=8B=A4=ED=8C=A8=20=EC=88=98=EC=8B=9D=20?= =?UTF-8?q?=EB=8C=80=ED=8F=AD=20=EB=B3=80=EA=B2=BD(=EB=AC=B4=EC=A7=80?= =?UTF-8?q?=EC=9E=A5=20=EB=84=88=ED=94=84)=20=20=20-=20=EC=8A=A4=ED=83=AF?= =?UTF-8?q?=EC=9D=B4=20=EB=82=AE=EC=9D=84=20=EC=88=98=EB=A1=9D=20=EC=84=B1?= =?UTF-8?q?=EA=B3=B5=EC=9D=B4=20=EC=9E=98=20=EB=9C=B8.=20(=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8=EB=8F=84=20=EC=9E=98=20=EB=9C=B8)=20-=20=EC=9D=BC?= =?UTF-8?q?=EB=B0=98=20=EB=AC=B4=EC=9E=A5/=EC=A7=80=EC=9E=A5=20=ED=8F=89?= =?UTF-8?q?=EA=B7=A0=20=EB=82=B4=EC=A0=95=EB=9F=89=20=EC=83=81=EC=8A=B9=20?= =?UTF-8?q?-=20=EB=AF=BC=EC=8B=AC=EC=9D=B4=20=ED=95=84=EC=9A=94=ED=95=9C?= =?UTF-8?q?=20=EB=82=B4=EC=A0=95=EB=8F=84=20'=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?=ED=99=95=EB=A5=A0'=EB=A7=8C=20=EB=82=AE=EC=95=84=EC=A7=80?= =?UTF-8?q?=EB=8A=94=20=ED=98=95=ED=83=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/func_process.php | 107 ++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 43 deletions(-) diff --git a/che_close/func_process.php b/che_close/func_process.php index d1247d8..f152862 100644 --- a/che_close/func_process.php +++ b/che_close/func_process.php @@ -108,27 +108,41 @@ function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $us * @return array 계산된 실패, 성공 확률 ('succ' => 성공 확률, 'fail' => 실패 확률) */ function CriticalRatioDomestic(&$general, $type) { - $leader = getGeneralLeadership($general, false, true, false, false); - $power = getGeneralPower($general, false, true, false, false); - $intel = getGeneralIntel($general, false, true, false, false); + $leader = getGeneralLeadership($general, false, true, true, false); + $power = getGeneralPower($general, false, true, true, false); + $intel = getGeneralIntel($general, false, true, true, false); $avg = ($leader+$power+$intel) / 3; - // 707010장수 18/21% 706515장수 16/27% 706020장수 14/33% xx50xx장수 10/50% + /* + * 능력치가 높아질 수록 성공 확률 감소. 실패 확률도 감소 + + * 무력 내정 기준(지력 내정 방식과 구조 동일) + 756510(32%/30%), 707010(28%/25%), 657510(23%/20%) + 106575(23%/20%), 107070(20%/17%), 107565(17%/15%) + 506040(33%/30%), 505050(43%/40%), 504060(50%/50%) + + * 통솔 내정 기준 + 756510(25%/22%), 707010(31%/28%), 657510(38%,35%), + 505050(50%,50%), 107070(50%,50%) + */ switch($type) { case 0: $ratio = $avg / $leader; break; case 1: $ratio = $avg / $power; break; case 2: $ratio = $avg / $intel; break; } - if($ratio > 1) $ratio = 1; + $ratio = min($ratio, 1.2); - $r[fail] = (0.2 / $ratio - 0.1) * 100; - $r[succ] = ($ratio - 0.5) * 100; + $fail = power($ratio / 1.2, 1.4) - 0.3; + $succ = power($ratio / 1.2, 1.5) - 0.25; - if($r[fail] < 0) { $r[fail] = 0; } - $r[succ] += $r[fail]; - if($r[succ] > 100) { $r[succ] = 100; } + $fail = min(max($fail, 0), 0.5); + $succ = min(max($succ, 0), 0.5); - return $r; + + return array( + 'succ'=>$succ, + 'fail'=>$fail + ); } /** @@ -154,10 +168,10 @@ function setLeadershipBonus(&$general, $nationLevel){ function CriticalScore($score, $type) { switch($type) { case 0: - $ratio = (rand()%9 + 20)/10; // 2.0~2.8 + $ratio = randF()*0.8 + 2.2; // 2.2~3.0 break; case 1: - $ratio = (rand()%3 + 2)/10; // 0.2~0.4 + $ratio = randF()*0.2 + 0.2; // 0.2~0.4 break; } return round($score * $ratio); @@ -214,20 +228,21 @@ function process_1($connect, &$general, $type) { // 군사 보정 if($general[level] == 3 && $general[no] == $city[gen2]) { $score *= 1.05; } - $rd = rand() % 100; + $rd = randF(); $r = CriticalRatioDomestic($general, 2); // 특기보정 : 경작, 상재 - if($type == 1 && $general[special] == 1) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } - if($type == 2 && $general[special] == 2) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } - + if($type == 1 && $general['special'] == 1) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + if($type == 2 && $general['special'] == 2) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + //민심 반영 + if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:{$dtype}{$atype} 실패하여 $score 상승했습니다. <1>$date"; - } elseif($city[rate] >= 80 && $r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:{$dtype}{$atype} 성공하여 $score 상승했습니다. <1>$date"; } else { @@ -302,18 +317,20 @@ function process_3($connect, &$general) { // 군주, 참모, 모사 보정 if($general[level] == 12 || $general[level] == 11 || $general[level] == 9 || $general[level] == 7 || $general[level] == 5) { $score *= 1.05; } - $rd = rand() % 100; - $r = CriticalRatioDomestic($general, 0); + $rd = randF(); + $r = CriticalRatioDomestic($general, 2); // 특기보정 : 발명 - if($general[special] == 3) { $score *= 1.1; $admin[develcost] *= 0.8; $r[succ] += 10; } + if($general['special'] == 3) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + //민심 반영 + if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:{$dtype}를 실패하여 $score 상승했습니다. <1>$date"; - } elseif($city[rate] >= 80 && $r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:{$dtype}를 성공하여 $score 상승했습니다. <1>$date"; } else { @@ -397,18 +414,18 @@ function process_4($connect, &$general) { // 시중 보정 if($general[level] == 2 && $general[no] == $city[gen3]) { $score *= 1.05; } - $rd = rand() % 100; + $rd = randF(); $r = CriticalRatioDomestic($general, 0); // 특기보정 : 인덕 - if($general[special] == 20) { $r[succ] += 10; $admin[develcost] *= 0.8; $score *= 1.1; } + if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:선정을 실패하여 민심이 $score 상승했습니다. <1>$date"; - } elseif($r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:선정을 성공하여 민심이 $score 상승했습니다. <1>$date"; } else { @@ -492,19 +509,21 @@ function process_5($connect, &$general, $type) { // 태수 보정 if($general[level] == 4 && $general[no] == $city[gen1]) { $score *= 1.05; } - $rd = rand() % 100; // 현재 20% - $r = CriticalRatioDomestic($general, 0); + $rd = randF(); + $r = CriticalRatioDomestic($general, 1); // 특기보정 : 수비, 축성 - if($type == 1 && $general[special] == 11) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } - if($type == 2 && $general[special] == 10) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } + if($type == 1 && $general['special'] == 11) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + if($type == 2 && $general['special'] == 10) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + //민심 반영 + if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:{$dtype}를 실패하여 $score 상승했습니다. <1>$date"; - } elseif($city[rate] >= 80 && $r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:{$dtype}를 성공하여 $score 상승했습니다. <1>$date"; } else { @@ -581,18 +600,18 @@ function process_7($connect, &$general) { // 시중 보정 if($general[level] == 2 && $general[no] == $city[gen3]) { $score *= 1.05; } - $rd = rand() % 100; // 현재 20% + $rd = randF(); $r = CriticalRatioDomestic($general, 0); // 특기보정 : 인덕 - if($general[special] == 20) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } + if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:장려를 실패하여 주민이 {$score}0명 증가했습니다. <1>$date"; - } elseif($r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:장려를 성공하여 주민이 {$score}0명 증가했습니다. <1>$date"; } else { @@ -675,18 +694,20 @@ function process_8($connect, &$general) { // 태수 보정 if($general[level] == 4 && $general[no] == $city[gen1]) { $score *= 1.05; } - $rd = rand() % 100; // 현재 20% - $r = CriticalRatioDomestic($general, 0); + $rd = randF(); + $r = CriticalRatioDomestic($general, 1); // 특기보정 : 통찰 - if($general[special] == 12) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; } + if($general['special'] == 12) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; } + //민심 반영 + if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; } //버그방지 if($score < 1) $score = 1; - if($r[fail] > $rd) { + if($r['fail'] > $rd) { $score = CriticalScore($score, 1); $log[count($log)] = "●{$admin[month]}월:{$dtype}을 실패하여 $score 강화했습니다. <1>$date"; - } elseif($city[rate] >= 80 && $r[succ] > $rd) { + } elseif($r['succ'] + $r['fail'] > $rd) { $score = CriticalScore($score, 0); $log[count($log)] = "●{$admin[month]}월:{$dtype}을 성공하여 $score 강화했습니다. <1>$date"; } else { From 9519a17eaa5f4553f1bdc42b0c0e2a76770b9c83 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Mar 2018 22:15:47 +0900 Subject: [PATCH 08/13] =?UTF-8?q?=EB=AC=BC=EC=9E=90=20=EC=A1=B0=EB=8B=AC,?= =?UTF-8?q?=20=EC=9D=B8=EC=9E=AC=20=ED=83=90=EC=83=89,=20=EA=B5=B0?= =?UTF-8?q?=EB=9F=89=20=EB=A7=A4=EB=A7=A4=EC=8B=9C,=20'=EB=9E=9C=EB=8D=A4?= =?UTF-8?q?=20=EA=B2=BD=ED=97=98'=EC=9D=B4=20=ED=98=84=EC=9E=AC=20?= =?UTF-8?q?=EB=8A=A5=EB=A0=A5=EC=B9=98=20=EB=B9=84=EC=A4=91=EC=9D=84=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/func.php | 26 ++++++++++++++++++++++++++ che_close/func_process.php | 8 ++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/che_close/func.php b/che_close/func.php index 96aeb76..b61a88e 100644 --- a/che_close/func.php +++ b/che_close/func.php @@ -12,6 +12,32 @@ function randF(){ return mt_rand() / mt_getrandmax(); } +/** + * 각 값의 비중에 따라 랜덤한 값을 선택 + * + * @param array 각 수치의 비중 + * + * @return object 선택된 랜덤 값의 key값. 단순 배열인 경우에는 index + */ +function ChooseRandomItem($items){ + $sum = 0; + foreach($items as $value){ + $sum += $value; + } + + $rd = randF()*$sum; + foreach($items as $key=>$value){ + if($rd <= $value){ + return $key; + } + $rd -= $value; + } + + //fallback. 이곳으로 빠지지 않음 + end($items); + return key($items); +} + // 37.5 ~ 75 function abilityRand() { $total = 150; diff --git a/che_close/func_process.php b/che_close/func_process.php index f152862..b751b86 100644 --- a/che_close/func_process.php +++ b/che_close/func_process.php @@ -805,7 +805,7 @@ function process_9($connect, &$general) { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); } - switch(rand()%3) { + switch(ChooseRandomItem(array($general['leader'], $general['power'], $general['intel']))) { case 0: $general[leader2]++; $query = "update general set resturn='SUCCESS',leader2='$general[leader2]',dedication=dedication+'$ded',experience=experience+'$exp' where no='$general[no]'"; @@ -1981,7 +1981,7 @@ function process_29($connect, &$general) { if(rand() % $criteria > 0) { $exp = 100; $ded = 70; - switch(rand()%3) { + switch(ChooseRandomItem(array($general['leader'], $general['power'], $general['intel']))) { case 0: $general[leader2] += 1; break; case 1: $general[power2] += 1; break; case 2: $general[intel2] += 1; break; @@ -1991,7 +1991,7 @@ function process_29($connect, &$general) { // 탐색 성공 $exp = 200; $ded = 300; - switch(rand()%3) { + switch(ChooseRandomItem(array($general['leader'], $general['power'], $general['intel']))) { case 0: $general[leader2] += 3; break; case 1: $general[power2] += 3; break; case 2: $general[intel2] += 3; break; @@ -3934,7 +3934,7 @@ function process_49($connect, &$general) { MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); // 경험치 상승 - switch(rand()%3) { + switch(ChooseRandomItem(array($general['leader'], $general['power'], $general['intel']))) { case 0: $general[leader2]++; $query = "update general set leader2='$general[leader2]' where no='$general[no]'"; From bb142d94c549843dad790af250810c49801e60b3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 11 Mar 2018 22:21:36 +0900 Subject: [PATCH 09/13] =?UTF-8?q?[=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95]?= =?UTF-8?q?=EC=88=98=EC=A0=95=ED=95=9C=20=EB=82=B4=EC=A0=95=20=EC=84=B1?= =?UTF-8?q?=EA=B3=B5=20=EA=B8=B0=EC=A4=80=EC=97=90=EC=84=9C=20=EC=A7=80?= =?UTF-8?q?=EC=88=98=EC=8A=B9=20=EA=B3=84=EC=82=B0=EC=9D=84=20pow=EA=B0=80?= =?UTF-8?q?=20=EC=95=84=EB=8B=88=EB=9D=BC=20power=EB=A1=9C=20=EC=A0=81?= =?UTF-8?q?=EC=9D=80=20=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/func_process.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/che_close/func_process.php b/che_close/func_process.php index b751b86..4b719eb 100644 --- a/che_close/func_process.php +++ b/che_close/func_process.php @@ -132,8 +132,8 @@ function CriticalRatioDomestic(&$general, $type) { } $ratio = min($ratio, 1.2); - $fail = power($ratio / 1.2, 1.4) - 0.3; - $succ = power($ratio / 1.2, 1.5) - 0.25; + $fail = pow($ratio / 1.2, 1.4) - 0.3; + $succ = pow($ratio / 1.2, 1.5) - 0.25; $fail = min(max($fail, 0), 0.5); $succ = min(max($succ, 0), 0.5); From 97be8740e24477945f6d679cc08362d9278f49af Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 12 Mar 2018 23:23:10 +0900 Subject: [PATCH 10/13] =?UTF-8?q?=EC=8A=A4=ED=83=AF=20=EB=B3=B4=EB=84=88?= =?UTF-8?q?=EC=8A=A4=EA=B0=80=20=ED=98=84=EC=9E=AC=20=EC=8A=A4=ED=83=AF?= =?UTF-8?q?=EC=97=90=20=EB=B9=84=EB=A1=80=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/join_post.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/che_close/join_post.php b/che_close/join_post.php index 793c8bf..f811aad 100644 --- a/che_close/join_post.php +++ b/che_close/join_post.php @@ -141,14 +141,24 @@ if($id_num) { } $city = $city[city]; - $total = 3 + rand() % 3; - $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); + + $pleader = 0; + $ppower = 0; + $pintel = 0; + for($statBonusCnt = 3 + rand() % 3; $statBonusCnt > 0; $statBonusCnt--){ + switch(ChooseRandomItem(array($leader, $power, $intel))){ + case 0: + $pleader++; + break; + case 1: + $ppower++; + break; + case 2: + $pintel++; + break; + } + $statBonus[]++; + } $leader = $leader + $pleader; $power = $power + $ppower; From 3cf84157f8dbc4d407f74ad6212f1a9a317852e6 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 12 Mar 2018 23:46:40 +0900 Subject: [PATCH 11/13] =?UTF-8?q?=EC=BD=94=EB=94=A9=EC=A4=91=20=EB=82=A8?= =?UTF-8?q?=EC=9D=80=20=ED=95=84=EC=9A=94=EC=97=86=EB=8A=94=20=EC=9E=94?= =?UTF-8?q?=EC=97=AC=20=EC=BD=94=EB=93=9C=20=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/join_post.php | 1 - 1 file changed, 1 deletion(-) diff --git a/che_close/join_post.php b/che_close/join_post.php index f811aad..2f573b1 100644 --- a/che_close/join_post.php +++ b/che_close/join_post.php @@ -157,7 +157,6 @@ if($id_num) { $pintel++; break; } - $statBonus[]++; } $leader = $leader + $pleader; From fa1f5a8aa38f71709dbefa161ffb8e38eb49b0dd Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 13 Mar 2018 09:42:44 +0900 Subject: [PATCH 12/13] =?UTF-8?q?=EB=A6=AC=EC=85=8B=20=EA=B3=BC=EC=A0=95?= =?UTF-8?q?=EC=97=90=EC=84=9C=20install3=5Fok.php=20=EC=97=90=EC=84=9C=20r?= =?UTF-8?q?equireUserLevel()=EC=9D=B4=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=20=EC=88=98=EC=A0=95=20requireUserLevel()?= =?UTF-8?q?=EC=97=90=EC=84=9C=20$reqLevel=20=EB=B0=98=EC=98=81=EC=9D=B4=20?= =?UTF-8?q?=EB=90=98=EB=8B=A4=20=EB=A7=8C=20=EA=B2=83=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/install3_ok.php | 1 - che_close/lib.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/che_close/install3_ok.php b/che_close/install3_ok.php index 5784571..815739b 100644 --- a/che_close/install3_ok.php +++ b/che_close/install3_ok.php @@ -3,7 +3,6 @@ include "lib.php"; include "func.php"; $connect=dbConn(); -requireUserLevel($connect, 5); LogHistory($connect, 1); diff --git a/che_close/lib.php b/che_close/lib.php index 677d866..21063db 100644 --- a/che_close/lib.php +++ b/che_close/lib.php @@ -173,7 +173,7 @@ function requireUserLevel($connect, $reqLevel=5){ $p_id = isset($_SESSION['p_id'])?$_SESSION['p_id']:null; if(!$p_id){ - $query = "select count(*) as cnt from general where userlevel < 4 limit 1"; + $query = "select count(*) as cnt from general where userlevel < $reqLevel limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cnt = MYDB_fetch_array($result); From 35169c99b426acdd8111af18b2e7a5c987427b6b Mon Sep 17 00:00:00 2001 From: sars Date: Wed, 14 Mar 2018 10:38:37 -0700 Subject: [PATCH 13/13] =?UTF-8?q?=EC=B6=A9=EC=B0=A8=EA=B3=84=EC=97=B4=20?= =?UTF-8?q?=EC=84=B1=EB=B2=BD=EB=8D=B0=EB=AF=B8=EC=A7=80=2020%=20=EB=B2=84?= =?UTF-8?q?=ED=94=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- che_close/process_war.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/che_close/process_war.php b/che_close/process_war.php index 649a4a8..2581a26 100644 --- a/che_close/process_war.php +++ b/che_close/process_war.php @@ -241,11 +241,11 @@ function processWar($connect, $general, $city) { } } } elseif($general[crewtype] == 40) { // 정란 - $cityCrew = $cityCrew * 1.5; + $cityCrew = $cityCrew * 1.8; } elseif($general[crewtype] == 41) { // 충차 - $cityCrew = $cityCrew * 2.0; + $cityCrew = $cityCrew * 2.4; } elseif($general[crewtype] == 42) { // 벽력거 - $cityCrew = $cityCrew * 1.5; + $cityCrew = $cityCrew * 1.8; } //군주 공격 보정 10% if($general[level] == 12) {