From be800d12c2a31b4cc5eac67e9e742a84219a590b Mon Sep 17 00:00:00 2001 From: houmgaor Date: Sun, 22 Mar 2026 14:40:49 +0100 Subject: [PATCH] docs(tournament): add hunting tournament setup and operations guide --- Server-Operations.md | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Server-Operations.md b/Server-Operations.md index 778be19..01d60a4 100644 --- a/Server-Operations.md +++ b/Server-Operations.md @@ -57,6 +57,56 @@ Decrypted quest data is cached in memory. The cache expires after `QuestCacheExp If `ClientMode` is set to Z1 or earlier, quest data is automatically backported for compatibility with older clients. +## Hunting Tournament + +The hunting tournament system (`公式狩猟大会`) hosts periodic competitive events where players submit timed hunts and fishing runs. The tournament lobby, cup listings, leaderboards, registration, and run submission are all server-driven. + +### Lifecycle phases + +Each tournament row has four Unix timestamps that drive the phase shown to the client: + +| Phase | State byte | Description | +|-------|:---:|-------------| +| Before start | 0 | No active tournament shown | +| Registration open | 1 | Players can register (`EntryTournament`) | +| Hunting active | 2 | Players can enter and submit runs | +| Ranking / reward | 3 | Results visible; rewards claimable | + +### Database tables + +| Table | Purpose | +|-------|---------| +| `tournaments` | One row per tournament instance (schedule) | +| `tournament_cups` | Competition categories (speed hunt, fishing, etc.) linked to a tournament | +| `tournament_sub_events` | Specific hunt/fish targets grouped by `cup_group` | +| `tournament_entries` | Player registrations | +| `tournament_results` | Submitted run records (submission order = rank proxy) | + +### Seed data + +`TournamentDefaults.sql` seeds cup and sub-event data from live tournament #150 (Brachydios time-attack + fishing cups). A demo tournament starting immediately is also inserted so the lobby is populated on a fresh install. + +### Scheduling a tournament + +Update the demo row or insert a new one: + +```sql +-- Update the existing demo tournament +UPDATE tournaments SET + name = '第151回公式狩猟大会', + start_time = EXTRACT(epoch FROM '2026-04-01 14:00:00+09'::timestamptz)::bigint, + entry_end = EXTRACT(epoch FROM '2026-04-04 14:00:00+09'::timestamptz)::bigint, + ranking_end = EXTRACT(epoch FROM '2026-04-13 14:00:00+09'::timestamptz)::bigint, + reward_end = EXTRACT(epoch FROM '2026-04-20 14:00:00+09'::timestamptz)::bigint +WHERE id = 1; +``` + +To add new cup types or hunt targets, insert rows into `tournament_cups` (with the correct `tournament_id`) and `tournament_sub_events` (linked by `cup_group`). + +### Known limitation + +The `Unk2` field in `MsgMhfEnterTournamentQuest` is stored as `event_id` in `tournament_results`. Its exact semantics are unconfirmed — if leaderboards appear empty in-game, this is the likely cause. See [#184](https://github.com/Mezeporta/Erupe/issues/184). + ## Save Data ### Character Saves