plrsave

package
v0.0.0-...-67a1e62 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FileInfoID = 1

Variables

This section is empty.

Functions

func RegisterSection

func RegisterSection(s Section)

RegisterSection registers a section for automated decoding.

Types

type Attributes

type Attributes struct {
	Vers    uint16
	Flags   uint32
	Name    string
	Val50   uint32
	Val54   uint32
	Val58   uint32
	Val62   uint32
	Val66   byte
	Val67   byte
	Val68   [3]byte
	Val71   [3]byte
	Val74   [3]byte
	Val77   [3]byte
	Val80   [3]byte
	Val83   byte
	Val84   byte
	Val85   byte
	Val86   byte
	Val87   byte
	Val88   byte
	Val320  uint32
	Unused1 [9]uint32
	Val4696 uint32
}

func (*Attributes) ID

func (*Attributes) ID() uint32

func (*Attributes) SectName

func (s *Attributes) SectName() string

func (*Attributes) UnmarshalBinary

func (s *Attributes) UnmarshalBinary(data []byte) error

type Enchant

type Enchant struct {
	Data []byte
}

func (*Enchant) ID

func (*Enchant) ID() uint32

func (*Enchant) SectName

func (s *Enchant) SectName() string

func (*Enchant) UnmarshalBinary

func (s *Enchant) UnmarshalBinary(data []byte) error

type FieldGuide

type FieldGuide struct {
	Data []byte
}

func (*FieldGuide) ID

func (*FieldGuide) ID() uint32

func (*FieldGuide) SectName

func (s *FieldGuide) SectName() string

func (*FieldGuide) UnmarshalBinary

func (s *FieldGuide) UnmarshalBinary(data []byte) error

type FileInfo

type FileInfo struct {
	Vers  uint16
	Val0  uint32
	Path  string
	Str2  string
	Time  Time
	Val4  [3]byte
	Val5  [3]byte
	Val6  [3]byte
	Val7  [3]byte
	Val8  [3]byte
	Val9  byte
	Val10 byte
	Val11 byte
	Val12 byte
	Val13 byte
	Name  string
	Val15 byte
	Val16 byte
	Val17 byte
	Map   string
	Val19 byte
}

func ReadInfo

func ReadInfo(r io.Reader) (*FileInfo, error)

ReadInfo reads save file info.

func (*FileInfo) ID

func (*FileInfo) ID() uint32

func (*FileInfo) SectName

func (s *FileInfo) SectName() string

func (*FileInfo) UnmarshalBinary

func (s *FileInfo) UnmarshalBinary(data []byte) error

type GUIData

type GUIData struct {
	Data []byte
}

func (*GUIData) ID

func (*GUIData) ID() uint32

func (*GUIData) SectName

func (s *GUIData) SectName() string

func (*GUIData) UnmarshalBinary

func (s *GUIData) UnmarshalBinary(data []byte) error

type GameData

type GameData struct {
	Data []byte
}

func (*GameData) ID

func (*GameData) ID() uint32

func (*GameData) SectName

func (s *GameData) SectName() string

func (*GameData) UnmarshalBinary

func (s *GameData) UnmarshalBinary(data []byte) error

type Inventory

type Inventory struct {
	Data []byte
}

func (*Inventory) ID

func (*Inventory) ID() uint32

func (*Inventory) SectName

func (s *Inventory) SectName() string

func (*Inventory) UnmarshalBinary

func (s *Inventory) UnmarshalBinary(data []byte) error

type Journal

type Journal struct {
	Data []byte
}

func (*Journal) ID

func (*Journal) ID() uint32

func (*Journal) SectName

func (s *Journal) SectName() string

func (*Journal) UnmarshalBinary

func (s *Journal) UnmarshalBinary(data []byte) error

type Music

type Music struct {
	Data []byte
}

func (*Music) ID

func (*Music) ID() uint32

func (*Music) SectName

func (s *Music) SectName() string

func (*Music) UnmarshalBinary

func (s *Music) UnmarshalBinary(data []byte) error

type Padding

type Padding struct{}

func (*Padding) ID

func (*Padding) ID() uint32

func (*Padding) SectName

func (s *Padding) SectName() string

func (*Padding) UnmarshalBinary

func (s *Padding) UnmarshalBinary(data []byte) error

type Reader

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

Reader is a player save file reader.

func NewReader

func NewReader(r io.Reader) (*Reader, error)

NewReader creates a new player save file reader.

func (*Reader) ReadSection

func (r *Reader) ReadSection() (Section, error)

ReadSection reads next save file section.

func (*Reader) ReadSectionRaw

func (r *Reader) ReadSectionRaw() (uint32, []byte, error)

ReadSectionRaw reads next save file section. It returns its ID and raw data.

type Section

type Section interface {
	// ID returns a unique section ID used in binary encoding.
	ID() uint32
	// SectName returns a human-friendly section name.
	SectName() string
	encoding.BinaryUnmarshaler
}

Section is a common interface for player save file sections.

func ReadAll

func ReadAll(r io.Reader) ([]Section, error)

ReadAll reads all player save file sections.

type SpellBook

type SpellBook struct {
	Data []byte
}

func (*SpellBook) ID

func (*SpellBook) ID() uint32

func (*SpellBook) SectName

func (s *SpellBook) SectName() string

func (*SpellBook) UnmarshalBinary

func (s *SpellBook) UnmarshalBinary(data []byte) error

type Status

type Status struct {
	Vers      uint16
	Val1      byte
	MaxHealth uint16
	MaxMana   uint16
	Val4      uint16
	Val5      uint16
	Val6      byte
	Val7      byte
	Val8      uint16
	Val9      uint32
	Val10     uint16
}

func (*Status) ID

func (*Status) ID() uint32

func (*Status) SectName

func (s *Status) SectName() string

func (*Status) UnmarshalBinary

func (s *Status) UnmarshalBinary(data []byte) error

type Time

type Time struct {
	Year         uint16
	Month        uint16
	DayOfWeek    uint16
	Day          uint16
	Hour         uint16
	Minute       uint16
	Second       uint16
	Milliseconds uint16
}

func AsTime

func AsTime(t time.Time) Time

func (*Time) GoString

func (ts *Time) GoString() string

func (*Time) String

func (ts *Time) String() string

func (*Time) Time

func (ts *Time) Time() time.Time

type UnknownSect

type UnknownSect struct {
	Ind  uint32
	Data []byte
}

UnknownSect represents a section that is not yet supported.

func (*UnknownSect) ID

func (s *UnknownSect) ID() uint32

func (*UnknownSect) SectName

func (s *UnknownSect) SectName() string

func (*UnknownSect) UnmarshalBinary

func (s *UnknownSect) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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