mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
Improve documentation of SourceInterface and AdvancedSourceInterface
This commit is contained in:
parent
bc9a387b0b
commit
965f0d670d
@ -26,15 +26,23 @@ declare(strict_types=1);
|
|||||||
*/
|
*/
|
||||||
namespace pocketmine\network;
|
namespace pocketmine\network;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Advanced network interfaces have some additional capabilities, such as being able to ban addresses and process raw
|
||||||
|
* packets.
|
||||||
|
*/
|
||||||
interface AdvancedSourceInterface extends SourceInterface{
|
interface AdvancedSourceInterface extends SourceInterface{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Prevents packets received from the IP address getting processed for the given timeout.
|
||||||
|
*
|
||||||
* @param string $address
|
* @param string $address
|
||||||
* @param int $timeout Seconds
|
* @param int $timeout Seconds
|
||||||
*/
|
*/
|
||||||
public function blockAddress(string $address, int $timeout = 300) : void;
|
public function blockAddress(string $address, int $timeout = 300) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Unblocks a previously-blocked address.
|
||||||
|
*
|
||||||
* @param string $address
|
* @param string $address
|
||||||
*/
|
*/
|
||||||
public function unblockAddress(string $address) : void;
|
public function unblockAddress(string $address) : void;
|
||||||
@ -45,6 +53,8 @@ interface AdvancedSourceInterface extends SourceInterface{
|
|||||||
public function setNetwork(Network $network) : void;
|
public function setNetwork(Network $network) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Sends a raw payload to the network interface, bypassing any sessions.
|
||||||
|
*
|
||||||
* @param string $address
|
* @param string $address
|
||||||
* @param int $port
|
* @param int $port
|
||||||
* @param string $payload
|
* @param string $payload
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\network\mcpe\protocol\DataPacket;
|
|||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classes that implement this interface will be able to be attached to players
|
* Network interfaces are transport layers which can be used to transmit packets between the server and clients.
|
||||||
*/
|
*/
|
||||||
interface SourceInterface{
|
interface SourceInterface{
|
||||||
|
|
||||||
@ -69,8 +69,14 @@ interface SourceInterface{
|
|||||||
*/
|
*/
|
||||||
public function process() : void;
|
public function process() : void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gracefully shuts down the network interface.
|
||||||
|
*/
|
||||||
public function shutdown() : void;
|
public function shutdown() : void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shuts down the network interface in an emergency situation, such as due to a crash.
|
||||||
|
*/
|
||||||
public function emergencyShutdown() : void;
|
public function emergencyShutdown() : void;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user