Namespace FishMMO.Server.Core.Collections
Classes
- ExpiringKeyTracker<TKey>
Queue/index tracker for expiring keyed entries. Uses head-first sweeps to avoid full dictionary enumeration under heavy load.
- LastSeenCacheTracker<TKey, TValue>
Queue/index tracker for key-value caches whose entries expire by last-seen timestamp. Optimized for high-frequency touch and bounded head-first TTL sweeps.
- TimedCache<TKey, TValue>
A thread-safe, write-through TTL cache where entries expire after a fixed duration from when they were stored. Reads do NOT extend the lifetime (unlike LastSeenCacheTracker<TKey, TValue>).
Supports bounded head-first SweepExpired(DateTime, TimeSpan, int, int) for memory management.
Structs
- InstanceCapacityHeap
A max-heap of scene instances, keyed by scene row ID, ordered by remaining capacity. Used for O(log N) fallback instance selection in open-world routing.
The root always holds the instance with the most remaining capacity. TryAssignFromTop(out long) peeks the root, decrements its capacity, and re-heapifies — yielding O(log N) per assignment instead of O(N) linear scan. If the root reaches zero capacity it is removed automatically.