mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-08 07:44:23 +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:
@@ -198,3 +198,44 @@ std::optional<IProperty::Info> MySQLDatabase::GetPropertyInfo(const LWOOBJID id)
|
||||
|
||||
return ReadPropertyInfo(propertyEntry);
|
||||
}
|
||||
|
||||
std::vector<IProperty::Info> MySQLDatabase::GetAllProperties() {
|
||||
std::vector<IProperty::Info> out;
|
||||
auto res = ExecuteSelect(
|
||||
"SELECT id, owner_id, clone_id, name, description, privacy_option, rejection_reason, "
|
||||
"last_updated, time_claimed, reputation, mod_approved, performance_cost "
|
||||
"FROM properties ORDER BY id DESC;"
|
||||
);
|
||||
|
||||
while (res->next()) {
|
||||
out.push_back(ReadPropertyInfo(res));
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
std::vector<IProperty::Info> MySQLDatabase::GetPropertiesByApprovalStatus(uint32_t approved) {
|
||||
std::vector<IProperty::Info> out;
|
||||
auto res = ExecuteSelect(
|
||||
"SELECT id, owner_id, clone_id, name, description, privacy_option, rejection_reason, "
|
||||
"last_updated, time_claimed, reputation, mod_approved, performance_cost "
|
||||
"FROM properties WHERE mod_approved = ? ORDER BY id DESC;",
|
||||
approved
|
||||
);
|
||||
|
||||
while (res->next()) {
|
||||
out.push_back(ReadPropertyInfo(res));
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
uint32_t MySQLDatabase::GetPropertyCount() {
|
||||
auto res = ExecuteSelect("SELECT COUNT(*) as count FROM properties;");
|
||||
return res->next() ? res->getUInt("count") : 0;
|
||||
}
|
||||
|
||||
uint32_t MySQLDatabase::GetUnapprovedPropertyCount() {
|
||||
auto res = ExecuteSelect("SELECT COUNT(*) as count FROM properties WHERE mod_approved = 0;");
|
||||
return res->next() ? res->getUInt("count") : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user