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

@ -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);
}
}