checkLimit 함수에 입력값이 없어도 자동으로 수행하도록 변경

This commit is contained in:
2018-04-10 21:20:57 +09:00
parent 8f9077dff8
commit 16e5601651
+18 -2
View File
@@ -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(); $session = Session::getInstance();
if($session->userGrade>=4){ if($session->userGrade>=4){
return 0; 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) { if($con > $conlimit) {
return 2; return 2;
//접속제한 90%이면 경고문구 //접속제한 90%이면 경고문구
@@ -2143,7 +2157,6 @@ function CheckHall($no) {
function uniqueItem($general, $log, $vote=0) { function uniqueItem($general, $log, $vote=0) {
$db = DB::db(); $db = DB::db();
$connect=$db->get(); $connect=$db->get();
$log = [];
$alllog = []; $alllog = [];
$history = []; $history = [];
$occupied = []; $occupied = [];
@@ -2532,6 +2545,9 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
while(!$queue->isEmpty()){ while(!$queue->isEmpty()){
list($cityID, $dist) = $queue->dequeue(); list($cityID, $dist) = $queue->dequeue();
if(key_exists($cityID, $cities)){
continue;
}
if(!key_exists($dist, $distanceList)){ if(!key_exists($dist, $distanceList)){
$distanceList[$dist] = []; $distanceList[$dist] = [];