Network
in package
Table of Contents
- $advancedInterfaces : array<string|int, AdvancedNetworkInterface>
- $bandwidthTracker : BidirectionalBandwidthStatsTracker
- $bannedIps : array<string|int, int>
- $interfaces : array<string|int, NetworkInterface>
- $logger : Logger
- $name : string
- $rawPacketHandlers : array<string|int, RawPacketHandler>
- $sessionManager : NetworkSessionManager
- __construct() : mixed
- blockAddress() : void
- Blocks an IP address from the main interface. Setting timeout to -1 will block it forever
- getBandwidthTracker() : BidirectionalBandwidthStatsTracker
- getConnectionCount() : int
- getInterfaces() : array<string|int, NetworkInterface>
- getName() : string
- getSessionManager() : NetworkSessionManager
- processRawPacket() : void
- registerInterface() : bool
- registerRawPacketHandler() : void
- Registers a raw packet handler on the network.
- sendPacket() : void
- setName() : void
- Sets the server name shown on each interface Query
- tick() : void
- unblockAddress() : void
- unregisterInterface() : void
- unregisterRawPacketHandler() : void
- Unregisters a previously-registered raw packet handler.
- updateName() : void
Properties
$advancedInterfaces
private
array<string|int, AdvancedNetworkInterface>
$advancedInterfaces
= []
$bandwidthTracker
private
BidirectionalBandwidthStatsTracker
$bandwidthTracker
$bannedIps
private
array<string|int, int>
$bannedIps
= []
$interfaces
private
array<string|int, NetworkInterface>
$interfaces
= []
$logger
private
Logger
$logger
$name
private
string
$name
$rawPacketHandlers
private
array<string|int, RawPacketHandler>
$rawPacketHandlers
= []
$sessionManager
private
NetworkSessionManager
$sessionManager
Methods
__construct()
public
__construct(Logger $logger) : mixed
Parameters
- $logger : Logger
Return values
mixed —blockAddress()
Blocks an IP address from the main interface. Setting timeout to -1 will block it forever
public
blockAddress(string $address[, int $timeout = 300 ]) : void
Parameters
- $address : string
- $timeout : int = 300
Return values
void —getBandwidthTracker()
public
getBandwidthTracker() : BidirectionalBandwidthStatsTracker
Return values
BidirectionalBandwidthStatsTracker —getConnectionCount()
public
getConnectionCount() : int
Return values
int —getInterfaces()
public
getInterfaces() : array<string|int, NetworkInterface>
Return values
array<string|int, NetworkInterface> —getName()
public
getName() : string
Return values
string —getSessionManager()
public
getSessionManager() : NetworkSessionManager
Return values
NetworkSessionManager —processRawPacket()
public
processRawPacket(AdvancedNetworkInterface $interface, string $address, int $port, string $packet) : void
Parameters
- $interface : AdvancedNetworkInterface
- $address : string
- $port : int
- $packet : string
Return values
void —registerInterface()
public
registerInterface(NetworkInterface $interface) : bool
Parameters
- $interface : NetworkInterface
Tags
Return values
bool —registerRawPacketHandler()
Registers a raw packet handler on the network.
public
registerRawPacketHandler(RawPacketHandler $handler) : void
Parameters
- $handler : RawPacketHandler
Return values
void —sendPacket()
public
sendPacket(string $address, int $port, string $payload) : void
Parameters
- $address : string
- $port : int
- $payload : string
Return values
void —setName()
Sets the server name shown on each interface Query
public
setName(string $name) : void
Parameters
- $name : string
Return values
void —tick()
public
tick() : void
Return values
void —unblockAddress()
public
unblockAddress(string $address) : void
Parameters
- $address : string
Return values
void —unregisterInterface()
public
unregisterInterface(NetworkInterface $interface) : void
Parameters
- $interface : NetworkInterface
Tags
Return values
void —unregisterRawPacketHandler()
Unregisters a previously-registered raw packet handler.
public
unregisterRawPacketHandler(RawPacketHandler $handler) : void
Parameters
- $handler : RawPacketHandler
Return values
void —updateName()
public
updateName() : void