From 48a560cb4ca9d6c09e7b40ea0fa3592573c58033 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 8 Apr 2018 12:38:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=91=EC=86=8D=20=EA=B0=80=EC=A4=91?= =?UTF-8?q?=EC=B9=98=20=EA=B0=9C=EB=85=90=20=EC=82=AD=EC=A0=9C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/j_create_admin.php | 4 ++-- hwe/_admin1_submit.php | 8 ++++---- hwe/_admin2.php | 9 +-------- hwe/_admin2_submit.php | 4 ---- hwe/func.php | 3 +-- hwe/sammo/GameConst.php | 2 ++ hwe/sql/schema.sql | 1 - 7 files changed, 10 insertions(+), 21 deletions(-) diff --git a/f_install/j_create_admin.php b/f_install/j_create_admin.php index 18ed9f08..7603cf25 100644 --- a/f_install/j_create_admin.php +++ b/f_install/j_create_admin.php @@ -7,7 +7,7 @@ session_start(); session_destroy(); $username = mb_strtolower(Util::getReq('username'), 'utf-8'); -$password = Util::getReq('password'); +$password = Util::getReq('password', 'string'); $nickname = Util::getReq('nickname'); if(!$username || !$password || !$nickname){ @@ -17,7 +17,7 @@ if(!$username || !$password || !$nickname){ ]); } -if(strlen($password)!=128){ +if(strlen((string)$password)!=128){ Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.' diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index bcaf9c7f..53e60438 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -23,10 +23,10 @@ if(!$v->validate()){ } $log = Util::getReq('log'); -$starttime = Util::getReq('starttime', 'string', (new DateTime())->format('Y-m-d H:i:s')); -$maxgeneral = Util::getReq('maxgeneral', 'int', 500); -$maxnation = Util::getReq('maxnation', 'int', 55); - +$starttime = Util::getReq('starttime', 'string', (new \DateTime())->format('Y-m-d H:i:s')); +$maxgeneral = Util::getReq('maxgeneral', 'int', GameConst::$defaultMaxGeneral); +$maxnation = Util::getReq('maxnation', 'int', GameConst::$defaultMaxNation); +$startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear); $db = DB::db(); $connect=$db->get(); diff --git a/hwe/_admin2.php b/hwe/_admin2.php index c5f23da2..2bead54c 100644 --- a/hwe/_admin2.php +++ b/hwe/_admin2.php @@ -28,7 +28,7 @@ if($session->userGrade < 5) { $db = DB::db(); $connect=$db->get(); -$query = "select conlimit,conweight from game limit 1"; +$query = "select conlimit from game limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); ?> @@ -49,13 +49,6 @@ $admin = MYDB_fetch_array($result); 접속제한 - - 제한등급 - - style=color:white;background-color:black;font-size:13px;> - - - diff --git a/hwe/_admin2_submit.php b/hwe/_admin2_submit.php index 39e2b789..1efa8eb3 100644 --- a/hwe/_admin2_submit.php +++ b/hwe/_admin2_submit.php @@ -27,10 +27,6 @@ switch($btn) { $query = "update general set con=1000"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); break; - case "접속가중치": - $query = "update game set conweight='$conweight'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - break; case "블럭 해제": DB::db()->query('update general set block=0 where no IN %li', $genlist); break; diff --git a/hwe/func.php b/hwe/func.php index 2bae6fab..36c2267b 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1358,10 +1358,9 @@ function updateTraffic() { function CheckOverhead() { //서버정보 $db = DB::db(); - $admin = $db->queryFirstRow('SELECT conweight, turnterm, conlimit from GAME LIMIT 1'); + $admin = $db->queryFirstRow('SELECT turnterm, conlimit from GAME LIMIT 1'); $con = $admin['turnterm'] * 6; - $con *= $admin['conweight'] / 100; if($con != $admin['conlimit']){ diff --git a/hwe/sammo/GameConst.php b/hwe/sammo/GameConst.php index f80d05a4..00f1d2ad 100644 --- a/hwe/sammo/GameConst.php +++ b/hwe/sammo/GameConst.php @@ -78,4 +78,6 @@ class GameConst public static $defaultMaxNation = 55; /** @var int 초기 최대 천재 수 */ public static $defaultMaxGenius = 5; + /** @var int 초기 시작 년도. 실제 값은 시나리오에서 정해지므로 딱히 의미는 없음. */ + public static $defaultStartYear = 180; } diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index f7f62d28..dd883803 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -363,7 +363,6 @@ CREATE TABLE `game` ( `maxonline` INT(9) NULL DEFAULT '1', `maxrefresh` INT(9) NULL DEFAULT '1', `conlimit` INT(9) NULL DEFAULT '5', - `conweight` INT(3) NULL DEFAULT '100', `develcost` INT(4) NULL DEFAULT '20', `online` INT(9) NULL DEFAULT '0', `onlinenation` VARCHAR(256) NULL DEFAULT '',