save

package
v0.0.0-...-0c1458e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package save is a parser and serializer for the Satisfactory save file format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpBody

func DumpBody(r io.Reader) ([]byte, error)

DumpBody will decompress the body of a Satisfactory save file and return the body as a byte slice.

Primarily used for debugging.

Types

type Component

type Component struct {
	TypePath         string               `json:"typePath"`
	RootObject       string               `json:"rootObject"`
	InstanceName     string               `json:"instanceName"`
	ParentEntityName string               `json:"parentEntityName"`
	Properties       []*property.Property `json:"property"`
}

type Entity

type Entity struct {
	TypePath         string               `json:"typePath"`
	RootObject       string               `json:"rootObject"`
	InstanceName     string               `json:"instanceName"`
	NeedTransform    int32                `json:"needTransform"`
	Rotation         []float32            `json:"rotation"`
	Position         []float32            `json:"position"`
	Scale            []float32            `json:"scale"`
	WasPlacedInLevel int32                `json:"wasPlacedInLevel"`
	ParentObjectRoot string               `json:"parentObjectRoot"`
	ParentObjectName string               `json:"parentObjectName"`
	References       []*ObjectReference   `json:"references"`
	Properties       []*property.Property `json:"properties"`
	Extra            *extra.Extra         `json:"extra"`
}
type Header struct {
	HeaderVersion       int32  `json:"headerVersion"`
	SaveVersion         int32  `json:"saveVersion"`
	BuildVersion        int32  `json:"buildVersion"`
	MapName             string `json:"mapName"`
	MapOptions          string `json:"mapOptions"`
	SessionName         string `json:"sessionName"`
	PlayTime            int32  `json:"playTime"`
	SaveDate            int64  `json:"saveDate"`
	SessionVisibility   byte   `json:"sessionVisibility"`
	EditorObjectVersion int32  `json:"editorObjectVersion"`
	ModMetadata         string `json:"modMetadata"`
	ModFlags            int32  `json:"modFlags"`
}

Header of a Satisfactory save file.

func ParseHeader

func ParseHeader(r io.Reader) (*Header, error)

ParseHeader will only parse the header of the save file and return it.

func (*Header) GetMapOptions

func (h *Header) GetMapOptions() map[string]string

GetMapOptions returns the Header.MapOptions as a map.

type ObjectReference

type ObjectReference struct {
	LevelName string `json:"levelName"`
	PathName  string `json:"pathName"`
}

type Save

type Save struct {
	// Header of the save file.
	Header *Header `json:"header"`

	// Components within the save file. The key is the InstanceName of the Component.
	Components map[string]*Component `json:"components"`

	// Entities within the save file. The key is the InstanceName of the Entity.
	Entities map[string]*Entity `json:"entities"`

	// CollectedObjects is a list of all the objects the player has collected in the level.
	CollectedObjects []*ObjectReference `json:"collected_objects"`
	// contains filtered or unexported fields
}

A Save file for Satisfactory

func Parse

func Parse(r io.Reader) (*Save, error)

Parse a Satisfactory save file

func (*Save) Serialize

func (s *Save) Serialize(w io.Writer) error

Serialize the Save to the provided writer.

Directories

Path Synopsis
Package data provides the ability to read and write the necessary data types from a decompressed Satisfactory save body.
Package data provides the ability to read and write the necessary data types from a decompressed Satisfactory save body.
Package extra provides handling for the extra data that may be appended on to a save.Entity
Package extra provides handling for the extra data that may be appended on to a save.Entity
Package property provides handling for the different property types that may be encountered within a Satisfactory save file.
Package property provides handling for the different property types that may be encountered within a Satisfactory save file.

Jump to

Keyboard shortcuts

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