bundle

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressIndexBundle

func DecompressIndexBundle(data []byte) ([]byte, error)

DecompressIndexBundle decompresses the index bundle using the bundle system

func DiscoverRequiredBundles

func DiscoverRequiredBundles(cache *cache.Cache, patch string, languages []string, tables []string, allTables bool) ([]string, error)

DiscoverRequiredBundles parses the index file to find which bundles contain the DAT files needed based on the specified configuration (languages, tables, allTables flag).

func FNVHashPath

func FNVHashPath(path string) uint64

FNVHashPath computes FNV-1a hash with "++" suffix for legacy PoE (≤3.21.2)

func MurmurHash64A

func MurmurHash64A(data []byte, seed uint64) uint64

MurmurHash64A implements the 64-bit MurmurHash2 algorithm as used by modern PoE (≥3.21.2) Reference: https://github.com/poe-tool-dev/poe-dat-viewer/blob/main/lib/src/utils/murmur2.ts

func MurmurHashPath

func MurmurHashPath(path string) uint64

MurmurHashPath computes MurmurHash64A of a lowercase path string with seed 0x1337b33f

func NewLoader

func NewLoader(lower fs.FS) (*bundleFS, error)

Types

type Bundle

type Bundle interface {
	// Read returns the entire contents of the bundle decompressed
	Read() ([]byte, error)
	// Size returns the uncompressed size of the bundle
	Size() int64
	// ReadAt reads data from a specific offset in the decompressed bundle
	ReadAt(p []byte, off int64) (int, error)
}

Bundle represents an opened bundle that can be read from

func OpenBundle

func OpenBundle(r io.ReaderAt) (Bundle, error)

OpenBundle is the exported version of openBundle

type FileLocation

type FileLocation struct {
	BundleName string
	Offset     uint32
	Size       uint32
}

FileLocation contains information about where a file is located in the bundle system

type Index

type Index interface {
	// GetFileInfo returns information about a file, including which bundle contains it
	GetFileInfo(path string) (*FileLocation, error)
	// ListBundles returns all bundle names in the index
	ListBundles() []string
	// ListFiles returns all file paths in the index
	ListFiles() []string
}

Index represents a bundle index that can be used to find files and bundles

func LoadIndex

func LoadIndex(data []byte) (Index, error)

LoadIndex parses index data and returns an Index interface

type Manager

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

Manager provides a high-level API for accessing bundle files

func NewManager

func NewManager(cacheDir, patch string) (*Manager, error)

NewManager creates a new bundle manager

func (*Manager) Close

func (m *Manager) Close() error

Close closes the manager and releases resources

func (*Manager) FileExists

func (m *Manager) FileExists(path string) bool

FileExists checks if a file exists in the bundle, trying language-specific paths as needed

func (*Manager) GetFile

func (m *Manager) GetFile(path string) ([]byte, error)

GetFile reads the entire contents of a file from the bundle, trying language-specific paths as needed

func (*Manager) SetLanguages

func (m *Manager) SetLanguages(languages []string)

SetLanguages configures the languages to search for files

Jump to

Keyboard shortcuts

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