From 264db40bdc3b3fae6e947e1718dc8f9edc1cf0ec Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 28 Jan 2022 02:43:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B2=A0=ED=8C=85=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20=EC=82=AC=EC=86=8C=ED=95=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20=EB=B2=A0=ED=8C=85=EC=9D=B4=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20-=20=EB=B2=A0=ED=8C=85=20?= =?UTF-8?q?=EB=8F=99=EC=8B=9C=20=EC=8B=A0=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Betting/Bet.php | 2 +- hwe/sammo/API/Betting/GetBettingDetail.php | 1 - hwe/sammo/API/Betting/GetBettingList.php | 14 ++++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hwe/sammo/API/Betting/Bet.php b/hwe/sammo/API/Betting/Bet.php index c5ffaec6..40bb3d81 100644 --- a/hwe/sammo/API/Betting/Bet.php +++ b/hwe/sammo/API/Betting/Bet.php @@ -39,7 +39,7 @@ class Bet extends \sammo\BaseAPI public function getRequiredSessionMode(): int { - return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + return static::REQ_GAME_LOGIN; } public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag) diff --git a/hwe/sammo/API/Betting/GetBettingDetail.php b/hwe/sammo/API/Betting/GetBettingDetail.php index 78e87507..99548309 100644 --- a/hwe/sammo/API/Betting/GetBettingDetail.php +++ b/hwe/sammo/API/Betting/GetBettingDetail.php @@ -38,7 +38,6 @@ class GetBettingDetail extends \sammo\BaseAPI { $db = DB::db(); - increaseRefresh("국가베팅장", 1); /** @var int */ $bettingID = $this->args['betting_id']; diff --git a/hwe/sammo/API/Betting/GetBettingList.php b/hwe/sammo/API/Betting/GetBettingList.php index df89dc55..57a25fbf 100644 --- a/hwe/sammo/API/Betting/GetBettingList.php +++ b/hwe/sammo/API/Betting/GetBettingList.php @@ -36,7 +36,7 @@ class GetBettingList extends \sammo\BaseAPI $me = $db->queryFirstRow('SELECT no,nation,officer_level,con,turntime,belong,penalty,permission FROM general WHERE owner=%i', $userID); $con = checkLimit($me['con']); if ($con >= 2) { - return "접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 갱신 가능 시각 : {$me['turntime']})"; + return "접속 제한중입니다."; } $bettingList = []; @@ -47,6 +47,17 @@ class GetBettingList extends \sammo\BaseAPI $bettingList[$item->id]['totalAmount'] = 0; } + [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); + + if(!$bettingList){ + return [ + 'result' => true, + 'bettingList' => $bettingList, + 'year' => $year, + 'month' => $month, + ]; + } + $bettingIDList = array_keys($bettingList); // XXX: query cache만 믿고 sum을 하는 짓을 벌여도 되는가? foreach ($db->queryAllLists( @@ -59,7 +70,6 @@ class GetBettingList extends \sammo\BaseAPI $bettingList[$bettingID]['totalAmount'] = $totalAmount; } - [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); return [ 'result' => true,