Skip to content

🐛 [Bug] Idle clients and spell processing #3230

@Wall-core

Description

@Wall-core

Currently there is a bug in the method of processing packets for clients which have remained idle for some time.

If you are in the open world and idle for a few minutes, and then attempt to cast a spell without moving or causing any object updates for your character, the first spell you cast will have some issues. The spell global cooldown does not trigger and the spell visual is sent oddly; meaning, some visuals like channels will not display their visuals correctly.

This can be tested by setting a conditional breakpoint at m_caster->DecreaseCastCounter(); in Spell::Cast for m_spellInfo->Id == 16914 and casting Rank 1 Hurricane while in the open world. If you have recently sent movement packets or object updates, the hurricane visual will not trigger until you continue after the breakpoint is hit. If you have been idle for some time, the spell visual will appear before continuing after breakpoint.

The reason I believe for this is somewhere in Map::Update, specifically in the double handling for UpdateSessionsMovementAndSpellsIfNeeded(). I haven't done any level of testing into this issue specifically, but I believe that this is being called at the tail end after an idle update method is set, causing it to be processed after player updates are processed for that first spell.

The above theory is just blind guessing based on noticing something while working near this section of code, but I wanted to open a ticket so this issue can be examined further as it's been persistent for decades now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions