TrinityCore
Loading...
Searching...
No Matches
MovementPacketSender.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef MOVEMENT_SENDER_H
19#define MOVEMENT_SENDER_H
20
21#include "UnitDefines.h"
22
23class Player;
24class Unit;
25struct MovementInfo;
26enum class MovementChangeType : uint8;
90
91/*
92xxxxxToMover() and xxxxxToObservers() methods should be only used on a unit controlled & moved by a player (as in direct client control: possess, vehicule,..).
93ToMover() to send a packet to the client (asking for confirmation before acting the change) and ToObservers once the change has been acted and should be broadcasted to the other players around (the observers).
94
95xxxxxToAll() method should be used on a unit controlled & moved by the server (@todo note to self: does a player moved unit under the control of a temporary disorient (Scatter Shot eg) or fear fall into this category? EDIT: by looking at the effects of Psychic Scream (10890), the answer is yes)
96*/
98{
99 public:
101 //static void SendHeightChangeToMover(Unit* unit, float newRate);
102 //static void SendHeightChangeToObservers(Unit* unit, float newRate);
103
105 //static void SendTeleportAckPacket(Unit* unit, MovementInfo const& movementInfo); // rename to SendTeleportToMover?
106 //static void SendTeleportPacket(Unit* unit, MovementInfo const& movementInfo); // rename to SendTeleportToobservers?
107
108 /* speed change */
109 static void SendSpeedChangeToMover(Unit* unit, UnitMoveType mtype, float newRate);
110 static void SendSpeedChangeToObservers(Unit* unit, UnitMoveType mtype, float newRate);
111 static void SendSpeedChangeToAll(Unit* unit, UnitMoveType mtype, float newRate);
112
114 //static void SendKnockBackToMover(Unit* unit, float vcos, float vsin, float speedXY, float speedZ);
115 //static void SendKnockBackToObservers(Unit* unit, float vcos, float vsin, float speedXY, float speedZ);
116
118 //static void SendMovementFlagChangeToMover(Unit* unit, MovementFlags mFlag, bool apply);
119 //static void SendMovementFlagChangeToMover(Unit* unit, MovementFlags2 mFlag, bool apply);
120 //static void SendMovementFlagChangeToObservers(Unit* unit, MovementFlags mFlag, bool apply);
121 //static void SendMovementFlagChangeToObservers(Unit* unit, MovementFlags2 mFlag);
122
123 //static void SendMovementFlagChangeToAll(Unit* unit, MovementFlags mFlag, bool apply);
124
125 // utility method
127
128 private:
129 static Opcodes const moveTypeToOpcode[MAX_MOVE_TYPE][3];
130};
131
132#endif
uint8_t uint8
Definition Define.h:135
#define MAX_MOVE_TYPE
UnitMoveType
MovementChangeType
Definition Unit.h:275
static void SendSpeedChangeToMover(Unit *unit, UnitMoveType mtype, float newRate)
static MovementChangeType GetChangeTypeByMoveType(UnitMoveType moveType)
static void SendSpeedChangeToObservers(Unit *unit, UnitMoveType mtype, float newRate)
static void SendSpeedChangeToAll(Unit *unit, UnitMoveType mtype, float newRate)
static Opcodes const moveTypeToOpcode[MAX_MOVE_TYPE][3]
Definition Unit.h:769
Opcodes
Definition Opcodes.h:29