From b96cd0904bc0a8913cb15ab9ddfa0e32adab02a9 Mon Sep 17 00:00:00 2001 From: Houmgaor Date: Mon, 23 Feb 2026 20:23:08 +0100 Subject: [PATCH] fix: ease onboarding with startup warnings and doc corrections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Warn at startup when quest files are missing (clients crash without them) and point users to the download link - Fix Host config description: it's the advertised IP, not a bind address — 0.0.0.0 was wrong advice - Load bundled schemas (shops, events, gacha) in Docker init so new users get working demo data out of the box - Renumber duplicate patch schema 28 → 32 to resolve numbering collision - Fix patch schema example filename to use hyphens matching actual files --- README.md | 4 ++-- docker/init/setup.sh | 8 ++++++++ main.go | 10 ++++++++++ ...-soft-delete.sql => 32-guild-posts-soft-delete.sql} | 0 4 files changed, 20 insertions(+), 2 deletions(-) rename schemas/patch-schema/{28-guild-posts-soft-delete.sql => 32-guild-posts-soft-delete.sql} (100%) diff --git a/README.md b/README.md index 5f3f02aa4..1b1c4864a 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Docker handles the database automatically. You only need to provide quest files 3. Apply any patch schemas from [schemas/patch-schema/](./schemas/patch-schema/) in numerical order: ```bash - psql -U postgres -d erupe -f schemas/patch-schema/01_patch.sql + psql -U postgres -d erupe -f schemas/patch-schema/01-example-patch.sql # Repeat for each patch file ``` @@ -159,7 +159,7 @@ Edit `config.json` before starting the server. The essential settings are: | Setting | Description | |---------|-------------| -| `Host` | Bind address. Use `127.0.0.1` for local, `0.0.0.0` for remote access | +| `Host` | IP advertised to clients. Use `127.0.0.1` for local play, your LAN/WAN IP for remote. Leave blank in config to auto-detect | | `ClientMode` | Target client version (`ZZ`, `G10`, `Forward4`, etc.) | | `BinPath` | Path to quest/scenario files | | `Language` | `"en"` or `"jp"` | diff --git a/docker/init/setup.sh b/docker/init/setup.sh index 78639a18e..02e9b9709 100644 --- a/docker/init/setup.sh +++ b/docker/init/setup.sh @@ -14,6 +14,14 @@ done echo "Patching!" for file in /schemas/patch-schema/*; do + [ -f "$file" ] || continue + echo " Applying $file" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f "$file" +done + +echo "Loading bundled data (shops, events, gacha)..." +for file in /schemas/bundled-schema/*; do + [ -f "$file" ] || continue echo " Applying $file" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -1 -f "$file" done \ No newline at end of file diff --git a/main.go b/main.go index f03665d7e..7a16dc515 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "net" "os" "os/signal" + "path/filepath" "runtime/debug" "syscall" "time" @@ -180,6 +181,15 @@ func main() { logger.Info(fmt.Sprintf("Server Time: %s", gametime.Adjusted().String())) + // Warn if quest files are missing — clients crash without them. + questPath := filepath.Join(config.BinPath, "quests") + if entries, err := os.ReadDir(questPath); err != nil || len(entries) == 0 { + logger.Warn("No quest files found in " + questPath) + logger.Warn("Download quest/scenario files from: https://files.catbox.moe/xf0l7w.7z") + logger.Warn("Extract into your BinPath directory (default: bin/)") + logger.Warn("Without these files, quests will not load and clients will crash.") + } + // Now start our server(s). // Entrance server. diff --git a/schemas/patch-schema/28-guild-posts-soft-delete.sql b/schemas/patch-schema/32-guild-posts-soft-delete.sql similarity index 100% rename from schemas/patch-schema/28-guild-posts-soft-delete.sql rename to schemas/patch-schema/32-guild-posts-soft-delete.sql