Documentation ¶
Index ¶
- Variables
- func Module() fx.Option
- type DropElement
- type DropElementValue
- type DropSet
- func (d *DropSet) GetOrCreateElement(idset IDSet) *DropElement
- func (d *DropSet) IncrTimes(stageId uint32, server uint8, generation uint64)
- func (d *DropSet) RemoveSub(sub *Sub)
- func (d *DropSet) ReplaceSubToItemElements(itemID uint32, server uint8, sub *Sub) error
- func (d *DropSet) ReplaceSubToStageElements(stageID uint32, server uint8, sub *Sub) error
- type Element
- type IDPair
- type IDSet
- type LiteValue
- type Sub
Constants ¶
This section is empty.
Variables ¶
var ( ErrStageNotFound = errors.New("stage not found") ErrItemNotFound = errors.New("item not found") )
Functions ¶
Types ¶
type DropElement ¶
type DropElement struct { IDSet // Times describes the amount of occurances of reports such drop // may possibly drop. Times DropElementValue // Quantity describes the amount of occurances that such item has dropped Quantity DropElementValue // Subscriptions, map[ClientID]*Sub Subscriptions sync.Map }
DropElement contains all metrics for a drop element identified by an IDSet, as well all subscriptions to such DropElement.
func (*DropElement) AddSub ¶
func (e *DropElement) AddSub(sub *Sub)
func (*DropElement) CutOut ¶
func (e *DropElement) CutOut(times, quantity, generation uint64)
func (*DropElement) Incr ¶
func (e *DropElement) Incr(times, quantity, generation uint64)
func (*DropElement) RemoveSub ¶
func (e *DropElement) RemoveSub(sub *Sub)
type DropElementValue ¶
DropElementValue
func (*DropElementValue) CutOut ¶
func (d *DropElementValue) CutOut(value, generation uint64)
func (*DropElementValue) Incr ¶
func (d *DropElementValue) Incr(delta, generation uint64) uint64
func (*DropElementValue) Sum ¶
func (d *DropElementValue) Sum() uint64
type DropSet ¶
type DropSet struct { // CombineElements is used to get a singular element (if exists) // by indexing its ServerID, StageID, and ItemID. // Such indexing uint64 is calculated using IDSet#ID(). CombineElements map[uint64]*DropElement // StageElements is used to get a list of elements for a particular (ServerID, StageID) pair (if exists) // It is actually map[EntityID]map[EntityID]*DropElement, in which // the first EntityID consists of a (ServerID, StageID) pair, and // the second EntityID consists of a (ServerID, ItemID) pair. StageElements map[uint32]map[uint32]*DropElement // ItemElements is used to get a list of elements for a particular (ServerID, ItemID) pair (if exists) // It is actually map[EntityID]map[EntityID]*DropElement, in which // the first EntityID consists of a (ServerID, ItemID) pair, and // the second EntityID consists of a (ServerID, StageID) pair. ItemElements map[uint32]map[uint32]*DropElement // contains filtered or unexported fields }
DropSet consists a completed collection of all `DropElement`s existing on such instance. It stores a singular `DropElement` into three different maps, to improve index efficiencies under different workloads. See docuemntation on those particular maps for their intended usage.
func NewDropSet ¶
func NewDropSet() *DropSet
func (*DropSet) GetOrCreateElement ¶
func (d *DropSet) GetOrCreateElement(idset IDSet) *DropElement
func (*DropSet) ReplaceSubToItemElements ¶
type Element ¶
Element consists of a minimal subscribable values stored in LiteValue that is identified by lhcore.IDSet. A zero LiteValue is ready to be used.
type LiteValue ¶
LiteValue consists of a minimal representation of values to subscribe with. A zero LiteValue is ready to be used.