Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile, read raw romfs with zstd+sarc+byml #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix arg handling compatibility
  • Loading branch information
aquacluck committed Jul 9, 2023
commit 31e301866595407db199899968d9c2cf68b89342
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@ A server for querying placement objects in *The Legend of Zelda: Tears of the Ki

Run build.ts to generate a map database before starting the server for the first time.

ts-node build.ts -d ../totk/Banc

This assumes the `totk/Banc` directory contains the YAML data object map files

ts-node build.ts -r ../totk -e tools

This assumes the `totk` directory contains the unaltered romfs contents.
15 changes: 10 additions & 5 deletions build.ts
Original file line number Diff line number Diff line change
@@ -7,17 +7,22 @@ import { Beco } from './beco';

let parseArgs = require('minimist');
let argv = parseArgs(process.argv);
if (!argv.e || !argv.r) {
console.log("Error: Must specify paths to directories with ");
const validRomfsArgs = (argv.e && argv.r);
const validFolderArgs = (argv.e && argv.b && argv.d);
if (!validRomfsArgs && !validFolderArgs) {
console.log("Error: Must specify paths to directories with -e and either -r or (-b and -d)");
console.log(" -d Banc extracted YAML files");
console.log(" -b field map area beco files");
console.log(" -e Ecosystem json files");
console.log(" -r Bare game romfs");
console.log(" e.g. % ts-node build.ts -r path/to/romfs -e tools")
console.log(" e.g. % ts-node build.ts -d path/to/Banc -b path/to/beco -e path/to/Ecosystem")
console.log(" or: % ts-node build.ts -r path/to/romfs -e path/to/Ecosystem")
process.exit(1);
}
const ecoPath = argv.e;
const romfsPath = argv.r;
const totkData = path.join(romfsPath, 'Banc');
const becoPath = path.join(romfsPath, 'Ecosystem', 'FieldMapArea');
const totkData = argv.d || path.join(romfsPath, 'Banc');
const becoPath = argv.b || path.join(romfsPath, 'Ecosystem', 'FieldMapArea');

fs.rmSync('map.db.tmp', { force: true });
const db = sqlite3('map.db.tmp');