Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Friends-of-Monika/go-persistent-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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)
}

Releases

No releases published

Languages