Plugin crash when delBio option is specified #30

Open
opened 2018-07-16 11:42:20 +00:00 by Ad5001 · 0 comments
Owner

Original issue #46 by fyvekatz created at 2018-06-28T20:57:31Z

createworld survival3 betternormal 0 {"delBio":"BetterDesert"}
[16:49:59] [Server thread/INFO]: [BetterGen] Generating level survival3 with generator betternormal and seed 7261..
[16:49:59] [Server thread/INFO]: Preparing level "survival3"
[16:49:59] [Server thread/ERROR]: Could not generate level "survival3": Undefined index: de
[16:49:59] [Server thread/CRITICAL]: ErrorException: "Undefined index: de" (EXCEPTION) in "BetterGen/src/Ad5001/BetterGen/generator/BetterNormal" at line 417
[16:49:59] [Server thread/DEBUG]: #0 BetterGen/src/Ad5001/BetterGen/generator/BetterNormal(417): pocketmine\error_handler(integer 8, string Undefined index: de, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/BetterGen/src/Ad5001/BetterGen/generator/BetterNormal.php, integer 417, array Array())
[16:49:59] [Server thread/DEBUG]: #1 src/pocketmine/level/Level(391): Ad5001\BetterGen\generator\BetterNormal->__construct(array Array())
[16:49:59] [Server thread/DEBUG]: #2 src/pocketmine/Server(1068): pocketmine\level\Level->initLevel()
[16:49:59] [Server thread/DEBUG]: #3 BetterGen/src/Ad5001/BetterGen/Main(169): pocketmine\Server->generateLevel(string survival3, integer 7261, string Ad5001\BetterGen\generator\BetterNormal, array Array())
[16:49:59] [Server thread/DEBUG]: #4 src/pocketmine/command/PluginCommand(58): Ad5001\BetterGen\Main->onCommand(pocketmine\command\ConsoleCommandSender object, pocketmine\command\PluginCommand object, string createworld, array Array())
[16:49:59] [Server thread/DEBUG]: #5 src/pocketmine/command/SimpleCommandMap(258): pocketmine\command\PluginCommand->execute(pocketmine\command\ConsoleCommandSender object, string createworld, array Array())
[16:49:59] [Server thread/DEBUG]: #6 src/pocketmine/Server(1946): pocketmine\command\SimpleCommandMap->dispatch(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"})
[16:49:59] [Server thread/DEBUG]: #7 src/pocketmine/Server(1931): pocketmine\Server->dispatchCommand(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"})
[16:49:59] [Server thread/DEBUG]: #8 src/pocketmine/Server(2492): pocketmine\Server->checkConsole()
[16:49:59] [Server thread/DEBUG]: #9 src/pocketmine/Server(2243): pocketmine\Server->tick()
[16:49:59] [Server thread/DEBUG]: #10 src/pocketmine/Server(2119): pocketmine\Server->tickProcessor()
[16:49:59] [Server thread/DEBUG]: #11 src/pocketmine/Server(1701): pocketmine\Server->start()
[16:49:59] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(305): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /share/MD0_DATA/.qpkg/Pocketmine/, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/)
[16:49:59] [Server thread/DEBUG]: #13 /share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar(1): require(string phar:///share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar/src/pocketmine/PocketMine.php)

Code from file:

    /**
     * Constructs the class
     *
     * @param array $options
     */
    public function __construct(array $options = []) {
            self::$options["preset"] = $options["preset"];
            $options = (array) json_decode($options["preset"]);
            if(isset($options["delBio"])) {
                    if(is_string($options["de"])) $options["delBio"] = explode(",", $options["delBio"]);
                    if(count($options["delBio"]) !== 0) {
                            self::$options["delBio"] = $options["delBio"];
                    }
            }

If I'm reading this correctly, just some missing characters. I changed that "de" to "delBio" and the level generated correctly.

Original issue [#46](https://github.com/Ad5001/BetterGen/issues/46) by [fyvekatz](https://github.com/fyvekatz) created at 2018-06-28T20:57:31Z createworld survival3 betternormal 0 {"delBio":"BetterDesert"} [16:49:59] [Server thread/INFO]: [BetterGen] Generating level survival3 with generator betternormal and seed 7261.. [16:49:59] [Server thread/INFO]: Preparing level "survival3" [16:49:59] [Server thread/ERROR]: Could not generate level "survival3": Undefined index: de [16:49:59] [Server thread/CRITICAL]: ErrorException: "Undefined index: de" (EXCEPTION) in "BetterGen/src/Ad5001/BetterGen/generator/BetterNormal" at line 417 [16:49:59] [Server thread/DEBUG]: #0 BetterGen/src/Ad5001/BetterGen/generator/BetterNormal(417): pocketmine\error_handler(integer 8, string Undefined index: de, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/BetterGen/src/Ad5001/BetterGen/generator/BetterNormal.php, integer 417, array Array()) [16:49:59] [Server thread/DEBUG]: #1 src/pocketmine/level/Level(391): Ad5001\BetterGen\generator\BetterNormal->__construct(array Array()) [16:49:59] [Server thread/DEBUG]: #2 src/pocketmine/Server(1068): pocketmine\level\Level->initLevel() [16:49:59] [Server thread/DEBUG]: #3 BetterGen/src/Ad5001/BetterGen/Main(169): pocketmine\Server->generateLevel(string survival3, integer 7261, string Ad5001\BetterGen\generator\BetterNormal, array Array()) [16:49:59] [Server thread/DEBUG]: #4 src/pocketmine/command/PluginCommand(58): Ad5001\BetterGen\Main->onCommand(pocketmine\command\ConsoleCommandSender object, pocketmine\command\PluginCommand object, string createworld, array Array()) [16:49:59] [Server thread/DEBUG]: #5 src/pocketmine/command/SimpleCommandMap(258): pocketmine\command\PluginCommand->execute(pocketmine\command\ConsoleCommandSender object, string createworld, array Array()) [16:49:59] [Server thread/DEBUG]: #6 src/pocketmine/Server(1946): pocketmine\command\SimpleCommandMap->dispatch(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"}) [16:49:59] [Server thread/DEBUG]: #7 src/pocketmine/Server(1931): pocketmine\Server->dispatchCommand(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"}) [16:49:59] [Server thread/DEBUG]: #8 src/pocketmine/Server(2492): pocketmine\Server->checkConsole() [16:49:59] [Server thread/DEBUG]: #9 src/pocketmine/Server(2243): pocketmine\Server->tick() [16:49:59] [Server thread/DEBUG]: #10 src/pocketmine/Server(2119): pocketmine\Server->tickProcessor() [16:49:59] [Server thread/DEBUG]: #11 src/pocketmine/Server(1701): pocketmine\Server->start() [16:49:59] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(305): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /share/MD0_DATA/.qpkg/Pocketmine/, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/) [16:49:59] [Server thread/DEBUG]: #13 /share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar(1): require(string phar:///share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar/src/pocketmine/PocketMine.php) Code from file: /** * Constructs the class * * @param array $options */ public function __construct(array $options = []) { self::$options["preset"] = $options["preset"]; $options = (array) json_decode($options["preset"]); if(isset($options["delBio"])) { if(is_string($options["de"])) $options["delBio"] = explode(",", $options["delBio"]); if(count($options["delBio"]) !== 0) { self::$options["delBio"] = $options["delBio"]; } } If I'm reading this correctly, just some missing characters. I changed that "de" to "delBio" and the level generated correctly.
Ad5001 self-assigned this 2018-07-16 11:42:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Ad5001/BetterGen#30
No description provided.