mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-08 05:43:43 +00:00
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>
This commit is contained in:
@@ -26,7 +26,10 @@ namespace {
|
||||
"(SELECT COALESCE(MAX(id), 0) FROM audit_log) AS audit_log_max_id, "
|
||||
"(SELECT COALESCE(MAX(id), 0) FROM mail) AS mail_max_id, "
|
||||
"(SELECT COUNT(*) FROM economy_flags WHERE status = 0) AS open_economy_flags, "
|
||||
"(SELECT COALESCE(MAX(id), 0) FROM economy_flags) AS economy_flags_max_id;";
|
||||
"(SELECT COALESCE(MAX(id), 0) FROM economy_flags) AS economy_flags_max_id, "
|
||||
"(SELECT COUNT(*) FROM chat_flags WHERE status = 'open') AS open_chat_flags, "
|
||||
"(SELECT COALESCE(MAX(id), 0) FROM chat_flags) AS chat_flags_max_id, "
|
||||
"(SELECT COALESCE(MAX(updated_at), 0) FROM chat_flags) AS chat_flags_updated_at;";
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -264,6 +267,9 @@ IDashboardStats::Snapshot MySQLDatabase::GetDashboardSnapshot() {
|
||||
snapshot.mailMaxId = result->getUInt64("mail_max_id");
|
||||
snapshot.openEconomyFlags = result->getUInt64("open_economy_flags");
|
||||
snapshot.economyFlagsMaxId = result->getUInt64("economy_flags_max_id");
|
||||
snapshot.openChatFlags = result->getUInt64("open_chat_flags");
|
||||
snapshot.chatFlagsMaxId = result->getUInt64("chat_flags_max_id");
|
||||
snapshot.chatFlagsUpdatedAt = result->getUInt64("chat_flags_updated_at");
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user