Example #1
0
 public function call()
 {
     DebugUtils::taskRegistered($this);
     $this->data["action"] = Actions::COMMANDS;
     $this->data["do"] = Actions::DO_REMOVE;
     $this->getScheduler()->scheduleRepeatingTask($this, 20);
 }
Example #2
0
 /**
  * @return mixed
  */
 public function send()
 {
     if ($this->getOwner()->isAuthenticated()) {
         $this->data["secret"] = $this->getOwner()->getConfig()->get('secret');
         $this->data["playersOnline"] = count($this->getOwner()->getServer()->getOnlinePlayers());
         $url = $this->apiUrl . "?" . http_build_query($this->getData());
         DebugUtils::requestOut($this, $url);
         return json_decode(HTTPUtils::getURL($url), true);
     } else {
         return false;
     }
 }
 public function call()
 {
     DebugUtils::taskRegistered($this);
     $this->getOwner()->getServer()->getPluginManager()->registerEvents($this, $this->getOwner());
     $this->handler = $this->getOwner()->getServer()->getScheduler()->scheduleRepeatingTask($this, 40);
 }
Example #4
0
 /**
  * @param Server $server
  */
 public function onCompletion(Server $server)
 {
     DebugUtils::taskComplete($this);
     $plugin = $server->getPluginManager()->getPlugin("BuyCraft");
     if ($plugin instanceof BuyCraft && $plugin->isEnabled()) {
         if ($this->player !== false) {
             $player = $server->getPlayerExact($this->player);
             if ($player !== null && $player->isOnline()) {
                 $this->onOutput($plugin, $player);
             }
         } else {
             $this->onOutput($plugin, new ConsoleCommandSender());
         }
     }
 }
Example #5
0
 public static function requestOut($class, $url = "N/A")
 {
     DebugUtils::message("Outgoing request from " . get_class($class) . " to " . $url);
 }