Updated endpoint

This commit is contained in:
Shoghi Cervantes 2015-05-21 16:31:42 +02:00
parent 46f20d36b3
commit cfe5ca91b2
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -37,7 +37,6 @@ class SendUsageTask extends AsyncTask{
public function __construct(Server $server, $type, $playerList = []){
$endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/";
$path = "post";
$data = [];
$data["uniqueServerId"] = $server->getServerUniqueId();
@ -46,7 +45,6 @@ class SendUsageTask extends AsyncTask{
switch($type){
case self::TYPE_OPEN:
$path = "open";
$data["event"] = "open";
$version = new VersionString();
@ -92,7 +90,6 @@ class SendUsageTask extends AsyncTask{
break;
case self::TYPE_STATUS:
$path = "status";
$data["event"] = "status";
$data["server"] = [
@ -131,13 +128,12 @@ class SendUsageTask extends AsyncTask{
break;
case self::TYPE_CLOSE:
$path = "close";
$data["event"] = "close";
$data["crashing"] = $server->isRunning();
break;
}
$this->endpoint = $endpoint . $path;
$this->endpoint = $endpoint . "api/post";
$this->data = json_encode($data/*, JSON_PRETTY_PRINT*/);
}