From 892bd505798892a8b8e8eebc596c0e97a83b4875 Mon Sep 17 00:00:00 2001 From: AzaleeX Date: Sun, 3 Dec 2023 16:46:09 +0100 Subject: [PATCH] Merge of the next-dev branch with the stable branch (#18) * add symply.yml config * set to Symply name * add support native waterdogpe in symply and fix system symply.yml * fix php-cs-fixer and add new rule * oups no commit rules for php-cs-fixer * fix rules and add support multi rules * fix rules for pmmp * fix finder for exclude file * fix cs --------- Signed-off-by: AzaleeX Co-authored-by: Vuillamier Lilian <33796736+Virvolta@users.noreply.github.com> Co-authored-by: Sensei Tarzan --- .github/workflows/main.yml | 7 +- .gitignore | 2 + .idea/codeStyles/Project.xml | 83 - .idea/codeStyles/codeStyleConfig.xml | 5 - .idea/fileTemplates/code/PHP Constructor.php | 8 - .../code/PHP Fluent Setter Method.php | 6 - .../fileTemplates/code/PHP Getter Method.php | 3 - .../fileTemplates/code/PHP Setter Method.php | 2 - .../includes/PHP Class Doc Comment.php | 0 .../includes/PHP File Header.php | 21 - .../includes/PHP Function Doc Comment.php | 5 - .../includes/PHP Interface Doc Comment.php | 0 .../includes/PHP Property Doc Comment.php | 1 - .../includes/PHP Trait Doc Comment.php | 0 .idea/fileTemplates/internal/PHP Class.php | 10 - .idea/fileTemplates/internal/PHP File.php | 4 - .../fileTemplates/internal/PHP Interface.php | 10 - .idea/fileTemplates/internal/PHP Trait.php | 10 - .php-cs-fixer-symply.php | 121 ++ .php-cs-fixer.php | 4 +- build/server-phar.php | 5 +- .../generate-symply-yml-property-consts.php | 126 ++ composer.json | 6 +- composer.lock | 1653 ++++++++++++++++- resources/symply.yml | 8 + src/PocketMine.php | 1 - src/Server.php | 19 +- src/ServerConfigGroup.php | 17 + src/VersionInfo.php | 4 +- src/crash/CrashDumpData.php | 4 + src/network/mcpe/NetworkSession.php | 7 +- .../mcpe/handler/LoginPacketHandler.php | 42 +- start.sh | 4 +- symply/YmlSymplyProperties.php | 43 + symply/waterdogpe/WDPEClientData.php | 168 ++ .../WDPEClientDataAnimationFrame.php | 51 + .../WDPEClientDataPersonaPieceTintColor.php | 41 + .../WDPEClientDataPersonaSkinPiece.php | 47 + .../WDPEClientDataToSkinDataHelper.php | 96 + symply/waterdogpe/WDPEPlayerInfo.php | 64 + 40 files changed, 2450 insertions(+), 258 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/fileTemplates/code/PHP Constructor.php delete mode 100644 .idea/fileTemplates/code/PHP Fluent Setter Method.php delete mode 100644 .idea/fileTemplates/code/PHP Getter Method.php delete mode 100644 .idea/fileTemplates/code/PHP Setter Method.php delete mode 100644 .idea/fileTemplates/includes/PHP Class Doc Comment.php delete mode 100644 .idea/fileTemplates/includes/PHP File Header.php delete mode 100644 .idea/fileTemplates/includes/PHP Function Doc Comment.php delete mode 100644 .idea/fileTemplates/includes/PHP Interface Doc Comment.php delete mode 100644 .idea/fileTemplates/includes/PHP Property Doc Comment.php delete mode 100644 .idea/fileTemplates/includes/PHP Trait Doc Comment.php delete mode 100644 .idea/fileTemplates/internal/PHP Class.php delete mode 100644 .idea/fileTemplates/internal/PHP File.php delete mode 100644 .idea/fileTemplates/internal/PHP Interface.php delete mode 100644 .idea/fileTemplates/internal/PHP Trait.php create mode 100644 .php-cs-fixer-symply.php create mode 100644 build/symply/generate-symply-yml-property-consts.php create mode 100644 resources/symply.yml create mode 100644 symply/YmlSymplyProperties.php create mode 100644 symply/waterdogpe/WDPEClientData.php create mode 100644 symply/waterdogpe/WDPEClientDataAnimationFrame.php create mode 100644 symply/waterdogpe/WDPEClientDataPersonaPieceTintColor.php create mode 100644 symply/waterdogpe/WDPEClientDataPersonaSkinPiece.php create mode 100644 symply/waterdogpe/WDPEClientDataToSkinDataHelper.php create mode 100644 symply/waterdogpe/WDPEPlayerInfo.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0fd49a7d5a..7c3e79bd066 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -180,5 +180,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Run PHP-CS-Fixer - run: php-cs-fixer fix --dry-run --diff --ansi \ No newline at end of file + - name: Run PHP-CS-Fixer PMMP + run: "rm -fr .php-cs-fixer.cache && php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff --ansi" + + - name: Run PHP-CS-Fixer SYMPLY + run: "rm -fr .php-cs-fixer.cache && php-cs-fixer fix --config=.php-cs-fixer-symply.php --dry-run --diff --ansi" diff --git a/.gitignore b/.gitignore index 13c3473764f..aea6da2ecd3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ crashdumps/* *.phar server.properties /pocketmine.yml +/symply.yml /plugin_list.yml memory_dumps/* resource_packs/ @@ -53,3 +54,4 @@ Documentation/* # php-cs-fixer /.php_cs.cache /.php-cs-fixer.cache +/server/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 466a1a3a409..00000000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123c2b2..00000000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/fileTemplates/code/PHP Constructor.php b/.idea/fileTemplates/code/PHP Constructor.php deleted file mode 100644 index 0f6384d97e8..00000000000 --- a/.idea/fileTemplates/code/PHP Constructor.php +++ /dev/null @@ -1,8 +0,0 @@ -#if(${THROWS_DOC} != "") -/** -${THROWS_DOC} -*/ -#end -public function __construct(${PARAM_LIST}) { -${BODY} -} \ No newline at end of file diff --git a/.idea/fileTemplates/code/PHP Fluent Setter Method.php b/.idea/fileTemplates/code/PHP Fluent Setter Method.php deleted file mode 100644 index a46d3050472..00000000000 --- a/.idea/fileTemplates/code/PHP Fluent Setter Method.php +++ /dev/null @@ -1,6 +0,0 @@ -/** @return $this */ -public function set${NAME}(#if (${SCALAR_TYPE_HINT})${SCALAR_TYPE_HINT} #else#end$${PARAM_NAME})#if(${RETURN_TYPE}): self#else#end -{ - $this->${FIELD_NAME} = $${PARAM_NAME}; - return $this; -} diff --git a/.idea/fileTemplates/code/PHP Getter Method.php b/.idea/fileTemplates/code/PHP Getter Method.php deleted file mode 100644 index 4193590271e..00000000000 --- a/.idea/fileTemplates/code/PHP Getter Method.php +++ /dev/null @@ -1,3 +0,0 @@ -#if(${TYPE_HINT} != ${RETURN_TYPE} && ${TYPE_HINT} != "")/** @return ${TYPE_HINT} */#end -public ${STATIC} function ${GET_OR_IS}${NAME}()#if(${RETURN_TYPE}): ${RETURN_TYPE}#else#end -{ return #if(${STATIC} == "static")self::$${FIELD_NAME};#else$this->${FIELD_NAME};#end } diff --git a/.idea/fileTemplates/code/PHP Setter Method.php b/.idea/fileTemplates/code/PHP Setter Method.php deleted file mode 100644 index 2ded807f6a0..00000000000 --- a/.idea/fileTemplates/code/PHP Setter Method.php +++ /dev/null @@ -1,2 +0,0 @@ -public ${STATIC} function set${NAME}(#if (${SCALAR_TYPE_HINT})${SCALAR_TYPE_HINT} #end$${PARAM_NAME})#if (${VOID_RETURN_TYPE}):void #end -{#if (${STATIC} == "static") self::$${FIELD_NAME} = $${PARAM_NAME}; #else $this->${FIELD_NAME} = $${PARAM_NAME}; #end} diff --git a/.idea/fileTemplates/includes/PHP Class Doc Comment.php b/.idea/fileTemplates/includes/PHP Class Doc Comment.php deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.idea/fileTemplates/includes/PHP File Header.php b/.idea/fileTemplates/includes/PHP File Header.php deleted file mode 100644 index db6ec1e1339..00000000000 --- a/.idea/fileTemplates/includes/PHP File Header.php +++ /dev/null @@ -1,21 +0,0 @@ - -/* - * - * ____ _ _ __ __ _ __ __ ____ - * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \ - * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) | - * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/ - * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_| - * - * 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); \ No newline at end of file diff --git a/.idea/fileTemplates/includes/PHP Function Doc Comment.php b/.idea/fileTemplates/includes/PHP Function Doc Comment.php deleted file mode 100644 index 8b993824502..00000000000 --- a/.idea/fileTemplates/includes/PHP Function Doc Comment.php +++ /dev/null @@ -1,5 +0,0 @@ -#if (${THROWS_DOC} != "") -/** -${THROWS_DOC} -*/ -#end \ No newline at end of file diff --git a/.idea/fileTemplates/includes/PHP Interface Doc Comment.php b/.idea/fileTemplates/includes/PHP Interface Doc Comment.php deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.idea/fileTemplates/includes/PHP Property Doc Comment.php b/.idea/fileTemplates/includes/PHP Property Doc Comment.php deleted file mode 100644 index 59487962820..00000000000 --- a/.idea/fileTemplates/includes/PHP Property Doc Comment.php +++ /dev/null @@ -1 +0,0 @@ -/** @var ${TYPE_HINT} */ diff --git a/.idea/fileTemplates/includes/PHP Trait Doc Comment.php b/.idea/fileTemplates/includes/PHP Trait Doc Comment.php deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.idea/fileTemplates/internal/PHP Class.php b/.idea/fileTemplates/internal/PHP Class.php deleted file mode 100644 index dc7d13b6b61..00000000000 --- a/.idea/fileTemplates/internal/PHP Class.php +++ /dev/null @@ -1,10 +0,0 @@ -in(__DIR__ . '/symply') + ->in(__DIR__ . '/build/symply'); + +return (new PhpCsFixer\Config) + ->setRiskyAllowed(true) + + ->setRules([ + 'align_multiline_comment' => [ + 'comment_type' => 'phpdocs_only' + ], + 'array_indentation' => true, + 'array_syntax' => [ + 'syntax' => 'short' + ], + 'binary_operator_spaces' => [ + 'default' => 'single_space' + ], + 'blank_line_after_namespace' => true, + 'blank_line_after_opening_tag' => true, + 'blank_line_before_statement' => [ + 'statements' => [ + 'declare' + ] + ], + 'cast_spaces' => [ + 'space' => 'single' + ], + 'concat_space' => [ + 'spacing' => 'one' + ], + 'declare_strict_types' => true, + 'elseif' => true, + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => [ + 'import_constants' => true, + 'import_functions' => true, + 'import_classes' => null, + ], + 'header_comment' => [ + 'comment_type' => 'comment', + 'header' => << 'after_open' + ], + 'indentation_type' => true, + 'logical_operators' => true, + 'native_constant_invocation' => [ + 'scope' => 'namespaced' + ], + 'native_function_invocation' => [ + 'scope' => 'namespaced', + 'include' => ['@all'], + ], + 'new_with_braces' => [ + 'named_class' => true, + 'anonymous_class' => false, + ], + 'no_closing_tag' => true, + 'no_empty_phpdoc' => true, + 'no_extra_blank_lines' => true, + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + ], + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => true, + 'no_whitespace_in_blank_line' => true, + 'no_unused_imports' => true, + 'ordered_imports' => [ + 'imports_order' => [ + 'class', + 'function', + 'const', + ], + 'sort_algorithm' => 'alpha' + ], + 'phpdoc_align' => [ + 'align' => 'vertical', + 'tags' => [ + 'param', + ] + ], + 'phpdoc_line_span' => [ + 'property' => 'single', + 'method' => null, + 'const' => null + ], + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'return_type_declaration' => [ + 'space_before' => 'one' + ], + 'single_blank_line_at_eof' => true, + 'single_import_per_statement' => true, + 'strict_param' => true, + 'unary_operator_spaces' => true, + ]) + ->setFinder($finder) + ->setIndent("\t") + ->setLineEnding("\n"); diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 32af1ef4815..628b44fc245 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -5,8 +5,10 @@ ->in(__DIR__ . '/build') ->in(__DIR__ . '/tests') ->in(__DIR__ . '/tools') + ->exclude( __DIR__ . '/symply') ->notPath('plugins/DevTools') - ->notName('PocketMine.php'); + ->notName('PocketMine.php') + ->notName('generate-symply-yml-property-consts.php'); return (new PhpCsFixer\Config) ->setRiskyAllowed(true) diff --git a/build/server-phar.php b/build/server-phar.php index 0665c89d5d9..d69589f60e4 100644 --- a/build/server-phar.php +++ b/build/server-phar.php @@ -148,12 +148,13 @@ function main() : void{ $build = 0; } foreach(buildPhar( - $opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "PocketMine-MP.phar", + $opts["out"] ?? getcwd() . DIRECTORY_SEPARATOR . "Symply.phar", dirname(__DIR__) . DIRECTORY_SEPARATOR, [ 'resources', 'src', - 'vendor' + 'vendor', + 'symply' ], [ 'git' => $gitHash, diff --git a/build/symply/generate-symply-yml-property-consts.php b/build/symply/generate-symply-yml-property-consts.php new file mode 100644 index 00000000000..e40ca481f1c --- /dev/null +++ b/build/symply/generate-symply-yml-property-consts.php @@ -0,0 +1,126 @@ + $constants + * @phpstan-param-out array $constants + */ +function collectProperties(string $prefix, array $properties, array &$constants) : void{ + foreach($properties as $propertyName => $property){ + $fullPropertyName = ($prefix !== "" ? $prefix . "." : "") . $propertyName; + + $constName = str_replace([".", "-"], "_", strtoupper($fullPropertyName)); + $constants[$constName] = $fullPropertyName; + + if(is_array($property)){ + collectProperties($fullPropertyName, $property, $constants); + } + } +} + +collectProperties("", $defaultConfig, $constants); +ksort($constants, SORT_STRING); + +$file = fopen(dirname(__DIR__) . '/symply/YmlSymplyProperties.php', 'wb'); +if($file === false){ + fwrite(STDERR, "Failed to open output file\n"); + exit(1); +} +fwrite($file, " $propertyName){ + fwrite($file, "\tpublic const $constName = '$propertyName';\n"); +} +fwrite($file, "}\n"); + +fclose($file); + +echo "Done. Don't forget to run CS fixup after generating code.\n"; diff --git a/composer.json b/composer.json index 201f30f71bb..a5674a2487d 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,7 @@ "symfony/filesystem": "~6.3.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpstan/phpstan": "1.10.46", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", @@ -59,7 +60,8 @@ }, "autoload": { "psr-4": { - "pocketmine\\": "src/" + "pocketmine\\": "src/", + "symply\\": "symply/" }, "files": [ "src/CoreConstants.php" @@ -73,7 +75,7 @@ }, "config": { "platform": { - "php": "8.1.0" + "php": "8.2.0" }, "sort-packages": true }, diff --git a/composer.lock b/composer.lock index 40e56d90e3b..ad138e4dad3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "780ac4d9e381292b0a6b01dbe9fcdd07", + "content-hash": "eb22858a0fa7f989a2ba3beeafe4ae92", "packages": [ { "name": "adhocore/json-comment", @@ -1150,6 +1150,317 @@ } ], "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-10-11T07:11:09+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.40.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "7002f09c9593f515625a9f9717b10c2ab64dd3d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7002f09c9593f515625a9f9717b10c2ab64dd3d5", + "reference": "7002f09c9593f515625a9f9717b10c2ab64dd3d5", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpspec/prophecy": "^1.17", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-12-02T23:18:26+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -1962,123 +2273,276 @@ "time": "2023-09-19T05:42:37+00:00" }, { - "name": "sebastian/cli-parser", - "version": "2.0.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "sebastian/code-unit", - "version": "2.0.0", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=7.2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:58:43+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", + "name": "psr/log", "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:15+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { @@ -2876,6 +3340,1071 @@ ], "time": "2023-02-07T11:34:05+00:00" }, + { + "name": "symfony/console", + "version": "v7.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cdce5c684b2f920bb1343deecdfba356ffad83d5", + "reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.0.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-01T15:10:06+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e", + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-27T16:29:09+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-31T17:59:56+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-08-08T10:20:21+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "875e90aeea2777b6f135677f618529449334a612" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/13bdb1670c7f510494e04fcb2bfa29af63db9c0d", + "reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-11-20T16:43:42+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-30T20:28:31+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-05T13:06:06+00:00" + }, + { + "name": "symfony/string", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-11-29T08:40:23+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -2962,7 +4491,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "8.1.0" + "php": "8.2.0" }, "plugin-api-version": "2.6.0" } diff --git a/resources/symply.yml b/resources/symply.yml new file mode 100644 index 00000000000..e39a9168b90 --- /dev/null +++ b/resources/symply.yml @@ -0,0 +1,8 @@ +# Main configuration file for Symply +# Some of these settings are safe, others can break your server if modified incorrectly +# New settings/defaults won't appear automatically in this file when upgrading. + +# Allow the persona skin in your Symply server +persona-skin: true +# Allow the support WaterDogPE in your Symply server +waterdogpe-support: false \ No newline at end of file diff --git a/src/PocketMine.php b/src/PocketMine.php index 296c21a897c..8fd515a158b 100644 --- a/src/PocketMine.php +++ b/src/PocketMine.php @@ -337,7 +337,6 @@ function server(){ */ $autoloader = new ThreadSafeClassLoader(); $autoloader->register(false); - new Server($autoloader, $logger, $dataPath, $pluginPath); $logger->info("Stopping other threads"); diff --git a/src/Server.php b/src/Server.php index 63eee3b2adc..dd07304a3ff 100644 --- a/src/Server.php +++ b/src/Server.php @@ -122,6 +122,7 @@ use pocketmine\YmlServerProperties as Yml; use Ramsey\Uuid\UuidInterface; use Symfony\Component\Filesystem\Path; +use symply\YmlSymplyProperties; use function array_fill; use function array_sum; use function base64_encode; @@ -300,6 +301,7 @@ class Server{ * @phpstan-var array> */ private array $broadcastSubscribers = []; + private bool $waterdogeSupport = false; public function getName() : string{ return VersionInfo::NAME; @@ -346,7 +348,7 @@ public function getMaxPlayers() : int{ * are not logged into Xbox Live will be disconnected. */ public function getOnlineMode() : bool{ - return $this->onlineMode; + return !$this->waterdogeSupport && $this->onlineMode; } /** @@ -412,6 +414,10 @@ public function isHardcore() : bool{ return $this->configGroup->getConfigBool(ServerProperties::HARDCORE, false); } + public function isWaterdogepeSupport() : bool{ + return $this->waterdogeSupport; + } + public function getMotd() : string{ return $this->configGroup->getConfigString(ServerProperties::MOTD, self::DEFAULT_SERVER_NAME); } @@ -809,8 +815,15 @@ public function __construct( @file_put_contents($pocketmineYmlPath, $content); } + $symplyYmlPath = Path::join($this->dataPath, "symply.yml"); + if (!file_exists($symplyYmlPath)) { + $content = Filesystem::fileGetContents(Path::join(\pocketmine\RESOURCE_PATH, "symply.yml")); + @file_put_contents($symplyYmlPath, $content); + } + $this->configGroup = new ServerConfigGroup( new Config($pocketmineYmlPath, Config::YAML, []), + new Config($symplyYmlPath, Config::YAML, []), new Config(Path::join($this->dataPath, "server.properties"), Config::PROPERTIES, [ ServerProperties::MOTD => self::DEFAULT_SERVER_NAME, ServerProperties::SERVER_PORT_IPV4 => self::DEFAULT_PORT_IPV4, @@ -934,9 +947,9 @@ public function __construct( $this->banByIP->load(); $this->maxPlayers = $this->configGroup->getConfigInt(ServerProperties::MAX_PLAYERS, self::DEFAULT_MAX_PLAYERS); - + $this->waterdogeSupport = $this->configGroup->getSymplyProperty(YmlSymplyProperties::WATERDOGPE_SUPPORT, false); $this->onlineMode = $this->configGroup->getConfigBool(ServerProperties::XBOX_AUTH, true); - if($this->onlineMode){ + if($this->getOnlineMode()){ $this->logger->info($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_server_auth_enabled())); }else{ $this->logger->warning($this->getLanguage()->translate(KnownTranslationFactory::pocketmine_server_auth_disabled())); diff --git a/src/ServerConfigGroup.php b/src/ServerConfigGroup.php index b4a3a908713..740845c4ed5 100644 --- a/src/ServerConfigGroup.php +++ b/src/ServerConfigGroup.php @@ -40,6 +40,7 @@ final class ServerConfigGroup{ public function __construct( private Config $pocketmineYml, + private Config $symplyYml, private Config $serverProperties ){} @@ -56,6 +57,19 @@ public function getProperty(string $variable, mixed $defaultValue = null) : mixe return $this->propertyCache[$variable] ?? $defaultValue; } + public function getSymplyProperty(string $variable, mixed $defaultValue = null) : mixed{ + if(!array_key_exists($variable, $this->propertyCache)){ + $v = getopt("", ["$variable::"]); + if(isset($v[$variable])){ + $this->propertyCache[$variable] = $v[$variable]; + }else{ + $this->propertyCache[$variable] = $this->symplyYml->getNested($variable); + } + } + + return $this->propertyCache[$variable] ?? $defaultValue; + } + public function getPropertyBool(string $variable, bool $defaultValue) : bool{ return (bool) $this->getProperty($variable, $defaultValue); } @@ -131,5 +145,8 @@ public function save() : void{ if($this->pocketmineYml->hasChanged()){ $this->pocketmineYml->save(); } + if ($this->symplyYml->hasChanged()) { + $this->symplyYml->save(); + } } } diff --git a/src/VersionInfo.php b/src/VersionInfo.php index e0f4ca4f388..fa4d236c863 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -30,10 +30,10 @@ use function str_repeat; final class VersionInfo{ - public const NAME = "PocketMine-MP"; + public const NAME = "Symply"; public const BASE_VERSION = "5.8.3"; public const IS_DEVELOPMENT_BUILD = true; - public const BUILD_CHANNEL = "stable"; + public const BUILD_CHANNEL = "0.1"; /** * PocketMine-MP-specific version ID for world data. Used to determine what fixes need to be applied to old world diff --git a/src/crash/CrashDumpData.php b/src/crash/CrashDumpData.php index b71e6f405b2..a4ccef86907 100644 --- a/src/crash/CrashDumpData.php +++ b/src/crash/CrashDumpData.php @@ -62,6 +62,8 @@ final class CrashDumpData implements \JsonSerializable{ public string $pocketmineDotYml = ""; + public string $symplyDotYml = ""; + /** * @var string[] * @phpstan-var array @@ -81,7 +83,9 @@ public function jsonSerialize() : array{ $result = (array) $this; unset($result["serverDotProperties"]); unset($result["pocketmineDotYml"]); + unset($result["symply.yml"]); $result["pocketmine.yml"] = $this->pocketmineDotYml; + $result["symply.yml"] = $this->symplyDotYml; $result["server.properties"] = $this->serverDotProperties; return $result; } diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index de87653936d..58d4d1f6fb0 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -109,6 +109,7 @@ use pocketmine\utils\TextFormat; use pocketmine\world\Position; use pocketmine\YmlServerProperties; +use symply\waterdogpe\WDPEPlayerInfo; use function array_map; use function array_values; use function base64_encode; @@ -746,7 +747,7 @@ private function setAuthenticationStatus(bool $authenticated, bool $authRequired $this->logger->debug("Xbox Live authenticated: " . ($this->authenticated ? "YES" : "NO")); $checkXUID = $this->server->getConfigGroup()->getPropertyBool(YmlServerProperties::PLAYER_VERIFY_XUID, true); - $myXUID = $this->info instanceof XboxLivePlayerInfo ? $this->info->getXuid() : ""; + $myXUID = $this->info instanceof XboxLivePlayerInfo || $this->info instanceof WDPEPlayerInfo ? $this->info->getXuid() : ""; $kickForXUIDMismatch = function(string $xuid) use ($checkXUID, $myXUID) : bool{ if($checkXUID && $myXUID !== $xuid){ $this->logger->debug("XUID mismatch: expected '$xuid', but got '$myXUID'"); @@ -766,7 +767,7 @@ private function setAuthenticationStatus(bool $authenticated, bool $authRequired } $info = $existingSession->getPlayerInfo(); if($info !== null && (strcasecmp($info->getUsername(), $this->info->getUsername()) === 0 || $info->getUuid()->equals($this->info->getUuid()))){ - if($kickForXUIDMismatch($info instanceof XboxLivePlayerInfo ? $info->getXuid() : "")){ + if($kickForXUIDMismatch($info instanceof XboxLivePlayerInfo || $info instanceof WDPEPlayerInfo ? $info->getXuid() : "")){ return; } $ev = new PlayerDuplicateLoginEvent($this, $existingSession, KnownTranslationFactory::disconnectionScreen_loggedinOtherLocation(), null); @@ -784,7 +785,7 @@ private function setAuthenticationStatus(bool $authenticated, bool $authRequired //TODO: we shouldn't be loading player data here at all, but right now we don't have any choice :( $this->cachedOfflinePlayerData = $this->server->getOfflinePlayerData($this->info->getUsername()); if($checkXUID){ - $recordedXUID = $this->cachedOfflinePlayerData !== null ? $this->cachedOfflinePlayerData->getTag(Player::TAG_LAST_KNOWN_XUID) : null; + $recordedXUID = $this->cachedOfflinePlayerData?->getTag(Player::TAG_LAST_KNOWN_XUID); if(!($recordedXUID instanceof StringTag)){ $this->logger->debug("No previous XUID recorded, no choice but to trust this player"); }elseif(!$kickForXUIDMismatch($recordedXUID->getValue())){ diff --git a/src/network/mcpe/handler/LoginPacketHandler.php b/src/network/mcpe/handler/LoginPacketHandler.php index 9ac82bc5fef..ab1ea2c3e60 100644 --- a/src/network/mcpe/handler/LoginPacketHandler.php +++ b/src/network/mcpe/handler/LoginPacketHandler.php @@ -23,7 +23,9 @@ namespace pocketmine\network\mcpe\handler; +use InvalidArgumentException; use pocketmine\entity\InvalidSkinException; +use pocketmine\entity\Skin; use pocketmine\event\player\PlayerPreLoginEvent; use pocketmine\lang\KnownTranslationFactory; use pocketmine\lang\Translatable; @@ -42,6 +44,9 @@ use pocketmine\player\XboxLivePlayerInfo; use pocketmine\Server; use Ramsey\Uuid\Uuid; +use symply\waterdogpe\WDPEClientData; +use symply\waterdogpe\WDPEClientDataToSkinDataHelper; +use symply\waterdogpe\WDPEPlayerInfo; use function is_array; /** @@ -64,18 +69,16 @@ public function handleLogin(LoginPacket $packet) : bool{ if(!Player::isValidUserName($extraData->displayName)){ $this->session->disconnectWithError(KnownTranslationFactory::disconnectionScreen_invalidName()); - return true; } $clientData = $this->parseClientData($packet->clientDataJwt); try{ - $skin = $this->session->getTypeConverter()->getSkinAdapter()->fromSkinData(ClientDataToSkinDataHelper::fromClientData($clientData)); - }catch(\InvalidArgumentException | InvalidSkinException $e){ + $skin = $this->parseSkinInClientData($clientData); + }catch(InvalidArgumentException | InvalidSkinException $e){ $this->session->getLogger()->debug("Invalid skin: " . $e->getMessage()); $this->session->disconnectWithError(KnownTranslationFactory::disconnectionScreen_invalidSkin()); - return true; } @@ -84,9 +87,18 @@ public function handleLogin(LoginPacket $packet) : bool{ } $uuid = Uuid::fromString($extraData->identity); $arrClientData = (array) $clientData; - $arrClientData["TitleID"] = $extraData->titleId; - - if($extraData->XUID !== ""){ + $arrClientData["titleId"] = $extraData->titleId; + if ($clientData instanceof WDPEClientData){ + $playerInfo = new WDPEPlayerInfo( + $clientData->Waterdog_XUID, + $extraData->displayName, + $clientData->Waterdog_IP, + $uuid, + $skin, + $clientData->LanguageCode, + $arrClientData + ); + }elseif($extraData->XUID !== ""){ $playerInfo = new XboxLivePlayerInfo( $extraData->XUID, $extraData->displayName, @@ -184,7 +196,7 @@ protected function fetchAuthData(JwtChain $chain) : AuthenticationData{ /** * @throws PacketHandlingException */ - protected function parseClientData(string $clientDataJwt) : ClientData{ + protected function parseClientData(string $clientDataJwt) : ClientData|WDPEClientData{ try{ [, $clientDataClaims, ] = JwtUtils::parse($clientDataJwt); }catch(JwtException $e){ @@ -196,18 +208,28 @@ protected function parseClientData(string $clientDataJwt) : ClientData{ $mapper->bExceptionOnMissingData = true; $mapper->bExceptionOnUndefinedProperty = true; try{ - $clientData = $mapper->map($clientDataClaims, new ClientData()); + $clientData = $mapper->map($clientDataClaims, $this->server->isWaterdogepeSupport() ? new WDPEClientData() : new ClientData()); }catch(\JsonMapper_Exception $e){ throw PacketHandlingException::wrap($e); } return $clientData; } + /** + * @throws InvalidArgumentException|InvalidSkinException + */ + protected function parseSkinInClientData(ClientData|WDPEClientData $clientData) : Skin{ + if ($clientData instanceof WDPEClientData){ + return $this->session->getTypeConverter()->getSkinAdapter()->fromSkinData(WDPEClientDataToSkinDataHelper::fromClientData($clientData)); + } + return $this->session->getTypeConverter()->getSkinAdapter()->fromSkinData(ClientDataToSkinDataHelper::fromClientData($clientData)); + } + /** * TODO: This is separated for the purposes of allowing plugins (like Specter) to hack it and bypass authentication. * In the future this won't be necessary. * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ protected function processLogin(LoginPacket $packet, bool $authRequired) : void{ $this->server->getAsyncPool()->submitTask(new ProcessLoginTask($packet->chainDataJwt->chain, $packet->clientDataJwt, $authRequired, $this->authCallback)); diff --git a/start.sh b/start.sh index 0121f3887bb..d6db8eaf00d 100755 --- a/start.sh +++ b/start.sh @@ -33,8 +33,8 @@ if [ "$PHP_BINARY" == "" ]; then fi if [ "$POCKETMINE_FILE" == "" ]; then - if [ -f ./PocketMine-MP.phar ]; then - POCKETMINE_FILE="./PocketMine-MP.phar" + if [ -f ./Symply.phar ]; then + POCKETMINE_FILE="./Symply.phar" else echo "PocketMine-MP.phar not found" echo "Downloads can be found at https://github.com/pmmp/PocketMine-MP/releases" diff --git a/symply/YmlSymplyProperties.php b/symply/YmlSymplyProperties.php new file mode 100644 index 00000000000..5fb38a61cfa --- /dev/null +++ b/symply/YmlSymplyProperties.php @@ -0,0 +1,43 @@ +AnimatedImageData as $k => $animation){ + $animations[] = new SkinAnimation( + new SkinImage( + $animation->ImageHeight, + $animation->ImageWidth, + self::safeB64Decode($animation->Image, "AnimatedImageData.$k.Image") + ), + $animation->Type, + $animation->Frames, + $animation->AnimationExpression + ); + } + return new SkinData( + $clientData->SkinId, + $clientData->PlayFabId, + self::safeB64Decode($clientData->SkinResourcePatch, "SkinResourcePatch"), + new SkinImage($clientData->SkinImageHeight, $clientData->SkinImageWidth, self::safeB64Decode($clientData->SkinData, "SkinData")), + $animations, + new SkinImage($clientData->CapeImageHeight, $clientData->CapeImageWidth, self::safeB64Decode($clientData->CapeData, "CapeData")), + self::safeB64Decode($clientData->SkinGeometryData, "SkinGeometryData"), + self::safeB64Decode($clientData->SkinGeometryDataEngineVersion, "SkinGeometryDataEngineVersion"), //yes, they actually base64'd the version! + self::safeB64Decode($clientData->SkinAnimationData, "SkinAnimationData"), + $clientData->CapeId, + null, + $clientData->ArmSize, + $clientData->SkinColor, + array_map(function(WDPEClientDataPersonaSkinPiece $piece) : PersonaSkinPiece{ + return new PersonaSkinPiece($piece->PieceId, $piece->PieceType, $piece->PackId, $piece->IsDefault, $piece->ProductId); + }, $clientData->PersonaPieces), + array_map(function(WDPEClientDataPersonaPieceTintColor $tint) : PersonaPieceTintColor{ + return new PersonaPieceTintColor($tint->PieceType, $tint->Colors); + }, $clientData->PieceTintColors), + true, + $clientData->PremiumSkin, + $clientData->PersonaSkin, + $clientData->CapeOnClassicSkin, + true, //assume this is true? there's no field for it ... + $clientData->OverrideSkin ?? true, + ); + } +} diff --git a/symply/waterdogpe/WDPEPlayerInfo.php b/symply/waterdogpe/WDPEPlayerInfo.php new file mode 100644 index 00000000000..a4d1f84a8c3 --- /dev/null +++ b/symply/waterdogpe/WDPEPlayerInfo.php @@ -0,0 +1,64 @@ +xuid = $xuid; + $this->realIp = $realIp; + } + + public function getXuid() : string{ + return $this->xuid; + } + + public function getRealIp() : string{ + return $this->realIp; + } + + /** + * Returns a new PlayerInfo with XBL player info stripped. This is used to ensure that non-XBL players can't spoof + * XBL data. + */ + public function withoutXboxData() : PlayerInfo{ + return new PlayerInfo( + $this->getUsername(), + $this->getUuid(), + $this->getSkin(), + $this->getLocale(), + $this->getExtraData() + ); + } +}