Add the battle pass (port of AVA2 ENABLE_BATTLE_PASS)

Monthly seasons from share/locale/<locale>/port_battlepass.tsv, up to ten
missions (kills, boss, stone, play time, fishing, refine, level, NPC spend,
NPC sell) with per-mission and final rewards. Progress is counted in memory
and flushed additively on save; claims are idempotent via INSERT IGNORE.
Client protocol: /mt_bp 1 info|claim N|close -> MTBP1 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 09:11:36 +09:00
co-authored by Claude Opus 5.5
parent 1bdaae8807
commit 7f4e8b3f76
15 changed files with 964 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
-- PORT: battle pass tables (docs/FEATURE-BATTLEPASS.md). Idempotent; run once on the player database.
-- Progress: one row per player, season and mission slot; the game adds deltas and MySQL caps them at target.
CREATE TABLE IF NOT EXISTS player.mt_battlepass_progress (
pid INT UNSIGNED NOT NULL,
season INT UNSIGNED NOT NULL,
slot TINYINT UNSIGNED NOT NULL,
value BIGINT UNSIGNED NOT NULL DEFAULT 0,
target BIGINT UNSIGNED NOT NULL DEFAULT 0,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (pid, season, slot)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Claims: the primary key is the idempotency guard; only the request whose INSERT IGNORE adds the row pays out.
-- slot 0 is the final reward.
CREATE TABLE IF NOT EXISTS player.mt_battlepass_claim (
pid INT UNSIGNED NOT NULL,
season INT UNSIGNED NOT NULL,
slot TINYINT UNSIGNED NOT NULL,
claimed_at INT UNSIGNED NOT NULL,
PRIMARY KEY (pid, season, slot)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;