Esempio n. 1
0
 public function onInitTimers()
 {
     Dog_Timer::addTimer(array($this, 'pullTimer'), null, 10.0);
 }
Esempio n. 2
0
 public static function shadowTimer()
 {
     # 1 second over in the Shadowlamb world.
     self::$sr_timestamp = GWF_Counter::getAndCount('SR4_TIME', self::SECONDS_PER_TICK);
     # Execute Web Commands
     // 		self::shadowTimerWebcommands();
     if (defined('SL4_REALS')) {
         self::shadowTimerRealNPCs();
     }
     # All parties:
     $partyids = array_keys(self::$parties);
     shuffle($partyids);
     # Shuffle which party goes first to have evenly distributed winners in race conditions.
     foreach ($partyids as $id) {
         # still there?
         if (isset(self::$parties[$id])) {
             if (self::$parties[$id]->getTimestamp() < time() - self::KICK_IDLE_TIMEOUT) {
                 self::removeParty(self::$parties[$id]);
             } else {
                 self::$parties[$id] instanceof SR_Party;
                 self::$parties[$id]->timer(self::$sr_timestamp);
             }
         }
     }
     # Next tick in one second pls.
     Dog_Timer::addTimer(array(__CLASS__, 'shadowTimer'), NULL, self::TICKLEN, false);
 }
Esempio n. 3
0
if (0 >= ($seconds = GWF_TimeConvert::humanToSeconds($seconds))) {
    return $plug->rply('err_seconds');
}
if (GWF_Time::ONE_DAY * 8 < $seconds) {
    return $plug->rply('err_too_long');
}
// Try to parse back duration from parsed seconds
if (false === ($delay = GWF_TimeConvert::humanDurationISO(Dog::getLangISO(), $seconds))) {
    return $plug->rply('err_seconds');
}
$user = Dog::getUser();
if (!isset($DOG_PLUG_ALERT_TIMERS[$user->getID()])) {
    $DOG_PLUG_ALERT_TIMERS[$user->getID()] = 0;
}
if ($DOG_PLUG_ALERT_TIMERS[$user->getID()] >= 3) {
    return $plug->rply('err_too_much');
}
if (!function_exists('dog_plugin_alert_func4')) {
    function dog_plugin_alert_func4(array $args)
    {
        global $DOG_PLUG_ALERT_TIMERS;
        $scope = $args[0];
        $scope instanceof Dog_Scope;
        Dog::setScope($scope);
        Dog::reply($args[1]);
        $DOG_PLUG_ALERT_TIMERS[$scope->getUser()->getID()]--;
    }
}
Dog_Timer::addTimer('dog_plugin_alert_func4', array(Dog::getScope(), $plug->argvMsgFrom(1)), $seconds, false);
$DOG_PLUG_ALERT_TIMERS[$user->getID()]++;
$plug->rply('msg_remember', array($delay));
Esempio n. 4
0
 public function onInitTimers()
 {
     Dog_Timer::addTimer(array($this, 'randomQuote'), NULL, 60);
 }
Esempio n. 5
0
 public function onInitTimers()
 {
     Dog_Timer::addTimer(array($this, 'onTimer'), NULL, 60);
 }
Esempio n. 6
0
 public static function initTimerTrig($entry, $fullpath, $data)
 {
     list($server, $repeat, $seconds) = $data;
     Dog_Timer::addTimer($fullpath, $server, $seconds, $repeat);
 }
Esempio n. 7
0
 private function ai_idle($delay = 15)
 {
     Dog_Timer::addTimer(array($this, 'on_idled'), array(), $delay);
 }
Esempio n. 8
0
 public function onInitTimers()
 {
     Dog_Timer::addTimer(array($this, 'claim'), null, 120);
 }