diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-04-09 17:24:39 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-04-09 17:24:39 +0200 |
commit | 12a828fdbc01b9fca817829f9da3be2cf8cedf46 (patch) | |
tree | bedf2c3cf036f4e56635f4e41c41b4e72f9418a3 /src/server/game/Handlers/MovementHandler.cpp | |
parent | c34fd8d862fa85e8e1ed9d6abac349647f6cc082 (diff) |
Core/Movement
* Implemented a generic way of sending movement packets depending on who controls the unit (player or server controlled)
* Added possibility to specify extra elements in movement packets (such as speed, extra passenger guid, collision height and similar) without having to add a special element only for these
* Removed Unit::SendMovementFlagUpdate as it was something working only in 3.3.5a and earlier (no serverside HEARTBEAT opcode exists now)
Diffstat (limited to 'src/server/game/Handlers/MovementHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/MovementHandler.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 2b904537b1e..892a926d2c3 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -30,6 +30,7 @@ #include "WaypointMovementGenerator.h" #include "InstanceSaveMgr.h" #include "ObjectMgr.h" +#include "MovementStructures.h" void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket& /*recvPacket*/) { @@ -425,28 +426,19 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) uint32 opcode = recvData.GetOpcode(); /* extract packet */ - uint64 guid; - uint32 unk1; - float newspeed; - - recvData.readPackGUID(guid); + MovementInfo movementInfo; + static MovementStatusElements const speedElement = MSEExtraFloat; + Movement::ExtraMovementStatusElement extras(&speedElement); + GetPlayer()->ReadMovementInfo(recvData, &movementInfo, &extras); // now can skip not our packet - if (_player->GetGUID() != guid) + if (_player->GetGUID() != movementInfo.guid) { recvData.rfinish(); // prevent warnings spam return; } - // continue parse packet - - recvData >> unk1; // counter or moveEvent - - MovementInfo movementInfo; - movementInfo.guid = guid; - GetPlayer()->ReadMovementInfo(recvData, &movementInfo); - - recvData >> newspeed; + float newspeed = extras.Data.floatData; /*----------------*/ // client ACK send one packet for mounted/run case and need skip all except last from its @@ -615,3 +607,13 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData) _player->SummonIfPossible(agree); } + +void WorldSession::HandleSetCollisionHeightAck(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_SET_COLLISION_HEIGHT_ACK"); + + static MovementStatusElements const heightElement = MSEExtraFloat; + Movement::ExtraMovementStatusElement extra(&heightElement); + MovementInfo movementInfo; + GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo, &extra); +} |