Exemplo n.º 1
0
 public static function cleanup($message = 'Clean shutdown!')
 {
     GWF_CachedCounter::persist();
     if (NULL !== Dog_Init::getStartupTime()) {
         GWF_Counter::increaseCount('dog_uptime', Dog_Init::getUptime());
     }
     if (self::$CLEANED === false) {
         self::$CLEANED = true;
         foreach (Dog::getServers() as $server) {
             $server instanceof Dog_Server;
             if ($server->isConnected()) {
                 $server->disconnect($message);
             }
         }
     }
     die(0);
 }
Exemplo n.º 2
0
<?php

$lang = array('en' => array('help' => 'Usage: %CMD%. Print statistics about the bots uptime.', 'out' => 'This bot is running since %s. Total runtime: %s.'));
$plugin = Dog::getPlugin();
if ($plugin->argc() > 0) {
    $plugin->showHelp();
} else {
    $uptime = round(Dog_Init::getUptime());
    $total = GWF_Counter::getCount('dog_uptime') + $uptime;
    $plugin->rply('out', array(GWF_Time::humanDuration($uptime), GWF_Time::humanDuration($total)));
}