TrinityCore
Loading...
Searching...
No Matches
MovementPacketSender.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
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;
27enum class MovementChangeType : uint8;
28
91
92/*
93xxxxxToMover() and xxxxxToObservers() methods should be only used on a unit controlled & moved by a player (as in direct client control: possess, vehicule,..).
94ToMover() 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).
95
96xxxxxToAll() 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)
97*/
99{
100 public:
102 //static void SendHeightChangeToMover(Unit* unit, float newRate);
103 //static void SendHeightChangeToObservers(Unit* unit, float newRate);
104
106 //static void SendTeleportAckPacket(Unit* unit, MovementInfo const& movementInfo); // rename to SendTeleportToMover?
107 //static void SendTeleportPacket(Unit* unit, MovementInfo const& movementInfo); // rename to SendTeleportToobservers?
108
109 /* speed change */
110 static void SendSpeedChangeToMover(Unit* unit, UnitMoveType mtype, float newRate);
111 static void SendSpeedChangeToObservers(Unit* unit, UnitMoveType mtype, float newRate);
112 static void SendSpeedChangeToAll(Unit* unit, UnitMoveType mtype, float newRate);
113
115 //static void SendKnockBackToMover(Unit* unit, float vcos, float vsin, float speedXY, float speedZ);
116 //static void SendKnockBackToObservers(Unit* unit, float vcos, float vsin, float speedXY, float speedZ);
117
119 //static void SendMovementFlagChangeToMover(Unit* unit, MovementFlags mFlag, bool apply);
120 //static void SendMovementFlagChangeToMover(Unit* unit, MovementFlags2 mFlag, bool apply);
121 //static void SendMovementFlagChangeToObservers(Unit* unit, MovementFlags mFlag, bool apply);
122 //static void SendMovementFlagChangeToObservers(Unit* unit, MovementFlags2 mFlag);
123
124 //static void SendMovementFlagChangeToAll(Unit* unit, MovementFlags mFlag, bool apply);
125
126 // utility method
128
129 private:
130 static Opcodes const moveTypeToOpcode[MAX_MOVE_TYPE][3];
131};
132
133#endif
uint8_t uint8
Definition Define.h:135
uint16_t uint16
Definition Define.h:134
#define MAX_MOVE_TYPE
UnitMoveType
MovementChangeType
Definition Unit.h:289
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:783
Opcodes
Definition Opcodes.h:29