PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\network\mcpe\protocol\TextPacket Class Reference
+ Inheritance diagram for pocketmine\network\mcpe\protocol\TextPacket:
+ Collaboration diagram for pocketmine\network\mcpe\protocol\TextPacket:

Public Member Functions

 __get ($name)
 
 __set ($name, $value)
 
 canBeSentBeforeLogin ()
 
 decode (PacketSerializer $in)
 
 encode (PacketSerializer $out)
 
 getName ()
 
 handle (PacketHandlerInterface $handler)
 
 pid ()
 

Static Public Member Functions

static jukeboxPopup (string $key, array $parameters=[])
 
static popup (string $message)
 
static raw (string $message)
 
static tip (string $message)
 
static translatedPopup (string $key, array $parameters=[])
 
static translation (string $key, array $parameters=[])
 

Public Attributes

string $message
 
bool $needsTranslation = false
 
array $parameters = []
 
string $platformChatId = ""
 
int $recipientSubId = 0
 
int $senderSubId = 0
 
string $sourceName
 
int $type
 
string $xboxUserId = ""
 
const NETWORK_ID = ProtocolInfo::TEXT_PACKET
 
const PID_MASK = 0x3ff
 
const TYPE_ANNOUNCEMENT = 8
 
const TYPE_CHAT = 1
 
const TYPE_JSON = 10
 
const TYPE_JSON_ANNOUNCEMENT = 11
 
const TYPE_JSON_WHISPER = 9
 
const TYPE_JUKEBOX_POPUP = 4
 
const TYPE_POPUP = 3
 
const TYPE_RAW = 0
 
const TYPE_SYSTEM = 6
 
const TYPE_TIP = 5
 
const TYPE_TRANSLATION = 2
 
const TYPE_WHISPER = 7
 

Protected Member Functions

 decodeHeader (PacketSerializer $in)
 
 decodePayload (PacketSerializer $in)
 
 encodeHeader (PacketSerializer $out)
 
 encodePayload (PacketSerializer $out)
 

Detailed Description

Definition at line 20 of file TextPacket.php.

Member Function Documentation

◆ __get()

pocketmine\network\mcpe\protocol\DataPacket::__get (   $name)
inherited
Parameters
string$name
Returns
mixed

Definition at line 105 of file DataPacket.php.

◆ __set()

pocketmine\network\mcpe\protocol\DataPacket::__set (   $name,
  $value 
)
inherited
Parameters
string$name
mixed$value

Definition at line 113 of file DataPacket.php.

◆ canBeSentBeforeLogin()

pocketmine\network\mcpe\protocol\DataPacket::canBeSentBeforeLogin ( )
inherited

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 42 of file DataPacket.php.

◆ decode()

pocketmine\network\mcpe\protocol\DataPacket::decode ( PacketSerializer  $in)
finalinherited
Exceptions
PacketDecodeException

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 49 of file DataPacket.php.

◆ decodeHeader()

pocketmine\network\mcpe\protocol\DataPacket::decodeHeader ( PacketSerializer  $in)
protectedinherited
Exceptions
BinaryDataException
PacketDecodeException

Definition at line 62 of file DataPacket.php.

◆ decodePayload()

pocketmine\network\mcpe\protocol\TextPacket::decodePayload ( PacketSerializer  $in)
protected

Decodes the packet body, without the packet ID or other generic header fields.

Exceptions
PacketDecodeException
BinaryDataException

Reimplemented from pocketmine\network\mcpe\protocol\DataPacket.

Definition at line 97 of file TextPacket.php.

References pocketmine\network\mcpe\protocol\serializer\PacketSerializer\getString(), and pocketmine\utils\BinaryStream\getUnsignedVarInt().

+ Here is the call graph for this function:

◆ encode()

pocketmine\network\mcpe\protocol\DataPacket::encode ( PacketSerializer  $out)
finalinherited

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 82 of file DataPacket.php.

◆ encodeHeader()

pocketmine\network\mcpe\protocol\DataPacket::encodeHeader ( PacketSerializer  $out)
protectedinherited

Definition at line 87 of file DataPacket.php.

◆ encodePayload()

pocketmine\network\mcpe\protocol\TextPacket::encodePayload ( PacketSerializer  $out)
protected

Encodes the packet body, without the packet ID or other generic header fields.

Reimplemented from pocketmine\network\mcpe\protocol\DataPacket.

Definition at line 130 of file TextPacket.php.

References pocketmine\utils\BinaryStream\putUnsignedVarInt().

+ Here is the call graph for this function:

◆ getName()

pocketmine\network\mcpe\protocol\DataPacket::getName ( )
inherited

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 38 of file DataPacket.php.

◆ handle()

pocketmine\network\mcpe\protocol\TextPacket::handle ( PacketHandlerInterface  $handler)

Performs handling for this packet. Usually you'll want an appropriately named method in the session handler for this.

This method returns a bool to indicate whether the packet was handled or not. If the packet was unhandled, a debug message will be logged with a hexdump of the packet.

Typically this method returns the return value of the handler in the supplied PacketHandler. See other packets for examples how to implement this.

Returns
bool true if the packet was handled successfully, false if not.
Exceptions
PacketDecodeExceptionif broken data was found in the packet

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 163 of file TextPacket.php.

◆ jukeboxPopup()

static pocketmine\network\mcpe\protocol\TextPacket::jukeboxPopup ( string  $key,
array  $parameters = [] 
)
static
Parameters
string[]$parameters

Definition at line 89 of file TextPacket.php.

◆ pid()

pocketmine\network\mcpe\protocol\DataPacket::pid ( )
inherited

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 34 of file DataPacket.php.

◆ popup()

static pocketmine\network\mcpe\protocol\TextPacket::popup ( string  $message)
static

Definition at line 75 of file TextPacket.php.

◆ raw()

static pocketmine\network\mcpe\protocol\TextPacket::raw ( string  $message)
static

Definition at line 64 of file TextPacket.php.

◆ tip()

static pocketmine\network\mcpe\protocol\TextPacket::tip ( string  $message)
static

Definition at line 93 of file TextPacket.php.

◆ translatedPopup()

static pocketmine\network\mcpe\protocol\TextPacket::translatedPopup ( string  $key,
array  $parameters = [] 
)
static
Parameters
string[]$parameters

Definition at line 82 of file TextPacket.php.

◆ translation()

static pocketmine\network\mcpe\protocol\TextPacket::translation ( string  $key,
array  $parameters = [] 
)
static
Parameters
string[]$parameters

Definition at line 71 of file TextPacket.php.

Member Data Documentation

◆ $message

string pocketmine\network\mcpe\protocol\TextPacket::$message

Definition at line 39 of file TextPacket.php.

◆ $needsTranslation

bool pocketmine\network\mcpe\protocol\TextPacket::$needsTranslation = false

Definition at line 37 of file TextPacket.php.

◆ $parameters

array pocketmine\network\mcpe\protocol\TextPacket::$parameters = []

Definition at line 41 of file TextPacket.php.

◆ $platformChatId

string pocketmine\network\mcpe\protocol\TextPacket::$platformChatId = ""

Definition at line 43 of file TextPacket.php.

◆ $recipientSubId

int pocketmine\network\mcpe\protocol\DataPacket::$recipientSubId = 0
inherited

Definition at line 32 of file DataPacket.php.

◆ $senderSubId

int pocketmine\network\mcpe\protocol\DataPacket::$senderSubId = 0
inherited

Definition at line 31 of file DataPacket.php.

◆ $sourceName

string pocketmine\network\mcpe\protocol\TextPacket::$sourceName

Definition at line 38 of file TextPacket.php.

◆ $type

int pocketmine\network\mcpe\protocol\TextPacket::$type

Definition at line 36 of file TextPacket.php.

◆ $xboxUserId

string pocketmine\network\mcpe\protocol\TextPacket::$xboxUserId = ""

Definition at line 42 of file TextPacket.php.

◆ NETWORK_ID

const pocketmine\network\mcpe\protocol\TextPacket::NETWORK_ID = ProtocolInfo::TEXT_PACKET

Definition at line 21 of file TextPacket.php.

◆ PID_MASK

const pocketmine\network\mcpe\protocol\DataPacket::PID_MASK = 0x3ff
inherited

Definition at line 25 of file DataPacket.php.

◆ TYPE_ANNOUNCEMENT

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_ANNOUNCEMENT = 8

Definition at line 31 of file TextPacket.php.

◆ TYPE_CHAT

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_CHAT = 1

Definition at line 24 of file TextPacket.php.

◆ TYPE_JSON

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_JSON = 10

Definition at line 33 of file TextPacket.php.

◆ TYPE_JSON_ANNOUNCEMENT

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_JSON_ANNOUNCEMENT = 11

Definition at line 34 of file TextPacket.php.

◆ TYPE_JSON_WHISPER

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_JSON_WHISPER = 9

Definition at line 32 of file TextPacket.php.

◆ TYPE_JUKEBOX_POPUP

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_JUKEBOX_POPUP = 4

Definition at line 27 of file TextPacket.php.

◆ TYPE_POPUP

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_POPUP = 3

Definition at line 26 of file TextPacket.php.

◆ TYPE_RAW

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_RAW = 0

Definition at line 23 of file TextPacket.php.

◆ TYPE_SYSTEM

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_SYSTEM = 6

Definition at line 29 of file TextPacket.php.

◆ TYPE_TIP

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_TIP = 5

Definition at line 28 of file TextPacket.php.

◆ TYPE_TRANSLATION

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_TRANSLATION = 2

Definition at line 25 of file TextPacket.php.

◆ TYPE_WHISPER

const pocketmine\network\mcpe\protocol\TextPacket::TYPE_WHISPER = 7

Definition at line 30 of file TextPacket.php.


The documentation for this class was generated from the following file: