diff --git a/src/pocketmine/command/defaults/DumpMemoryCommand.php b/src/pocketmine/command/defaults/DumpMemoryCommand.php index df20d101e..ecc380b9e 100644 --- a/src/pocketmine/command/defaults/DumpMemoryCommand.php +++ b/src/pocketmine/command/defaults/DumpMemoryCommand.php @@ -27,13 +27,11 @@ use pocketmine\command\CommandSender; class DumpMemoryCommand extends VanillaCommand{ - private static $executions = 0; - public function __construct(string $name){ parent::__construct( $name, "Dumps the memory", - "/$name [path]" + "/$name [path]" ); $this->setPermission("pocketmine.command.dumpmemory"); } @@ -43,16 +41,7 @@ class DumpMemoryCommand extends VanillaCommand{ return true; } - $token = strtoupper(substr(sha1(BOOTUP_RANDOM . ":" . $sender->getServer()->getServerUniqueId() . ":" . self::$executions), 6, 6)); - - if(count($args) < 1 or strtoupper($args[0]) !== $token){ - $sender->sendMessage("Usage: /" . $this->getName() . " " . $token); - return true; - } - - ++self::$executions; - - $sender->getServer()->getMemoryManager()->dumpServerMemory($args[1] ?? ($sender->getServer()->getDataPath() . "/memory_dumps/$token"), 48, 80); + $sender->getServer()->getMemoryManager()->dumpServerMemory($args[0] ?? ($sender->getServer()->getDataPath() . "/memory_dumps/" . date("D_M_j-H.i.s-T_Y")), 48, 80); return true; } }