Documentation
¶
Overview ¶
Package skyquest provides the embedded Plane of Sky class quest database.
Index ¶
- Constants
- Variables
- func ArchiveState(logPath, suffix string) (string, error)
- func CharacterIdentity(logPath string) (string, string, error)
- func ReadInventoryExport(path string, database Database) (map[string]int, error)
- func ResetUploadHistory(logPath string) error
- func StateExists(logPath string) (bool, error)
- func StatePath(logPath string) (string, error)
- type CharacterState
- type Class
- type Database
- type LogCheckpoint
- type PersistentTracker
- func InitializePersistentTracker(logPath string, database Database, maxBytes int64, ...) (*PersistentTracker, error)
- func LoadPersistentTracker(logPath string, database Database) (*PersistentTracker, error)
- func OpenPersistentTracker(logPath string, database Database) (*PersistentTracker, error)
- func ResetPersistentTracker(logPath string, database Database, maxBytes int64, ...) (*PersistentTracker, error)
- func (p *PersistentTracker) Inventory() map[string]int
- func (p *PersistentTracker) Offset() int64
- func (p *PersistentTracker) ProcessLine(line string, endOffset int64) error
- func (p *PersistentTracker) QuestProgress() []QuestProgress
- func (p *PersistentTracker) ReadyQuests() []QuestProgress
- func (p *PersistentTracker) Save() error
- func (p *PersistentTracker) SetInventoryQuantities(quantities map[string]int) error
- func (p *PersistentTracker) SetQuestWatched(quest string, watched bool) error
- func (p *PersistentTracker) StatePath() string
- func (p *PersistentTracker) SyncLog(logPath string) error
- func (p *PersistentTracker) SyncLogWithProgress(logPath string, maxBytes int64, onProgress func(ScanProgress), ...) error
- func (p *PersistentTracker) WatchedQuests() map[string]bool
- type Quest
- type QuestProgress
- type Requirement
- type ScanProgress
- type SyncEvent
- type Tracker
- func (t *Tracker) Completed() map[string]bool
- func (t *Tracker) Inventory() map[string]int
- func (t *Tracker) Owned(item string) int
- func (t *Tracker) PendingOffers() map[string]map[string]int
- func (t *Tracker) ProcessRecord(record eqlog.Record)
- func (t *Tracker) QuestProgress() []QuestProgress
- func (t *Tracker) ReadyQuests() []QuestProgress
- func (t *Tracker) Zone() string
Constants ¶
const PlaneOfSkyZone = "The Plane of Sky"
Variables ¶
var ( ErrInvalidCheckpoint = errors.New("Plane of Sky log checkpoint is invalid") ErrScanCancelled = errors.New("Plane of Sky inventory scan cancelled") )
Functions ¶
func ArchiveState ¶ added in v0.2.2
ArchiveState moves existing Plane of Sky state out of the active path.
func ReadInventoryExport ¶ added in v0.2.4
ReadInventoryExport returns quantities for known Plane of Sky quest items. Wind Runes are deliberately excluded because they are stored on a currency tab that is not represented reliably by inventory exports.
func ResetUploadHistory ¶ added in v0.2.2
ResetUploadHistory makes the current logfile eligible for a fresh launch-era Plane of Sky queue scan without disturbing other characters.
func StateExists ¶
Types ¶
type CharacterState ¶
type CharacterState struct {
Version int `json:"version"`
Character string `json:"character"`
Server string `json:"server"`
Holdings map[string]int `json:"holdings"`
Completed map[string]bool `json:"completed_quests,omitempty"`
Watched map[string]bool `json:"watched_quests,omitempty"`
Pending map[string]map[string]int `json:"pending_offers,omitempty"`
Checkpoint LogCheckpoint `json:"log_checkpoint"`
}
type Database ¶
type Database struct {
SchemaVersion int `json:"schema_version"`
Source string `json:"source"`
SourcePageID int `json:"source_page_id"`
SourceRevision int `json:"source_revision"`
Classes []Class `json:"classes"`
}
func LoadDatabase ¶
type LogCheckpoint ¶
type PersistentTracker ¶
type PersistentTracker struct {
// contains filtered or unexported fields
}
func InitializePersistentTracker ¶
func InitializePersistentTracker(logPath string, database Database, maxBytes int64, onProgress func(ScanProgress), cancel <-chan struct{}) (*PersistentTracker, error)
func LoadPersistentTracker ¶
func LoadPersistentTracker(logPath string, database Database) (*PersistentTracker, error)
LoadPersistentTracker loads saved state without reading newer logfile lines. Call SyncLogWithProgress before live processing begins.
func OpenPersistentTracker ¶
func OpenPersistentTracker(logPath string, database Database) (*PersistentTracker, error)
func ResetPersistentTracker ¶ added in v0.2.4
func ResetPersistentTracker(logPath string, database Database, maxBytes int64, onProgress func(ScanProgress), cancel <-chan struct{}) (*PersistentTracker, error)
ResetPersistentTracker removes the character's saved Plane of Sky state and rebuilds it from the logfile. Historical rows rebuild local holdings without being queued for upload a second time.
func (*PersistentTracker) Inventory ¶
func (p *PersistentTracker) Inventory() map[string]int
func (*PersistentTracker) Offset ¶
func (p *PersistentTracker) Offset() int64
func (*PersistentTracker) ProcessLine ¶
func (p *PersistentTracker) ProcessLine(line string, endOffset int64) error
func (*PersistentTracker) QuestProgress ¶
func (p *PersistentTracker) QuestProgress() []QuestProgress
func (*PersistentTracker) ReadyQuests ¶
func (p *PersistentTracker) ReadyQuests() []QuestProgress
func (*PersistentTracker) Save ¶
func (p *PersistentTracker) Save() error
func (*PersistentTracker) SetInventoryQuantities ¶ added in v0.2.4
func (p *PersistentTracker) SetInventoryQuantities(quantities map[string]int) error
SetInventoryQuantities replaces selected item quantities while preserving quest completion, pending hand-ins, and all unmentioned holdings.
func (*PersistentTracker) SetQuestWatched ¶ added in v0.2.5
func (p *PersistentTracker) SetQuestWatched(quest string, watched bool) error
func (*PersistentTracker) StatePath ¶
func (p *PersistentTracker) StatePath() string
func (*PersistentTracker) SyncLog ¶
func (p *PersistentTracker) SyncLog(logPath string) error
func (*PersistentTracker) SyncLogWithProgress ¶
func (p *PersistentTracker) SyncLogWithProgress(logPath string, maxBytes int64, onProgress func(ScanProgress), cancel <-chan struct{}) error
func (*PersistentTracker) WatchedQuests ¶ added in v0.2.5
func (p *PersistentTracker) WatchedQuests() map[string]bool
type Quest ¶
type Quest struct {
Name string `json:"name"`
QuestGiver string `json:"quest_giver"`
Requirements []Requirement `json:"requirements"`
Rewards []string `json:"rewards"`
}
type QuestProgress ¶
type QuestProgress struct {
Class string
Quest Quest
Missing []Requirement
Ready bool
Completed bool
}
type Requirement ¶
type ScanProgress ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
func NewTracker ¶
func (*Tracker) ProcessRecord ¶
func (*Tracker) QuestProgress ¶
func (t *Tracker) QuestProgress() []QuestProgress
func (*Tracker) ReadyQuests ¶
func (t *Tracker) ReadyQuests() []QuestProgress