Interface IPartyCombatMeterData
- Namespace
- FishMMO.Server.Core.World.SceneServer
- Assembly
- FishMMO.Server.dll
Per-encounter damage and healing meters for the characters this scene server hosts.
public interface IPartyCombatMeterData : IRuntimeDataContainer, IServerComponent
Remarks
Per encounter, not per session. A meter that never resets stops meaning anything after the first fight — a player who opened with a burst and then stood still for ten minutes still reads as the top damage dealer. Every contribution refreshes an idle timer; once that timer lapses the accumulator is discarded and the next hit starts a fresh encounter from zero. That is the whole definition of "encounter" here, deliberately: it needs no notion of which mob was pulled or when a boss reset, and it therefore cannot disagree with one.
Main-thread only. Contributions arrive from the damage controller's static events, which are raised on the server simulation, and samples are read by the party update pump. Both run on the main thread, so nothing here synchronises.
Kept on the server rather than accumulated per client. The client is shown a rate for other players, so the number has to be one the server computed; a client-side meter could only ever measure the fraction of a fight that happened inside its own observer range.
Methods
Forget(long)
Drops a character's meter entirely.
void Forget(long characterID)
Parameters
characterIDlongThe character to forget.
GetSample(long, float, float, float)
Reads a character's current rates.
PartyCombatMeterSample GetSample(long characterID, float now, float encounterTimeoutSeconds, float minimumWindowSeconds)
Parameters
characterIDlongThe character to read.
nowfloatCurrent unscaled time, in seconds.
encounterTimeoutSecondsfloatIdle time after which an encounter is over.
minimumWindowSecondsfloatFloor on the divisor. Without one, the first hit of a fight divides by very nearly zero and reports a rate in the millions for one tick.
Returns
- PartyCombatMeterSample
The character's rates, or a zeroed sample when it has no encounter running — including when its last encounter has timed out, which is reported as zero rather than as no reading so a stale number can never survive on a client's meter.
RecordDamage(long, float, float, float)
Credits a character with damage dealt.
void RecordDamage(long characterID, float amount, float now, float encounterTimeoutSeconds)
Parameters
characterIDlongThe character that dealt the damage.
amountfloatDamage amount; non-positive amounts are ignored.
nowfloatCurrent unscaled time, in seconds.
encounterTimeoutSecondsfloatIdle time after which an encounter is over.
RecordHealing(long, float, float, float)
Credits a character with healing done.
void RecordHealing(long characterID, float amount, float now, float encounterTimeoutSeconds)
Parameters
characterIDlongThe character that did the healing.
amountfloatHealing amount; non-positive amounts are ignored.
nowfloatCurrent unscaled time, in seconds.
encounterTimeoutSecondsfloatIdle time after which an encounter is over.
Sweep(float, float, int, int)
Removes meters whose encounters have long since ended, up to a bounded count.
int Sweep(float now, float staleAfterSeconds, int maxScan, int maxRemove)
Parameters
nowfloatCurrent unscaled time, in seconds.
staleAfterSecondsfloatIdle time after which an entry is discarded.
maxScanintMaximum entries to examine.
maxRemoveintMaximum entries to remove.
Returns
- int
The number of entries removed.