feat,wip: 경매장을 db table로 분리
This commit is contained in:
@@ -5,6 +5,7 @@ namespace sammo;
|
||||
use DateTimeImmutable;
|
||||
use sammo\DTO\AuctionBidItem;
|
||||
use sammo\DTO\AuctionInfo;
|
||||
use sammo\DTO\AuctionInfoDetail;
|
||||
use sammo\Enums\AuctionType;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\Enums\ResourceType;
|
||||
@@ -44,7 +45,7 @@ class AuctionUniqueItem extends Auction
|
||||
return "{$namePool[$subIdx]}{$dupIdx}";
|
||||
}
|
||||
|
||||
static public function openItemAuction(BaseItem $item, General $general, int $startAmount): ?string
|
||||
static public function openItemAuction(BaseItem $item, General $general, int $startAmount): self|string
|
||||
{
|
||||
if ($startAmount < GameConst::$inheritItemUniqueMinPoint) {
|
||||
return '최소 경매 금액은 ' . GameConst::$inheritItemUniqueMinPoint . '입니다.';
|
||||
@@ -58,9 +59,6 @@ class AuctionUniqueItem extends Auction
|
||||
return '구매할 수 있는 아이템입니다.';
|
||||
}
|
||||
|
||||
if (GameConst::$allItems)
|
||||
|
||||
$auctionID = static::genNextAuctionID();
|
||||
$now = new DateTimeImmutable();
|
||||
|
||||
$db = DB::db();
|
||||
@@ -75,25 +73,28 @@ class AuctionUniqueItem extends Auction
|
||||
));
|
||||
|
||||
$info = new AuctionInfo(
|
||||
$auctionID,
|
||||
static::genObfuscatedName($general->getID()),
|
||||
$general->getID(),
|
||||
AuctionType::UniqueItem,
|
||||
$item->getRawClassName(),
|
||||
"{$item->getName()} 경매",
|
||||
false,
|
||||
ResourceType::inheritancePoint,
|
||||
$startAmount,
|
||||
null,
|
||||
1,
|
||||
AuctionType::UniqueItem,
|
||||
false,
|
||||
$item->getRawClassName(),
|
||||
$general->getID(),
|
||||
ResourceType::inheritancePoint,
|
||||
$now,
|
||||
$closeDate,
|
||||
$availableLatestBidCloseDate,
|
||||
new AuctionInfoDetail(
|
||||
"{$item->getName()} 경매",
|
||||
static::genObfuscatedName($general->getID()),
|
||||
|
||||
$startAmount,
|
||||
null,
|
||||
1,
|
||||
$availableLatestBidCloseDate,
|
||||
)
|
||||
);
|
||||
|
||||
$result = static::openAuction($info, $general);
|
||||
if ($result !== null) {
|
||||
return $result;
|
||||
$auctionID = static::openAuction($info, $general);
|
||||
if (!is_int($auctionID)) {
|
||||
return $auctionID;
|
||||
}
|
||||
$auction = new static($auctionID, $general);
|
||||
try {
|
||||
@@ -105,7 +106,7 @@ class AuctionUniqueItem extends Auction
|
||||
return "경매를 시작했지만, 첫 입찰에 실패했습니다: {$msg}";
|
||||
}
|
||||
|
||||
return null;
|
||||
return $auction;
|
||||
}
|
||||
|
||||
private function giveUniqueItem(AuctionBidItem $highestBid, General $bidder): ?string
|
||||
@@ -137,7 +138,7 @@ class AuctionUniqueItem extends Auction
|
||||
}
|
||||
}
|
||||
|
||||
if($availableEquipUniqueCnt <= 0){
|
||||
if ($availableEquipUniqueCnt <= 0) {
|
||||
return '유니크 아이템 소유 제한 상태입니다. 종료 시간이 연장됩니다.';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user