Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2019-08-16 16:49:24 +01:00
commit 9321eef683
2 changed files with 14 additions and 22 deletions

2
.github/support.yml vendored
View File

@ -5,7 +5,7 @@ supportLabel: "Support request"
# Comment to post on issues marked as support requests. Add a link # Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable # to a support page, or set to `false` to disable
supportComment: > supportComment: >
Thanks, but this issue tracker not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue). Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io) [Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io)

View File

@ -305,7 +305,7 @@ class PluginManager{
while(count($plugins) > 0){ while(count($plugins) > 0){
$missingDependency = true; $loadedThisLoop = 0;
foreach($plugins as $name => $file){ foreach($plugins as $name => $file){
if(isset($dependencies[$name])){ if(isset($dependencies[$name])){
foreach($dependencies[$name] as $key => $dependency){ foreach($dependencies[$name] as $key => $dependency){
@ -329,7 +329,14 @@ class PluginManager{
if(isset($softDependencies[$name])){ if(isset($softDependencies[$name])){
foreach($softDependencies[$name] as $key => $dependency){ foreach($softDependencies[$name] as $key => $dependency){
if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){ if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){
$this->server->getLogger()->debug("Successfully resolved soft dependency \"$dependency\" for plugin \"$name\"");
unset($softDependencies[$name][$key]); unset($softDependencies[$name][$key]);
}elseif(!isset($plugins[$dependency])){
//this dependency is never going to be resolved, so don't bother trying
$this->server->getLogger()->debug("Skipping resolution of missing soft dependency \"$dependency\" for plugin \"$name\"");
unset($softDependencies[$name][$key]);
}else{
$this->server->getLogger()->debug("Deferring resolution of soft dependency \"$dependency\" for plugin \"$name\" (found but not loaded yet)");
} }
} }
@ -340,7 +347,7 @@ class PluginManager{
if(!isset($dependencies[$name]) and !isset($softDependencies[$name])){ if(!isset($dependencies[$name]) and !isset($softDependencies[$name])){
unset($plugins[$name]); unset($plugins[$name]);
$missingDependency = false; $loadedThisLoop++;
if($plugin = $this->loadPlugin($file, $loaders) and $plugin instanceof Plugin){ if($plugin = $this->loadPlugin($file, $loaders) and $plugin instanceof Plugin){
$loadedPlugins[$name] = $plugin; $loadedPlugins[$name] = $plugin;
}else{ }else{
@ -349,27 +356,12 @@ class PluginManager{
} }
} }
if($missingDependency){ if($loadedThisLoop === 0){
foreach($plugins as $name => $file){
if(!isset($dependencies[$name])){
unset($softDependencies[$name]);
unset($plugins[$name]);
$missingDependency = false;
if($plugin = $this->loadPlugin($file, $loaders) and $plugin instanceof Plugin){
$loadedPlugins[$name] = $plugin;
}else{
$this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.plugin.genericLoadError", [$name]));
}
}
}
//No plugins loaded :( //No plugins loaded :(
if($missingDependency){ foreach($plugins as $name => $file){
foreach($plugins as $name => $file){ $this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [$name, "%pocketmine.plugin.circularDependency"]));
$this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.plugin.loadError", [$name, "%pocketmine.plugin.circularDependency"]));
}
$plugins = [];
} }
$plugins = [];
} }
} }