Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
MovementStructures.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef SF_MOVEMENT_STRUCTURES_H
7
#define SF_MOVEMENT_STRUCTURES_H
8
9
#include "
Object.h
"
10
#include "
Opcodes.h
"
11
12
class
ByteBuffer
;
13
class
Unit
;
14
15
enum
MovementStatusElements
16
{
17
MSEForcesCount
,
18
MSEHasCounter
,
19
MSEHasGuidByte0
,
20
MSEHasGuidByte1
,
21
MSEHasGuidByte2
,
22
MSEHasGuidByte3
,
23
MSEHasGuidByte4
,
24
MSEHasGuidByte5
,
25
MSEHasGuidByte6
,
26
MSEHasGuidByte7
,
27
MSEHasMountDisplayId
,
28
MSEHasMovementFlags
,
29
MSEHasMovementFlags2
,
30
MSEHasTimestamp
,
31
MSEHasOrientation
,
32
MSEHasTransportData
,
33
MSEHasTransportGuidByte0
,
34
MSEHasTransportGuidByte1
,
35
MSEHasTransportGuidByte2
,
36
MSEHasTransportGuidByte3
,
37
MSEHasTransportGuidByte4
,
38
MSEHasTransportGuidByte5
,
39
MSEHasTransportGuidByte6
,
40
MSEHasTransportGuidByte7
,
41
MSEHasTransportTime2
,
42
MSEHasTransportTime3
,
43
MSEHasTransportVehicleId
,
44
MSEHasPitch
,
45
MSEHasFallData
,
46
MSEHasFallDirection
,
47
MSEHasSplineElevation
,
48
MSEHasSpline
,
49
50
MSEForces
,
51
MSECount
,
52
MSECounter
,
53
MSEGuidByte0
,
54
MSEGuidByte1
,
55
MSEGuidByte2
,
56
MSEGuidByte3
,
57
MSEGuidByte4
,
58
MSEGuidByte5
,
59
MSEGuidByte6
,
60
MSEGuidByte7
,
61
MSEMountDisplayIdWithCheck
,
62
MSEMountDisplayIdWithoutCheck
,
63
MSEMovementFlags
,
64
MSEMovementFlags2
,
65
MSETimestamp
,
66
MSEPositionX
,
67
MSEPositionY
,
68
MSEPositionZ
,
69
MSEOrientation
,
70
MSEOrientationWithoutCheck
,
71
MSETransportGuidByte0
,
72
MSETransportGuidByte1
,
73
MSETransportGuidByte2
,
74
MSETransportGuidByte3
,
75
MSETransportGuidByte4
,
76
MSETransportGuidByte5
,
77
MSETransportGuidByte6
,
78
MSETransportGuidByte7
,
79
MSETransportPositionX
,
80
MSETransportPositionY
,
81
MSETransportPositionZ
,
82
MSETransportOrientation
,
83
MSETransportSeat
,
84
MSETransportTime
,
85
MSETransportTime2
,
86
MSETransportTime3
,
87
MSETransportVehicleId
,
88
MSEPitch
,
89
MSEFallTime
,
90
MSEFallVerticalSpeed
,
91
MSEFallCosAngle
,
92
MSEFallSinAngle
,
93
MSEFallHorizontalSpeed
,
94
MSESplineElevation
,
95
96
MSEUintCount
,
97
98
MSEAckCount
,
99
MSEFlushBits
,
100
101
// Special
102
MSEZeroBit
,
// writes bit value 1 or skips read bit
103
MSEOneBit
,
// writes bit value 0 or skips read bit
104
MSEEnd
,
// marks end of parsing
105
MSEExtraElement
,
// Used to signalize reading into ExtraMovementStatusElement, element sequence inside it is declared as separate array
106
// Allowed internal elements are: GUID markers (not transport), MSEExtraFloat, MSEExtraInt8
107
MSEExtraFloat
,
108
MSEExtraFloat2
,
109
MSEExtraInt8
,
110
MSEExtraInt32
,
111
MSEExtra2Bits
,
112
};
113
114
namespace
Movement
115
{
116
class
PacketSender
;
117
118
class
ExtraMovementStatusElement
119
{
120
friend
class
PacketSender
;
121
122
public
:
123
ExtraMovementStatusElement
(
MovementStatusElements
const
* elements) :
_elements
(elements),
_index
(0) { }
124
125
void
ReadNextElement
(
ByteBuffer
& packet);
126
void
WriteNextElement
(
ByteBuffer
& packet);
127
128
struct
129
{
130
ObjectGuid
guid
;
131
int8
byteData
;
132
int32
extraInt32Data
;
133
uint32
extra2BitsData
;
134
float
floatData
;
135
float
floatData2
;
136
}
Data
;
137
138
protected
:
139
void
ResetIndex
() {
_index
= 0; }
140
141
private
:
142
MovementStatusElements
const
*
_elements
;
143
uint32
_index
;
144
};
145
146
class
PacketSender
147
{
148
public
:
149
PacketSender
(
Unit
* unit,
Opcodes
serverControl,
Opcodes
playerControl,
Opcodes
broadcast =
SMSG_PLAYER_MOVE
,
ExtraMovementStatusElement
* extras = NULL);
150
151
void
Send
()
const
;
152
153
private
:
154
ExtraMovementStatusElement
*
_extraElements
;
155
Unit
*
_unit
;
156
Opcodes
_selfOpcode
;
157
Opcodes
_broadcast
;
158
};
159
160
bool
PrintInvalidSequenceElement
(
MovementStatusElements
element,
char
const
* function);
161
}
162
163
MovementStatusElements
const
*
GetMovementStatusElementsSequence
(
Opcodes
opcode);
164
165
#endif
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
int8
std::int8_t int8
Definition
Define.h:75
GetMovementStatusElementsSequence
MovementStatusElements const * GetMovementStatusElementsSequence(Opcodes opcode)
Definition
MovementStructures.cpp:6642
MovementStatusElements
MovementStatusElements
Definition
MovementStructures.h:16
MSEFallHorizontalSpeed
@ MSEFallHorizontalSpeed
Definition
MovementStructures.h:93
MSETransportGuidByte6
@ MSETransportGuidByte6
Definition
MovementStructures.h:77
MSEHasGuidByte6
@ MSEHasGuidByte6
Definition
MovementStructures.h:25
MSEExtraFloat2
@ MSEExtraFloat2
Definition
MovementStructures.h:108
MSEZeroBit
@ MSEZeroBit
Definition
MovementStructures.h:102
MSEHasTransportData
@ MSEHasTransportData
Definition
MovementStructures.h:32
MSEFlushBits
@ MSEFlushBits
Definition
MovementStructures.h:99
MSEHasCounter
@ MSEHasCounter
Definition
MovementStructures.h:18
MSEFallVerticalSpeed
@ MSEFallVerticalSpeed
Definition
MovementStructures.h:90
MSEMountDisplayIdWithCheck
@ MSEMountDisplayIdWithCheck
Definition
MovementStructures.h:61
MSEForcesCount
@ MSEForcesCount
Definition
MovementStructures.h:17
MSESplineElevation
@ MSESplineElevation
Definition
MovementStructures.h:94
MSEHasMovementFlags
@ MSEHasMovementFlags
Definition
MovementStructures.h:28
MSEFallTime
@ MSEFallTime
Definition
MovementStructures.h:89
MSEHasTransportVehicleId
@ MSEHasTransportVehicleId
Definition
MovementStructures.h:43
MSEExtraInt32
@ MSEExtraInt32
Definition
MovementStructures.h:110
MSEGuidByte6
@ MSEGuidByte6
Definition
MovementStructures.h:59
MSEHasTransportGuidByte5
@ MSEHasTransportGuidByte5
Definition
MovementStructures.h:38
MSEHasGuidByte4
@ MSEHasGuidByte4
Definition
MovementStructures.h:23
MSEHasGuidByte5
@ MSEHasGuidByte5
Definition
MovementStructures.h:24
MSEHasOrientation
@ MSEHasOrientation
Definition
MovementStructures.h:31
MSETransportGuidByte0
@ MSETransportGuidByte0
Definition
MovementStructures.h:71
MSEOrientation
@ MSEOrientation
Definition
MovementStructures.h:69
MSETransportGuidByte2
@ MSETransportGuidByte2
Definition
MovementStructures.h:73
MSETransportVehicleId
@ MSETransportVehicleId
Definition
MovementStructures.h:87
MSETransportGuidByte1
@ MSETransportGuidByte1
Definition
MovementStructures.h:72
MSECounter
@ MSECounter
Definition
MovementStructures.h:52
MSETransportGuidByte7
@ MSETransportGuidByte7
Definition
MovementStructures.h:78
MSEPositionX
@ MSEPositionX
Definition
MovementStructures.h:66
MSEMountDisplayIdWithoutCheck
@ MSEMountDisplayIdWithoutCheck
Definition
MovementStructures.h:62
MSEExtraInt8
@ MSEExtraInt8
Definition
MovementStructures.h:109
MSEFallSinAngle
@ MSEFallSinAngle
Definition
MovementStructures.h:92
MSEHasPitch
@ MSEHasPitch
Definition
MovementStructures.h:44
MSEMovementFlags2
@ MSEMovementFlags2
Definition
MovementStructures.h:64
MSEHasGuidByte3
@ MSEHasGuidByte3
Definition
MovementStructures.h:22
MSEHasTimestamp
@ MSEHasTimestamp
Definition
MovementStructures.h:30
MSEHasFallData
@ MSEHasFallData
Definition
MovementStructures.h:45
MSEFallCosAngle
@ MSEFallCosAngle
Definition
MovementStructures.h:91
MSEHasMovementFlags2
@ MSEHasMovementFlags2
Definition
MovementStructures.h:29
MSETransportPositionX
@ MSETransportPositionX
Definition
MovementStructures.h:79
MSEHasSpline
@ MSEHasSpline
Definition
MovementStructures.h:48
MSEAckCount
@ MSEAckCount
Definition
MovementStructures.h:98
MSEHasTransportTime2
@ MSEHasTransportTime2
Definition
MovementStructures.h:41
MSEHasTransportGuidByte3
@ MSEHasTransportGuidByte3
Definition
MovementStructures.h:36
MSEGuidByte1
@ MSEGuidByte1
Definition
MovementStructures.h:54
MSEHasFallDirection
@ MSEHasFallDirection
Definition
MovementStructures.h:46
MSETransportTime3
@ MSETransportTime3
Definition
MovementStructures.h:86
MSETransportGuidByte3
@ MSETransportGuidByte3
Definition
MovementStructures.h:74
MSEHasTransportGuidByte6
@ MSEHasTransportGuidByte6
Definition
MovementStructures.h:39
MSEHasGuidByte0
@ MSEHasGuidByte0
Definition
MovementStructures.h:19
MSEHasTransportTime3
@ MSEHasTransportTime3
Definition
MovementStructures.h:42
MSEHasTransportGuidByte2
@ MSEHasTransportGuidByte2
Definition
MovementStructures.h:35
MSEGuidByte2
@ MSEGuidByte2
Definition
MovementStructures.h:55
MSEGuidByte0
@ MSEGuidByte0
Definition
MovementStructures.h:53
MSEHasTransportGuidByte1
@ MSEHasTransportGuidByte1
Definition
MovementStructures.h:34
MSEHasSplineElevation
@ MSEHasSplineElevation
Definition
MovementStructures.h:47
MSETransportTime
@ MSETransportTime
Definition
MovementStructures.h:84
MSETransportTime2
@ MSETransportTime2
Definition
MovementStructures.h:85
MSEPositionZ
@ MSEPositionZ
Definition
MovementStructures.h:68
MSEPitch
@ MSEPitch
Definition
MovementStructures.h:88
MSEUintCount
@ MSEUintCount
Definition
MovementStructures.h:96
MSEExtraElement
@ MSEExtraElement
Definition
MovementStructures.h:105
MSEHasTransportGuidByte7
@ MSEHasTransportGuidByte7
Definition
MovementStructures.h:40
MSETransportSeat
@ MSETransportSeat
Definition
MovementStructures.h:83
MSEPositionY
@ MSEPositionY
Definition
MovementStructures.h:67
MSEHasGuidByte7
@ MSEHasGuidByte7
Definition
MovementStructures.h:26
MSEExtraFloat
@ MSEExtraFloat
Definition
MovementStructures.h:107
MSEMovementFlags
@ MSEMovementFlags
Definition
MovementStructures.h:63
MSEHasMountDisplayId
@ MSEHasMountDisplayId
Definition
MovementStructures.h:27
MSEOrientationWithoutCheck
@ MSEOrientationWithoutCheck
Definition
MovementStructures.h:70
MSEHasGuidByte2
@ MSEHasGuidByte2
Definition
MovementStructures.h:21
MSECount
@ MSECount
Definition
MovementStructures.h:51
MSEGuidByte3
@ MSEGuidByte3
Definition
MovementStructures.h:56
MSETransportGuidByte5
@ MSETransportGuidByte5
Definition
MovementStructures.h:76
MSEOneBit
@ MSEOneBit
Definition
MovementStructures.h:103
MSEEnd
@ MSEEnd
Definition
MovementStructures.h:104
MSETransportOrientation
@ MSETransportOrientation
Definition
MovementStructures.h:82
MSETransportPositionY
@ MSETransportPositionY
Definition
MovementStructures.h:80
MSETransportGuidByte4
@ MSETransportGuidByte4
Definition
MovementStructures.h:75
MSEGuidByte5
@ MSEGuidByte5
Definition
MovementStructures.h:58
MSEHasTransportGuidByte4
@ MSEHasTransportGuidByte4
Definition
MovementStructures.h:37
MSETransportPositionZ
@ MSETransportPositionZ
Definition
MovementStructures.h:81
MSEHasTransportGuidByte0
@ MSEHasTransportGuidByte0
Definition
MovementStructures.h:33
MSEForces
@ MSEForces
Definition
MovementStructures.h:50
MSEGuidByte7
@ MSEGuidByte7
Definition
MovementStructures.h:60
MSETimestamp
@ MSETimestamp
Definition
MovementStructures.h:65
MSEExtra2Bits
@ MSEExtra2Bits
Definition
MovementStructures.h:111
MSEGuidByte4
@ MSEGuidByte4
Definition
MovementStructures.h:57
MSEHasGuidByte1
@ MSEHasGuidByte1
Definition
MovementStructures.h:20
Object.h
Opcodes.h
ByteBuffer
Definition
ByteBuffer.h:120
Movement::ExtraMovementStatusElement
Definition
MovementStructures.h:119
Movement::ExtraMovementStatusElement::_index
uint32 _index
Definition
MovementStructures.h:143
Movement::ExtraMovementStatusElement::floatData2
float floatData2
Definition
MovementStructures.h:135
Movement::ExtraMovementStatusElement::_elements
MovementStatusElements const * _elements
Definition
MovementStructures.h:142
Movement::ExtraMovementStatusElement::PacketSender
friend class PacketSender
Definition
MovementStructures.h:120
Movement::ExtraMovementStatusElement::ReadNextElement
void ReadNextElement(ByteBuffer &packet)
Definition
MovementStructures.cpp:6501
Movement::ExtraMovementStatusElement::WriteNextElement
void WriteNextElement(ByteBuffer &packet)
Definition
MovementStructures.cpp:6548
Movement::ExtraMovementStatusElement::ResetIndex
void ResetIndex()
Definition
MovementStructures.h:139
Movement::ExtraMovementStatusElement::floatData
float floatData
Definition
MovementStructures.h:134
Movement::ExtraMovementStatusElement::extra2BitsData
uint32 extra2BitsData
Definition
MovementStructures.h:133
Movement::ExtraMovementStatusElement::guid
ObjectGuid guid
Definition
MovementStructures.h:130
Movement::ExtraMovementStatusElement::extraInt32Data
int32 extraInt32Data
Definition
MovementStructures.h:132
Movement::ExtraMovementStatusElement::ExtraMovementStatusElement
ExtraMovementStatusElement(MovementStatusElements const *elements)
Definition
MovementStructures.h:123
Movement::ExtraMovementStatusElement::byteData
int8 byteData
Definition
MovementStructures.h:131
Movement::PacketSender
Definition
MovementStructures.h:147
Movement::PacketSender::_unit
Unit * _unit
Definition
MovementStructures.h:155
Movement::PacketSender::_broadcast
Opcodes _broadcast
Definition
MovementStructures.h:157
Movement::PacketSender::Send
void Send() const
Definition
MovementStructures.cpp:6616
Movement::PacketSender::_extraElements
ExtraMovementStatusElement * _extraElements
Definition
MovementStructures.h:154
Movement::PacketSender::_selfOpcode
Opcodes _selfOpcode
Definition
MovementStructures.h:156
Movement::PacketSender::PacketSender
PacketSender(Unit *unit, Opcodes serverControl, Opcodes playerControl, Opcodes broadcast=SMSG_PLAYER_MOVE, ExtraMovementStatusElement *extras=NULL)
Definition
MovementStructures.cpp:6601
Unit
Definition
Unit.h:1367
Opcodes
Opcodes
List of Opcodes.
Definition
Opcodes.h:21
SMSG_PLAYER_MOVE
@ SMSG_PLAYER_MOVE
Definition
Opcodes.h:878
Data
Data
Definition
molten_core.h:55
Movement
Definition
Unit.h:365
Movement::PrintInvalidSequenceElement
bool PrintInvalidSequenceElement(MovementStatusElements element, char const *function)
Definition
MovementStructures.cpp:6595
ObjectGuid
Definition
ByteBuffer.h:66
src
server
game
Movement
MovementStructures.h
Generated on
for Project SkyFire Core by
1.17.0