mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-06 06:44:20 +00:00
- 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.
42 lines
1011 B
C++
42 lines
1011 B
C++
#ifndef __IACTIVITYLOG__H__
|
|
#define __IACTIVITYLOG__H__
|
|
|
|
#include <cstdint>
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
enum class eActivityType : uint32_t {
|
|
PlayerLoggedIn,
|
|
PlayerLoggedOut,
|
|
PlayerChangedZone
|
|
};
|
|
|
|
class IActivityLog {
|
|
public:
|
|
// Update the activity log for the given account.
|
|
virtual void UpdateActivityLog(const LWOOBJID characterId, const eActivityType activityType, const LWOMAPID mapId) = 0;
|
|
|
|
struct Entry {
|
|
LWOOBJID characterId{};
|
|
eActivityType activity{};
|
|
uint32_t timestamp{};
|
|
LWOMAPID mapId{};
|
|
};
|
|
|
|
// Retrieve recent activity entries ordered by time desc.
|
|
virtual std::vector<Entry> GetRecentActivity(const uint32_t limit) = 0;
|
|
|
|
// Get total count of activity log entries
|
|
virtual uint32_t GetActivityLogCount() = 0;
|
|
|
|
// Get paginated activity log entries with ordering
|
|
virtual std::vector<Entry> GetActivityLogPaginated(
|
|
uint32_t offset,
|
|
uint32_t limit,
|
|
const std::string& orderColumn = "time",
|
|
const std::string& orderDir = "DESC"
|
|
) = 0;
|
|
};
|
|
|
|
#endif //!__IACTIVITYLOG__H__
|