public function send() { $data = $this->getData(); if ($this->isAuthenticated || $data["action"] === Actions::AUTHENTICATE) { $url = $this->apiUrl . "?" . http_build_query($data); DebugUtils::requestOut($this, $url); $this->output = serialize(json_decode(HTTPUtils::getURL($url), true)); } else { $this->output = false; } }
/** * @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; } }