Files
DarkflameServer/migrations/dlu/mysql/73_message_capture_sessions.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

54 lines
2.6 KiB
SQL

/* Saved game message inspector captures (see dDashboardServer/routes/Inspector.h). One row per capture, written when it
starts and kept up to date while it runs; ended_at is 0 until it ends. only_messages / skip_messages: the capture's
message ID filters, comma separated. zones: the worlds it was captured in, in order, as zone:instance:clone separated by
spaces. byte_count: bytes stored for its messages (raw bytes plus decoded fields). The Message capture pruning task
deletes old sessions (inspector_session_days, inspector_max_mb). */
CREATE TABLE IF NOT EXISTS message_capture_sessions (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
character_id BIGINT NOT NULL,
character_name VARCHAR(64) NOT NULL DEFAULT '',
account_id INT UNSIGNED NOT NULL DEFAULT 0,
account_name VARCHAR(64) NOT NULL DEFAULT '',
started_by_id INT UNSIGNED NOT NULL DEFAULT 0,
started_by VARCHAR(64) NOT NULL DEFAULT '',
started_at BIGINT NOT NULL DEFAULT 0,
ends_at BIGINT NOT NULL DEFAULT 0,
ended_at BIGINT NOT NULL DEFAULT 0,
end_reason VARCHAR(255) NOT NULL DEFAULT '',
to_server TINYINT NOT NULL DEFAULT 1,
to_client TINYINT NOT NULL DEFAULT 1,
only_messages TEXT NOT NULL,
skip_messages TEXT NOT NULL,
zone_id INT UNSIGNED NOT NULL DEFAULT 0,
instance_id INT UNSIGNED NOT NULL DEFAULT 0,
clone_id INT UNSIGNED NOT NULL DEFAULT 0,
zones TEXT NOT NULL,
message_count BIGINT UNSIGNED NOT NULL DEFAULT 0,
byte_count BIGINT UNSIGNED NOT NULL DEFAULT 0,
dropped BIGINT UNSIGNED NOT NULL DEFAULT 0,
INDEX message_capture_sessions_character (character_id),
INDEX message_capture_sessions_account (account_id),
INDEX message_capture_sessions_started (started_at)
);
/* The messages of a saved capture. seq: the dashboard's number for the message in its session, from 1.
dropped_before: messages the world left out just before this one (too many at once). direction: 0 sent by the client,
1 sent to it. payload: the message's bytes after the object and message ID (at most 2 KB; bits is its full size).
decoded: its fields as JSON when the world server had a typed struct for it, else empty. */
CREATE TABLE IF NOT EXISTS message_capture_entries (
session_id BIGINT UNSIGNED NOT NULL,
seq INT UNSIGNED NOT NULL,
time_ms BIGINT NOT NULL,
direction TINYINT UNSIGNED NOT NULL,
message_id SMALLINT UNSIGNED NOT NULL,
object_id BIGINT NOT NULL,
bits INT UNSIGNED NOT NULL,
dropped_before INT UNSIGNED NOT NULL DEFAULT 0,
zone_id INT UNSIGNED NOT NULL DEFAULT 0,
instance_id INT UNSIGNED NOT NULL DEFAULT 0,
clone_id INT UNSIGNED NOT NULL DEFAULT 0,
payload BLOB NOT NULL,
decoded TEXT NOT NULL,
PRIMARY KEY (session_id, seq)
);