Loading [MathJax]/extensions/MathMenu.js
PocketMine-MP
5.25.3 git-afc4a3c7f18d42b41cbfde84ab6a2e4dd7c03045
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
g
i
m
n
o
p
r
s
t
Functions
Variables
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Variables
$
a
c
d
e
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Files
File List
▼
PocketMine-MP
PocketMine-MP API Documentation
Deprecated List
►
Namespaces
►
Classes
▼
Files
▼
File List
►
src
▼
vendor
▼
pocketmine
►
bedrock-data
►
bedrock-protocol
►
binaryutils
►
callback-validator
►
color
►
errorhandler
►
log
►
math
►
nbt
▼
raklib
▼
src
►
client
►
generic
▼
protocol
ACK.php
AcknowledgePacket.php
AdvertiseSystem.php
ConnectedPacket.php
ConnectedPing.php
ConnectedPong.php
ConnectionRequest.php
ConnectionRequestAccepted.php
Datagram.php
DisconnectionNotification.php
EncapsulatedPacket.php
IncompatibleProtocolVersion.php
MessageIdentifiers.php
NACK.php
NewIncomingConnection.php
OfflineMessage.php
OpenConnectionReply1.php
OpenConnectionReply2.php
OpenConnectionRequest1.php
OpenConnectionRequest2.php
raklib/src/protocol/Packet.php
PacketReliability.php
raklib/src/protocol/PacketSerializer.php
SplitPacketInfo.php
UnconnectedPing.php
UnconnectedPingOpenConnections.php
UnconnectedPong.php
►
server
►
utils
RakLib.php
►
tools
raklib/.php-cs-fixer.php
►
raklib-ipc
►
snooze
•
All
Classes
Namespaces
Functions
Variables
Enumerations
Enumerator
Pages
Loading...
Searching...
No Matches
raklib/src/protocol/Packet.php
1
<?php
2
3
/*
4
* This file is part of RakLib.
5
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/RakLib>
6
*
7
* RakLib is not affiliated with Jenkins Software LLC nor RakNet.
8
*
9
* RakLib is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*/
14
15
declare(strict_types=1);
16
17
namespace
raklib\protocol;
18
19
use
pocketmine\utils\BinaryDataException
;
20
21
abstract
class
Packet
{
23
public
static
$ID = -1;
24
25
public
function
encode(
PacketSerializer
$out) :
void
{
26
$this->encodeHeader($out);
27
$this->encodePayload($out);
28
}
29
30
protected
function
encodeHeader(
PacketSerializer
$out) :
void
{
31
$out->putByte(static::$ID);
32
}
33
34
abstract
protected
function
encodePayload(
PacketSerializer
$out) : void;
35
39
public
function
decode
(
PacketSerializer
$in) : void{
40
$this->
decodeHeader
($in);
41
$this->
decodePayload
($in);
42
}
39
public
function
decode
(
PacketSerializer
$in) : void {
…
}
43
47
protected
function
decodeHeader
(
PacketSerializer
$in) : void{
48
$in->getByte();
//PID
49
}
47
protected
function
decodeHeader
(
PacketSerializer
$in) : void {
…
}
50
54
abstract
protected
function
decodePayload
(
PacketSerializer
$in) : void;
55
}
21
abstract
class
Packet
{
…
};
pocketmine\utils\BinaryDataException
Definition
BinaryDataException.php:26
raklib\protocol\Packet
Definition
raklib/src/protocol/Packet.php:21
raklib\protocol\Packet\decodePayload
decodePayload(PacketSerializer $in)
raklib\protocol\Packet\decodeHeader
decodeHeader(PacketSerializer $in)
Definition
raklib/src/protocol/Packet.php:47
raklib\protocol\Packet\decode
decode(PacketSerializer $in)
Definition
raklib/src/protocol/Packet.php:39
raklib\protocol\PacketSerializer
Definition
raklib/src/protocol/PacketSerializer.php:30
vendor
pocketmine
raklib
src
protocol
Packet.php
Generated by
1.12.0