mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-07 07:14:22 +00:00
Add dashboard audit log and configuration management
- Implemented dashboard audit logging with InsertAuditLog, GetRecentAuditLogs, GetAuditLogsByIP, and CleanupOldAuditLogs methods. - Created dashboard configuration management with GetDashboardConfig and SetDashboardConfig methods. - Added new tables for dashboard_audit_log and dashboard_config in both MySQL and SQLite migrations. - Updated CMakeLists to include Crow and ASIO for dashboard server functionality. - Enhanced existing database classes to support new dashboard features, including character, play key, and property management. - Added new methods for retrieving and managing play keys, properties, and pet names. - Updated TestSQLDatabase to include stubs for new dashboard-related methods. - Modified shared and dashboard configuration files for new settings.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
enum class eGameMasterLevel : uint8_t;
|
||||
|
||||
@@ -38,7 +39,62 @@ public:
|
||||
// Update the GameMaster level of an account.
|
||||
virtual void UpdateAccountGmLevel(const uint32_t accountId, const eGameMasterLevel gmLevel) = 0;
|
||||
|
||||
// Set the play_key_id for an account (used during registration)
|
||||
virtual void UpdateAccountPlayKey(const uint32_t accountId, const uint32_t playKeyId) = 0;
|
||||
|
||||
// Get counts for dashboard/stats
|
||||
virtual uint32_t GetBannedAccountCount() = 0;
|
||||
virtual uint32_t GetLockedAccountCount() = 0;
|
||||
|
||||
virtual uint32_t GetAccountCount() = 0;
|
||||
|
||||
struct ListInfo {
|
||||
uint32_t id{};
|
||||
std::string name;
|
||||
eGameMasterLevel gm_level{};
|
||||
bool banned{};
|
||||
bool locked{};
|
||||
uint64_t mute_expire{};
|
||||
uint32_t play_key_id{};
|
||||
};
|
||||
|
||||
struct DetailedInfo {
|
||||
uint32_t id{};
|
||||
std::string name;
|
||||
std::string email;
|
||||
eGameMasterLevel gm_level{};
|
||||
bool banned{};
|
||||
bool locked{};
|
||||
uint64_t mute_expire{};
|
||||
uint32_t play_key_id{};
|
||||
uint64_t created_at{};
|
||||
};
|
||||
|
||||
struct SessionInfo {
|
||||
uint64_t sessionId{};
|
||||
std::string ipAddress;
|
||||
uint64_t loginTime{};
|
||||
uint64_t logoutTime{};
|
||||
bool active{};
|
||||
};
|
||||
|
||||
// Return all accounts for dashboard listing
|
||||
virtual std::vector<ListInfo> GetAllAccounts() = 0;
|
||||
|
||||
// Update an account's locked status
|
||||
virtual void UpdateAccountLock(const uint32_t accountId, const bool locked) = 0;
|
||||
|
||||
// Get detailed account info by ID (for dashboard viewing)
|
||||
virtual std::optional<DetailedInfo> GetAccountById(const uint32_t accountId) = 0;
|
||||
|
||||
// Update account email (for dashboard)
|
||||
virtual void UpdateAccountEmail(const uint32_t accountId, const std::string_view email) = 0;
|
||||
|
||||
// Delete account and all associated data
|
||||
virtual void DeleteAccount(const uint32_t accountId) = 0;
|
||||
|
||||
// Get account session history
|
||||
virtual std::vector<SessionInfo> GetAccountSessions(const uint32_t accountId, uint32_t limit = 50) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IACCOUNTS__H__
|
||||
|
||||
Reference in New Issue
Block a user