/** * @param BuyCraft $main * @param Player $manual * @param array $data */ public function __construct(BuyCraft $main, $data = []) { parent::__construct($main); DebugUtils::construct($this); if ($main->getConfig()->get("https")) { $this->apiUrl = "https://api.buycraft.net/v4"; } else { $this->apiUrl = "http://api.buycraft.net/v4"; } $this->data = $data; }
/** * @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); }