mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Merge branch '3.6'
This commit is contained in:
commit
470879c9bf
@ -179,7 +179,6 @@ namespace pocketmine {
|
|||||||
ini_set("default_charset", "utf-8");
|
ini_set("default_charset", "utf-8");
|
||||||
|
|
||||||
ini_set("memory_limit", '-1');
|
ini_set("memory_limit", '-1');
|
||||||
define('pocketmine\START_TIME', microtime(true));
|
|
||||||
|
|
||||||
define('pocketmine\RESOURCE_PATH', \pocketmine\PATH . 'resources' . DIRECTORY_SEPARATOR);
|
define('pocketmine\RESOURCE_PATH', \pocketmine\PATH . 'resources' . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
@ -251,6 +250,8 @@ namespace pocketmine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: move this to a Server field
|
||||||
|
define('pocketmine\START_TIME', microtime(true));
|
||||||
ThreadManager::init();
|
ThreadManager::init();
|
||||||
new Server($autoloader, $logger, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
new Server($autoloader, $logger, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
||||||
|
|
||||||
|
@ -53,6 +53,9 @@ class DeopCommand extends VanillaCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$name = array_shift($args);
|
$name = array_shift($args);
|
||||||
|
if(!Player::isValidUserName($name)){
|
||||||
|
throw new InvalidCommandSyntaxException();
|
||||||
|
}
|
||||||
|
|
||||||
$player = $sender->getServer()->getOfflinePlayer($name);
|
$player = $sender->getServer()->getOfflinePlayer($name);
|
||||||
$player->setOp(false);
|
$player->setOp(false);
|
||||||
|
@ -83,7 +83,7 @@ class EffectCommand extends VanillaCommand{
|
|||||||
$amplification = 0;
|
$amplification = 0;
|
||||||
|
|
||||||
if(count($args) >= 3){
|
if(count($args) >= 3){
|
||||||
if(($d = $this->getBoundedInt($sender, $args[2], 0, INT32_MAX)) === null){
|
if(($d = $this->getBoundedInt($sender, $args[2], 0, (int) (INT32_MAX / 20))) === null){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$duration = $d * 20; //ticks
|
$duration = $d * 20; //ticks
|
||||||
|
@ -53,6 +53,9 @@ class OpCommand extends VanillaCommand{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$name = array_shift($args);
|
$name = array_shift($args);
|
||||||
|
if(!Player::isValidUserName($name)){
|
||||||
|
throw new InvalidCommandSyntaxException();
|
||||||
|
}
|
||||||
|
|
||||||
$player = $sender->getServer()->getOfflinePlayer($name);
|
$player = $sender->getServer()->getOfflinePlayer($name);
|
||||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$player->getName()]));
|
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$player->getName()]));
|
||||||
|
@ -27,6 +27,7 @@ use pocketmine\command\Command;
|
|||||||
use pocketmine\command\CommandSender;
|
use pocketmine\command\CommandSender;
|
||||||
use pocketmine\command\utils\InvalidCommandSyntaxException;
|
use pocketmine\command\utils\InvalidCommandSyntaxException;
|
||||||
use pocketmine\lang\TranslationContainer;
|
use pocketmine\lang\TranslationContainer;
|
||||||
|
use pocketmine\Player;
|
||||||
use pocketmine\utils\TextFormat;
|
use pocketmine\utils\TextFormat;
|
||||||
use function count;
|
use function count;
|
||||||
use function implode;
|
use function implode;
|
||||||
@ -94,6 +95,9 @@ class WhitelistCommand extends VanillaCommand{
|
|||||||
if($this->badPerm($sender, strtolower($args[0]))){
|
if($this->badPerm($sender, strtolower($args[0]))){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(!Player::isValidUserName($args[1])){
|
||||||
|
throw new InvalidCommandSyntaxException();
|
||||||
|
}
|
||||||
switch(strtolower($args[0])){
|
switch(strtolower($args[0])){
|
||||||
case "add":
|
case "add":
|
||||||
$sender->getServer()->getOfflinePlayer($args[1])->setWhitelisted(true);
|
$sender->getServer()->getOfflinePlayer($args[1])->setWhitelisted(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user