Core/Misc: Sending player's own auras before all visible objects.
This should finally solve the problem of naked characters.
Many thanks to xvwyh for explaining cause of this bug
Issues addressed:
Closes #15159
was this tested ingame and verified that the fields in the client are initialized ?
31e7516b83aa Does it build, still hard to test and reproduce the issue even before fix.
31e7516 Does it build, still hard to test and reproduce the issue even before fix.
it's not hard at all to reproduce. login with multiple characters on same location, don't move them and you will see few naked :)
I would say one will have to debug WoW client to make sure the required fields are initialized
should this PR be marked as Draft as it doesn't solve the issue yet ?
Oi, I wasn't notified of this because I was mentioned via a URL instead of @xvwyh.
@jackpoz, can you test this with characters that have some visible buffs on them? Because: https://github.com/TrinityCore/TrinityCore/blob/b6d59f3f8885a382219a1e78fe85cfca281f1231/src/server/game/Entities/Player/Player.cpp#L23210-L23213 If the player that's logging in (the one that will see everyone else naked) doesn't have any visible auras on them - no packets will be sent and the memory will remain uninitialized. And you are testing with a brand new character that's unlikely to have any buffs. You'd need to add something like
-void Player::SendAurasForTarget(Unit* target) const
+void Player::SendAurasForTarget(Unit* target, bool force) const
{
- if (!target || target->GetVisibleAuras().empty()) // speedup things
+ if (!target || !force && target->GetVisibleAuras().empty()) // speedup things
And call it with force=true on login.
// send to player his own auras (this is needed here for timely initialization of some fields on client)
- player->SendAurasForTarget(player);
+ player->SendAurasForTarget(player, true);
Other than that, this PR should be functionally identical to the fix I made to my server. I vouch that it should work, barring any further differences between the codebases. Apologies for not mentioning this in my original message, I'll edit it now.
I'd be grateful if someone could test this. Because I have no idea how to make sure the bug is no longer reproduced.
I'd be grateful if someone could test this. Because I have no idea how to make sure the bug is no longer reproduced.
https://github.com/TrinityCore/TrinityCore/pull/28450#issuecomment-1328217322
I'd be grateful if someone could test this. Because I have no idea how to make sure the bug is no longer reproduced.
Ok I use five characters in one place for testing. Two of them were created earlier and three right now. One of them had a visible aura, the rest did not. I made several attempts and every time in all open clients I saw all the characters dressed.
So it seems to me that everything works.
Screenshot

This actually reminds me of similar bug what other players see different, but with mounted npcs and their relocation https://github.com/TrinityCore/TrinityCore/issues/20136#issuecomment-687663047
yea, now problem is solved as I coud test multiple times with same characters and same positions.
is this PR ready to be merged then ?
is this PR ready to be merged then ?
Yes
Thanks for the PR 🚀 😃