From a677bcb3313adc7f63a9c7f77ff791850500fd3e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 22 Dec 2014 23:38:47 +0100 Subject: [PATCH] Increased transaction timeout, not needed anymore due to packet ordering --- src/pocketmine/Player.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 8c69a4055..5e2b7967c 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2182,7 +2182,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ } - if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 0.5)){ + if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 8)){ if($this->currentTransaction instanceof SimpleTransactionGroup){ foreach($this->currentTransaction->getInventories() as $inventory){ if($inventory instanceof PlayerInventory){ @@ -2197,19 +2197,16 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->currentTransaction->addTransaction($transaction); if($this->currentTransaction->canExecute()){ - if(!$this->currentTransaction->execute()){ - $this->currentTransaction = null; - break; - } - - foreach($this->currentTransaction->getTransactions() as $ts){ - $inv = $ts->getInventory(); - if($inv instanceof FurnaceInventory){ - if($ts->getSlot() === 2){ - switch($inv->getResult()->getId()){ - case Item::IRON_INGOT: - $this->awardAchievement("acquireIron"); - break; + if($this->currentTransaction->execute()){ + foreach($this->currentTransaction->getTransactions() as $ts){ + $inv = $ts->getInventory(); + if($inv instanceof FurnaceInventory){ + if($ts->getSlot() === 2){ + switch($inv->getResult()->getId()){ + case Item::IRON_INGOT: + $this->awardAchievement("acquireIron"); + break; + } } } }