mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-05 22:34:21 +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.
58 lines
1.8 KiB
C++
58 lines
1.8 KiB
C++
#ifndef __GAMEDATABASE__H__
|
|
#define __GAMEDATABASE__H__
|
|
|
|
#include <optional>
|
|
|
|
#include "ILeaderboard.h"
|
|
#include "IPlayerCheatDetections.h"
|
|
#include "ICommandLog.h"
|
|
#include "IMail.h"
|
|
#include "IObjectIdTracker.h"
|
|
#include "IPlayKeys.h"
|
|
#include "IServers.h"
|
|
#include "IBugReports.h"
|
|
#include "IPropertyContents.h"
|
|
#include "IProperty.h"
|
|
#include "IPetNames.h"
|
|
#include "ICharXml.h"
|
|
#include "IMigrationHistory.h"
|
|
#include "IUgc.h"
|
|
#include "IFriends.h"
|
|
#include "ICharInfo.h"
|
|
#include "IAccounts.h"
|
|
#include "IActivityLog.h"
|
|
#include "IIgnoreList.h"
|
|
#include "IAccountsRewardCodes.h"
|
|
#include "IBehaviors.h"
|
|
#include "IUgcModularBuild.h"
|
|
#include "IDashboardAuditLog.h"
|
|
#include "IDashboardConfig.h"
|
|
|
|
#ifdef _DEBUG
|
|
# define DLU_SQL_TRY_CATCH_RETHROW(x) do { try { x; } catch (std::exception& ex) { LOG("SQL Error: %s", ex.what()); throw; } } while(0)
|
|
#else
|
|
# define DLU_SQL_TRY_CATCH_RETHROW(x) x
|
|
#endif // _DEBUG
|
|
|
|
class GameDatabase :
|
|
public IPlayKeys, public ILeaderboard, public IObjectIdTracker, public IServers,
|
|
public IMail, public ICommandLog, public IPlayerCheatDetections, public IBugReports,
|
|
public IPropertyContents, public IProperty, public IPetNames, public ICharXml,
|
|
public IMigrationHistory, public IUgc, public IFriends, public ICharInfo,
|
|
public IAccounts, public IActivityLog, public IAccountsRewardCodes, public IIgnoreList,
|
|
public IBehaviors, public IUgcModularBuild,
|
|
public IDashboardAuditLog, public IDashboardConfig {
|
|
public:
|
|
virtual ~GameDatabase() = default;
|
|
// TODO: These should be made private.
|
|
virtual void Connect() = 0;
|
|
virtual void Destroy(std::string source = "") = 0;
|
|
virtual void ExecuteCustomQuery(const std::string_view query) = 0;
|
|
virtual void Commit() = 0;
|
|
virtual bool GetAutoCommit() = 0;
|
|
virtual void SetAutoCommit(bool value) = 0;
|
|
virtual void DeleteCharacter(const LWOOBJID characterId) = 0;
|
|
};
|
|
|
|
#endif //!__GAMEDATABASE__H__
|