Jump to content

Fix MSG_MOVE_HEARTBEAT structure


Guest Wojta

Recommended Posts

What bug does the patch fix? What features does the patch add?

All movement packets and flags has been corrected recently by TOM_RUS i think, but heart beat msg is still horribly outdated.

For which repository revision was the patch created?

10032

Is there a thread in the bug report section or at lighthouse?

none

Who has been writing thisfix? Please include either forum user names or email addresses.

Me

This can be used in the future for maybe correct animation of knockback to other players (set movementInfo data, send heartbeatmsg, then wait until player land so animation is smooth and then another heartbeat without jump flags(Well BuildMovementUpdateBlock() would be enough to do that, need to know how its done on retail servers :P)) and so on...

http://pastebin.com/iPtXRxBV

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 0bab7ea..5bfcbb4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -422,20 +422,9 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTim

void Unit::BuildHeartBeatMsg(WorldPacket *data) const
{
-    MovementFlags move_flags = GetTypeId()==TYPEID_PLAYER
-        ? ((Player const*)this)->m_movementInfo.GetMovementFlags()
-        : MOVEFLAG_NONE;
-
-    data->Initialize(MSG_MOVE_HEARTBEAT, 32);
+    data->Initialize(MSG_MOVE_HEARTBEAT);
    *data << GetPackGUID();
-    *data << uint32(move_flags);                            // movement flags
-    *data << uint16(0);                                     // 2.3.0
-    *data << uint32(getMSTime());                           // time
-    *data << float(GetPositionX());
-    *data << float(GetPositionY());
-    *data << float(GetPositionZ());
-    *data << float(GetOrientation());
-    *data << uint32(0);
+    m_movementInfo.Write(*data);
}

void Unit::resetAttackTimer(WeaponAttackType type)

Link to comment
Share on other sites

This change is wrong. I have test it with the eye of acherus. Doesn't work with this change :D Without the change, it works

Can't move with the eye with this change.

No one cares about your fork here. As for a change, it looks correct. May be there's even more places where MovementInfo::Write can be used...

Link to comment
Share on other sites

No one cares about your fork here. As for a change, it looks correct. May be there's even more places where MovementInfo::Write can be used...

Don't be angry o.0

Just test newest Mangos + SilverIce Camera System + Eye Patch + MSG_MOVE_HEARTBEAT Patch

on Atheros Eye and see what happens.

Link to comment
Share on other sites

Don't be angry o.0

Just test newest Mangos + SilverIce Camera System + Eye Patch + MSG_MOVE_HEARTBEAT Patch

on Atheros Eye and see what happens.

If it doesn't work, it not necessary doesn't work because of this patch. Other patches may be not compatible, incorrect, etc...

Link to comment
Share on other sites

Yeah, I would like to know why theres Spline flags for creatures and MoveFlags for players(well, at least its intended). Are these SplineFlags sent to client(I think they are cuz theres few unk among them)? I see only movementInfo in BuildMovementUpdateBlock(), but MONSTER_MOVE opcodes have spline flags, so its mixed somehow..?

Link to comment
Share on other sites

This change is wrong. I have test it with the eye of acherus. Doesn't work with this change :D Without the change, it works

Can't move with the eye with this change.

Eye of acherus is technically a vehicle, so any kind of workaround on it is most likely to be incompatible anyways (due to lack of vehicle support)

Link to comment
Share on other sites

it's eye's movement flags problem

but, i still don't why mangos use mostly client's movement packet format for all units.

there is spline analogs of them

It's because eye can fly?

Btw http://www.wowhead.com/spell=45257 works fine.

Update: Ok, I've found a problem. In Object::BuildMovementUpdate:

if (!((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING))
{
     // (ok) possibly some "hover" mode
     unit->m_movementInfo.AddMovementFlag(MOVEFLAG_ROOT);
}

Eye doesn't have state UNIT_STAT_MOVING, so it's rooted in place.

Link to comment
Share on other sites

yes, maybe because eye's movement flags should be null (like move_flags in original Unit::BuildHeartBeatMsg function)

Update: Ok, I've found a problem. In Object::BuildMovementUpdate:

if (!((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING))
{
     // (ok) possibly some "hover" mode
     unit->m_movementInfo.AddMovementFlag(MOVEFLAG_ROOT);
}

Eye doesn't have state UNIT_STAT_MOVING, so it's rooted in place.

need go and kill NF for that :P

btw, movement flags shouldn't be changed into Object::BuildMovementUpdate(i mean those flags must be initialized in another place)

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 1 year later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use