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>
21 lines
1022 B
SQL
21 lines
1022 B
SQL
-- 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;
|