mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Merge branch 'master' of https://github.com/kotyaralih/NostalgiaCore
This commit is contained in:
commit
7b4d69d550
2 changed files with 0 additions and 38 deletions
|
|
@ -137,7 +137,6 @@ class ServerAPI{
|
||||||
"enable-query" => true,
|
"enable-query" => true,
|
||||||
"enable-rcon" => false,
|
"enable-rcon" => false,
|
||||||
"rcon.password" => substr(base64_encode(Utils::getRandomBytes(20, false)), 3, 10),
|
"rcon.password" => substr(base64_encode(Utils::getRandomBytes(20, false)), 3, 10),
|
||||||
"send-usage" => true,
|
|
||||||
"auto-save" => true,
|
"auto-save" => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -204,32 +203,6 @@ class ServerAPI{
|
||||||
$this->server->api->level->saveAll();
|
$this->server->api->level->saveAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendUsage(){
|
|
||||||
console("[DEBUG] Sending usage data...", true, true, 2);
|
|
||||||
$plist = "";
|
|
||||||
foreach($this->plugin->getList() as $p){
|
|
||||||
$plist .= str_replace(array(";", ":"), "", $p["name"]).":".str_replace(array(";", ":"), "", $p["version"]).";";
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->asyncOperation(ASYNC_CURL_POST, array(
|
|
||||||
"url" => "http://stats.pocketmine.net/usage.php",
|
|
||||||
"data" => array(
|
|
||||||
"serverid" => $this->server->serverID,
|
|
||||||
"port" => $this->server->port,
|
|
||||||
"os" => Utils::getOS(),
|
|
||||||
"memory_total" => $this->getProperty("memory-limit"),
|
|
||||||
"memory_usage" => memory_get_usage(true),
|
|
||||||
"php_version" => PHP_VERSION,
|
|
||||||
"version" => MAJOR_VERSION,
|
|
||||||
"mc_version" => CURRENT_MINECRAFT_VERSION,
|
|
||||||
"protocol" => ProtocolInfo::CURRENT_PROTOCOL,
|
|
||||||
"online" => count($this->server->clients),
|
|
||||||
"max" => $this->server->maxClients,
|
|
||||||
"plugins" => $plist,
|
|
||||||
),
|
|
||||||
), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __destruct(){
|
public function __destruct(){
|
||||||
foreach($this->apiList as $i => $ob){
|
foreach($this->apiList as $i => $ob){
|
||||||
if(method_exists($ob, "__destruct")){
|
if(method_exists($ob, "__destruct")){
|
||||||
|
|
@ -295,10 +268,6 @@ class ServerAPI{
|
||||||
self::$serverRequest = $this->server;
|
self::$serverRequest = $this->server;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getProperty("send-usage") !== false){
|
|
||||||
$this->server->schedule(6000, array($this, "sendUsage"), array(), true); //Send the info after 5 minutes have passed
|
|
||||||
$this->sendUsage();
|
|
||||||
}
|
|
||||||
if($this->getProperty("auto-save") === true){
|
if($this->getProperty("auto-save") === true){
|
||||||
$this->server->schedule(18000, array($this, "autoSave"), array(), true);
|
$this->server->schedule(18000, array($this, "autoSave"), array(), true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,13 +160,6 @@ LICENSE;
|
||||||
$config->set("enable-rcon", false);
|
$config->set("enable-rcon", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "[*] ".$this->lang->usage_info."\n";
|
|
||||||
echo "[?] ".$this->lang->usage_disable." (y/N): ";
|
|
||||||
if(strtolower($this->getInput("n")) === "y"){
|
|
||||||
$config->set("send-usage", false);
|
|
||||||
}else{
|
|
||||||
$config->set("send-usage", true);
|
|
||||||
}
|
|
||||||
$config->save();
|
$config->save();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue