From fdafaf16078032a6ad6d95659cbbea1df1fd8da9 Mon Sep 17 00:00:00 2001 From: Vitaly Neumoin Date: Sun, 17 Oct 2021 02:16:18 +0300 Subject: [PATCH] rename package --- README.md | 12 +++---- appearance.go | 2 +- appearances.go | 2 +- character.go | 10 +++--- class.go | 2 +- consts.go | 2 +- consts/go.mod | 3 -- d2s-conv/README.md | 24 ------------- d2s-conv/main.go | 77 ---------------------------------------- d2s.go | 2 +- errors.go | 2 +- go.mod | 2 +- header.go | 4 +-- location.go | 2 +- locations.go | 4 +-- mercenary.go | 2 +- npcdialogs/consts.go | 2 +- npcdialogs/difficulty.go | 2 +- quests/act.go | 4 +-- quests/consts.go | 2 +- quests/difficulty.go | 4 +-- quests/quest.go | 4 +-- skill.go | 2 +- status.go | 4 +-- waypoints/consts.go | 2 +- waypoints/difficulty.go | 4 +-- 26 files changed, 39 insertions(+), 143 deletions(-) delete mode 100644 consts/go.mod delete mode 100644 d2s-conv/README.md delete mode 100644 d2s-conv/main.go diff --git a/README.md b/README.md index 8b3ed64..275a547 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ Supports reading both d2s (player saves) ~~and d2i (shared stash)~~ files. To install the package, use the following: ```bash -go get github.com/vitalick/d2s +go get github.com/vitalick/go-d2editor ``` To install command line program, use the following: ```bash -go install github.com/vitalick/d2s/d2s-conv@latest +go install github.com/vitalick/d2editor-cli@latest ``` ## Usage @@ -26,18 +26,18 @@ go install github.com/vitalick/d2s/d2s-conv@latest For convert JSON to .d2s, use the following: ```bash -d2s-conv -fromjson +d2editor-cli -fromjson ``` For convert .d2s to JSON, use the following: ```bash -d2s-conv -tojson +d2editor-cli -tojson ``` To specify the path to the output folder, we use the following: ```bash -d2s-conv -fromjson -o -d2s-conv -tojson -o +d2editor-cli -fromjson -o +d2editor-cli -tojson -o ``` ### As package diff --git a/appearance.go b/appearance.go index b691419..e3133c9 100644 --- a/appearance.go +++ b/appearance.go @@ -1,4 +1,4 @@ -package d2s +package d2editor import "math" diff --git a/appearances.go b/appearances.go index 7916cae..8646a09 100644 --- a/appearances.go +++ b/appearances.go @@ -1,4 +1,4 @@ -package d2s +package d2editor //Appearances ... type Appearances struct { diff --git a/character.go b/character.go index 841a31b..0192a7b 100644 --- a/character.go +++ b/character.go @@ -1,12 +1,12 @@ -package d2s +package d2editor import ( "bytes" "encoding/binary" - "github.com/vitalick/d2s/consts" - "github.com/vitalick/d2s/npcdialogs" - "github.com/vitalick/d2s/quests" - "github.com/vitalick/d2s/waypoints" + "github.com/vitalick/go-d2editor/consts" + "github.com/vitalick/go-d2editor/npcdialogs" + "github.com/vitalick/go-d2editor/quests" + "github.com/vitalick/go-d2editor/waypoints" "io" "time" ) diff --git a/class.go b/class.go index 5b86f90..08194d2 100644 --- a/class.go +++ b/class.go @@ -1,4 +1,4 @@ -package d2s +package d2editor import "fmt" diff --git a/consts.go b/consts.go index 8c6dbb9..fa25447 100644 --- a/consts.go +++ b/consts.go @@ -1,4 +1,4 @@ -package d2s +package d2editor const ( nameSize = 16 diff --git a/consts/go.mod b/consts/go.mod deleted file mode 100644 index ed25b23..0000000 --- a/consts/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/vitalick/d2s/d2s-conv - -go 1.13 \ No newline at end of file diff --git a/d2s-conv/README.md b/d2s-conv/README.md deleted file mode 100644 index e5b1e9b..0000000 --- a/d2s-conv/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Diablo 2 Save editor CLI - -CLI for convert .d2s to JSON and vice-versa - -## Installation - -To install command line program, use the following: - -```bash -go install github.com/vitalick/d2s/d2s-conv@latest -``` - -## Usage -### CLI - -For convert JSON to .d2s, use the following: -```bash -d2s-conv -fromjson -``` - -For convert .d2s to JSON, use the following: -```bash -d2s-conv -tojson -``` \ No newline at end of file diff --git a/d2s-conv/main.go b/d2s-conv/main.go deleted file mode 100644 index 61232c9..0000000 --- a/d2s-conv/main.go +++ /dev/null @@ -1,77 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "github.com/vitalick/d2s" - "os" -) - -type flags struct { - d2sToJSON bool - jsonToD2s bool - output string - input []string -} - -var parsedFlags flags - -func main() { - parseArgs() - - if parsedFlags.d2sToJSON { - for _, f := range parsedFlags.input { - c, err := d2s.Open(f) - if err != nil { - fmt.Fprintf(os.Stderr, "Error \"%v\" on open file \"%s\", skipped \n\n", err, f) - continue - } - err = d2s.SaveJSON(c, parsedFlags.output) - if err != nil { - fmt.Fprintf(os.Stderr, "Error \"%v\" on save file \"%s\", skipped \n\n", err, f) - continue - } - } - } - - if parsedFlags.jsonToD2s { - for _, f := range parsedFlags.input { - c, err := d2s.OpenJSON(f) - if err != nil { - fmt.Fprintf(os.Stderr, "Error \"%v\" on open file \"%s\", skipped \n\n", err, f) - continue - } - err = d2s.Save(c, parsedFlags.output) - if err != nil { - fmt.Fprintf(os.Stderr, "Error \"%v\" on save file \"%s\", skipped \n\n", err, f) - continue - } - } - } -} - -func parseArgs() { - flag.Usage = func() { - fmt.Printf("Usage: %s [options] \n\n", os.Args[0]) - flag.PrintDefaults() - } - flag.BoolVar(&parsedFlags.d2sToJSON, "tojson", parsedFlags.d2sToJSON, "Convert d2s to json.") - flag.BoolVar(&parsedFlags.jsonToD2s, "fromjson", parsedFlags.jsonToD2s, "Convert json to d2s.") - flag.StringVar(&parsedFlags.output, "o", parsedFlags.output, "Optional path of the output folder.") - - // Make sure we have input paths. - if flag.NArg() == 0 { - _, err := fmt.Fprintf(os.Stderr, "Missing \n\n") - if err != nil { - return - } - flag.Usage() - os.Exit(1) - } - - // Create input configurations. - parsedFlags.input = make([]string, flag.NArg()) - for i := range parsedFlags.input { - parsedFlags.input[i] = flag.Arg(i) - } -} diff --git a/d2s.go b/d2s.go index 176cb8e..6078112 100644 --- a/d2s.go +++ b/d2s.go @@ -1,4 +1,4 @@ -package d2s +package d2editor import ( "encoding/json" diff --git a/errors.go b/errors.go index d177a98..5c5f090 100644 --- a/errors.go +++ b/errors.go @@ -1,4 +1,4 @@ -package d2s +package d2editor import "errors" diff --git a/go.mod b/go.mod index d8ac48c..37f5ee5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/vitalick/d2s +module github.com/vitalick/go-d2editor go 1.13 diff --git a/header.go b/header.go index d7f5192..25bf027 100644 --- a/header.go +++ b/header.go @@ -1,8 +1,8 @@ -package d2s +package d2editor import ( "encoding/binary" - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" "io" ) diff --git a/location.go b/location.go index 4251a6c..17e97b7 100644 --- a/location.go +++ b/location.go @@ -1,4 +1,4 @@ -package d2s +package d2editor //Location is information about difficult and opened acts on it type Location struct { diff --git a/locations.go b/locations.go index 5335cfc..c357379 100644 --- a/locations.go +++ b/locations.go @@ -1,8 +1,8 @@ -package d2s +package d2editor import ( "encoding/binary" - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" "io" ) diff --git a/mercenary.go b/mercenary.go index 09b6975..c77c08a 100644 --- a/mercenary.go +++ b/mercenary.go @@ -1,4 +1,4 @@ -package d2s +package d2editor //Mercenary ... type Mercenary struct { diff --git a/npcdialogs/consts.go b/npcdialogs/consts.go index f7c1be3..16b363a 100644 --- a/npcdialogs/consts.go +++ b/npcdialogs/consts.go @@ -1,7 +1,7 @@ package npcdialogs import ( - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" ) var ( diff --git a/npcdialogs/difficulty.go b/npcdialogs/difficulty.go index ce0e855..cc1d068 100644 --- a/npcdialogs/difficulty.go +++ b/npcdialogs/difficulty.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "github.com/vitalick/bitslice" - "github.com/vitalick/d2s/utils" + "github.com/vitalick/go-d2editor/utils" ) type DifficultyImportMap map[string]NPCDialogData diff --git a/quests/act.go b/quests/act.go index 0626600..a818bfb 100644 --- a/quests/act.go +++ b/quests/act.go @@ -3,8 +3,8 @@ package quests import ( "encoding/json" "errors" - "github.com/vitalick/d2s/consts" - "github.com/vitalick/d2s/utils" + "github.com/vitalick/go-d2editor/consts" + "github.com/vitalick/go-d2editor/utils" "io" ) diff --git a/quests/consts.go b/quests/consts.go index 7df9ecf..f7da4d0 100644 --- a/quests/consts.go +++ b/quests/consts.go @@ -1,7 +1,7 @@ package quests import ( - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" ) var ( diff --git a/quests/difficulty.go b/quests/difficulty.go index 3b30f26..432fe2d 100644 --- a/quests/difficulty.go +++ b/quests/difficulty.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/binary" "encoding/json" - "github.com/vitalick/d2s/consts" - "github.com/vitalick/d2s/utils" + "github.com/vitalick/go-d2editor/consts" + "github.com/vitalick/go-d2editor/utils" "io" ) diff --git a/quests/quest.go b/quests/quest.go index f7cccc2..fb8a1ed 100644 --- a/quests/quest.go +++ b/quests/quest.go @@ -4,8 +4,8 @@ import ( "encoding/json" "errors" "github.com/vitalick/bitslice" - "github.com/vitalick/d2s/consts" - "github.com/vitalick/d2s/utils" + "github.com/vitalick/go-d2editor/consts" + "github.com/vitalick/go-d2editor/utils" "io" ) diff --git a/skill.go b/skill.go index 356fe88..bc4e3ce 100644 --- a/skill.go +++ b/skill.go @@ -1,4 +1,4 @@ -package d2s +package d2editor import "math" diff --git a/status.go b/status.go index 0ddb5a7..4304138 100644 --- a/status.go +++ b/status.go @@ -1,8 +1,8 @@ -package d2s +package d2editor import ( "encoding/binary" - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" "io" ) diff --git a/waypoints/consts.go b/waypoints/consts.go index 11cf90c..99d9409 100644 --- a/waypoints/consts.go +++ b/waypoints/consts.go @@ -1,7 +1,7 @@ package waypoints import ( - "github.com/vitalick/d2s/consts" + "github.com/vitalick/go-d2editor/consts" ) var ( diff --git a/waypoints/difficulty.go b/waypoints/difficulty.go index f323a26..b7f21c4 100644 --- a/waypoints/difficulty.go +++ b/waypoints/difficulty.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "encoding/json" "github.com/vitalick/bitslice" - "github.com/vitalick/d2s/consts" - "github.com/vitalick/d2s/utils" + "github.com/vitalick/go-d2editor/consts" + "github.com/vitalick/go-d2editor/utils" "io" )