Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pocketmine\player\Player::addAttachment() int given instead of ?string #14

Closed
xqwtxon opened this issue Jun 14, 2022 · 4 comments
Closed

Comments

@xqwtxon
Copy link

xqwtxon commented Jun 14, 2022

Error: pocketmine\player\Player::addAttachment(): Argument #2 ($name) must be of type ?string, int given, called in C:\PrideMC Network\plugins\RankSystem\src\IvanCraft623\RankSystem\session\Session.php on line 365
File: pmsrc/src/permission/PermissibleDelegateTrait
Line: 62
Type: TypeError
Backtrace:
#0 plugins/RankSystem/src/IvanCraft623/RankSystem/session/Session(365): pocketmine\player\Player->addAttachment(object IvanCraft623\RankSystem\RankSystem#24955, integer 0, true)
#1 plugins/RankSystem/src/IvanCraft623/RankSystem/session/Session(144): IvanCraft623\RankSystem\session\Session->updatePermissions()
#2 plugins/RankSystem/src/IvanCraft623/RankSystem/session/Session(269): IvanCraft623\RankSystem\session\Session->syncPermissions(array[38])
#3 pmsrc/src/promise/PromiseResolver(51): IvanCraft623\RankSystem\session\Session->IvanCraft623\RankSystem\session\{closure}(array[1])
#4 plugins/RankSystem/src/IvanCraft623/RankSystem/provider/libasynql(151): pocketmine\promise\PromiseResolver->resolve(array[1])
#5 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/DataConnectorImpl(124): IvanCraft623\RankSystem\provider\libasynql->IvanCraft623\RankSystem\provider\{closure}()
#6 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/DataConnectorImpl(181): IvanCraft623\RankSystem\libs\poggit\libasynql\base\DataConnectorImpl::IvanCraft623\RankSystem\libs\poggit\libasynql\base\{closure}(object IvanCraft623\RankSystem\libs\poggit\libasynql\SqlResult#140126)
#7 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/DataConnectorImpl(239): IvanCraft623\RankSystem\libs\poggit\libasynql\base\DataConnectorImpl::IvanCraft623\RankSystem\libs\poggit\libasynql\base\{closure}(array[1])
#8 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/SqlThreadPool(112): IvanCraft623\RankSystem\libs\poggit\libasynql\base\DataConnectorImpl->IvanCraft623\RankSystem\libs\poggit\libasynql\base\{closure}(array[1])
#9 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/DataConnectorImpl(323): IvanCraft623\RankSystem\libs\poggit\libasynql\base\SqlThreadPool->readResults(array[1])
#10 plugins/RankSystem/src/IvanCraft623/RankSystem/libs/poggit/libasynql/base/SqlThreadPool(65): IvanCraft623\RankSystem\libs\poggit\libasynql\base\DataConnectorImpl->checkResults()
#11 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(123): IvanCraft623\RankSystem\libs\poggit\libasynql\base\SqlThreadPool->IvanCraft623\RankSystem\libs\poggit\libasynql\base\{closure}()
#12 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\snooze\SleeperHandler->processNotifications()
#13 pmsrc/src/Server(1661): pocketmine\snooze\SleeperHandler->sleepUntil(double 1655179203.4521)
#14 pmsrc/src/Server(1047): pocketmine\Server->tickProcessor()
#15 pmsrc/src/PocketMine(304): pocketmine\Server->__construct(object BaseClassLoader#2, object pocketmine\utils\MainLogger#3, string[19] C:\PrideMC Network\, string[27] C:\PrideMC Network\plugins\)
#16 pmsrc/src/PocketMine(327): pocketmine\server()
#17 pmsrc(11): require(string[63] phar://C:/PrideMC Network/PocketMine-MP.phar/src/PocketMine.php)

Why they returning int instead of string?

Pocketmine Code:

public function addAttachment(Plugin $plugin, ?string $name = null, ?bool $value = null) : PermissionAttachment{
        return $this->perm->addAttachment($plugin, $name, $value);
    }
@IvanCraft623
Copy link
Owner

Hello! I'm tracking the issue, could you upload the database file?

IvanCraft623 added a commit that referenced this issue Jun 15, 2022
@xqwtxon
Copy link
Author

xqwtxon commented Jun 16, 2022

So, when you set ranks to player, and remove again to player, it would crash from the server.

@xqwtxon
Copy link
Author

xqwtxon commented Jun 16, 2022

Hello! I'm tracking the issue, could you upload the database file?

Sorry but i cant. Because i cant upload right here in github.

@NJMD13 NJMD13 mentioned this issue Jun 16, 2022
@IvanCraft623
Copy link
Owner

So, when you set ranks to player, and remove again to player, it would crash from the server.

Already solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants