mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Rename DataPacketPreReceiveEvent -> DataPacketDecodeEvent
thank you @IvanCraft623 for the suggestion
This commit is contained in:
parent
941fd03998
commit
ef45180b80
@ -31,7 +31,7 @@ use pocketmine\network\mcpe\NetworkSession;
|
|||||||
* Called before a packet is decoded and handled by the network session.
|
* Called before a packet is decoded and handled by the network session.
|
||||||
* Cancelling this event will drop the packet without decoding it, minimizing wasted CPU time.
|
* Cancelling this event will drop the packet without decoding it, minimizing wasted CPU time.
|
||||||
*/
|
*/
|
||||||
class DataPacketPreReceiveEvent extends ServerEvent implements Cancellable{
|
class DataPacketDecodeEvent extends ServerEvent implements Cancellable{
|
||||||
use CancellableTrait;
|
use CancellableTrait;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe;
|
|||||||
|
|
||||||
use pocketmine\entity\effect\EffectInstance;
|
use pocketmine\entity\effect\EffectInstance;
|
||||||
use pocketmine\event\player\PlayerDuplicateLoginEvent;
|
use pocketmine\event\player\PlayerDuplicateLoginEvent;
|
||||||
use pocketmine\event\server\DataPacketPreReceiveEvent;
|
use pocketmine\event\server\DataPacketDecodeEvent;
|
||||||
use pocketmine\event\server\DataPacketReceiveEvent;
|
use pocketmine\event\server\DataPacketReceiveEvent;
|
||||||
use pocketmine\event\server\DataPacketSendEvent;
|
use pocketmine\event\server\DataPacketSendEvent;
|
||||||
use pocketmine\form\Form;
|
use pocketmine\form\Form;
|
||||||
@ -412,7 +412,7 @@ class NetworkSession{
|
|||||||
$timings->startTiming();
|
$timings->startTiming();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$ev = new DataPacketPreReceiveEvent($this, $packet->pid(), $buffer);
|
$ev = new DataPacketDecodeEvent($this, $packet->pid(), $buffer);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user