mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Compare commits
95 Commits
Author | SHA1 | Date | |
---|---|---|---|
61391b6e23 | |||
fbb6f1f81c | |||
712df04bc4 | |||
1563e25378 | |||
ed84252942 | |||
3d90625020 | |||
9f6b914925 | |||
0e614ea8fd | |||
401bd09d60 | |||
649671cc69 | |||
e755e1dc23 | |||
e34a444dde | |||
78f9985377 | |||
fac2bd3379 | |||
fcfd51dfc7 | |||
ccc76cf338 | |||
10a73488ed | |||
9c5114084b | |||
11630ab1aa | |||
a3068b39a2 | |||
edbc73a72c | |||
3a0c8dd594 | |||
16fa26405a | |||
57423540f0 | |||
8f8821c904 | |||
094102fe92 | |||
2aef83e7d7 | |||
5c3e78e1d3 | |||
18666e5a60 | |||
f72163c173 | |||
7407e504b6 | |||
0e396dc47d | |||
d2204da1d5 | |||
2a51269305 | |||
928041ddf1 | |||
007f4f9350 | |||
46e9f0cec6 | |||
606d56b55d | |||
78a62a8b27 | |||
c5bdd7dd64 | |||
8ee37a3033 | |||
7e3e63f342 | |||
8ef1e54e20 | |||
eaf3a86981 | |||
317a48d9b0 | |||
bc14660e55 | |||
b1bb9fbd1c | |||
96181f8cf5 | |||
4771e3dc28 | |||
2e9117d102 | |||
06493da7d9 | |||
bd303b1062 | |||
fe731b9018 | |||
1a24afc6d1 | |||
bef906b0f0 | |||
37e8dd6444 | |||
02ee0f23c0 | |||
cda472333c | |||
47cf58be8a | |||
ccf9691927 | |||
16fa958416 | |||
bac57c159f | |||
38b2d83799 | |||
c134b1cd8a | |||
62deafda48 | |||
31b6df4376 | |||
b296ae1b87 | |||
f9e42b716a | |||
34c1d455a7 | |||
af8936dba5 | |||
e8ffab1787 | |||
ecc1e1f698 | |||
ea5931e274 | |||
988cf7f535 | |||
e156fb47e8 | |||
efc5f34877 | |||
dd0d8842d5 | |||
7bdc564ccc | |||
69fff23f1a | |||
ae43698e88 | |||
0987e03c03 | |||
97c124edf9 | |||
56501178b7 | |||
da663deea1 | |||
972c911485 | |||
0d8858f948 | |||
da71540fce | |||
ec9b39862b | |||
efca8077d5 | |||
5066d5225b | |||
aefaf73685 | |||
15401d740f | |||
5920b0ba40 | |||
dea75a0687 | |||
873e8740e0 |
16
.github/support.yml
vendored
16
.github/support.yml
vendored
@ -1,16 +0,0 @@
|
||||
# Configuration for support-requests - https://github.com/dessant/support-requests
|
||||
|
||||
# Label used to mark issues as support requests
|
||||
supportLabel: "Support request"
|
||||
# Comment to post on issues marked as support requests. Add a link
|
||||
# to a support page, or set to `false` to disable
|
||||
supportComment: >
|
||||
Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
|
||||
|
||||
|
||||
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io)
|
||||
|
||||
# Whether to close issues marked as support requests
|
||||
close: true
|
||||
# Whether to lock issues marked as support requests
|
||||
lock: false
|
61
.github/workflows/main.yml
vendored
61
.github/workflows/main.yml
vendored
@ -8,8 +8,13 @@ on:
|
||||
jobs:
|
||||
build-php:
|
||||
name: Prepare PHP
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
runs-on: ${{ matrix.image }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
image: [ubuntu-20.04]
|
||||
php: [7.3.27, 7.4.16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2 #needed for build.sh
|
||||
- name: Check for PHP build cache
|
||||
@ -17,16 +22,22 @@ jobs:
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "./bin"
|
||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
|
||||
- name: Compile PHP
|
||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||
run: ./tests/gh-actions/build.sh
|
||||
run: ./tests/gh-actions/build.sh "${{ matrix.php }}"
|
||||
|
||||
phpstan:
|
||||
name: PHPStan analysis
|
||||
needs: build-php
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.image }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [ubuntu-20.04]
|
||||
php: [7.3.27, 7.4.16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -36,12 +47,16 @@ jobs:
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "./bin"
|
||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
|
||||
- name: Kill build on PHP build cache miss (should never happen)
|
||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Install cached PHP's dependencies
|
||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
||||
|
||||
- name: Prefix PHP to PATH
|
||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||
|
||||
@ -54,7 +69,7 @@ jobs:
|
||||
path: |
|
||||
~/.cache/composer/files
|
||||
~/.cache/composer/vcs
|
||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
||||
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||
restore-keys: |
|
||||
composer-v2-cache-
|
||||
|
||||
@ -67,7 +82,13 @@ jobs:
|
||||
phpunit:
|
||||
name: PHPUnit tests
|
||||
needs: build-php
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.image }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [ubuntu-20.04]
|
||||
php: [7.3.27, 7.4.16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@ -76,12 +97,16 @@ jobs:
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "./bin"
|
||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
|
||||
- name: Kill build on PHP build cache miss (should never happen)
|
||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Install cached PHP's dependencies
|
||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
||||
|
||||
- name: Prefix PHP to PATH
|
||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||
|
||||
@ -94,7 +119,7 @@ jobs:
|
||||
path: |
|
||||
~/.cache/composer/files
|
||||
~/.cache/composer/vcs
|
||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
||||
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||
restore-keys: |
|
||||
composer-v2-cache-
|
||||
|
||||
@ -107,7 +132,13 @@ jobs:
|
||||
integration:
|
||||
name: Integration tests
|
||||
needs: build-php
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.image }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [ubuntu-20.04]
|
||||
php: [7.3.27, 7.4.16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
@ -118,12 +149,16 @@ jobs:
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "./bin"
|
||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||
|
||||
- name: Kill build on PHP build cache miss (should never happen)
|
||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||
run: exit 1
|
||||
|
||||
- name: Install cached PHP's dependencies
|
||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
||||
|
||||
- name: Prefix PHP to PATH
|
||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||
|
||||
@ -136,7 +171,7 @@ jobs:
|
||||
path: |
|
||||
~/.cache/composer/files
|
||||
~/.cache/composer/vcs
|
||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
||||
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||
restore-keys: |
|
||||
composer-v2-cache-
|
||||
|
||||
|
22
.github/workflows/support.yml
vendored
Normal file
22
.github/workflows/support.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
name: 'Manage support request issues'
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled, unlabeled, reopened]
|
||||
|
||||
jobs:
|
||||
support:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/support-requests@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
support-label: "Support request"
|
||||
issue-comment: >
|
||||
Thanks, but this issue tracker is not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
|
||||
|
||||
|
||||
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bmSAZBG) | [Forums](https://forums.pmmp.io)
|
||||
|
||||
close-issue: true
|
||||
lock-issue: false
|
@ -34,5 +34,11 @@ Run `composer make-server` using your preferred PHP binary. It'll drop a `Pocket
|
||||
|
||||
You can also use the `--out` option to change the output filename.
|
||||
|
||||
There is a bug in PHP that might cause an error which looks like this:
|
||||
```
|
||||
Fatal error: Uncaught BadMethodCallException: unable to create temporary file in PocketMine-MP/build/server-phar.php:119
|
||||
```
|
||||
You can work around it by setting `ulimit -n` to some bigger number, e.g. `8192`, or by updating your PHP version to at least 7.4.16 or 8.0.3.
|
||||
|
||||
## Running PocketMine-MP from source code
|
||||
Run `src/pocketmine/PocketMine.php` using your preferred PHP binary.
|
||||
|
@ -3,7 +3,12 @@
|
||||
<b>A highly customisable, open source server software for Minecraft: Bedrock Edition written in PHP</b>
|
||||
</p>
|
||||
|
||||

|
||||
<p align="center">
|
||||
<img src="https://github.com/pmmp/PocketMine-MP/workflows/CI/badge.svg" alt="CI" />
|
||||
<a href="https://github.com/pmmp/PocketMine-MP/releases"><img src="https://img.shields.io/github/v/tag/pmmp/PocketMine-MP?label=release&logo=github" alt="GitHub tag (latest semver)" /></a>
|
||||
<a href="https://hub.docker.com/r/pmmp/pocketmine-mp"><img src="https://img.shields.io/docker/v/pmmp/pocketmine-mp?logo=docker&label=image" alt="Docker image version (latest semver)" /></a>
|
||||
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
|
||||
</p>
|
||||
|
||||
## Getting started
|
||||
- [Documentation](http://pmmp.readthedocs.org/)
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace pocketmine\build\make_release;
|
||||
|
||||
use pocketmine\utils\VersionString;
|
||||
use function defined;
|
||||
use function dirname;
|
||||
use function fgets;
|
||||
use function file_get_contents;
|
||||
@ -86,6 +85,4 @@ function main(array $argv) : void{
|
||||
system('git push origin HEAD ' . $currentVer->getBaseVersion());
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
main($argv);
|
||||
}
|
||||
main($argv);
|
||||
|
Submodule build/php updated: a42c7df20a...60194e8b14
@ -26,7 +26,6 @@ namespace pocketmine\build\server_phar;
|
||||
use pocketmine\utils\Git;
|
||||
use function array_map;
|
||||
use function count;
|
||||
use function defined;
|
||||
use function dirname;
|
||||
use function file_exists;
|
||||
use function getcwd;
|
||||
@ -174,6 +173,4 @@ STUB
|
||||
}
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
main();
|
||||
}
|
||||
main();
|
||||
|
@ -21,3 +21,40 @@ Plugin developers should **only** update their required API to this version if y
|
||||
- Server uptime is now included in crash reports.
|
||||
- Hoes now take damage when used to break sponges.
|
||||
- Using lava as fuel in a furnace now leaves behind an empty bucket.
|
||||
|
||||
# 3.17.2
|
||||
- Fixed region header corruption when chunks with larger-than-expected lengths are found. These chunks are now treated as corrupted, instead of automatically attempting to salvage them (which usually fails anyway).
|
||||
- `RegionLoader->removeChunk()` now allows the space used by the removed chunk to be reused by future region saves.
|
||||
- Extracted `Living->applyConsumptionResults()` from `Living->consumeObject()` (preparation for a future bug fix).
|
||||
|
||||
# 3.17.3
|
||||
- Improved performance of chunk loading in Region-based worlds.
|
||||
- Improved performance of region header validation in Region-based worlds (indirect improvement to chunk loading performance).
|
||||
- Fixed some PHP 8.0 language-level compatibility issues.
|
||||
- Source installations will now exit with an error when Composer dependencies are not in sync with the current Git revision. Now, it's required to run `composer install` after every git pull to make sure the correct dependency versions are installed.
|
||||
|
||||
# 3.17.4
|
||||
- Removed `readline` support. This hasn't been maintained for many years, never worked correctly, and isn't thread-safe in any case.
|
||||
- Fixed false-positives of region corruption in Region-based worlds (outdated file stat cache).
|
||||
- Fixed more deprecation warnings on PHP 8.0 (optional parameter before required).
|
||||
- `CraftItemEvent->getInputs()` now returns a list starting at offset 0, instead of random offsets. (Note that the contents still won't be ordered.)
|
||||
- `CraftItemEvent->getOutputs()` now returns a list starting at offset 0, instead of random offsets. (Note that the contents still won't be ordered.)
|
||||
- Fixed a bug that broke synchronized building, bridging, towering and more.
|
||||
- Objects in memory dumps no longer show inherited properties multiple times.
|
||||
|
||||
# 3.17.5
|
||||
- Reduced CPU wastage by the logger thread.
|
||||
- Fixed LevelDB deprecation errors on PHP 8.0.
|
||||
- Added some protocol changes for 1.16.200 which were previously overlooked.
|
||||
- Player XUIDs are now tracked. If a player's XUID does not match the previously recorded XUID when they next join the server, they will be kicked. This can be disabled by the `player.verify-xuid` setting in `pocketmine.yml`.
|
||||
- `BUILDING.md` now has a note about `build/server-phar.php`'s compression bug (a bug in PHP).
|
||||
|
||||
# 3.17.6
|
||||
- Fixed core race conditions that could have led to server freezes (race conditions in pmmp/Snooze).
|
||||
- The log message about Xbox Live authentication being enabled has been reduced to INFO, and the tip on how to turn it off removed (disabling it should usually only be done by power users anyway).
|
||||
- Fixed `PlayerMoveEvent->getFrom()` returning incorrect results for players who experienced movement reversions.
|
||||
- Fixed a bug in `ResourcePackClientResponsePacket` decoding that caused unexpected results when decoding the packet twice.
|
||||
- XUID verification now compares XUIDs against players who are already on the server to detect mismatches to avoid unnecessary loading of playerdata.
|
||||
- Fixed an inventory duplication bug which could occur when the same player joined with two devices at the same time.
|
||||
- Fixed cursor item not being synced on inventory transaction rollbacks.
|
||||
- Fixed items with TAG_Float in their NBT not being able to be moved around in the inventory.
|
||||
|
@ -5,10 +5,10 @@
|
||||
"homepage": "https://pmmp.io",
|
||||
"license": "LGPL-3.0",
|
||||
"require": {
|
||||
"php": ">=7.3.0",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"php-64bit": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-ctype": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-date": "*",
|
||||
"ext-hash": "*",
|
||||
"ext-json": "*",
|
||||
@ -23,21 +23,21 @@
|
||||
"ext-yaml": ">=2.0.0",
|
||||
"ext-zip": "*",
|
||||
"ext-zlib": ">=1.2.11",
|
||||
"pocketmine/raklib": "^0.12.7",
|
||||
"pocketmine/spl": "^0.4.0",
|
||||
"composer-runtime-api": "^2.0",
|
||||
"adhocore/json-comment": "^0.1.0",
|
||||
"pocketmine/binaryutils": "^0.1.9",
|
||||
"pocketmine/nbt": "^0.2.10",
|
||||
"pocketmine/math": "^0.2.0",
|
||||
"pocketmine/snooze": "^0.1.0",
|
||||
"pocketmine/callback-validator": "^1.0.2",
|
||||
"pocketmine/classloader": "^0.1.0",
|
||||
"pocketmine/log": "^0.2.0",
|
||||
"pocketmine/log-pthreads": "^0.1.0",
|
||||
"pocketmine/callback-validator": "^1.0.2",
|
||||
"adhocore/json-comment": "^0.1.0",
|
||||
"composer-runtime-api": "^2.0"
|
||||
"pocketmine/math": "^0.2.0",
|
||||
"pocketmine/nbt": "^0.2.10",
|
||||
"pocketmine/raklib": "^0.12.7",
|
||||
"pocketmine/snooze": "^0.1.0",
|
||||
"pocketmine/spl": "^0.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "0.12.64",
|
||||
"phpstan/phpstan": "0.12.80",
|
||||
"phpstan/phpstan-phpunit": "^0.12.6",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2",
|
||||
"phpunit/phpunit": "^9.2"
|
||||
@ -60,7 +60,8 @@
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.3.0"
|
||||
}
|
||||
},
|
||||
"sort-packages": true
|
||||
},
|
||||
"scripts": {
|
||||
"make-devtools": "@php -dphar.readonly=0 tests/plugins/DevTools/src/DevTools/ConsoleScript.php --make tests/plugins/DevTools --out plugins/DevTools.phar",
|
||||
|
234
composer.lock
generated
234
composer.lock
generated
@ -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": "f0cec87ced440a2ea2b189283e9f696c",
|
||||
"content-hash": "4ed24eeab1fdf52c6b9a797a42e10638",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/json-comment",
|
||||
@ -56,25 +56,25 @@
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/binaryutils",
|
||||
"version": "0.1.12",
|
||||
"version": "0.1.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/BinaryUtils.git",
|
||||
"reference": "566fa87829e007eda0bd96e39fe20b9b0d638132"
|
||||
"reference": "0abee38d4e2861621f262c79a2a3d699d8a697f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/566fa87829e007eda0bd96e39fe20b9b0d638132",
|
||||
"reference": "566fa87829e007eda0bd96e39fe20b9b0d638132",
|
||||
"url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/0abee38d4e2861621f262c79a2a3d699d8a697f4",
|
||||
"reference": "0abee38d4e2861621f262c79a2a3d699d8a697f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"php-64bit": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.40",
|
||||
"phpstan/phpstan": "0.12.67",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
@ -90,9 +90,9 @@
|
||||
"description": "Classes and methods for conveniently handling binary data",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/BinaryUtils/issues",
|
||||
"source": "https://github.com/pmmp/BinaryUtils/tree/stable"
|
||||
"source": "https://github.com/pmmp/BinaryUtils/tree/0.1.13"
|
||||
},
|
||||
"time": "2020-08-28T20:43:21+00:00"
|
||||
"time": "2021-01-15T14:19:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/callback-validator",
|
||||
@ -146,29 +146,29 @@
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/classloader",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/ClassLoader.git",
|
||||
"reference": "7c0363491d1ce8f914fe96d41a4338c982adedff"
|
||||
"reference": "9757928424652393b178a3760073113aa7c9911b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/ClassLoader/zipball/7c0363491d1ce8f914fe96d41a4338c982adedff",
|
||||
"reference": "7c0363491d1ce8f914fe96d41a4338c982adedff",
|
||||
"url": "https://api.github.com/repos/pmmp/ClassLoader/zipball/9757928424652393b178a3760073113aa7c9911b",
|
||||
"reference": "9757928424652393b178a3760073113aa7c9911b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-reflection": "*",
|
||||
"php": ">=7.2.0"
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.38",
|
||||
"phpstan/phpstan": "0.12.66",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
@ -184,32 +184,32 @@
|
||||
"description": "Ad-hoc autoloading components used by PocketMine-MP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/ClassLoader/issues",
|
||||
"source": "https://github.com/pmmp/ClassLoader/tree/stable"
|
||||
"source": "https://github.com/pmmp/ClassLoader/tree/0.1.2"
|
||||
},
|
||||
"time": "2020-08-22T11:48:51+00:00"
|
||||
"time": "2021-01-15T00:40:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/log",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Log.git",
|
||||
"reference": "e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa"
|
||||
"reference": "830b44a2cf96ef703c550abe64302f230231ca49"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Log/zipball/e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa",
|
||||
"reference": "e59bedb5d4bbeb9a26647cb7c367cb2fa72addfa",
|
||||
"url": "https://api.github.com/repos/pmmp/Log/zipball/830b44a2cf96ef703c550abe64302f230231ca49",
|
||||
"reference": "830b44a2cf96ef703c550abe64302f230231ca49",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8",
|
||||
"phpstan/phpstan": "0.12.67",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2"
|
||||
},
|
||||
"type": "library",
|
||||
@ -225,34 +225,36 @@
|
||||
"description": "Logging components used by PocketMine-MP and related projects",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/Log/issues",
|
||||
"source": "https://github.com/pmmp/Log/tree/0.2.0"
|
||||
"source": "https://github.com/pmmp/Log/tree/0.2.1"
|
||||
},
|
||||
"time": "2020-03-31T15:43:47+00:00"
|
||||
"time": "2021-01-15T14:32:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/log-pthreads",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/LogPthreads.git",
|
||||
"reference": "9bbcef398b01487ab47c234a6a7054722abbe067"
|
||||
"reference": "e477ecf6ec214fdd4415ea1da3fdd9d73bf699ea"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/LogPthreads/zipball/9bbcef398b01487ab47c234a6a7054722abbe067",
|
||||
"reference": "9bbcef398b01487ab47c234a6a7054722abbe067",
|
||||
"url": "https://api.github.com/repos/pmmp/LogPthreads/zipball/e477ecf6ec214fdd4415ea1da3fdd9d73bf699ea",
|
||||
"reference": "e477ecf6ec214fdd4415ea1da3fdd9d73bf699ea",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"php": ">=7.2",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"pocketmine/log": "^0.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"pocketmine/spl": "<0.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.18"
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.66",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -267,31 +269,31 @@
|
||||
"description": "Logging components specialized for pthreads used by PocketMine-MP and related projects",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/LogPthreads/issues",
|
||||
"source": "https://github.com/pmmp/LogPthreads/tree/0.1.1"
|
||||
"source": "https://github.com/pmmp/LogPthreads/tree/0.1.3"
|
||||
},
|
||||
"time": "2020-03-31T16:17:19+00:00"
|
||||
"time": "2021-01-15T00:35:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/math",
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Math.git",
|
||||
"reference": "8c46cfa95351fb0b2b30739a381310941934b55f"
|
||||
"reference": "43057cb8c179a9859677b496a788db922fd5cfc3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Math/zipball/8c46cfa95351fb0b2b30739a381310941934b55f",
|
||||
"reference": "8c46cfa95351fb0b2b30739a381310941934b55f",
|
||||
"url": "https://api.github.com/repos/pmmp/Math/zipball/43057cb8c179a9859677b496a788db922fd5cfc3",
|
||||
"reference": "43057cb8c179a9859677b496a788db922fd5cfc3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.0",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"php-64bit": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.40",
|
||||
"phpstan/phpstan": "0.12.67",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
@ -307,34 +309,34 @@
|
||||
"description": "PHP library containing math related code used in PocketMine-MP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/Math/issues",
|
||||
"source": "https://github.com/pmmp/Math/tree/stable"
|
||||
"source": "https://github.com/pmmp/Math/tree/0.2.6"
|
||||
},
|
||||
"time": "2020-08-27T11:45:40+00:00"
|
||||
"time": "2021-01-15T14:25:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/nbt",
|
||||
"version": "0.2.15",
|
||||
"version": "0.2.17",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/NBT.git",
|
||||
"reference": "f8a81d37d24eb79fb77d985a52549d68955bc6a1"
|
||||
"reference": "7de6bdfdfbcafe2689aafbde47f6506f265afd19"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/f8a81d37d24eb79fb77d985a52549d68955bc6a1",
|
||||
"reference": "f8a81d37d24eb79fb77d985a52549d68955bc6a1",
|
||||
"url": "https://api.github.com/repos/pmmp/NBT/zipball/7de6bdfdfbcafe2689aafbde47f6506f265afd19",
|
||||
"reference": "7de6bdfdfbcafe2689aafbde47f6506f265afd19",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-zlib": "*",
|
||||
"php": ">=7.2.0",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"php-64bit": "*",
|
||||
"pocketmine/binaryutils": "^0.1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"irstea/phpunit-shim": "^7.5 || ^8.0",
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.40",
|
||||
"phpstan/phpstan": "0.12.80",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
@ -350,28 +352,28 @@
|
||||
"description": "PHP library for working with Named Binary Tags",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/NBT/issues",
|
||||
"source": "https://github.com/pmmp/NBT/tree/stable"
|
||||
"source": "https://github.com/pmmp/NBT/tree/0.2.17"
|
||||
},
|
||||
"time": "2020-08-28T15:11:32+00:00"
|
||||
"time": "2021-03-07T20:51:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/raklib",
|
||||
"version": "0.12.9",
|
||||
"version": "0.12.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/RakLib.git",
|
||||
"reference": "5f2a02009f486ca4d90892814570fa13ebdc078d"
|
||||
"reference": "9cce458b8bfde3e4dfdbf70c659fc7b7fe26b5c4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/5f2a02009f486ca4d90892814570fa13ebdc078d",
|
||||
"reference": "5f2a02009f486ca4d90892814570fa13ebdc078d",
|
||||
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/9cce458b8bfde3e4dfdbf70c659fc7b7fe26b5c4",
|
||||
"reference": "9cce458b8bfde3e4dfdbf70c659fc7b7fe26b5c4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": "~3.2.0",
|
||||
"ext-sockets": "*",
|
||||
"php": ">=7.2.0",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"php-64bit": "*",
|
||||
"php-ipv6": "*",
|
||||
"pocketmine/binaryutils": "^0.1.9",
|
||||
@ -380,7 +382,7 @@
|
||||
"pocketmine/snooze": "^0.1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "0.12.40",
|
||||
"phpstan/phpstan": "0.12.76",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.2"
|
||||
},
|
||||
"type": "library",
|
||||
@ -396,31 +398,31 @@
|
||||
"description": "A RakNet server implementation written in PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/RakLib/issues",
|
||||
"source": "https://github.com/pmmp/RakLib/tree/stable"
|
||||
"source": "https://github.com/pmmp/RakLib/tree/0.12.11"
|
||||
},
|
||||
"time": "2020-08-28T15:22:57+00:00"
|
||||
"time": "2021-02-15T11:21:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/snooze",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/Snooze.git",
|
||||
"reference": "849510fa62e57512b8467e3694e9b3add97038fd"
|
||||
"reference": "70b5e7937a06878dd321a3182ceb76d56298f2cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/Snooze/zipball/849510fa62e57512b8467e3694e9b3add97038fd",
|
||||
"reference": "849510fa62e57512b8467e3694e9b3add97038fd",
|
||||
"url": "https://api.github.com/repos/pmmp/Snooze/zipball/70b5e7937a06878dd321a3182ceb76d56298f2cd",
|
||||
"reference": "70b5e7937a06878dd321a3182ceb76d56298f2cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pthreads": ">=3.1.7dev",
|
||||
"php-64bit": ">=7.2.0"
|
||||
"php-64bit": "^7.2 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan": "0.12.40",
|
||||
"phpstan/phpstan": "0.12.76",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.4"
|
||||
},
|
||||
"type": "library",
|
||||
@ -436,26 +438,26 @@
|
||||
"description": "Thread notification management library for code using the pthreads extension",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/Snooze/issues",
|
||||
"source": "https://github.com/pmmp/Snooze/tree/0.1.3"
|
||||
"source": "https://github.com/pmmp/Snooze/tree/0.1.5"
|
||||
},
|
||||
"time": "2020-08-28T22:19:21+00:00"
|
||||
"time": "2021-02-22T16:16:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pocketmine/spl",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pmmp/SPL.git",
|
||||
"reference": "ff0579a0be41bbe65d3637607715c0f87728a838"
|
||||
"reference": "6b08b7cf8c4afa17139c9a1b3bf1b408531de161"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pmmp/SPL/zipball/ff0579a0be41bbe65d3637607715c0f87728a838",
|
||||
"reference": "ff0579a0be41bbe65d3637607715c0f87728a838",
|
||||
"url": "https://api.github.com/repos/pmmp/SPL/zipball/6b08b7cf8c4afa17139c9a1b3bf1b408531de161",
|
||||
"reference": "6b08b7cf8c4afa17139c9a1b3bf1b408531de161",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^0.12.8"
|
||||
@ -473,9 +475,9 @@
|
||||
"description": "Standard library files required by PocketMine-MP and related projects",
|
||||
"support": {
|
||||
"issues": "https://github.com/pmmp/SPL/issues",
|
||||
"source": "https://github.com/pmmp/SPL/tree/0.4.1"
|
||||
"source": "https://github.com/pmmp/SPL/tree/0.4.2"
|
||||
},
|
||||
"time": "2020-01-31T16:18:03+00:00"
|
||||
"time": "2021-01-15T15:15:23+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@ -724,16 +726,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phar-io/version",
|
||||
"version": "3.0.4",
|
||||
"version": "3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phar-io/version.git",
|
||||
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
|
||||
"reference": "bae7c545bef187884426f042434e561ab1ddb182"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
|
||||
"reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
|
||||
"url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182",
|
||||
"reference": "bae7c545bef187884426f042434e561ab1ddb182",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -769,9 +771,9 @@
|
||||
"description": "Library for handling version information and constraints",
|
||||
"support": {
|
||||
"issues": "https://github.com/phar-io/version/issues",
|
||||
"source": "https://github.com/phar-io/version/tree/3.0.4"
|
||||
"source": "https://github.com/phar-io/version/tree/3.1.0"
|
||||
},
|
||||
"time": "2020-12-13T23:18:30+00:00"
|
||||
"time": "2021-02-23T14:00:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
@ -1000,16 +1002,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "0.12.64",
|
||||
"version": "0.12.80",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa"
|
||||
"reference": "c6a1b17f22ecf708d434d6bee05092647ec7e686"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa",
|
||||
"reference": "23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6a1b17f22ecf708d434d6bee05092647ec7e686",
|
||||
"reference": "c6a1b17f22ecf708d434d6bee05092647ec7e686",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1040,7 +1042,7 @@
|
||||
"description": "PHPStan - PHP Static Analysis Tool",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpstan/issues",
|
||||
"source": "https://github.com/phpstan/phpstan/tree/0.12.64"
|
||||
"source": "https://github.com/phpstan/phpstan/tree/0.12.80"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1056,20 +1058,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-12-21T11:59:02+00:00"
|
||||
"time": "2021-02-28T20:22:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-phpunit",
|
||||
"version": "0.12.17",
|
||||
"version": "0.12.18",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan-phpunit.git",
|
||||
"reference": "432575b41cf2d4f44e460234acaf56119ed97d36"
|
||||
"reference": "ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/432575b41cf2d4f44e460234acaf56119ed97d36",
|
||||
"reference": "432575b41cf2d4f44e460234acaf56119ed97d36",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72",
|
||||
"reference": "ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1109,27 +1111,27 @@
|
||||
"description": "PHPUnit extensions and rules for PHPStan",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
|
||||
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.17"
|
||||
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.18"
|
||||
},
|
||||
"time": "2020-12-13T12:12:51+00:00"
|
||||
"time": "2021-03-06T11:51:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-strict-rules",
|
||||
"version": "0.12.7",
|
||||
"version": "0.12.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
|
||||
"reference": "03807e3410747ec18cd5f05a6342384adcc423bf"
|
||||
"reference": "0705fefc7c9168529fd130e341428f5f10f4f01d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/03807e3410747ec18cd5f05a6342384adcc423bf",
|
||||
"reference": "03807e3410747ec18cd5f05a6342384adcc423bf",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/0705fefc7c9168529fd130e341428f5f10f4f01d",
|
||||
"reference": "0705fefc7c9168529fd130e341428f5f10f4f01d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0",
|
||||
"phpstan/phpstan": "^0.12.60"
|
||||
"phpstan/phpstan": "^0.12.66"
|
||||
},
|
||||
"require-dev": {
|
||||
"phing/phing": "^2.16.3",
|
||||
@ -1160,9 +1162,9 @@
|
||||
"description": "Extra strict and opinionated rules for PHPStan",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
|
||||
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.7"
|
||||
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.9"
|
||||
},
|
||||
"time": "2020-12-13T13:27:14+00:00"
|
||||
"time": "2021-01-13T08:50:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@ -1484,16 +1486,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "9.5.0",
|
||||
"version": "9.5.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe"
|
||||
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
|
||||
"reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4",
|
||||
"reference": "f661659747f2f87f9e72095bb207bceb0f151cb4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1571,7 +1573,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -1583,7 +1585,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-12-04T05:05:53+00:00"
|
||||
"time": "2021-02-02T14:45:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
@ -2551,16 +2553,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.20.0",
|
||||
"version": "v1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
|
||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
|
||||
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
|
||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2572,7 +2574,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.20-dev"
|
||||
"dev-main": "1.22-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -2610,7 +2612,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2626,7 +2628,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-10-23T14:02:19+00:00"
|
||||
"time": "2021-01-07T16:49:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
@ -2683,12 +2685,12 @@
|
||||
"version": "1.9.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozart/assert.git",
|
||||
"url": "https://github.com/webmozarts/assert.git",
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"shasum": ""
|
||||
},
|
||||
@ -2726,8 +2728,8 @@
|
||||
"validate"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/webmozart/assert/issues",
|
||||
"source": "https://github.com/webmozart/assert/tree/master"
|
||||
"issues": "https://github.com/webmozarts/assert/issues",
|
||||
"source": "https://github.com/webmozarts/assert/tree/1.9.1"
|
||||
},
|
||||
"time": "2020-07-08T17:02:28+00:00"
|
||||
}
|
||||
@ -2738,10 +2740,10 @@
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=7.3.0",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"php-64bit": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-ctype": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-date": "*",
|
||||
"ext-hash": "*",
|
||||
"ext-json": "*",
|
||||
|
@ -17,6 +17,7 @@ includes:
|
||||
parameters:
|
||||
level: 8
|
||||
checkExplicitMixed: true
|
||||
checkMissingCallableSignature: true
|
||||
bootstrapFiles:
|
||||
- tests/phpstan/bootstrap.php
|
||||
scanDirectories:
|
||||
@ -41,3 +42,9 @@ parameters:
|
||||
reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings
|
||||
staticReflectionClassNamePatterns:
|
||||
- "#^COM$#"
|
||||
typeAliases:
|
||||
#variadics don't work for this - mixed probably shouldn't work either, but for now it does
|
||||
#what we actually need is something that accepts an infinite number of parameters, but in the absence of that,
|
||||
#we'll just fill it with 10 - it's very unlikely to encounter a callable with 10 parameters anyway.
|
||||
anyCallable: 'callable(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
|
||||
anyClosure: '\Closure(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed'
|
||||
|
@ -206,9 +206,16 @@ class CrashDump{
|
||||
|
||||
if($this->server->getProperty("auto-report.send-settings", true) !== false){
|
||||
$this->data["parameters"] = (array) $argv;
|
||||
$this->data["server.properties"] = @file_get_contents($this->server->getDataPath() . "server.properties");
|
||||
$this->data["server.properties"] = preg_replace("#^rcon\\.password=(.*)$#m", "rcon.password=******", $this->data["server.properties"]);
|
||||
$this->data["pocketmine.yml"] = @file_get_contents($this->server->getDataPath() . "pocketmine.yml");
|
||||
if(($serverDotProperties = @file_get_contents($this->server->getDataPath() . "server.properties")) !== false){
|
||||
$this->data["server.properties"] = preg_replace("#^rcon\\.password=(.*)$#m", "rcon.password=******", $serverDotProperties);
|
||||
}else{
|
||||
$this->data["server.properties"] = $serverDotProperties;
|
||||
}
|
||||
if(($pocketmineDotYml = @file_get_contents($this->server->getDataPath() . "pocketmine.yml")) !== false){
|
||||
$this->data["pocketmine.yml"] = $pocketmineDotYml;
|
||||
}else{
|
||||
$this->data["pocketmine.yml"] = "";
|
||||
}
|
||||
}else{
|
||||
$this->data["pocketmine.yml"] = "";
|
||||
$this->data["server.properties"] = "";
|
||||
|
@ -423,8 +423,12 @@ class MemoryManager{
|
||||
}
|
||||
|
||||
$name = $property->getName();
|
||||
if($reflection !== $original and !$property->isPublic()){
|
||||
$name = $reflection->getName() . ":" . $name;
|
||||
if($reflection !== $original){
|
||||
if($property->isPrivate()){
|
||||
$name = $reflection->getName() . ":" . $name;
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(!$property->isPublic()){
|
||||
$property->setAccessible(true);
|
||||
|
@ -100,6 +100,7 @@ use pocketmine\nbt\tag\ByteTag;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\DoubleTag;
|
||||
use pocketmine\nbt\tag\ListTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\network\mcpe\convert\ItemTypeDictionary;
|
||||
use pocketmine\network\mcpe\PlayerNetworkSessionAdapter;
|
||||
use pocketmine\network\mcpe\protocol\ActorEventPacket;
|
||||
@ -408,8 +409,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
/** @var float */
|
||||
protected $lastRightClickTime = 0.0;
|
||||
/** @var Vector3|null */
|
||||
protected $lastRightClickPos = null;
|
||||
/** @var \stdClass|null */
|
||||
protected $lastRightClickData = null;
|
||||
|
||||
/**
|
||||
* @return TranslationContainer|string
|
||||
@ -1652,13 +1653,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$deltaAngle = abs($this->lastYaw - $to->yaw) + abs($this->lastPitch - $to->pitch);
|
||||
|
||||
if($delta > 0.0001 or $deltaAngle > 1.0){
|
||||
$this->lastX = $to->x;
|
||||
$this->lastY = $to->y;
|
||||
$this->lastZ = $to->z;
|
||||
|
||||
$this->lastYaw = $to->yaw;
|
||||
$this->lastPitch = $to->pitch;
|
||||
|
||||
$ev = new PlayerMoveEvent($this, $from, $to);
|
||||
|
||||
$ev->call();
|
||||
@ -1673,6 +1667,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->lastX = $to->x;
|
||||
$this->lastY = $to->y;
|
||||
$this->lastZ = $to->z;
|
||||
|
||||
$this->lastYaw = $to->yaw;
|
||||
$this->lastPitch = $to->pitch;
|
||||
$this->broadcastMovement();
|
||||
|
||||
$distance = sqrt((($from->x - $to->x) ** 2) + (($from->z - $to->z) ** 2));
|
||||
@ -1695,13 +1695,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
protected function revertMovement(Location $from) : void{
|
||||
$this->lastX = $from->x;
|
||||
$this->lastY = $from->y;
|
||||
$this->lastZ = $from->z;
|
||||
|
||||
$this->lastYaw = $from->yaw;
|
||||
$this->lastPitch = $from->pitch;
|
||||
|
||||
$this->setPosition($from);
|
||||
$this->sendPosition($from, $from->yaw, $from->pitch, MovePlayerPacket::MODE_RESET);
|
||||
}
|
||||
@ -2080,17 +2073,42 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
* @return void
|
||||
*/
|
||||
protected function processLogin(){
|
||||
$checkXUID = (bool) $this->server->getProperty("player.verify-xuid", true);
|
||||
$kickForXUIDMismatch = function(string $xuid) use ($checkXUID) : bool{
|
||||
if($checkXUID && $this->xuid !== $xuid){
|
||||
if($this->kick("XUID does not match (possible impersonation attempt)", false)){
|
||||
//TODO: Longer term, we should be identifying playerdata using something more reliable, like XUID or UUID.
|
||||
//However, that would be a very disruptive change, so this will serve as a stopgap for now.
|
||||
//Side note: this will also prevent offline players hijacking XBL playerdata on online servers, since their
|
||||
//XUID will always be empty.
|
||||
return true;
|
||||
}
|
||||
$this->server->getLogger()->debug("XUID mismatch for " . $this->getName() . ", but plugin cancelled event allowing them to join anyway");
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
foreach($this->server->getLoggedInPlayers() as $p){
|
||||
if($p !== $this and ($p->iusername === $this->iusername or $this->getUniqueId()->equals($p->getUniqueId()))){
|
||||
if($kickForXUIDMismatch($p->getXuid())){
|
||||
return;
|
||||
}
|
||||
if(!$p->kick("logged in from another location")){
|
||||
$this->close($this->getLeaveMessage(), "Logged in from another location");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->namedtag = $this->server->getOfflinePlayerData($this->username);
|
||||
if($checkXUID){
|
||||
$recordedXUID = $this->namedtag->getTag("LastKnownXUID");
|
||||
if(!($recordedXUID instanceof StringTag)){
|
||||
$this->server->getLogger()->debug("No previous XUID recorded for " . $this->getName() . ", no choice but to trust this player");
|
||||
}elseif(!$kickForXUIDMismatch($recordedXUID->getValue())){
|
||||
$this->server->getLogger()->debug("XUID match for " . $this->getName());
|
||||
}
|
||||
}
|
||||
|
||||
$this->playedBefore = ($this->getLastPlayed() - $this->getFirstPlayed()) > 1; // microtime(true) - microtime(true) may have less than one millisecond difference
|
||||
$this->namedtag->setString("NameTag", $this->username);
|
||||
@ -2495,12 +2513,16 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
switch($type){
|
||||
case InventoryTransactionPacket::USE_ITEM_ACTION_CLICK_BLOCK:
|
||||
//TODO: start hack for client spam bug
|
||||
$spamBug = ($this->lastRightClickPos !== null and
|
||||
$spamBug = ($this->lastRightClickData !== null and
|
||||
microtime(true) - $this->lastRightClickTime < 0.1 and //100ms
|
||||
$this->lastRightClickPos->distanceSquared($packet->trData->clickPos) < 0.00001 //signature spam bug has 0 distance, but allow some error
|
||||
$this->lastRightClickData->playerPos->distanceSquared($packet->trData->playerPos) < 0.00001 and
|
||||
$this->lastRightClickData->x === $packet->trData->x and
|
||||
$this->lastRightClickData->y === $packet->trData->y and
|
||||
$this->lastRightClickData->z === $packet->trData->z and
|
||||
$this->lastRightClickData->clickPos->distanceSquared($packet->trData->clickPos) < 0.00001 //signature spam bug has 0 distance, but allow some error
|
||||
);
|
||||
//get rid of continued spam if the player clicks and holds right-click
|
||||
$this->lastRightClickPos = clone $packet->trData->clickPos;
|
||||
$this->lastRightClickData = $packet->trData;
|
||||
$this->lastRightClickTime = microtime(true);
|
||||
if($spamBug){
|
||||
return true;
|
||||
@ -3752,6 +3774,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
parent::saveNBT();
|
||||
|
||||
$this->namedtag->setString("LastKnownXUID", $this->xuid);
|
||||
|
||||
if($this->isValid()){
|
||||
$this->namedtag->setString("Level", $this->level->getFolderName());
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine {
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use pocketmine\utils\Git;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\Process;
|
||||
@ -205,6 +206,19 @@ namespace pocketmine {
|
||||
|
||||
define('pocketmine\GIT_COMMIT', $gitHash);
|
||||
|
||||
$composerGitHash = InstalledVersions::getReference('pocketmine/pocketmine-mp');
|
||||
if($composerGitHash !== null){
|
||||
$currentGitHash = explode("-", \pocketmine\GIT_COMMIT)[0];
|
||||
if($currentGitHash !== $composerGitHash){
|
||||
critical_error("Composer dependencies and/or autoloader are out of sync.");
|
||||
critical_error("- Current revision is $currentGitHash");
|
||||
critical_error("- Composer dependencies were last synchronized for revision $composerGitHash");
|
||||
critical_error("Out-of-sync Composer dependencies may result in crashes and classes not being found.");
|
||||
critical_error("Please synchronize Composer dependencies before running the server.");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
$opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-ansi", "disable-ansi"]);
|
||||
|
||||
define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR);
|
||||
@ -214,7 +228,12 @@ namespace pocketmine {
|
||||
mkdir(\pocketmine\DATA, 0777, true);
|
||||
}
|
||||
|
||||
define('pocketmine\LOCK_FILE', fopen(\pocketmine\DATA . 'server.lock', "a+b"));
|
||||
$lockFile = fopen(\pocketmine\DATA . 'server.lock', "a+b");
|
||||
if($lockFile === false){
|
||||
critical_error("Unable to open server.lock file. Please check that the current user has read/write permissions to it.");
|
||||
exit(1);
|
||||
}
|
||||
define('pocketmine\LOCK_FILE', $lockFile);
|
||||
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
|
||||
//wait for a shared lock to avoid race conditions if two servers started at the same time - this makes sure the
|
||||
//other server wrote its PID and released exclusive lock before we get our lock
|
||||
@ -299,7 +318,5 @@ namespace pocketmine {
|
||||
exit($exitCode);
|
||||
}
|
||||
|
||||
if(!defined('pocketmine\_PHPSTAN_ANALYSIS')){
|
||||
\pocketmine\server();
|
||||
}
|
||||
\pocketmine\server();
|
||||
}
|
||||
|
@ -1461,8 +1461,7 @@ class Server{
|
||||
|
||||
$this->onlineMode = $this->getConfigBool("xbox-auth", true);
|
||||
if($this->onlineMode){
|
||||
$this->logger->notice($this->getLanguage()->translateString("pocketmine.server.auth.enabled"));
|
||||
$this->logger->notice($this->getLanguage()->translateString("pocketmine.server.authProperty.enabled"));
|
||||
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.auth.enabled"));
|
||||
}else{
|
||||
$this->logger->warning($this->getLanguage()->translateString("pocketmine.server.auth.disabled"));
|
||||
$this->logger->warning($this->getLanguage()->translateString("pocketmine.server.authWarning"));
|
||||
|
@ -33,6 +33,6 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){
|
||||
const _VERSION_INFO_INCLUDED = true;
|
||||
|
||||
const NAME = "PocketMine-MP";
|
||||
const BASE_VERSION = "3.17.1";
|
||||
const BASE_VERSION = "3.17.6";
|
||||
const IS_DEVELOPMENT_BUILD = false;
|
||||
const BUILD_NUMBER = 0;
|
||||
|
@ -418,6 +418,9 @@ abstract class Liquid extends Transparent{
|
||||
return $isOptimalFlowDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-impure This function modifies the adjacent sources count (premature optimisation)
|
||||
*/
|
||||
private function getSmallestFlowDecay(Block $block, int $decay) : int{
|
||||
$blockDecay = $this->getFlowDecay($block);
|
||||
|
||||
|
@ -25,23 +25,18 @@ namespace pocketmine\command;
|
||||
|
||||
use pocketmine\snooze\SleeperNotifier;
|
||||
use pocketmine\Thread;
|
||||
use pocketmine\utils\Utils;
|
||||
use function extension_loaded;
|
||||
use function fclose;
|
||||
use function fgets;
|
||||
use function fopen;
|
||||
use function fstat;
|
||||
use function getopt;
|
||||
use function is_resource;
|
||||
use function microtime;
|
||||
use function preg_replace;
|
||||
use function readline;
|
||||
use function readline_add_history;
|
||||
use function stream_isatty;
|
||||
use function stream_select;
|
||||
use function trim;
|
||||
use function usleep;
|
||||
use const STDIN;
|
||||
|
||||
class CommandReader extends Thread{
|
||||
|
||||
@ -65,12 +60,6 @@ class CommandReader extends Thread{
|
||||
public function __construct(?SleeperNotifier $notifier = null){
|
||||
$this->buffer = new \Threaded;
|
||||
$this->notifier = $notifier;
|
||||
|
||||
$opts = getopt("", ["disable-readline", "enable-readline"]);
|
||||
|
||||
if(extension_loaded("readline") and (Utils::getOS() === Utils::OS_WINDOWS ? isset($opts["enable-readline"]) : !isset($opts["disable-readline"])) and !$this->isPipe(STDIN)){
|
||||
$this->type = self::TYPE_READLINE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,41 +117,34 @@ class CommandReader extends Thread{
|
||||
*/
|
||||
private function readLine() : bool{
|
||||
$line = "";
|
||||
if($this->type === self::TYPE_READLINE){
|
||||
if(($raw = readline("> ")) !== false and ($line = trim($raw)) !== ""){
|
||||
readline_add_history($line);
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
if(!is_resource(self::$stdin)){
|
||||
$this->initStdin();
|
||||
}
|
||||
|
||||
switch($this->type){
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case self::TYPE_STREAM:
|
||||
//stream_select doesn't work on piped streams for some reason
|
||||
$r = [self::$stdin];
|
||||
$w = $e = null;
|
||||
if(($count = stream_select($r, $w, $e, 0, 200000)) === 0){ //nothing changed in 200000 microseconds
|
||||
return true;
|
||||
}elseif($count === false){ //stream error
|
||||
$this->initStdin();
|
||||
}
|
||||
if(!is_resource(self::$stdin)){
|
||||
$this->initStdin();
|
||||
}
|
||||
|
||||
case self::TYPE_PIPED:
|
||||
if(($raw = fgets(self::$stdin)) === false){ //broken pipe or EOF
|
||||
$this->initStdin();
|
||||
$this->synchronized(function() : void{
|
||||
$this->wait(200000);
|
||||
}); //prevent CPU waste if it's end of pipe
|
||||
return true; //loop back round
|
||||
}
|
||||
switch($this->type){
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case self::TYPE_STREAM:
|
||||
//stream_select doesn't work on piped streams for some reason
|
||||
$r = [self::$stdin];
|
||||
$w = $e = null;
|
||||
if(($count = stream_select($r, $w, $e, 0, 200000)) === 0){ //nothing changed in 200000 microseconds
|
||||
return true;
|
||||
}elseif($count === false){ //stream error
|
||||
$this->initStdin();
|
||||
}
|
||||
|
||||
$line = trim($raw);
|
||||
break;
|
||||
}
|
||||
case self::TYPE_PIPED:
|
||||
if(($raw = fgets(self::$stdin)) === false){ //broken pipe or EOF
|
||||
$this->initStdin();
|
||||
$this->synchronized(function() : void{
|
||||
$this->wait(200000);
|
||||
}); //prevent CPU waste if it's end of pipe
|
||||
return true; //loop back round
|
||||
}
|
||||
|
||||
$line = trim($raw);
|
||||
break;
|
||||
}
|
||||
|
||||
if($line !== ""){
|
||||
@ -193,17 +175,11 @@ class CommandReader extends Thread{
|
||||
*/
|
||||
public function run(){
|
||||
$this->registerClassLoader();
|
||||
|
||||
if($this->type !== self::TYPE_READLINE){
|
||||
$this->initStdin();
|
||||
}
|
||||
$this->initStdin();
|
||||
|
||||
while(!$this->shutdown and $this->readLine());
|
||||
|
||||
if($this->type !== self::TYPE_READLINE){
|
||||
fclose(self::$stdin);
|
||||
}
|
||||
|
||||
fclose(self::$stdin);
|
||||
}
|
||||
|
||||
public function getThreadName() : string{
|
||||
|
@ -300,17 +300,20 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
if($consumable instanceof MaybeConsumable and !$consumable->canBeConsumed()){
|
||||
return false;
|
||||
}
|
||||
if($consumable instanceof FoodSource && $consumable->requiresHunger() and !$this->isHungry()){
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::consumeObject($consumable);
|
||||
}
|
||||
|
||||
protected function applyConsumptionResults(Consumable $consumable) : void{
|
||||
if($consumable instanceof FoodSource){
|
||||
if($consumable->requiresHunger() and !$this->isHungry()){
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addFood($consumable->getFoodRestore());
|
||||
$this->addSaturation($consumable->getSaturationRestore());
|
||||
}
|
||||
|
||||
return parent::consumeObject($consumable);
|
||||
parent::applyConsumptionResults($consumable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -363,13 +363,20 @@ abstract class Living extends Entity implements Damageable{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->applyConsumptionResults($consumable);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies effects from consuming the object. This shouldn't do any can-consume checks (those are expected to be
|
||||
* handled by the caller).
|
||||
*/
|
||||
protected function applyConsumptionResults(Consumable $consumable) : void{
|
||||
foreach($consumable->getAdditionalEffects() as $effect){
|
||||
$this->addEffect($effect);
|
||||
}
|
||||
|
||||
$consumable->onConsume($this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ class BlockBreakEvent extends BlockEvent implements Cancellable{
|
||||
/**
|
||||
* @param Item[] $drops
|
||||
*/
|
||||
public function __construct(Player $player, Block $block, Item $item, bool $instaBreak = false, array $drops, int $xpDrops = 0){
|
||||
public function __construct(Player $player, Block $block, Item $item, bool $instaBreak = false, array $drops = [], int $xpDrops = 0){
|
||||
parent::__construct($block);
|
||||
$this->item = $item;
|
||||
$this->player = $player;
|
||||
|
@ -53,4 +53,13 @@ class PlayerCursorInventory extends BaseInventory{
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
}
|
||||
|
||||
public function sendContents($target) : void{
|
||||
//TODO: HACK!
|
||||
//Since 1.13, this is now part of a larger "UI inventory", and sending contents for this larger inventory does
|
||||
//not work the way it's intended to. Even if it did, it would be necessary to send all 51 slots just to update
|
||||
//this one, which is just not worth it.
|
||||
//This workaround isn't great, but it's at least simple.
|
||||
$this->sendSlot(0, $target);
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ use pocketmine\inventory\transaction\action\SlotChangeAction;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
use function array_keys;
|
||||
use function array_values;
|
||||
use function assert;
|
||||
use function count;
|
||||
use function get_class;
|
||||
@ -168,6 +169,8 @@ class InventoryTransaction{
|
||||
}
|
||||
}
|
||||
}
|
||||
$needItems = array_values($needItems);
|
||||
$haveItems = array_values($haveItems);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,7 +63,6 @@ abstract class LevelProviderManager{
|
||||
throw new \InvalidArgumentException("Class $class cannot be constructed");
|
||||
}
|
||||
|
||||
/** @var LevelProvider $class */
|
||||
self::$providers[strtolower($class::getProviderName())] = $class;
|
||||
}
|
||||
|
||||
|
@ -183,8 +183,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
if(!$this->levelData->hasTag("generatorOptions", StringTag::class)){
|
||||
$this->levelData->setString("generatorOptions", "");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
}
|
||||
|
||||
public static function getProviderName() : string{
|
||||
@ -269,9 +267,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
$db->put(self::ENTRY_FLAT_WORLD_LAYERS, $out); //Add vanilla flatworld layers to allow terrain generation by MCPE to continue seamlessly
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
}
|
||||
|
||||
public function saveLevelData(){
|
||||
@ -555,6 +550,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
public function close(){
|
||||
$this->db->close();
|
||||
unset($this->db);
|
||||
}
|
||||
}
|
||||
|
@ -27,12 +27,13 @@ use pocketmine\level\format\ChunkException;
|
||||
use pocketmine\level\format\io\exception\CorruptedChunkException;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\Binary;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\BinaryDataException;
|
||||
use pocketmine\utils\BinaryStream;
|
||||
use function assert;
|
||||
use function ceil;
|
||||
use function chr;
|
||||
use function clearstatcache;
|
||||
use function fclose;
|
||||
use function feof;
|
||||
use function file_exists;
|
||||
use function filesize;
|
||||
use function fopen;
|
||||
@ -43,14 +44,12 @@ use function fwrite;
|
||||
use function is_resource;
|
||||
use function ksort;
|
||||
use function max;
|
||||
use function ord;
|
||||
use function pack;
|
||||
use function str_pad;
|
||||
use function str_repeat;
|
||||
use function stream_set_read_buffer;
|
||||
use function stream_set_write_buffer;
|
||||
use function strlen;
|
||||
use function substr;
|
||||
use function time;
|
||||
use function touch;
|
||||
use function unpack;
|
||||
@ -99,6 +98,7 @@ class RegionLoader{
|
||||
* @throws CorruptedRegionException
|
||||
*/
|
||||
public function open(){
|
||||
clearstatcache(false, $this->filePath);
|
||||
$exists = file_exists($this->filePath);
|
||||
if(!$exists){
|
||||
touch($this->filePath);
|
||||
@ -146,37 +146,34 @@ class RegionLoader{
|
||||
|
||||
fseek($this->filePointer, $this->locationTable[$index]->getFirstSector() << 12);
|
||||
|
||||
$prefix = fread($this->filePointer, 4);
|
||||
if($prefix === false or strlen($prefix) !== 4){
|
||||
throw new CorruptedChunkException("Corrupted chunk header detected (unexpected end of file reading length prefix)");
|
||||
}
|
||||
$length = Binary::readInt($prefix);
|
||||
/*
|
||||
* this might cause us to read some junk, but under normal circumstances it won't be any more than 4096 bytes wasted.
|
||||
* doing this in a single call is faster than making two seeks and reads to fetch the chunk.
|
||||
* this relies on the assumption that the end of the file is always padded to a multiple of 4096 bytes.
|
||||
*/
|
||||
$bytesToRead = $this->locationTable[$index]->getSectorCount() << 12;
|
||||
$payload = fread($this->filePointer, $bytesToRead);
|
||||
|
||||
if($length <= 0){ //TODO: if we reached here, the locationTable probably needs updating
|
||||
return null;
|
||||
}
|
||||
if($length > self::MAX_SECTOR_LENGTH){ //corrupted
|
||||
throw new CorruptedChunkException("Length for chunk x=$x,z=$z ($length) is larger than maximum " . self::MAX_SECTOR_LENGTH);
|
||||
if($payload === false || strlen($payload) !== $bytesToRead){
|
||||
throw new CorruptedChunkException("Corrupted chunk detected (unexpected EOF, truncated or non-padded chunk found)");
|
||||
}
|
||||
$stream = new BinaryStream($payload);
|
||||
|
||||
if($length > ($this->locationTable[$index]->getSectorCount() << 12)){ //Invalid chunk, bigger than defined number of sectors
|
||||
MainLogger::getLogger()->error("Chunk x=$x,z=$z length mismatch (expected " . ($this->locationTable[$index]->getSectorCount() << 12) . " sectors, got $length sectors)");
|
||||
$old = $this->locationTable[$index];
|
||||
$this->locationTable[$index] = new RegionLocationTableEntry($old->getFirstSector(), $length >> 12, time());
|
||||
$this->writeLocationIndex($index);
|
||||
}
|
||||
try{
|
||||
$length = $stream->getInt();
|
||||
if($length <= 0){ //TODO: if we reached here, the locationTable probably needs updating
|
||||
return null;
|
||||
}
|
||||
|
||||
$chunkData = fread($this->filePointer, $length);
|
||||
if($chunkData === false or strlen($chunkData) !== $length){
|
||||
throw new CorruptedChunkException("Corrupted chunk detected (unexpected end of file reading chunk data)");
|
||||
}
|
||||
$compression = $stream->getByte();
|
||||
if($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){
|
||||
throw new CorruptedChunkException("Invalid compression type (got $compression, expected " . self::COMPRESSION_ZLIB . " or " . self::COMPRESSION_GZIP . ")");
|
||||
}
|
||||
|
||||
$compression = ord($chunkData[0]);
|
||||
if($compression !== self::COMPRESSION_ZLIB and $compression !== self::COMPRESSION_GZIP){
|
||||
throw new CorruptedChunkException("Invalid compression type (got $compression, expected " . self::COMPRESSION_ZLIB . " or " . self::COMPRESSION_GZIP . ")");
|
||||
return $stream->get($length - 1); //length prefix includes the compression byte
|
||||
}catch(BinaryDataException $e){
|
||||
throw new CorruptedChunkException("Corrupted chunk detected: " . $e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
return substr($chunkData, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,6 +183,23 @@ class RegionLoader{
|
||||
return $this->isChunkGenerated(self::getChunkOffset($x, $z));
|
||||
}
|
||||
|
||||
private function disposeGarbageArea(RegionLocationTableEntry $oldLocation) : void{
|
||||
/* release the area containing the old copy to the garbage pool */
|
||||
$this->garbageTable->add($oldLocation);
|
||||
|
||||
$endGarbage = $this->garbageTable->end();
|
||||
$nextSector = $this->nextSector;
|
||||
for(; $endGarbage !== null and $endGarbage->getLastSector() + 1 === $nextSector; $endGarbage = $this->garbageTable->end()){
|
||||
$nextSector = $endGarbage->getFirstSector();
|
||||
$this->garbageTable->remove($endGarbage);
|
||||
}
|
||||
|
||||
if($nextSector !== $this->nextSector){
|
||||
$this->nextSector = $nextSector;
|
||||
ftruncate($this->filePointer, $this->nextSector << 12);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws ChunkException
|
||||
@ -230,20 +244,7 @@ class RegionLoader{
|
||||
$this->writeLocationIndex($index);
|
||||
|
||||
if($oldLocation !== null){
|
||||
/* release the area containing the old copy to the garbage pool */
|
||||
$this->garbageTable->add($oldLocation);
|
||||
|
||||
$endGarbage = $this->garbageTable->end();
|
||||
$nextSector = $this->nextSector;
|
||||
for(; $endGarbage !== null and $endGarbage->getLastSector() + 1 === $nextSector; $endGarbage = $this->garbageTable->end()){
|
||||
$nextSector = $endGarbage->getFirstSector();
|
||||
$this->garbageTable->remove($endGarbage);
|
||||
}
|
||||
|
||||
if($nextSector !== $this->nextSector){
|
||||
$this->nextSector = $nextSector;
|
||||
ftruncate($this->filePointer, $this->nextSector << 12);
|
||||
}
|
||||
$this->disposeGarbageArea($oldLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,8 +254,12 @@ class RegionLoader{
|
||||
*/
|
||||
public function removeChunk(int $x, int $z){
|
||||
$index = self::getChunkOffset($x, $z);
|
||||
$oldLocation = $this->locationTable[$index];
|
||||
$this->locationTable[$index] = null;
|
||||
$this->writeLocationIndex($index);
|
||||
if($oldLocation !== null){
|
||||
$this->disposeGarbageArea($oldLocation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -336,6 +341,8 @@ class RegionLoader{
|
||||
/** @var int[] $usedOffsets */
|
||||
$usedOffsets = [];
|
||||
|
||||
$fileSize = filesize($this->filePath);
|
||||
if($fileSize === false) throw new AssumptionFailedError("filesize() should not return false here");
|
||||
for($i = 0; $i < 1024; ++$i){
|
||||
$entry = $this->locationTable[$i];
|
||||
if($entry === null){
|
||||
@ -348,8 +355,7 @@ class RegionLoader{
|
||||
|
||||
//TODO: more validity checks
|
||||
|
||||
fseek($this->filePointer, $fileOffset);
|
||||
if(feof($this->filePointer)){
|
||||
if($fileOffset >= $fileSize){
|
||||
throw new CorruptedRegionException("Region file location offset x=$x,z=$z points to invalid file location $fileOffset");
|
||||
}
|
||||
if(isset($usedOffsets[$offset])){
|
||||
@ -402,6 +408,7 @@ class RegionLoader{
|
||||
fwrite($this->filePointer, Binary::writeInt($entry !== null ? ($entry->getFirstSector() << 8) | $entry->getSectorCount() : 0), 4);
|
||||
fseek($this->filePointer, 4096 + ($index << 2));
|
||||
fwrite($this->filePointer, Binary::writeInt($entry !== null ? $entry->getTimestamp() : 0), 4);
|
||||
clearstatcache(false, $this->filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,10 @@ namespace pocketmine\metadata;
|
||||
use pocketmine\plugin\Plugin;
|
||||
|
||||
abstract class MetadataStore{
|
||||
/** @var \SplObjectStorage[]|MetadataValue[][] */
|
||||
/**
|
||||
* @var \SplObjectStorage[]|MetadataValue[][]
|
||||
* @phpstan-var array<string, \SplObjectStorage<Plugin, MetadataValue>>
|
||||
*/
|
||||
private $metadataMap;
|
||||
|
||||
/**
|
||||
@ -41,6 +44,7 @@ abstract class MetadataStore{
|
||||
$owningPlugin = $newMetadataValue->getOwningPlugin();
|
||||
|
||||
if(!isset($this->metadataMap[$key])){
|
||||
/** @phpstan-var \SplObjectStorage<Plugin, MetadataValue> $entry */
|
||||
$entry = new \SplObjectStorage();
|
||||
$this->metadataMap[$key] = $entry;
|
||||
}else{
|
||||
@ -92,7 +96,6 @@ abstract class MetadataStore{
|
||||
* @return void
|
||||
*/
|
||||
public function invalidateAll(Plugin $owningPlugin){
|
||||
/** @var \SplObjectStorage|MetadataValue[] $values */
|
||||
foreach($this->metadataMap as $values){
|
||||
if(isset($values[$owningPlugin])){
|
||||
$values[$owningPlugin]->invalidate();
|
||||
|
@ -84,7 +84,6 @@ class CraftingDataPacket extends DataPacket{
|
||||
case self::ENTRY_SHAPELESS_CHEMISTRY:
|
||||
$entry["recipe_id"] = $this->getString();
|
||||
$ingredientCount = $this->getUnsignedVarInt();
|
||||
/** @var Item */
|
||||
$entry["input"] = [];
|
||||
for($j = 0; $j < $ingredientCount; ++$j){
|
||||
$entry["input"][] = $in = $this->getRecipeIngredient();
|
||||
|
@ -44,6 +44,7 @@ class ResourcePackClientResponsePacket extends DataPacket{
|
||||
protected function decodePayload(){
|
||||
$this->status = $this->getByte();
|
||||
$entryCount = $this->getLShort();
|
||||
$this->packIds = [];
|
||||
while($entryCount-- > 0){
|
||||
$this->packIds[] = $this->getString();
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
|
||||
|
||||
use pocketmine\network\mcpe\NetworkBinaryStream;
|
||||
|
||||
/**
|
||||
* Renames an item in an anvil, or map on a cartography table.
|
||||
*/
|
||||
final class CraftRecipeOptionalStackRequestAction extends ItemStackRequestAction{
|
||||
|
||||
/** @var int */
|
||||
private $recipeId;
|
||||
/** @var int */
|
||||
private $filterStringIndex;
|
||||
|
||||
public function __construct(int $type, int $filterStringIndex){
|
||||
$this->recipeId = $type;
|
||||
$this->filterStringIndex = $filterStringIndex;
|
||||
}
|
||||
|
||||
public function getRecipeId() : int{ return $this->recipeId; }
|
||||
|
||||
public function getFilterStringIndex() : int{ return $this->filterStringIndex; }
|
||||
|
||||
public static function getTypeId() : int{ return ItemStackRequestActionType::CRAFTING_RECIPE_OPTIONAL; }
|
||||
|
||||
public static function read(NetworkBinaryStream $in) : self{
|
||||
$recipeId = $in->readGenericTypeNetworkId();
|
||||
$filterStringIndex = $in->getLInt();
|
||||
return new self($recipeId, $filterStringIndex);
|
||||
}
|
||||
|
||||
public function write(NetworkBinaryStream $out) : void{
|
||||
$out->writeGenericTypeNetworkId($this->recipeId);
|
||||
$out->putLInt($this->filterStringIndex);
|
||||
}
|
||||
}
|
@ -32,13 +32,21 @@ final class ItemStackRequest{
|
||||
private $requestId;
|
||||
/** @var ItemStackRequestAction[] */
|
||||
private $actions;
|
||||
/**
|
||||
* @var string[]
|
||||
* @phpstan-var list<string>
|
||||
*/
|
||||
private $filterStrings;
|
||||
|
||||
/**
|
||||
* @param ItemStackRequestAction[] $actions
|
||||
* @param string[] $filterStrings
|
||||
* @phpstan-param list<string> $filterStrings
|
||||
*/
|
||||
public function __construct(int $requestId, array $actions){
|
||||
public function __construct(int $requestId, array $actions, array $filterStrings){
|
||||
$this->requestId = $requestId;
|
||||
$this->actions = $actions;
|
||||
$this->filterStrings = $filterStrings;
|
||||
}
|
||||
|
||||
public function getRequestId() : int{ return $this->requestId; }
|
||||
@ -46,6 +54,12 @@ final class ItemStackRequest{
|
||||
/** @return ItemStackRequestAction[] */
|
||||
public function getActions() : array{ return $this->actions; }
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @phpstan-return list<string>
|
||||
*/
|
||||
public function getFilterStrings() : array{ return $this->filterStrings; }
|
||||
|
||||
private static function readAction(NetworkBinaryStream $in, int $typeId) : ItemStackRequestAction{
|
||||
switch($typeId){
|
||||
case TakeStackRequestAction::getTypeId(): return TakeStackRequestAction::read($in);
|
||||
@ -60,6 +74,7 @@ final class ItemStackRequest{
|
||||
case CraftRecipeStackRequestAction::getTypeId(): return CraftRecipeStackRequestAction::read($in);
|
||||
case CraftRecipeAutoStackRequestAction::getTypeId(): return CraftRecipeAutoStackRequestAction::read($in);
|
||||
case CreativeCreateStackRequestAction::getTypeId(): return CreativeCreateStackRequestAction::read($in);
|
||||
case CraftRecipeOptionalStackRequestAction::getTypeId(): return CraftRecipeOptionalStackRequestAction::read($in);
|
||||
case DeprecatedCraftingNonImplementedStackRequestAction::getTypeId(): return DeprecatedCraftingNonImplementedStackRequestAction::read($in);
|
||||
case DeprecatedCraftingResultsStackRequestAction::getTypeId(): return DeprecatedCraftingResultsStackRequestAction::read($in);
|
||||
}
|
||||
@ -73,7 +88,11 @@ final class ItemStackRequest{
|
||||
$typeId = $in->getByte();
|
||||
$actions[] = self::readAction($in, $typeId);
|
||||
}
|
||||
return new self($requestId, $actions);
|
||||
$filterStrings = [];
|
||||
for($i = 0, $len = $in->getUnsignedVarInt(); $i < $len; ++$i){
|
||||
$filterStrings[] = $in->getString();
|
||||
}
|
||||
return new self($requestId, $actions, $filterStrings);
|
||||
}
|
||||
|
||||
public function write(NetworkBinaryStream $out) : void{
|
||||
@ -83,5 +102,9 @@ final class ItemStackRequest{
|
||||
$out->putByte($action::getTypeId());
|
||||
$action->write($out);
|
||||
}
|
||||
$out->putUnsignedVarInt(count($this->filterStrings));
|
||||
foreach($this->filterStrings as $string){
|
||||
$out->putString($string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ final class ItemStackRequestActionType{
|
||||
public const CRAFTING_RECIPE = 9;
|
||||
public const CRAFTING_RECIPE_AUTO = 10; //recipe book?
|
||||
public const CREATIVE_CREATE = 11;
|
||||
public const CRAFTING_NON_IMPLEMENTED_DEPRECATED_ASK_TY_LAING = 12; //anvils aren't fully implemented yet
|
||||
public const CRAFTING_RESULTS_DEPRECATED_ASK_TY_LAING = 13; //no idea what this is for
|
||||
public const CRAFTING_RECIPE_OPTIONAL = 12; //anvil/cartography table rename
|
||||
public const CRAFTING_NON_IMPLEMENTED_DEPRECATED_ASK_TY_LAING = 13;
|
||||
public const CRAFTING_RESULTS_DEPRECATED_ASK_TY_LAING = 14; //no idea what this is for
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class RCONInstance extends Thread{
|
||||
* @param resource $socket
|
||||
* @param resource $ipcSocket
|
||||
*/
|
||||
public function __construct($socket, string $password, int $maxClients = 50, \ThreadedLogger $logger, $ipcSocket, ?SleeperNotifier $notifier){
|
||||
public function __construct($socket, string $password, int $maxClients, \ThreadedLogger $logger, $ipcSocket, ?SleeperNotifier $notifier){
|
||||
$this->stop = false;
|
||||
$this->cmd = "";
|
||||
$this->response = "";
|
||||
|
@ -701,9 +701,18 @@ class PluginManager{
|
||||
}
|
||||
|
||||
$handlerClosure = $method->getClosure($listener);
|
||||
if($handlerClosure === null) throw new AssumptionFailedError("This should never happen");
|
||||
|
||||
try{
|
||||
$eventClass = $parameters[0]->getClass();
|
||||
$paramType = $parameters[0]->getType();
|
||||
//isBuiltin() returns false for builtin classes ..................
|
||||
if($paramType instanceof \ReflectionNamedType && !$paramType->isBuiltin()){
|
||||
/** @phpstan-var class-string $paramClass */
|
||||
$paramClass = $paramType->getName();
|
||||
$eventClass = new \ReflectionClass($paramClass);
|
||||
}else{
|
||||
$eventClass = null;
|
||||
}
|
||||
}catch(\ReflectionException $e){ //class doesn't exist
|
||||
if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){
|
||||
$this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "() because plugin \"" . $tags["softDepend"] . "\" not found");
|
||||
|
@ -100,6 +100,9 @@ debug:
|
||||
player:
|
||||
#Choose whether to enable player data saving.
|
||||
save-player-data: true
|
||||
#If true, checks that joining players' Xbox user ID (XUID) match what was previously recorded.
|
||||
#This also prevents non-XBL players using XBL players' usernames to steal their data on servers with xbox-auth=off.
|
||||
verify-xuid: true
|
||||
anti-cheat:
|
||||
#If false, will try to prevent speed and noclip cheats. May cause movement issues.
|
||||
allow-movement-cheats: true
|
||||
|
@ -51,6 +51,7 @@ use function unserialize;
|
||||
abstract class AsyncTask extends Collectable{
|
||||
/**
|
||||
* @var \SplObjectStorage|null
|
||||
* @phpstan-var \SplObjectStorage<AsyncTask, mixed>
|
||||
* Used to store objects on the main thread which should not be serialized.
|
||||
*/
|
||||
private static $threadLocalStorage;
|
||||
@ -258,7 +259,9 @@ abstract class AsyncTask extends Collectable{
|
||||
}
|
||||
|
||||
if(self::$threadLocalStorage === null){
|
||||
self::$threadLocalStorage = new \SplObjectStorage(); //lazy init
|
||||
/** @phpstan-var \SplObjectStorage<AsyncTask, mixed> $storage */
|
||||
$storage = new \SplObjectStorage();
|
||||
self::$threadLocalStorage = $storage; //lazy init
|
||||
}
|
||||
|
||||
if(isset(self::$threadLocalStorage[$this])){
|
||||
|
@ -278,8 +278,10 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
* @return void
|
||||
*/
|
||||
public function shutdown(){
|
||||
$this->shutdown = true;
|
||||
$this->notify();
|
||||
$this->synchronized(function() : void{
|
||||
$this->shutdown = true;
|
||||
$this->notify();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -321,6 +323,7 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
}
|
||||
|
||||
$this->logStream[] = $time->format("Y-m-d") . " " . TextFormat::clean($message) . PHP_EOL;
|
||||
$this->notify();
|
||||
});
|
||||
}
|
||||
|
||||
@ -343,14 +346,17 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
*/
|
||||
private function writeLogStream($logResource) : void{
|
||||
while($this->logStream->count() > 0){
|
||||
/** @var string $chunk */
|
||||
$chunk = $this->logStream->shift();
|
||||
fwrite($logResource, $chunk);
|
||||
}
|
||||
|
||||
if($this->syncFlush){
|
||||
$this->syncFlush = false;
|
||||
$this->notify(); //if this was due to a sync flush, tell the caller to stop waiting
|
||||
}
|
||||
$this->synchronized(function() : void{
|
||||
if($this->syncFlush){
|
||||
$this->syncFlush = false;
|
||||
$this->notify(); //if this was due to a sync flush, tell the caller to stop waiting
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -365,7 +371,9 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
while(!$this->shutdown){
|
||||
$this->writeLogStream($logResource);
|
||||
$this->synchronized(function() : void{
|
||||
$this->wait(25000);
|
||||
if(!$this->shutdown){
|
||||
$this->wait();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,8 @@ class Utils{
|
||||
/**
|
||||
* Generates an unique identifier to a callable
|
||||
*
|
||||
* @phpstan-param anyCallable $variable
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getCallableIdentifier(callable $variable){
|
||||
@ -132,6 +134,7 @@ class Utils{
|
||||
/**
|
||||
* Returns a readable identifier for the given Closure, including file and line.
|
||||
*
|
||||
* @phpstan-param anyClosure $closure
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function getNiceClosureName(\Closure $closure) : string{
|
||||
@ -685,6 +688,8 @@ class Utils{
|
||||
*
|
||||
* @param callable $signature Dummy callable with the required parameters and return type
|
||||
* @param callable $subject Callable to check the signature of
|
||||
* @phpstan-param anyCallable $signature
|
||||
* @phpstan-param anyCallable $subject
|
||||
*
|
||||
* @throws \DaveRandom\CallbackValidator\InvalidCallbackException
|
||||
* @throws \TypeError
|
||||
|
@ -1,4 +1,5 @@
|
||||
VERSION=7.4.13
|
||||
VERSION="$1"
|
||||
|
||||
sudo apt update && sudo apt install -y \
|
||||
re2c \
|
||||
libtool \
|
||||
@ -11,44 +12,15 @@ sudo apt update && sudo apt install -y \
|
||||
libzip-dev \
|
||||
libssl-dev
|
||||
|
||||
curl -sSL https://www.php.net/distributions/php-$VERSION.tar.gz | tar -xz
|
||||
|
||||
INSTALL_DIR="$(pwd)/bin/php7"
|
||||
cd php-$VERSION
|
||||
cd ext/
|
||||
curl -sSL https://github.com/pmmp/pthreads/archive/2bcd8b8c10395d58b8a9bc013e3a5328080c867f.tar.gz | tar -xz
|
||||
curl -sSL https://github.com/php/pecl-file_formats-yaml/archive/2.2.0.tar.gz | tar -xz
|
||||
cd ..
|
||||
|
||||
CFLAGS="$CFLAGS -march=x86-64"
|
||||
CXXFLAGS="$CXXFLAGS -march=x86-64"
|
||||
export CFLAGS="$CFLAGS -march=x86-64"
|
||||
export CXXFLAGS="$CXXFLAGS -march=x86-64"
|
||||
|
||||
./buildconf --force
|
||||
./configure \
|
||||
--prefix="$INSTALL_DIR" \
|
||||
--exec-prefix="$INSTALL_DIR" \
|
||||
--enable-maintainer-zts \
|
||||
--enable-cli \
|
||||
--disable-cgi \
|
||||
--disable-phpdbg \
|
||||
--disable-mbregex \
|
||||
--disable-pdo \
|
||||
--disable-session \
|
||||
--enable-mbstring \
|
||||
--enable-pthreads \
|
||||
--enable-simplexml \
|
||||
--enable-sockets \
|
||||
--enable-xml \
|
||||
--enable-xmlreader \
|
||||
--enable-xmlwriter \
|
||||
--with-curl \
|
||||
--with-gmp \
|
||||
--with-libxml \
|
||||
--with-openssl \
|
||||
--with-yaml \
|
||||
--with-zip \
|
||||
--with-zlib \
|
||||
--without-pear \
|
||||
--without-sqlite3
|
||||
|
||||
make -j8 install
|
||||
git clone https://github.com/php-build/php-build.git
|
||||
cd php-build
|
||||
./install-dependencies.sh
|
||||
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
|
||||
PHP_BUILD_INSTALL_EXTENSION='pthreads=@acc6e52b2144c61c434b62a3cb680d537e06828e yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
|
||||
rm "$INSTALL_DIR/etc/conf.d/xdebug.ini" || true
|
||||
cp install-dependencies.sh "$INSTALL_DIR"
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
define('pocketmine\_PHPSTAN_ANALYSIS', true);
|
||||
|
||||
if(!defined('LEVELDB_ZLIB_RAW_COMPRESSION')){
|
||||
//leveldb might not be loaded
|
||||
define('LEVELDB_ZLIB_RAW_COMPRESSION', 4);
|
||||
|
@ -745,6 +745,11 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/level/generator/normal/Normal.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\metadata\\\\MetadataStore\\:\\:getMetadataInternal\\(\\) should return array\\<pocketmine\\\\metadata\\\\MetadataValue\\> but returns SplObjectStorage\\<pocketmine\\\\plugin\\\\Plugin, pocketmine\\\\metadata\\\\MetadataValue\\>\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/metadata/MetadataStore.php
|
||||
|
||||
-
|
||||
message: "#^Variable method call on pocketmine\\\\event\\\\Listener\\.$#"
|
||||
count: 1
|
||||
|
@ -45,6 +45,31 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$str of function base64_decode expects string, mixed given\\.$#"
|
||||
count: 5
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$height of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinImage constructor expects int, mixed given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$width of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinImage constructor expects int, mixed given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#8 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#9 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#10 \\$personaCapeOnClassic of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
@ -65,31 +90,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#8 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#9 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$str of function base64_decode expects string, mixed given\\.$#"
|
||||
count: 5
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$height of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinImage constructor expects int, mixed given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$width of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinImage constructor expects int, mixed given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/Player.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\.\\.\\.\\$slots of method pocketmine\\\\inventory\\\\BaseInventory\\:\\:addItem\\(\\) expects pocketmine\\\\item\\\\Item, mixed given\\.$#"
|
||||
count: 1
|
||||
@ -275,11 +275,6 @@ parameters:
|
||||
count: 6
|
||||
path: ../../../src/pocketmine/level/generator/noise/Noise.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method invalidate\\(\\) on mixed\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/metadata/MetadataStore.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$buffer of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\BatchPacket constructor expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
@ -450,11 +445,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/protocol/SetActorDataPacket.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$table of static method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\StartGamePacket\\:\\:serializeItemTable\\(\\) expects array\\<string, int\\>, mixed given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/protocol/StartGamePacket.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$value of static method pocketmine\\\\permission\\\\Permission\\:\\:getByName\\(\\) expects bool\\|string, mixed given\\.$#"
|
||||
count: 1
|
||||
|
@ -60,16 +60,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$filename of function is_file expects string, array\\<int, mixed\\>\\|string given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Binary operation \"\\.\" between 'Composer autoloader…' and array\\<int, mixed\\>\\|string\\|false results in an error\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Binary operation \"\\.\" between array\\<int, mixed\\>\\|string\\|false and '/'\\|'\\\\\\\\' results in an error\\.$#"
|
||||
count: 2
|
||||
@ -80,36 +70,6 @@ parameters:
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function flock expects resource, resource\\|false given\\.$#"
|
||||
count: 4
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$source of function stream_get_contents expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function ftruncate expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function fflush expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$buffer of method pocketmine\\\\nbt\\\\NBTStream\\:\\:readCompressed\\(\\) expects string, string\\|false given\\.$#"
|
||||
count: 1
|
||||
@ -155,51 +115,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Cactus.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Farmland.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Farmland.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Farmland.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockIdAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$min of function mt_rand expects int, float\\|int given\\.$#"
|
||||
count: 3
|
||||
@ -210,36 +125,6 @@ parameters:
|
||||
count: 3
|
||||
path: ../../../src/pocketmine/block/Grass.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getHighestAdjacentBlockLight\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Ice.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getHighestAdjacentBlockLight\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Ice.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getHighestAdjacentBlockLight\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Ice.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 23
|
||||
path: ../../../src/pocketmine/block/Liquid.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 23
|
||||
path: ../../../src/pocketmine/block/Liquid.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 23
|
||||
path: ../../../src/pocketmine/block/Liquid.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of static method pocketmine\\\\level\\\\Level\\:\\:blockHash\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 3
|
||||
@ -295,36 +180,6 @@ parameters:
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/block/Sapling.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Sapling.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Sapling.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Sapling.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/SnowLayer.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/SnowLayer.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/SnowLayer.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 2
|
||||
@ -400,21 +255,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/entity/Human.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/entity/Living.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/entity/Living.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/entity/Living.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
@ -435,21 +275,6 @@ parameters:
|
||||
count: 3
|
||||
path: ../../../src/pocketmine/entity/projectile/Projectile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/entity/projectile/Projectile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/entity/projectile/Projectile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 2
|
||||
path: ../../../src/pocketmine/entity/projectile/Projectile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class\\-string\\<T of object\\>\\|T of object, string given\\.$#"
|
||||
count: 1
|
||||
@ -685,11 +510,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/level/Level.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\format\\\\Chunk\\:\\:setBlock\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/level/Level.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of static method pocketmine\\\\level\\\\Level\\:\\:chunkBlockHash\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
@ -770,16 +590,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/level/generator/object/TallGrass.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\metadata\\\\MetadataStore\\:\\:getMetadataInternal\\(\\) should return array\\<pocketmine\\\\metadata\\\\MetadataValue\\> but returns array\\<pocketmine\\\\metadata\\\\MetadataValue\\>\\|SplObjectStorage\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/metadata/MetadataStore.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method count\\(\\) on array\\<pocketmine\\\\metadata\\\\MetadataValue\\>\\|SplObjectStorage\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/metadata/MetadataStore.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$str of method pocketmine\\\\utils\\\\BinaryStream\\:\\:put\\(\\) expects string, string\\|false given\\.$#"
|
||||
count: 2
|
||||
@ -985,18 +795,3 @@ parameters:
|
||||
count: 3
|
||||
path: ../../../src/pocketmine/tile/Tile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/tile/Tile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/tile/Tile.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\level\\\\Level\\:\\:getBlockAt\\(\\) expects int, float\\|int given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/tile/Tile.php
|
||||
|
||||
|
@ -1445,11 +1445,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/convert/RuntimeBlockMapping.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$that of method pocketmine\\\\nbt\\\\tag\\\\NamedTag\\:\\:equals\\(\\) expects pocketmine\\\\nbt\\\\tag\\\\NamedTag, pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/convert/RuntimeBlockMapping.php
|
||||
|
||||
-
|
||||
message: "#^Method pocketmine\\\\network\\\\mcpe\\\\convert\\\\RuntimeBlockMapping\\:\\:getBedrockKnownStates\\(\\) should return array\\<pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\> but returns array\\<pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\>\\|null\\.$#"
|
||||
count: 1
|
||||
@ -1485,11 +1480,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/plugin/PluginBase.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$closure of static method pocketmine\\\\utils\\\\Utils\\:\\:getNiceClosureName\\(\\) expects Closure, Closure\\|null given\\.$#"
|
||||
count: 3
|
||||
path: ../../../src/pocketmine/plugin/PluginManager.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method handleException\\(\\) on pocketmine\\\\scheduler\\\\AsyncWorker\\|null\\.$#"
|
||||
count: 1
|
||||
|
@ -1,15 +1,5 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Comparison operation \"\\>\\=\" between 0 and 2 is always false\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Liquid.php
|
||||
|
||||
-
|
||||
message: "#^If condition is always false\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/block/Liquid.php
|
||||
|
||||
-
|
||||
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
|
||||
count: 3
|
||||
|
@ -115,4 +115,19 @@ class RegionLoaderTest extends TestCase{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->region->readChunk($x, $z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that cached filesize() values don't break validation of region headers
|
||||
*/
|
||||
public function testRegionHeaderCachedFilesizeRegression() : void{
|
||||
$this->region->close();
|
||||
$region = new RegionLoader($this->regionPath, 0, 0); //now we have a region, so the header will be verified, triggering two filesize() calls
|
||||
$region->open();
|
||||
$data = str_repeat("hello", 2000);
|
||||
$region->writeChunk(0, 0, $data); //add some data to the end of the file, to make the cached filesize invalid
|
||||
$region->close();
|
||||
$region = new RegionLoader($this->regionPath, 0, 0);
|
||||
$region->open();
|
||||
self::assertSame($data, $region->readChunk(0, 0));
|
||||
}
|
||||
}
|
||||
|
37
tests/phpunit/network/mcpe/protocol/ProtocolInfoTest.php
Normal file
37
tests/phpunit/network/mcpe/protocol/ProtocolInfoTest.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\protocol;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class ProtocolInfoTest extends TestCase{
|
||||
|
||||
public function testMinecraftVersionNetwork() : void{
|
||||
self::assertMatchesRegularExpression(
|
||||
'/^(?:\d+\.)?(?:\d+\.)?(?:\d+\.)?\d+$/',
|
||||
ProtocolInfo::MINECRAFT_VERSION_NETWORK,
|
||||
"Network version should only contain 0-9 and \".\", and no more than 4 groups of digits"
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user