rename SessionHandler -> PacketHandler

This commit is contained in:
Dylan K. Taylor 2019-06-18 16:02:46 +01:00
parent 87c3636d44
commit b18bd4f33c
136 changed files with 284 additions and 284 deletions

View File

@ -34,14 +34,14 @@ use pocketmine\inventory\CreativeInventory;
use pocketmine\inventory\Inventory;
use pocketmine\math\Vector3;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\DeathSessionHandler;
use pocketmine\network\mcpe\handler\HandshakeSessionHandler;
use pocketmine\network\mcpe\handler\InGameSessionHandler;
use pocketmine\network\mcpe\handler\LoginSessionHandler;
use pocketmine\network\mcpe\handler\NullSessionHandler;
use pocketmine\network\mcpe\handler\PreSpawnSessionHandler;
use pocketmine\network\mcpe\handler\ResourcePacksSessionHandler;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\DeathPacketHandler;
use pocketmine\network\mcpe\handler\HandshakePacketHandler;
use pocketmine\network\mcpe\handler\InGamePacketHandler;
use pocketmine\network\mcpe\handler\LoginPacketHandler;
use pocketmine\network\mcpe\handler\NullPacketHandler;
use pocketmine\network\mcpe\handler\PreSpawnPacketHandler;
use pocketmine\network\mcpe\handler\ResourcePacksPacketHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
@ -116,7 +116,7 @@ class NetworkSession{
/** @var int */
private $ping;
/** @var SessionHandler */
/** @var PacketHandler */
private $handler;
/** @var bool */
@ -152,7 +152,7 @@ class NetworkSession{
$this->connectTime = time();
$this->setHandler(new LoginSessionHandler($this->server, $this));
$this->setHandler(new LoginPacketHandler($this->server, $this));
$this->manager->add($this);
$this->logger->info("Session opened");
@ -245,11 +245,11 @@ class NetworkSession{
$this->ping = $ping;
}
public function getHandler() : SessionHandler{
public function getHandler() : PacketHandler{
return $this->handler;
}
public function setHandler(SessionHandler $handler) : void{
public function setHandler(PacketHandler $handler) : void{
if($this->connected){ //TODO: this is fine since we can't handle anything from a disconnected session, but it might produce surprises in some cases
$this->handler = $handler;
$this->handler->setUp();
@ -439,7 +439,7 @@ class NetworkSession{
$this->disconnectGuard = true;
$func();
$this->disconnectGuard = false;
$this->setHandler(NullSessionHandler::getInstance());
$this->setHandler(NullPacketHandler::getInstance());
$this->connected = false;
$this->manager->remove($this);
$this->logger->info("Session closed due to $reason");
@ -554,7 +554,7 @@ class NetworkSession{
$this->cipher = new NetworkCipher($encryptionKey);
$this->setHandler(new HandshakeSessionHandler($this));
$this->setHandler(new HandshakePacketHandler($this));
$this->logger->debug("Enabled encryption");
}
@ -564,13 +564,13 @@ class NetworkSession{
$this->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::LOGIN_SUCCESS));
$this->logger->debug("Initiating resource packs phase");
$this->setHandler(new ResourcePacksSessionHandler($this, $this->server->getResourcePackManager()));
$this->setHandler(new ResourcePacksPacketHandler($this, $this->server->getResourcePackManager()));
}
public function onResourcePacksDone() : void{
$this->createPlayer();
$this->setHandler(new PreSpawnSessionHandler($this->server, $this->player, $this));
$this->setHandler(new PreSpawnPacketHandler($this->server, $this->player, $this));
$this->logger->debug("Waiting for spawn chunks");
}
@ -582,11 +582,11 @@ class NetworkSession{
public function onSpawn() : void{
$this->logger->debug("Received spawn response, entering in-game phase");
$this->player->doFirstSpawn();
$this->setHandler(new InGameSessionHandler($this->player, $this));
$this->setHandler(new InGamePacketHandler($this->player, $this));
}
public function onDeath() : void{
$this->setHandler(new DeathSessionHandler($this->player, $this));
$this->setHandler(new DeathPacketHandler($this->player, $this));
}
public function onRespawn() : void{
@ -595,7 +595,7 @@ class NetworkSession{
$this->syncAdventureSettings($this->player);
$this->syncAllInventoryContents();
$this->setHandler(new InGameSessionHandler($this->player, $this));
$this->setHandler(new InGamePacketHandler($this->player, $this));
}
public function syncMovement(Vector3 $pos, ?float $yaw = null, ?float $pitch = null, int $mode = MovePlayerPacket::MODE_NORMAL) : void{

View File

@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\PlayerActionPacket;
use pocketmine\network\mcpe\protocol\RespawnPacket;
use pocketmine\Player;
class DeathSessionHandler extends SessionHandler{
class DeathPacketHandler extends PacketHandler{
/** @var Player */
private $player;

View File

@ -29,7 +29,7 @@ use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
/**
* Handler responsible for awaiting client response from crypto handshake.
*/
class HandshakeSessionHandler extends SessionHandler{
class HandshakePacketHandler extends PacketHandler{
/** @var NetworkSession */
private $session;

View File

@ -93,7 +93,7 @@ use function trim;
/**
* This handler handles packets related to general gameplay.
*/
class InGameSessionHandler extends SessionHandler{
class InGamePacketHandler extends PacketHandler{
/** @var Player */
private $player;

View File

@ -40,7 +40,7 @@ use function base64_decode;
/**
* Handles the initial login phase of the session. This handler is used as the initial state.
*/
class LoginSessionHandler extends SessionHandler{
class LoginPacketHandler extends PacketHandler{
/** @var Server */
private $server;
@ -134,7 +134,7 @@ class LoginSessionHandler extends SessionHandler{
*/
protected function processLogin(LoginPacket $packet, bool $authRequired) : void{
$this->server->getAsyncPool()->submitTask(new ProcessLoginTask($this->session, $packet, $authRequired, NetworkCipher::$ENABLED));
$this->session->setHandler(NullSessionHandler::getInstance()); //drop packets received during login verification
$this->session->setHandler(NullPacketHandler::getInstance()); //drop packets received during login verification
}
protected function isCompatibleProtocol(int $protocolVersion) : bool{

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\handler;
/**
* Handler which simply ignores all packets received.
*/
final class NullSessionHandler extends SessionHandler{
final class NullPacketHandler extends PacketHandler{
/** @var self|null */
private static $instance = null;

View File

@ -155,7 +155,7 @@ use pocketmine\network\mcpe\protocol\VideoStreamConnectPacket;
*
* This class is an automatically generated stub. Do not edit it manually.
*/
abstract class SessionHandler{
abstract class PacketHandler{
public function setUp() : void{

View File

@ -36,7 +36,7 @@ use pocketmine\Server;
/**
* Handler used for the pre-spawn phase of the session.
*/
class PreSpawnSessionHandler extends SessionHandler{
class PreSpawnPacketHandler extends PacketHandler{
/** @var Server */
private $server;

View File

@ -42,7 +42,7 @@ use function substr;
* Handler used for the resource packs sequence phase of the session. This handler takes care of downloading resource
* packs to the client.
*/
class ResourcePacksSessionHandler extends SessionHandler{
class ResourcePacksPacketHandler extends PacketHandler{
private const PACK_CHUNK_SIZE = 1048576; //1MB
/** @var NetworkSession */

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class AddBehaviorTreePacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ADD_BEHAVIOR_TREE_PACKET;
@ -41,7 +41,7 @@ class AddBehaviorTreePacket extends DataPacket implements ClientboundPacket{
$this->putString($this->behaviorTreeJson);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAddBehaviorTree($this);
}
}

View File

@ -29,7 +29,7 @@ use pocketmine\entity\Attribute;
use pocketmine\entity\EntityIds;
use pocketmine\math\Vector3;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\EntityLink;
use function array_search;
use function count;
@ -239,7 +239,7 @@ class AddEntityPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAddEntity($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class AddItemEntityPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ADD_ITEM_ENTITY_PACKET;
@ -67,7 +67,7 @@ class AddItemEntityPacket extends DataPacket implements ClientboundPacket{
$this->putBool($this->isFromFishing);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAddItemEntity($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class AddPaintingPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ADD_PAINTING_PACKET;
@ -62,7 +62,7 @@ class AddPaintingPacket extends DataPacket implements ClientboundPacket{
$this->putString($this->title);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAddPainting($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\EntityLink;
use pocketmine\utils\UUID;
use function count;
@ -135,7 +135,7 @@ class AddPlayerPacket extends DataPacket implements ClientboundPacket{
$this->putString($this->deviceId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAddPlayer($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\PlayerPermissions;
class AdventureSettingsPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
@ -116,7 +116,7 @@ class AdventureSettingsPacket extends DataPacket implements ClientboundPacket, S
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAdventureSettings($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class AnimatePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::ANIMATE_PACKET;
@ -72,7 +72,7 @@ class AnimatePacket extends DataPacket implements ClientboundPacket, Serverbound
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAnimate($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class AutomationClientConnectPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::AUTOMATION_CLIENT_CONNECT_PACKET;
@ -41,7 +41,7 @@ class AutomationClientConnectPacket extends DataPacket implements ClientboundPac
$this->putString($this->serverUri);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAutomationClientConnect($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\CommandData;
use pocketmine\network\mcpe\protocol\types\CommandEnum;
use pocketmine\network\mcpe\protocol\types\CommandParameter;
@ -412,7 +412,7 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAvailableCommands($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function base64_decode;
class AvailableEntityIdentifiersPacket extends DataPacket implements ClientboundPacket{
@ -47,7 +47,7 @@ class AvailableEntityIdentifiersPacket extends DataPacket implements Clientbound
$this->put($this->namedtag ?? base64_decode(self::HARDCODED_NBT_BLOB));
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleAvailableEntityIdentifiers($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BiomeDefinitionListPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::BIOME_DEFINITION_LIST_PACKET;
@ -42,7 +42,7 @@ class BiomeDefinitionListPacket extends DataPacket implements ClientboundPacket{
$this->put($this->namedtag ?? self::HARDCODED_NBT_BLOB);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBiomeDefinitionList($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BlockEntityDataPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::BLOCK_ENTITY_DATA_PACKET;
@ -57,7 +57,7 @@ class BlockEntityDataPacket extends DataPacket implements ClientboundPacket, Ser
$this->put($this->namedtag);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBlockEntityData($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BlockEventPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::BLOCK_EVENT_PACKET;
@ -65,7 +65,7 @@ class BlockEventPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->eventData);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBlockEvent($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BlockPickRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::BLOCK_PICK_REQUEST_PACKET;
@ -55,7 +55,7 @@ class BlockPickRequestPacket extends DataPacket implements ServerboundPacket{
$this->putByte($this->hotbarSlot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBlockPickRequest($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BookEditPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::BOOK_EDIT_PACKET;
@ -114,7 +114,7 @@ class BookEditPacket extends DataPacket implements ServerboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBookEdit($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class BossEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::BOSS_EVENT_PACKET;
@ -177,7 +177,7 @@ class BossEventPacket extends DataPacket implements ClientboundPacket, Serverbou
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleBossEvent($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class CameraPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::CAMERA_PACKET;
@ -45,7 +45,7 @@ class CameraPacket extends DataPacket implements ClientboundPacket{
$this->putEntityUniqueId($this->playerUniqueId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCamera($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ChangeDimensionPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::CHANGE_DIMENSION_PACKET;
@ -51,7 +51,7 @@ class ChangeDimensionPacket extends DataPacket implements ClientboundPacket{
$this->putBool($this->respawn);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleChangeDimension($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ChunkRadiusUpdatedPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::CHUNK_RADIUS_UPDATED_PACKET;
@ -48,7 +48,7 @@ class ChunkRadiusUpdatedPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->radius);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleChunkRadiusUpdated($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ClientToServerHandshakePacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::CLIENT_TO_SERVER_HANDSHAKE_PACKET;
@ -43,7 +43,7 @@ class ClientToServerHandshakePacket extends DataPacket implements ServerboundPac
//No payload
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleClientToServerHandshake($this);
}
}

View File

@ -28,7 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\DimensionIds;
use pocketmine\network\mcpe\protocol\types\MapTrackedObject;
use pocketmine\utils\Color;
@ -207,7 +207,7 @@ class ClientboundMapItemDataPacket extends DataPacket implements ClientboundPack
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleClientboundMapItemData($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class CommandBlockUpdatePacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::COMMAND_BLOCK_UPDATE_PACKET;
@ -99,7 +99,7 @@ class CommandBlockUpdatePacket extends DataPacket implements ServerboundPacket{
$this->putBool($this->shouldTrackOutput);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCommandBlockUpdate($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\CommandOriginData;
use pocketmine\network\mcpe\protocol\types\CommandOutputMessage;
use pocketmine\utils\BinaryDataException;
@ -101,7 +101,7 @@ class CommandOutputPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCommandOutput($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\CommandOriginData;
class CommandRequestPacket extends DataPacket implements ServerboundPacket{
@ -50,7 +50,7 @@ class CommandRequestPacket extends DataPacket implements ServerboundPacket{
$this->putBool($this->isInternal);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCommandRequest($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ContainerClosePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_CLOSE_PACKET;
@ -48,7 +48,7 @@ class ContainerClosePacket extends DataPacket implements ClientboundPacket, Serv
$this->putByte($this->windowId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleContainerClose($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ContainerOpenPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_OPEN_PACKET;
@ -74,7 +74,7 @@ class ContainerOpenPacket extends DataPacket implements ClientboundPacket{
$this->putEntityUniqueId($this->entityUniqueId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleContainerOpen($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ContainerSetDataPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_SET_DATA_PACKET;
@ -68,7 +68,7 @@ class ContainerSetDataPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->value);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleContainerSetData($this);
}
}

View File

@ -32,7 +32,7 @@ use pocketmine\inventory\ShapelessRecipe;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\NetworkBinaryStream;
use function count;
use function str_repeat;
@ -226,7 +226,7 @@ class CraftingDataPacket extends DataPacket implements ClientboundPacket{
$this->putBool($this->cleanRecipes);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCraftingData($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\utils\UUID;
use function count;
@ -76,7 +76,7 @@ class CraftingEventPacket extends DataPacket implements ServerboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleCraftingEvent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class DisconnectPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::DISCONNECT_PACKET;
@ -67,7 +67,7 @@ class DisconnectPacket extends DataPacket implements ClientboundPacket, Serverbo
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleDisconnect($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class EntityEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_EVENT_PACKET;
@ -110,7 +110,7 @@ class EntityEventPacket extends DataPacket implements ClientboundPacket, Serverb
$this->putVarInt($this->data);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleEntityEvent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class EntityFallPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_FALL_PACKET;
@ -50,7 +50,7 @@ class EntityFallPacket extends DataPacket implements ServerboundPacket{
$this->putBool($this->isInVoid);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleEntityFall($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class EntityPickRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_PICK_REQUEST_PACKET;
@ -45,7 +45,7 @@ class EntityPickRequestPacket extends DataPacket implements ServerboundPacket{
$this->putByte($this->hotbarSlot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleEntityPickRequest($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class EventPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::EVENT_PACKET;
@ -67,7 +67,7 @@ class EventPacket extends DataPacket implements ClientboundPacket{
//TODO: also nice confusing mess
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleEvent($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function count;
class ExplodePacket extends DataPacket implements ClientboundPacket{
@ -77,7 +77,7 @@ class ExplodePacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleExplode($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class FullChunkDataPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::FULL_CHUNK_DATA_PACKET;
@ -58,7 +58,7 @@ class FullChunkDataPacket extends DataPacket implements ClientboundPacket{
$this->putString($this->data);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleFullChunkData($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
@ -41,7 +41,7 @@ class GameRulesChangedPacket extends DataPacket implements ClientboundPacket{
$this->putGameRules($this->gameRules);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleGameRulesChanged($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class GuiDataPickItemPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::GUI_DATA_PICK_ITEM_PACKET;
@ -49,7 +49,7 @@ class GuiDataPickItemPacket extends DataPacket implements ClientboundPacket{
$this->putLInt($this->hotbarSlot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleGuiDataPickItem($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class HurtArmorPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::HURT_ARMOR_PACKET;
@ -42,7 +42,7 @@ class HurtArmorPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->health);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleHurtArmor($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class InteractPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::INTERACT_PACKET;
@ -71,7 +71,7 @@ class InteractPacket extends DataPacket implements ServerboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleInteract($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function count;
class InventoryContentPacket extends DataPacket implements ClientboundPacket{
@ -66,7 +66,7 @@ class InventoryContentPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleInventoryContent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class InventorySlotPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::INVENTORY_SLOT_PACKET;
@ -58,7 +58,7 @@ class InventorySlotPacket extends DataPacket implements ClientboundPacket{
$this->putSlot($this->item);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleInventorySlot($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\MismatchTransactionData;
use pocketmine\network\mcpe\protocol\types\NormalTransactionData;
use pocketmine\network\mcpe\protocol\types\ReleaseItemTransactionData;
@ -80,7 +80,7 @@ class InventoryTransactionPacket extends DataPacket implements ClientboundPacket
$this->trData->encode($this);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleInventoryTransaction($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ItemFrameDropItemPacket extends DataPacket implements ServerboundPacket{
@ -46,7 +46,7 @@ class ItemFrameDropItemPacket extends DataPacket implements ServerboundPacket{
$this->putBlockPosition($this->x, $this->y, $this->z);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleItemFrameDropItem($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class LabTablePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::LAB_TABLE_PACKET;
@ -55,7 +55,7 @@ class LabTablePacket extends DataPacket implements ClientboundPacket, Serverboun
$this->putByte($this->reactionType);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLabTable($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class LecternUpdatePacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::LECTERN_UPDATE_PACKET;
@ -57,7 +57,7 @@ class LecternUpdatePacket extends DataPacket implements ServerboundPacket{
$this->putBool($this->dropBook);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLecternUpdate($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class LevelEventPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_EVENT_PACKET;
@ -141,7 +141,7 @@ class LevelEventPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->data);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLevelEvent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET;
@ -346,7 +346,7 @@ class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, Ser
$this->putBool($this->disableRelativeVolume);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLevelSoundEvent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
/**
* Useless leftover from a 1.8 refactor, does nothing
@ -65,7 +65,7 @@ class LevelSoundEventPacketV1 extends DataPacket{
$this->putBool($this->disableRelativeVolume);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLevelSoundEventPacketV1($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
/**
* Useless leftover from a 1.9 refactor, does nothing
@ -65,7 +65,7 @@ class LevelSoundEventPacketV2 extends DataPacket{
$this->putBool($this->disableRelativeVolume);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLevelSoundEventPacketV2($this);
}
}

View File

@ -28,7 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use Particle\Validator\Validator;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\utils\BinaryDataException;
use pocketmine\utils\BinaryStream;
use pocketmine\utils\Utils;
@ -178,7 +178,7 @@ class LoginPacket extends DataPacket implements ServerboundPacket{
//TODO
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleLogin($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MapCreateLockedCopyPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MAP_CREATE_LOCKED_COPY_PACKET;
@ -45,7 +45,7 @@ class MapCreateLockedCopyPacket extends DataPacket implements ServerboundPacket{
$this->putEntityUniqueId($this->newMapId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMapCreateLockedCopy($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MapInfoRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MAP_INFO_REQUEST_PACKET;
@ -43,7 +43,7 @@ class MapInfoRequestPacket extends DataPacket implements ServerboundPacket{
$this->putEntityUniqueId($this->mapId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMapInfoRequest($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MobArmorEquipmentPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET;
@ -72,7 +72,7 @@ class MobArmorEquipmentPacket extends DataPacket implements ClientboundPacket, S
$this->putSlot($this->feet);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMobArmorEquipment($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MobEffectPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::MOB_EFFECT_PACKET;
@ -85,7 +85,7 @@ class MobEffectPacket extends DataPacket implements ClientboundPacket{
$this->putVarInt($this->duration);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMobEffect($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MobEquipmentPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MOB_EQUIPMENT_PACKET;
@ -69,7 +69,7 @@ class MobEquipmentPacket extends DataPacket implements ClientboundPacket, Server
$this->putByte($this->windowId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMobEquipment($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ModalFormRequestPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::MODAL_FORM_REQUEST_PACKET;
@ -52,7 +52,7 @@ class ModalFormRequestPacket extends DataPacket implements ClientboundPacket{
$this->putString($this->formData);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleModalFormRequest($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ModalFormResponsePacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MODAL_FORM_RESPONSE_PACKET;
@ -45,7 +45,7 @@ class ModalFormResponsePacket extends DataPacket implements ServerboundPacket{
$this->putString($this->formData);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleModalFormResponse($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MoveEntityAbsolutePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MOVE_ENTITY_ABSOLUTE_PACKET;
@ -66,7 +66,7 @@ class MoveEntityAbsolutePacket extends DataPacket implements ClientboundPacket,
$this->putByteRotation($this->zRot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMoveEntityAbsolute($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\utils\BinaryDataException;
class MoveEntityDeltaPacket extends DataPacket implements ClientboundPacket{
@ -115,7 +115,7 @@ class MoveEntityDeltaPacket extends DataPacket implements ClientboundPacket{
$this->maybeWriteRotation(self::FLAG_HAS_ROT_Z, $this->zRot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMoveEntityDelta($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class MovePlayerPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::MOVE_PLAYER_PACKET;
@ -88,7 +88,7 @@ class MovePlayerPacket extends DataPacket implements ClientboundPacket, Serverbo
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleMovePlayer($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class NetworkChunkPublisherUpdatePacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::NETWORK_CHUNK_PUBLISHER_UPDATE_PACKET;
@ -58,7 +58,7 @@ class NetworkChunkPublisherUpdatePacket extends DataPacket implements Clientboun
$this->putUnsignedVarInt($this->radius);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleNetworkChunkPublisherUpdate($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class NetworkStackLatencyPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::NETWORK_STACK_LATENCY_PACKET;
@ -45,7 +45,7 @@ class NetworkStackLatencyPacket extends DataPacket implements ClientboundPacket,
$this->putBool($this->needResponse);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleNetworkStackLatency($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class NpcRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::NPC_REQUEST_PACKET;
@ -53,7 +53,7 @@ class NpcRequestPacket extends DataPacket implements ServerboundPacket{
$this->putByte($this->actionType);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleNpcRequest($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class OnScreenTextureAnimationPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ON_SCREEN_TEXTURE_ANIMATION_PACKET;
@ -41,7 +41,7 @@ class OnScreenTextureAnimationPacket extends DataPacket implements ClientboundPa
$this->putLInt($this->effectId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleOnScreenTextureAnimation($this);
}
}

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
interface Packet{
@ -62,13 +62,13 @@ interface Packet{
* This method returns a bool to indicate whether the packet was handled or not. If the packet was unhandled, a
* debug message will be logged with a hexdump of the packet.
*
* Typically this method returns the return value of the handler in the supplied SessionHandler. See other packets
* Typically this method returns the return value of the handler in the supplied PacketHandler. See other packets
* for examples how to implement this.
*
* @param SessionHandler $handler
* @param PacketHandler $handler
*
* @return bool true if the packet was handled successfully, false if not.
* @throws BadPacketException if broken data was found in the packet
*/
public function handle(SessionHandler $handler) : bool;
public function handle(PacketHandler $handler) : bool;
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class PhotoTransferPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::PHOTO_TRANSFER_PACKET;
@ -49,7 +49,7 @@ class PhotoTransferPacket extends DataPacket implements ClientboundPacket{
$this->putString($this->bookId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePhotoTransfer($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class PlaySoundPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::PLAY_SOUND_PACKET;
@ -62,7 +62,7 @@ class PlaySoundPacket extends DataPacket implements ClientboundPacket{
$this->putLFloat($this->pitch);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlaySound($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class PlayStatusPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::PLAY_STATUS_PACKET;
@ -61,7 +61,7 @@ class PlayStatusPacket extends DataPacket implements ClientboundPacket{
$this->putInt($this->status);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayStatus($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class PlayerActionPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::PLAYER_ACTION_PACKET;
@ -84,7 +84,7 @@ class PlayerActionPacket extends DataPacket implements ServerboundPacket{
$this->putVarInt($this->face);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayerAction($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
/**
@ -53,7 +53,7 @@ class PlayerHotbarPacket extends DataPacket implements ClientboundPacket, Server
$this->putBool($this->selectHotbarSlot);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayerHotbar($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class PlayerInputPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::PLAYER_INPUT_PACKET;
@ -54,7 +54,7 @@ class PlayerInputPacket extends DataPacket implements ServerboundPacket{
$this->putBool($this->sneaking);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayerInput($this);
}
}

View File

@ -28,7 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\entity\Skin;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use function count;
@ -116,7 +116,7 @@ class PlayerListPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayerList($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\entity\Skin;
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\utils\UUID;
class PlayerSkinPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
@ -78,7 +78,7 @@ class PlayerSkinPacket extends DataPacket implements ClientboundPacket, Serverbo
$this->putBool($this->premiumSkin);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePlayerSkin($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function count;
class PurchaseReceiptPacket extends DataPacket implements ServerboundPacket{
@ -48,7 +48,7 @@ class PurchaseReceiptPacket extends DataPacket implements ServerboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handlePurchaseReceipt($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class RemoveEntityPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
@ -48,7 +48,7 @@ class RemoveEntityPacket extends DataPacket implements ClientboundPacket{
$this->putEntityUniqueId($this->entityUniqueId);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleRemoveEntity($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class RemoveObjectivePacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::REMOVE_OBJECTIVE_PACKET;
@ -41,7 +41,7 @@ class RemoveObjectivePacket extends DataPacket implements ClientboundPacket{
$this->putString($this->objectiveName);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleRemoveObjective($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class RequestChunkRadiusPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::REQUEST_CHUNK_RADIUS_PACKET;
@ -42,7 +42,7 @@ class RequestChunkRadiusPacket extends DataPacket implements ServerboundPacket{
$this->putVarInt($this->radius);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleRequestChunkRadius($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function strlen;
class ResourcePackChunkDataPacket extends DataPacket implements ClientboundPacket{
@ -66,7 +66,7 @@ class ResourcePackChunkDataPacket extends DataPacket implements ClientboundPacke
$this->put($this->data);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePackChunkData($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ResourcePackChunkRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_CHUNK_REQUEST_PACKET;
@ -47,7 +47,7 @@ class ResourcePackChunkRequestPacket extends DataPacket implements ServerboundPa
$this->putLInt($this->chunkIndex);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePackChunkRequest($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use function count;
class ResourcePackClientResponsePacket extends DataPacket implements ServerboundPacket{
@ -58,7 +58,7 @@ class ResourcePackClientResponsePacket extends DataPacket implements Serverbound
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePackClientResponse($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ResourcePackDataInfoPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_DATA_INFO_PACKET;
@ -69,7 +69,7 @@ class ResourcePackDataInfoPacket extends DataPacket implements ClientboundPacket
$this->putString($this->sha256);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePackDataInfo($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\resourcepacks\ResourcePack;
use function count;
@ -101,7 +101,7 @@ class ResourcePackStackPacket extends DataPacket implements ClientboundPacket{
$this->putBool($this->isExperimental);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePackStack($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
use pocketmine\resourcepacks\ResourcePack;
use function count;
@ -110,7 +110,7 @@ class ResourcePacksInfoPacket extends DataPacket implements ClientboundPacket{
}
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleResourcePacksInfo($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class RespawnPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::RESPAWN_PACKET;
@ -49,7 +49,7 @@ class RespawnPacket extends DataPacket implements ClientboundPacket{
$this->putVector3($this->position);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleRespawn($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class RiderJumpPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::RIDER_JUMP_PACKET;
@ -43,7 +43,7 @@ class RiderJumpPacket extends DataPacket implements ServerboundPacket{
$this->putVarInt($this->jumpStrength);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleRiderJump($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ScriptCustomEventPacket extends DataPacket{ //TODO: this doesn't have handlers in either client or server in the game as of 1.8
public const NETWORK_ID = ProtocolInfo::SCRIPT_CUSTOM_EVENT_PACKET;
@ -45,7 +45,7 @@ class ScriptCustomEventPacket extends DataPacket{ //TODO: this doesn't have hand
$this->putString($this->eventData);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleScriptCustomEvent($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ServerSettingsRequestPacket extends DataPacket implements ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_SETTINGS_REQUEST_PACKET;
@ -38,7 +38,7 @@ class ServerSettingsRequestPacket extends DataPacket implements ServerboundPacke
//No payload
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleServerSettingsRequest($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ServerSettingsResponsePacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_SETTINGS_RESPONSE_PACKET;
@ -45,7 +45,7 @@ class ServerSettingsResponsePacket extends DataPacket implements ClientboundPack
$this->putString($this->formData);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleServerSettingsResponse($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class ServerToClientHandshakePacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_TO_CLIENT_HANDSHAKE_PACKET;
@ -55,7 +55,7 @@ class ServerToClientHandshakePacket extends DataPacket implements ClientboundPac
$this->putString($this->jwt);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleServerToClientHandshake($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\PacketHandler;
class SetCommandsEnabledPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::SET_COMMANDS_ENABLED_PACKET;
@ -42,7 +42,7 @@ class SetCommandsEnabledPacket extends DataPacket implements ClientboundPacket{
$this->putBool($this->enabled);
}
public function handle(SessionHandler $handler) : bool{
public function handle(PacketHandler $handler) : bool{
return $handler->handleSetCommandsEnabled($this);
}
}

Some files were not shown because too many files have changed in this diff Show More