item

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOutOfRange = errors.New("error: out of range")

Functions

func DecryptSerial

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

func DmKeyToInvKey added in v0.3.5

func DmKeyToInvKey(key string, assets []string) string

func EncryptSerial

func EncryptSerial(data []byte, seed int32) ([]byte, error)

func GetBlueprint added in v0.3.5

func GetBlueprint(key, invdata string) string

func GetBtik

func GetBtik() map[string]string

func GetPartSuffix added in v0.3.5

func GetPartSuffix(part string) string

func GetSeedFromSerial

func GetSeedFromSerial(data []byte) (int32, error)

func Hash

func Hash(buffer []byte) uint

func Serialize

func Serialize(item Item, seed int32) ([]byte, error)

Types

type Assets

type Assets []string

type Data

type Data struct {
	Versions Versions `json:"versions"`
	Assets   Assets   `json:"assets"`
}

func (Data) GetBits

func (d Data) GetBits(version uint64) int

func (Data) GetPart

func (d Data) GetPart(i uint64) string

type DigitalMarineItem added in v0.3.5

type DigitalMarineItem struct {
	CopyType       string   `json:"copyType"`
	Level          int      `json:"level"`
	Blueprint      string   `json:"blueprint"`
	Balance        string   `json:"balance"`
	Manufacturer   string   `json:"manufacturer"`
	ComponentNames []string `json:"componentNames"`
	Components     []int    `json:"components"`
}

func GibbedToDm added in v0.3.5

func GibbedToDm(i Item) DigitalMarineItem

type Item

type Item struct {
	Level        int                              `json:"level"`
	Balance      string                           `json:"balance"`
	Manufacturer string                           `json:"manufacturer"`
	InvData      string                           `json:"inv_data"`
	Parts        []string                         `json:"parts"`
	Generics     []string                         `json:"generics"`
	Overflow     string                           `json:"overflow"`
	Version      uint64                           `json:"version"`
	Wrapper      *pb.OakInventoryItemSaveGameData `json:"wrapper"`
}

func Deserialize

func Deserialize(data []byte) (item Item, err error)

func DmToGibbed added in v0.3.5

func DmToGibbed(dmi DigitalMarineItem) Item

type PartsDatabase

type PartsDatabase map[string]Data

func GetDB

func GetDB() PartsDatabase

func (PartsDatabase) GetData

func (db PartsDatabase) GetData(key string) Data

func (PartsDatabase) GetInventoryBalanceData

func (db PartsDatabase) GetInventoryBalanceData() Data

func (PartsDatabase) GetInventoryData

func (db PartsDatabase) GetInventoryData() Data

func (PartsDatabase) GetManufacturerData

func (db PartsDatabase) GetManufacturerData() Data

type Reader

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

func NewReader

func NewReader(data []byte) *Reader

func (*Reader) Overflow

func (r *Reader) Overflow() string

func (*Reader) ReadInt

func (r *Reader) ReadInt(n int) (uint64, error)

func (*Reader) Remaining

func (r *Reader) Remaining() int

type Version

type Version struct {
	Version uint64 `json:"version"`
	Bits    int    `json:"bits"`
}

type Versions

type Versions []Version

type Writer

type Writer string

func NewWriter

func NewWriter(initial string) *Writer

func (*Writer) GetBytes

func (w *Writer) GetBytes() []byte

func (*Writer) WriteInt

func (w *Writer) WriteInt(v uint64, n int) error

Jump to

Keyboard shortcuts

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