Files
DarkflameServer/migrations/dlu/mysql/63_live_events.sql
Aaron Kimbrell 2d1ef0e370 feat: web dashboard and playground work
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch:
accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy
reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live
events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved
captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes
they need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 09:33:10 -05:00

40 lines
1.8 KiB
SQL

/* Live events staff start from the dashboard (treasure hunts, bonus multipliers, invasions, celebrations). type names
the kind, config is its JSON settings. zones: comma separated zone IDs ('' for every world, bonus events only);
instance_id -1 for every instance of them. state: 0 running, 1 ended (time up or ended early), 2 cancelled. World
servers run each event in every matching instance and clean up after themselves at ends_at or when it is ended. */
CREATE TABLE IF NOT EXISTS live_events (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
type VARCHAR(32) NOT NULL,
title VARCHAR(100) NOT NULL DEFAULT '',
message TEXT NOT NULL,
zones TEXT NOT NULL,
instance_id INT NOT NULL DEFAULT -1,
config TEXT NOT NULL,
starts_at BIGINT NOT NULL,
ends_at BIGINT NOT NULL,
state TINYINT NOT NULL DEFAULT 0,
ended_at BIGINT NOT NULL DEFAULT 0,
end_reason VARCHAR(255) NOT NULL DEFAULT '',
created_by VARCHAR(64) NOT NULL DEFAULT '',
ended_by VARCHAR(64) NOT NULL DEFAULT '',
INDEX live_events_state (state)
);
/* What each world instance running an event last reported (JSON: spawned, found, kills, wave, ...). closed = 1 once
the instance stopped running it (event over or world shut down). */
CREATE TABLE IF NOT EXISTS live_event_instances (
event_id BIGINT UNSIGNED NOT NULL,
zone_id INT UNSIGNED NOT NULL,
instance_id INT UNSIGNED NOT NULL,
status TEXT NOT NULL,
updated_at BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (event_id, zone_id, instance_id)
);
/* Per character score in an event: treasures found, invaders smashed. */
CREATE TABLE IF NOT EXISTS live_event_scores (
event_id BIGINT UNSIGNED NOT NULL,
character_id BIGINT NOT NULL,
amount BIGINT NOT NULL DEFAULT 0,
updated_at BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (event_id, character_id)
);