Yui2001 / SHotPotato

a game plugin for PocketMine
6 stars 0 forks source link

crash #2

Open ghost opened 4 years ago

ghost commented 4 years ago

a player exit the game via the door while in the lobby and when the game started the server crashed

EDIT: also if you set the leave pos in a diffrent world it doesn't teleport you to the world you set, only the positions

Error: Undefined index: lu109

File: plugins/SHotPotato-master/src/net/mcpes/summit/yui/gameManager/RoomsData
Line: 135
Type: ErrorException

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: SHotPotato v1.1.6

Code:
[126]     }
[127] 
[128]     public function getPotatoPlayer():Player
[129]     {
[130]         return $this->getRoom()["potato"];
[131]     }
[132] 
[133]     public function getPlayerManager(string $playerName):PlayerManager
[134]     {
[135]         return $this->getPlayers()[$playerName];
[136]     }
[137] 
[138]     public function getPlayersCount():int
[139]     {
[140]         return count($this->getPlayers());
[141]     }
[142] 
[143]     public function getAlivePlayersCount():int
[144]     {
[145]         return count($this->getAlivePlayers());

Backtrace:
#0 plugins/SHotPotato-master/src/net/mcpes/summit/yui/gameManager/RoomsData(135): pocketmine\utils\Utils::errorExceptionHandler(integer 8, string[22] Undefined index: lu109, string[123] /home/minecraft/multicraft/servers/server22957/plugins/SHotPotato-master/src/net, integer 135, array[1])
#1 plugins/SHotPotato-master/src/net/mcpes/summit/yui/gameFunction/GameState(133): net\mcpes\summit\yui\gameManager\RoomsData->getPlayerManager(string[5] lu109)
#2 plugins/SHotPotato-master/src/net/mcpes/summit/yui/listen/PlayerListen(123): net\mcpes\summit\yui\gameFunction\GameState->onQuit(string[5] lu109)
#3 src/pocketmine/plugin/MethodEventExecutor(42): net\mcpes\summit\yui\listen\PlayerListen->onQuit(object pocketmine\event\player\PlayerQuitEvent)
#4 src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object net\mcpes\summit\yui\listen\PlayerListen, object pocketmine\event\player\PlayerQuitEvent)
#5 src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\player\PlayerQuitEvent)
#6 src/pocketmine/Player(3477): pocketmine\event\Event->call()
#7 src/pocketmine/network/mcpe/RakLibInterface(176): pocketmine\Player->close(object pocketmine\lang\TranslationContainer, string[21] Internal server error)
#8 vendor/pocketmine/raklib/src/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string[20] 178.87.227.126 63909, object raklib\protocol\EncapsulatedPacket, integer 0)
#9 src/pocketmine/network/mcpe/RakLibInterface(109): raklib\server\ServerHandler->handlePacket()
#10 src/pocketmine/network/mcpe/RakLibInterface(99): pocketmine\network\mcpe\RakLibInterface->process()
#11 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
#12 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
#13 src/pocketmine/Server(2146): pocketmine\snooze\SleeperHandler->sleepUntil(double 1587544477.2065)
#14 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
#15 src/pocketmine/Server(1584): pocketmine\Server->start()
#16 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[47] /home/minecraft/multicraft/servers/server22957/, string[55] /home/minecraft/multicraft/servers/server22957/plugins/)
#17 src/pocketmine/PocketMine(296): pocketmine\server()
#18 (11): require(string[113] phar:///home/minecraft/multicraft/jar/versions/PocketMine/PocketMine-MP-3.12.0.p)

PocketMine-MP version: 3.12.0 [Protocol 390]```
Yui2001 commented 4 years ago

okey,do you test this plugin in gaming completely?I just tested joining and quiting the game.If you already have tested complete game process,so any other problems?

ghost commented 4 years ago

yeah alot lol, array_search nesting too deep, spell particle doesn't exist, level/sound/ExplodeSound doesn't exist, pocketmine/entity/lightning doesn't exist

ghost commented 4 years ago

other than those issues in this topic there are no issues

ghost commented 4 years ago

but please make a patch for the undefined index error, like a double check or something

Yui2001 commented 4 years ago

yeah,I just fix known errors,except....this crash problem.Hmm.. I think it maybe a logic error.I've never had this problem.Please give me a detailed situation when this crash happening..,well,what were you have done before that? you can download the lazypackage,and try again.Please let me know if you have any other problems about this plugin.and could you give me a start if you like this game plugin,haha

ghost commented 4 years ago

confirmed, it works fine when the game is still in the lobby phase, but crashes when the game has already started

Yui2001 commented 4 years ago

install the new version,try again please,I have just played with my firend at noon.It worked fine,but...,except before starting,if you touch others.

ghost commented 4 years ago

the same issue is still there, if you touch the door when the game is running the server crashes with "undefined index: steve"

also i just tried your package in readme.md and when the game started i got this error

UnexpectedValueException: "Invalid pocketmine\entity\object\ItemEntity entity: expected "Item" NBT tag not found" (EXCEPTION) in "src/pocketmine/entity/object/ItemEntity" at line 72
[09:52:13] [Server thread/DEBUG]: #0 src/pocketmine/entity/Entity(630): pocketmine\entity\object\ItemEntity->initEntity()
[09:52:13] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(373): pocketmine\entity\Entity->__construct(object pocketmine\level\Level, object pocketmine\nbt\tag\CompoundTag)
ne\level\Level, object pocketmine\nbt\tag\CompoundTag)
[09:52:13] [Server thread/DEBUG]: #3 src/pocketmine/level/Level(2682): pocketmine\level\format\Chunk->initChunk(object pocketmine\level\Level)
[09:52:13] [Server thread/DEBUG]: #4 src/pocketmine/level/Level(2294): pocketmine\level\Level->loadChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #5 src/pocketmine/level/Level(2949): pocketmine\level\Level->getChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #6 src/pocketmine/Player(1014): pocketmine\level\Level->populateChunk(integer 6, integer 12)
[09:52:13] [Server thread/DEBUG]: #7 src/pocketmine/Player(1783): pocketmine\Player->sendNextChunk()
[09:52:13] [Server thread/DEBUG]: #8 src/pocketmine/Server(2390): pocketmine\Player->checkNetwork()
[09:52:13] [Server thread/DEBUG]: #9 src/pocketmine/Server(2143): pocketmine\Server->tick()
[09:52:13] [Server thread/DEBUG]: #10 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
[09:52:13] [Server thread/DEBUG]: #11 src/pocketmine/Server(1584): pocketmine\Server->start()
[09:52:13] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[34] /storage/emulated/0/PocketMine-MP/, string[42] /storage/emulated/0/PocketMine-MP/plugins/)
[09:52:13] [Server thread/DEBUG]: #13 src/pocketmine/PocketMine(296): pocketmine\server()
[09:52:13] [Server thread/DEBUG]: #14 (11): require(string[89] phar:///storage/emulated/0/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/Pocke)

it didn't happen before because i didn't set the tool items

ghost commented 4 years ago

and please make the plugin load the rooms worlds on enable, im tired of having to load the world manually

Yui2001 commented 4 years ago

the same issue is still there, if you touch the door when the game is running the server crashes with "undefined index: steve"

also i just tried your package in readme.md and when the game started i got this error

UnexpectedValueException: "Invalid pocketmine\entity\object\ItemEntity entity: expected "Item" NBT tag not found" (EXCEPTION) in "src/pocketmine/entity/object/ItemEntity" at line 72
[09:52:13] [Server thread/DEBUG]: #0 src/pocketmine/entity/Entity(630): pocketmine\entity\object\ItemEntity->initEntity()
[09:52:13] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(373): pocketmine\entity\Entity->__construct(object pocketmine\level\Level, object pocketmine\nbt\tag\CompoundTag)
ne\level\Level, object pocketmine\nbt\tag\CompoundTag)
[09:52:13] [Server thread/DEBUG]: #3 src/pocketmine/level/Level(2682): pocketmine\level\format\Chunk->initChunk(object pocketmine\level\Level)
[09:52:13] [Server thread/DEBUG]: #4 src/pocketmine/level/Level(2294): pocketmine\level\Level->loadChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #5 src/pocketmine/level/Level(2949): pocketmine\level\Level->getChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #6 src/pocketmine/Player(1014): pocketmine\level\Level->populateChunk(integer 6, integer 12)
[09:52:13] [Server thread/DEBUG]: #7 src/pocketmine/Player(1783): pocketmine\Player->sendNextChunk()
[09:52:13] [Server thread/DEBUG]: #8 src/pocketmine/Server(2390): pocketmine\Player->checkNetwork()
[09:52:13] [Server thread/DEBUG]: #9 src/pocketmine/Server(2143): pocketmine\Server->tick()
[09:52:13] [Server thread/DEBUG]: #10 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
[09:52:13] [Server thread/DEBUG]: #11 src/pocketmine/Server(1584): pocketmine\Server->start()
[09:52:13] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[34] /storage/emulated/0/PocketMine-MP/, string[42] /storage/emulated/0/PocketMine-MP/plugins/)
[09:52:13] [Server thread/DEBUG]: #13 src/pocketmine/PocketMine(296): pocketmine\server()
[09:52:13] [Server thread/DEBUG]: #14 (11): require(string[89] phar:///storage/emulated/0/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/Pocke)

it didn't happen before because i didn't set the tool items

I have solved this problem,but the error of "UnexpectedValueException" I never meet,I think it maybe the world's data problem.

and please make the plugin load the rooms worlds on enable, im tired of having to load the world manually

hmm...but this function already exists.when the plugin loading,it will check if the gaming world loaded or not,and if not, it will load it.

ghost commented 4 years ago

no it doesn't load it, when i start the server and click the sign i already made it throws an error saying it tried to getPlayers() on null

Yui2001 commented 4 years ago

no it doesn't load it, when i start the server and click the sign i already made it throws an error saying it tried to getPlayers() on null

oh,sorry,I forgot deleting an error code

ghost commented 4 years ago

i just tested it again, "UnexpectedValueException" is not because of the level, i tried it on a new level and it still happened.

and the world load on startup is still not working

ghost commented 4 years ago

it appears that it only loads the world the which has the game sign, not the game world itself.

Yui2001 commented 4 years ago

please give me the error information again.

---Original--- From: "mote166"<notifications@github.com> Date: 2020/4/26 18:43:02 To: "Yui2001/SHotPotato"<SHotPotato@noreply.github.com>; Cc: "Comment"<comment@noreply.github.com>;"Yui233"<2363935539@qq.com>; Subject: Re: [Yui2001/SHotPotato] crash (#2)

it appears that it only loads the world the which has the game sign, not the game world itself.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost commented 4 years ago

when you add the tools and setup the game correctly and start the game, when the items are supposed to drop into the places you set, they don't and the error

UnexpectedValueException: "Invalid pocketmine\entity\object\ItemEntity entity: expected "Item" NBT tag not found" (EXCEPTION) in "src/pocketmine/entity/object/ItemEntity" at line 72
[09:52:13] [Server thread/DEBUG]: #0 src/pocketmine/entity/Entity(630): pocketmine\entity\object\ItemEntity->initEntity()
[09:52:13] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(373): pocketmine\entity\Entity->__construct(object pocketmine\level\Level, object pocketmine\nbt\tag\CompoundTag)
ne\level\Level, object pocketmine\nbt\tag\CompoundTag)
[09:52:13] [Server thread/DEBUG]: #3 src/pocketmine/level/Level(2682): pocketmine\level\format\Chunk->initChunk(object pocketmine\level\Level)
[09:52:13] [Server thread/DEBUG]: #4 src/pocketmine/level/Level(2294): pocketmine\level\Level->loadChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #5 src/pocketmine/level/Level(2949): pocketmine\level\Level->getChunk(integer 6, integer 12, boolean 1)
[09:52:13] [Server thread/DEBUG]: #6 src/pocketmine/Player(1014): pocketmine\level\Level->populateChunk(integer 6, integer 12)
[09:52:13] [Server thread/DEBUG]: #7 src/pocketmine/Player(1783): pocketmine\Player->sendNextChunk()
[09:52:13] [Server thread/DEBUG]: #8 src/pocketmine/Server(2390): pocketmine\Player->checkNetwork()
[09:52:13] [Server thread/DEBUG]: #9 src/pocketmine/Server(2143): pocketmine\Server->tick()
[09:52:13] [Server thread/DEBUG]: #10 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
[09:52:13] [Server thread/DEBUG]: #11 src/pocketmine/Server(1584): pocketmine\Server->start()
[09:52:13] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[34] /storage/emulated/0/PocketMine-MP/, string[42] /storage/emulated/0/PocketMine-MP/plugins/)
[09:52:13] [Server thread/DEBUG]: #13 src/pocketmine/PocketMine(296): pocketmine\server()
[09:52:13] [Server thread/DEBUG]: #14 (11): require(string[89] phar:///storage/emulated/0/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/Pocke)

shows up, and what you said about the plugin loads the game worlds, it only loads the join sign world, like it checks where the join sign is and loads its world, but that is not good since i have a minigames server and i put the join signs in the main world, so in this case it will only load the world which is already loaded, not the game world

ghost commented 4 years ago

can you fix the issue where when you set the leave pos in a diffrent world it only teleports you to the x y z and not the world ?