mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
DataPacketSendEvent: add array type validation
this API is used directly by plugins, so anything goes.
This commit is contained in:
parent
774df0fa4c
commit
e1b0e00c6f
@ -27,6 +27,7 @@ use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\ClientboundPacket;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
/**
|
||||
* Called when packets are sent to network sessions.
|
||||
@ -61,6 +62,7 @@ class DataPacketSendEvent extends ServerEvent implements Cancellable{
|
||||
* @param ClientboundPacket[] $packets
|
||||
*/
|
||||
public function setPackets(array $packets) : void{
|
||||
Utils::validateArrayValueType($packets, function(ClientboundPacket $_) : void{});
|
||||
$this->packets = $packets;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user