Files
DarkflameServer/dDashboardServer/routes/WSRoutes.h
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

30 lines
1.2 KiB
C++

#pragma once
#include <cstdint>
#include <string>
/**
* Live updates pushed to dashboard browsers over WebSocket.
*
* Topics (each gated by GM level at subscribe and send time):
* - dashboard_update (GM 0): server status, online players and totals
* - table_changed (GM 1): {table, id?} - a table's contents changed, clients refetch through the API
* - moderation_counts (GM 3): sizes of the moderation queues for sidebar badges
*
* table_changed never carries row data, so a client only ever sees data it can fetch with its own permissions.
*/
void RegisterWSRoutes();
// Called periodically from the main loop. Pushes server status and detects changes made outside the
// dashboard (game servers, other tools) by diffing a cheap database snapshot.
void BroadcastDashboardUpdate();
// Notify clients that a table changed. id is optional and lets detail pages refresh only when relevant.
void BroadcastTableChanged(const std::string& table, const std::string& id = "");
struct DataChanged;
// Rows a game server just wrote (DATA_CHANGED from a world, via master), pushed on as table_changed events.
// Only known table names are passed on.
void BroadcastDataChanged(const DataChanged& changed);