Skip to content

AdvancedNetworkInterface ​

interface · pocketmine\network\AdvancedNetworkInterface · source

Extends NetworkInterface

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

Methods ​

addRawPacketFilter() ​

php
public function addRawPacketFilter(string $regex) : 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() ​

php
public function blockAddress(string $address, int $timeout = 300) : void

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

sendRawPacket() ​

php
public function sendRawPacket(string $address, int $port, string $payload) : void

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

setNetwork() ​

php
public function setNetwork(\pocketmine\network\Network $network) : void

unblockAddress() ​

php
public function unblockAddress(string $address) : void

Unblocks a previously-blocked address.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.