PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\network\query\DedicatedQueryNetworkInterface Class Reference
+ Inheritance diagram for pocketmine\network\query\DedicatedQueryNetworkInterface:
+ Collaboration diagram for pocketmine\network\query\DedicatedQueryNetworkInterface:

Public Member Functions

 __construct (private string $ip, private int $port, bool $ipV6, private \Logger $logger)
 
 addRawPacketFilter (string $regex)
 
 blockAddress (string $address, int $timeout=300)
 
 sendRawPacket (string $address, int $port, string $payload)
 
 setName (string $name)
 
 setNetwork (Network $network)
 
 shutdown ()
 
 start ()
 
 tick ()
 
 unblockAddress (string $address)
 

Detailed Description

This is a supplementary network interface to maintain Query functionality when the RakLibInterface is not registered.

Normally, Query runs on the same port as RakLib does, so Query handles packets coming in on RakLib's socket instead of using its own interface.

However, it's necessary to have a separate interface for the cases where the RakLib interface is either not registered or running on a different port than Query.

Definition at line 62 of file DedicatedQueryNetworkInterface.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\network\query\DedicatedQueryNetworkInterface::__construct ( private string  $ip,
private int  $port,
bool  $ipV6,
private \Logger  $logger 
)

Definition at line 73 of file DedicatedQueryNetworkInterface.php.

Member Function Documentation

◆ addRawPacketFilter()

pocketmine\network\query\DedicatedQueryNetworkInterface::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 158 of file DedicatedQueryNetworkInterface.php.

◆ blockAddress()

pocketmine\network\query\DedicatedQueryNetworkInterface::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 139 of file DedicatedQueryNetworkInterface.php.

◆ sendRawPacket()

pocketmine\network\query\DedicatedQueryNetworkInterface::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 151 of file DedicatedQueryNetworkInterface.php.

◆ setName()

pocketmine\network\query\DedicatedQueryNetworkInterface::setName ( string  $name)

◆ setNetwork()

pocketmine\network\query\DedicatedQueryNetworkInterface::setNetwork ( Network  $network)

◆ shutdown()

pocketmine\network\query\DedicatedQueryNetworkInterface::shutdown ( )

Gracefully shuts down the network interface.

Implements pocketmine\network\NetworkInterface.

Definition at line 162 of file DedicatedQueryNetworkInterface.php.

◆ start()

pocketmine\network\query\DedicatedQueryNetworkInterface::start ( )

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

Exceptions
NetworkInterfaceStartException

Implements pocketmine\network\NetworkInterface.

Definition at line 89 of file DedicatedQueryNetworkInterface.php.

◆ tick()

pocketmine\network\query\DedicatedQueryNetworkInterface::tick ( )

Called every tick to process events on the interface.

Implements pocketmine\network\NetworkInterface.

Definition at line 105 of file DedicatedQueryNetworkInterface.php.

◆ unblockAddress()

pocketmine\network\query\DedicatedQueryNetworkInterface::unblockAddress ( string  $address)

Unblocks a previously-blocked address.

Implements pocketmine\network\AdvancedNetworkInterface.

Definition at line 143 of file DedicatedQueryNetworkInterface.php.


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