Compare commits

...

3 Commits

Author SHA1 Message Date
cb2047fa19 update for umadump v2.0.0-beta.3 2026-05-06 17:00:13 -04:00
c1bcf6b74f add readme 2026-05-06 16:43:30 -04:00
7b673ef443 output to file by default 2026-05-06 16:41:23 -04:00
2 changed files with 35 additions and 15 deletions

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# umadump-gametora
Convert [Umadump](https://github.com/Werseter/umadump) exports into [GameTora collection](https://gametora.com/umamusume/collection-tracker) backups.
This program is meant to be a temporary helper until GameTora has full Umadump import built in, which should be soon.
Therefore, it does not provide a pretty UI.
## Usage
With a recent Go toolchain installed, open a terminal and run:
```
umadump
go run git.sunturtle.xyz/zephyr/umadump-gametora@latest
```
If you run umadump in a different directory, pass that directory with `-dump` on the `go run` line.
E.g., I run umadump in `C:\Users\zephyr\Downloads`, so the command I use is
```
go run git.sunturtle.xyz/zephyr/umadump-gametora@latest -dump C:\Users\zephyr\Downloads
```
This writes the collection to a file like `uma-col-all-2026-05-06.json` which you can use with the `Import from a file instead` link in the `Import` section of the `Backup` menu on the GameTora collection tracker page.

View File

@@ -5,6 +5,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"flag" "flag"
"fmt"
"io" "io"
"log/slog" "log/slog"
"net/http" "net/http"
@@ -15,22 +16,16 @@ import (
) )
type DumpCard struct { type DumpCard struct {
ID int `json:"card_id"` ID int `json:"card_id"`
Level int `json:"talent_level"` Rarity int `json:"rarity"`
Rarity int `json:"rarity"` // Level int `json:"talent_level"`
CreateTime int `json:"create_time"` // CreateTime int `json:"create_time"`
} }
type DumpSupport struct { type DumpSupport struct {
ID int `json:"supportCardId"` ID int `json:"support_card_id"`
Level int `json:"level"` LB int `json:"limit_break_count"`
LB int `json:"limitBreakCount"` // many other fields we don't need
MaxLevel int `json:"maxLevel"`
CreateTime int `json:"createTime"`
Exp int `json:"exp"`
Stock int `json:"stock"`
Favorite bool `json:"isFavoriteLock"`
BestTraining int `json:"bestTraining"`
} }
type Collection struct { type Collection struct {
@@ -88,12 +83,13 @@ func filejson[T any](path string) ([]T, error) {
} }
func main() { func main() {
ts := time.Now().UTC().Format(time.DateOnly) // can't use RFC3339 because :s in filename
var ( var (
dumpDir string dumpDir string
out string out string
) )
flag.StringVar(&dumpDir, "dump", ".", "`dir`ectory containing umadump output files") flag.StringVar(&dumpDir, "dump", ".", "`dir`ectory containing umadump output files")
flag.StringVar(&out, "o", "", "output `file` (default stdout)") flag.StringVar(&out, "o", fmt.Sprintf("uma-col-all-%s.json", ts), "output `file` (stdout if empty)")
flag.Parse() flag.Parse()
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
@@ -142,7 +138,7 @@ func main() {
Game: "umamusume", Game: "umamusume",
Type: "collection", Type: "collection",
Version: 4, Version: 4,
Timestamp: time.Now().String(), Timestamp: ts,
Servers: map[string]CollectionServer{ Servers: map[string]CollectionServer{
"en": { "en": {
CharCards: charaLevels, CharCards: charaLevels,