mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
LoginPacketHandler: account for failure to correctly parse UUID
this will still crash in some circumstances, pending merging bug fixes from stable.
This commit is contained in:
parent
d3a6da1b3a
commit
9ba47f90d1
@ -25,6 +25,7 @@ namespace pocketmine\network\mcpe\handler;
|
||||
|
||||
use pocketmine\entity\Skin;
|
||||
use pocketmine\event\player\PlayerPreLoginEvent;
|
||||
use pocketmine\network\BadPacketException;
|
||||
use pocketmine\network\mcpe\auth\ProcessLoginTask;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\LoginPacket;
|
||||
@ -111,9 +112,14 @@ class LoginPacketHandler extends PacketHandler{
|
||||
return true;
|
||||
}
|
||||
|
||||
try{
|
||||
$uuid = UUID::fromString($packet->extraData->identity);
|
||||
}catch(\InvalidArgumentException $e){
|
||||
throw BadPacketException::wrap($e, "Failed to parse login UUID");
|
||||
}
|
||||
$this->session->setPlayerInfo(new PlayerInfo(
|
||||
$packet->extraData->displayName,
|
||||
UUID::fromString($packet->extraData->identity),
|
||||
$uuid,
|
||||
$skin,
|
||||
$packet->clientData->LanguageCode,
|
||||
$packet->extraData->XUID,
|
||||
|
Loading…
x
Reference in New Issue
Block a user