From 8bf3b6bbea581e98eb118e4f25aaab457de8def4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 24 Feb 2017 19:58:24 +0000 Subject: [PATCH] Added ShowCreditsPacket --- src/pocketmine/network/Network.php | 2 + .../network/protocol/ShowCreditsPacket.php | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/pocketmine/network/protocol/ShowCreditsPacket.php diff --git a/src/pocketmine/network/Network.php b/src/pocketmine/network/Network.php index ac198cc44..45cd58cb3 100644 --- a/src/pocketmine/network/Network.php +++ b/src/pocketmine/network/Network.php @@ -87,6 +87,7 @@ use pocketmine\network\protocol\SetHealthPacket; use pocketmine\network\protocol\SetPlayerGameTypePacket; use pocketmine\network\protocol\SetSpawnPositionPacket; use pocketmine\network\protocol\SetTimePacket; +use pocketmine\network\protocol\ShowCreditsPacket; use pocketmine\network\protocol\SpawnExperienceOrbPacket; use pocketmine\network\protocol\StartGamePacket; use pocketmine\network\protocol\TakeItemEntityPacket; @@ -364,6 +365,7 @@ class Network{ $this->registerPacket(ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET, SetPlayerGameTypePacket::class); $this->registerPacket(ProtocolInfo::SET_SPAWN_POSITION_PACKET, SetSpawnPositionPacket::class); $this->registerPacket(ProtocolInfo::SET_TIME_PACKET, SetTimePacket::class); + $this->registerPacket(ProtocolInfo::SHOW_CREDITS_PACKET, ShowCreditsPacket::class); $this->registerPacket(ProtocolInfo::SPAWN_EXPERIENCE_ORB_PACKET, SpawnExperienceOrbPacket::class); $this->registerPacket(ProtocolInfo::START_GAME_PACKET, StartGamePacket::class); $this->registerPacket(ProtocolInfo::TAKE_ITEM_ENTITY_PACKET, TakeItemEntityPacket::class); diff --git a/src/pocketmine/network/protocol/ShowCreditsPacket.php b/src/pocketmine/network/protocol/ShowCreditsPacket.php new file mode 100644 index 000000000..751831ae5 --- /dev/null +++ b/src/pocketmine/network/protocol/ShowCreditsPacket.php @@ -0,0 +1,47 @@ + + + +class ShowCreditsPacket extends DataPacket{ + const NETWORK_ID = Info::SHOW_CREDITS_PACKET; + + const STATUS_START_CREDITS = 0; + const STATUS_END_CREDITS = 1; + + public $playerEid; + public $status; + + public function decode(){ + $this->playerEid = $this->getEntityId(); + $this->status = $this->getVarInt(); + } + + public function encode(){ + $this->reset(); + $this->putEntityId($this->playerEid); + $this->putVarInt($this->status); + } +} \ No newline at end of file