PocketMine-MP
5.35.1 git-e32e836dad793a3a3c8ddd8927c00e112b1e576a
Loading...
Searching...
No Matches
DebugInfoPacket.php
1
<?php
2
3
/*
4
* This file is part of BedrockProtocol.
5
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6
*
7
* BedrockProtocol is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*/
12
13
declare(strict_types=1);
14
15
namespace
pocketmine\network\mcpe\protocol;
16
17
use pmmp\encoding\ByteBufferReader;
18
use pmmp\encoding\ByteBufferWriter;
19
use
pocketmine\network\mcpe\protocol\serializer\CommonTypes
;
20
21
class
DebugInfoPacket
extends
DataPacket
implements
ClientboundPacket
,
ServerboundPacket
{
22
public
const
NETWORK_ID = ProtocolInfo::DEBUG_INFO_PACKET;
23
24
private
int
$actorUniqueId;
25
private
string
$data;
26
30
public
static
function
create
(
int
$actorUniqueId,
string
$data) : self{
31
$result = new self;
32
$result->actorUniqueId = $actorUniqueId;
33
$result->data = $data;
34
return
$result;
35
}
36
37
public
function
getActorUniqueId() : int{ return $this->actorUniqueId; }
38
39
public
function
getData() : string{ return $this->data; }
40
41
protected
function
decodePayload
(ByteBufferReader $in) : void{
42
$this->actorUniqueId =
CommonTypes
::getActorUniqueId($in);
43
$this->data = CommonTypes::getString($in);
44
}
45
46
protected
function
encodePayload
(ByteBufferWriter $out) : void{
47
CommonTypes
::putActorUniqueId($out, $this->actorUniqueId);
48
CommonTypes::putString($out, $this->data);
49
}
50
51
public
function
handle
(
PacketHandlerInterface
$handler) : bool{
52
return $handler->handleDebugInfo($this);
53
}
54
}
pocketmine\network\mcpe\protocol\DataPacket
Definition
DataPacket.php:23
pocketmine\network\mcpe\protocol\DebugInfoPacket
Definition
DebugInfoPacket.php:21
pocketmine\network\mcpe\protocol\DebugInfoPacket\encodePayload
encodePayload(ByteBufferWriter $out)
Definition
DebugInfoPacket.php:46
pocketmine\network\mcpe\protocol\DebugInfoPacket\create
static create(int $actorUniqueId, string $data)
Definition
DebugInfoPacket.php:30
pocketmine\network\mcpe\protocol\DebugInfoPacket\handle
handle(PacketHandlerInterface $handler)
Definition
DebugInfoPacket.php:51
pocketmine\network\mcpe\protocol\DebugInfoPacket\decodePayload
decodePayload(ByteBufferReader $in)
Definition
DebugInfoPacket.php:41
pocketmine\network\mcpe\protocol\serializer\CommonTypes
Definition
CommonTypes.php:70
pocketmine\network\mcpe\protocol\ClientboundPacket
Definition
ClientboundPacket.php:17
pocketmine\network\mcpe\protocol\PacketHandlerInterface
Definition
PacketHandlerInterface.php:20
pocketmine\network\mcpe\protocol\ServerboundPacket
Definition
ServerboundPacket.php:17
vendor
pocketmine
bedrock-protocol
src
DebugInfoPacket.php
Generated by
1.12.0