feat: replace game schedules with logical ticks
This commit is contained in:
@@ -43,12 +43,10 @@ function putInfoText(&$info, ?array $currentTargetEnv){
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$oNow = new \DateTimeImmutable();
|
||||
|
||||
$now = $oNow->format('Y-m-d H:i:s');
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$clock = GameClock::fromStorage($gameStor);
|
||||
$now = $clock->nowTick();
|
||||
|
||||
$eventEnv = $gameStor->getValues(['npcmode', 'startyear', 'year', 'month']);
|
||||
$npcmode = $eventEnv['npcmode'];
|
||||
@@ -88,7 +86,7 @@ if($tokens){
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>$pick,
|
||||
'validUntil'=>$valid_until
|
||||
'validUntil'=>$clock->formatTick(Util::toInt($valid_until))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -108,5 +106,5 @@ sortTokens($pick);//좀 무식하지만..
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'pick'=>$pick,
|
||||
'validUntil'=>$valid_until
|
||||
'validUntil'=>$valid_until === null ? null : $clock->formatTick(Util::toInt($valid_until))
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user