This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/main/library/isGameRunning.inc

31 lines
434 B
PHP

<?php
class main_isGameRunning {
function main_isGameRunning($lib) {
$this->lib = $lib;
}
function run($game) {
$g = config::getGame($game);
if (!$g) {
return false;
}
$lib = $g->getLib();
if ($lib->call('isFinished')) {
return false;
}
$now = time();
foreach ($g->ticks as $td => $tick) {
if ($tick->first <= $now && $tick->definition->public) {
return true;
}
}
return false;
}
}
?>