fflogs

package
v0.0.0-...-1ffa3f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ability

type Ability struct {
	Name string
	Icon string
}

type BuffType

type BuffType string
const (
	Applybuff        BuffType = "applybuff"
	Applybuffstack   BuffType = "applybuffstack"
	Applydebuff      BuffType = "applydebuff"
	Applydebuffstack BuffType = "applydebuffstack"
	Begincast        BuffType = "begincast"
	Calculateddamage BuffType = "calculateddamage"
	Calculatedheal   BuffType = "calculatedheal"
	Cast             BuffType = "cast"
	Damage           BuffType = "damage"
	Heal             BuffType = "heal"
	Limitbreakupdate BuffType = "limitbreakupdate"
	Refreshbuff      BuffType = "refreshbuff"
	Refreshdebuff    BuffType = "refreshdebuff"
	Removebuff       BuffType = "removebuff"
	Removebuffstack  BuffType = "removebuffstack"
	Removedebuff     BuffType = "removedebuff"
)

type Client

type Client interface {
	GetTimesFromFightAndID(ctx context.Context, code string,
		fightID int) (startTime, endTime float64, err error)
	GetEvents(ctx context.Context, code string, fightID int, startTime,
		endTime float64, dataType EventDataType, hostilityType HostilityType) ([]*RawBuffEvent, error)
}

type ClientImplementation

type ClientImplementation struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientID, secret string, token ...string) (*ClientImplementation, error)

TODO: caching

func (*ClientImplementation) GetAllAbilities

func (c *ClientImplementation) GetAllAbilities(ctx context.Context) (map[int]Ability, error)

func (*ClientImplementation) GetEvents

func (c *ClientImplementation) GetEvents(ctx context.Context,
	code string, fightID int, startTime, endTime float64, dataType EventDataType, hostilityType HostilityType) ([]*RawBuffEvent, error)

TODO: GetEvents(Buffs,Friendlies) took 5.76s. Find ways to optimize oh god its slow

func (*ClientImplementation) GetTimesFromFightAndID

func (c *ClientImplementation) GetTimesFromFightAndID(ctx context.Context, code string, fightID int) (startTime, endTime float64, err error)

func (*ClientImplementation) Token

func (c *ClientImplementation) Token() (*oauth2.Token, error)

type EventDataType

type EventDataType string
const (
	EDTypeAll           EventDataType = "All"
	EDTypeBuffs         EventDataType = "Buffs"
	EDTypeCasts         EventDataType = "Casts"
	EDTypeCombatantInfo EventDataType = "CombatantInfo"
	EDTypeDamageDone    EventDataType = "DamageDone"
	EDTypeDamageTaken   EventDataType = "DamageTaken"
	EDTypeDeaths        EventDataType = "Deaths"
	EDTypeDebuffs       EventDataType = "Debuffs"
	EDTypeDispels       EventDataType = "Dispels"
	EDTypeHealing       EventDataType = "Healing"
	EDTypeInterrupts    EventDataType = "Interrupts"
	EDTypeResources     EventDataType = "Resources"
	EDTypeSummons       EventDataType = "Summons"
	EDTypeThreat        EventDataType = "Threat"
)

type HostilityType

type HostilityType string
const (
	Friendlies HostilityType = "Friendlies"
	Enemies    HostilityType = "Enemies"
)

type RawBuffEvent

type RawBuffEvent struct {
	Timestamp           int64    `json:"timestamp"`
	Type                BuffType `json:"type"`
	SourceID            *int64   `json:"sourceID,omitempty"`
	TargetID            *int64   `json:"targetID,omitempty"`
	AbilityGameID       *int64   `json:"abilityGameID,omitempty"`
	HitType             *int64   `json:"hitType,omitempty"`
	Amount              *int64   `json:"amount,omitempty"`
	Multiplier          *float64 `json:"multiplier,omitempty"`
	PacketID            *int64   `json:"packetID,omitempty"`
	Stack               *int64   `json:"stack,omitempty"`
	DirectHit           *bool    `json:"directHit,omitempty"`
	Value               *int64   `json:"value,omitempty"`
	Bars                *int64   `json:"bars,omitempty"`
	Melee               *bool    `json:"melee,omitempty"`
	Absorbed            *int64   `json:"absorbed,omitempty"`
	Absorb              *int64   `json:"absorb,omitempty"`
	Overheal            *int64   `json:"overheal,omitempty"`
	Tick                *bool    `json:"tick,omitempty"`
	FinalizedAmount     *float64 `json:"finalizedAmount,omitempty"`
	Simulated           *bool    `json:"simulated,omitempty"`
	ExpectedAmount      *int64   `json:"expectedAmount,omitempty"`
	ExpectedCritRate    *int64   `json:"expectedCritRate,omitempty"`
	ActorPotencyRatio   *float64 `json:"actorPotencyRatio,omitempty"`
	GuessAmount         *float64 `json:"guessAmount,omitempty"`
	DirectHitPercentage *float64 `json:"directHitPercentage,omitempty"`
	TargetInstance      *int64   `json:"targetInstance,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL