Files
DarkflameServer/dDatabase/GameDatabase/ITables/IAccountNotes.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

38 lines
1.3 KiB
C++

#ifndef __IACCOUNTNOTES__H__
#define __IACCOUNTNOTES__H__
#include <cstdint>
#include <optional>
#include <string>
#include <vector>
/**
* An account's moderation history: notes and warnings staff write, and every ban, mute and lock with its reason.
* Also temporary bans: a ban with an end time is lifted at login (and by an hourly task) once it has passed.
*/
class IAccountNotes {
public:
struct AccountNote {
uint64_t id{};
uint32_t accountId{};
std::string kind; // note, warning, ban, unban, mute, unmute, lock, unlock
std::string text;
std::string actor;
int64_t createdAt{};
};
virtual void InsertAccountNote(const AccountNote& note) = 0;
virtual std::vector<AccountNote> GetAccountNotes(uint32_t accountId) = 0; // newest first
virtual std::optional<AccountNote> GetAccountNote(uint64_t id) = 0;
virtual void DeleteAccountNote(uint64_t id) = 0;
virtual uint32_t GetAccountWarningCount(uint32_t accountId) = 0;
// Ban or unban with an end time (0: permanent) and a reason shown to the player
virtual void SetAccountBan(uint32_t accountId, bool banned, int64_t expires, const std::string& reason) = 0;
// Unban every temporary ban that ended before `now`; returns their account ids
virtual std::vector<uint32_t> LiftExpiredBans(int64_t now) = 0;
};
#endif //!__IACCOUNTNOTES__H__