PocketMine
Network Class Reference

Public Member Functions

 __construct (Server $server)
 
 addStatistics ($upload, $download)
 
 getUpload ()
 
 getDownload ()
 
 resetStatistics ()
 
 getInterfaces ()
 
 processInterfaces ()
 
 registerInterface (SourceInterface $interface)
 
 unregisterInterface (SourceInterface $interface)
 
 setName ($name)
 
 getName ()
 
 updateName ()
 
 registerPacket ($id, $class)
 
 getServer ()
 
 processBatch (BatchPacket $packet, Player $p)
 
 sendPacket ($address, $port, $payload)
 
 blockAddress ($address, $timeout=300)
 

Data Fields

const CHANNEL_NONE = 0
 
const CHANNEL_PRIORITY = 1
 
const CHANNEL_WORLD_CHUNKS = 2
 
const CHANNEL_MOVEMENT = 3
 
const CHANNEL_BLOCKS = 4
 
const CHANNEL_WORLD_EVENTS = 5
 
const CHANNEL_ENTITY_SPAWNING = 6
 
const CHANNEL_TEXT = 7
 
const CHANNEL_END = 31
 

Static Public Attributes

static $BATCH_THRESHOLD = 512
 

Member Function Documentation

blockAddress (   $address,
  $timeout = 300 
)

Blocks an IP address from the main interface. Setting timeout to -1 will block it forever

Parameters
string$address
int$timeout
getInterfaces ( )
Returns
SourceInterface[]
registerInterface ( SourceInterface  $interface)
Parameters
SourceInterface$interface
registerPacket (   $id,
  $class 
)
Parameters
int$id0-255
DataPacket$class
sendPacket (   $address,
  $port,
  $payload 
)
Parameters
string$address
int$port
string$payload
setName (   $name)

Sets the server name shown on each interface Query

Parameters
string$name
unregisterInterface ( SourceInterface  $interface)
Parameters
SourceInterface$interface

Field Documentation

const CHANNEL_BLOCKS = 4
const CHANNEL_END = 31
const CHANNEL_ENTITY_SPAWNING = 6
const CHANNEL_MOVEMENT = 3
const CHANNEL_NONE = 0
const CHANNEL_PRIORITY = 1
const CHANNEL_TEXT = 7
const CHANNEL_WORLD_CHUNKS = 2
const CHANNEL_WORLD_EVENTS = 5

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