mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
refactor: Database abstraction and organization of files (#1274)
* Database: Convert to proper namespace * Database: Use base class and getter * Database: Move files around * Database: Add property Management query Database: Move over user queries Tested at gm 0 that pre-approved names are pre-approved, unapproved need moderator approval deleting characters deletes the selcted one refreshing the character page shows the last character you logged in as tested all my characters show up when i login tested that you can delete all 4 characters and the correct character is selected each time tested renaming, approving names as gm0 Database: Add ugc model getter Hey it works, look I got around the mariadb issue. Database: Add queries Database: consolidate name query Database: Add friends list query Update name of approved names query Documentation Database: Add name check Database: Add BFF Query Database: Move BFF Setter Database: Move new friend query Database: Add remove friend queries Database: Add activity log Database: Add ugc & prop content removal Database: Add model update Database: Add migration queries Database: Add character and xml queries Database: Add user queries Untested, but compiling code Need to test that new character names are properly assigned in the following scenarios gm 0 and pre-approved name gm 0 and unapproved name gm 9 and pre-approved name gm 9 and unapproved name Database: constify function arguments Database: Add pet queries * Database: Move property model queries Untested. Need to test placing a new model moving existing one removing ugc model placing ugc model moving ugc model(?) changing privacy option variously change description and name approve property can properly travel to property * Property: Move stale reference deletion * Database: Move performance update query * Database: Add bug report query * Database: Add cheat detection query * Database: Add mail send query * Untested code need to test mailing from slash command, from all users of SendMail, getting bbb of a property and sending messages to bffs * Update CDComponentsRegistryTable.h Database: Rename and add further comments Datavbase: Add comments Add some comments Build: Fix PCH directories Database: Fix time thanks apple Database: Fix compiler warnings Overload destructor Define specialty for time_t Use string instead of string_view for temp empty string Update CDTable.h Property: Update queries to use mapId Database: Reorganize Reorganize into CDClient folder and GameDatabase folder for clearer meanings and file structure Folders: Rename to GameDatabase MySQL: Remove MySQL Specifier from table Database: Move Tables to Interfaces Database: Reorder functions in header Database: Simplify property queries Database: Remove unused queries Remove extra query definitions as well Database: Consolidate User getters Database: Comment logs Update MySQLDatabase.cpp Database: Use generic code Playkey: Fix bad optional access Database: Move stuff around WorldServer: Update queries Ugc reduced by many scopes use new queries very fast tested that ugc still loads Database: Add auth queries I tested that only the correct password can sign into an account. Tested that disabled playkeys do not allow the user to play the game Database: Add donation query Database: add objectId queries Database: Add master queries Database: Fix mis-named function Database: Add slash command queries Mail: Fix itemId type CharFilter: Use new query ObjectID: Remove duplicate code SlashCommand: Update query with function Database: Add mail queries Ugc: Fix issues with saving models Resolve large scope blocks as well * Database: Add debug try catch rethrow macro * General fixes * fix play key not working * Further fixes --------- Co-authored-by: Aaron Kimbre <aronwk.aaron@gmail.com>
This commit is contained in:
37
dDatabase/GameDatabase/ITables/IAccounts.h
Normal file
37
dDatabase/GameDatabase/ITables/IAccounts.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef __IACCOUNTS__H__
|
||||
#define __IACCOUNTS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
|
||||
enum class eGameMasterLevel : uint8_t;
|
||||
|
||||
class IAccounts {
|
||||
public:
|
||||
struct Info {
|
||||
std::string bcryptPassword;
|
||||
uint32_t id{};
|
||||
uint32_t playKeyId{};
|
||||
bool banned{};
|
||||
bool locked{};
|
||||
eGameMasterLevel maxGmLevel{};
|
||||
};
|
||||
|
||||
// Get the account info for the given username.
|
||||
virtual std::optional<IAccounts::Info> GetAccountInfo(const std::string_view username) = 0;
|
||||
|
||||
// Update the account's unmute time.
|
||||
virtual void UpdateAccountUnmuteTime(const uint32_t accountId, const uint64_t timeToUnmute) = 0;
|
||||
|
||||
// Update the account's ban status.
|
||||
virtual void UpdateAccountBan(const uint32_t accountId, const bool banned) = 0;
|
||||
|
||||
// Update the account's password.
|
||||
virtual void UpdateAccountPassword(const uint32_t accountId, const std::string_view bcryptpassword) = 0;
|
||||
|
||||
// Add a new account to the database.
|
||||
virtual void InsertNewAccount(const std::string_view username, const std::string_view bcryptpassword) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IACCOUNTS__H__
|
19
dDatabase/GameDatabase/ITables/IActivityLog.h
Normal file
19
dDatabase/GameDatabase/ITables/IActivityLog.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef __IACTIVITYLOG__H__
|
||||
#define __IACTIVITYLOG__H__
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "dCommonVars.h"
|
||||
|
||||
enum class eActivityType : uint32_t {
|
||||
PlayerLoggedIn,
|
||||
PlayerLoggedOut,
|
||||
};
|
||||
|
||||
class IActivityLog {
|
||||
public:
|
||||
// Update the activity log for the given account.
|
||||
virtual void UpdateActivityLog(const uint32_t characterId, const eActivityType activityType, const LWOMAPID mapId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IACTIVITYLOG__H__
|
20
dDatabase/GameDatabase/ITables/IBugReports.h
Normal file
20
dDatabase/GameDatabase/ITables/IBugReports.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __IBUGREPORTS__H__
|
||||
#define __IBUGREPORTS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
class IBugReports {
|
||||
public:
|
||||
struct Info {
|
||||
std::string body;
|
||||
std::string clientVersion;
|
||||
std::string otherPlayer;
|
||||
std::string selection;
|
||||
uint32_t characterId{};
|
||||
};
|
||||
|
||||
// Add a new bug report to the database.
|
||||
virtual void InsertNewBugReport(const Info& info) = 0;
|
||||
};
|
||||
#endif //!__IBUGREPORTS__H__
|
49
dDatabase/GameDatabase/ITables/ICharInfo.h
Normal file
49
dDatabase/GameDatabase/ITables/ICharInfo.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef __ICHARINFO__H__
|
||||
#define __ICHARINFO__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "ePermissionMap.h"
|
||||
|
||||
class ICharInfo {
|
||||
public:
|
||||
struct Info {
|
||||
std::string name;
|
||||
std::string pendingName;
|
||||
uint32_t id{};
|
||||
uint32_t accountId{};
|
||||
bool needsRename{};
|
||||
LWOCLONEID cloneId{};
|
||||
ePermissionMap permissionMap{};
|
||||
};
|
||||
|
||||
// Get the approved names of all characters.
|
||||
virtual std::vector<std::string> GetApprovedCharacterNames() = 0;
|
||||
|
||||
// Get the character info for the given character id.
|
||||
virtual std::optional<ICharInfo::Info> GetCharacterInfo(const uint32_t charId) = 0;
|
||||
|
||||
// Get the character info for the given character name.
|
||||
virtual std::optional<ICharInfo::Info> GetCharacterInfo(const std::string_view name) = 0;
|
||||
|
||||
// Get the character ids for the given account.
|
||||
virtual std::vector<uint32_t> GetAccountCharacterIds(const uint32_t accountId) = 0;
|
||||
|
||||
// Insert a new character into the database.
|
||||
virtual void InsertNewCharacter(const ICharInfo::Info info) = 0;
|
||||
|
||||
// Set the name of the given character.
|
||||
virtual void SetCharacterName(const uint32_t characterId, const std::string_view name) = 0;
|
||||
|
||||
// Set the pending name of the given character.
|
||||
virtual void SetPendingCharacterName(const uint32_t characterId, const std::string_view name) = 0;
|
||||
|
||||
// Updates the given character ids last login to be right now.
|
||||
virtual void UpdateLastLoggedInCharacter(const uint32_t characterId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__ICHARINFO__H__
|
20
dDatabase/GameDatabase/ITables/ICharXml.h
Normal file
20
dDatabase/GameDatabase/ITables/ICharXml.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __ICHARXML__H__
|
||||
#define __ICHARXML__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
class ICharXml {
|
||||
public:
|
||||
// Get the character xml for the given character id.
|
||||
virtual std::string GetCharacterXml(const uint32_t charId) = 0;
|
||||
|
||||
// Update the character xml for the given character id.
|
||||
virtual void UpdateCharacterXml(const uint32_t charId, const std::string_view lxfml) = 0;
|
||||
|
||||
// Insert the character xml for the given character id.
|
||||
virtual void InsertCharacterXml(const uint32_t characterId, const std::string_view lxfml) = 0;
|
||||
};
|
||||
|
||||
#endif //!__ICHARXML__H__
|
14
dDatabase/GameDatabase/ITables/ICommandLog.h
Normal file
14
dDatabase/GameDatabase/ITables/ICommandLog.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __ICOMMANDLOG__H__
|
||||
#define __ICOMMANDLOG__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
class ICommandLog {
|
||||
public:
|
||||
|
||||
// Insert a new slash command log entry.
|
||||
virtual void InsertSlashCommandUsage(const uint32_t characterId, const std::string_view command) = 0;
|
||||
};
|
||||
|
||||
#endif //!__ICOMMANDLOG__H__
|
32
dDatabase/GameDatabase/ITables/IFriends.h
Normal file
32
dDatabase/GameDatabase/ITables/IFriends.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef __IFRIENDS__H__
|
||||
#define __IFRIENDS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
class IFriends {
|
||||
public:
|
||||
struct BestFriendStatus {
|
||||
uint32_t playerCharacterId{};
|
||||
uint32_t friendCharacterId{};
|
||||
uint32_t bestFriendStatus{};
|
||||
};
|
||||
|
||||
// Get the friends list for the given character id.
|
||||
virtual std::vector<FriendData> GetFriendsList(const uint32_t charId) = 0;
|
||||
|
||||
// Get the best friend status for the given player and friend character ids.
|
||||
virtual std::optional<IFriends::BestFriendStatus> GetBestFriendStatus(const uint32_t playerCharacterId, const uint32_t friendCharacterId) = 0;
|
||||
|
||||
// Set the best friend status for the given player and friend character ids.
|
||||
virtual void SetBestFriendStatus(const uint32_t playerCharacterId, const uint32_t friendCharacterId, const uint32_t bestFriendStatus) = 0;
|
||||
|
||||
// Add a friend to the given character id.
|
||||
virtual void AddFriend(const uint32_t playerCharacterId, const uint32_t friendCharacterId) = 0;
|
||||
|
||||
// Remove a friend from the given character id.
|
||||
virtual void RemoveFriend(const uint32_t playerCharacterId, const uint32_t friendCharacterId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IFRIENDS__H__
|
14
dDatabase/GameDatabase/ITables/ILeaderboard.h
Normal file
14
dDatabase/GameDatabase/ITables/ILeaderboard.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __ILEADERBOARD__H__
|
||||
#define __ILEADERBOARD__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class ILeaderboard {
|
||||
public:
|
||||
|
||||
// Get the donation total for the given activity id.
|
||||
virtual std::optional<uint32_t> GetDonationTotal(const uint32_t activityId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__ILEADERBOARD__H__
|
54
dDatabase/GameDatabase/ITables/IMail.h
Normal file
54
dDatabase/GameDatabase/ITables/IMail.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef __IMAIL__H__
|
||||
#define __IMAIL__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
|
||||
#include "dCommonVars.h"
|
||||
#include "NiQuaternion.h"
|
||||
#include "NiPoint3.h"
|
||||
|
||||
class IMail {
|
||||
public:
|
||||
struct MailInfo {
|
||||
std::string senderUsername;
|
||||
std::string recipient;
|
||||
std::string subject;
|
||||
std::string body;
|
||||
uint64_t id{};
|
||||
uint32_t senderId{};
|
||||
uint32_t receiverId{};
|
||||
uint64_t timeSent{};
|
||||
bool wasRead{};
|
||||
struct {
|
||||
LWOOBJID itemID{};
|
||||
int32_t itemCount{};
|
||||
LOT itemLOT{};
|
||||
LWOOBJID itemSubkey{};
|
||||
};
|
||||
};
|
||||
|
||||
// Insert a new mail into the database.
|
||||
virtual void InsertNewMail(const MailInfo& mail) = 0;
|
||||
|
||||
// Get the mail for the given character id.
|
||||
virtual std::vector<MailInfo> GetMailForPlayer(const uint32_t characterId, const uint32_t numberOfMail) = 0;
|
||||
|
||||
// Get the mail for the given mail id.
|
||||
virtual std::optional<MailInfo> GetMail(const uint64_t mailId) = 0;
|
||||
|
||||
// Get the number of unread mail for the given character id.
|
||||
virtual uint32_t GetUnreadMailCount(const uint32_t characterId) = 0;
|
||||
|
||||
// Mark the given mail as read.
|
||||
virtual void MarkMailRead(const uint64_t mailId) = 0;
|
||||
|
||||
// Claim the item from the given mail.
|
||||
virtual void ClaimMailItem(const uint64_t mailId) = 0;
|
||||
|
||||
// Delete the given mail.
|
||||
virtual void DeleteMail(const uint64_t mailId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IMAIL__H__
|
17
dDatabase/GameDatabase/ITables/IMigrationHistory.h
Normal file
17
dDatabase/GameDatabase/ITables/IMigrationHistory.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef __IMIGRATIONHISTORY__H__
|
||||
#define __IMIGRATIONHISTORY__H__
|
||||
|
||||
#include <string_view>
|
||||
|
||||
class IMigrationHistory {
|
||||
public:
|
||||
// Create the migration history table.
|
||||
virtual void CreateMigrationHistoryTable() = 0;
|
||||
|
||||
// Check if the given migration has been run.
|
||||
virtual bool IsMigrationRun(const std::string_view str) = 0;
|
||||
|
||||
// Insert the given migration into the migration history table.
|
||||
virtual void InsertMigration(const std::string_view str) = 0;
|
||||
};
|
||||
#endif //!__IMIGRATIONHISTORY__H__
|
19
dDatabase/GameDatabase/ITables/IObjectIdTracker.h
Normal file
19
dDatabase/GameDatabase/ITables/IObjectIdTracker.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef __IOBJECTIDTRACKER__H__
|
||||
#define __IOBJECTIDTRACKER__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IObjectIdTracker {
|
||||
public:
|
||||
// Get the current persistent id.
|
||||
virtual std::optional<uint32_t> GetCurrentPersistentId() = 0;
|
||||
|
||||
// Insert the default persistent id.
|
||||
virtual void InsertDefaultPersistentId() = 0;
|
||||
|
||||
// Update the persistent id.
|
||||
virtual void UpdatePersistentId(const uint32_t newId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IOBJECTIDTRACKER__H__
|
21
dDatabase/GameDatabase/ITables/IPetNames.h
Normal file
21
dDatabase/GameDatabase/ITables/IPetNames.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef __IPETNAMES__H__
|
||||
#define __IPETNAMES__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IPetNames {
|
||||
public:
|
||||
struct Info {
|
||||
std::string petName;
|
||||
int32_t approvalStatus{};
|
||||
};
|
||||
|
||||
// Set the pet name moderation status for the given pet id.
|
||||
virtual void SetPetNameModerationStatus(const LWOOBJID& petId, const IPetNames::Info& info) = 0;
|
||||
|
||||
// Get pet info for the given pet id.
|
||||
virtual std::optional<IPetNames::Info> GetPetNameInfo(const LWOOBJID& petId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IPETNAMES__H__
|
15
dDatabase/GameDatabase/ITables/IPlayKeys.h
Normal file
15
dDatabase/GameDatabase/ITables/IPlayKeys.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef __IPLAYKEYS__H__
|
||||
#define __IPLAYKEYS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IPlayKeys {
|
||||
public:
|
||||
// Get the playkey id for the given playkey.
|
||||
// Optional of bool may seem pointless, however the optional indicates if the playkey exists
|
||||
// and the bool indicates if the playkey is active.
|
||||
virtual std::optional<bool> IsPlaykeyActive(const int32_t playkeyId) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IPLAYKEYS__H__
|
20
dDatabase/GameDatabase/ITables/IPlayerCheatDetections.h
Normal file
20
dDatabase/GameDatabase/ITables/IPlayerCheatDetections.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __IPLAYERCHEATDETECTIONS__H__
|
||||
#define __IPLAYERCHEATDETECTIONS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IPlayerCheatDetections {
|
||||
public:
|
||||
struct Info {
|
||||
std::optional<uint32_t> userId = std::nullopt;
|
||||
std::string username;
|
||||
std::string systemAddress;
|
||||
std::string extraMessage;
|
||||
};
|
||||
|
||||
// Insert a new cheat detection.
|
||||
virtual void InsertCheatDetection(const IPlayerCheatDetections::Info& info) = 0;
|
||||
};
|
||||
|
||||
#endif //!__IPLAYERCHEATDETECTIONS__H__
|
38
dDatabase/GameDatabase/ITables/IProperty.h
Normal file
38
dDatabase/GameDatabase/ITables/IProperty.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __IPROPERTY__H__
|
||||
#define __IPROPERTY__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IProperty {
|
||||
public:
|
||||
struct Info {
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string rejectionReason;
|
||||
LWOOBJID id{};
|
||||
uint32_t ownerId{};
|
||||
LWOCLONEID cloneId{};
|
||||
int32_t privacyOption{};
|
||||
uint32_t modApproved{};
|
||||
uint32_t lastUpdatedTime{};
|
||||
uint32_t claimedTime{};
|
||||
uint32_t reputation{};
|
||||
};
|
||||
|
||||
// Get the property info for the given property id.
|
||||
virtual std::optional<IProperty::Info> GetPropertyInfo(const LWOMAPID mapId, const LWOCLONEID cloneId) = 0;
|
||||
|
||||
// Update the property moderation info for the given property id.
|
||||
virtual void UpdatePropertyModerationInfo(const IProperty::Info& info) = 0;
|
||||
|
||||
// Update the property details for the given property id.
|
||||
virtual void UpdatePropertyDetails(const IProperty::Info& info) = 0;
|
||||
|
||||
// Update the property performance cost for the given property id.
|
||||
virtual void UpdatePerformanceCost(const LWOZONEID& zoneId, const float performanceCost) = 0;
|
||||
|
||||
// Insert a new property into the database.
|
||||
virtual void InsertNewProperty(const IProperty::Info& info, const uint32_t templateId, const LWOZONEID& zoneId) = 0;
|
||||
};
|
||||
#endif //!__IPROPERTY__H__
|
40
dDatabase/GameDatabase/ITables/IPropertyContents.h
Normal file
40
dDatabase/GameDatabase/ITables/IPropertyContents.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef __IPROPERTIESCONTENTS__H__
|
||||
#define __IPROPERTIESCONTENTS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
class IPropertyContents {
|
||||
public:
|
||||
struct Model {
|
||||
inline bool operator==(const LWOOBJID& other) const noexcept {
|
||||
return id == other;
|
||||
}
|
||||
|
||||
NiPoint3 position;
|
||||
NiQuaternion rotation;
|
||||
LWOOBJID id{};
|
||||
LOT lot{};
|
||||
uint32_t ugcId{};
|
||||
};
|
||||
|
||||
// Inserts a new UGC model into the database.
|
||||
virtual void InsertNewUgcModel(
|
||||
std::istringstream& sd0Data,
|
||||
const uint32_t blueprintId,
|
||||
const uint32_t accountId,
|
||||
const uint32_t characterId) = 0;
|
||||
|
||||
// Get the property models for the given property id.
|
||||
virtual std::vector<IPropertyContents::Model> GetPropertyModels(const LWOOBJID& propertyId) = 0;
|
||||
|
||||
// Insert a new property model into the database.
|
||||
virtual void InsertNewPropertyModel(const LWOOBJID& propertyId, const IPropertyContents::Model& model, const std::string_view name) = 0;
|
||||
|
||||
// Update the model position and rotation for the given property id.
|
||||
virtual void UpdateModelPositionRotation(const LWOOBJID& propertyId, const NiPoint3& position, const NiQuaternion& rotation) = 0;
|
||||
|
||||
// Remove the model for the given property id.
|
||||
virtual void RemoveModel(const LWOOBJID& modelId) = 0;
|
||||
};
|
||||
#endif //!__IPROPERTIESCONTENTS__H__
|
21
dDatabase/GameDatabase/ITables/IServers.h
Normal file
21
dDatabase/GameDatabase/ITables/IServers.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef __ISERVERS__H__
|
||||
#define __ISERVERS__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class IServers {
|
||||
public:
|
||||
struct MasterInfo {
|
||||
std::string ip;
|
||||
uint32_t port{};
|
||||
};
|
||||
|
||||
// Set the master server ip and port.
|
||||
virtual void SetMasterIp(const std::string_view ip, const uint32_t port) = 0;
|
||||
|
||||
// Get the master server info.
|
||||
virtual std::optional<MasterInfo> GetMasterInfo() = 0;
|
||||
};
|
||||
|
||||
#endif //!__ISERVERS__H__
|
32
dDatabase/GameDatabase/ITables/IUgc.h
Normal file
32
dDatabase/GameDatabase/ITables/IUgc.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef __IUGC__H__
|
||||
#define __IUGC__H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <sstream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
class IUgc {
|
||||
public:
|
||||
struct Model {
|
||||
std::stringstream lxfmlData;
|
||||
LWOOBJID id{};
|
||||
};
|
||||
|
||||
// Gets all UGC models for the given property id.
|
||||
virtual std::vector<IUgc::Model> GetUgcModels(const LWOOBJID& propertyId) = 0;
|
||||
|
||||
// Gets all Ugcs models.
|
||||
virtual std::vector<IUgc::Model> GetAllUgcModels() = 0;
|
||||
|
||||
// Removes ugc models that are not referenced by any property.
|
||||
virtual void RemoveUnreferencedUgcModels() = 0;
|
||||
|
||||
// Deletes the ugc model for the given model id.
|
||||
virtual void DeleteUgcModelData(const LWOOBJID& modelId) = 0;
|
||||
|
||||
// Inserts a new UGC model into the database.
|
||||
virtual void UpdateUgcModelData(const LWOOBJID& modelId, std::istringstream& lxfml) = 0;
|
||||
};
|
||||
#endif //!__IUGC__H__
|
Reference in New Issue
Block a user