mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[10732] Not send session fields as args into HandleMoverRelocation/VerifyMovementInfo.
Also mark args as constant where expected in this functions.
This commit is contained in:
parent
bd48d3cdc9
commit
10273fa38a
3 changed files with 13 additions and 11 deletions
|
|
@ -241,7 +241,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||||
recv_data >> movementInfo;
|
recv_data >> movementInfo;
|
||||||
/*----------------*/
|
/*----------------*/
|
||||||
|
|
||||||
if (!VerifyMovementInfo(movementInfo,guid,mover))
|
if (!VerifyMovementInfo(movementInfo, guid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
|
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
|
||||||
|
|
@ -249,7 +249,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||||
plMover->HandleFall(movementInfo);
|
plMover->HandleFall(movementInfo);
|
||||||
|
|
||||||
/* process position-change */
|
/* process position-change */
|
||||||
HandleMoverRelocation(movementInfo,mover,plMover);
|
HandleMoverRelocation(movementInfo);
|
||||||
|
|
||||||
if (plMover)
|
if (plMover)
|
||||||
plMover->UpdateFallInformationIfNeed(movementInfo, opcode);
|
plMover->UpdateFallInformationIfNeed(movementInfo, opcode);
|
||||||
|
|
@ -432,10 +432,10 @@ void WorldSession::HandleMoveKnockBackAck( WorldPacket & recv_data )
|
||||||
recv_data >> Unused<uint32>(); // knockback packets counter
|
recv_data >> Unused<uint32>(); // knockback packets counter
|
||||||
recv_data >> movementInfo;
|
recv_data >> movementInfo;
|
||||||
|
|
||||||
if (!VerifyMovementInfo(movementInfo,guid,mover))
|
if (!VerifyMovementInfo(movementInfo, guid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HandleMoverRelocation(movementInfo, mover, plMover);
|
HandleMoverRelocation(movementInfo);
|
||||||
|
|
||||||
WorldPacket data(MSG_MOVE_KNOCK_BACK, recv_data.size() + 15);
|
WorldPacket data(MSG_MOVE_KNOCK_BACK, recv_data.size() + 15);
|
||||||
data << mover->GetPackGUID();
|
data << mover->GetPackGUID();
|
||||||
|
|
@ -486,10 +486,10 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data)
|
||||||
_player->SummonIfPossible(agree);
|
_player->SummonIfPossible(agree);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WorldSession::VerifyMovementInfo(MovementInfo& movementInfo, ObjectGuid& guid, Unit* mover) const
|
bool WorldSession::VerifyMovementInfo(MovementInfo const& movementInfo, ObjectGuid const& guid) const
|
||||||
{
|
{
|
||||||
// ignore wrong guid (player attempt cheating own session for not own guid possible...)
|
// ignore wrong guid (player attempt cheating own session for not own guid possible...)
|
||||||
if (guid != mover->GetObjectGuid())
|
if (guid != _player->GetMover()->GetObjectGuid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!MaNGOS::IsValidMapCoord(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o))
|
if (!MaNGOS::IsValidMapCoord(movementInfo.GetPos()->x, movementInfo.GetPos()->y, movementInfo.GetPos()->z, movementInfo.GetPos()->o))
|
||||||
|
|
@ -512,11 +512,13 @@ bool WorldSession::VerifyMovementInfo(MovementInfo& movementInfo, ObjectGuid& gu
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo, Unit* mover, Player* plMover)
|
void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo)
|
||||||
{
|
{
|
||||||
movementInfo.UpdateTime(getMSTime());
|
movementInfo.UpdateTime(getMSTime());
|
||||||
|
|
||||||
if (plMover)
|
Unit *mover = _player->GetMover();
|
||||||
|
|
||||||
|
if (Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL)
|
||||||
{
|
{
|
||||||
if (movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT))
|
if (movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -778,8 +778,8 @@ class MANGOS_DLL_SPEC WorldSession
|
||||||
private:
|
private:
|
||||||
// private trade methods
|
// private trade methods
|
||||||
void moveItems(Item* myItems[], Item* hisItems[]);
|
void moveItems(Item* myItems[], Item* hisItems[]);
|
||||||
bool VerifyMovementInfo(MovementInfo&,ObjectGuid&, Unit*) const;
|
bool VerifyMovementInfo(MovementInfo const& movementInfo, ObjectGuid const& guid) const;
|
||||||
void HandleMoverRelocation(MovementInfo&, Unit*, Player*);
|
void HandleMoverRelocation(MovementInfo& movementInfo);
|
||||||
|
|
||||||
void ExecuteOpcode( OpcodeHandler const& opHandle, WorldPacket* packet );
|
void ExecuteOpcode( OpcodeHandler const& opHandle, WorldPacket* packet );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10731"
|
#define REVISION_NR "10732"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue