mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 14:19:53 +00:00
Added detection for recursive server aliases (#424)
* Added detection for recursive server aliases, close #423 * Oops
This commit is contained in:
parent
92193fd27b
commit
d264a04db4
@ -243,20 +243,32 @@ class SimpleCommandMap implements CommandMap{
|
||||
$targets = [];
|
||||
|
||||
$bad = "";
|
||||
$recursive = "";
|
||||
foreach($commandStrings as $commandString){
|
||||
$args = explode(" ", $commandString);
|
||||
$command = $this->getCommand($args[0]);
|
||||
|
||||
|
||||
if($command === null){
|
||||
if(strlen($bad) > 0){
|
||||
$bad .= ", ";
|
||||
}
|
||||
$bad .= $commandString;
|
||||
}elseif($args[0] === $alias){
|
||||
if($recursive !== ""){
|
||||
$recursive .= ", ";
|
||||
}
|
||||
$recursive .= $commandString;
|
||||
}else{
|
||||
$targets[] = $commandString;
|
||||
}
|
||||
}
|
||||
|
||||
if($recursive !== ""){
|
||||
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.recursive", [$alias, $recursive]));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(strlen($bad) > 0){
|
||||
$this->server->getLogger()->warning($this->server->getLanguage()->translateString("pocketmine.command.alias.notFound", [$alias, $bad]));
|
||||
continue;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7ac7004e2dde7d3e424aef2514f1eb8b98192ea9
|
||||
Subproject commit b30ca5e3bdb65c446e22bf777d1dcb04d78b6f7d
|
Loading…
x
Reference in New Issue
Block a user