Documentation

AdvancedNetworkInterface extends NetworkInterface

Advanced network interfaces have some additional capabilities, such as being able to ban addresses and process raw packets.

Table of Contents

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
Gracefully shuts down the network interface.
start()  : void
Performs actions needed to start the interface after it is registered.
tick()  : void
Called every tick to process events on the interface.
unblockAddress()  : void
Unblocks a previously-blocked address.

Methods

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

shutdown()

Gracefully shuts down the network interface.

public shutdown() : void
Return values
void

tick()

Called every tick to process events on the interface.

public tick() : void
Return values
void

unblockAddress()

Unblocks a previously-blocked address.

public unblockAddress(string $address) : void
Parameters
$address : string
Return values
void

Search results