Send Usage data again

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-14 16:30:26 +02:00
parent 8442c0529e
commit 69b78a9dd6
2 changed files with 11 additions and 15 deletions

View File

@ -178,7 +178,7 @@ class ConsoleAPI{
}
if($this->server->api->dhandle("console.command.".$cmd, array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias)) === false
or $this->server->api->dhandle("console.command", array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias)) === false){
$output = "You don't have permissions\n";
$output = "You don't have permission to use this command.\n";
}else{
if(isset($this->cmds[$cmd]) and is_callable($this->cmds[$cmd])){
$output = @call_user_func($this->cmds[$cmd], $cmd, $params, $issuer, $alias);

View File

@ -245,7 +245,6 @@ class ServerAPI{
return false;
}
$ob = $this->asyncCalls[$id];
$this->asyncCalls[$id] = null;
unset($this->asyncCalls[$id]);
return $ob;
}
@ -256,19 +255,15 @@ class ServerAPI{
foreach($this->plugin->getList() as $p){
$plist .= str_replace(array(";", ":"), "", $p["name"]).":".str_replace(array(";", ":"), "", $p["version"]).";";
}
$this->async("Utils::curl_post", array(
0 => "http://stats.pocketmine.net/usage.php",
1 => array(
"serverid" => $this->server->serverID,
"os" => Utils::getOS(),
"version" => MAJOR_VERSION,
"protocol" => CURRENT_PROTOCOL,
"online" => count($this->server->clients),
"max" => $this->server->maxClients,
"plugins" => $plist,
),
2 => 10
), true);
Utils::curl_post("http://stats.pocketmine.net/usage.php",array(
"serverid" => $this->server->serverID,
"os" => Utils::getOS(),
"version" => MAJOR_VERSION,
"protocol" => CURRENT_PROTOCOL,
"online" => count($this->server->clients),
"max" => $this->server->maxClients,
"plugins" => $plist,
), 2);
}
public function __destruct(){
@ -343,6 +338,7 @@ class ServerAPI{
if($this->getProperty("send-usage") !== false){
$this->server->schedule(36000, array($this, "sendUsage"), array(), true); //Send usage data every 30 minutes
$this->server->schedule(6000, array($this, "sendUsage")); //Send the info after 5 minutes have passed
$this->sendUsage();
}
$this->server->init();
unregister_tick_function(array($this->server, "tick"));