63 $this->type = Byte::readUnsigned($in);
64 $count = VarInt::readUnsignedInt($in);
65 for($i = 0; $i < $count; ++$i){
68 if($this->type === self::TYPE_ADD){
69 $entry->uuid = CommonTypes::getUUID($in);
70 $entry->actorUniqueId = CommonTypes::getActorUniqueId($in);
71 $entry->username = CommonTypes::getString($in);
72 $entry->xboxUserId = CommonTypes::getString($in);
73 $entry->platformChatId = CommonTypes::getString($in);
74 $entry->buildPlatform = LE::readSignedInt($in);
75 $entry->skinData = CommonTypes::getSkin($in);
76 $entry->isTeacher = CommonTypes::getBool($in);
77 $entry->isHost = CommonTypes::getBool($in);
78 $entry->isSubClient = CommonTypes::getBool($in);
79 $entry->color = Color::fromARGB(LE::readUnsignedInt($in));
81 $entry->uuid = CommonTypes::getUUID($in);
84 $this->entries[$i] = $entry;
86 if($this->type === self::TYPE_ADD){
87 for($i = 0; $i < $count; ++$i){
88 $this->entries[$i]->skinData->setVerified(CommonTypes::getBool($in));
94 Byte::writeUnsigned($out, $this->type);
95 VarInt::writeUnsignedInt($out, count($this->entries));
96 foreach($this->entries as $entry){
97 if($this->type === self::TYPE_ADD){
98 CommonTypes::putUUID($out, $entry->uuid);
99 CommonTypes::putActorUniqueId($out, $entry->actorUniqueId);
100 CommonTypes::putString($out, $entry->username);
101 CommonTypes::putString($out, $entry->xboxUserId);
102 CommonTypes::putString($out, $entry->platformChatId);
103 LE::writeSignedInt($out, $entry->buildPlatform);
104 CommonTypes::putSkin($out, $entry->skinData);
105 CommonTypes::putBool($out, $entry->isTeacher);
106 CommonTypes::putBool($out, $entry->isHost);
107 CommonTypes::putBool($out, $entry->isSubClient);
108 LE::writeUnsignedInt($out, ($entry->color ??
new Color(255, 255, 255))->toARGB());
110 CommonTypes::putUUID($out, $entry->uuid);
113 if($this->type === self::TYPE_ADD){
114 foreach($this->entries as $entry){
115 CommonTypes::putBool($out, $entry->skinData->isVerified());