DedicatedQueryNetworkInterface
in package
implements
AdvancedNetworkInterface
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.
Interfaces, Classes, Traits and Enums
- AdvancedNetworkInterface
- Advanced network interfaces have some additional capabilities, such as being able to ban addresses and process raw packets.
Table of Contents
- $blockedIps : array<string|int, int>
- $ip : string
- $logger : Logger
- $network : Network
- $port : int
- $rawPacketPatterns : array<string|int, string>
- $socket : Socket
- __construct() : mixed
- addRawPacketFilter() : void
- 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.
- blockAddress() : void
- Prevents packets received from the IP address getting processed for the given timeout.
- sendRawPacket() : void
- Sends a raw payload to the network interface, bypassing any sessions.
- setName() : void
- setNetwork() : void
- shutdown() : void
- start() : void
- tick() : void
- unblockAddress() : void
- Unblocks a previously-blocked address.
Properties
$blockedIps
private
array<string|int, int>
$blockedIps
= []
address => timeout time
Tags
$ip
private
string
$ip
$logger
private
Logger
$logger
$network
private
Network
$network
$port
private
int
$port
$rawPacketPatterns
private
array<string|int, string>
$rawPacketPatterns
= []
$socket
private
Socket
$socket
Methods
__construct()
public
__construct(string $ip, int $port, bool $ipV6, Logger $logger) : mixed
Parameters
- $ip : string
- $port : int
- $ipV6 : bool
- $logger : Logger
Return values
mixed —addRawPacketFilter()
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.
public
addRawPacketFilter(string $regex) : void
Parameters
- $regex : string
Return values
void —blockAddress()
Prevents packets received from the IP address getting processed for the given timeout.
public
blockAddress(string $address[, int $timeout = 300 ]) : void
Parameters
- $address : string
- $timeout : int = 300
-
Seconds
Return values
void —sendRawPacket()
Sends a raw payload to the network interface, bypassing any sessions.
public
sendRawPacket(string $address, int $port, string $payload) : void
Parameters
- $address : string
- $port : int
- $payload : string
Return values
void —setName()
public
setName(string $name) : void
Parameters
- $name : string
Return values
void —setNetwork()
public
setNetwork(Network $network) : void
Parameters
- $network : Network
Return values
void —shutdown()
public
shutdown() : void
Return values
void —start()
public
start() : void
Return values
void —tick()
public
tick() : void
Return values
void —unblockAddress()
Unblocks a previously-blocked address.
public
unblockAddress(string $address) : void
Parameters
- $address : string