- Lua 77.5%
- Go 22.3%
- Shell 0.2%
|
All checks were successful
Sync validated game data to Go backend / sync (push) Successful in 2m8s
|
||
|---|---|---|
| .forgejo/workflows | ||
| abilities | ||
| cmd | ||
| dat | ||
| encoding | ||
| exports | ||
| flyway | ||
| image | ||
| items | ||
| lsb | ||
| maps | ||
| migrations | ||
| render | ||
| scripts | ||
| spells | ||
| types | ||
| .gitignore | ||
| currencyshops.go | ||
| extraction_test.go | ||
| go.mod | ||
| go.sum | ||
| guildshops.go | ||
| init.sql | ||
| landsandboat.go | ||
| landsandboat_test.go | ||
| main.go | ||
| npcshops.go | ||
| README.md | ||
| serializers.go | ||
| serializers_test.go | ||
| upstream_test.go | ||
| yamldrops.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.
Item DAT layout compatibility
The item parser supports both legacy 0xC00 (3,072-byte) and current 0x1400
(5,120-byte) records. It checks decoded icon wrappers at record boundaries when
file size alone is ambiguous. The larger layout uses a wider flag field and
additional equipment-field padding. String tables are validated separately for
English and Japanese, while the icon wrapper remains at offset 0x284.
Missing, truncated, or unsupported item DATs now stop extraction with a nonzero exit status instead of exporting an incomplete catalogue. Output should be staged and checked before generating migrations or importing it into a database.
Updating and publishing game data for the Go backend
Run scripts/export-game-data.sh "/path/to/FINAL FANTASY XI". Set FONT_PATH
to Verdana TTF if it is not installed under the default Wine prefix, and
VANAPORTAL_GO_DIR if the sibling Go backend is elsewhere. The script updates
an ignored shallow/sparse LandSandBoat checkout using git pull --ff-only, runs
tests, extracts the game, renders all equipment cards, and validates the bundle
with the Go backend's cmd/game-data tool. Failures keep the previous bundle.
The prepared archive is exports/game-data.tar.gz; expanded output is retained
under exports/data-<content-version>/ locally. Commit the archive to publish an
update. Forgejo validates it and syncs only the archive to
vanaportal-backend-go/extracted/game-data.tar.gz using GITOPS_TOKEN. It no
longer pushes repeatable SQL migrations to the Java backend. The workflow does
not run extraction: the runner currently has no FFXI installation. For future
full automation, give the runner a read-only game installation and Verdana,
then invoke the same export script before the sync step.
Current upstream supports item constants under scripts/enum/item.lua, Lua
guild shop definitions with shared-stock aliases, and monster loot from
data/zones/*/mobs.yaml in addition to the remaining SQL sources. YAML loot is
preserved in the mob_loot dataset; normalized mob_drops includes ordinary,
weighted-group, steal and despoil items. Unknown probabilities remain null
rather than being invented. Guild shop rows from Lua are keyed by NPC and zone,
not a fabricated legacy guild ID; min/max asking prices follow the upstream
stock-price curve rather than representing current live stock.