Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Undefined index: creativeWorlds" #5

Closed
adamprato opened this issue Sep 16, 2017 · 6 comments
Closed

"Undefined index: creativeWorlds" #5

adamprato opened this issue Sep 16, 2017 · 6 comments

Comments

@adamprato
Copy link

  • Issue Description: gamemodeWorlds is an empty array in config.yml, but configManager.php tries to access array indexes that don't exist.

perhaps checks for each of these indexes are in order:
$config = $this->plugin->getConfig();
$gmWorlds = $config->get("gamemodeWorlds");
if(is_array($gmWorlds)) {
$this->configData["creativeWorlds"] = $gmWorlds["creativeWorlds"];
$this->configData["survivalWorlds"] = $gmWorlds["survivalWorlds"];
$this->configData["adventureWorlds"] = $gmWorlds["adventureWorlds"];
$this->configData["spectatorWorlds"] = $gmWorlds["spectatorWorlds"];
}

line38

  • Version: [02:53:41] [Server thread/INFO]: Plugins (2): MultiWorld v1.3.2 [BETA], EssentialsPE v2.0.0
  • Server Version: [02:5 implementing API version 3.0.0-ALPHA7 for Minecraft: PE v1.1.0.55 (protocol version 113)

(that's not a typo, somehow the timestamp is being cut off)

  • Crashdump, backtrace or other files:

[02:49:35] [Server thread/INFO]: Enabling MultiWorld v1.3.2 [BETA]
[02:49:35] [Server thread/CRITICAL]: ErrorException: "Undefined index: creativeWorlds" (EXCEPTION) in "MultiWorld.phar/src/MultiWorld/Util/ConfigManager" at line 38
[02:49:35] [Server thread/DEBUG]: #0 MultiWorld.phar/src/MultiWorld/Util/ConfigManager(38): pocketmine{closure}(integer 8, string Undefined index: creativeWorlds, string phar:///u/mcsrv/pe/pmmp/plugins/MultiWorld.phar/src/MultiWorld/Util/ConfigManager.php, integer 38, array Array())
[02:49:35] [Server thread/DEBUG]: #1 MultiWorld.phar/src/MultiWorld/Util/ConfigManager(30): MultiWorld\Util\ConfigManager->loadData()
[02:49:35] [Server thread/DEBUG]: #2 MultiWorld.phar/src/MultiWorld/MultiWorld(48): MultiWorld\Util\ConfigManager->__construct(MultiWorld\MultiWorld object)
[02:49:35] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginBase(90): MultiWorld\MultiWorld->onEnable()
[02:49:35] [Server thread/DEBUG]: #4 src/pocketmine/plugin/PharPluginLoader(122): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
[02:49:35] [Server thread/DEBUG]: #5 src/pocketmine/plugin/PluginManager(603): pocketmine\plugin\PharPluginLoader->enablePlugin(MultiWorld\MultiWorld object)
[02:49:35] [Server thread/DEBUG]: #6 src/pocketmine/Server(1926): pocketmine\plugin\PluginManager->enablePlugin(MultiWorld\MultiWorld object)
[02:49:35] [Server thread/DEBUG]: #7 src/pocketmine/Server(1912): pocketmine\Server->enablePlugin(MultiWorld\MultiWorld object)
[02:49:35] [Server thread/DEBUG]: #8 src/pocketmine/Server(1698): pocketmine\Server->enablePlugins(integer 1)
[02:49:35] [Server thread/DEBUG]: #9 src/pocketmine/PocketMine(541): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string phar:///u/mcsrv/pe/pmmp/PocketMine-MP.phar/, string /u/mcsrv/pe/pmmp/, string /u/mcsrv/pe/pmmp/plugins/)
[02:49:35] [Server thread/DEBUG]: #10 /u/mcsrv/pe/pmmp/PocketMine-MP.phar(1): require(string phar:///u/mcsrv/pe/pmmp/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
[02:49:35] [Server thread/INFO]: Disabling MultiWorld v1.3.2 [BETA]
[02:49:35] [Server thread/INFO]: [MultiWorld] MultiWorld is disabled!

@adamprato
Copy link
Author

Also, typo here ('Cloud' should be 'Could' I think):
$this->plugin->getLogger()->critical("Cloud not load GameMode world data (Data is not saved in array)");

@adamprato
Copy link
Author

Also:

Line 59 of MultiWorld.php:
if(strval($this->getConfig()->get("plugin-version")) != "1.3.0") {

Line 3 of config.yml:
plugin-version: '1.3.2'

The version check fails and prevents the plugin from loading. I added 'array_key_exists() around the gamemodeWorlds access, changed the version in config.yml, and now the plugin loads.

@GamakCZ
Copy link
Member

GamakCZ commented Sep 16, 2017

If you want to use MultiWorld plugin, download phar from releases (https://github.com/CzechPMDevs/MultiWorld/releases/tag/1.3.1).

@adamprato
Copy link
Author

I couldn't use the .phar which is why edited and built the phar by hand.

@ghost
Copy link

ghost commented Oct 5, 2017

If plugin don't work for your, check pocketmine version or there can be problem while compiling

@GamakCZ
Copy link
Member

GamakCZ commented Oct 7, 2017

fixed (874d89b)

@supercrafti-lab supercrafti-lab mentioned this issue Jan 29, 2020
This was referenced Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants