Example #1
0
 public static function bootstrap()
 {
     $timings = self::getInstance();
     $timings->prepareData();
     if (!empty($_GET['raw'])) {
         $timings->showRaw();
     }
     Template::render();
 }
Example #2
0
function printRows($lag, $level)
{
    global $processMap;
    $tpl = Template::getInstance();
    foreach ($lag as $l) {
        if (($l->total < 500000 || LAG_ONLY && $l->lagTotal < 500000) && !NOFILTER) {
            continue;
        }
        $lagTicks = (int) $tpl->masterHandler->lagCount;
        $count = (int) (LAG_ONLY ? $l->lagCount : $l->count);
        if ($count === 0 || LAG_ONLY && $lagTicks === 0) {
            continue;
        }
        openRow($level, $l);
        printRecord($l);
        $id = $l->id->id;
        $h = $tpl->handlerData[$id];
        if (!empty($h->children) && ++$processMap[$id] == 1) {
            if (!NOFILTER) {
                $children = array_filter($h->children, 'lagFilter');
            } else {
                $children = $h->children;
            }
            if (!empty($children)) {
                $children = array_map(function ($v) {
                    $tpl = Template::getInstance();
                    $h = $tpl->handlerData[$v->id->id];
                    $v->children = $h->children;
                    return $v;
                }, $children);
                usort($children, 'lagSort');
                echo '<div class="children">';
                printRows($children, $level + 1);
                echo '</div>';
            }
            --$processMap[$id];
        }
        closeRow();
    }
}
Example #3
0
<?php

use Starlis\Timings\Json\TimingsMaster;
use Starlis\Timings\Template;
use Starlis\Timings\util;
$timingsData = TimingsMaster::getInstance();
$tpl = Template::getInstance();
$system = $timingsData->system;
?>
<div id="header-right" class=" ui-widget ui-widget-content ui-corner-all">
	<?php 
if ($timingsData->icon) {
    ?>
		<img class="server-icon" style="float:left" src="image.php?id=<?php 
    echo util::esc($timingsData->icon);
    ?>
" width="64" height="64" />
	<?php 
}
?>

	<span class="server-name">Server: <b class="<?php 
echo $timingsData->onlinemode === true ? "online-server" : "offline-server";
?>
"
			><?php 
echo util::esc($timingsData->server);
?>
</b> (max: <?php 
echo util::esc($timingsData->maxplayers);
?>
Example #4
0
function printRows($lag, $level)
{
    global $processMap;
    $tpl = Template::getInstance();
    foreach ($lag as $l) {
        if ($l->lagTotal < 500000) {
            //			continue;
        }
        printRecord($l, $level);
        $id = $l->id->id;
        $h = $tpl->handlerData[$id];
        if (!empty($h->children) && ++$processMap[$id] == 1) {
            $children = array_filter($h->children, 'lagFilter');
            if (!empty($children)) {
                $children = array_map(function ($v) {
                    $tpl = Template::getInstance();
                    $h = $tpl->handlerData[$v->id->id];
                    $v->children = $h->children;
                    return $v;
                }, $children);
                usort($children, 'lagSort');
                printRows($children, $level + 1);
            }
            --$processMap[$id];
        }
    }
}