invalidateCacheValue('last_betting_id'); $bettingID = ($gameStor->getValue('last_betting_id') ?? 0) + 1; $gameStor->setValue('last_betting_id', $bettingID); $nationBettingStor = KVStorage::getStorage($db, 'nation_betting'); [$year, $month] = [$env['year'], $env['month']]; if ($this->nationCnt == 1) { $name = "천통국"; } else { $name = "최후 {$this->nationCnt}국"; } $openYearMonth = Util::joinYearMonth($year, $month); $closeYearMonth = $openYearMonth + 24; $bettingInfo = new NationBettingInfo( id: $bettingID, name: "[{$year}년 {$month}월] {$name} 예상 베팅", finished: false, selectCnt: $this->nationCnt, reqInheritancePoint: true, openYearMonth: $openYearMonth, closeYearMonth: $closeYearMonth, ); $nationBettingStor->setValue("id_{$bettingID}", $bettingInfo->toArray()); $db->insert('event', [ 'target' => 'DESTROY_NATION', 'priority' => 1000, 'condition' => Json::encode( ["RemainNation", $this->nationCnt], ), 'action' => Json::encode([ ["FinishNationBetting", $bettingID], ["DeleteEvent"], ]), ]); $logger = new \sammo\ActionLogger(0, 0, $year, $month); $logger->pushGlobalHistoryLog("【내기】천하통일을 염원하는 내기가 진행중입니다! 호사가의 참여를 기다립니다!"); $logger->flush(); return [__CLASS__, true]; } }