Initial concept for CDClient rework.

Utilizes `boost::interprocess` to share a map between worlds.
The master server loads the table into memory, and the worlds hook into it when they want to get an entry.

This solves the issue of skill delay, but introduces the third-party library Boost.
There should be a conversation about the introduction of Boost — it is a large library and adds extra steps to the installation.
This commit is contained in:
wincent
2022-07-09 22:59:36 +02:00
parent 485de6173a
commit 34fa43ed93
8 changed files with 143 additions and 67 deletions

View File

@@ -12,17 +12,17 @@
//! BehaviorParameter Entry Struct
struct CDBehaviorParameter {
unsigned int behaviorID; //!< The Behavior ID
std::string parameterID; //!< The Parameter ID
int32_t behaviorID; //!< The Behavior ID
int32_t parameterID; //!< The Parameter ID
float value; //!< The value of the behavior template
};
//! BehaviorParameter table
class CDBehaviorParameterTable : public CDTable {
private:
std::unordered_map<size_t, CDBehaviorParameter> m_Entries;
std::unordered_set<std::string> m_ParametersList;
std::unordered_map<size_t, float> m_Entries;
public:
static void CreateSharedMap();
//! Constructor
CDBehaviorParameterTable(void);
@@ -36,7 +36,5 @@ public:
*/
std::string GetName(void) const override;
CDBehaviorParameter GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0);
std::map<std::string, float> GetParametersByBehaviorID(uint32_t behaviorID);
float GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0);
};