mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Updated endpoint
This commit is contained in:
parent
46f20d36b3
commit
cfe5ca91b2
@ -37,7 +37,6 @@ class SendUsageTask extends AsyncTask{
|
|||||||
|
|
||||||
public function __construct(Server $server, $type, $playerList = []){
|
public function __construct(Server $server, $type, $playerList = []){
|
||||||
$endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/";
|
$endpoint = "http://" . $server->getProperty("anonymous-statistics.host", "stats.pocketmine.net") . "/";
|
||||||
$path = "post";
|
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data["uniqueServerId"] = $server->getServerUniqueId();
|
$data["uniqueServerId"] = $server->getServerUniqueId();
|
||||||
@ -46,7 +45,6 @@ class SendUsageTask extends AsyncTask{
|
|||||||
|
|
||||||
switch($type){
|
switch($type){
|
||||||
case self::TYPE_OPEN:
|
case self::TYPE_OPEN:
|
||||||
$path = "open";
|
|
||||||
$data["event"] = "open";
|
$data["event"] = "open";
|
||||||
|
|
||||||
$version = new VersionString();
|
$version = new VersionString();
|
||||||
@ -92,7 +90,6 @@ class SendUsageTask extends AsyncTask{
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case self::TYPE_STATUS:
|
case self::TYPE_STATUS:
|
||||||
$path = "status";
|
|
||||||
$data["event"] = "status";
|
$data["event"] = "status";
|
||||||
|
|
||||||
$data["server"] = [
|
$data["server"] = [
|
||||||
@ -131,13 +128,12 @@ class SendUsageTask extends AsyncTask{
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case self::TYPE_CLOSE:
|
case self::TYPE_CLOSE:
|
||||||
$path = "close";
|
|
||||||
$data["event"] = "close";
|
$data["event"] = "close";
|
||||||
$data["crashing"] = $server->isRunning();
|
$data["crashing"] = $server->isRunning();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->endpoint = $endpoint . $path;
|
$this->endpoint = $endpoint . "api/post";
|
||||||
$this->data = json_encode($data/*, JSON_PRETTY_PRINT*/);
|
$this->data = json_encode($data/*, JSON_PRETTY_PRINT*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user