From 3004b20c879c96c8b2c29f19087c2d2862fa1b12 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 11 Apr 2018 01:08:12 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=ED=8C=A8=EC=B9=98=20-=20?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=84=B4=20=EC=8B=A4=ED=96=89=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=84=B8=EC=85=98=EB=9D=BD=EC=9D=B4=20=EA=B1=B8=EB=A6=AC?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D.=20-=20=ED=86=A0?= =?UTF-8?q?=EB=84=88=EB=A8=BC=ED=8A=B8=EC=97=90=EC=84=9C=20=EB=A7=A4=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B4=EB=93=9C=EB=A7=88=EB=8B=A4=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EA=B0=80=20=EC=B4=88=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20-=20=EC=A0=84=ED=88=AC=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=ED=91=9C=EA=B8=B0=EC=97=90=EC=84=9C=20=20=EB=B6=88?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EB=B9=88=EC=B9=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_history.php | 13 +++++++++++++ hwe/func_tournament.php | 9 +++------ hwe/index.php | 8 +------- hwe/templates/small_war_log.php | 10 ++++------ 4 files changed, 21 insertions(+), 19 deletions(-) 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 @@ -
- - - - - 년 +
월: