From 58da20f27605bc9b776f924c87a914097d4cdfb6 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 9 Jun 2022 15:49:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8F=99=EC=9D=BC=20=EB=B6=80=EC=9C=84?= =?UTF-8?q?=20=EC=9C=A0=EB=8B=88=ED=81=AC=20=EC=86=8C=EC=9C=A0=EC=8B=9C,?= =?UTF-8?q?=20'1=ED=84=B4'=20=EC=97=B0=EC=9E=A5=ED=95=98=EB=8F=84=EB=A1=9D?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/AuctionUniqueItem.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hwe/sammo/AuctionUniqueItem.php b/hwe/sammo/AuctionUniqueItem.php index 9ede126f..a38c9440 100644 --- a/hwe/sammo/AuctionUniqueItem.php +++ b/hwe/sammo/AuctionUniqueItem.php @@ -126,7 +126,7 @@ class AuctionUniqueItem extends Auction ) ?? []); $auctionIDList = []; - foreach($openUniqueAuctions as $auction){ + foreach ($openUniqueAuctions as $auction) { $auctionIDList[] = $auction->id; } $db = DB::db(); @@ -149,7 +149,7 @@ class AuctionUniqueItem extends Auction $itemCode = $this->info->target; - if($itemCode === null){ + if ($itemCode === null) { throw new \Exception('아이템 코드가 없습니다.'); } @@ -234,6 +234,7 @@ class AuctionUniqueItem extends Auction return '유니크 아이템 소유 제한 상태입니다. 종료 시간이 연장됩니다.'; } + $isExtendCloseDateRequired = false; foreach (GameConst::$allItems as $itemType => $itemList) { //아직은 그런 경우는 없지만 동일 유니크를 여러 부위에 장착할 수 있을지도 모름 if (!key_exists($itemKey, $itemList)) { @@ -243,11 +244,13 @@ class AuctionUniqueItem extends Auction $ownItem = $general->getItem($itemType); if ($ownItem->getRawClassName() == $itemKey) { //FIXME: 이 경우에는 환불이 되던가 해야함. + $isExtendCloseDateRequired = true; $reasons[] = '이미 그 유니크를 가지고 있습니다.'; continue; } if (!$ownItem->isBuyable()) { + $isExtendCloseDateRequired = true; $reasons[] = '이미 다른 유니크를 가지고 있습니다.'; continue; } @@ -263,6 +266,16 @@ class AuctionUniqueItem extends Auction } if (!$availableItemTypes) { + if ($isExtendCloseDateRequired) { + $turnTerm = $gameStor->getValue('turnterm'); + //동일 부위 제한에 걸렸다면 자동 연장 + $extendedCloseDate = $this->info->closeDate->add(TimeUtil::secondsToDateInterval( + max(static::MIN_EXTENSION_MINUTES_LIMIT_BY_BID, $turnTerm * static::COEFF_EXTENSION_MINUTES_LIMIT_BY_BID) * 60 + )); + + $this->extendCloseDate($extendedCloseDate, true); + $this->extendLatestBidCloseDate(null); + } return join(' ', $reasons); }