Split up session base logic and packet handling

this will allow for mutable packet handlers which can be used to cleanly implement multi-stage game sessions.
This commit is contained in:
Dylan K. Taylor 2018-07-19 15:12:40 +01:00
parent bdd9a7eb52
commit 64ecc373be
117 changed files with 1195 additions and 910 deletions

View File

@ -25,120 +25,11 @@ namespace pocketmine\network\mcpe;
use pocketmine\event\server\DataPacketReceiveEvent;
use pocketmine\event\server\DataPacketSendEvent;
use pocketmine\network\mcpe\protocol\AddBehaviorTreePacket;
use pocketmine\network\mcpe\protocol\AddEntityPacket;
use pocketmine\network\mcpe\protocol\AddHangingEntityPacket;
use pocketmine\network\mcpe\protocol\AddItemEntityPacket;
use pocketmine\network\mcpe\protocol\AddPaintingPacket;
use pocketmine\network\mcpe\protocol\AddPlayerPacket;
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
use pocketmine\network\mcpe\protocol\AnimatePacket;
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
use pocketmine\network\mcpe\protocol\BlockEventPacket;
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
use pocketmine\network\mcpe\protocol\BookEditPacket;
use pocketmine\network\mcpe\protocol\BossEventPacket;
use pocketmine\network\mcpe\protocol\CameraPacket;
use pocketmine\network\mcpe\protocol\ChangeDimensionPacket;
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket;
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
use pocketmine\network\mcpe\protocol\CommandOutputPacket;
use pocketmine\network\mcpe\protocol\CommandRequestPacket;
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
use pocketmine\network\mcpe\protocol\ContainerOpenPacket;
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
use pocketmine\network\mcpe\protocol\CraftingDataPacket;
use pocketmine\network\mcpe\protocol\CraftingEventPacket;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\handler\SimpleSessionHandler;
use pocketmine\network\mcpe\protocol\DataPacket;
use pocketmine\network\mcpe\protocol\DisconnectPacket;
use pocketmine\network\mcpe\protocol\EntityEventPacket;
use pocketmine\network\mcpe\protocol\EntityFallPacket;
use pocketmine\network\mcpe\protocol\EntityPickRequestPacket;
use pocketmine\network\mcpe\protocol\EventPacket;
use pocketmine\network\mcpe\protocol\ExplodePacket;
use pocketmine\network\mcpe\protocol\FullChunkDataPacket;
use pocketmine\network\mcpe\protocol\GameRulesChangedPacket;
use pocketmine\network\mcpe\protocol\GuiDataPickItemPacket;
use pocketmine\network\mcpe\protocol\HurtArmorPacket;
use pocketmine\network\mcpe\protocol\InteractPacket;
use pocketmine\network\mcpe\protocol\InventoryContentPacket;
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
use pocketmine\network\mcpe\protocol\InventoryTransactionPacket;
use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket;
use pocketmine\network\mcpe\protocol\LabTablePacket;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\network\mcpe\protocol\LoginPacket;
use pocketmine\network\mcpe\protocol\MapInfoRequestPacket;
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
use pocketmine\network\mcpe\protocol\MobEffectPacket;
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
use pocketmine\network\mcpe\protocol\ModalFormRequestPacket;
use pocketmine\network\mcpe\protocol\ModalFormResponsePacket;
use pocketmine\network\mcpe\protocol\MoveEntityAbsolutePacket;
use pocketmine\network\mcpe\protocol\MoveEntityDeltaPacket;
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
use pocketmine\network\mcpe\protocol\NpcRequestPacket;
use pocketmine\network\mcpe\protocol\PacketPool;
use pocketmine\network\mcpe\protocol\PhotoTransferPacket;
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
use pocketmine\network\mcpe\protocol\PlayerHotbarPacket;
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
use pocketmine\network\mcpe\protocol\PlayerListPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\PlaySoundPacket;
use pocketmine\network\mcpe\protocol\PlayStatusPacket;
use pocketmine\network\mcpe\protocol\PurchaseReceiptPacket;
use pocketmine\network\mcpe\protocol\RemoveEntityPacket;
use pocketmine\network\mcpe\protocol\RemoveObjectivePacket;
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
use pocketmine\network\mcpe\protocol\ResourcePackChunkDataPacket;
use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket;
use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket;
use pocketmine\network\mcpe\protocol\ResourcePackDataInfoPacket;
use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket;
use pocketmine\network\mcpe\protocol\ResourcePackStackPacket;
use pocketmine\network\mcpe\protocol\RespawnPacket;
use pocketmine\network\mcpe\protocol\RiderJumpPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket;
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket;
use pocketmine\network\mcpe\protocol\SetDefaultGameTypePacket;
use pocketmine\network\mcpe\protocol\SetDifficultyPacket;
use pocketmine\network\mcpe\protocol\SetDisplayObjectivePacket;
use pocketmine\network\mcpe\protocol\SetEntityDataPacket;
use pocketmine\network\mcpe\protocol\SetEntityLinkPacket;
use pocketmine\network\mcpe\protocol\SetEntityMotionPacket;
use pocketmine\network\mcpe\protocol\SetHealthPacket;
use pocketmine\network\mcpe\protocol\SetLastHurtByPacket;
use pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket;
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
use pocketmine\network\mcpe\protocol\SetScorePacket;
use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket;
use pocketmine\network\mcpe\protocol\SetTimePacket;
use pocketmine\network\mcpe\protocol\SetTitlePacket;
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
use pocketmine\network\mcpe\protocol\ShowProfilePacket;
use pocketmine\network\mcpe\protocol\ShowStoreOfferPacket;
use pocketmine\network\mcpe\protocol\SimpleEventPacket;
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
use pocketmine\network\mcpe\protocol\StartGamePacket;
use pocketmine\network\mcpe\protocol\StopSoundPacket;
use pocketmine\network\mcpe\protocol\StructureBlockUpdatePacket;
use pocketmine\network\mcpe\protocol\SubClientLoginPacket;
use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\TransferPacket;
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket;
use pocketmine\network\mcpe\protocol\UpdateEquipPacket;
use pocketmine\network\mcpe\protocol\UpdateTradePacket;
use pocketmine\network\mcpe\protocol\WSConnectPacket;
use pocketmine\network\NetworkInterface;
use pocketmine\Player;
use pocketmine\Server;
@ -158,6 +49,9 @@ class NetworkSession{
/** @var int */
private $port;
/** @var SessionHandler */
private $handler;
public function __construct(Server $server, Player $player, NetworkInterface $interface, string $ip, int $port){
$this->server = $server;
$this->player = $player;
@ -165,6 +59,8 @@ class NetworkSession{
$this->ip = $ip;
$this->port = $port;
$this->handler = new SimpleSessionHandler($player);
}
public function getInterface() : NetworkInterface{
@ -205,7 +101,7 @@ class NetworkSession{
}
$this->server->getPluginManager()->callEvent($ev = new DataPacketReceiveEvent($this->player, $packet));
if(!$ev->isCancelled() and !$packet->handle($this)){
if(!$ev->isCancelled() and !$packet->handle($this->handler)){
$this->server->getLogger()->debug("Unhandled " . $packet->getName() . " received from " . $this->player->getName() . ": 0x" . bin2hex($packet->buffer));
}
@ -239,458 +135,4 @@ class NetworkSession{
}
$this->interface->close($this->player, $notify ? $reason : "");
}
public function handleLogin(LoginPacket $packet) : bool{
return $this->player->handleLogin($packet);
}
public function handlePlayStatus(PlayStatusPacket $packet) : bool{
return false;
}
public function handleServerToClientHandshake(ServerToClientHandshakePacket $packet) : bool{
return false;
}
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool{
return false; //TODO
}
public function handleDisconnect(DisconnectPacket $packet) : bool{
return false;
}
public function handleResourcePacksInfo(ResourcePacksInfoPacket $packet) : bool{
return false;
}
public function handleResourcePackStack(ResourcePackStackPacket $packet) : bool{
return false;
}
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{
return $this->player->handleResourcePackClientResponse($packet);
}
public function handleText(TextPacket $packet) : bool{
if($packet->type === TextPacket::TYPE_CHAT){
return $this->player->chat($packet->message);
}
return false;
}
public function handleSetTime(SetTimePacket $packet) : bool{
return false;
}
public function handleStartGame(StartGamePacket $packet) : bool{
return false;
}
public function handleAddPlayer(AddPlayerPacket $packet) : bool{
return false;
}
public function handleAddEntity(AddEntityPacket $packet) : bool{
return false;
}
public function handleRemoveEntity(RemoveEntityPacket $packet) : bool{
return false;
}
public function handleAddItemEntity(AddItemEntityPacket $packet) : bool{
return false;
}
public function handleAddHangingEntity(AddHangingEntityPacket $packet) : bool{
return false;
}
public function handleTakeItemEntity(TakeItemEntityPacket $packet) : bool{
return false;
}
public function handleMoveEntityAbsolute(MoveEntityAbsolutePacket $packet) : bool{
return false;
}
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
return $this->player->handleMovePlayer($packet);
}
public function handleRiderJump(RiderJumpPacket $packet) : bool{
return false;
}
public function handleUpdateBlock(UpdateBlockPacket $packet) : bool{
return false;
}
public function handleAddPainting(AddPaintingPacket $packet) : bool{
return false;
}
public function handleExplode(ExplodePacket $packet) : bool{
return false;
}
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
return $this->player->handleLevelSoundEvent($packet);
}
public function handleLevelEvent(LevelEventPacket $packet) : bool{
return false;
}
public function handleBlockEvent(BlockEventPacket $packet) : bool{
return false;
}
public function handleEntityEvent(EntityEventPacket $packet) : bool{
return $this->player->handleEntityEvent($packet);
}
public function handleMobEffect(MobEffectPacket $packet) : bool{
return false;
}
public function handleUpdateAttributes(UpdateAttributesPacket $packet) : bool{
return false;
}
public function handleInventoryTransaction(InventoryTransactionPacket $packet) : bool{
return $this->player->handleInventoryTransaction($packet);
}
public function handleMobEquipment(MobEquipmentPacket $packet) : bool{
return $this->player->handleMobEquipment($packet);
}
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool{
return true; //Not used
}
public function handleInteract(InteractPacket $packet) : bool{
return $this->player->handleInteract($packet);
}
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
return $this->player->handleBlockPickRequest($packet);
}
public function handleEntityPickRequest(EntityPickRequestPacket $packet) : bool{
return false; //TODO
}
public function handlePlayerAction(PlayerActionPacket $packet) : bool{
return $this->player->handlePlayerAction($packet);
}
public function handleEntityFall(EntityFallPacket $packet) : bool{
return true; //Not used
}
public function handleHurtArmor(HurtArmorPacket $packet) : bool{
return false;
}
public function handleSetEntityData(SetEntityDataPacket $packet) : bool{
return false;
}
public function handleSetEntityMotion(SetEntityMotionPacket $packet) : bool{
return false;
}
public function handleSetEntityLink(SetEntityLinkPacket $packet) : bool{
return false;
}
public function handleSetHealth(SetHealthPacket $packet) : bool{
return false;
}
public function handleSetSpawnPosition(SetSpawnPositionPacket $packet) : bool{
return false;
}
public function handleAnimate(AnimatePacket $packet) : bool{
return $this->player->handleAnimate($packet);
}
public function handleRespawn(RespawnPacket $packet) : bool{
return false;
}
public function handleContainerOpen(ContainerOpenPacket $packet) : bool{
return false;
}
public function handleContainerClose(ContainerClosePacket $packet) : bool{
return $this->player->handleContainerClose($packet);
}
public function handlePlayerHotbar(PlayerHotbarPacket $packet) : bool{
return true; //this packet is useless
}
public function handleInventoryContent(InventoryContentPacket $packet) : bool{
return false;
}
public function handleInventorySlot(InventorySlotPacket $packet) : bool{
return false;
}
public function handleContainerSetData(ContainerSetDataPacket $packet) : bool{
return false;
}
public function handleCraftingData(CraftingDataPacket $packet) : bool{
return false;
}
public function handleCraftingEvent(CraftingEventPacket $packet) : bool{
return true; //this is a broken useless packet, so we don't use it
}
public function handleGuiDataPickItem(GuiDataPickItemPacket $packet) : bool{
return false;
}
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
return $this->player->handleAdventureSettings($packet);
}
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
return $this->player->handleBlockEntityData($packet);
}
public function handlePlayerInput(PlayerInputPacket $packet) : bool{
return false; //TODO
}
public function handleFullChunkData(FullChunkDataPacket $packet) : bool{
return false;
}
public function handleSetCommandsEnabled(SetCommandsEnabledPacket $packet) : bool{
return false;
}
public function handleSetDifficulty(SetDifficultyPacket $packet) : bool{
return false;
}
public function handleChangeDimension(ChangeDimensionPacket $packet) : bool{
return false;
}
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool{
return $this->player->handleSetPlayerGameType($packet);
}
public function handlePlayerList(PlayerListPacket $packet) : bool{
return false;
}
public function handleSimpleEvent(SimpleEventPacket $packet) : bool{
return false;
}
public function handleEvent(EventPacket $packet) : bool{
return false;
}
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool{
return false; //TODO
}
public function handleClientboundMapItemData(ClientboundMapItemDataPacket $packet) : bool{
return false;
}
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool{
return false; //TODO
}
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
$this->player->setViewDistance($packet->radius);
return true;
}
public function handleChunkRadiusUpdated(ChunkRadiusUpdatedPacket $packet) : bool{
return false;
}
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool{
return $this->player->handleItemFrameDropItem($packet);
}
public function handleGameRulesChanged(GameRulesChangedPacket $packet) : bool{
return false;
}
public function handleCamera(CameraPacket $packet) : bool{
return false;
}
public function handleBossEvent(BossEventPacket $packet) : bool{
return false; //TODO
}
public function handleShowCredits(ShowCreditsPacket $packet) : bool{
return false; //TODO: handle resume
}
public function handleAvailableCommands(AvailableCommandsPacket $packet) : bool{
return false;
}
public function handleCommandRequest(CommandRequestPacket $packet) : bool{
return $this->player->chat($packet->command);
}
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
return false; //TODO
}
public function handleCommandOutput(CommandOutputPacket $packet) : bool{
return false;
}
public function handleUpdateTrade(UpdateTradePacket $packet) : bool{
return false;
}
public function handleUpdateEquip(UpdateEquipPacket $packet) : bool{
return false;
}
public function handleResourcePackDataInfo(ResourcePackDataInfoPacket $packet) : bool{
return false;
}
public function handleResourcePackChunkData(ResourcePackChunkDataPacket $packet) : bool{
return false;
}
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool{
return $this->player->handleResourcePackChunkRequest($packet);
}
public function handleTransfer(TransferPacket $packet) : bool{
return false;
}
public function handlePlaySound(PlaySoundPacket $packet) : bool{
return false;
}
public function handleStopSound(StopSoundPacket $packet) : bool{
return false;
}
public function handleSetTitle(SetTitlePacket $packet) : bool{
return false;
}
public function handleAddBehaviorTree(AddBehaviorTreePacket $packet) : bool{
return false;
}
public function handleStructureBlockUpdate(StructureBlockUpdatePacket $packet) : bool{
return false;
}
public function handleShowStoreOffer(ShowStoreOfferPacket $packet) : bool{
return false;
}
public function handlePurchaseReceipt(PurchaseReceiptPacket $packet) : bool{
return false;
}
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
return $this->player->changeSkin($packet->skin, $packet->newSkinName, $packet->oldSkinName);
}
public function handleSubClientLogin(SubClientLoginPacket $packet) : bool{
return false;
}
public function handleWSConnect(WSConnectPacket $packet) : bool{
return false;
}
public function handleSetLastHurtBy(SetLastHurtByPacket $packet) : bool{
return false;
}
public function handleBookEdit(BookEditPacket $packet) : bool{
return $this->player->handleBookEdit($packet);
}
public function handleNpcRequest(NpcRequestPacket $packet) : bool{
return false;
}
public function handlePhotoTransfer(PhotoTransferPacket $packet) : bool{
return false;
}
public function handleModalFormRequest(ModalFormRequestPacket $packet) : bool{
return false;
}
public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{
return false; //TODO: GUI stuff
}
public function handleServerSettingsRequest(ServerSettingsRequestPacket $packet) : bool{
return false; //TODO: GUI stuff
}
public function handleServerSettingsResponse(ServerSettingsResponsePacket $packet) : bool{
return false;
}
public function handleShowProfile(ShowProfilePacket $packet) : bool{
return false;
}
public function handleSetDefaultGameType(SetDefaultGameTypePacket $packet) : bool{
return false;
}
public function handleRemoveObjective(RemoveObjectivePacket $packet) : bool{
return false;
}
public function handleSetDisplayObjective(SetDisplayObjectivePacket $packet) : bool{
return false;
}
public function handleSetScore(SetScorePacket $packet) : bool{
return false;
}
public function handleLabTable(LabTablePacket $packet) : bool{
return false;
}
public function handleUpdateBlockSynced(UpdateBlockSyncedPacket $packet) : bool{
return false;
}
public function handleMoveEntityDelta(MoveEntityDeltaPacket $packet) : bool{
return false;
}
public function handleSetLocalPlayerAsInitialized(SetLocalPlayerAsInitializedPacket $packet) : bool{
return false;
}
}

View File

@ -0,0 +1,598 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\handler;
use pocketmine\network\mcpe\protocol\AddBehaviorTreePacket;
use pocketmine\network\mcpe\protocol\AddEntityPacket;
use pocketmine\network\mcpe\protocol\AddHangingEntityPacket;
use pocketmine\network\mcpe\protocol\AddItemEntityPacket;
use pocketmine\network\mcpe\protocol\AddPaintingPacket;
use pocketmine\network\mcpe\protocol\AddPlayerPacket;
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
use pocketmine\network\mcpe\protocol\AnimatePacket;
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
use pocketmine\network\mcpe\protocol\BlockEventPacket;
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
use pocketmine\network\mcpe\protocol\BookEditPacket;
use pocketmine\network\mcpe\protocol\BossEventPacket;
use pocketmine\network\mcpe\protocol\CameraPacket;
use pocketmine\network\mcpe\protocol\ChangeDimensionPacket;
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
use pocketmine\network\mcpe\protocol\ClientboundMapItemDataPacket;
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
use pocketmine\network\mcpe\protocol\CommandOutputPacket;
use pocketmine\network\mcpe\protocol\CommandRequestPacket;
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
use pocketmine\network\mcpe\protocol\ContainerOpenPacket;
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
use pocketmine\network\mcpe\protocol\CraftingDataPacket;
use pocketmine\network\mcpe\protocol\CraftingEventPacket;
use pocketmine\network\mcpe\protocol\DisconnectPacket;
use pocketmine\network\mcpe\protocol\EntityEventPacket;
use pocketmine\network\mcpe\protocol\EntityFallPacket;
use pocketmine\network\mcpe\protocol\EntityPickRequestPacket;
use pocketmine\network\mcpe\protocol\EventPacket;
use pocketmine\network\mcpe\protocol\ExplodePacket;
use pocketmine\network\mcpe\protocol\FullChunkDataPacket;
use pocketmine\network\mcpe\protocol\GameRulesChangedPacket;
use pocketmine\network\mcpe\protocol\GuiDataPickItemPacket;
use pocketmine\network\mcpe\protocol\HurtArmorPacket;
use pocketmine\network\mcpe\protocol\InteractPacket;
use pocketmine\network\mcpe\protocol\InventoryContentPacket;
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
use pocketmine\network\mcpe\protocol\InventoryTransactionPacket;
use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket;
use pocketmine\network\mcpe\protocol\LabTablePacket;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\network\mcpe\protocol\LoginPacket;
use pocketmine\network\mcpe\protocol\MapInfoRequestPacket;
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
use pocketmine\network\mcpe\protocol\MobEffectPacket;
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
use pocketmine\network\mcpe\protocol\ModalFormRequestPacket;
use pocketmine\network\mcpe\protocol\ModalFormResponsePacket;
use pocketmine\network\mcpe\protocol\MoveEntityAbsolutePacket;
use pocketmine\network\mcpe\protocol\MoveEntityDeltaPacket;
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
use pocketmine\network\mcpe\protocol\NpcRequestPacket;
use pocketmine\network\mcpe\protocol\PhotoTransferPacket;
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
use pocketmine\network\mcpe\protocol\PlayerHotbarPacket;
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
use pocketmine\network\mcpe\protocol\PlayerListPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\PlaySoundPacket;
use pocketmine\network\mcpe\protocol\PlayStatusPacket;
use pocketmine\network\mcpe\protocol\PurchaseReceiptPacket;
use pocketmine\network\mcpe\protocol\RemoveEntityPacket;
use pocketmine\network\mcpe\protocol\RemoveObjectivePacket;
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
use pocketmine\network\mcpe\protocol\ResourcePackChunkDataPacket;
use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket;
use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket;
use pocketmine\network\mcpe\protocol\ResourcePackDataInfoPacket;
use pocketmine\network\mcpe\protocol\ResourcePacksInfoPacket;
use pocketmine\network\mcpe\protocol\ResourcePackStackPacket;
use pocketmine\network\mcpe\protocol\RespawnPacket;
use pocketmine\network\mcpe\protocol\RiderJumpPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsResponsePacket;
use pocketmine\network\mcpe\protocol\ServerToClientHandshakePacket;
use pocketmine\network\mcpe\protocol\SetCommandsEnabledPacket;
use pocketmine\network\mcpe\protocol\SetDefaultGameTypePacket;
use pocketmine\network\mcpe\protocol\SetDifficultyPacket;
use pocketmine\network\mcpe\protocol\SetDisplayObjectivePacket;
use pocketmine\network\mcpe\protocol\SetEntityDataPacket;
use pocketmine\network\mcpe\protocol\SetEntityLinkPacket;
use pocketmine\network\mcpe\protocol\SetEntityMotionPacket;
use pocketmine\network\mcpe\protocol\SetHealthPacket;
use pocketmine\network\mcpe\protocol\SetLastHurtByPacket;
use pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket;
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
use pocketmine\network\mcpe\protocol\SetScorePacket;
use pocketmine\network\mcpe\protocol\SetSpawnPositionPacket;
use pocketmine\network\mcpe\protocol\SetTimePacket;
use pocketmine\network\mcpe\protocol\SetTitlePacket;
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
use pocketmine\network\mcpe\protocol\ShowProfilePacket;
use pocketmine\network\mcpe\protocol\ShowStoreOfferPacket;
use pocketmine\network\mcpe\protocol\SimpleEventPacket;
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
use pocketmine\network\mcpe\protocol\StartGamePacket;
use pocketmine\network\mcpe\protocol\StopSoundPacket;
use pocketmine\network\mcpe\protocol\StructureBlockUpdatePacket;
use pocketmine\network\mcpe\protocol\SubClientLoginPacket;
use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\TransferPacket;
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockSyncedPacket;
use pocketmine\network\mcpe\protocol\UpdateEquipPacket;
use pocketmine\network\mcpe\protocol\UpdateTradePacket;
use pocketmine\network\mcpe\protocol\WSConnectPacket;
/**
* Handlers are attached to sessions to handle packets received from their associated clients. A handler
* is mutable and may be removed/replaced at any time.
*
* This class is an automatically generated stub. Do not edit it manually.
*/
abstract class SessionHandler{
public function setUp() : void{
}
public function handleLogin(LoginPacket $packet) : bool{
return false;
}
public function handlePlayStatus(PlayStatusPacket $packet) : bool{
return false;
}
public function handleServerToClientHandshake(ServerToClientHandshakePacket $packet) : bool{
return false;
}
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool{
return false;
}
public function handleDisconnect(DisconnectPacket $packet) : bool{
return false;
}
public function handleResourcePacksInfo(ResourcePacksInfoPacket $packet) : bool{
return false;
}
public function handleResourcePackStack(ResourcePackStackPacket $packet) : bool{
return false;
}
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{
return false;
}
public function handleText(TextPacket $packet) : bool{
return false;
}
public function handleSetTime(SetTimePacket $packet) : bool{
return false;
}
public function handleStartGame(StartGamePacket $packet) : bool{
return false;
}
public function handleAddPlayer(AddPlayerPacket $packet) : bool{
return false;
}
public function handleAddEntity(AddEntityPacket $packet) : bool{
return false;
}
public function handleRemoveEntity(RemoveEntityPacket $packet) : bool{
return false;
}
public function handleAddItemEntity(AddItemEntityPacket $packet) : bool{
return false;
}
public function handleAddHangingEntity(AddHangingEntityPacket $packet) : bool{
return false;
}
public function handleTakeItemEntity(TakeItemEntityPacket $packet) : bool{
return false;
}
public function handleMoveEntityAbsolute(MoveEntityAbsolutePacket $packet) : bool{
return false;
}
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
return false;
}
public function handleRiderJump(RiderJumpPacket $packet) : bool{
return false;
}
public function handleUpdateBlock(UpdateBlockPacket $packet) : bool{
return false;
}
public function handleAddPainting(AddPaintingPacket $packet) : bool{
return false;
}
public function handleExplode(ExplodePacket $packet) : bool{
return false;
}
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
return false;
}
public function handleLevelEvent(LevelEventPacket $packet) : bool{
return false;
}
public function handleBlockEvent(BlockEventPacket $packet) : bool{
return false;
}
public function handleEntityEvent(EntityEventPacket $packet) : bool{
return false;
}
public function handleMobEffect(MobEffectPacket $packet) : bool{
return false;
}
public function handleUpdateAttributes(UpdateAttributesPacket $packet) : bool{
return false;
}
public function handleInventoryTransaction(InventoryTransactionPacket $packet) : bool{
return false;
}
public function handleMobEquipment(MobEquipmentPacket $packet) : bool{
return false;
}
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool{
return false;
}
public function handleInteract(InteractPacket $packet) : bool{
return false;
}
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
return false;
}
public function handleEntityPickRequest(EntityPickRequestPacket $packet) : bool{
return false;
}
public function handlePlayerAction(PlayerActionPacket $packet) : bool{
return false;
}
public function handleEntityFall(EntityFallPacket $packet) : bool{
return false;
}
public function handleHurtArmor(HurtArmorPacket $packet) : bool{
return false;
}
public function handleSetEntityData(SetEntityDataPacket $packet) : bool{
return false;
}
public function handleSetEntityMotion(SetEntityMotionPacket $packet) : bool{
return false;
}
public function handleSetEntityLink(SetEntityLinkPacket $packet) : bool{
return false;
}
public function handleSetHealth(SetHealthPacket $packet) : bool{
return false;
}
public function handleSetSpawnPosition(SetSpawnPositionPacket $packet) : bool{
return false;
}
public function handleAnimate(AnimatePacket $packet) : bool{
return false;
}
public function handleRespawn(RespawnPacket $packet) : bool{
return false;
}
public function handleContainerOpen(ContainerOpenPacket $packet) : bool{
return false;
}
public function handleContainerClose(ContainerClosePacket $packet) : bool{
return false;
}
public function handlePlayerHotbar(PlayerHotbarPacket $packet) : bool{
return false;
}
public function handleInventoryContent(InventoryContentPacket $packet) : bool{
return false;
}
public function handleInventorySlot(InventorySlotPacket $packet) : bool{
return false;
}
public function handleContainerSetData(ContainerSetDataPacket $packet) : bool{
return false;
}
public function handleCraftingData(CraftingDataPacket $packet) : bool{
return false;
}
public function handleCraftingEvent(CraftingEventPacket $packet) : bool{
return false;
}
public function handleGuiDataPickItem(GuiDataPickItemPacket $packet) : bool{
return false;
}
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
return false;
}
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
return false;
}
public function handlePlayerInput(PlayerInputPacket $packet) : bool{
return false;
}
public function handleFullChunkData(FullChunkDataPacket $packet) : bool{
return false;
}
public function handleSetCommandsEnabled(SetCommandsEnabledPacket $packet) : bool{
return false;
}
public function handleSetDifficulty(SetDifficultyPacket $packet) : bool{
return false;
}
public function handleChangeDimension(ChangeDimensionPacket $packet) : bool{
return false;
}
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool{
return false;
}
public function handlePlayerList(PlayerListPacket $packet) : bool{
return false;
}
public function handleSimpleEvent(SimpleEventPacket $packet) : bool{
return false;
}
public function handleEvent(EventPacket $packet) : bool{
return false;
}
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool{
return false;
}
public function handleClientboundMapItemData(ClientboundMapItemDataPacket $packet) : bool{
return false;
}
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool{
return false;
}
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
return false;
}
public function handleChunkRadiusUpdated(ChunkRadiusUpdatedPacket $packet) : bool{
return false;
}
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool{
return false;
}
public function handleGameRulesChanged(GameRulesChangedPacket $packet) : bool{
return false;
}
public function handleCamera(CameraPacket $packet) : bool{
return false;
}
public function handleBossEvent(BossEventPacket $packet) : bool{
return false;
}
public function handleShowCredits(ShowCreditsPacket $packet) : bool{
return false;
}
public function handleAvailableCommands(AvailableCommandsPacket $packet) : bool{
return false;
}
public function handleCommandRequest(CommandRequestPacket $packet) : bool{
return false;
}
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
return false;
}
public function handleCommandOutput(CommandOutputPacket $packet) : bool{
return false;
}
public function handleUpdateTrade(UpdateTradePacket $packet) : bool{
return false;
}
public function handleUpdateEquip(UpdateEquipPacket $packet) : bool{
return false;
}
public function handleResourcePackDataInfo(ResourcePackDataInfoPacket $packet) : bool{
return false;
}
public function handleResourcePackChunkData(ResourcePackChunkDataPacket $packet) : bool{
return false;
}
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool{
return false;
}
public function handleTransfer(TransferPacket $packet) : bool{
return false;
}
public function handlePlaySound(PlaySoundPacket $packet) : bool{
return false;
}
public function handleStopSound(StopSoundPacket $packet) : bool{
return false;
}
public function handleSetTitle(SetTitlePacket $packet) : bool{
return false;
}
public function handleAddBehaviorTree(AddBehaviorTreePacket $packet) : bool{
return false;
}
public function handleStructureBlockUpdate(StructureBlockUpdatePacket $packet) : bool{
return false;
}
public function handleShowStoreOffer(ShowStoreOfferPacket $packet) : bool{
return false;
}
public function handlePurchaseReceipt(PurchaseReceiptPacket $packet) : bool{
return false;
}
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
return false;
}
public function handleSubClientLogin(SubClientLoginPacket $packet) : bool{
return false;
}
public function handleWSConnect(WSConnectPacket $packet) : bool{
return false;
}
public function handleSetLastHurtBy(SetLastHurtByPacket $packet) : bool{
return false;
}
public function handleBookEdit(BookEditPacket $packet) : bool{
return false;
}
public function handleNpcRequest(NpcRequestPacket $packet) : bool{
return false;
}
public function handlePhotoTransfer(PhotoTransferPacket $packet) : bool{
return false;
}
public function handleModalFormRequest(ModalFormRequestPacket $packet) : bool{
return false;
}
public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{
return false;
}
public function handleServerSettingsRequest(ServerSettingsRequestPacket $packet) : bool{
return false;
}
public function handleServerSettingsResponse(ServerSettingsResponsePacket $packet) : bool{
return false;
}
public function handleShowProfile(ShowProfilePacket $packet) : bool{
return false;
}
public function handleSetDefaultGameType(SetDefaultGameTypePacket $packet) : bool{
return false;
}
public function handleRemoveObjective(RemoveObjectivePacket $packet) : bool{
return false;
}
public function handleSetDisplayObjective(SetDisplayObjectivePacket $packet) : bool{
return false;
}
public function handleSetScore(SetScorePacket $packet) : bool{
return false;
}
public function handleLabTable(LabTablePacket $packet) : bool{
return false;
}
public function handleUpdateBlockSynced(UpdateBlockSyncedPacket $packet) : bool{
return false;
}
public function handleMoveEntityDelta(MoveEntityDeltaPacket $packet) : bool{
return false;
}
public function handleSetLocalPlayerAsInitialized(SetLocalPlayerAsInitializedPacket $packet) : bool{
return false;
}
}

View File

@ -0,0 +1,241 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\network\mcpe\handler;
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
use pocketmine\network\mcpe\protocol\AnimatePacket;
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
use pocketmine\network\mcpe\protocol\BookEditPacket;
use pocketmine\network\mcpe\protocol\BossEventPacket;
use pocketmine\network\mcpe\protocol\ClientToServerHandshakePacket;
use pocketmine\network\mcpe\protocol\CommandBlockUpdatePacket;
use pocketmine\network\mcpe\protocol\CommandRequestPacket;
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
use pocketmine\network\mcpe\protocol\CraftingEventPacket;
use pocketmine\network\mcpe\protocol\EntityEventPacket;
use pocketmine\network\mcpe\protocol\EntityFallPacket;
use pocketmine\network\mcpe\protocol\EntityPickRequestPacket;
use pocketmine\network\mcpe\protocol\InteractPacket;
use pocketmine\network\mcpe\protocol\InventoryTransactionPacket;
use pocketmine\network\mcpe\protocol\ItemFrameDropItemPacket;
use pocketmine\network\mcpe\protocol\LabTablePacket;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\network\mcpe\protocol\LoginPacket;
use pocketmine\network\mcpe\protocol\MapInfoRequestPacket;
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
use pocketmine\network\mcpe\protocol\ModalFormResponsePacket;
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
use pocketmine\network\mcpe\protocol\PlayerActionPacket;
use pocketmine\network\mcpe\protocol\PlayerHotbarPacket;
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
use pocketmine\network\mcpe\protocol\ResourcePackChunkRequestPacket;
use pocketmine\network\mcpe\protocol\ResourcePackClientResponsePacket;
use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket;
use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket;
use pocketmine\network\mcpe\protocol\ShowCreditsPacket;
use pocketmine\network\mcpe\protocol\SpawnExperienceOrbPacket;
use pocketmine\network\mcpe\protocol\SubClientLoginPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\Player;
/**
* Temporary session handler implementation
* TODO: split this up properly into different handlers
*/
class SimpleSessionHandler extends SessionHandler{
/** @var Player */
private $player;
public function __construct(Player $player){
$this->player = $player;
}
public function handleLogin(LoginPacket $packet) : bool{
return $this->player->handleLogin($packet);
}
public function handleClientToServerHandshake(ClientToServerHandshakePacket $packet) : bool{
return false; //TODO
}
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{
return $this->player->handleResourcePackClientResponse($packet);
}
public function handleText(TextPacket $packet) : bool{
if($packet->type === TextPacket::TYPE_CHAT){
return $this->player->chat($packet->message);
}
return false;
}
public function handleMovePlayer(MovePlayerPacket $packet) : bool{
return $this->player->handleMovePlayer($packet);
}
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
return $this->player->handleLevelSoundEvent($packet);
}
public function handleEntityEvent(EntityEventPacket $packet) : bool{
return $this->player->handleEntityEvent($packet);
}
public function handleInventoryTransaction(InventoryTransactionPacket $packet) : bool{
return $this->player->handleInventoryTransaction($packet);
}
public function handleMobEquipment(MobEquipmentPacket $packet) : bool{
return $this->player->handleMobEquipment($packet);
}
public function handleMobArmorEquipment(MobArmorEquipmentPacket $packet) : bool{
return true; //Not used
}
public function handleInteract(InteractPacket $packet) : bool{
return $this->player->handleInteract($packet);
}
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
return $this->player->handleBlockPickRequest($packet);
}
public function handleEntityPickRequest(EntityPickRequestPacket $packet) : bool{
return false; //TODO
}
public function handlePlayerAction(PlayerActionPacket $packet) : bool{
return $this->player->handlePlayerAction($packet);
}
public function handleEntityFall(EntityFallPacket $packet) : bool{
return true; //Not used
}
public function handleAnimate(AnimatePacket $packet) : bool{
return $this->player->handleAnimate($packet);
}
public function handleContainerClose(ContainerClosePacket $packet) : bool{
return $this->player->handleContainerClose($packet);
}
public function handlePlayerHotbar(PlayerHotbarPacket $packet) : bool{
return true; //this packet is useless
}
public function handleCraftingEvent(CraftingEventPacket $packet) : bool{
return true; //this is a broken useless packet, so we don't use it
}
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
return $this->player->handleAdventureSettings($packet);
}
public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
return $this->player->handleBlockEntityData($packet);
}
public function handlePlayerInput(PlayerInputPacket $packet) : bool{
return false; //TODO
}
public function handleSetPlayerGameType(SetPlayerGameTypePacket $packet) : bool{
return $this->player->handleSetPlayerGameType($packet);
}
public function handleSpawnExperienceOrb(SpawnExperienceOrbPacket $packet) : bool{
return false; //TODO
}
public function handleMapInfoRequest(MapInfoRequestPacket $packet) : bool{
return false; //TODO
}
public function handleRequestChunkRadius(RequestChunkRadiusPacket $packet) : bool{
$this->player->setViewDistance($packet->radius);
return true;
}
public function handleItemFrameDropItem(ItemFrameDropItemPacket $packet) : bool{
return $this->player->handleItemFrameDropItem($packet);
}
public function handleBossEvent(BossEventPacket $packet) : bool{
return false; //TODO
}
public function handleShowCredits(ShowCreditsPacket $packet) : bool{
return false; //TODO: handle resume
}
public function handleCommandRequest(CommandRequestPacket $packet) : bool{
return $this->player->chat($packet->command);
}
public function handleCommandBlockUpdate(CommandBlockUpdatePacket $packet) : bool{
return false; //TODO
}
public function handleResourcePackChunkRequest(ResourcePackChunkRequestPacket $packet) : bool{
return $this->player->handleResourcePackChunkRequest($packet);
}
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
return $this->player->changeSkin($packet->skin, $packet->newSkinName, $packet->oldSkinName);
}
public function handleSubClientLogin(SubClientLoginPacket $packet) : bool{
return false; //TODO
}
public function handleBookEdit(BookEditPacket $packet) : bool{
return $this->player->handleBookEdit($packet);
}
public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{
return false; //TODO: GUI stuff
}
public function handleServerSettingsRequest(ServerSettingsRequestPacket $packet) : bool{
return false; //TODO: GUI stuff
}
public function handleLabTable(LabTablePacket $packet) : bool{
return false; //TODO
}
public function handleSetLocalPlayerAsInitialized(SetLocalPlayerAsInitializedPacket $packet) : bool{
return false; //TODO
}
}

View File

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

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\entity\Attribute;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\EntityLink;
class AddEntityPacket extends DataPacket{
@ -117,7 +117,7 @@ class AddEntityPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleAddEntity($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleAddEntity($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class AddHangingEntityPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ADD_HANGING_ENTITY_PACKET;
@ -57,7 +57,7 @@ class AddHangingEntityPacket extends DataPacket{
$this->putVarInt($this->direction);
}
public function handle(NetworkSession $session) : bool{
return $session->handleAddHangingEntity($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleAddHangingEntity($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class AddItemEntityPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ADD_ITEM_ENTITY_PACKET;
@ -67,7 +67,7 @@ class AddItemEntityPacket extends DataPacket{
$this->putBool($this->isFromFishing);
}
public function handle(NetworkSession $session) : bool{
return $session->handleAddItemEntity($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class AddPaintingPacket extends AddHangingEntityPacket{
public const NETWORK_ID = ProtocolInfo::ADD_PAINTING_PACKET;
@ -44,7 +44,7 @@ class AddPaintingPacket extends AddHangingEntityPacket{
$this->putString($this->title);
}
public function handle(NetworkSession $session) : bool{
return $session->handleAddPainting($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\EntityLink;
use pocketmine\utils\UUID;
@ -135,7 +135,7 @@ class AddPlayerPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleAddPlayer($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\PlayerPermissions;
class AdventureSettingsPacket extends DataPacket{
@ -116,7 +116,7 @@ class AdventureSettingsPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleAdventureSettings($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class AnimatePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ANIMATE_PACKET;
@ -59,7 +59,7 @@ class AnimatePacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleAnimate($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\CommandData;
use pocketmine\network\mcpe\protocol\types\CommandEnum;
use pocketmine\network\mcpe\protocol\types\CommandParameter;
@ -336,7 +336,7 @@ class AvailableCommandsPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleAvailableCommands($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleAvailableCommands($this);
}
}

View File

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

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class BlockEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::BLOCK_EVENT_PACKET;
@ -54,7 +54,7 @@ class BlockEventPacket extends DataPacket{
$this->putVarInt($this->eventData);
}
public function handle(NetworkSession $session) : bool{
return $session->handleBlockEvent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class BlockPickRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::BLOCK_PICK_REQUEST_PACKET;
@ -55,7 +55,7 @@ class BlockPickRequestPacket extends DataPacket{
$this->putByte($this->hotbarSlot);
}
public function handle(NetworkSession $session) : bool{
return $session->handleBlockPickRequest($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleBlockPickRequest($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class BookEditPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::BOOK_EDIT_PACKET;
@ -113,7 +113,7 @@ class BookEditPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleBookEdit($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class BossEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::BOSS_EVENT_PACKET;
@ -126,7 +126,7 @@ class BossEventPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleBossEvent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class CameraPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CAMERA_PACKET;
@ -45,7 +45,7 @@ class CameraPacket extends DataPacket{
$this->putEntityUniqueId($this->playerUniqueId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleCamera($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ChangeDimensionPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CHANGE_DIMENSION_PACKET;
@ -51,7 +51,7 @@ class ChangeDimensionPacket extends DataPacket{
$this->putBool($this->respawn);
}
public function handle(NetworkSession $session) : bool{
return $session->handleChangeDimension($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ChunkRadiusUpdatedPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CHUNK_RADIUS_UPDATED_PACKET;
@ -42,7 +42,7 @@ class ChunkRadiusUpdatedPacket extends DataPacket{
$this->putVarInt($this->radius);
}
public function handle(NetworkSession $session) : bool{
return $session->handleChunkRadiusUpdated($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ClientToServerHandshakePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CLIENT_TO_SERVER_HANDSHAKE_PACKET;
@ -43,7 +43,7 @@ class ClientToServerHandshakePacket extends DataPacket{
//No payload
}
public function handle(NetworkSession $session) : bool{
return $session->handleClientToServerHandshake($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleClientToServerHandshake($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\DimensionIds;
use pocketmine\network\mcpe\protocol\types\MapTrackedObject;
use pocketmine\utils\Color;
@ -194,7 +194,7 @@ class ClientboundMapItemDataPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleClientboundMapItemData($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class CommandBlockUpdatePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::COMMAND_BLOCK_UPDATE_PACKET;
@ -99,7 +99,7 @@ class CommandBlockUpdatePacket extends DataPacket{
$this->putBool($this->shouldTrackOutput);
}
public function handle(NetworkSession $session) : bool{
return $session->handleCommandBlockUpdate($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\CommandOriginData;
use pocketmine\network\mcpe\protocol\types\CommandOutputMessage;
@ -95,7 +95,7 @@ class CommandOutputPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleCommandOutput($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\CommandOriginData;
class CommandRequestPacket extends DataPacket{
@ -50,7 +50,7 @@ class CommandRequestPacket extends DataPacket{
$this->putBool($this->isInternal);
}
public function handle(NetworkSession $session) : bool{
return $session->handleCommandRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ContainerClosePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_CLOSE_PACKET;
@ -42,7 +42,7 @@ class ContainerClosePacket extends DataPacket{
$this->putByte($this->windowId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleContainerClose($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ContainerOpenPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_OPEN_PACKET;
@ -58,7 +58,7 @@ class ContainerOpenPacket extends DataPacket{
$this->putEntityUniqueId($this->entityUniqueId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleContainerOpen($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ContainerSetDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CONTAINER_SET_DATA_PACKET;
@ -60,7 +60,7 @@ class ContainerSetDataPacket extends DataPacket{
$this->putVarInt($this->value);
}
public function handle(NetworkSession $session) : bool{
return $session->handleContainerSetData($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleContainerSetData($this);
}
}

View File

@ -30,8 +30,8 @@ use pocketmine\inventory\FurnaceRecipe;
use pocketmine\inventory\ShapedRecipe;
use pocketmine\inventory\ShapelessRecipe;
use pocketmine\item\Item;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\NetworkBinaryStream;
use pocketmine\network\mcpe\NetworkSession;
class CraftingDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::CRAFTING_DATA_PACKET;
@ -215,7 +215,7 @@ class CraftingDataPacket extends DataPacket{
$this->putBool($this->cleanRecipes);
}
public function handle(NetworkSession $session) : bool{
return $session->handleCraftingData($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\utils\UUID;
class CraftingEventPacket extends DataPacket{
@ -81,7 +81,7 @@ class CraftingEventPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleCraftingEvent($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleCraftingEvent($this);
}
}

View File

@ -25,8 +25,8 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\NetworkBinaryStream;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\utils\Utils;
abstract class DataPacket extends NetworkBinaryStream{
@ -105,16 +105,20 @@ abstract class DataPacket extends NetworkBinaryStream{
}
/**
* Performs handling for this packet. Usually you'll want an appropriately named method in the NetworkSession for this.
* Performs handling for this packet. Usually you'll want an appropriately named method in the session handler for
* this.
*
* 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 NetworkSession. See other packets for examples how to implement this.
* 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.
*
* @param NetworkSession $session
* Typically this method returns the return value of the handler in the supplied SessionHandler. See other packets
* for examples how to implement this.
*
* @param SessionHandler $handler
*
* @return bool true if the packet was handled successfully, false if not.
*/
abstract public function handle(NetworkSession $session) : bool;
abstract public function handle(SessionHandler $handler) : bool;
public function clean(){
$this->buffer = null;

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class DisconnectPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::DISCONNECT_PACKET;
@ -54,7 +54,7 @@ class DisconnectPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleDisconnect($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class EntityEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_EVENT_PACKET;
@ -102,7 +102,7 @@ class EntityEventPacket extends DataPacket{
$this->putVarInt($this->data);
}
public function handle(NetworkSession $session) : bool{
return $session->handleEntityEvent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class EntityFallPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_FALL_PACKET;
@ -50,7 +50,7 @@ class EntityFallPacket extends DataPacket{
$this->putBool($this->isInVoid);
}
public function handle(NetworkSession $session) : bool{
return $session->handleEntityFall($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class EntityPickRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::ENTITY_PICK_REQUEST_PACKET;
@ -45,7 +45,7 @@ class EntityPickRequestPacket extends DataPacket{
$this->putByte($this->hotbarSlot);
}
public function handle(NetworkSession $session) : bool{
return $session->handleEntityPickRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class EventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::EVENT_PACKET;
@ -64,7 +64,7 @@ class EventPacket extends DataPacket{
//TODO: also nice confusing mess
}
public function handle(NetworkSession $session) : bool{
return $session->handleEvent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ExplodePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::EXPLODE_PACKET;
@ -66,7 +66,7 @@ class ExplodePacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleExplode($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class FullChunkDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::FULL_CHUNK_DATA_PACKET;
@ -50,7 +50,7 @@ class FullChunkDataPacket extends DataPacket{
$this->putString($this->data);
}
public function handle(NetworkSession $session) : bool{
return $session->handleFullChunkData($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class GameRulesChangedPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::GAME_RULES_CHANGED_PACKET;
@ -41,7 +41,7 @@ class GameRulesChangedPacket extends DataPacket{
$this->putGameRules($this->gameRules);
}
public function handle(NetworkSession $session) : bool{
return $session->handleGameRulesChanged($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class GuiDataPickItemPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::GUI_DATA_PICK_ITEM_PACKET;
@ -41,7 +41,7 @@ class GuiDataPickItemPacket extends DataPacket{
$this->putLInt($this->hotbarSlot);
}
public function handle(NetworkSession $session) : bool{
return $session->handleGuiDataPickItem($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class HurtArmorPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::HURT_ARMOR_PACKET;
@ -42,7 +42,7 @@ class HurtArmorPacket extends DataPacket{
$this->putVarInt($this->health);
}
public function handle(NetworkSession $session) : bool{
return $session->handleHurtArmor($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class InteractPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::INTERACT_PACKET;
@ -71,7 +71,7 @@ class InteractPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleInteract($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class InventoryContentPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::INVENTORY_CONTENT_PACKET;
@ -52,7 +52,7 @@ class InventoryContentPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleInventoryContent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class InventorySlotPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::INVENTORY_SLOT_PACKET;
@ -50,7 +50,7 @@ class InventorySlotPacket extends DataPacket{
$this->putSlot($this->item);
}
public function handle(NetworkSession $session) : bool{
return $session->handleInventorySlot($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleInventorySlot($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\NetworkInventoryAction;
class InventoryTransactionPacket extends DataPacket{
@ -151,7 +151,7 @@ class InventoryTransactionPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleInventoryTransaction($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ItemFrameDropItemPacket extends DataPacket{
@ -46,7 +46,7 @@ class ItemFrameDropItemPacket extends DataPacket{
$this->putBlockPosition($this->x, $this->y, $this->z);
}
public function handle(NetworkSession $session) : bool{
return $session->handleItemFrameDropItem($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class LabTablePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::LAB_TABLE_PACKET;
@ -55,7 +55,7 @@ class LabTablePacket extends DataPacket{
$this->putByte($this->reactionType);
}
public function handle(NetworkSession $session) : bool{
return $session->handleLabTable($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleLabTable($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class LevelEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_EVENT_PACKET;
@ -130,7 +130,7 @@ class LevelEventPacket extends DataPacket{
$this->putVarInt($this->data);
}
public function handle(NetworkSession $session) : bool{
return $session->handleLevelEvent($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class LevelSoundEventPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET;
@ -275,7 +275,7 @@ class LevelSoundEventPacket extends DataPacket{
$this->putBool($this->disableRelativeVolume);
}
public function handle(NetworkSession $session) : bool{
return $session->handleLevelSoundEvent($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleLevelSoundEvent($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\utils\BinaryStream;
use pocketmine\utils\MainLogger;
use pocketmine\utils\Utils;
@ -143,7 +143,7 @@ class LoginPacket extends DataPacket{
//TODO
}
public function handle(NetworkSession $session) : bool{
return $session->handleLogin($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleLogin($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MapInfoRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MAP_INFO_REQUEST_PACKET;
@ -43,7 +43,7 @@ class MapInfoRequestPacket extends DataPacket{
$this->putEntityUniqueId($this->mapId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleMapInfoRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MobArmorEquipmentPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET;
@ -51,7 +51,7 @@ class MobArmorEquipmentPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleMobArmorEquipment($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MobEffectPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOB_EFFECT_PACKET;
@ -66,7 +66,7 @@ class MobEffectPacket extends DataPacket{
$this->putVarInt($this->duration);
}
public function handle(NetworkSession $session) : bool{
return $session->handleMobEffect($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MobEquipmentPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOB_EQUIPMENT_PACKET;
@ -59,7 +59,7 @@ class MobEquipmentPacket extends DataPacket{
$this->putByte($this->windowId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleMobEquipment($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ModalFormRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MODAL_FORM_REQUEST_PACKET;
@ -45,7 +45,7 @@ class ModalFormRequestPacket extends DataPacket{
$this->putString($this->formData);
}
public function handle(NetworkSession $session) : bool{
return $session->handleModalFormRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ModalFormResponsePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MODAL_FORM_RESPONSE_PACKET;
@ -45,7 +45,7 @@ class ModalFormResponsePacket extends DataPacket{
$this->putString($this->formData);
}
public function handle(NetworkSession $session) : bool{
return $session->handleModalFormResponse($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MoveEntityAbsolutePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOVE_ENTITY_ABSOLUTE_PACKET;
@ -66,7 +66,7 @@ class MoveEntityAbsolutePacket extends DataPacket{
$this->putByteRotation($this->zRot);
}
public function handle(NetworkSession $session) : bool{
return $session->handleMoveEntityAbsolute($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MoveEntityDeltaPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOVE_ENTITY_DELTA_PACKET;
@ -98,7 +98,7 @@ class MoveEntityDeltaPacket extends DataPacket{
$this->maybeWriteRotation(self::FLAG_HAS_ROT_Z, $this->zRot);
}
public function handle(NetworkSession $session) : bool{
return $session->handleMoveEntityDelta($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class MovePlayerPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::MOVE_PLAYER_PACKET;
@ -88,7 +88,7 @@ class MovePlayerPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleMovePlayer($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class NpcRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::NPC_REQUEST_PACKET;
@ -53,7 +53,7 @@ class NpcRequestPacket extends DataPacket{
$this->putByte($this->actionType);
}
public function handle(NetworkSession $session) : bool{
return $session->handleNpcRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PhotoTransferPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PHOTO_TRANSFER_PACKET;
@ -49,7 +49,7 @@ class PhotoTransferPacket extends DataPacket{
$this->putString($this->bookId);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePhotoTransfer($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PlaySoundPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PLAY_SOUND_PACKET;
@ -62,7 +62,7 @@ class PlaySoundPacket extends DataPacket{
$this->putLFloat($this->pitch);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlaySound($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PlayStatusPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PLAY_STATUS_PACKET;
@ -69,7 +69,7 @@ class PlayStatusPacket extends DataPacket{
$this->putInt($this->status);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayStatus($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PlayerActionPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PLAYER_ACTION_PACKET;
@ -84,7 +84,7 @@ class PlayerActionPacket extends DataPacket{
$this->putVarInt($this->face);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayerAction($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
/**
@ -53,7 +53,7 @@ class PlayerHotbarPacket extends DataPacket{
$this->putBool($this->selectHotbarSlot);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayerHotbar($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PlayerInputPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PLAYER_INPUT_PACKET;
@ -54,7 +54,7 @@ class PlayerInputPacket extends DataPacket{
$this->putBool($this->sneaking);
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayerInput($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handlePlayerInput($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\entity\Skin;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
class PlayerListPacket extends DataPacket{
@ -105,7 +105,7 @@ class PlayerListPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayerList($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handlePlayerList($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\entity\Skin;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\utils\UUID;
class PlayerSkinPacket extends DataPacket{
@ -68,7 +68,7 @@ class PlayerSkinPacket extends DataPacket{
$this->putString($this->skin->getGeometryData());
}
public function handle(NetworkSession $session) : bool{
return $session->handlePlayerSkin($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class PurchaseReceiptPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::PURCHASE_RECEIPT_PACKET;
@ -47,7 +47,7 @@ class PurchaseReceiptPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handlePurchaseReceipt($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class RemoveEntityPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
@ -42,7 +42,7 @@ class RemoveEntityPacket extends DataPacket{
$this->putEntityUniqueId($this->entityUniqueId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleRemoveEntity($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class RemoveObjectivePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::REMOVE_OBJECTIVE_PACKET;
@ -41,7 +41,7 @@ class RemoveObjectivePacket extends DataPacket{
$this->putString($this->objectiveName);
}
public function handle(NetworkSession $session) : bool{
return $session->handleRemoveObjective($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class RequestChunkRadiusPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::REQUEST_CHUNK_RADIUS_PACKET;
@ -42,7 +42,7 @@ class RequestChunkRadiusPacket extends DataPacket{
$this->putVarInt($this->radius);
}
public function handle(NetworkSession $session) : bool{
return $session->handleRequestChunkRadius($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ResourcePackChunkDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_CHUNK_DATA_PACKET;
@ -56,7 +56,7 @@ class ResourcePackChunkDataPacket extends DataPacket{
$this->put($this->data);
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePackChunkData($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ResourcePackChunkRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_CHUNK_REQUEST_PACKET;
@ -47,7 +47,7 @@ class ResourcePackChunkRequestPacket extends DataPacket{
$this->putLInt($this->chunkIndex);
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePackChunkRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ResourcePackClientResponsePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_CLIENT_RESPONSE_PACKET;
@ -57,7 +57,7 @@ class ResourcePackClientResponsePacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePackClientResponse($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ResourcePackDataInfoPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_DATA_INFO_PACKET;
@ -59,7 +59,7 @@ class ResourcePackDataInfoPacket extends DataPacket{
$this->putString($this->sha256);
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePackDataInfo($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\resourcepacks\ResourcePack;
class ResourcePackStackPacket extends DataPacket{
@ -76,7 +76,7 @@ class ResourcePackStackPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePackStack($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\resourcepacks\ResourcePack;
class ResourcePacksInfoPacket extends DataPacket{
@ -81,7 +81,7 @@ class ResourcePacksInfoPacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleResourcePacksInfo($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class RespawnPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESPAWN_PACKET;
@ -43,7 +43,7 @@ class RespawnPacket extends DataPacket{
$this->putVector3($this->position);
}
public function handle(NetworkSession $session) : bool{
return $session->handleRespawn($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class RiderJumpPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RIDER_JUMP_PACKET;
@ -43,7 +43,7 @@ class RiderJumpPacket extends DataPacket{
$this->putVarInt($this->jumpStrength);
}
public function handle(NetworkSession $session) : bool{
return $session->handleRiderJump($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ServerSettingsRequestPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_SETTINGS_REQUEST_PACKET;
@ -38,7 +38,7 @@ class ServerSettingsRequestPacket extends DataPacket{
//No payload
}
public function handle(NetworkSession $session) : bool{
return $session->handleServerSettingsRequest($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ServerSettingsResponsePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_SETTINGS_RESPONSE_PACKET;
@ -45,7 +45,7 @@ class ServerSettingsResponsePacket extends DataPacket{
$this->putString($this->formData);
}
public function handle(NetworkSession $session) : bool{
return $session->handleServerSettingsResponse($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ServerToClientHandshakePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SERVER_TO_CLIENT_HANDSHAKE_PACKET;
@ -49,7 +49,7 @@ class ServerToClientHandshakePacket extends DataPacket{
$this->putString($this->jwt);
}
public function handle(NetworkSession $session) : bool{
return $session->handleServerToClientHandshake($this);
public function handle(SessionHandler $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\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetCommandsEnabledPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_COMMANDS_ENABLED_PACKET;
@ -42,7 +42,7 @@ class SetCommandsEnabledPacket extends DataPacket{
$this->putBool($this->enabled);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetCommandsEnabled($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetCommandsEnabled($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetDefaultGameTypePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_DEFAULT_GAME_TYPE_PACKET;
@ -41,7 +41,7 @@ class SetDefaultGameTypePacket extends DataPacket{
$this->putUnsignedVarInt($this->gamemode);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetDefaultGameType($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetDefaultGameType($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetDifficultyPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_DIFFICULTY_PACKET;
@ -42,7 +42,7 @@ class SetDifficultyPacket extends DataPacket{
$this->putUnsignedVarInt($this->difficulty);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetDifficulty($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetDifficulty($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetDisplayObjectivePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_DISPLAY_OBJECTIVE_PACKET;
@ -57,7 +57,7 @@ class SetDisplayObjectivePacket extends DataPacket{
$this->putVarInt($this->sortOrder);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetDisplayObjective($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetDisplayObjective($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetEntityDataPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_ENTITY_DATA_PACKET;
@ -46,7 +46,7 @@ class SetEntityDataPacket extends DataPacket{
$this->putEntityMetadata($this->metadata);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetEntityData($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetEntityData($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\EntityLink;
class SetEntityLinkPacket extends DataPacket{
@ -43,7 +43,7 @@ class SetEntityLinkPacket extends DataPacket{
$this->putEntityLink($this->link);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetEntityLink($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetEntityLink($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetEntityMotionPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_ENTITY_MOTION_PACKET;
@ -47,7 +47,7 @@ class SetEntityMotionPacket extends DataPacket{
$this->putVector3($this->motion);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetEntityMotion($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetEntityMotion($this);
}
}

View File

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

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetLastHurtByPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_LAST_HURT_BY_PACKET;
@ -41,7 +41,7 @@ class SetLastHurtByPacket extends DataPacket{
$this->putVarInt($this->entityTypeId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetLastHurtBy($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetLastHurtBy($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetLocalPlayerAsInitializedPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_LOCAL_PLAYER_AS_INITIALIZED_PACKET;
@ -41,7 +41,7 @@ class SetLocalPlayerAsInitializedPacket extends DataPacket{
$this->putEntityRuntimeId($this->entityRuntimeId);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetLocalPlayerAsInitialized($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetLocalPlayerAsInitialized($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetPlayerGameTypePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET;
@ -42,7 +42,7 @@ class SetPlayerGameTypePacket extends DataPacket{
$this->putVarInt($this->gamemode);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetPlayerGameType($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetPlayerGameType($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\ScorePacketEntry;
class SetScorePacket extends DataPacket{
@ -59,7 +59,7 @@ class SetScorePacket extends DataPacket{
}
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetScore($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetScore($this);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetSpawnPositionPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_SPAWN_POSITION_PACKET;
@ -57,7 +57,7 @@ class SetSpawnPositionPacket extends DataPacket{
$this->putBool($this->spawnForced);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetSpawnPosition($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetSpawnPosition($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetTimePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_TIME_PACKET;
@ -41,7 +41,7 @@ class SetTimePacket extends DataPacket{
$this->putVarInt($this->time);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetTime($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetTime($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class SetTitlePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SET_TITLE_PACKET;
@ -66,7 +66,7 @@ class SetTitlePacket extends DataPacket{
$this->putVarInt($this->fadeOutTime);
}
public function handle(NetworkSession $session) : bool{
return $session->handleSetTitle($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleSetTitle($this);
}
}

View File

@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ShowCreditsPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SHOW_CREDITS_PACKET;
@ -50,7 +50,7 @@ class ShowCreditsPacket extends DataPacket{
$this->putVarInt($this->status);
}
public function handle(NetworkSession $session) : bool{
return $session->handleShowCredits($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleShowCredits($this);
}
}

View File

@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\handler\SessionHandler;
class ShowProfilePacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::SHOW_PROFILE_PACKET;
@ -41,7 +41,7 @@ class ShowProfilePacket extends DataPacket{
$this->putString($this->xuid);
}
public function handle(NetworkSession $session) : bool{
return $session->handleShowProfile($this);
public function handle(SessionHandler $handler) : bool{
return $handler->handleShowProfile($this);
}
}

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