Util::array_get($_POST 류를 Util::getReq로 통합.

array_merge를 이상하게 처리하는 부분 수정
This commit is contained in:
2018-04-07 15:16:46 +09:00
parent 183efd073b
commit 0cc7ba368a
21 changed files with 125 additions and 88 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ if(!$v->validate()){
Error($v->errorStr());
}
$minute = Util::toInt(Util::array_get($_POST['minute']));
$minute2 = Util::toInt(Util::array_get($_POST['minute2']));
$minute = Util::getReq('minute', 'int');
$minute2 = Util::getReq('minute2', 'int');
$db = DB::db();
$connect=$db->get();
+2
View File
@@ -22,6 +22,8 @@ if(!$v->validate()){
Error($v->errorStr());
}
$db = DB::db();
$connect=$db->get();
+13 -13
View File
@@ -9,14 +9,14 @@ $userID = Session::getUserID();
//로그인 검사
$isgen = Util::array_get($_POST['isgen'], '');
$tech1 = Util::array_get($_POST['tech1'], 0);
$tech2 =Util::array_get($_POST['tech2'], 0);
$dex10 = Util::array_get($_POST['dex10'], 0);
$dex110 = Util::array_get($_POST['dex110'], 0);
$dex120 = Util::array_get($_POST['dex120'], 0);
$dex130 = Util::array_get($_POST['dex130'], 0);
$dex140 = Util::array_get($_POST['dex140'], 0);
$isgen = Util::getReq('isgen');
$tech1 = Util::getReq('tech1', 'int', 0);
$tech2 = Util::getReq('tech2', 'int', 0);
$dex10 = Util::getReq('dex10', 'int', 0);
$dex110 = Util::getReq('dex110', 'int', 0);
$dex120 = Util::getReq('dex120', 'int', 0);
$dex130 = Util::getReq('dex130', 'int', 0);
$dex140 = Util::getReq('dex140', 'int', 0);
$dx10 = array_fill(0, 20, '');
$dx110 = array_fill(0, 20, '');
@@ -24,11 +24,11 @@ $dx120 = array_fill(0, 20, '');
$dx130 = array_fill(0, 20, '');
$dx140 = array_fill(0, 20, '');
$dex20 = Util::array_get($_POST['dex20'], 0);
$dex210 = Util::array_get($_POST['dex210'], 0);
$dex220 = Util::array_get($_POST['dex220'], 0);
$dex230 = Util::array_get($_POST['dex230'], 0);
$dex240 = Util::array_get($_POST['dex240'], 0);
$dex20 = Util::getReq('dex20', 'int', 0);
$dex210 = Util::getReq('dex210', 'int', 0);
$dex220 = Util::getReq('dex220', 'int', 0);
$dex230 = Util::getReq('dex230', 'int', 0);
$dex240 = Util::getReq('dex240', 'int', 0);
$dx20 = array_fill(0, 20, '');
$dx210 = array_fill(0, 20, '');
+1 -1
View File
@@ -3,7 +3,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::array_get($_POST['btn']);
$btn = Util::getReq('btn');
$yearmonth = $_POST['yearmonth'];
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+3 -3
View File
@@ -4,9 +4,9 @@ namespace sammo;
include "lib.php";
include "func.php";
$title = Util::array_get($_POST['title']);
$msg = Util::array_get($_POST['msg']);
$num = Util::toInt(Util::array_get($_POST['num']));
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num');
// $title, $msg, $num
//로그인 검사
+5 -4
View File
@@ -5,10 +5,11 @@ include "lib.php";
include "func.php";
// $btn, $level, $genlist, $outlist
$btn = Util::array_get($_POST['btn']);
$level = Util::toInt(Util::array_get($_POST['level']));
$genlist = Util::toInt(Util::array_get($_POST['genlist']));
$outlist = Util::toInt(Util::array_get($_POST['outlist']));
$btn = Util::getReq('btn');
$level = Util::getReq('level', 'int');
$genlist = Util::getReq('genlist', 'int');
$outlist = Util::getReq('outlist', 'int');
$citylist = Util::getReq('citylist', 'int');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+3 -3
View File
@@ -4,9 +4,9 @@ namespace sammo;
include "lib.php";
include "func.php";
// $title, $msg, $num
$title = Util::array_get($_POST['title']);
$msg = Util::array_get($_POST['msg']);
$num = Util::toInt(Util::array_get($_POST['num']));
$title = Util::getReq('title');
$msg = Util::getReq('msg');
$num = Util::getReq('num', 'int');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+2 -2
View File
@@ -5,8 +5,8 @@ include "lib.php";
include "func.php";
// $btn, $msg
$gen = Util::toInt(Util::array_get($_POST['gen']));
$sel = Util::toInt(Util::array_get($_POST['sel']));
$gen = Util::getReq('gen', 'int');
$sel = Util::getReq('sel', 'int');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+1 -1
View File
@@ -4,7 +4,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$sel = Util::toInt(Util::array_get($_POST['sel']));
$sel = Util::getReq('sel', 'int');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
+6 -2
View File
@@ -217,13 +217,17 @@ function SetNationFront($nationNo) {
);
if($enemyCities) {
foreach($enemyCities as $city){
$adj = array_merge($adj, CityConst::byID($city)->path);
foreach(CityConst::byID($city)->path as $adjKey=>$adjVal){
$adj[$adjKey] = $adjVal;
}
}
} else {
//평시이면 공백지
//NOTE: if, else일 경우 NPC는 전쟁시에는 공백지로 출병하지 않는다는 뜻이 된다.
foreach ($db->queryFirstColumn('SELECT city,path from city where nation=0') as $city) {
$adj = array_merge($adj, CityConst::byID($city)->path);
foreach(CityConst::byID($city)->path as $adjKey=>$adjVal){
$adj[$adjKey] = $adjVal;
}
}
}
+6 -6
View File
@@ -12,12 +12,12 @@ if($session->userGrade < 6){
]);
}
$fullReset = Util::array_get($_POST['full_reset'], false);
$host = Util::array_get($_POST['db_host']);
$port = Util::array_get($_POST['db_port']);
$username = Util::array_get($_POST['db_id']);
$password = Util::array_get($_POST['db_pw']);
$dbName = Util::array_get($_POST['db_name']);
$fullReset = Util::getReq('full_reset', 'bool', false);
$host = Util::getReq('db_host');
$port = Util::getReq('db_port', 'int');
$username = Util::getReq('db_id');
$password = Util::getReq('db_pw');
$dbName = Util::getReq('db_name');
if(!$host || !$port || !$username || !$password || !$dbName){
Json::die([
+7 -7
View File
@@ -4,7 +4,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$v = new Validator($_POST);
$v = new Validator(array_merge($_POST, $_GET));
$v
->rule('required', [
'name',
@@ -44,14 +44,14 @@ $session = Session::requireLogin()->setReadOnly();
$userID = Session::getUserID();
//NOTE: 이 페이지에서는 세션에 데이터를 등록하지 않음. 로그인은 이후에.
$name = $_POST['name'];
$name = Util::getReq('name');
$name = StringUtil::removeSpecialCharacter($name);
$pic = (int)Util::array_get($_POST['pic'], 0);
$character = (int)Util::array_get($_POST['character'], 0);
$pic = Util::getReq('pic', 'int', 0);
$character = Util::getReq('character', 'int', 0);
$leader = (int)$_POST['leader'];
$power = (int)$_POST['power'];
$intel = (int)$_POST['intel'];
$leader = Util::getReq('leader', 'int', 50);
$power = Util::getReq('power', 'int', 50);
$intel = Util::getReq('intel', 'int', 50);
$mylog = [];