Files
DarkflameServer/dDatabase/GameDatabase/ITables/IDashboardStats.h
Aaron Kimbrell af54ca282f feat(db): chat log guild, team and filter result; chat flags
chat_log gets guild_id, team_id and filtered (migrations mysql 100, sqlite 83),
and the chat log queries take a time range, a guild, a team, a conversation
between two characters and paging back by id. Whispers are their own visibility
switch (includeWhispers), apart from team and guild chat (includePrivate).
Whisper partners and teams that talked are listed with counts.

chat_flags, chat_flag_messages and chat_flag_events (mysql 101, sqlite 84) hold
flagged chat with a copy of the messages around it, its status, note, linked
player report and history. Open flags are in the dashboard snapshot.

Tests on SQLite alone (dDatabaseSqliteTests) and in the MySQL parity tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:23:22 -05:00

41 lines
1.1 KiB
C++

#ifndef __IDASHBOARDSTATS__H__
#define __IDASHBOARDSTATS__H__
#include <cstdint>
class IDashboardStats {
public:
// Cheap aggregate values the dashboard compares between ticks to detect changes made by any writer
// (game servers, other tools). A table is considered changed when any of its values differ.
struct Snapshot {
uint64_t accounts{};
uint64_t accountsMaxId{};
uint64_t characters{};
uint64_t pendingNames{};
uint64_t properties{};
uint64_t pendingProperties{};
uint64_t playKeys{};
uint64_t bugReports{};
uint64_t unresolvedBugReports{};
uint64_t petNames{};
uint64_t pendingPetNames{};
uint64_t pendingGuildNames{}; // guilds whose name waits for moderation
uint64_t activityLogMaxId{};
uint64_t chatLogMaxId{};
uint64_t commandLogMaxId{};
uint64_t auditLogMaxId{};
uint64_t mailMaxId{};
uint64_t openEconomyFlags{};
uint64_t economyFlagsMaxId{};
uint64_t openChatFlags{};
uint64_t chatFlagsMaxId{};
uint64_t chatFlagsUpdatedAt{};
bool operator==(const Snapshot&) const = default;
};
virtual Snapshot GetDashboardSnapshot() = 0;
};
#endif //!__IDASHBOARDSTATS__H__