コード例 #1
0
ファイル: ApiAsyncTask.php プロジェクト: GeenoMC/BuyCraft
 /**
  * @param BuyCraft $main
  * @param array $data
  * @param bool $player
  */
 public function __construct(BuyCraft $main, $data = [], $player = false)
 {
     DebugUtils::construct($this);
     if ($main->getConfig()->get("https")) {
         $this->apiUrl = "https://api.buycraft.net/v4";
     } else {
         $this->apiUrl = "http://api.buycraft.net/v4";
     }
     $data["secret"] = $main->getConfig()->get("secret");
     $data["playersOnline"] = count($main->getServer()->getOnlinePlayers());
     $this->data = serialize($data);
     $this->player = $player;
     $this->isAuthenticated = $main->isAuthenticated();
     $this->autoloader = unserialize(serialize($main->getServer()->getLoader()));
     //TODO improve this
     $this->onConfig($main);
 }