skyquest

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package skyquest provides the embedded Plane of Sky class quest database.

Index

Constants

View Source
const PlaneOfSkyZone = "The Plane of Sky"

Variables

View Source
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

func ArchiveState(logPath, suffix string) (string, error)

ArchiveState moves existing Plane of Sky state out of the active path.

func CharacterIdentity

func CharacterIdentity(logPath string) (string, string, error)

func ReadInventoryExport added in v0.2.4

func ReadInventoryExport(path string, database Database) (map[string]int, error)

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

func ResetUploadHistory(logPath string) error

ResetUploadHistory makes the current logfile eligible for a fresh launch-era Plane of Sky queue scan without disturbing other characters.

func StateExists

func StateExists(logPath string) (bool, error)

func StatePath

func StatePath(logPath string) (string, error)

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"`
	Pending    map[string]map[string]int `json:"pending_offers,omitempty"`
	Checkpoint LogCheckpoint             `json:"log_checkpoint"`
}

type Class

type Class struct {
	Name           string  `json:"name"`
	QuestNPC       string  `json:"quest_npc"`
	Source         string  `json:"source,omitempty"`
	SourcePageID   int     `json:"source_page_id,omitempty"`
	SourceRevision int     `json:"source_revision,omitempty"`
	Quests         []Quest `json:"quests"`
}

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

func LoadDatabase() (Database, error)

type LogCheckpoint

type LogCheckpoint struct {
	LogFile       string    `json:"log_file"`
	PrefixSHA256  string    `json:"prefix_sha256"`
	PrefixBytes   int64     `json:"prefix_bytes"`
	Offset        int64     `json:"offset"`
	LastTimestamp time.Time `json:"last_timestamp,omitempty"`
	LastZone      string    `json:"last_zone,omitempty"`
}

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) 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

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 Requirement struct {
	Name       string `json:"name"`
	Kind       string `json:"kind"`
	Quantity   int    `json:"quantity"`
	NoDrop     bool   `json:"no_drop,omitempty"`
	Island     int    `json:"island,omitempty"`
	DropsFrom  string `json:"drops_from,omitempty"`
	SourceHint string `json:"source_hint,omitempty"`
}

type ScanProgress

type ScanProgress struct {
	Bytes int64
	Total int64
	Lines int
}

type SyncEvent added in v0.2.2

type SyncEvent struct {
	Character string    `json:"character"`
	Server    string    `json:"server"`
	Type      string    `json:"type"`
	Rune      string    `json:"rune,omitempty"`
	Amount    int       `json:"amount,omitempty"`
	Quest     string    `json:"quest,omitempty"`
	Timestamp time.Time `json:"timestamp"`
}

type Tracker

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

func NewTracker

func NewTracker(database Database) *Tracker

func (*Tracker) Completed

func (t *Tracker) Completed() map[string]bool

func (*Tracker) Inventory

func (t *Tracker) Inventory() map[string]int

func (*Tracker) Owned

func (t *Tracker) Owned(item string) int

func (*Tracker) PendingOffers

func (t *Tracker) PendingOffers() map[string]map[string]int

func (*Tracker) ProcessRecord

func (t *Tracker) ProcessRecord(record eqlog.Record)

func (*Tracker) QuestProgress

func (t *Tracker) QuestProgress() []QuestProgress

func (*Tracker) ReadyQuests

func (t *Tracker) ReadyQuests() []QuestProgress

func (*Tracker) Zone

func (t *Tracker) Zone() string

Jump to

Keyboard shortcuts

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