From 16e560165177d2cf841ee335ac7661bcff3f2e90 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 10 Apr 2018 21:20:57 +0900 Subject: [PATCH] =?UTF-8?q?checkLimit=20=ED=95=A8=EC=88=98=EC=97=90=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=EA=B0=92=EC=9D=B4=20=EC=97=86=EC=96=B4?= =?UTF-8?q?=EB=8F=84=20=EC=9E=90=EB=8F=99=EC=9C=BC=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=ED=96=89=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 017fca5b..0e1714ce 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -75,11 +75,25 @@ function GetImageURL($imgsvr) { } } -function checkLimit($con, $conlimit) { +/** + * @param null|int $con 장수의 벌점 + * @param null|int $conlimit 최대 벌점 + */ +function checkLimit($con = null, $conlimit = null) { $session = Session::getInstance(); if($session->userGrade>=4){ return 0; } + + $db = DB::db(); + + if($con === null){ + $con = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', Session::getUserID()); + } + if($conlimit === null){ + $conlimit = $db->queryFirstField('SELECT conlimit FROM game LIMIT 1'); + } + if($con > $conlimit) { return 2; //접속제한 90%이면 경고문구 @@ -2143,7 +2157,6 @@ function CheckHall($no) { function uniqueItem($general, $log, $vote=0) { $db = DB::db(); $connect=$db->get(); - $log = []; $alllog = []; $history = []; $occupied = []; @@ -2532,6 +2545,9 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) { while(!$queue->isEmpty()){ list($cityID, $dist) = $queue->dequeue(); + if(key_exists($cityID, $cities)){ + continue; + } if(!key_exists($dist, $distanceList)){ $distanceList[$dist] = [];