diff --git a/hwe/func_history.php b/hwe/func_history.php index 40cc5ac3..17a4bcd7 100644 --- a/hwe/func_history.php +++ b/hwe/func_history.php @@ -43,6 +43,19 @@ function getFormattedFileLogAll(string $path){ }, getRawFileLogAll($path)); } +function eraseTnmtFightLogAll(){ + foreach(range(0, 49) as $i){ + eraseTnmtFightLog($i); + } +} + +function eraseTnmtFightLog(int $group){ + $filepath = "logs/fight{$group}.txt"; + if(file_exists($filepath)){ + @unlink($filepath); + } +} + function pushTnmtFightLog(int $group, $log) { pushRawFileLog("logs/fight{$group}.txt", $log); } diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php index ce8253ba..08510715 100644 --- a/hwe/func_tournament.php +++ b/hwe/func_tournament.php @@ -232,12 +232,7 @@ function startTournament($auto, $type) { $db = DB::db(); $connect=$db->get(); - for($i=0; $i<50; $i++){ - $filepath = "logs/fight{$i}.txt"; - if(file_exists($filepath)){ - @unlink($filepath); - } - } + eraseTnmtFightLogAll(); switch($auto) { case 1: $unit = 60; break; @@ -760,6 +755,8 @@ function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) { $db = DB::db(); $connect=$db->get(); + eraseTnmtFightLog($group); + $query = "select *,(ldr+pwr+itl)*7/15 as tot,h,w,b from tournament where grp='$group' and grp_no='$g1'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $gen1 = MYDB_fetch_array($result); diff --git a/hwe/index.php b/hwe/index.php index 4ee42fc2..b183392b 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; -$session = Session::requireLogin()->loginGame(); +$session = Session::requireLogin()->loginGame()->setReadOnly(); $userID = Session::getUserID(); increaseRefresh("메인", 1); @@ -31,12 +31,6 @@ if ($me === null) { header('Location: ../'); die(); } -if (!$session->generalID) { - $session = Session::requireGameLogin(); -} -$session->setReadOnly(); -$userID = Session::getUserID(); - if ($me['newmsg'] == 1 || $me['newvote'] == 1) { $db->update('general', [ diff --git a/hwe/templates/small_war_log.php b/hwe/templates/small_war_log.php index 290046f5..2837afbc 100644 --- a/hwe/templates/small_war_log.php +++ b/hwe/templates/small_war_log.php @@ -1,9 +1,7 @@ -
- - - - - 년 +
월: