mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Moved /status into debug.commands
This commit is contained in:
parent
b50d58e46f
commit
0865381881
@ -44,6 +44,7 @@ use pocketmine\command\defaults\SaveOnCommand;
|
||||
use pocketmine\command\defaults\SayCommand;
|
||||
use pocketmine\command\defaults\SeedCommand;
|
||||
use pocketmine\command\defaults\SpawnpointCommand;
|
||||
use pocketmine\command\defaults\StatusCommand;
|
||||
use pocketmine\command\defaults\StopCommand;
|
||||
use pocketmine\command\defaults\TeleportCommand;
|
||||
use pocketmine\command\defaults\TellCommand;
|
||||
@ -96,7 +97,10 @@ class SimpleCommandMap implements CommandMap{
|
||||
$this->register("pocketmine", new KillCommand("kill"));
|
||||
$this->register("pocketmine", new SpawnpointCommand("spawnpoint"));
|
||||
$this->register("pocketmine", new TeleportCommand("tp"));
|
||||
$this->register("pocketmine", new StatusCommand("status"));
|
||||
|
||||
if($this->server->getConfigBoolean("debug.commands", false) === true){
|
||||
$this->register("pocketmine", new StatusCommand("status"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@ namespace pocketmine\command\defaults;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\utils\TextFormat;
|
||||
|
||||
class StatusCommand extends VanillaCommand{
|
||||
|
||||
@ -43,7 +44,9 @@ class StatusCommand extends VanillaCommand{
|
||||
|
||||
$server = Server::getInstance();
|
||||
|
||||
$sender->sendMessage("TPS: ".$server->getTicksPerSecond()." Uploading: " . round($server->getNetwork()->getUploadSpeed() / 1024, 2) . " Downloading: " . round($server->getNetwork()->getDownloadSpeed() / 1024, 2) . " kB/s");
|
||||
$sender->sendMessage(TextFormat::GOLD . "TPS: ".TextFormat::WHITE.$server->getTicksPerSecond());
|
||||
$sender->sendMessage(TextFormat::GOLD . "Upload: ".TextFormat::WHITE . round($server->getNetwork()->getUploadSpeed() / 1024, 2) . " kB/s");
|
||||
$sender->sendMessage(TextFormat::GOLD . "Download: ".TextFormat::WHITE . round($server->getNetwork()->getDownloadSpeed() / 1024, 2) . " kB/s");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user