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

CraftingGrid: Index invalid or out of range BaseInventory #2250

Closed
zKoz210 opened this issue Jun 19, 2018 · 2 comments
Closed

CraftingGrid: Index invalid or out of range BaseInventory #2250

zKoz210 opened this issue Jun 19, 2018 · 2 comments
Assignees
Labels
Category: Core Related to internal functionality Resolution: Fixed

Comments

@zKoz210
Copy link
Contributor

zKoz210 commented Jun 19, 2018

Issue description

The error occurs because of that PlayerInteractEvent blocks all actions, but the client still opens the workbench, even if we have block it on the server.

Lines: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Level.php#L1782-L1792

Steps to reproduce the issue

  1. Join to server
  2. Place crafting table
  3. Make simple plugin with one event:
public function onPlayerInteractEvent(PlayerInteractEvent $event) {
	$event->setCancelled();
}
  1. Join and try craft some items in crafting table

OS and versions

  • PocketMine-MP: 0351033
  • Game version: PE/Win10

Crashdump, backtrace or other files

[13:47:44] [Server thread/CRITICAL]: RuntimeException: "Index invalid or out of range" (EXCEPTION) in "src/pocketmine/inventory/BaseInventory" at line 94
[13:47:44] [Server thread/DEBUG]: #0 src/pocketmine/inventory/transaction/InventoryTransaction(176): pocketmine\inventory\BaseInventory->getItem(integer 7)
[13:47:44] [Server thread/DEBUG]: #1 src/pocketmine/inventory/transaction/InventoryTransaction(226): pocketmine\inventory\transaction\InventoryTransaction->squashDuplicateSlotChanges()
[13:47:44] [Server thread/DEBUG]: #2 src/pocketmine/inventory/transaction/InventoryTransaction(266): pocketmine\inventory\transaction\InventoryTransaction->validate()
[13:47:44] [Server thread/DEBUG]: #3 src/pocketmine/Player(2338): pocketmine\inventory\transaction\InventoryTransaction->execute()
[13:47:44] [Server thread/DEBUG]: #4 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(132): pocketmine\Player->handleInventoryTransaction(pocketmine\network\mcpe\protocol\InventoryTransactionPacket object)
[13:47:44] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/protocol/InventoryTransactionPacket(155): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleInventoryTransaction(pocketmine\network\mcpe\protocol\InventoryTransactionPacket object)
[13:47:44] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\InventoryTransactionPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
[13:47:44] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/protocol/BatchPacket(118): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\InventoryTransactionPacket object)
[13:47:44] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
[13:47:44] [Server thread/DEBUG]: #9 src/pocketmine/Player(3038): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
[13:47:44] [Server thread/DEBUG]: #10 src/pocketmine/network/mcpe/RakLibInterface(158): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
[13:47:44] [Server thread/DEBUG]: #11 vendor/pocketmine/raklib/src/server/ServerHandler(98): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 164.132.111.150 7036, raklib\protocol\EncapsulatedPacket object, integer 0)
[13:47:44] [Server thread/DEBUG]: #12 src/pocketmine/network/mcpe/RakLibInterface(103): raklib\server\ServerHandler->handlePacket()
[13:47:44] [Server thread/DEBUG]: #13 src/pocketmine/network/Network(94): pocketmine\network\mcpe\RakLibInterface->process()
[13:47:44] [Server thread/DEBUG]: #14 src/pocketmine/network/mcpe/RakLibInterface(80): pocketmine\network\Network->processInterface(pocketmine\network\mcpe\RakLibInterface object)
[13:47:44] [Server thread/DEBUG]: #15 vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
[13:47:44] [Server thread/DEBUG]: #16 vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\snooze\SleeperHandler->processNotifications()
[13:47:44] [Server thread/DEBUG]: #17 src/pocketmine/Server(2272): pocketmine\snooze\SleeperHandler->sleepUntil(double 1529146064.6362)
[13:47:44] [Server thread/DEBUG]: #18 src/pocketmine/Server(2143): pocketmine\Server->tickProcessor()
[13:47:44] [Server thread/DEBUG]: #19 src/pocketmine/Server(1716): pocketmine\Server->start()
[13:47:44] [Server thread/DEBUG]: #20 src/pocketmine/PocketMine(242): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/survival1/, string /home/survival1/plugins/)
[13:47:44] [RakLibServer thread/NOTICE]: Blocked 164.132.111.150 for 5 seconds
@dktapps
Copy link
Member

dktapps commented Jun 19, 2018

oh, I forgot about this bug... I thought I'd fixed it already.

@dktapps dktapps added Category: Core Related to internal functionality Status: Debugged Cause of the bug has been found, but not fixed labels Jun 19, 2018
@dktapps dktapps self-assigned this Jun 19, 2018
@dktapps
Copy link
Member

dktapps commented Jun 19, 2018

Bear in mind that there's nothing I can do about the large grid opening when this event is cancelled. I can only prevent the transaction raising exceptions.

@dktapps dktapps added Resolution: Fixed and removed Status: Debugged Cause of the bug has been found, but not fixed labels Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Resolution: Fixed
Projects
None yet
Development

No branches or pull requests

2 participants