jkorn2324 / PvPCore

The PvPCore plugin for Pocketmine and Nukkit.
12 stars 10 forks source link

Server error #6

Open ghost opened 3 years ago

ghost commented 3 years ago

Eror code: [12:48:00] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to jkorn\pvpcore\world\PvPCWorld::decode() must be of the type string, int given, called in phar:///opt/pocketmine/plugins/PvPCore.phar/src/jkorn/pvpcore/world/WorldHandler.php on line 87" (EXCEPTION) in "plugins/PvPCore.phar/src/jkorn/pvpcore/world/PvPCWorld" at line 168 [12:48:00] [Server thread/CRITICAL]: #0 plugins/PvPCore.phar/src/jkorn/pvpcore/world/WorldHandler(87): jkorn\pvpcore\world\PvPCWorld::decode(integer -1, array[2]) [12:48:00] [Server thread/CRITICAL]: #1 plugins/PvPCore.phar/src/jkorn/pvpcore/world/WorldHandler(46): jkorn\pvpcore\world\WorldHandler->initWorlds() [12:48:00] [Server thread/CRITICAL]: #2 plugins/PvPCore.phar/src/jkorn/pvpcore/PvPCore(48): jkorn\pvpcore\world\WorldHandler->construct(object jkorn\pvpcore\PvPCore) [12:48:00] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/plugin/PluginBase(116): jkorn\pvpcore\PvPCore->onEnable() [12:48:00] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/plugin/PluginManager(552): pocketmine\plugin\PluginBase->setEnabled(boolean 1) [12:48:00] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/Server(1786): pocketmine\plugin\PluginManager->enablePlugin(object jkorn\pvpcore\PvPCore) [12:48:00] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/Server(1772): pocketmine\Server->enablePlugin(object jkorn\pvpcore\PvPCore) [12:48:00] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/Server(1585): pocketmine\Server->enablePlugins(integer 1) [12:48:00] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/PocketMine(272): pocketmine\Server->construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /opt/pocketmine/, string[24] /opt/pocketmine/plugins/) [12:48:00] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/PocketMine(302): pocketmine\server() [12:48:00] [Server thread/CRITICAL]: #10 pmsrc(11): require(string[71] phar:///opt/pocketmine/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Thank you and this plugin!

TheNewHEROBRINEX commented 3 years ago

I suspect OP had a world named -1 that was saved as an integer and then triggered PHP type checking when passed to a function that only accepted strings. A type cast when encoding/decoding world names should be sufficient.