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/site/beta5/handlers/ticks.inc

33 lines
622 B
PHP
Raw Permalink Normal View History

2016-01-10 11:01:49 +01:00
<?php
class page_handler
{
var $needsAuth = true;
var $ajax = array(
'init' => 'readInitString()',
'func' => array('updateTicks')
);
function updateTicks()
{
$tickLib = $this->game->getLib('main');
$tinf = $tickLib->call('getTicks', getLanguage());
$now = time();
$dt = array($now);
foreach ($ticks as $tid => $td)
if ($td['game'])
array_push($dt, "$tid#" . $td['last']);
return join('#', $dt);
}
function handle($input)
{
$lang = getLanguage();
$tickLib = $this->game->getLib('main');
$this->data = $tickLib->call('getTicks', getLanguage());
$this->output = "ticks";
}
}
?>