PocketMine-MP 5.37.4 git-0c453f585430c41919390ec01ffeb1e004b5334b
Loading...
Searching...
No Matches
pocketmine\network\mcpe\protocol\AvailableCommandsPacket Class Reference
+ Inheritance diagram for pocketmine\network\mcpe\protocol\AvailableCommandsPacket:
+ Collaboration diagram for pocketmine\network\mcpe\protocol\AvailableCommandsPacket:

Public Member Functions

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

Static Public Member Functions

static create (array $enumValues, array $chainedSubCommandValues, array $postfixes, array $enums, array $chainedSubCommandData, array $commandData, array $softEnums, array $enumConstraints,)
 

Public Attributes

array $chainedSubCommandData = []
 
array $chainedSubCommandValues = []
 
array $commandData = []
 
array $enumConstraints = []
 
array $enums = []
 
array $enumValues = []
 
array $postfixes = []
 
int $recipientSubId = 0
 
int $senderSubId = 0
 
array $softEnums = []
 
const ARG_FLAG_ENUM = 0x200000
 
const ARG_FLAG_POSTFIX = 0x1000000
 
const ARG_FLAG_SOFT_ENUM = 0x4000000
 
const ARG_FLAG_VALID = 0x100000
 
const ARG_TYPE_BLOCK_STATES = ArgTypes::BLOCK_STATE_ARRAY
 
const ARG_TYPE_COMMAND = ArgTypes::CODEBUILDERARGS
 
const ARG_TYPE_COMPARE_OPERATOR = ArgTypes::COMPAREOPERATOR
 
const ARG_TYPE_EQUIPMENT_SLOT = ArgTypes::EQUIPMENTSLOTENUM
 
const ARG_TYPE_FILEPATH = ArgTypes::PATHCOMMAND
 
const ARG_TYPE_FLOAT = ArgTypes::VAL
 
const ARG_TYPE_FULL_INTEGER_RANGE = ArgTypes::FULLINTEGERRANGE
 
const ARG_TYPE_INT = ArgTypes::INT
 
const ARG_TYPE_INT_POSITION = ArgTypes::POSITION
 
const ARG_TYPE_JSON = ArgTypes::JSON_OBJECT
 
const ARG_TYPE_MESSAGE = ArgTypes::MESSAGE_ROOT
 
const ARG_TYPE_OPERATOR = ArgTypes::OPERATOR
 
const ARG_TYPE_POSITION = ArgTypes::POSITION_FLOAT
 
const ARG_TYPE_RAWTEXT = ArgTypes::RAWTEXT
 
const ARG_TYPE_STRING = ArgTypes::ID
 
const ARG_TYPE_TARGET = ArgTypes::SELECTION
 
const ARG_TYPE_VALUE = ArgTypes::RVAL
 
const ARG_TYPE_WILDCARD_INT = ArgTypes::WILDCARDINT
 
const ARG_TYPE_WILDCARD_TARGET = ArgTypes::WILDCARDSELECTION
 
const NETWORK_ID = ProtocolInfo::AVAILABLE_COMMANDS_PACKET
 
const PID_MASK = 0x3ff
 

Protected Member Functions

 decodeHeader (ByteBufferReader $in)
 
 decodePayload (ByteBufferReader $in)
 
 encodeHeader (ByteBufferWriter $out)
 
 encodePayload (ByteBufferWriter $out)
 

Detailed Description

Note: It's not recommended to work with this packet directly. It's very complicated, and it's very easy to crash the client if the packet data is incorrect in any way.

To assemble a packet for sending from high-level structures, use AvailableCommandsPacketAssembler. To disassemble a received packet into high-level structures, use AvailableCommandsPacketDisassembler.

Definition at line 38 of file AvailableCommandsPacket.php.

Member Function Documentation

◆ __get()

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

Definition at line 107 of file DataPacket.php.

◆ __set()

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

Definition at line 115 of file DataPacket.php.

◆ canBeSentBeforeLogin()

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

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 44 of file DataPacket.php.

◆ create()

static pocketmine\network\mcpe\protocol\AvailableCommandsPacket::create ( array $enumValues,
array $chainedSubCommandValues,
array $postfixes,
array $enums,
array $chainedSubCommandData,
array $commandData,
array $softEnums,
array $enumConstraints )
static

@generate-create-func

Parameters
string[]$enumValues
string[]$chainedSubCommandValues
string[]$postfixes
CommandEnumRawData[]$enums
ChainedSubCommandRawData[]$chainedSubCommandData
CommandRawData[]$commandData
CommandSoftEnum[]$softEnums
CommandEnumConstraintRawData[]$enumConstraints@phpstan-param list<string> $enumValues @phpstan-param list<string> $chainedSubCommandValues @phpstan-param list<string> $postfixes @phpstan-param list<CommandEnumRawData> $enums @phpstan-param list<ChainedSubCommandRawData> $chainedSubCommandData @phpstan-param list<CommandRawData> $commandData @phpstan-param list<CommandSoftEnum> $softEnums @phpstan-param list<CommandEnumConstraintRawData> $enumConstraints

Definition at line 152 of file AvailableCommandsPacket.php.

◆ decode()

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

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 51 of file DataPacket.php.

◆ decodeHeader()

pocketmine\network\mcpe\protocol\DataPacket::decodeHeader ( ByteBufferReader $in)
protectedinherited
Exceptions
DataDecodeException
PacketDecodeException

Definition at line 64 of file DataPacket.php.

◆ decodePayload()

pocketmine\network\mcpe\protocol\AvailableCommandsPacket::decodePayload ( ByteBufferReader $in)
protected

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

Exceptions
PacketDecodeException
DataDecodeException

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

Definition at line 174 of file AvailableCommandsPacket.php.

◆ encode()

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

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 84 of file DataPacket.php.

◆ encodeHeader()

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

Definition at line 89 of file DataPacket.php.

◆ encodePayload()

pocketmine\network\mcpe\protocol\AvailableCommandsPacket::encodePayload ( ByteBufferWriter $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 217 of file AvailableCommandsPacket.php.

◆ getName()

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

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 40 of file DataPacket.php.

◆ handle()

pocketmine\network\mcpe\protocol\AvailableCommandsPacket::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 260 of file AvailableCommandsPacket.php.

◆ pid()

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

Implements pocketmine\network\mcpe\protocol\Packet.

Definition at line 36 of file DataPacket.php.

Member Data Documentation

◆ $chainedSubCommandData

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$chainedSubCommandData = []

Definition at line 116 of file AvailableCommandsPacket.php.

◆ $chainedSubCommandValues

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$chainedSubCommandValues = []

Definition at line 101 of file AvailableCommandsPacket.php.

◆ $commandData

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$commandData = []

Definition at line 121 of file AvailableCommandsPacket.php.

◆ $enumConstraints

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$enumConstraints = []

Definition at line 131 of file AvailableCommandsPacket.php.

◆ $enums

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$enums = []

Definition at line 111 of file AvailableCommandsPacket.php.

◆ $enumValues

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$enumValues = []

Definition at line 96 of file AvailableCommandsPacket.php.

◆ $postfixes

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$postfixes = []

Definition at line 106 of file AvailableCommandsPacket.php.

◆ $recipientSubId

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

Definition at line 34 of file DataPacket.php.

◆ $senderSubId

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

Definition at line 33 of file DataPacket.php.

◆ $softEnums

array pocketmine\network\mcpe\protocol\AvailableCommandsPacket::$softEnums = []

Definition at line 126 of file AvailableCommandsPacket.php.

◆ ARG_FLAG_ENUM

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_FLAG_ENUM = 0x200000

Enums are a little different: they are composed as follows: ARG_FLAG_ENUM | ARG_FLAG_VALID | (enum index)

Definition at line 85 of file AvailableCommandsPacket.php.

◆ ARG_FLAG_POSTFIX

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_FLAG_POSTFIX = 0x1000000

This is used for /xp <level: int>L. It can only be applied to integer parameters.

Definition at line 88 of file AvailableCommandsPacket.php.

◆ ARG_FLAG_SOFT_ENUM

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_FLAG_SOFT_ENUM = 0x4000000

Definition at line 90 of file AvailableCommandsPacket.php.

◆ ARG_FLAG_VALID

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_FLAG_VALID = 0x100000

This flag is set on all types EXCEPT the POSTFIX type. Not completely sure what this is for, but it is required for the argtype to work correctly. VALID seems as good a name as any.

Definition at line 45 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_BLOCK_STATES

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_BLOCK_STATES = ArgTypes::BLOCK_STATE_ARRAY

Definition at line 77 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_COMMAND

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_COMMAND = ArgTypes::CODEBUILDERARGS

Definition at line 79 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_COMPARE_OPERATOR

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_COMPARE_OPERATOR = ArgTypes::COMPAREOPERATOR

Definition at line 56 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_EQUIPMENT_SLOT

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_EQUIPMENT_SLOT = ArgTypes::EQUIPMENTSLOTENUM

Definition at line 65 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_FILEPATH

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_FILEPATH = ArgTypes::PATHCOMMAND

Definition at line 61 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_FLOAT

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_FLOAT = ArgTypes::VAL

Definition at line 52 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_FULL_INTEGER_RANGE

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_FULL_INTEGER_RANGE = ArgTypes::FULLINTEGERRANGE

Definition at line 63 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_INT

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_INT = ArgTypes::INT

Basic parameter types. These must be combined with the ARG_FLAG_VALID constant. ARG_FLAG_VALID | (type const)

Definition at line 51 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_INT_POSITION

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_INT_POSITION = ArgTypes::POSITION

Definition at line 68 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_JSON

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_JSON = ArgTypes::JSON_OBJECT

Definition at line 75 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_MESSAGE

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_MESSAGE = ArgTypes::MESSAGE_ROOT

Definition at line 71 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_OPERATOR

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_OPERATOR = ArgTypes::OPERATOR

Definition at line 55 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_POSITION

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_POSITION = ArgTypes::POSITION_FLOAT

Definition at line 69 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_RAWTEXT

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_RAWTEXT = ArgTypes::RAWTEXT

Definition at line 73 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_STRING

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_STRING = ArgTypes::ID

Definition at line 66 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_TARGET

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_TARGET = ArgTypes::SELECTION

Definition at line 57 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_VALUE

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_VALUE = ArgTypes::RVAL

Definition at line 53 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_WILDCARD_INT

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_WILDCARD_INT = ArgTypes::WILDCARDINT

Definition at line 54 of file AvailableCommandsPacket.php.

◆ ARG_TYPE_WILDCARD_TARGET

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::ARG_TYPE_WILDCARD_TARGET = ArgTypes::WILDCARDSELECTION

Definition at line 59 of file AvailableCommandsPacket.php.

◆ NETWORK_ID

const pocketmine\network\mcpe\protocol\AvailableCommandsPacket::NETWORK_ID = ProtocolInfo::AVAILABLE_COMMANDS_PACKET

Definition at line 39 of file AvailableCommandsPacket.php.

◆ PID_MASK

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

Definition at line 27 of file DataPacket.php.


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