Esempio n. 1
0
 public function Ping()
 {
     if (!$this->iHasBeenReply) {
         $this->iNoReply++;
         $this->iHasBeenReply = false;
     }
     if ($this->iNoReply >= 5) {
         $this->destructBot();
         Timers::Create(array($this, "constructBot"), $this->aConfig['timewait'], 0);
         $this->isWaiting = true;
         $this->iNoReply = 0;
     }
     $this->Output("PING " . time());
     $this->iHasBeenReply = false;
 }
Esempio n. 2
0
 /**
  * checking a password against a hash
  *
  * @param string $password Password
  * @param string $hash Hash of stored password
  * @param string $email
  * @return bool
  */
 function check($password, $hash, $email = '')
 {
     Timers::start('hash_check');
     $password = $this->salt($password, $email);
     if (PASSWORD_HASH == 'PBKDF2') {
         $return = $this->pbkdf2_check($password, $hash, PBKDF2_SALT, PBKDF2_BINARY, PBKDF2_ITERATIONS, PBKDF2_KEY_LENGTH, PBKDF2_ALGORITHM);
     } else {
         if (PASSWORD_HASH == 'bcrypt') {
             $return = $this->bcrypt_check($password, $hash);
         } else {
             if (PASSWORD_HASH == 'scrypt') {
                 $return = $this->scrypt_check($password, $hash, SCRYPT_PEPPER, SCRYPT_KEY_LENGTH);
             }
         }
     }
     Timers::stop('hash_check');
     return $return;
 }
Esempio n. 3
0
 public function run()
 {
     DB::table('timers')->delete();
     Timers::create(array('itemID' => '40228414', 'bashed' => 0, 'outcome' => 0, 'structureType' => 0, 'structureStatus' => 0, 'timerType' => 0, 'timeExiting' => date('Y-m-d H:i:s', 1387366200), 'user_id' => '1', 'type' => '0'));
 }
Esempio n. 4
0
 /**
  *	Unloads an active plugin from memory.
  *
  *	@param string $sPlugin
  *	@return bool 'true' on success.
  */
 public function pluginUnload($sPlugin)
 {
     if (isset($this->oPlugins->{$sPlugin})) {
         unset($this->oPlugins->{$sPlugin});
         Timers::CheckCall();
         echo "* Plugin " . $sPlugin . " has been unloaded." . PHP_EOL;
         return true;
     }
     return false;
 }
Esempio n. 5
0
function timer($time, $callback, $specificTime = false)
{
    Timers::add($time, $callback, $specificTime);
}
Esempio n. 6
0
 *	@author David Weston <*****@*****.**>
 *	@licence http://www.typefish.co.uk/licences/
 */
/* Key initiation process. */
error_reporting(E_ALL | E_STRICT);
date_default_timezone_set("Europe/London");
// Change this to your time zone.
define("BASE_DIRECTORY", dirname(__FILE__));
require "System/Definitions.php";
/* Include the system files. */
include "System/Format.php";
include "System/Master.php";
include "System/Socket.php";
include "System/Plugins.php";
include "System/Timers.php";
include "System/Control.php";
include "System/Configuration.php";
/* Set up the controlling classes */
Control::$oConfig = new ConfigParser();
Control::$oConfig->parseDirectory();
/* Bot loop */
while (true) {
    Timers::Scan();
    foreach (Control::$aBots as $oMaster) {
        $oMaster->Loop();
    }
    Timers::Scan();
    usleep(CORE_SLEEP);
}
/* And what happens when we want to leave everything behind? */
exit;
Esempio n. 7
0
 /**
  * A utility method for setting the soonest scheduled time.
  *
  * @static
  * @return float
  */
 private static function setNextTime($nextTime)
 {
     if (self::$nextTime == 0 || self::$nextTime > $nextTime) {
         self::$nextTime = $nextTime;
     }
 }
Esempio n. 8
0
 /**  Constructor */
 public function __construct()
 {
     parent::__construct();
     $this->streams = $this->handlers = array(self::READ => array(), self::WRITE => array());
     $this->running = true;
     if (function_exists('event_base_new')) {
         $this->evbase = event_base_new();
     }
 }
Esempio n. 9
0
 public function deleteTimerAction($id)
 {
     $timer = Timers::find($id);
     if ($timer != false and $timer->bashed !== '1') {
         $timer->delete();
         return Redirect::route('home')->with('flash_msg', 'Timer Deleted');
     } else {
         return Redirect::route('home')->with('flash_error', 'Timer Not Found or Already Marked');
     }
 }
Esempio n. 10
0
 /**
  * Constructs a Timers object.
  */
 function __construct($id = "")
 {
     self::$id = $id;
 }
Esempio n. 11
0
 /**
  *	Creates a timer, framework.
  *
  *	@see Master::timerCreate()
  *	@ignore
  */
 public function timerCreate($cCallback, $iInterval, $iRepeat)
 {
     $cCallback = is_array($cCallback) ? $cCallback : array($this, $cCallback);
     $aArguments = func_get_args();
     array_shift($aArguments);
     array_shift($aArguments);
     array_shift($aArguments);
     return Timers::Create($sCallback, $iInterval, $iRepeat, (array) $aArguments);
 }