getValue("id_{$this->bettingID}"); if($bettingInfoRaw === null){ return [__CLASS__, true]; } try{ $bettingHelper = new Betting($this->bettingID); } catch (\Exception $e){ return [__CLASS__, false, $e->getMessage()]; } $bettingInfo = $bettingHelper->getInfo(); if($bettingInfo->type != 'nationBetting'){ return [__CLASS__, false, 'invalid type', $bettingInfo->type]; } $winnerNations = $bettingHelper->purifyBettingKey($db->queryFirstColumn('SELECT nation FROM nation WHERE level > 0')); if(count($winnerNations) != $bettingInfo->selectCnt){ return [__CLASS__, false, 'invalid winner cnt', $bettingInfo->selectCnt]; } $bettingHelper->giveReward($winnerNations); return [__CLASS__, true]; } }