feat,wip: 유니크 입찰 기본 구현
This commit is contained in:
@@ -17,37 +17,6 @@ class AuctionUniqueItem extends Auction
|
||||
|
||||
static AuctionType $auctionType = AuctionType::UniqueItem;
|
||||
|
||||
static public function genObfuscatedName(int $id): string
|
||||
{
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$namePool = $gameStor->getValue('obfuscatedNamePool');
|
||||
if ($namePool === null) {
|
||||
$rng = new RandUtil(new LiteHashDRBG(Util::simpleSerialize(
|
||||
UniqueConst::$hiddenSeed,
|
||||
)));
|
||||
$namePool = [];
|
||||
foreach (GameConst::$randGenFirstName as $ch0) {
|
||||
foreach (GameConst::$randGenMiddleName as $ch1) {
|
||||
foreach (GameConst::$randGenLastName as $ch2) {
|
||||
$namePool[] = "{$ch0}{$ch1}{$ch2}";
|
||||
}
|
||||
}
|
||||
}
|
||||
$namePool = $rng->shuffle($namePool);
|
||||
$gameStor->setValue('obfuscatedNamePool', $namePool);
|
||||
}
|
||||
|
||||
|
||||
$dupIdx = intdiv($id, count($namePool));
|
||||
$subIdx = $id % count($namePool);
|
||||
if ($dupIdx == 0) {
|
||||
return $namePool[$subIdx];
|
||||
}
|
||||
return "{$namePool[$subIdx]}{$dupIdx}";
|
||||
}
|
||||
|
||||
static public function openItemAuction(BaseItem $item, General $general, int $startAmount): self|string
|
||||
{
|
||||
if ($startAmount < GameConst::$inheritItemUniqueMinPoint) {
|
||||
|
||||
Reference in New Issue
Block a user