From 1b675eabe2cc888c09705f45f2a7e8bdc126ce0a Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 28 Jan 2018 05:27:11 +0900 Subject: [PATCH] =?UTF-8?q?onlinenum=EC=9D=84=20=EB=8B=A8=EC=88=9C?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/a_traffic.php | 2 +- twe/func.php | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/twe/a_traffic.php b/twe/a_traffic.php index 54429946..1005941a 100644 --- a/twe/a_traffic.php +++ b/twe/a_traffic.php @@ -17,7 +17,7 @@ $str = ""; for($i=0; $i < $count; $i++) { $str .= ConvertLog($log[count($log)-2-$i], $skin)."
"; } echo $str; -$curonline = onlinenum($connect); +$curonline = getOnlineNum(); for($i=0; $i < 11; $i++) { $parse = explode("|", $log[count($log)-12+$i]); $date[$i] = trim($parse[0]); diff --git a/twe/func.php b/twe/func.php index 71ceeac0..6bef2d8d 100644 --- a/twe/func.php +++ b/twe/func.php @@ -1981,20 +1981,10 @@ function adminMsg($connect, $skin=1) { echo $admin['msg'].""; } - -function getOnlineNumEx(){ +function getOnlineNum() { return newDB()->queryFirstField('select `online` from `game` where `no`=1'); } - - -function onlinenum($connect) { - $query = "select online from game where no='1'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $game = MYDB_fetch_array($result); - return $game['online']; -} - function onlinegen($connect) { $onlinegen = ""; if($_SESSION['p_nation'] == 0) { @@ -2349,7 +2339,7 @@ function increateRefreshEx($type, $cnt=1){ $date = date('Y_m_d H:i:s'); $date2 = substr($date, 0, 10); - $online = onlinenum($connect); + $online = getOnlineNum(); $fp = fopen("logs/_{$date2}_refresh.txt", "a"); $msg = _String::Fill2($date,20," ")._String::Fill2($_SESSION['p_id'],13," ")._String::Fill2($_SESSION['p_name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ")._String::Fill2($type, 10, " ")." 동접자: {$online}"; fwrite($fp, $msg."\n"); @@ -2401,7 +2391,7 @@ function increaseRefresh($connect, $type="", $cnt=1) { $date = date('Y_m_d H:i:s'); $date2 = substr($date, 0, 10); - $online = onlinenum($connect); + $online = getOnlineNum(); $fp = fopen("logs/_{$date2}_refresh.txt", "a"); $msg = _String::Fill2($date,20," ")._String::Fill2($_SESSION['p_id'],13," ")._String::Fill2($_SESSION['p_name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ")._String::Fill2($type, 10, " ")." 동접자: {$online}"; fwrite($fp, $msg."\n"); @@ -2437,7 +2427,7 @@ function increaseRefresh($connect, $type="", $cnt=1) { } function updateTraffic($connect) { - $online = onlinenum($connect); + $online = getOnlineNum(); $query = "select year,month,refresh,maxonline,maxrefresh from game where no='1'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -2474,7 +2464,7 @@ function CheckOverhead($connect) { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); - $onlineNumber = onlinenum($connect); + $onlineNumber = getOnlineNum(); switch($admin['turnterm']) { case 0: $thr1 = 30; $thr2 = 60; $thr3 = 120; $con1 = 480; $con2 = 360; $con3 = 240; $con4 = 120; break; // 120분턴 case 1: $thr1 = 30; $thr2 = 60; $thr3 = 120; $con1 = 480; $con2 = 360; $con3 = 240; $con4 = 120; break; // 60분턴