Skip to content

Commit

Permalink
Increased transaction timeout, not needed anymore due to packet ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Dec 22, 2014
1 parent 2f60073 commit a677bcb
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ public function handleDataPacket(DataPacket $packet){
}


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){
Expand All @@ -2197,19 +2197,16 @@ public function handleDataPacket(DataPacket $packet){
$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;
}
}
}
}
Expand Down

0 comments on commit a677bcb

Please sign in to comment.