tact

package
v0.0.288 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package tact reads files out of a local World of Warcraft CASC install: .build.info picks the build, then root → encoding → .idx → data.NNN → BLTE resolves a file data id to its bytes. There is no CDN fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNumber

func BuildNumber(version string) (uint32, error)

BuildNumber extracts the trailing build number from a 4-part version string.

func LoadConfig

func LoadConfig(baseDir, hash string) (map[string][]string, error)

LoadConfig reads a build/CDN config from the local install's Data/config/<xx>/<yy>/<hash> layout. Values are space-separated (typically `ckey [ekey]`). All keys are kept, including the ~318 unused `vfs-*` TVFS lines — they parse fine and are simply never consulted.

Types

type AvailableBuild

type AvailableBuild struct {
	BuildConfig string
	Version     string
	Product     string
}

AvailableBuild is one .build.info product entry, reduced to the fields this local-only reader consumes.

func ParseBuildInfo

func ParseBuildInfo(path string) ([]AvailableBuild, error)

ParseBuildInfo reads <BaseDir>/.build.info (typed pipe format: the header line names columns as "Name!TYPE:len") and returns all product entries.

func SelectBuild

func SelectBuild(entries []AvailableBuild, product string) (AvailableBuild, error)

SelectBuild returns the first entry for the given product.

type Build

type Build struct {
	Entry       AvailableBuild
	BuildNumber uint32
	// contains filtered or unexported fields
}

func Open

func Open(baseDir, product string) (*Build, error)

Open loads everything needed to serve OpenFileByFDID from a local install.

func (*Build) OpenFileByCKey

func (b *Build) OpenFileByCKey(cKey []byte) ([]byte, error)

OpenFileByCKey resolves a content key through encoding and opens the first encoding key locally.

func (*Build) OpenFileByFDID

func (b *Build) OpenFileByFDID(fdid uint32) ([]byte, error)

OpenFileByFDID opens a file by its file data id via the WoW root.

type Listfile

type Listfile struct {
	Path string
	URL  string
	// contains filtered or unexported fields
}

Listfile manages the community listfile.csv with download-if-stale semantics: HEAD + Last-Modified vs local mtime; a failed freshness check triggers a re-download, and a failed download falls back to the existing file when one exists.

func (*Listfile) GetFDID

func (l *Listfile) GetFDID(path string) (uint32, error)

GetFDID resolves a game path (e.g. "dbfilesclient/Spell.db2") to its file data id: static map first, then the listfile (loaded lazily). The lookup key is the raw game path, lowercased — never a filesystem-resolved path.

func (*Listfile) Refresh

func (l *Listfile) Refresh() error

Refresh ensures the listfile exists and is current. It never deletes a usable existing file on network failure — the extractor (via the static FDID map) and gen_db's icon map can still run offline.

Jump to

Keyboard shortcuts

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