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

Public Member Functions

 __construct (Server $server, string $ip, int $port, bool $ipV6, PacketBroadcaster $packetBroadcaster, EntityEventBroadcaster $entityEventBroadcaster, TypeConverter $typeConverter)
 
 addRawPacketFilter (string $regex)
 
 blockAddress (string $address, int $timeout=300)
 
 close (int $sessionId)
 
 onBandwidthStatsUpdate (int $bytesSentDiff, int $bytesReceivedDiff)
 
 onClientConnect (int $sessionId, string $address, int $port, int $clientID)
 
 onClientDisconnect (int $sessionId, int $reason)
 
 onPacketAck (int $sessionId, int $identifierACK)
 
 onPacketReceive (int $sessionId, string $packet)
 
 onPingMeasure (int $sessionId, int $pingMS)
 
 onRawPacketReceive (string $address, int $port, string $payload)
 
 putPacket (int $sessionId, string $payload, bool $immediate=true, ?int $receiptId=null)
 
 sendRawPacket (string $address, int $port, string $payload)
 
 setName (string $name)
 
 setNetwork (Network $network)
 
 setPacketLimit (int $limit)
 
 setPortCheck (bool $name)
 
 shutdown ()
 
 start ()
 
 tick ()
 
 unblockAddress (string $address)
 

Detailed Description

Definition at line 61 of file RakLibInterface.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\network\mcpe\raklib\RakLibInterface::__construct ( Server  $server,
string  $ip,
int  $port,
bool  $ipV6,
PacketBroadcaster  $packetBroadcaster,
EntityEventBroadcaster  $entityEventBroadcaster,
TypeConverter  $typeConverter 
)

Definition at line 88 of file RakLibInterface.php.

Member Function Documentation

◆ addRawPacketFilter()

pocketmine\network\mcpe\raklib\RakLibInterface::addRawPacketFilter ( string  $regex)

Adds a regex filter for raw packets to this network interface. This filter should be used to check validity of raw packets before relaying them to the main thread.

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 250 of file RakLibInterface.php.

◆ blockAddress()

pocketmine\network\mcpe\raklib\RakLibInterface::blockAddress ( string  $address,
int  $timeout = 300 
)

Prevents packets received from the IP address getting processed for the given timeout.

Parameters
int$timeoutSeconds

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 234 of file RakLibInterface.php.

◆ close()

pocketmine\network\mcpe\raklib\RakLibInterface::close ( int  $sessionId)

Definition at line 174 of file RakLibInterface.php.

◆ onBandwidthStatsUpdate()

pocketmine\network\mcpe\raklib\RakLibInterface::onBandwidthStatsUpdate ( int  $bytesSentDiff,
int  $bytesReceivedDiff 
)

Implements raklib\server\ServerEventListener.

Definition at line 290 of file RakLibInterface.php.

◆ onClientConnect()

pocketmine\network\mcpe\raklib\RakLibInterface::onClientConnect ( int  $sessionId,
string  $address,
int  $port,
int  $clientID 
)

Implements raklib\server\ServerEventListener.

Definition at line 186 of file RakLibInterface.php.

◆ onClientDisconnect()

pocketmine\network\mcpe\raklib\RakLibInterface::onClientDisconnect ( int  $sessionId,
int  $reason 
)
Parameters
int$reasonone of the DisconnectReason constants @phpstan-param DisconnectReason::* $reason
See also
DisconnectReason

Implements raklib\server\ServerEventListener.

Definition at line 161 of file RakLibInterface.php.

◆ onPacketAck()

pocketmine\network\mcpe\raklib\RakLibInterface::onPacketAck ( int  $sessionId,
int  $identifierACK 
)

Implements raklib\server\ServerEventListener.

Definition at line 254 of file RakLibInterface.php.

◆ onPacketReceive()

pocketmine\network\mcpe\raklib\RakLibInterface::onPacketReceive ( int  $sessionId,
string  $packet 
)

Implements raklib\server\ServerEventListener.

Definition at line 202 of file RakLibInterface.php.

◆ onPingMeasure()

pocketmine\network\mcpe\raklib\RakLibInterface::onPingMeasure ( int  $sessionId,
int  $pingMS 
)

Implements raklib\server\ServerEventListener.

Definition at line 306 of file RakLibInterface.php.

◆ onRawPacketReceive()

pocketmine\network\mcpe\raklib\RakLibInterface::onRawPacketReceive ( string  $address,
int  $port,
string  $payload 
)

Implements raklib\server\ServerEventListener.

Definition at line 242 of file RakLibInterface.php.

◆ putPacket()

pocketmine\network\mcpe\raklib\RakLibInterface::putPacket ( int  $sessionId,
string  $payload,
bool  $immediate = true,
?int  $receiptId = null 
)

Definition at line 294 of file RakLibInterface.php.

◆ sendRawPacket()

pocketmine\network\mcpe\raklib\RakLibInterface::sendRawPacket ( string  $address,
int  $port,
string  $payload 
)

Sends a raw payload to the network interface, bypassing any sessions.

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 246 of file RakLibInterface.php.

◆ setName()

pocketmine\network\mcpe\raklib\RakLibInterface::setName ( string  $name)

Implements pocketmine\network\NetworkInterface.

Definition at line 260 of file RakLibInterface.php.

◆ setNetwork()

pocketmine\network\mcpe\raklib\RakLibInterface::setNetwork ( Network  $network)

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 147 of file RakLibInterface.php.

◆ setPacketLimit()

pocketmine\network\mcpe\raklib\RakLibInterface::setPacketLimit ( int  $limit)

Definition at line 286 of file RakLibInterface.php.

◆ setPortCheck()

pocketmine\network\mcpe\raklib\RakLibInterface::setPortCheck ( bool  $name)

Definition at line 282 of file RakLibInterface.php.

◆ shutdown()

pocketmine\network\mcpe\raklib\RakLibInterface::shutdown ( )

Gracefully shuts down the network interface.

Implements pocketmine\network\NetworkInterface.

Definition at line 181 of file RakLibInterface.php.

References pocketmine\server().

+ Here is the call graph for this function:

◆ start()

pocketmine\network\mcpe\raklib\RakLibInterface::start ( )

Performs actions needed to start the interface after it is registered.

Exceptions
NetworkInterfaceStartException

Implements pocketmine\network\NetworkInterface.

Definition at line 137 of file RakLibInterface.php.

◆ tick()

pocketmine\network\mcpe\raklib\RakLibInterface::tick ( )

Called every tick to process events on the interface.

Implements pocketmine\network\NetworkInterface.

Definition at line 151 of file RakLibInterface.php.

◆ unblockAddress()

pocketmine\network\mcpe\raklib\RakLibInterface::unblockAddress ( string  $address)

Unblocks a previously-blocked address.

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 238 of file RakLibInterface.php.


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