Files
DarkflameServer/migrations/dlu/mysql/51_server_operations.sql
Aaron Kimbrell e213a7aeff 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-28 22:30:43 -05:00

59 lines
2.8 KiB
SQL

/* Repeating in-game announcements scheduled on the dashboard. zones: comma separated zone IDs, '' for every world.
schedule: a cron expression or @every interval in UTC, as for scheduled tasks. starts_at/ends_at 0: no limit. */
CREATE TABLE IF NOT EXISTS scheduled_announcements (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL DEFAULT '',
message TEXT NOT NULL,
zones TEXT NOT NULL,
schedule VARCHAR(128) NOT NULL,
starts_at BIGINT NOT NULL DEFAULT 0,
ends_at BIGINT NOT NULL DEFAULT 0,
enabled TINYINT NOT NULL DEFAULT 1,
last_sent_at BIGINT NOT NULL DEFAULT 0,
sent_count INT UNSIGNED NOT NULL DEFAULT 0,
created_at BIGINT NOT NULL DEFAULT 0,
created_by VARCHAR(64) NOT NULL DEFAULT '',
updated_at BIGINT NOT NULL DEFAULT 0,
updated_by VARCHAR(64) NOT NULL DEFAULT ''
);
/* Events: a feature name (gatingOnFeature in the levels, FeatureGating in the client database) put in a free
event_N setting from starts_at to ends_at. state: 0 scheduled, 1 active, 2 ended, 3 cancelled, 4 missed (the
dashboard was down for all of it). slot: the N it used. previous_value/previous_web_wins: the slot's
sharedconfig.ini web value before, put back at the end. */
CREATE TABLE IF NOT EXISTS scheduled_events (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
feature VARCHAR(128) NOT NULL,
note TEXT NOT NULL,
starts_at BIGINT NOT NULL,
ends_at BIGINT NOT NULL,
state TINYINT NOT NULL DEFAULT 0,
slot TINYINT NOT NULL DEFAULT 0,
previous_value TEXT NULL DEFAULT NULL,
previous_web_wins TINYINT NOT NULL DEFAULT 0,
status TEXT NOT NULL,
created_at BIGINT NOT NULL DEFAULT 0,
created_by VARCHAR(64) NOT NULL DEFAULT '',
updated_at BIGINT NOT NULL DEFAULT 0,
updated_by VARCHAR(64) NOT NULL DEFAULT ''
);
/* Per-zone player caps and spare instances the master server applies to public instances of the zone. A NULL cap
uses the client's ZoneTable population_soft_cap / population_hard_cap. */
CREATE TABLE IF NOT EXISTS zone_limits (
zone_id INT UNSIGNED NOT NULL PRIMARY KEY,
soft_cap INT UNSIGNED NULL DEFAULT NULL,
hard_cap INT UNSIGNED NULL DEFAULT NULL,
spare_instances INT UNSIGNED NOT NULL DEFAULT 0,
updated_at BIGINT NOT NULL DEFAULT 0,
updated_by VARCHAR(64) NOT NULL DEFAULT ''
);
/* Players in each world instance, sampled with server_health once a minute and kept as long (health_days). */
CREATE TABLE IF NOT EXISTS server_health_instances (
time BIGINT NOT NULL,
zone_id INT UNSIGNED NOT NULL,
instance_id INT UNSIGNED NOT NULL,
clone_id INT UNSIGNED NOT NULL DEFAULT 0,
players INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (time, zone_id, instance_id),
INDEX server_health_instances_zone (zone_id, time)
);