From 1193efd69ee85687bda513b545648e74aeebcd70 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 31 Aug 2018 18:58:53 +0100 Subject: [PATCH 1/8] Release 3.2.1 --- src/pocketmine/PocketMine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index a1192ddd3..692dfc841 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -38,7 +38,7 @@ namespace pocketmine { const NAME = "PocketMine-MP"; const BASE_VERSION = "3.2.1"; - const IS_DEVELOPMENT_BUILD = true; + const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0"; From 56ee957fdae948299368ef903b026ad12e29a5b5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 31 Aug 2018 19:03:58 +0100 Subject: [PATCH 2/8] 3.2.2 is next --- src/pocketmine/PocketMine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 692dfc841..f4e10c9f3 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -37,8 +37,8 @@ namespace pocketmine { use pocketmine\wizard\SetupWizard; const NAME = "PocketMine-MP"; - const BASE_VERSION = "3.2.1"; - const IS_DEVELOPMENT_BUILD = false; + const BASE_VERSION = "3.2.2"; + const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0"; From e621cde8f159538e0756ee7d3ffc5d01e5a4b34f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 1 Sep 2018 15:25:46 +0100 Subject: [PATCH 3/8] Player: Tighten validity checks for addWindow() (#2419) - Don't allow the same window ID to be used when another window is already using it - Detect window ID collisions when selecting IDs for regular containers (should never happen, but anything is possible) --- src/pocketmine/Player.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 7a4c5925d..6e43936f3 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3801,6 +3801,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ * @param bool $isPermanent Prevents the window being removed if true. * * @return int + * + * @throws \InvalidArgumentException if a forceID which is already in use is specified + * @throws \InvalidStateException if trying to add a window without forceID when no slots are free */ public function addWindow(Inventory $inventory, int $forceId = null, bool $isPermanent = false) : int{ if(($id = $this->getWindowId($inventory)) !== ContainerIds::NONE){ @@ -3808,10 +3811,21 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ } if($forceId === null){ - $this->windowCnt = $cnt = max(ContainerIds::FIRST, ++$this->windowCnt % ContainerIds::LAST); + $cnt = $this->windowCnt; + do{ + $cnt = max(ContainerIds::FIRST, ($cnt + 1) % ContainerIds::LAST); + if($cnt === $this->windowCnt){ //wraparound, no free slots + throw new \InvalidStateException("No free window IDs found"); + } + }while(isset($this->windowIndex[$cnt])); + $this->windowCnt = $cnt; }else{ $cnt = $forceId; + if(isset($this->windowIndex[$cnt])){ + throw new \InvalidArgumentException("Requested force ID $forceId already in use"); + } } + $this->windowIndex[$cnt] = $inventory; $this->windows[spl_object_hash($inventory)] = $cnt; if($inventory->open($this)){ From a4a93091936b97d7ce7303f2545919759c985537 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 4 Sep 2018 11:43:38 +0100 Subject: [PATCH 4/8] Updated NBT dependency for bug fix --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 205b60ee8..b532e32b9 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "pocketmine/raklib": "^0.12.0", "pocketmine/spl": "^0.3.0", "pocketmine/binaryutils": "^0.1.0", - "pocketmine/nbt": "^0.2.0", + "pocketmine/nbt": "^0.2.1", "pocketmine/math": "^0.2.0", "pocketmine/snooze": "^0.1.0" }, diff --git a/composer.lock b/composer.lock index 86292d682..c01d0de3c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2670b9e2a730ff758909be8b9e9d609a", + "content-hash": "3536995c56bfc3dbd6ccc0994e88a636", "packages": [ { "name": "pocketmine/binaryutils", @@ -76,16 +76,16 @@ }, { "name": "pocketmine/nbt", - "version": "0.2.0", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/pmmp/NBT.git", - "reference": "da19487ff92f6f7a16b5ce8894132bb1d1e9ea0c" + "reference": "a4ee39f313c6870153fb7c7e513b211217f7daf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/NBT/zipball/da19487ff92f6f7a16b5ce8894132bb1d1e9ea0c", - "reference": "da19487ff92f6f7a16b5ce8894132bb1d1e9ea0c", + "url": "https://api.github.com/repos/pmmp/NBT/zipball/a4ee39f313c6870153fb7c7e513b211217f7daf8", + "reference": "a4ee39f313c6870153fb7c7e513b211217f7daf8", "shasum": "" }, "require": { @@ -109,10 +109,10 @@ ], "description": "PHP library for working with Named Binary Tags", "support": { - "source": "https://github.com/pmmp/NBT/tree/0.2.0", + "source": "https://github.com/pmmp/NBT/tree/0.2.1", "issues": "https://github.com/pmmp/NBT/issues" }, - "time": "2018-06-13T09:56:00+00:00" + "time": "2018-09-04T10:36:02+00:00" }, { "name": "pocketmine/raklib", From b93e219231530a66c2d1ef103b77c84274e29efc Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 4 Sep 2018 11:44:05 +0100 Subject: [PATCH 5/8] Release 3.1.6 --- src/pocketmine/PocketMine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index a9f737d2d..783bc5044 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -38,7 +38,7 @@ namespace pocketmine { const NAME = "PocketMine-MP"; const BASE_VERSION = "3.1.6"; - const IS_DEVELOPMENT_BUILD = true; + const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0"; From b615cad22d9cb1c44510979d270fdbc159b8686f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 4 Sep 2018 11:50:05 +0100 Subject: [PATCH 6/8] 3.1.7 is next --- src/pocketmine/PocketMine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index 783bc5044..9ca2d218f 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -37,8 +37,8 @@ namespace pocketmine { use pocketmine\wizard\SetupWizard; const NAME = "PocketMine-MP"; - const BASE_VERSION = "3.1.6"; - const IS_DEVELOPMENT_BUILD = false; + const BASE_VERSION = "3.1.7"; + const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0"; From cb04f287eb66b6b7b7b41613d19523689bb3b870 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 4 Sep 2018 11:51:28 +0100 Subject: [PATCH 7/8] Release 3.2.2 --- src/pocketmine/PocketMine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index f4e10c9f3..af630ee03 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -38,7 +38,7 @@ namespace pocketmine { const NAME = "PocketMine-MP"; const BASE_VERSION = "3.2.2"; - const IS_DEVELOPMENT_BUILD = true; + const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0"; From 9f4722f5377db569f58e5d2af8b1d89f11f1497c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 4 Sep 2018 11:56:27 +0100 Subject: [PATCH 8/8] 3.2.3 is next --- src/pocketmine/PocketMine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index af630ee03..502df029b 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -37,8 +37,8 @@ namespace pocketmine { use pocketmine\wizard\SetupWizard; const NAME = "PocketMine-MP"; - const BASE_VERSION = "3.2.2"; - const IS_DEVELOPMENT_BUILD = false; + const BASE_VERSION = "3.2.3"; + const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; const MIN_PHP_VERSION = "7.2.0";