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

32 lines
622 B
PHP

<?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";
}
}
?>