diff options
| author | kaelima <kaelima@live.se> | 2012-11-05 12:02:08 +0100 |
|---|---|---|
| committer | kaelima <kaelima@live.se> | 2012-11-05 12:02:08 +0100 |
| commit | 3c13454ad71b259c50d394a8a467a2570f683827 (patch) | |
| tree | 13b8744efdb5fc8930630f5e5c513f2727c7bb18 /src/server/game/Handlers/MovementHandler.cpp | |
| parent | 19d7f68592d653067c3b84c3d409e59b2724a85d (diff) | |
| parent | c5fdb02305c78d8193f8c3161449e3955d4f7e8a (diff) | |
Merge git://github.com/TrinityCore/TrinityCore into mmaps
Conflicts:
src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
src/server/game/Movement/Spline/MoveSplineInit.cpp
Diffstat (limited to 'src/server/game/Handlers/MovementHandler.cpp')
| -rwxr-xr-x | src/server/game/Handlers/MovementHandler.cpp | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index ca80921a7b2..0eaf3c127b7 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -31,7 +31,7 @@ #include "InstanceSaveMgr.h" #include "ObjectMgr.h" -void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); HandleMoveWorldportAckOpcode(); @@ -46,7 +46,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); // get the teleport destination - WorldLocation const loc = GetPlayer()->GetTeleportDest(); + WorldLocation const& loc = GetPlayer()->GetTeleportDest(); // possible errors in the coordinate validity check if (!MapManager::IsValidMapCoord(loc)) @@ -66,7 +66,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() Map* oldMap = GetPlayer()->GetMap(); if (GetPlayer()->IsInWorld()) { - sLog->outError(LOG_FILTER_NETWORKIO, "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId()); + sLog->outError(LOG_FILTER_NETWORKIO, "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName().c_str(), oldMap->GetId(), loc.GetMapId()); oldMap->RemovePlayerFromMap(GetPlayer(), false); } @@ -89,7 +89,8 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SendInitialPacketsBeforeAddToMap(); if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer())) { - sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId()); + sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", + GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), loc.GetMapId()); GetPlayer()->ResetMap(); GetPlayer()->SetMap(oldMap); GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation()); @@ -187,15 +188,15 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->ProcessDelayedOperations(); } -void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) +void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); uint32 flags, time; - recv_data >> flags >> time; + recvData >> flags >> time; sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, guid); sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS); @@ -406,9 +407,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) } } -void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) +void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) { - uint32 opcode = recv_data.GetOpcode(); + uint32 opcode = recvData.GetOpcode(); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); /* extract packet */ @@ -416,24 +417,24 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) uint32 unk1; float newspeed; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); // now can skip not our packet if (_player->GetGUID() != guid) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } // continue parse packet - recv_data >> unk1; // counter or moveEvent + recvData >> unk1; // counter or moveEvent MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data >> newspeed; + recvData >> newspeed; /*----------------*/ // client ACK send one packet for mounted/run case and need skip all except last from its @@ -473,24 +474,24 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) if (_player->GetSpeed(move_type) > newspeed) // must be greater - just correct { sLog->outError(LOG_FILTER_NETWORKIO, "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value", - move_type_name[move_type], _player->GetName(), _player->GetSpeed(move_type), newspeed); + move_type_name[move_type], _player->GetName().c_str(), _player->GetSpeed(move_type), newspeed); _player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true); } else // must be lesser - cheating { sLog->outDebug(LOG_FILTER_GENERAL, "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)", - _player->GetName(), _player->GetSession()->GetAccountId(), _player->GetSpeed(move_type), newspeed); + _player->GetName().c_str(), _player->GetSession()->GetAccountId(), _player->GetSpeed(move_type), newspeed); _player->GetSession()->KickPlayer(); } } } -void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) +void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); uint64 guid; - recv_data >> guid; + recvData >> guid; if (GetPlayer()->IsInWorld()) { @@ -499,22 +500,22 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) } } -void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) +void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); uint64 old_mover_guid; - recv_data.readPackGUID(old_mover_guid); + recvData.readPackGUID(old_mover_guid); MovementInfo mi; - ReadMovementInfo(recv_data, &mi); + ReadMovementInfo(recvData, &mi); mi.guid = old_mover_guid; _player->m_movementInfo = mi; } -void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) { WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); data << uint64(GetPlayer()->GetGUID()); @@ -522,20 +523,20 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) GetPlayer()->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) +void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); if (_player->m_mover->GetGUID() != guid) return; - recv_data.read_skip<uint32>(); // unk + recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); _player->m_movementInfo = movementInfo; @@ -552,45 +553,45 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) _player->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) +void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); uint64 guid; // guid - unused - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); - recv_data.read_skip<uint32>(); // unk + recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip<uint32>(); // unk2 + recvData.read_skip<uint32>(); // unk2 } -void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) +void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); uint64 guid; // guid - unused - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); - recv_data.read_skip<uint32>(); // unk + recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip<uint32>(); // unk2 + recvData.read_skip<uint32>(); // unk2 } -void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) +void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData) { if (!_player->isAlive() || _player->isInCombat()) return; uint64 summoner_guid; bool agree; - recv_data >> summoner_guid; - recv_data >> agree; + recvData >> summoner_guid; + recvData >> agree; _player->SummonIfPossible(agree); } |
