From 5e3c869141a01b02a1925181fc007f7153470c00 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Wed, 5 Jun 2024 02:39:36 -0500 Subject: [PATCH 1/8] WIP --- .../dEnums/eDeletionRestrictionsCheckType.h | 16 ++++++ .../CDClientDatabase/CDClientManager.cpp | 3 ++ .../CDDeletionRestrictionsTable.cpp | 53 +++++++++++++++++++ .../CDDeletionRestrictionsTable.h | 18 +++++++ .../CDClientTables/CDItemComponentTable.h | 2 +- 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 dCommon/dEnums/eDeletionRestrictionsCheckType.h create mode 100644 dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp create mode 100644 dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h diff --git a/dCommon/dEnums/eDeletionRestrictionsCheckType.h b/dCommon/dEnums/eDeletionRestrictionsCheckType.h new file mode 100644 index 000000000..adda09aa0 --- /dev/null +++ b/dCommon/dEnums/eDeletionRestrictionsCheckType.h @@ -0,0 +1,16 @@ +#ifndef __EDELETIONRESTRICTIONSCHECKTYPE__H__ +#define __EDELETIONRESTRICTIONSCHECKTYPE__H__ + +#include + +enum class eDeletionRestrictionsCheckType : uint32_t { + INCLUDE_LOTS, + EXCLUDE_LOTS, + ANY_OF_THESE, + ALL_OF_THESE, + ZONE, + RESTRICTED, + MAX +}; + +#endif //!__EDELETIONRESTRICTIONSCHECKTYPE__H__ diff --git a/dDatabase/CDClientDatabase/CDClientManager.cpp b/dDatabase/CDClientDatabase/CDClientManager.cpp index 6ecfb0ad0..e1802d267 100644 --- a/dDatabase/CDClientDatabase/CDClientManager.cpp +++ b/dDatabase/CDClientDatabase/CDClientManager.cpp @@ -41,6 +41,7 @@ #include "CDRailActivatorComponent.h" #include "CDRewardCodesTable.h" #include "CDPetComponentTable.h" +#include "CDDeletionRestrictionsTable.h" #ifndef CDCLIENT_CACHE_ALL // Uncomment this to cache the full cdclient database into memory. This will make the server load faster, but will use more memory. @@ -103,6 +104,7 @@ DEFINE_TABLE_STORAGE(CDSkillBehaviorTable); DEFINE_TABLE_STORAGE(CDTamingBuildPuzzleTable); DEFINE_TABLE_STORAGE(CDVendorComponentTable); DEFINE_TABLE_STORAGE(CDZoneTableTable); +DEFINE_TABLE_STORAGE(CDDeletionRestrictionsTable) void CDClientManager::LoadValuesFromDatabase() { if (!CDClientDatabase::isConnected) { @@ -150,6 +152,7 @@ void CDClientManager::LoadValuesFromDatabase() { CDTamingBuildPuzzleTable::Instance().LoadValuesFromDatabase(); CDVendorComponentTable::Instance().LoadValuesFromDatabase(); CDZoneTableTable::Instance().LoadValuesFromDatabase(); + CDDeletionRestrictionsTable::Instance().LoadValuesFromDatabase(); } void CDClientManager::LoadValuesFromDefaults() { diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp new file mode 100644 index 000000000..8cdc9ec86 --- /dev/null +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -0,0 +1,53 @@ +#include "CDDeletionRestrictionsTable.h" +#include "GeneralUtils.h" + +//! Constructor +void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { + + // First, get the size of the table + uint32_t size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + + tableSize.nextRow(); + } + + tableSize.finalize(); + + // Reserve the size + auto& entries = GetEntriesMutable(); + entries.reserve(size); + + // Now get the data + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DeletionRestrictions"); + while (!tableData.eof()) { + CDDeletionRestrictions entry; + entry.id = tableData.getIntField("id", -1); + if (entry.id == -1) continue; + entry.restricted = tableData.getIntField("restricted", -1); + const std::string raw_ids = tableData.getStringField("ids", ""); + if (!raw_ids.empty()) { + for (const auto& idstr : GeneralUtils::SplitString(raw_ids, ',')) { + if (!idstr.empty()) { + const auto id = GeneralUtils::TryParse(idstr).value_or(-1); + if (id != -1) entry.ids.push_back(id); + } + } + } + entry.checkType = static_cast(tableData.getIntField("checkType", 6)); + + entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +std::vector CDDeletionRestrictionsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(GetEntries()) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h new file mode 100644 index 000000000..718e7bab8 --- /dev/null +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h @@ -0,0 +1,18 @@ +#pragma once + +#include "CDTable.h" + +enum class eDeletionRestrictionsCheckType : uint32_t; + +struct CDDeletionRestrictions { + uint32_t id; + bool restricted; + std::vector ids; + eDeletionRestrictionsCheckType checkType; +}; + +class CDDeletionRestrictionsTable : public CDTable> { +public: + void LoadValuesFromDatabase(); + std::vector Query(std::function predicate); +}; diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDItemComponentTable.h b/dDatabase/CDClientDatabase/CDClientTables/CDItemComponentTable.h index 60a3e4129..58bee024a 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDItemComponentTable.h +++ b/dDatabase/CDClientDatabase/CDClientTables/CDItemComponentTable.h @@ -33,7 +33,7 @@ struct CDItemComponent { uint32_t itemRating; //!< ??? bool isTwoHanded; //!< Whether or not the item is double handed uint32_t minNumRequired; //!< Maybe the minimum number required for a mission, or to own this object? - uint32_t delResIndex; //!< ??? + uint32_t delResIndex; //!< Relates to DeletionRestrictions Table uint32_t currencyLOT; //!< ??? uint32_t altCurrencyCost; //!< ??? std::string subItems; //!< A comma seperate string of sub items (maybe for multi-itemed things like faction test gear set) From 5ba37ff7d626acf5897f5aba2dbb05605c76a9e3 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Thu, 6 Jun 2024 08:50:00 -0500 Subject: [PATCH 2/8] fix compiling --- dCommon/dEnums/eDeletionRestrictionsCheckType.h | 4 ++-- .../CDClientTables/CDDeletionRestrictionsTable.cpp | 2 +- dDatabase/CDClientDatabase/CDClientTables/CMakeLists.txt | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dCommon/dEnums/eDeletionRestrictionsCheckType.h b/dCommon/dEnums/eDeletionRestrictionsCheckType.h index adda09aa0..af4f18ea6 100644 --- a/dCommon/dEnums/eDeletionRestrictionsCheckType.h +++ b/dCommon/dEnums/eDeletionRestrictionsCheckType.h @@ -8,8 +8,8 @@ enum class eDeletionRestrictionsCheckType : uint32_t { EXCLUDE_LOTS, ANY_OF_THESE, ALL_OF_THESE, - ZONE, - RESTRICTED, + WHILE_IN_ZONE, + ALWAYS_RESTRICTED, MAX }; diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index 8cdc9ec86..1e7f87c2a 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -35,7 +35,7 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { } } } - entry.checkType = static_cast(tableData.getIntField("checkType", 6)); + entry.checkType = static_cast(tableData.getIntField("checkType", 6)); // MAX entries.push_back(entry); tableData.nextRow(); diff --git a/dDatabase/CDClientDatabase/CDClientTables/CMakeLists.txt b/dDatabase/CDClientDatabase/CDClientTables/CMakeLists.txt index f45516463..300c54b61 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CMakeLists.txt +++ b/dDatabase/CDClientDatabase/CDClientTables/CMakeLists.txt @@ -38,4 +38,6 @@ set(DDATABASE_CDCLIENTDATABASE_CDCLIENTTABLES_SOURCES "CDActivitiesTable.cpp" "CDSkillBehaviorTable.cpp" "CDTamingBuildPuzzleTable.cpp" "CDVendorComponentTable.cpp" - "CDZoneTableTable.cpp" PARENT_SCOPE) + "CDZoneTableTable.cpp" + "CDDeletionRestrictionsTable.cpp" +PARENT_SCOPE) From 3cfbc9d3df554f6b2935bb6582c825b89584b6a1 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Thu, 6 Jun 2024 21:11:43 -0500 Subject: [PATCH 3/8] Document what needs to be done May not do the recursive restriction cause they aren't used in the live game --- .../CDDeletionRestrictionsTable.cpp | 30 +++++++------ .../CDDeletionRestrictionsTable.h | 8 ++-- dGame/dInventory/Item.cpp | 42 +++++++++++++++++++ dGame/dInventory/Item.h | 7 ++++ 4 files changed, 71 insertions(+), 16 deletions(-) diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index 1e7f87c2a..cf66b8323 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -1,10 +1,16 @@ #include "CDDeletionRestrictionsTable.h" #include "GeneralUtils.h" +#include "eDeletionRestrictionsCheckType.h" + +CDDeletionRestriction CDDeletionRestrictionsTable::Default = { + .id = 0, + .restricted = false, + .ids = {}, + .checkType = eDeletionRestrictionsCheckType::MAX +}; -//! Constructor void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { - // First, get the size of the table uint32_t size = 0; auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyTable"); while (!tableSize.eof()) { @@ -15,14 +21,11 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { tableSize.finalize(); - // Reserve the size auto& entries = GetEntriesMutable(); - entries.reserve(size); - // Now get the data auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DeletionRestrictions"); while (!tableData.eof()) { - CDDeletionRestrictions entry; + CDDeletionRestriction entry; entry.id = tableData.getIntField("id", -1); if (entry.id == -1) continue; entry.restricted = tableData.getIntField("restricted", -1); @@ -37,17 +40,18 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { } entry.checkType = static_cast(tableData.getIntField("checkType", 6)); // MAX - entries.push_back(entry); + entries.insert(std::make_pair(entry.id, entry)); tableData.nextRow(); } tableData.finalize(); } -std::vector CDDeletionRestrictionsTable::Query(std::function predicate) { - std::vector data = cpplinq::from(GetEntries()) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; +const CDDeletionRestriction& CDDeletionRestrictionsTable::GetByID(uint32_t id) { + auto& entries = GetEntries(); + const auto& it = entries.find(id); + if (it != entries.end()) { + return it->second; + } + return Default; } diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h index 718e7bab8..a09ee60da 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.h @@ -4,15 +4,17 @@ enum class eDeletionRestrictionsCheckType : uint32_t; -struct CDDeletionRestrictions { +struct CDDeletionRestriction { uint32_t id; bool restricted; std::vector ids; eDeletionRestrictionsCheckType checkType; }; -class CDDeletionRestrictionsTable : public CDTable> { +class CDDeletionRestrictionsTable : public CDTable> { public: void LoadValuesFromDatabase(); - std::vector Query(std::function predicate); + const CDDeletionRestriction& GetByID(uint32_t id); + + static CDDeletionRestriction Default; }; diff --git a/dGame/dInventory/Item.cpp b/dGame/dInventory/Item.cpp index 326037614..9ef816637 100644 --- a/dGame/dInventory/Item.cpp +++ b/dGame/dInventory/Item.cpp @@ -21,11 +21,13 @@ #include "eUseItemResponse.h" #include "dZoneManager.h" #include "ChatPackets.h" +#include "eDeletionRestrictionsCheckType.h" #include "CDBrickIDTableTable.h" #include "CDObjectSkillsTable.h" #include "CDComponentsRegistryTable.h" #include "CDPackageComponentTable.h" +#include "CDDeletionRestrictionsTable.h" namespace { const std::map ExtraSettingAbbreviations = { @@ -568,3 +570,43 @@ void Item::LoadConfigXml(const tinyxml2::XMLElement& i) { config.push_back(LDFBaseData::DataFromString(value)); } } + +bool Item::CanDeleteItem(Item* item) { + if (!item) return false; + // TODO: + // Check if item is being possessed + // Check if the owner is mounting item? (how is this different than the above) + // Allow GM 9 to freely delete + // Finally, check Deletion Restriction + const auto& itemComponent = item->inventory->FindItemComponent(item->lot); + if (itemComponent.delResIndex == -1) return true; + return CheckDeletionRestriction(itemComponent.delResIndex, item->lot); +} + +bool Item::CheckDeletionRestriction(uint32_t delResIndex, LOT item) { + auto* delresTable = CDClientManager::GetTable(); + const auto restriction = delresTable->GetByID(delResIndex); + + switch(restriction.checkType) { + case eDeletionRestrictionsCheckType::INCLUDE_LOTS: + if (std::ranges::find(restriction.ids, item) != restriction.ids.end()) return false; + else return true; + case eDeletionRestrictionsCheckType::EXCLUDE_LOTS: + if (std::ranges::find(restriction.ids, item) != restriction.ids.end()) return true; + else return false; + case eDeletionRestrictionsCheckType::ANY_OF_THESE: + // TODO: Implement + return true; + case eDeletionRestrictionsCheckType::ALL_OF_THESE: + // TODO: Implement + return true; + case eDeletionRestrictionsCheckType::WHILE_IN_ZONE: + if (std::ranges::find(restriction.ids, Game::zoneManager->GetZoneID().GetMapID()) != restriction.ids.end()) return false; + else return true; + case eDeletionRestrictionsCheckType::ALWAYS_RESTRICTED: + return false; + case eDeletionRestrictionsCheckType::MAX: + default: + return true; + } +} diff --git a/dGame/dInventory/Item.h b/dGame/dInventory/Item.h index 72ff264c7..b5e4e9f2e 100644 --- a/dGame/dInventory/Item.h +++ b/dGame/dInventory/Item.h @@ -228,6 +228,13 @@ class Item final void LoadConfigXml(const tinyxml2::XMLElement& i); + bool CanDeleteItem(Item* item); + + bool CheckDeletionRestriction(uint32_t delResIndex, LOT item); + + bool CheckDeletionRestrictionRecursion(std::set& delResIndexs, uint32_t delResIndex); + + private: /** * The object ID of this item From 42cf2b63774227baf8a85429daa5ca18e3f3fbf8 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 6 Jun 2024 21:33:42 -0500 Subject: [PATCH 4/8] remove unused code Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> --- .../CDClientTables/CDDeletionRestrictionsTable.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index cf66b8323..2da36b622 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -11,15 +11,6 @@ CDDeletionRestriction CDDeletionRestrictionsTable::Default = { void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { - uint32_t size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyTable"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); auto& entries = GetEntriesMutable(); From 0e6cb8ab19806c2fe81ef5715ea8fb74983baf66 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 6 Jun 2024 21:34:10 -0500 Subject: [PATCH 5/8] implict bool Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> --- .../CDClientTables/CDDeletionRestrictionsTable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index 2da36b622..ad7f90d8e 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -24,8 +24,8 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { if (!raw_ids.empty()) { for (const auto& idstr : GeneralUtils::SplitString(raw_ids, ',')) { if (!idstr.empty()) { - const auto id = GeneralUtils::TryParse(idstr).value_or(-1); - if (id != -1) entry.ids.push_back(id); + const auto id = GeneralUtils::TryParse(idstr); + if (id) entry.ids.push_back(id); } } } From 66cf96af1a83e48bc7fc381f308a3d05d6df0556 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 6 Jun 2024 21:34:29 -0500 Subject: [PATCH 6/8] whoops Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> --- .../CDClientTables/CDDeletionRestrictionsTable.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index ad7f90d8e..8591818e9 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -35,7 +35,6 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { tableData.nextRow(); } - tableData.finalize(); } const CDDeletionRestriction& CDDeletionRestrictionsTable::GetByID(uint32_t id) { From f6f3cdc3c02be8e1af44b5cc1078cec1741f412b Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Fri, 7 Jun 2024 09:31:54 -0500 Subject: [PATCH 7/8] fix compiling --- .../CDClientTables/CDDeletionRestrictionsTable.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index 8591818e9..77fb1a48a 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -10,8 +10,6 @@ CDDeletionRestriction CDDeletionRestrictionsTable::Default = { }; void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { - - auto& entries = GetEntriesMutable(); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DeletionRestrictions"); @@ -25,7 +23,7 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { for (const auto& idstr : GeneralUtils::SplitString(raw_ids, ',')) { if (!idstr.empty()) { const auto id = GeneralUtils::TryParse(idstr); - if (id) entry.ids.push_back(id); + if (id) entry.ids.push_back(id.value()); } } } From bf58cf85ccc2aad87593ee9946805bae865f0e1d Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Fri, 7 Jun 2024 15:07:37 -0500 Subject: [PATCH 8/8] us static cast and enum --- dCommon/dEnums/eCSRCommand.h | 55 +++++++++++++++++++ .../CDDeletionRestrictionsTable.cpp | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 dCommon/dEnums/eCSRCommand.h diff --git a/dCommon/dEnums/eCSRCommand.h b/dCommon/dEnums/eCSRCommand.h new file mode 100644 index 000000000..107d82bb1 --- /dev/null +++ b/dCommon/dEnums/eCSRCommand.h @@ -0,0 +1,55 @@ +#ifndef __ECSRCOMMAND__H__ +#define __ECSRCOMMAND__H__ + +#include + +enum class eCSRCommand : uint32_t { + QUERY_SERVER_STATUS = 0, + QUERY_CHARACTER_LOCATION, + QUERY_CHARACTER_ONLINE_STATUS, + INVENTORY_ADD_ITEM, + INVENTORY_DELETE_ITEM, + MODERATE_MUTE_ACCOUNT, + MODERATE_BAN_ACCOUNT, + MODERATE_EDUCATE_CHARACTER, + MODERATE_KICK_CHARACTER, + MODERATE_WARN_CHARACTER, + MODERATE_RENAME_CHARACTER, + MODERATE_DELETE_CHARACTER_FRIEND, + MODERATE_KILL_CHARACTER, + UPDATE_CHARACTER_HEALTH, + UPDATE_CHARACTER_ARMOR, + UPDATE_CHARACTER_IMAGINATION, + UPDATE_CHARACTER_MAX_HEALTH, + UPDATE_CHARACTER_MAX_ARMOR, + UPDATE_CHARACTER_MAX_IMAGINATION, + UPDATE_CHARACTER_CURRENCY, + UPDATE_CHARACTER_REPUTATION, + UPDATE_CHARACTER_LEGO_SCORE, + UPDATE_CHARACTER_EMOTES, + UPDATE_CHARACTER_ADD_ACHIEVEMENT, + UPDATE_CHARACTER_COMPLETE_ACHIEVEMENT, + UPDATE_CHARACTER_REMOVE_ACHIEVEMENT, + UPDATE_CHARACTER_POSITION_OFFLINE, + UPDATE_CHARACTER_INV_SLOT_AMOUNT, + UTILITY_SAVE_CHARACTER, + UTILITY_SEND_MAIL, + UTILITY_GIVE_ITEM_TO_ALL_PLAYERS_ONLINE, + METRICS_CONFIGURE, + DISABLE_ZONE, + INIT_DONATION_AMOUNT, + KILL_SERVERS_COUNTDOWN, + DISABLE_FAQ, + THROTTLEQUEUE, + GATEGM_ACCESS, + RECONNECT_CRISP, + MODERATE_KICK_ACCOUNT, + TOGGLE_CRISP_SERVER, + QUICK_DRAIN_SERVER, + QUICK_DRAIN_SERVER_RENEW, + REPLICATE_CHARACTER, + GET_SERVER_STATUS, + RELOAD_SERVER_INIS +}; + +#endif //!__ECSRCOMMAND__H__ diff --git a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp index 77fb1a48a..4cef80415 100644 --- a/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp +++ b/dDatabase/CDClientDatabase/CDClientTables/CDDeletionRestrictionsTable.cpp @@ -27,7 +27,7 @@ void CDDeletionRestrictionsTable::LoadValuesFromDatabase() { } } } - entry.checkType = static_cast(tableData.getIntField("checkType", 6)); // MAX + entry.checkType = static_cast(tableData.getIntField("checkType", static_cast(eDeletionRestrictionsCheckType::MAX))); entries.insert(std::make_pair(entry.id, entry)); tableData.nextRow();