Hi all I changed a bit RakLib to Server and Client side, because I would like to do transfer without TransferPacket And I have LoginPacket buffer on server-side raklib Q: how can I create EncapsulatedPacket with LP buffer? As I reed: Spoiler: raklib\RakLib.php PHP: /* * These internal "packets" DO NOT exist in the RakNet protocol. They are used by the RakLib API to communicate * messages between the RakLib thread and the implementation's thread. * * Internal Packet: * int32 (length without this field) * byte (packet ID) * payload */ /* * ENCAPSULATED payload: * byte (identifier length) * byte[] (identifier) * byte (flags, last 3 bits, priority) * payload (binary internal EncapsulatedPacket) */ public const PACKET_ENCAPSULATED = 0x01; I.e: PHP: create(pocketmine\network\mcpe\protocol\LoginPacket $buffer, string $playerAddress, int $playerPort) { // Internal packet header $pk = chr(RakLib::ENCAPSULATED); // byte (packet ID) // Internal packet payload $pk .= chr(4); // byte (identifier length - 4 bytes or 6 bytes (do I need to add 2 bytes - port length?)) $parts = explode(".", $playerAddress); assert(count($parts) === 4, "Wrong number of parts in IPv4 IP, expected 4, got " . count($parts)); foreach($parts as $b){ $pk .= chr((~((int) $b)) & 0xff); // byte[] (identifier) } $pk .= pack("n", $playerPort); // port (16-bit big-endian number) $pk .= PacketReliability::UNRELIABLE; $pk .= $buffer; return $pk;} Where is the mistake?