Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #321 from Fearyii/Pet-Fix
Browse files Browse the repository at this point in the history
Pet bar disappearing.
  • Loading branch information
0blu authored Oct 11, 2023
2 parents 3a10374 + 68b116c commit 2bea733
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions HermesProxy/World/Client/PacketHandlers/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ public void ReadFarObjectsBlock(WorldPacket packet, UpdateObject updateObject, o
GetSession().GameState.ObjectCacheModern.Remove(guid);
GetSession().GameState.ObjectCacheMutex.ReleaseMutex();
GetSession().GameState.LastAuraCasterOnTarget.Remove(guid);

// If the pet is too far away, sends a SMSG_UPDATE_OBJECT protocol
if (GetSession().GameState.CurrentPetGuid == guid)

This comment has been minimized.

Copy link
@ratkosrb

ratkosrb Oct 19, 2023

Collaborator

I don't see how sending an empty values update achieves anything? It's literally pointless.

{
UpdateObject updateObject2 = new UpdateObject(GetSession().GameState);
ObjectUpdate updateData2 = new ObjectUpdate(guid, UpdateTypeModern.Values, GetSession());
updateObject2.ObjectUpdates.Add(updateData2);
SendPacketToClient(updateObject2);

}
updateObject.OutOfRangeGuids.Add(guid);
}
}
Expand Down
10 changes: 10 additions & 0 deletions HermesProxy/World/Server/PacketHandlers/PetHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,15 @@ void HandlePetCancelAura(PetCancelAura cancel)
packet.WriteUInt32(cancel.SpellID);
SendPacketToServer(packet);
}

[PacketHandler(Opcode.CMSG_REQUEST_PET_INFO)]
void HandleRequestPetInfo(PetInfoRequest r)
{
// CMSG_REQUEST_PET_INFO

This comment has been minimized.

Copy link
@ratkosrb

ratkosrb Oct 19, 2023

Collaborator

Comment is pointless.

WorldPacket packet = new WorldPacket(Opcode.CMSG_REQUEST_PET_INFO);
SendPacketToServer(packet);

}
}
}

10 changes: 10 additions & 0 deletions HermesProxy/World/Server/Packets/PetPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,14 @@ public override void Read()
public WowGuid128 PetGUID;
public uint SpellID;
}

class PetInfoRequest : ClientPacket

This comment has been minimized.

Copy link
@ratkosrb

ratkosrb Oct 19, 2023

Collaborator

For empty client packets we normally use the EmptyClientPacket class, instead of defining new empty packet classes for each. That has the additional benefit that it helps to notice if the packet changes in a future client patch and something is added to it, because there's an assert in EmptyClientPacket that it is indeed empty.

{
public PetInfoRequest(WorldPacket packet) : base(packet) { }

public override void Read()
{
}

}
}

2 comments on commit 2bea733

@0blu
Copy link
Collaborator Author

@0blu 0blu commented on 2bea733 Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ratkosrb
I did merge this in the hope that it will fix something.
I was unable to reproduce the disappearing bar bug reliably (even before this merge)
Now I am not even sure if this fixed something.

@0blu
Copy link
Collaborator Author

@0blu 0blu commented on 2bea733 Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@celguar Here: Regarding your deleted question.

Please sign in to comment.