feat(tournament): implement hunting tournament system end-to-end

Wire format for MsgMhfEnterTournamentQuest (0x00D2) derived from
mhfo-hd.dll binary analysis (FUN_114f4280). Five new tables back
the full lifecycle: schedule, cups, sub-events, player registrations,
and run submissions. All six tournament handlers are now DB-driven:

- EnumerateRanking: returns active tournament schedule with cups and
  sub-events; computes phase state byte from timestamps
- EnumerateOrder: returns per-event leaderboard ranked by submission
  time, with SJIS-encoded character and guild names
- InfoTournament: exposes tournament detail and player registration
  state across all three query types
- EntryTournament: registers player and returns entry handle used by
  the client in the subsequent EnterTournamentQuest packet
- EnterTournamentQuest: parses the previously-unimplemented packet and
  records the run in tournament_results
- AcquireTournament: stubs rewards (item IDs not yet reversed)

Seed data (TournamentDefaults.sql) reproduces tournament #150 cups and
sub-events so a fresh install has a working tournament immediately.
This commit is contained in:
Houmgaor
2026-03-22 14:30:37 +01:00
parent 5ee9a0e635
commit c714374289
17 changed files with 674 additions and 161 deletions

View File

@@ -15,7 +15,7 @@ All empty handlers carry an inline comment — `// stub: unimplemented` for real
---
## Unimplemented (66 handlers)
## Unimplemented (65 handlers)
Grouped by handler file / game subsystem. Handlers with an open branch are marked **[branch]**.
@@ -95,8 +95,6 @@ Grouped by handler file / game subsystem. Handlers with an open branch are marke
All five mutex handlers are empty. MHF mutexes are distributed locks used for event coordination
(Raviente, etc.). The server currently uses its own semaphore system instead.
**[`fix/mutex-rework`]** (2 commits) proposes replacing the semaphore system with proper
protocol-level mutex handling.
| Handler | Notes |
|---------|-------|
@@ -125,12 +123,6 @@ secondary operations are stubs:
| `handleMsgSysDispObject` | Display/show a previously hidden object |
| `handleMsgSysHideObject` | Hide an object from other clients |
### Quests (`handlers_quest.go`)
| Handler | Notes |
|---------|-------|
| `handleMsgMhfEnterTournamentQuest` | Enter a tournament-mode quest — **[`feature/hunting-tournament`]** (7 commits, actively rebased onto main) |
### Register (`handlers_register.go`)
| Handler | Notes |
@@ -197,8 +189,6 @@ that needs no reply). Others are genuine feature gaps.
| Branch | Commits ahead | Handlers targeted |
|--------|:---:|-------------------|
| `feature/hunting-tournament` | 7 | `EnterTournamentQuest` |
| `fix/mutex-rework` | 2 | All 5 Mutex handlers |
| `feature/enum-event` | 4 | `GetRestrictionEvent` |
| `feature/conquest` | 4 | Conquest quest handlers |
| `feature/tower` | 4 | Tower handlers |