go-persistent-loader

module
v0.0.0-...-141549f Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT

README

Go Persistent Loader

This project is an experiment on loading/deserializing Monika After Story persistent (save) file into memory.

Currently it contains only the most basic wrapping types just to make it work plus some typed mappings (see renpy_persistent_persistent.go and renpy_preferences_preferences.go.)

This is proven to work, however, there is a possibility (however, this hasn't ever happened on testing stage and it happened once) some of these mappings may fail to apply due to type incompatibilities between dynamically typed Python and statically typed Go.

For this case and also for impossibility to know the value type for sure there are two alias types to interface{}, any and unknown. For clarity, fields with type that was not yet seen as anything other than nil are typed unknown and fields that are proven to be dynamically typed are typed any.

Example

import (
    "github.com/friends-of-monika/go-persistent-loader"
)

func main() {
    save, err := persistent.Load("/home/user/.renpy/Monika After Story/persistent")
    if err != nil {
        panic(err)
    }
    
    fmt.Println(save.Playername)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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