1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
// cPacket_Player.h
/* Interfaces to the player-related packets:
- PlayerAbilities (0xca)
- PlayerListItem (0xc9)
- PlayerLook (0x0c)
- PlayerMoveLook (0x0d)
- PlayerPosition (0x0b)
*/
#pragma once
#include "cPacket.h"
// fwd:
class cPlayer;
class cPacket_PlayerAbilities : public cPacket
{
public:
cPacket_PlayerAbilities(void) { m_PacketID = E_PLAYER_LIST_ITEM; }
virtual int Parse(cByteBuffer & a_Buffer) override;
virtual void Serialize(AString & a_Data) const override;
virtual cPacket * Clone() const { return new cPacket_PlayerAbilities(*this); }
bool m_Invulnerable; // Speculation
bool m_IsFlying;
bool m_CanFly;
bool m_InstaMine; // Speculation
} ;
class cPacket_PlayerListItem : public cPacket
{
public:
cPacket_PlayerListItem() { m_PacketID = E_PLAYER_LIST_ITEM; }
cPacket_PlayerListItem(const AString & a_PlayerName, bool a_Online, short a_Ping);
virtual int Parse(cByteBuffer & a_Buffer) override;
virtual void Serialize(AString & a_Data) const override;
virtual cPacket* Clone() const { return new cPacket_PlayerListItem(*this); }
AString m_PlayerName; // Supports chat coloring, limited to 16 characters.
bool m_Online;
short m_Ping;
} ;
class cPacket_PlayerLook : public cPacket
{
public:
cPacket_PlayerLook()
: m_Rotation( 0 )
, m_Pitch( 0 )
, m_IsOnGround( false )
{
m_PacketID = E_PLAYERLOOK;
}
cPacket_PlayerLook( cPlayer* a_Player );
virtual cPacket* Clone() const { return new cPacket_PlayerLook(*this); }
virtual int Parse(cByteBuffer & a_Buffer) override;
virtual void Serialize(AString & a_Data) const override;
float m_Rotation;
float m_Pitch;
bool m_IsOnGround;
} ;
class cPacket_PlayerMoveLook : public cPacket
{
public:
cPacket_PlayerMoveLook()
: m_PosX( 0.0 )
, m_PosY( 0.0 )
, m_Stance( 0.0 )
, m_PosZ( 0.0 )
, m_Rotation( 0.f )
, m_Pitch( 0.f )
, m_IsOnGround( false )
{
m_PacketID = E_PLAYERMOVELOOK;
}
cPacket_PlayerMoveLook(const cPlayer & a_Player);
virtual cPacket * Clone() const { return new cPacket_PlayerMoveLook(*this); }
virtual int Parse(cByteBuffer & a_Buffer) override;
virtual void Serialize(AString & a_Data) const override;
double m_PosX;
double m_PosY;
double m_Stance;
double m_PosZ;
float m_Rotation;
float m_Pitch;
bool m_IsOnGround;
} ;
class cPacket_PlayerPosition : public cPacket
{
public:
cPacket_PlayerPosition(const cPlayer & a_Player);
cPacket_PlayerPosition()
: m_PosX( 0.0 )
, m_PosY( 0.0 )
, m_PosZ( 0.0 )
, m_Stance( 0.0 )
, m_IsOnGround(true)
{ m_PacketID = E_PLAYERPOS; }
virtual cPacket* Clone() const { return new cPacket_PlayerPosition(*this); }
virtual int Parse(cByteBuffer & a_Buffer) override;
virtual void Serialize(AString & a_Data) const override;
double m_PosX;
double m_PosY;
double m_PosZ;
double m_Stance;
bool m_IsOnGround;
} ;
|