From 5b926ae5c54fa312a49552c98d2146f6d0849eab Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 8 Apr 2018 20:51:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=95=EC=A0=81=20=EB=B6=84=EC=84=9D?= =?UTF-8?q?=EA=B8=B0=20=EA=B2=B0=EA=B3=BC=20=EB=B0=98=EC=98=81.=20?= =?UTF-8?q?=EB=B9=A0=EC=A7=84=20POST=20=EC=9D=B8=EC=9E=90=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EB=93=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/c_chiefboard.php | 1 + hwe/c_double.php | 2 +- hwe/preprocessing.php | 7 +++++++ hwe/process_war.php | 10 +++++----- hwe/select_npc_post.php | 24 +++++++++++++++--------- j_updateServer.php | 3 ++- oauth_kakao/j_join_process.php | 2 ++ src/sammo/StringUtil.php | 6 +++--- src/sammo/Util.php | 33 +++++++++++++++++++++++++-------- src/sammo/WebUtil.php | 3 +++ tmp_msg/add_msg_dummy.php | 2 ++ 11 files changed, 66 insertions(+), 27 deletions(-) diff --git a/hwe/c_chiefboard.php b/hwe/c_chiefboard.php index a86cb557..f62968fb 100644 --- a/hwe/c_chiefboard.php +++ b/hwe/c_chiefboard.php @@ -7,6 +7,7 @@ include "func.php"; $title = Util::getReq('title'); $msg = Util::getReq('msg'); $num = Util::getReq('num'); +$reply = Util::getReq('reply'); // $title, $msg, $num //로그인 검사 diff --git a/hwe/c_double.php b/hwe/c_double.php index b5d86a4f..b2454cf3 100644 --- a/hwe/c_double.php +++ b/hwe/c_double.php @@ -40,7 +40,7 @@ if($command == 46) { ], 'owner=%i', $userID); $count = count($turn); - $query = ['con'=>$db->eval('con')]; + $query = ['con'=>$db->sqleval('con')]; foreach($turn as $turnIdx){ $query['turn'.$turnIdx] = $comStr; } diff --git a/hwe/preprocessing.php b/hwe/preprocessing.php index ffe07ba0..17aa349a 100644 --- a/hwe/preprocessing.php +++ b/hwe/preprocessing.php @@ -10,9 +10,16 @@ $userID = Session::getUserID(); $db = DB::db(); $connect=$db->get(); +$turn = Util::getReq('turn', 'array_int'); +$commandtype = Util::getReq('commandtype', 'int'); increaseRefresh("턴입력", 1); +if(!$turn || $commandtype === null){ + header('location:index.php'); + die(); +} + $query = "select conlimit from game limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); diff --git a/hwe/process_war.php b/hwe/process_war.php index a1874774..d7161fae 100644 --- a/hwe/process_war.php +++ b/hwe/process_war.php @@ -428,8 +428,8 @@ function processWar($general, $city) { $deadAmount['def'] = $deadAmount['def'] + $mykillnum; // 도시쌀 소모 계산 - $opexp = round($opexp / 50 * 0.8); - $rice = round($opexp * 5 * getCrewtypeRice($game, 0, 0) * ($game['city_rate']/100 - 0.2)); + $opexp = intval(round($opexp / 50 * 0.8)); + $rice = intval(round($opexp * 5 * getCrewtypeRice($game, 0, 0) * ($game['city_rate']/100 - 0.2))); $destnation['rice'] -= $rice; if($destnation['rice'] < 0) { $destnation['rice'] = 0; } $query = "update nation set rice='{$destnation['rice']}' where nation='{$destnation['nation']}'"; @@ -438,8 +438,8 @@ function processWar($general, $city) { pushAdminLog(["성벽 쌀 소모 : $rice"]); //원래대로 스케일링 - $city['def'] = round($city['def'] / 10); - $city['wall'] = round($city['wall'] / 10); + $city['def'] = intval(round($city['def'] / 10)); + $city['wall'] = intval(round($city['wall'] / 10)); //내정 감소 $dec = round($cityCrew / 10); $city['agri'] -= $dec; @@ -455,7 +455,7 @@ function processWar($general, $city) { addGenDex($general['no'], $general['crewtype'], $mykillnum); addGenDex($general['no'], 40, $mydeathnum); // 죽은수 기술로 누적 - $num = round($mydeathnum * 0.01); + $num = intval(round($mydeathnum * 0.01)); // 국가보정 if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; } if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; } diff --git a/hwe/select_npc_post.php b/hwe/select_npc_post.php index 57f8098f..e25128c2 100644 --- a/hwe/select_npc_post.php +++ b/hwe/select_npc_post.php @@ -41,11 +41,19 @@ if(!$npc){ ########## 동일 정보 존재여부 확인. ########## -$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,turnterm,genius,npcmode from game limit 1'); +list( + $year, + $month, + $maxgeneral, + $turnterm, + $genius, + $npcmode +) = $db->queryFirstList('SELECT year,month,maxgeneral,turnterm,genius,npcmode from game limit 1'); + $gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE noc<2'); $oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID); -if($admin['npcmode'] != 1) { +if($npcmode != 1) { echo ""; echo ""; exit(); @@ -57,7 +65,7 @@ if($oldGeneral) { "); exit; } -if($admin['maxgeneral'] <= $gencount) { +if($maxgeneral <= $gencount) { echo("