Phpcraft
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
Phpcraft\Packet\PluginMessage\PluginMessagePacket Class Reference
Inheritance diagram for Phpcraft\Packet\PluginMessage\PluginMessagePacket:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\Packet\PluginMessage\PluginMessagePacket:
Collaboration graph
[legend]

Public Member Functions

 send (Connection $con)
 
 __toString ()
 

Public Attributes

const CHANNEL_REGISTER = "minecraft:register"
 
const CHANNEL_UNREGISTER = "minecraft:unregister"
 
const CHANNEL_BRAND = "minecraft:brand"
 
const CHANNEL_BUNGEECORD = "bungeecord:main"
 
 $channel
 
 $data
 

Protected Member Functions

 __construct (string $packet_name, string $channel="", string $data="")
 
 send_ (Connection $con)
 

Static Protected Member Functions

static readChannel (Connection $con)
 

Additional Inherited Members

- Static Public Member Functions inherited from Phpcraft\Packet\Packet
static read (Connection $con)
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\PluginMessage\PluginMessagePacket::__construct ( string  $packet_name,
string  $channel = "",
string  $data = "" 
)
protected

Member Function Documentation

◆ __toString()

Phpcraft\Packet\PluginMessage\PluginMessagePacket::__toString ( )

◆ readChannel()

static Phpcraft\Packet\PluginMessage\PluginMessagePacket::readChannel ( Connection  $con)
staticprotected
Parameters
Connection$con
Returns
string
Exceptions
IOException

◆ send()

Phpcraft\Packet\PluginMessage\PluginMessagePacket::send ( Connection  $con)

Adds the packet's ID and payload to the Connection's write buffer and sends it over the wire if the connection has a stream. Note that in some cases this will produce multiple Minecraft packets, therefore you should only use this on connections without a stream if you know what you're doing.

Parameters
Connection$con
Returns
void
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send_()

Phpcraft\Packet\PluginMessage\PluginMessagePacket::send_ ( Connection  $con)
protected

Member Data Documentation

◆ $channel

string Phpcraft\Packet\PluginMessage\PluginMessagePacket::$channel

The name of the plugin message's channel.

◆ $data

string Phpcraft\Packet\PluginMessage\PluginMessagePacket::$data

The data of the plugin message; binary string, as it could be anything.

◆ CHANNEL_BRAND

const Phpcraft\Packet\PluginMessage\PluginMessagePacket::CHANNEL_BRAND = "minecraft:brand"

◆ CHANNEL_BUNGEECORD

const Phpcraft\Packet\PluginMessage\PluginMessagePacket::CHANNEL_BUNGEECORD = "bungeecord:main"

◆ CHANNEL_REGISTER

const Phpcraft\Packet\PluginMessage\PluginMessagePacket::CHANNEL_REGISTER = "minecraft:register"

◆ CHANNEL_UNREGISTER

const Phpcraft\Packet\PluginMessage\PluginMessagePacket::CHANNEL_UNREGISTER = "minecraft:unregister"