Categorygithub.com/gucio321/d2d2s
repository
1.0.1
Repository: https://github.com/gucio321/d2d2s.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

CircleCI Go Report Card GoDoc

Description

This package contains a Diablo II save files (D2S) decoder and encoder written in golang

Dependencies / Documentation

D2S structure documentation:

data reader

this project uses Stream readers based on these used in OpenDiablo2 project for more informations, see here

Status

for now (May 2021) the project is early in development. However, it is possible to:

  • decode character save file into a (in a greater part) human-readable structure
  • encoding file

Example

for some reasons, this project isn't able to create a whole new file yet, but it is able to load modify and than encode D2S format

simple example
package main

import (
        "fmt"
        "ioutil"
        "log"

        "github.com/gucio321/d2d2s"
)

func main() {
        data, err := ioutil.ReadFile("/path/to/file.d2s")
        if err != nil {
                log.Fatal(err)
        }

        character, err := d2d2s.Unmarshal(data)
        if err != nil {
                log.Fatal(err)
        }

        // some edits

        newData, err := d2d2s.Encode(character)
        if err != nil {
                log.fatal(err)
        }

        ioutil.WriteFile("/path/to/new/file.d2s", newData, 0o600)
}

for more examples, see here

Goals of the project

this programm should be able to decode, encode and create a new D2S files

Notes

Diablo 2 and its content is ©2000 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.