60 $this->protocol = $this->
getInt();
66 $this->gameEdition = $this->
getByte();
72 $chainData = json_decode($this->
get($this->
getLInt()))->{
"chain"};
74 $chainKey = self::MOJANG_PUBKEY;
75 while(!empty($chainData)){
76 foreach($chainData as $index => $chain){
77 list($verified, $webtoken) = $this->
decodeToken($chain, $chainKey);
78 if(isset($webtoken[
"extraData"])){
79 if(isset($webtoken[
"extraData"][
"displayName"])){
80 $this->username = $webtoken[
"extraData"][
"displayName"];
82 if(isset($webtoken[
"extraData"][
"identity"])){
83 $this->clientUUID = $webtoken[
"extraData"][
"identity"];
87 $verified = isset($webtoken[
"nbf"]) && $webtoken[
"nbf"] <= $time && isset($webtoken[
"exp"]) && $webtoken[
"exp"] > $time;
89 if($verified and isset($webtoken[
"identityPublicKey"])){
91 if($webtoken[
"identityPublicKey"] != self::MOJANG_PUBKEY) $chainKey = $webtoken[
"identityPublicKey"];
93 }elseif($chainKey === null){
98 if(!$verified && $chainKey !== null){
101 unset($chainData[$index]);
105 list($verified, $this->clientData) = $this->
decodeToken($this->
get($this->
getLInt()), $chainKey);
107 $this->clientId = $this->clientData[
"ClientRandomId"] ?? null;
108 $this->serverAddress = $this->clientData[
"ServerAddress"] ?? null;
109 $this->skinId = $this->clientData[
"SkinId"] ?? null;
111 if(isset($this->clientData[
"SkinData"])){
112 $this->skin = base64_decode($this->clientData[
"SkinData"]);
115 if(isset($this->clientData[
"DeviceModel"])){
116 $this->deviceModel = $this->clientData[
"DeviceModel"];
119 if(isset($this->clientData[
"DeviceOS"])){
120 $this->deviceOS = $this->clientData[
"DeviceOS"];
124 $this->identityPublicKey = $chainKey;