mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-05-06 14:24:15 +02:00
chore(merge): merge develop into main for 9.4.0 cycle
Brings 53 develop commits (i18n, Diva, campaign, guild invites, save transfer, return/rookie guilds, hunting tournament, JSON quest/scenario loaders, Ghidra-derived user binary parsing, and misc fixes) onto main now that 9.3.2 has been tagged and released. Resolves two overlap zones: 1. Migration number collision. Main shipped 0010_fix_zero_rasta_id and 0011_fix_stale_boost_time in 9.3.2; develop had independently numbered 0010_campaign..0015_tournament. The migration runner keys applied versions by integer, so coexisting files with the same numeric prefix would silently skip each other. Develop's files have been renumbered to 0016..0021, leaving main's 0010/0011 intact. A schema_version rename script is required on any server that had already applied the old develop numbers (only frontier.mogapedia.fr at the time of this merge). 2. CHANGELOG.md. Develop's in-progress feature entries move into [Unreleased] with updated migration references; the [9.3.2] section is preserved verbatim. main.go version string bumped to 9.4.0-dev to mark the new cycle. Full test suite (go test -race ./...) passes.
This commit is contained in:
@@ -998,7 +998,7 @@ CREATE TABLE public.guilds (
|
||||
pugi_name_1 character varying(12) DEFAULT ''::character varying,
|
||||
pugi_name_2 character varying(12) DEFAULT ''::character varying,
|
||||
pugi_name_3 character varying(12) DEFAULT ''::character varying,
|
||||
recruiting boolean DEFAULT true NOT NULL,
|
||||
recruiting boolean DEFAULT false NOT NULL,
|
||||
pugi_outfit_1 integer DEFAULT 0 NOT NULL,
|
||||
pugi_outfit_2 integer DEFAULT 0 NOT NULL,
|
||||
pugi_outfit_3 integer DEFAULT 0 NOT NULL,
|
||||
|
||||
@@ -1 +1 @@
|
||||
ALTER TABLE public.guild_alliances ADD COLUMN IF NOT EXISTS recruiting boolean NOT NULL DEFAULT true;
|
||||
ALTER TABLE public.guild_alliances ADD COLUMN IF NOT EXISTS recruiting boolean NOT NULL DEFAULT false;
|
||||
|
||||
66
server/migrations/sql/0016_campaign.sql
Normal file
66
server/migrations/sql/0016_campaign.sql
Normal file
@@ -0,0 +1,66 @@
|
||||
-- Campaign / Event Tent system tables.
|
||||
CREATE TABLE IF NOT EXISTS public.campaigns (
|
||||
id INTEGER PRIMARY KEY,
|
||||
min_hr INTEGER,
|
||||
max_hr INTEGER,
|
||||
min_sr INTEGER,
|
||||
max_sr INTEGER,
|
||||
min_gr INTEGER,
|
||||
max_gr INTEGER,
|
||||
reward_type INTEGER,
|
||||
stamps INTEGER,
|
||||
receive_type INTEGER,
|
||||
background_id INTEGER,
|
||||
start_time TIMESTAMP WITH TIME ZONE,
|
||||
end_time TIMESTAMP WITH TIME ZONE,
|
||||
title TEXT,
|
||||
reward TEXT,
|
||||
link TEXT,
|
||||
code_prefix TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_categories (
|
||||
id SERIAL PRIMARY KEY,
|
||||
type INTEGER,
|
||||
title TEXT,
|
||||
description TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_category_links (
|
||||
id SERIAL PRIMARY KEY,
|
||||
campaign_id INTEGER REFERENCES public.campaigns(id) ON DELETE CASCADE,
|
||||
category_id INTEGER REFERENCES public.campaign_categories(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_rewards (
|
||||
id SERIAL PRIMARY KEY,
|
||||
campaign_id INTEGER REFERENCES public.campaigns(id) ON DELETE CASCADE,
|
||||
item_type INTEGER,
|
||||
quantity INTEGER,
|
||||
item_id INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_rewards_claimed (
|
||||
character_id INTEGER REFERENCES public.characters(id) ON DELETE CASCADE,
|
||||
reward_id INTEGER REFERENCES public.campaign_rewards(id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (character_id, reward_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_state (
|
||||
id SERIAL PRIMARY KEY,
|
||||
campaign_id INTEGER REFERENCES public.campaigns(id) ON DELETE CASCADE,
|
||||
character_id INTEGER REFERENCES public.characters(id) ON DELETE CASCADE,
|
||||
code TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_codes (
|
||||
code TEXT PRIMARY KEY,
|
||||
campaign_id INTEGER REFERENCES public.campaigns(id) ON DELETE CASCADE,
|
||||
multi BOOLEAN NOT NULL DEFAULT FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.campaign_quest (
|
||||
campaign_id INTEGER REFERENCES public.campaigns(id) ON DELETE CASCADE,
|
||||
character_id INTEGER REFERENCES public.characters(id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (campaign_id, character_id)
|
||||
);
|
||||
44
server/migrations/sql/0017_diva.sql
Normal file
44
server/migrations/sql/0017_diva.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
-- Diva Defense (United Defense) extended schema.
|
||||
-- Adds bead selection, per-bead point accumulation, interception points,
|
||||
-- and prize reward tables for personal and guild tracks.
|
||||
|
||||
-- Interception map data per guild (binary blob, existing column pattern).
|
||||
ALTER TABLE guilds ADD COLUMN IF NOT EXISTS interception_maps bytea;
|
||||
|
||||
-- Per-character interception points keyed by quest file ID.
|
||||
ALTER TABLE guild_characters ADD COLUMN IF NOT EXISTS interception_points jsonb NOT NULL DEFAULT '{}';
|
||||
|
||||
-- Prize reward table for personal and guild tracks.
|
||||
CREATE TABLE IF NOT EXISTS diva_prizes (
|
||||
id SERIAL PRIMARY KEY,
|
||||
type VARCHAR(10) NOT NULL CHECK (type IN ('personal', 'guild')),
|
||||
points_req INTEGER NOT NULL,
|
||||
item_type INTEGER NOT NULL,
|
||||
item_id INTEGER NOT NULL,
|
||||
quantity INTEGER NOT NULL,
|
||||
gr BOOLEAN NOT NULL DEFAULT false,
|
||||
repeatable BOOLEAN NOT NULL DEFAULT false
|
||||
);
|
||||
|
||||
-- Active bead types for the current Diva Defense event.
|
||||
CREATE TABLE IF NOT EXISTS diva_beads (
|
||||
id SERIAL PRIMARY KEY,
|
||||
type INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- Per-character bead slot assignments with expiry.
|
||||
CREATE TABLE IF NOT EXISTS diva_beads_assignment (
|
||||
id SERIAL PRIMARY KEY,
|
||||
character_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
bead_index INTEGER NOT NULL,
|
||||
expiry TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
|
||||
-- Per-character bead point accumulation log.
|
||||
CREATE TABLE IF NOT EXISTS diva_beads_points (
|
||||
id SERIAL PRIMARY KEY,
|
||||
character_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
bead_index INTEGER NOT NULL,
|
||||
points INTEGER NOT NULL,
|
||||
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
19
server/migrations/sql/0018_guild_invites.sql
Normal file
19
server/migrations/sql/0018_guild_invites.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Dedicated table for guild-initiated scout invitations, separate from
|
||||
-- player-initiated applications. This gives each invitation a real serial PK
|
||||
-- so the client's InvitationID field can map to an actual database row
|
||||
-- instead of being aliased to the character ID.
|
||||
CREATE TABLE IF NOT EXISTS guild_invites (
|
||||
id serial PRIMARY KEY,
|
||||
guild_id integer REFERENCES guilds(id),
|
||||
character_id integer REFERENCES characters(id),
|
||||
actor_id integer REFERENCES characters(id),
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- Migrate any existing scout invitations from guild_applications.
|
||||
INSERT INTO guild_invites (guild_id, character_id, actor_id, created_at)
|
||||
SELECT guild_id, character_id, actor_id, COALESCE(created_at, now())
|
||||
FROM guild_applications
|
||||
WHERE application_type = 'invited';
|
||||
|
||||
DELETE FROM guild_applications WHERE application_type = 'invited';
|
||||
6
server/migrations/sql/0019_save_transfer.sql
Normal file
6
server/migrations/sql/0019_save_transfer.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Save transfer tokens: one-time admin-granted permission for a character
|
||||
-- to receive an imported save via the API endpoint.
|
||||
-- NULL means no import is pending for this character.
|
||||
ALTER TABLE characters
|
||||
ADD COLUMN IF NOT EXISTS savedata_import_token TEXT,
|
||||
ADD COLUMN IF NOT EXISTS savedata_import_token_expiry TIMESTAMPTZ;
|
||||
1
server/migrations/sql/0020_return_guilds.sql
Normal file
1
server/migrations/sql/0020_return_guilds.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE public.guilds ADD COLUMN IF NOT EXISTS return_type SMALLINT NOT NULL DEFAULT 0;
|
||||
44
server/migrations/sql/0021_tournament.sql
Normal file
44
server/migrations/sql/0021_tournament.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
CREATE TABLE IF NOT EXISTS tournaments (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
start_time BIGINT NOT NULL,
|
||||
entry_end BIGINT NOT NULL,
|
||||
ranking_end BIGINT NOT NULL,
|
||||
reward_end BIGINT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tournament_cups (
|
||||
id SERIAL PRIMARY KEY,
|
||||
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
||||
cup_group SMALLINT NOT NULL,
|
||||
cup_type SMALLINT NOT NULL,
|
||||
unk SMALLINT NOT NULL DEFAULT 0,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
description TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tournament_sub_events (
|
||||
id SERIAL PRIMARY KEY,
|
||||
cup_group SMALLINT NOT NULL,
|
||||
event_sub_type SMALLINT NOT NULL DEFAULT 0,
|
||||
quest_file_id INTEGER NOT NULL DEFAULT 0,
|
||||
name VARCHAR(64) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tournament_entries (
|
||||
id SERIAL PRIMARY KEY,
|
||||
char_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
||||
registered_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
UNIQUE (char_id, tournament_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tournament_results (
|
||||
id SERIAL PRIMARY KEY,
|
||||
char_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
||||
event_id INTEGER NOT NULL,
|
||||
quest_slot INTEGER NOT NULL DEFAULT 0,
|
||||
stage_handle INTEGER NOT NULL DEFAULT 0,
|
||||
submitted_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
Reference in New Issue
Block a user