PocketMine-MP 5.21.1 git-e598364f0695495cbe71ddf0b62f134b51091c6e
raklib\server\Server Class Reference
+ Inheritance diagram for raklib\server\Server:
+ Collaboration diagram for raklib\server\Server:

Public Member Functions

 __construct (protected int $serverId, protected \Logger $logger, protected ServerSocket $socket, protected int $maxMtuSize, ProtocolAcceptor $protocolAcceptor, private ServerEventSource $eventSource, private ServerEventListener $eventListener, private ExceptionTraceCleaner $traceCleaner, private int $recvMaxSplitParts=ServerSession::DEFAULT_MAX_SPLIT_PART_COUNT, private int $recvMaxConcurrentSplits=ServerSession::DEFAULT_MAX_CONCURRENT_SPLIT_COUNT)
 
 addRawPacketFilter (string $regex)
 
 blockAddress (string $address, int $timeout=300)
 
 closeSession (int $sessionId)
 
 createSession (InternetAddress $address, int $clientId, int $mtuSize)
 
 getEventListener ()
 
 getID ()
 
 getLogger ()
 
 getMaxMtuSize ()
 
 getName ()
 
 getPort ()
 
 getSessionByAddress (InternetAddress $address)
 
 openSession (ServerSession $session)
 
 sendEncapsulated (int $sessionId, EncapsulatedPacket $packet, bool $immediate=false)
 
 sendPacket (Packet $packet, InternetAddress $address)
 
 sendRaw (string $address, int $port, string $payload)
 
 sessionExists (InternetAddress $address)
 
 setName (string $name)
 
 setPacketsPerTickLimit (int $limit)
 
 setPortCheck (bool $value)
 
 tickProcessor ()
 
 unblockAddress (string $address)
 
 waitShutdown ()
 

Public Attributes

bool $portChecking = false
 

Protected Attributes

array $block = []
 
array $ipSec = []
 
string $name = ""
 
int $nextSessionId = 0
 
int $packetLimit = 200
 
array $rawPacketFilters = []
 
int $receiveBytes = 0
 
int $sendBytes = 0
 
array $sessions = []
 
array $sessionsByAddress = []
 
bool $shutdown = false
 
int $ticks = 0
 
UnconnectedMessageHandler $unconnectedMessageHandler
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

raklib\server\Server::__construct ( protected int  $serverId,
protected \Logger  $logger,
protected ServerSocket  $socket,
protected int  $maxMtuSize,
ProtocolAcceptor  $protocolAcceptor,
private ServerEventSource  $eventSource,
private ServerEventListener  $eventListener,
private ExceptionTraceCleaner  $traceCleaner,
private int  $recvMaxSplitParts = ServerSession::DEFAULT_MAX_SPLIT_PART_COUNT,
private int  $recvMaxConcurrentSplits = ServerSession::DEFAULT_MAX_CONCURRENT_SPLIT_COUNT 
)

@phpstan-param positive-int $recvMaxSplitParts @phpstan-param positive-int $recvMaxConcurrentSplits

Definition at line 83 of file vendor/pocketmine/raklib/src/server/Server.php.

Member Function Documentation

◆ addRawPacketFilter()

raklib\server\Server::addRawPacketFilter ( string  $regex)

◆ blockAddress()

raklib\server\Server::blockAddress ( string  $address,
int  $timeout = 300 
)

◆ closeSession()

raklib\server\Server::closeSession ( int  $sessionId)

◆ createSession()

raklib\server\Server::createSession ( InternetAddress  $address,
int  $clientId,
int  $mtuSize 
)

◆ getEventListener()

raklib\server\Server::getEventListener ( )

◆ getID()

raklib\server\Server::getID ( )

◆ getLogger()

raklib\server\Server::getLogger ( )

◆ getMaxMtuSize()

raklib\server\Server::getMaxMtuSize ( )

◆ getName()

raklib\server\Server::getName ( )

◆ getPort()

raklib\server\Server::getPort ( )

◆ getSessionByAddress()

raklib\server\Server::getSessionByAddress ( InternetAddress  $address)

◆ openSession()

raklib\server\Server::openSession ( ServerSession  $session)

◆ sendEncapsulated()

raklib\server\Server::sendEncapsulated ( int  $sessionId,
EncapsulatedPacket  $packet,
bool  $immediate = false 
)

◆ sendPacket()

raklib\server\Server::sendPacket ( Packet  $packet,
InternetAddress  $address 
)

◆ sendRaw()

raklib\server\Server::sendRaw ( string  $address,
int  $port,
string  $payload 
)

◆ sessionExists()

raklib\server\Server::sessionExists ( InternetAddress  $address)

◆ setName()

raklib\server\Server::setName ( string  $name)

◆ setPacketsPerTickLimit()

raklib\server\Server::setPacketsPerTickLimit ( int  $limit)

◆ setPortCheck()

raklib\server\Server::setPortCheck ( bool  $value)

◆ tickProcessor()

raklib\server\Server::tickProcessor ( )

◆ unblockAddress()

raklib\server\Server::unblockAddress ( string  $address)

◆ waitShutdown()

raklib\server\Server::waitShutdown ( )

Disconnects all sessions and blocks until everything has been shut down properly.

Definition at line 145 of file vendor/pocketmine/raklib/src/server/Server.php.

Member Data Documentation

◆ $block

array raklib\server\Server::$block = []
protected

◆ $ipSec

array raklib\server\Server::$ipSec = []
protected

◆ $name

string raklib\server\Server::$name = ""
protected

◆ $nextSessionId

int raklib\server\Server::$nextSessionId = 0
protected

◆ $packetLimit

int raklib\server\Server::$packetLimit = 200
protected

◆ $portChecking

bool raklib\server\Server::$portChecking = false

◆ $rawPacketFilters

array raklib\server\Server::$rawPacketFilters = []
protected

◆ $receiveBytes

int raklib\server\Server::$receiveBytes = 0
protected

◆ $sendBytes

int raklib\server\Server::$sendBytes = 0
protected

◆ $sessions

array raklib\server\Server::$sessions = []
protected

◆ $sessionsByAddress

array raklib\server\Server::$sessionsByAddress = []
protected

◆ $shutdown

bool raklib\server\Server::$shutdown = false
protected

◆ $ticks

int raklib\server\Server::$ticks = 0
protected

◆ $unconnectedMessageHandler

UnconnectedMessageHandler raklib\server\Server::$unconnectedMessageHandler
protected

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