Go implementation of PolUtils and ResourceExtractor
- Lua 78.9%
- Go 21.1%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| abilities | ||
| cmd | ||
| dat | ||
| encoding | ||
| flyway | ||
| image | ||
| items | ||
| lsb | ||
| maps | ||
| migrations | ||
| render | ||
| spells | ||
| types | ||
| .gitignore | ||
| currencyshops.go | ||
| go.mod | ||
| go.sum | ||
| init.sql | ||
| landsandboat.go | ||
| landsandboat_test.go | ||
| main.go | ||
| npcshops.go | ||
| README.md | ||
| serializers.go | ||
| serializers_test.go | ||
PolExtract
Build
go build ./...
Extract
go run . \
-ffxi "/path/to/ffxi" \
-out output \
-maps
The default extraction writes:
output/resources/json/*.jsonoutput/resources/lua/*.luaoutput/resources/xml/*.xmloutput/resources/manifest.jsonoutput/resources/manifest.xmloutput/icons/*.png
Useful options:
-icons=false Skip icon output
-items=false Skip item DATs
-spells=false Skip spell data
-abilities=false Skip ability data
-strings=false Skip DAT string tables
-maps Extract maps
Item Cards
Verdana font is required. Point the renderer at installed Verdana TTF:
go run ./cmd/card \
-items output/resources/json/items.json \
-icons output/icons \
-font "/path/to/verdana.ttf" \
-id 23734 \
-out output/malignance_gloves.png
Render all Weapon and Armor cards:
go run ./cmd/card \
-items output/resources/json/items.json \
-icons output/icons \
-font "/path/to/verdana.ttf" \
-all \
-out-dir output/cards
Use -all -out-dir output/cards to render every non-placeholder Weapon and
Armor item. Other item categories are skipped.
PostgreSQL Import
Import all JSON resources:
go run ./cmd/postgres
The importer reads output/resources/json/*.json, records existing icons from
output/icons, and records existing cards from output/cards. It upserts all
records and removes records that are no longer present by default. Database
asset paths are stored relative to the published asset root, such as
icons/10253.png and cards/10253.png.
The schema has:
game_resources: every extracted resource record, stored asjsonbgame_items: searchable item columns, the merged English description, detected weapon type, decoded job/race/flag/slot text, relative icon/card paths, and the complete untouched item record asjsonbresource_imports: one summary row for each successful import
Override it for another PostgreSQL server:
DATABASE_URL="postgres://user:password@host:5432/database" \
go run ./cmd/postgres
References & Inspiration
- ResourceExtractor: extraction, parsing, fixes, filtering, post-processing, manifests, and resource serialization.
- Vanalytics: item-card content, layout, styling, icons, and wrapping.