Skip to content

Commit

Permalink
Implement comics fetching, add support for TW server
Browse files Browse the repository at this point in the history
  • Loading branch information
blead committed Jan 10, 2024
1 parent 2cc3356 commit daae2f0
Show file tree
Hide file tree
Showing 5 changed files with 1,559 additions and 85 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Fetch new (`diff-only`) assets for version `1.600.0` into `./dump` directory and
wfax fetch --diff-only --version 1.600.0 ./dump && wfax extract --indent 2 ./dump ./output
```

Fetch character comics (`--comics 1`) with `10` maximum concurrent requests into `./comics` directory.
```sh
wfax fetch --comics 1 --concurrency 10 ./comics
```

Extract character image assets for eliyabot:
```sh
wfax extract --eliyabot --no-default-paths ./dump ./output
Expand All @@ -44,3 +49,4 @@ The main focus currently is extracting text files so other assets are not fully
* Ordered Maps
* Action/Enemy DSL files
* Image assets for EliyaBot
* Comics
8 changes: 6 additions & 2 deletions cmd/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var fetchVersion string
var fetchDiff bool
var fetchConcurrency int
var fetchRegion string
var fetchComics int

var fetchCmd = &cobra.Command{
Use: "fetch [target dir]",
Expand All @@ -39,6 +40,8 @@ var fetchCmd = &cobra.Command{
config.Region = wf.RegionKR
case "cn":
config.Region = wf.RegionCN
case "tw":
config.Region = wf.RegionTW
default:
log.Printf("[WARN] Unknown service region %s, using default (jp)", fetchRegion)
config.Region = wf.RegionJP
Expand All @@ -49,7 +52,7 @@ var fetchCmd = &cobra.Command{
log.Fatalln(err)
}

err = client.FetchAssetsFromAPI()
err = client.FetchAssetsFromAPI(fetchComics)
if err != nil {
if err == wf.ErrNoNewAssets {
os.Exit(1)
Expand All @@ -64,5 +67,6 @@ func init() {
fetchCmd.Flags().StringVarP(&fetchVersion, "version", "v", "0.0.0", "Game version of existing assets")
fetchCmd.Flags().BoolVarP(&fetchDiff, "diff-only", "d", false, "Fetch only new assets (used with --version)")
fetchCmd.Flags().IntVarP(&fetchConcurrency, "concurrency", "c", 5, "Maximum number of concurrent asset downloads")
fetchCmd.Flags().StringVarP(&fetchRegion, "region", "r", "jp", "Service region: jp, gl, kr, cn")
fetchCmd.Flags().StringVarP(&fetchRegion, "region", "r", "jp", "Service region: jp, gl, kr, cn, tw")
fetchCmd.Flags().IntVarP(&fetchComics, "comics", "m", 0, "Fetch comics instead (1: character comics, 2: tutorial comics)")
}
Loading

0 comments on commit daae2f0

Please sign in to comment.