Quantcast

Change the way that auras are scanned and kept in the aura database.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-04-10 07:20:26
Author local date 2013-04-10 07:20:26 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-04-10 07:20:26
Committer local date 2013-04-10 07:20:26 +0000
Commit 3afe77d58bdb9b6cff76c018ef9bb6908ca804f0
Tree 348e42c01ec9ee9d512de64f14840cce5183d2e8
Parent 6f0fadf6634c7981d2103f78572b83291d187312
Change the way that auras are scanned and kept in the aura database.

Keep a separate aura age for each GUID so we can tell when an aura
previously present is missing in a new aura scan of that GUID without
affecting the determination of other unit's aura ages.  The age is simply
the number of times the unit's auras were scanned.

Be more strict about deciding when an aura found on a unit matches one
that was recently scanned on the same unit.  An aura is the same if the
following details match:

	caster, duration, expiration time, stack count

Being more strict helps to "age" the auras properly, instead of tossing
them out and getting new scans each time UpdateAuras/ScanUnitAuras is run.

These changes will allow us to store more metadata in the aura properties
about the player's state (e.g., tick length, crit chance, etc.) at the
time the aura was gained.

Also, store the caster's GUID in the aura properties instead of the
caster's unit ID.  The former is invariant and better suited to aura
scans triggered by CLEU events.

Rename two methods to be more descriptive about what they do:

	UpdateAuras -> ScanUnitAuras
	AddAura -> UnitGainedAura

Re-use code to remove expired auras and be more DRY.

Be smarter about when to trigger an Ovale refresh event by checking
whether auras have actually changed on a unit since they were last
scanned.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@896 d5049fe3-3747-40f7-a4b5-f36d6801af5f