Merge remote-tracking branch 'upstream/main'

This commit is contained in:
David Markowitz 2023-01-07 19:50:42 -08:00
commit 2baef3f198
169 changed files with 2254 additions and 1325 deletions

View File

@ -24,7 +24,6 @@ public:
* Reloads the config file to reset values * Reloads the config file to reset values
*/ */
void ReloadConfig(); void ReloadConfig();
private: private:
void ProcessLine(const std::string& line); void ProcessLine(const std::string& line);

View File

@ -6,7 +6,7 @@
/** /**
* Represents the possible states a mission can be in * Represents the possible states a mission can be in
*/ */
enum class MissionState : int { enum class MissionState : int32_t {
/** /**
* The mission state is unknown * The mission state is unknown
*/ */

View File

@ -366,7 +366,7 @@ enum eControlSceme {
SCHEME_WEAR_A_ROBOT //== freecam? SCHEME_WEAR_A_ROBOT //== freecam?
}; };
enum eStunState { enum class eStateChangeType : uint32_t {
PUSH, PUSH,
POP POP
}; };

View File

@ -293,6 +293,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_POP_EQUIPPED_ITEMS_STATE = 192, GAME_MSG_POP_EQUIPPED_ITEMS_STATE = 192,
GAME_MSG_SET_GM_LEVEL = 193, GAME_MSG_SET_GM_LEVEL = 193,
GAME_MSG_SET_STUNNED = 198, GAME_MSG_SET_STUNNED = 198,
GAME_MSG_SET_STUN_IMMUNITY = 200,
GAME_MSG_KNOCKBACK = 202, GAME_MSG_KNOCKBACK = 202,
GAME_MSG_REBUILD_CANCEL = 209, GAME_MSG_REBUILD_CANCEL = 209,
GAME_MSG_ENABLE_REBUILD = 213, GAME_MSG_ENABLE_REBUILD = 213,
@ -373,6 +374,8 @@ enum GAME_MSG : unsigned short {
GAME_MSG_PET_TAMING_TRY_BUILD_RESULT = 668, GAME_MSG_PET_TAMING_TRY_BUILD_RESULT = 668,
GAME_MSG_NOTIFY_TAMING_BUILD_SUCCESS = 673, GAME_MSG_NOTIFY_TAMING_BUILD_SUCCESS = 673,
GAME_MSG_NOTIFY_TAMING_MODEL_LOADED_ON_SERVER = 674, GAME_MSG_NOTIFY_TAMING_MODEL_LOADED_ON_SERVER = 674,
GAME_MSG_ACTIVATE_BUBBLE_BUFF = 678,
GAME_MSG_DEACTIVATE_BUBBLE_BUFF = 679,
GAME_MSG_ADD_PET_TO_PLAYER = 681, GAME_MSG_ADD_PET_TO_PLAYER = 681,
GAME_MSG_REQUEST_SET_PET_NAME = 683, GAME_MSG_REQUEST_SET_PET_NAME = 683,
GAME_MSG_SET_PET_NAME = 684, GAME_MSG_SET_PET_NAME = 684,
@ -385,7 +388,10 @@ enum GAME_MSG : unsigned short {
GAME_MSG_QUERY_PROPERTY_DATA = 717, GAME_MSG_QUERY_PROPERTY_DATA = 717,
GAME_MSG_PROPERTY_EDITOR_BEGIN = 724, GAME_MSG_PROPERTY_EDITOR_BEGIN = 724,
GAME_MSG_PROPERTY_EDITOR_END = 725, GAME_MSG_PROPERTY_EDITOR_END = 725,
GAME_MSG_START_PATHING = 735, GAME_MSG_IS_MINIFIG_IN_A_BUBBLE = 729,
GAME_MSG_START_PATHING = 733,
GAME_MSG_ACTIVATE_BUBBLE_BUFF_FROM_SERVER = 734,
GAME_MSG_DEACTIVATE_BUBBLE_BUFF_FROM_SERVER = 735,
GAME_MSG_NOTIFY_CLIENT_ZONE_OBJECT = 737, GAME_MSG_NOTIFY_CLIENT_ZONE_OBJECT = 737,
GAME_MSG_UPDATE_REPUTATION = 746, GAME_MSG_UPDATE_REPUTATION = 746,
GAME_MSG_PROPERTY_RENTAL_RESPONSE = 750, GAME_MSG_PROPERTY_RENTAL_RESPONSE = 750,
@ -512,6 +518,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_UPDATE_CHAT_MODE = 1395, GAME_MSG_UPDATE_CHAT_MODE = 1395,
GAME_MSG_VEHICLE_NOTIFY_FINISHED_RACE = 1396, GAME_MSG_VEHICLE_NOTIFY_FINISHED_RACE = 1396,
GAME_MSG_SET_CONSUMABLE_ITEM = 1409, GAME_MSG_SET_CONSUMABLE_ITEM = 1409,
GAME_MSG_SET_STATUS_IMMUNITY = 1435,
GAME_MSG_SET_PET_NAME_MODERATED = 1448, GAME_MSG_SET_PET_NAME_MODERATED = 1448,
GAME_MSG_MODIFY_LEGO_SCORE = 1459, GAME_MSG_MODIFY_LEGO_SCORE = 1459,
GAME_MSG_RESTORE_TO_POST_LOAD_STATS = 1468, GAME_MSG_RESTORE_TO_POST_LOAD_STATS = 1468,

View File

@ -0,0 +1,14 @@
#pragma once
#ifndef __EBUBBLETYPE__H__
#define __EBUBBLETYPE__H__
#include <cstdint>
enum class eBubbleType : uint32_t {
DEFAULT = 0,
ENERGY = 1,
SKUNK = 2,
};
#endif //!__EBUBBLETYPE__H__

View File

@ -0,0 +1,16 @@
#ifndef __EMOVEMENTPLATFORMSTATE__H__
#define __EMOVEMENTPLATFORMSTATE__H__
#include <cstdint>
/**
* The different types of platform movement state, supposedly a bitmap
*/
enum class eMovementPlatformState : uint32_t
{
Moving = 0b00010,
Stationary = 0b11001,
Stopped = 0b01100
};
#endif //!__EMOVEMENTPLATFORMSTATE__H__

View File

@ -21,25 +21,25 @@ CDActivitiesTable::CDActivitiesTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Activities"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Activities");
while (!tableData.eof()) { while (!tableData.eof()) {
CDActivities entry; CDActivities entry;
entry.ActivityID = tableData.getIntField(0, -1); entry.ActivityID = tableData.getIntField("ActivityID", -1);
entry.locStatus = tableData.getIntField(1, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.instanceMapID = tableData.getIntField(2, -1); entry.instanceMapID = tableData.getIntField("instanceMapID", -1);
entry.minTeams = tableData.getIntField(3, -1); entry.minTeams = tableData.getIntField("minTeams", -1);
entry.maxTeams = tableData.getIntField(4, -1); entry.maxTeams = tableData.getIntField("maxTeams", -1);
entry.minTeamSize = tableData.getIntField(5, -1); entry.minTeamSize = tableData.getIntField("minTeamSize", -1);
entry.maxTeamSize = tableData.getIntField(6, -1); entry.maxTeamSize = tableData.getIntField("maxTeamSize", -1);
entry.waitTime = tableData.getIntField(7, -1); entry.waitTime = tableData.getIntField("waitTime", -1);
entry.startDelay = tableData.getIntField(8, -1); entry.startDelay = tableData.getIntField("startDelay", -1);
entry.requiresUniqueData = tableData.getIntField(9, -1); entry.requiresUniqueData = tableData.getIntField("requiresUniqueData", -1);
entry.leaderboardType = tableData.getIntField(10, -1); entry.leaderboardType = tableData.getIntField("leaderboardType", -1);
entry.localize = tableData.getIntField(11, -1); entry.localize = tableData.getIntField("localize", -1);
entry.optionalCostLOT = tableData.getIntField(12, -1); entry.optionalCostLOT = tableData.getIntField("optionalCostLOT", -1);
entry.optionalCostCount = tableData.getIntField(13, -1); entry.optionalCostCount = tableData.getIntField("optionalCostCount", -1);
entry.showUIRewards = tableData.getIntField(14, -1); entry.showUIRewards = tableData.getIntField("showUIRewards", -1);
entry.CommunityActivityFlagID = tableData.getIntField(15, -1); entry.CommunityActivityFlagID = tableData.getIntField("CommunityActivityFlagID", -1);
entry.gate_version = tableData.getStringField(16, ""); entry.gate_version = tableData.getStringField("gate_version", "");
entry.noTeamLootOnDeath = tableData.getIntField(17, -1); entry.noTeamLootOnDeath = tableData.getIntField("noTeamLootOnDeath", -1);
entry.optionalPercentage = tableData.getFloatField(18, -1.0f); entry.optionalPercentage = tableData.getFloatField("optionalPercentage", -1.0f);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -70,3 +70,4 @@ std::vector<CDActivities> CDActivitiesTable::Query(std::function<bool(CDActiviti
std::vector<CDActivities> CDActivitiesTable::GetEntries(void) const { std::vector<CDActivities> CDActivitiesTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,13 +21,13 @@ CDActivityRewardsTable::CDActivityRewardsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ActivityRewards"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ActivityRewards");
while (!tableData.eof()) { while (!tableData.eof()) {
CDActivityRewards entry; CDActivityRewards entry;
entry.objectTemplate = tableData.getIntField(0, -1); entry.objectTemplate = tableData.getIntField("objectTemplate", -1);
entry.ActivityRewardIndex = tableData.getIntField(1, -1); entry.ActivityRewardIndex = tableData.getIntField("ActivityRewardIndex", -1);
entry.activityRating = tableData.getIntField(2, -1); entry.activityRating = tableData.getIntField("activityRating", -1);
entry.LootMatrixIndex = tableData.getIntField(3, -1); entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
entry.CurrencyIndex = tableData.getIntField(4, -1); entry.CurrencyIndex = tableData.getIntField("CurrencyIndex", -1);
entry.ChallengeRating = tableData.getIntField(5, -1); entry.ChallengeRating = tableData.getIntField("ChallengeRating", -1);
entry.description = tableData.getStringField(6, ""); entry.description = tableData.getStringField("description", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -58,3 +58,4 @@ std::vector<CDActivityRewards> CDActivityRewardsTable::Query(std::function<bool(
std::vector<CDActivityRewards> CDActivityRewardsTable::GetEntries(void) const { std::vector<CDActivityRewards> CDActivityRewardsTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,19 +21,19 @@ CDAnimationsTable::CDAnimationsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Animations"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Animations");
while (!tableData.eof()) { while (!tableData.eof()) {
CDAnimations entry; CDAnimations entry;
entry.animationGroupID = tableData.getIntField(0, -1); entry.animationGroupID = tableData.getIntField("animationGroupID", -1);
entry.animation_type = tableData.getStringField(1, ""); entry.animation_type = tableData.getStringField("animation_type", "");
entry.animation_name = tableData.getStringField(2, ""); entry.animation_name = tableData.getStringField("animation_name", "");
entry.chance_to_play = tableData.getFloatField(3, -1.0f); entry.chance_to_play = tableData.getFloatField("chance_to_play", -1.0f);
entry.min_loops = tableData.getIntField(4, -1); entry.min_loops = tableData.getIntField("min_loops", -1);
entry.max_loops = tableData.getIntField(5, -1); entry.max_loops = tableData.getIntField("max_loops", -1);
entry.animation_length = tableData.getFloatField(6, -1.0f); entry.animation_length = tableData.getFloatField("animation_length", -1.0f);
entry.hideEquip = tableData.getIntField(7, -1) == 1 ? true : false; entry.hideEquip = tableData.getIntField("hideEquip", -1) == 1 ? true : false;
entry.ignoreUpperBody = tableData.getIntField(8, -1) == 1 ? true : false; entry.ignoreUpperBody = tableData.getIntField("ignoreUpperBody", -1) == 1 ? true : false;
entry.restartable = tableData.getIntField(9, -1) == 1 ? true : false; entry.restartable = tableData.getIntField("restartable", -1) == 1 ? true : false;
entry.face_animation_name = tableData.getStringField(10, ""); entry.face_animation_name = tableData.getStringField("face_animation_name", "");
entry.priority = tableData.getFloatField(11, -1.0f); entry.priority = tableData.getFloatField("priority", -1.0f);
entry.blendTime = tableData.getFloatField(12, -1.0f); entry.blendTime = tableData.getFloatField("blendTime", -1.0f);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -64,3 +64,4 @@ std::vector<CDAnimations> CDAnimationsTable::Query(std::function<bool(CDAnimatio
std::vector<CDAnimations> CDAnimationsTable::GetEntries(void) const { std::vector<CDAnimations> CDAnimationsTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -8,8 +8,8 @@ CDBehaviorParameterTable::CDBehaviorParameterTable(void) {
uint64_t hash = 0; uint64_t hash = 0;
while (!tableData.eof()) { while (!tableData.eof()) {
CDBehaviorParameter entry; CDBehaviorParameter entry;
entry.behaviorID = tableData.getIntField(0, -1); entry.behaviorID = tableData.getIntField("behaviorID", -1);
auto candidateStringToAdd = std::string(tableData.getStringField(1, "")); auto candidateStringToAdd = std::string(tableData.getStringField("parameterID", ""));
auto parameter = m_ParametersList.find(candidateStringToAdd); auto parameter = m_ParametersList.find(candidateStringToAdd);
if (parameter != m_ParametersList.end()) { if (parameter != m_ParametersList.end()) {
entry.parameterID = parameter; entry.parameterID = parameter;
@ -19,7 +19,7 @@ CDBehaviorParameterTable::CDBehaviorParameterTable(void) {
} }
hash = entry.behaviorID; hash = entry.behaviorID;
hash = (hash << 31U) | entry.parameterID->second; hash = (hash << 31U) | entry.parameterID->second;
entry.value = tableData.getFloatField(2, -1.0f); entry.value = tableData.getFloatField("value", -1.0f);
m_Entries.insert(std::make_pair(hash, entry)); m_Entries.insert(std::make_pair(hash, entry));
@ -62,3 +62,4 @@ std::map<std::string, float> CDBehaviorParameterTable::GetParametersByBehaviorID
} }
return returnInfo; return returnInfo;
} }

View File

@ -21,9 +21,9 @@ CDBehaviorTemplateTable::CDBehaviorTemplateTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorTemplate"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorTemplate");
while (!tableData.eof()) { while (!tableData.eof()) {
CDBehaviorTemplate entry; CDBehaviorTemplate entry;
entry.behaviorID = tableData.getIntField(0, -1); entry.behaviorID = tableData.getIntField("behaviorID", -1);
entry.templateID = tableData.getIntField(1, -1); entry.templateID = tableData.getIntField("templateID", -1);
entry.effectID = tableData.getIntField(2, -1); entry.effectID = tableData.getIntField("effectID", -1);
auto candidateToAdd = tableData.getStringField(3, ""); auto candidateToAdd = tableData.getStringField(3, "");
auto parameter = m_EffectHandles.find(candidateToAdd); auto parameter = m_EffectHandles.find(candidateToAdd);
if (parameter != m_EffectHandles.end()) { if (parameter != m_EffectHandles.end()) {
@ -75,3 +75,4 @@ const CDBehaviorTemplate CDBehaviorTemplateTable::GetByBehaviorID(uint32_t behav
return entry->second; return entry->second;
} }
} }

View File

@ -21,8 +21,8 @@ CDBrickIDTableTable::CDBrickIDTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BrickIDTable"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BrickIDTable");
while (!tableData.eof()) { while (!tableData.eof()) {
CDBrickIDTable entry; CDBrickIDTable entry;
entry.NDObjectID = tableData.getIntField(0, -1); entry.NDObjectID = tableData.getIntField("NDObjectID", -1);
entry.LEGOBrickID = tableData.getIntField(1, -1); entry.LEGOBrickID = tableData.getIntField("LEGOBrickID", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -53,3 +53,4 @@ std::vector<CDBrickIDTable> CDBrickIDTableTable::Query(std::function<bool(CDBric
std::vector<CDBrickIDTable> CDBrickIDTableTable::GetEntries(void) const { std::vector<CDBrickIDTable> CDBrickIDTableTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -24,9 +24,9 @@ CDComponentsRegistryTable::CDComponentsRegistryTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ComponentsRegistry"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ComponentsRegistry");
while (!tableData.eof()) { while (!tableData.eof()) {
CDComponentsRegistry entry; CDComponentsRegistry entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.component_type = tableData.getIntField(1, -1); entry.component_type = tableData.getIntField("component_type", -1);
entry.component_id = tableData.getIntField(2, -1); entry.component_id = tableData.getIntField("component_id", -1);
this->mappedEntries.insert_or_assign(((uint64_t)entry.component_type) << 32 | ((uint64_t)entry.id), entry.component_id); this->mappedEntries.insert_or_assign(((uint64_t)entry.component_type) << 32 | ((uint64_t)entry.id), entry.component_id);
@ -91,9 +91,9 @@ int32_t CDComponentsRegistryTable::GetByIDAndType(uint32_t id, uint32_t componen
auto tableData = CDClientDatabase::ExecuteQuery(query.str()); auto tableData = CDClientDatabase::ExecuteQuery(query.str());
while (!tableData.eof()) { while (!tableData.eof()) {
CDComponentsRegistry entry; CDComponentsRegistry entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.component_type = tableData.getIntField(1, -1); entry.component_type = tableData.getIntField("component_type", -1);
entry.component_id = tableData.getIntField(2, -1); entry.component_id = tableData.getIntField("component_id", -1);
//this->entries.push_back(entry); //this->entries.push_back(entry);
@ -126,3 +126,4 @@ int32_t CDComponentsRegistryTable::GetByIDAndType(uint32_t id, uint32_t componen
return defaultValue; return defaultValue;
#endif #endif
} }

View File

@ -21,11 +21,11 @@ CDCurrencyTableTable::CDCurrencyTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyTable"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyTable");
while (!tableData.eof()) { while (!tableData.eof()) {
CDCurrencyTable entry; CDCurrencyTable entry;
entry.currencyIndex = tableData.getIntField(0, -1); entry.currencyIndex = tableData.getIntField("currencyIndex", -1);
entry.npcminlevel = tableData.getIntField(1, -1); entry.npcminlevel = tableData.getIntField("npcminlevel", -1);
entry.minvalue = tableData.getIntField(2, -1); entry.minvalue = tableData.getIntField("minvalue", -1);
entry.maxvalue = tableData.getIntField(3, -1); entry.maxvalue = tableData.getIntField("maxvalue", -1);
entry.id = tableData.getIntField(4, -1); entry.id = tableData.getIntField("id", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -56,3 +56,4 @@ std::vector<CDCurrencyTable> CDCurrencyTableTable::Query(std::function<bool(CDCu
std::vector<CDCurrencyTable> CDCurrencyTableTable::GetEntries(void) const { std::vector<CDCurrencyTable> CDCurrencyTableTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,20 +21,20 @@ CDDestructibleComponentTable::CDDestructibleComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DestructibleComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DestructibleComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDDestructibleComponent entry; CDDestructibleComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.faction = tableData.getIntField(1, -1); entry.faction = tableData.getIntField("faction", -1);
entry.factionList = tableData.getStringField(2, ""); entry.factionList = tableData.getStringField("factionList", "");
entry.life = tableData.getIntField(3, -1); entry.life = tableData.getIntField("life", -1);
entry.imagination = tableData.getIntField(4, -1); entry.imagination = tableData.getIntField("imagination", -1);
entry.LootMatrixIndex = tableData.getIntField(5, -1); entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
entry.CurrencyIndex = tableData.getIntField(6, -1); entry.CurrencyIndex = tableData.getIntField("CurrencyIndex", -1);
entry.level = tableData.getIntField(7, -1); entry.level = tableData.getIntField("level", -1);
entry.armor = tableData.getFloatField(8, -1.0f); entry.armor = tableData.getFloatField("armor", -1.0f);
entry.death_behavior = tableData.getIntField(9, -1); entry.death_behavior = tableData.getIntField("death_behavior", -1);
entry.isnpc = tableData.getIntField(10, -1) == 1 ? true : false; entry.isnpc = tableData.getIntField("isnpc", -1) == 1 ? true : false;
entry.attack_priority = tableData.getIntField(11, -1); entry.attack_priority = tableData.getIntField("attack_priority", -1);
entry.isSmashable = tableData.getIntField(12, -1) == 1 ? true : false; entry.isSmashable = tableData.getIntField("isSmashable", -1) == 1 ? true : false;
entry.difficultyLevel = tableData.getIntField(13, -1); entry.difficultyLevel = tableData.getIntField("difficultyLevel", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -65,3 +65,4 @@ std::vector<CDDestructibleComponent> CDDestructibleComponentTable::Query(std::fu
std::vector<CDDestructibleComponent> CDDestructibleComponentTable::GetEntries(void) const { std::vector<CDDestructibleComponent> CDDestructibleComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -5,14 +5,14 @@ CDEmoteTableTable::CDEmoteTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes");
while (!tableData.eof()) { while (!tableData.eof()) {
CDEmoteTable* entry = new CDEmoteTable(); CDEmoteTable* entry = new CDEmoteTable();
entry->ID = tableData.getIntField(0, -1); entry->ID = tableData.getIntField("id", -1);
entry->animationName = tableData.getStringField(1, ""); entry->animationName = tableData.getStringField("animationName", "");
entry->iconFilename = tableData.getStringField(2, ""); entry->iconFilename = tableData.getStringField("iconFilename", "");
entry->channel = tableData.getIntField(3, -1); entry->channel = tableData.getIntField("channel", -1);
entry->locked = tableData.getIntField(5, -1) != 0; entry->locked = tableData.getIntField("locked", -1) != 0;
entry->localize = tableData.getIntField(6, -1) != 0; entry->localize = tableData.getIntField("localize", -1) != 0;
entry->locState = tableData.getIntField(7, -1); entry->locState = tableData.getIntField("locStatus", -1);
entry->gateVersion = tableData.getIntField(8, -1); entry->gateVersion = tableData.getStringField("gate_version", "");
entries.insert(std::make_pair(entry->ID, entry)); entries.insert(std::make_pair(entry->ID, entry));
tableData.nextRow(); tableData.nextRow();
@ -42,3 +42,4 @@ CDEmoteTable* CDEmoteTableTable::GetEmote(int id) {
return nullptr; return nullptr;
} }

View File

@ -19,7 +19,7 @@ struct CDEmoteTable {
channel = -1; channel = -1;
locked = false; locked = false;
localize = false; localize = false;
gateVersion = -1; gateVersion = "";
} }
int ID; int ID;
@ -29,7 +29,7 @@ struct CDEmoteTable {
int channel; int channel;
bool locked; bool locked;
bool localize; bool localize;
int gateVersion; std::string gateVersion;
}; };
//! CDEmoteTable table //! CDEmoteTable table

View File

@ -21,11 +21,11 @@ CDFeatureGatingTable::CDFeatureGatingTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM FeatureGating"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM FeatureGating");
while (!tableData.eof()) { while (!tableData.eof()) {
CDFeatureGating entry; CDFeatureGating entry;
entry.featureName = tableData.getStringField(0, ""); entry.featureName = tableData.getStringField("featureName", "");
entry.major = tableData.getIntField(1, -1); entry.major = tableData.getIntField("major", -1);
entry.current = tableData.getIntField(2, -1); entry.current = tableData.getIntField("current", -1);
entry.minor = tableData.getIntField(3, -1); entry.minor = tableData.getIntField("minor", -1);
entry.description = tableData.getStringField(4, ""); entry.description = tableData.getStringField("description", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -66,3 +66,4 @@ bool CDFeatureGatingTable::FeatureUnlocked(const std::string& feature) const {
std::vector<CDFeatureGating> CDFeatureGatingTable::GetEntries(void) const { std::vector<CDFeatureGating> CDFeatureGatingTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,10 +21,10 @@ CDInventoryComponentTable::CDInventoryComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM InventoryComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM InventoryComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDInventoryComponent entry; CDInventoryComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.itemid = tableData.getIntField(1, -1); entry.itemid = tableData.getIntField("itemid", -1);
entry.count = tableData.getIntField(2, -1); entry.count = tableData.getIntField("count", -1);
entry.equip = tableData.getIntField(3, -1) == 1 ? true : false; entry.equip = tableData.getIntField("equip", -1) == 1 ? true : false;
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -55,3 +55,4 @@ std::vector<CDInventoryComponent> CDInventoryComponentTable::Query(std::function
std::vector<CDInventoryComponent> CDInventoryComponentTable::GetEntries(void) const { std::vector<CDInventoryComponent> CDInventoryComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -23,48 +23,48 @@ CDItemComponentTable::CDItemComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDItemComponent entry; CDItemComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.equipLocation = tableData.getStringField(1, ""); entry.equipLocation = tableData.getStringField("equipLocation", "");
entry.baseValue = tableData.getIntField(2, -1); entry.baseValue = tableData.getIntField("baseValue", -1);
entry.isKitPiece = tableData.getIntField(3, -1) == 1 ? true : false; entry.isKitPiece = tableData.getIntField("isKitPiece", -1) == 1 ? true : false;
entry.rarity = tableData.getIntField(4, 0); entry.rarity = tableData.getIntField("rarity", 0);
entry.itemType = tableData.getIntField(5, -1); entry.itemType = tableData.getIntField("itemType", -1);
entry.itemInfo = tableData.getInt64Field(6, -1); entry.itemInfo = tableData.getInt64Field("itemInfo", -1);
entry.inLootTable = tableData.getIntField(7, -1) == 1 ? true : false; entry.inLootTable = tableData.getIntField("inLootTable", -1) == 1 ? true : false;
entry.inVendor = tableData.getIntField(8, -1) == 1 ? true : false; entry.inVendor = tableData.getIntField("inVendor", -1) == 1 ? true : false;
entry.isUnique = tableData.getIntField(9, -1) == 1 ? true : false; entry.isUnique = tableData.getIntField("isUnique", -1) == 1 ? true : false;
entry.isBOP = tableData.getIntField(10, -1) == 1 ? true : false; entry.isBOP = tableData.getIntField("isBOP", -1) == 1 ? true : false;
entry.isBOE = tableData.getIntField(11, -1) == 1 ? true : false; entry.isBOE = tableData.getIntField("isBOE", -1) == 1 ? true : false;
entry.reqFlagID = tableData.getIntField(12, -1); entry.reqFlagID = tableData.getIntField("reqFlagID", -1);
entry.reqSpecialtyID = tableData.getIntField(13, -1); entry.reqSpecialtyID = tableData.getIntField("reqSpecialtyID", -1);
entry.reqSpecRank = tableData.getIntField(14, -1); entry.reqSpecRank = tableData.getIntField("reqSpecRank", -1);
entry.reqAchievementID = tableData.getIntField(15, -1); entry.reqAchievementID = tableData.getIntField("reqAchievementID", -1);
entry.stackSize = tableData.getIntField(16, -1); entry.stackSize = tableData.getIntField("stackSize", -1);
entry.color1 = tableData.getIntField(17, -1); entry.color1 = tableData.getIntField("color1", -1);
entry.decal = tableData.getIntField(18, -1); entry.decal = tableData.getIntField("decal", -1);
entry.offsetGroupID = tableData.getIntField(19, -1); entry.offsetGroupID = tableData.getIntField("offsetGroupID", -1);
entry.buildTypes = tableData.getIntField(20, -1); entry.buildTypes = tableData.getIntField("buildTypes", -1);
entry.reqPrecondition = tableData.getStringField(21, ""); entry.reqPrecondition = tableData.getStringField("reqPrecondition", "");
entry.animationFlag = tableData.getIntField(22, 0); entry.animationFlag = tableData.getIntField("animationFlag", 0);
entry.equipEffects = tableData.getIntField(23, -1); entry.equipEffects = tableData.getIntField("equipEffects", -1);
entry.readyForQA = tableData.getIntField(24, -1) == 1 ? true : false; entry.readyForQA = tableData.getIntField("readyForQA", -1) == 1 ? true : false;
entry.itemRating = tableData.getIntField(25, -1); entry.itemRating = tableData.getIntField("itemRating", -1);
entry.isTwoHanded = tableData.getIntField(26, -1) == 1 ? true : false; entry.isTwoHanded = tableData.getIntField("isTwoHanded", -1) == 1 ? true : false;
entry.minNumRequired = tableData.getIntField(27, -1); entry.minNumRequired = tableData.getIntField("minNumRequired", -1);
entry.delResIndex = tableData.getIntField(28, -1); entry.delResIndex = tableData.getIntField("delResIndex", -1);
entry.currencyLOT = tableData.getIntField(29, -1); entry.currencyLOT = tableData.getIntField("currencyLOT", -1);
entry.altCurrencyCost = tableData.getIntField(30, -1); entry.altCurrencyCost = tableData.getIntField("altCurrencyCost", -1);
entry.subItems = tableData.getStringField(31, ""); entry.subItems = tableData.getStringField("subItems", "");
entry.audioEventUse = tableData.getStringField(32, ""); entry.audioEventUse = tableData.getStringField("audioEventUse", "");
entry.noEquipAnimation = tableData.getIntField(33, -1) == 1 ? true : false; entry.noEquipAnimation = tableData.getIntField("noEquipAnimation", -1) == 1 ? true : false;
entry.commendationLOT = tableData.getIntField(34, -1); entry.commendationLOT = tableData.getIntField("commendationLOT", -1);
entry.commendationCost = tableData.getIntField(35, -1); entry.commendationCost = tableData.getIntField("commendationCost", -1);
entry.audioEquipMetaEventSet = tableData.getStringField(36, ""); entry.audioEquipMetaEventSet = tableData.getStringField("audioEquipMetaEventSet", "");
entry.currencyCosts = tableData.getStringField(37, ""); entry.currencyCosts = tableData.getStringField("currencyCosts", "");
entry.ingredientInfo = tableData.getStringField(38, ""); entry.ingredientInfo = tableData.getStringField("ingredientInfo", "");
entry.locStatus = tableData.getIntField(39, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.forgeType = tableData.getIntField(40, -1); entry.forgeType = tableData.getIntField("forgeType", -1);
entry.SellMultiplier = tableData.getFloatField(41, -1.0f); entry.SellMultiplier = tableData.getFloatField("SellMultiplier", -1.0f);
this->entries.insert(std::make_pair(entry.id, entry)); this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow(); tableData.nextRow();
@ -101,48 +101,48 @@ const CDItemComponent& CDItemComponentTable::GetItemComponentByID(unsigned int s
while (!tableData.eof()) { while (!tableData.eof()) {
CDItemComponent entry; CDItemComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.equipLocation = tableData.getStringField(1, ""); entry.equipLocation = tableData.getStringField("equipLocation", "");
entry.baseValue = tableData.getIntField(2, -1); entry.baseValue = tableData.getIntField("baseValue", -1);
entry.isKitPiece = tableData.getIntField(3, -1) == 1 ? true : false; entry.isKitPiece = tableData.getIntField("isKitPiece", -1) == 1 ? true : false;
entry.rarity = tableData.getIntField(4, 0); entry.rarity = tableData.getIntField("rarity", 0);
entry.itemType = tableData.getIntField(5, -1); entry.itemType = tableData.getIntField("itemType", -1);
entry.itemInfo = tableData.getInt64Field(6, -1); entry.itemInfo = tableData.getInt64Field("itemInfo", -1);
entry.inLootTable = tableData.getIntField(7, -1) == 1 ? true : false; entry.inLootTable = tableData.getIntField("inLootTable", -1) == 1 ? true : false;
entry.inVendor = tableData.getIntField(8, -1) == 1 ? true : false; entry.inVendor = tableData.getIntField("inVendor", -1) == 1 ? true : false;
entry.isUnique = tableData.getIntField(9, -1) == 1 ? true : false; entry.isUnique = tableData.getIntField("isUnique", -1) == 1 ? true : false;
entry.isBOP = tableData.getIntField(10, -1) == 1 ? true : false; entry.isBOP = tableData.getIntField("isBOP", -1) == 1 ? true : false;
entry.isBOE = tableData.getIntField(11, -1) == 1 ? true : false; entry.isBOE = tableData.getIntField("isBOE", -1) == 1 ? true : false;
entry.reqFlagID = tableData.getIntField(12, -1); entry.reqFlagID = tableData.getIntField("reqFlagID", -1);
entry.reqSpecialtyID = tableData.getIntField(13, -1); entry.reqSpecialtyID = tableData.getIntField("reqSpecialtyID", -1);
entry.reqSpecRank = tableData.getIntField(14, -1); entry.reqSpecRank = tableData.getIntField("reqSpecRank", -1);
entry.reqAchievementID = tableData.getIntField(15, -1); entry.reqAchievementID = tableData.getIntField("reqAchievementID", -1);
entry.stackSize = tableData.getIntField(16, -1); entry.stackSize = tableData.getIntField("stackSize", -1);
entry.color1 = tableData.getIntField(17, -1); entry.color1 = tableData.getIntField("color1", -1);
entry.decal = tableData.getIntField(18, -1); entry.decal = tableData.getIntField("decal", -1);
entry.offsetGroupID = tableData.getIntField(19, -1); entry.offsetGroupID = tableData.getIntField("offsetGroupID", -1);
entry.buildTypes = tableData.getIntField(20, -1); entry.buildTypes = tableData.getIntField("buildTypes", -1);
entry.reqPrecondition = tableData.getStringField(21, ""); entry.reqPrecondition = tableData.getStringField("reqPrecondition", "");
entry.animationFlag = tableData.getIntField(22, 0); entry.animationFlag = tableData.getIntField("animationFlag", 0);
entry.equipEffects = tableData.getIntField(23, -1); entry.equipEffects = tableData.getIntField("equipEffects", -1);
entry.readyForQA = tableData.getIntField(24, -1) == 1 ? true : false; entry.readyForQA = tableData.getIntField("readyForQA", -1) == 1 ? true : false;
entry.itemRating = tableData.getIntField(25, -1); entry.itemRating = tableData.getIntField("itemRating", -1);
entry.isTwoHanded = tableData.getIntField(26, -1) == 1 ? true : false; entry.isTwoHanded = tableData.getIntField("isTwoHanded", -1) == 1 ? true : false;
entry.minNumRequired = tableData.getIntField(27, -1); entry.minNumRequired = tableData.getIntField("minNumRequired", -1);
entry.delResIndex = tableData.getIntField(28, -1); entry.delResIndex = tableData.getIntField("delResIndex", -1);
entry.currencyLOT = tableData.getIntField(29, -1); entry.currencyLOT = tableData.getIntField("currencyLOT", -1);
entry.altCurrencyCost = tableData.getIntField(30, -1); entry.altCurrencyCost = tableData.getIntField("altCurrencyCost", -1);
entry.subItems = tableData.getStringField(31, ""); entry.subItems = tableData.getStringField("subItems", "");
UNUSED(entry.audioEventUse = tableData.getStringField(32, "")); UNUSED(entry.audioEventUse = tableData.getStringField("audioEventUse", ""));
entry.noEquipAnimation = tableData.getIntField(33, -1) == 1 ? true : false; entry.noEquipAnimation = tableData.getIntField("noEquipAnimation", -1) == 1 ? true : false;
entry.commendationLOT = tableData.getIntField(34, -1); entry.commendationLOT = tableData.getIntField("commendationLOT", -1);
entry.commendationCost = tableData.getIntField(35, -1); entry.commendationCost = tableData.getIntField("commendationCost", -1);
UNUSED(entry.audioEquipMetaEventSet = tableData.getStringField(36, "")); UNUSED(entry.audioEquipMetaEventSet = tableData.getStringField("audioEquipMetaEventSet", ""));
entry.currencyCosts = tableData.getStringField(37, ""); entry.currencyCosts = tableData.getStringField("currencyCosts", "");
UNUSED(entry.ingredientInfo = tableData.getStringField(38, "")); UNUSED(entry.ingredientInfo = tableData.getStringField("ingredientInfo", ""));
entry.locStatus = tableData.getIntField(39, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.forgeType = tableData.getIntField(40, -1); entry.forgeType = tableData.getIntField("forgeType", -1);
entry.SellMultiplier = tableData.getFloatField(41, -1.0f); entry.SellMultiplier = tableData.getFloatField("SellMultiplier", -1.0f);
this->entries.insert(std::make_pair(entry.id, entry)); this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow(); tableData.nextRow();
@ -177,3 +177,4 @@ std::map<LOT, uint32_t> CDItemComponentTable::ParseCraftingCurrencies(const CDIt
return currencies; return currencies;
} }

View File

@ -21,9 +21,9 @@ CDItemSetSkillsTable::CDItemSetSkillsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSetSkills"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSetSkills");
while (!tableData.eof()) { while (!tableData.eof()) {
CDItemSetSkills entry; CDItemSetSkills entry;
entry.SkillSetID = tableData.getIntField(0, -1); entry.SkillSetID = tableData.getIntField("SkillSetID", -1);
entry.SkillID = tableData.getIntField(1, -1); entry.SkillID = tableData.getIntField("SkillID", -1);
entry.SkillCastType = tableData.getIntField(2, -1); entry.SkillCastType = tableData.getIntField("SkillCastType", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -65,3 +65,4 @@ std::vector<CDItemSetSkills> CDItemSetSkillsTable::GetBySkillID(unsigned int Ski
return toReturn; return toReturn;
} }

View File

@ -21,21 +21,21 @@ CDItemSetsTable::CDItemSetsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSets"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSets");
while (!tableData.eof()) { while (!tableData.eof()) {
CDItemSets entry; CDItemSets entry;
entry.setID = tableData.getIntField(0, -1); entry.setID = tableData.getIntField("setID", -1);
entry.locStatus = tableData.getIntField(1, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.itemIDs = tableData.getStringField(2, ""); entry.itemIDs = tableData.getStringField("itemIDs", "");
entry.kitType = tableData.getIntField(3, -1); entry.kitType = tableData.getIntField("kitType", -1);
entry.kitRank = tableData.getIntField(4, -1); entry.kitRank = tableData.getIntField("kitRank", -1);
entry.kitImage = tableData.getIntField(5, -1); entry.kitImage = tableData.getIntField("kitImage", -1);
entry.skillSetWith2 = tableData.getIntField(6, -1); entry.skillSetWith2 = tableData.getIntField("skillSetWith2", -1);
entry.skillSetWith3 = tableData.getIntField(7, -1); entry.skillSetWith3 = tableData.getIntField("skillSetWith3", -1);
entry.skillSetWith4 = tableData.getIntField(8, -1); entry.skillSetWith4 = tableData.getIntField("skillSetWith4", -1);
entry.skillSetWith5 = tableData.getIntField(9, -1); entry.skillSetWith5 = tableData.getIntField("skillSetWith5", -1);
entry.skillSetWith6 = tableData.getIntField(10, -1); entry.skillSetWith6 = tableData.getIntField("skillSetWith6", -1);
entry.localize = tableData.getIntField(11, -1) == 1 ? true : false; entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false;
entry.gate_version = tableData.getStringField(12, ""); entry.gate_version = tableData.getStringField("gate_version", "");
entry.kitID = tableData.getIntField(13, -1); entry.kitID = tableData.getIntField("kitID", -1);
entry.priority = tableData.getFloatField(14, -1.0f); entry.priority = tableData.getFloatField("priority", -1.0f);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -66,3 +66,4 @@ std::vector<CDItemSets> CDItemSetsTable::Query(std::function<bool(CDItemSets)> p
std::vector<CDItemSets> CDItemSetsTable::GetEntries(void) const { std::vector<CDItemSets> CDItemSetsTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,9 +21,9 @@ CDLevelProgressionLookupTable::CDLevelProgressionLookupTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LevelProgressionLookup"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LevelProgressionLookup");
while (!tableData.eof()) { while (!tableData.eof()) {
CDLevelProgressionLookup entry; CDLevelProgressionLookup entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.requiredUScore = tableData.getIntField(1, -1); entry.requiredUScore = tableData.getIntField("requiredUScore", -1);
entry.BehaviorEffect = tableData.getStringField(2, ""); entry.BehaviorEffect = tableData.getStringField("BehaviorEffect", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -54,3 +54,4 @@ std::vector<CDLevelProgressionLookup> CDLevelProgressionLookupTable::Query(std::
std::vector<CDLevelProgressionLookup> CDLevelProgressionLookupTable::GetEntries(void) const { std::vector<CDLevelProgressionLookup> CDLevelProgressionLookupTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,15 +21,15 @@ CDLootMatrixTable::CDLootMatrixTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootMatrix"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootMatrix");
while (!tableData.eof()) { while (!tableData.eof()) {
CDLootMatrix entry; CDLootMatrix entry;
entry.LootMatrixIndex = tableData.getIntField(0, -1); entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
entry.LootTableIndex = tableData.getIntField(1, -1); entry.LootTableIndex = tableData.getIntField("LootTableIndex", -1);
entry.RarityTableIndex = tableData.getIntField(2, -1); entry.RarityTableIndex = tableData.getIntField("RarityTableIndex", -1);
entry.percent = tableData.getFloatField(3, -1.0f); entry.percent = tableData.getFloatField("percent", -1.0f);
entry.minToDrop = tableData.getIntField(4, -1); entry.minToDrop = tableData.getIntField("minToDrop", -1);
entry.maxToDrop = tableData.getIntField(5, -1); entry.maxToDrop = tableData.getIntField("maxToDrop", -1);
entry.id = tableData.getIntField(6, -1); entry.id = tableData.getIntField("id", -1);
entry.flagID = tableData.getIntField(7, -1); entry.flagID = tableData.getIntField("flagID", -1);
UNUSED(entry.gate_version = tableData.getStringField(8, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -60,3 +60,4 @@ std::vector<CDLootMatrix> CDLootMatrixTable::Query(std::function<bool(CDLootMatr
const std::vector<CDLootMatrix>& CDLootMatrixTable::GetEntries(void) const { const std::vector<CDLootMatrix>& CDLootMatrixTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,12 +21,12 @@ CDLootTableTable::CDLootTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootTable"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootTable");
while (!tableData.eof()) { while (!tableData.eof()) {
CDLootTable entry; CDLootTable entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.itemid = tableData.getIntField(0, -1); entry.itemid = tableData.getIntField("itemid", -1);
entry.LootTableIndex = tableData.getIntField(1, -1); entry.LootTableIndex = tableData.getIntField("LootTableIndex", -1);
entry.id = tableData.getIntField(2, -1); entry.id = tableData.getIntField("id", -1);
entry.MissionDrop = tableData.getIntField(3, -1) == 1 ? true : false; entry.MissionDrop = tableData.getIntField("MissionDrop", -1) == 1 ? true : false;
entry.sortPriority = tableData.getIntField(4, -1); entry.sortPriority = tableData.getIntField("sortPriority", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -57,3 +57,4 @@ std::vector<CDLootTable> CDLootTableTable::Query(std::function<bool(CDLootTable)
const std::vector<CDLootTable>& CDLootTableTable::GetEntries(void) const { const std::vector<CDLootTable>& CDLootTableTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,14 +21,14 @@ CDMissionEmailTable::CDMissionEmailTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionEmail"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionEmail");
while (!tableData.eof()) { while (!tableData.eof()) {
CDMissionEmail entry; CDMissionEmail entry;
entry.ID = tableData.getIntField(0, -1); entry.ID = tableData.getIntField("ID", -1);
entry.messageType = tableData.getIntField(1, -1); entry.messageType = tableData.getIntField("messageType", -1);
entry.notificationGroup = tableData.getIntField(2, -1); entry.notificationGroup = tableData.getIntField("notificationGroup", -1);
entry.missionID = tableData.getIntField(3, -1); entry.missionID = tableData.getIntField("missionID", -1);
entry.attachmentLOT = tableData.getIntField(4, 0); entry.attachmentLOT = tableData.getIntField("attachmentLOT", 0);
entry.localize = (bool)tableData.getIntField(5, -1); entry.localize = (bool)tableData.getIntField("localize", -1);
entry.locStatus = tableData.getIntField(6, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.gate_version = tableData.getStringField(7, ""); entry.gate_version = tableData.getStringField("gate_version", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -59,3 +59,4 @@ std::vector<CDMissionEmail> CDMissionEmailTable::Query(std::function<bool(CDMiss
std::vector<CDMissionEmail> CDMissionEmailTable::GetEntries(void) const { std::vector<CDMissionEmail> CDMissionEmailTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,11 +21,11 @@ CDMissionNPCComponentTable::CDMissionNPCComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionNPCComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionNPCComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDMissionNPCComponent entry; CDMissionNPCComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.missionID = tableData.getIntField(1, -1); entry.missionID = tableData.getIntField("missionID", -1);
entry.offersMission = tableData.getIntField(2, -1) == 1 ? true : false; entry.offersMission = tableData.getIntField("offersMission", -1) == 1 ? true : false;
entry.acceptsMission = tableData.getIntField(3, -1) == 1 ? true : false; entry.acceptsMission = tableData.getIntField("acceptsMission", -1) == 1 ? true : false;
entry.gate_version = tableData.getStringField(4, ""); entry.gate_version = tableData.getStringField("gate_version", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -56,3 +56,4 @@ std::vector<CDMissionNPCComponent> CDMissionNPCComponentTable::Query(std::functi
std::vector<CDMissionNPCComponent> CDMissionNPCComponentTable::GetEntries(void) const { std::vector<CDMissionNPCComponent> CDMissionNPCComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,19 +21,19 @@ CDMissionTasksTable::CDMissionTasksTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionTasks"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionTasks");
while (!tableData.eof()) { while (!tableData.eof()) {
CDMissionTasks entry; CDMissionTasks entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
UNUSED(entry.locStatus = tableData.getIntField(1, -1)); UNUSED(entry.locStatus = tableData.getIntField("locStatus", -1));
entry.taskType = tableData.getIntField(2, -1); entry.taskType = tableData.getIntField("taskType", -1);
entry.target = tableData.getIntField(3, -1); entry.target = tableData.getIntField("target", -1);
entry.targetGroup = tableData.getStringField(4, ""); entry.targetGroup = tableData.getStringField("targetGroup", "");
entry.targetValue = tableData.getIntField(5, -1); entry.targetValue = tableData.getIntField("targetValue", -1);
entry.taskParam1 = tableData.getStringField(6, ""); entry.taskParam1 = tableData.getStringField("taskParam1", "");
UNUSED(entry.largeTaskIcon = tableData.getStringField(7, "")); UNUSED(entry.largeTaskIcon = tableData.getStringField("largeTaskIcon", ""));
UNUSED(entry.IconID = tableData.getIntField(8, -1)); UNUSED(entry.IconID = tableData.getIntField("IconID", -1));
entry.uid = tableData.getIntField(9, -1); entry.uid = tableData.getIntField("uid", -1);
UNUSED(entry.largeTaskIconID = tableData.getIntField(10, -1)); UNUSED(entry.largeTaskIconID = tableData.getIntField("largeTaskIconID", -1));
UNUSED(entry.localize = tableData.getIntField(11, -1) == 1 ? true : false); UNUSED(entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false);
UNUSED(entry.gate_version = tableData.getStringField(12, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -78,3 +78,4 @@ std::vector<CDMissionTasks*> CDMissionTasksTable::GetByMissionID(uint32_t missio
const std::vector<CDMissionTasks>& CDMissionTasksTable::GetEntries(void) const { const std::vector<CDMissionTasks>& CDMissionTasksTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -23,58 +23,58 @@ CDMissionsTable::CDMissionsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Missions"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Missions");
while (!tableData.eof()) { while (!tableData.eof()) {
CDMissions entry; CDMissions entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.defined_type = tableData.getStringField(1, ""); entry.defined_type = tableData.getStringField("defined_type", "");
entry.defined_subtype = tableData.getStringField(2, ""); entry.defined_subtype = tableData.getStringField("defined_subtype", "");
entry.UISortOrder = tableData.getIntField(3, -1); entry.UISortOrder = tableData.getIntField("UISortOrder", -1);
entry.offer_objectID = tableData.getIntField(4, -1); entry.offer_objectID = tableData.getIntField("offer_objectID", -1);
entry.target_objectID = tableData.getIntField(5, -1); entry.target_objectID = tableData.getIntField("target_objectID", -1);
entry.reward_currency = tableData.getInt64Field(6, -1); entry.reward_currency = tableData.getInt64Field("reward_currency", -1);
entry.LegoScore = tableData.getIntField(7, -1); entry.LegoScore = tableData.getIntField("LegoScore", -1);
entry.reward_reputation = tableData.getIntField(8, -1); entry.reward_reputation = tableData.getIntField("reward_reputation", -1);
entry.isChoiceReward = tableData.getIntField(9, -1) == 1 ? true : false; entry.isChoiceReward = tableData.getIntField("isChoiceReward", -1) == 1 ? true : false;
entry.reward_item1 = tableData.getIntField(10, 0); entry.reward_item1 = tableData.getIntField("reward_item1", 0);
entry.reward_item1_count = tableData.getIntField(11, 0); entry.reward_item1_count = tableData.getIntField("reward_item1_count", 0);
entry.reward_item2 = tableData.getIntField(12, 0); entry.reward_item2 = tableData.getIntField("reward_item2", 0);
entry.reward_item2_count = tableData.getIntField(13, 0); entry.reward_item2_count = tableData.getIntField("reward_item2_count", 0);
entry.reward_item3 = tableData.getIntField(14, 0); entry.reward_item3 = tableData.getIntField("reward_item3", 0);
entry.reward_item3_count = tableData.getIntField(15, 0); entry.reward_item3_count = tableData.getIntField("reward_item3_count", 0);
entry.reward_item4 = tableData.getIntField(16, 0); entry.reward_item4 = tableData.getIntField("reward_item4", 0);
entry.reward_item4_count = tableData.getIntField(17, 0); entry.reward_item4_count = tableData.getIntField("reward_item4_count", 0);
entry.reward_emote = tableData.getIntField(18, -1); entry.reward_emote = tableData.getIntField("reward_emote", -1);
entry.reward_emote2 = tableData.getIntField(19, -1); entry.reward_emote2 = tableData.getIntField("reward_emote2", -1);
entry.reward_emote3 = tableData.getIntField(20, -1); entry.reward_emote3 = tableData.getIntField("reward_emote3", -1);
entry.reward_emote4 = tableData.getIntField(21, -1); entry.reward_emote4 = tableData.getIntField("reward_emote4", -1);
entry.reward_maximagination = tableData.getIntField(22, -1); entry.reward_maximagination = tableData.getIntField("reward_maximagination", -1);
entry.reward_maxhealth = tableData.getIntField(23, -1); entry.reward_maxhealth = tableData.getIntField("reward_maxhealth", -1);
entry.reward_maxinventory = tableData.getIntField(24, -1); entry.reward_maxinventory = tableData.getIntField("reward_maxinventory", -1);
entry.reward_maxmodel = tableData.getIntField(25, -1); entry.reward_maxmodel = tableData.getIntField("reward_maxmodel", -1);
entry.reward_maxwidget = tableData.getIntField(26, -1); entry.reward_maxwidget = tableData.getIntField("reward_maxwidget", -1);
entry.reward_maxwallet = tableData.getIntField(27, -1); entry.reward_maxwallet = tableData.getIntField("reward_maxwallet", -1);
entry.repeatable = tableData.getIntField(28, -1) == 1 ? true : false; entry.repeatable = tableData.getIntField("repeatable", -1) == 1 ? true : false;
entry.reward_currency_repeatable = tableData.getIntField(29, -1); entry.reward_currency_repeatable = tableData.getIntField("reward_currency_repeatable", -1);
entry.reward_item1_repeatable = tableData.getIntField(30, -1); entry.reward_item1_repeatable = tableData.getIntField("reward_item1_repeatable", -1);
entry.reward_item1_repeat_count = tableData.getIntField(31, -1); entry.reward_item1_repeat_count = tableData.getIntField("reward_item1_repeat_count", -1);
entry.reward_item2_repeatable = tableData.getIntField(32, -1); entry.reward_item2_repeatable = tableData.getIntField("reward_item2_repeatable", -1);
entry.reward_item2_repeat_count = tableData.getIntField(33, -1); entry.reward_item2_repeat_count = tableData.getIntField("reward_item2_repeat_count", -1);
entry.reward_item3_repeatable = tableData.getIntField(34, -1); entry.reward_item3_repeatable = tableData.getIntField("reward_item3_repeatable", -1);
entry.reward_item3_repeat_count = tableData.getIntField(35, -1); entry.reward_item3_repeat_count = tableData.getIntField("reward_item3_repeat_count", -1);
entry.reward_item4_repeatable = tableData.getIntField(36, -1); entry.reward_item4_repeatable = tableData.getIntField("reward_item4_repeatable", -1);
entry.reward_item4_repeat_count = tableData.getIntField(37, -1); entry.reward_item4_repeat_count = tableData.getIntField("reward_item4_repeat_count", -1);
entry.time_limit = tableData.getIntField(38, -1); entry.time_limit = tableData.getIntField("time_limit", -1);
entry.isMission = tableData.getIntField(39, -1) ? true : false; entry.isMission = tableData.getIntField("isMission", -1) ? true : false;
entry.missionIconID = tableData.getIntField(40, -1); entry.missionIconID = tableData.getIntField("missionIconID", -1);
entry.prereqMissionID = tableData.getStringField(41, ""); entry.prereqMissionID = tableData.getStringField("prereqMissionID", "");
entry.localize = tableData.getIntField(42, -1) == 1 ? true : false; entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false;
entry.inMOTD = tableData.getIntField(43, -1) == 1 ? true : false; entry.inMOTD = tableData.getIntField("inMOTD", -1) == 1 ? true : false;
entry.cooldownTime = tableData.getInt64Field(44, -1); entry.cooldownTime = tableData.getInt64Field("cooldownTime", -1);
entry.isRandom = tableData.getIntField(45, -1) == 1 ? true : false; entry.isRandom = tableData.getIntField("isRandom", -1) == 1 ? true : false;
entry.randomPool = tableData.getStringField(46, ""); entry.randomPool = tableData.getStringField("randomPool", "");
entry.UIPrereqID = tableData.getIntField(47, -1); entry.UIPrereqID = tableData.getIntField("UIPrereqID", -1);
UNUSED(entry.gate_version = tableData.getStringField(48, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
UNUSED(entry.HUDStates = tableData.getStringField(49, "")); UNUSED(entry.HUDStates = tableData.getStringField("HUDStates", ""));
UNUSED(entry.locStatus = tableData.getIntField(50, -1)); UNUSED(entry.locStatus = tableData.getIntField("locStatus", -1));
entry.reward_bankinventory = tableData.getIntField(51, -1); entry.reward_bankinventory = tableData.getIntField("reward_bankinventory", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -131,3 +131,4 @@ const CDMissions& CDMissionsTable::GetByMissionID(uint32_t missionID, bool& foun
return Default; return Default;
} }

View File

@ -21,14 +21,14 @@ CDMovementAIComponentTable::CDMovementAIComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MovementAIComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MovementAIComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDMovementAIComponent entry; CDMovementAIComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.MovementType = tableData.getStringField(1, ""); entry.MovementType = tableData.getStringField("MovementType", "");
entry.WanderChance = tableData.getFloatField(2, -1.0f); entry.WanderChance = tableData.getFloatField("WanderChance", -1.0f);
entry.WanderDelayMin = tableData.getFloatField(3, -1.0f); entry.WanderDelayMin = tableData.getFloatField("WanderDelayMin", -1.0f);
entry.WanderDelayMax = tableData.getFloatField(4, -1.0f); entry.WanderDelayMax = tableData.getFloatField("WanderDelayMax", -1.0f);
entry.WanderSpeed = tableData.getFloatField(5, -1.0f); entry.WanderSpeed = tableData.getFloatField("WanderSpeed", -1.0f);
entry.WanderRadius = tableData.getFloatField(6, -1.0f); entry.WanderRadius = tableData.getFloatField("WanderRadius", -1.0f);
entry.attachedPath = tableData.getStringField(7, ""); entry.attachedPath = tableData.getStringField("attachedPath", "");
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -59,3 +59,4 @@ std::vector<CDMovementAIComponent> CDMovementAIComponentTable::Query(std::functi
std::vector<CDMovementAIComponent> CDMovementAIComponentTable::GetEntries(void) const { std::vector<CDMovementAIComponent> CDMovementAIComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,10 +21,10 @@ CDObjectSkillsTable::CDObjectSkillsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ObjectSkills"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ObjectSkills");
while (!tableData.eof()) { while (!tableData.eof()) {
CDObjectSkills entry; CDObjectSkills entry;
entry.objectTemplate = tableData.getIntField(0, -1); entry.objectTemplate = tableData.getIntField("objectTemplate", -1);
entry.skillID = tableData.getIntField(1, -1); entry.skillID = tableData.getIntField("skillID", -1);
entry.castOnType = tableData.getIntField(2, -1); entry.castOnType = tableData.getIntField("castOnType", -1);
entry.AICombatWeight = tableData.getIntField(3, -1); entry.AICombatWeight = tableData.getIntField("AICombatWeight", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -55,3 +55,4 @@ std::vector<CDObjectSkills> CDObjectSkillsTable::Query(std::function<bool(CDObje
std::vector<CDObjectSkills> CDObjectSkillsTable::GetEntries(void) const { std::vector<CDObjectSkills> CDObjectSkillsTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -18,20 +18,20 @@ CDObjectsTable::CDObjectsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Objects"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Objects");
while (!tableData.eof()) { while (!tableData.eof()) {
CDObjects entry; CDObjects entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.name = tableData.getStringField(1, ""); entry.name = tableData.getStringField("name", "");
entry.placeable = tableData.getIntField(2, -1); entry.placeable = tableData.getIntField("placeable", -1);
entry.type = tableData.getStringField(3, ""); entry.type = tableData.getStringField("type", "");
entry.description = tableData.getStringField(4, ""); entry.description = tableData.getStringField("description", "");
entry.localize = tableData.getIntField(5, -1); entry.localize = tableData.getIntField("localize", -1);
entry.npcTemplateID = tableData.getIntField(6, -1); entry.npcTemplateID = tableData.getIntField("npcTemplateID", -1);
entry.displayName = tableData.getStringField(7, ""); entry.displayName = tableData.getStringField("displayName", "");
entry.interactionDistance = tableData.getFloatField(8, -1.0f); entry.interactionDistance = tableData.getFloatField("interactionDistance", -1.0f);
entry.nametag = tableData.getIntField(9, -1); entry.nametag = tableData.getIntField("nametag", -1);
entry._internalNotes = tableData.getStringField(10, ""); entry._internalNotes = tableData.getStringField("_internalNotes", "");
entry.locStatus = tableData.getIntField(11, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.gate_version = tableData.getStringField(12, ""); entry.gate_version = tableData.getStringField("gate_version", "");
entry.HQ_valid = tableData.getIntField(13, -1); entry.HQ_valid = tableData.getIntField("HQ_valid", -1);
this->entries.insert(std::make_pair(entry.id, entry)); this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow(); tableData.nextRow();
@ -71,20 +71,20 @@ const CDObjects& CDObjectsTable::GetByID(unsigned int LOT) {
// Now get the data // Now get the data
while (!tableData.eof()) { while (!tableData.eof()) {
CDObjects entry; CDObjects entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.name = tableData.getStringField(1, ""); entry.name = tableData.getStringField("name", "");
UNUSED(entry.placeable = tableData.getIntField(2, -1)); UNUSED(entry.placeable = tableData.getIntField("placeable", -1));
entry.type = tableData.getStringField(3, ""); entry.type = tableData.getStringField("type", "");
UNUSED(ntry.description = tableData.getStringField(4, "")); UNUSED(ntry.description = tableData.getStringField(4, ""));
UNUSED(entry.localize = tableData.getIntField(5, -1)); UNUSED(entry.localize = tableData.getIntField("localize", -1));
UNUSED(entry.npcTemplateID = tableData.getIntField(6, -1)); UNUSED(entry.npcTemplateID = tableData.getIntField("npcTemplateID", -1));
UNUSED(entry.displayName = tableData.getStringField(7, "")); UNUSED(entry.displayName = tableData.getStringField("displayName", ""));
entry.interactionDistance = tableData.getFloatField(8, -1.0f); entry.interactionDistance = tableData.getFloatField("interactionDistance", -1.0f);
UNUSED(entry.nametag = tableData.getIntField(9, -1)); UNUSED(entry.nametag = tableData.getIntField("nametag", -1));
UNUSED(entry._internalNotes = tableData.getStringField(10, "")); UNUSED(entry._internalNotes = tableData.getStringField("_internalNotes", ""));
UNUSED(entry.locStatus = tableData.getIntField(11, -1)); UNUSED(entry.locStatus = tableData.getIntField("locStatus", -1));
UNUSED(entry.gate_version = tableData.getStringField(12, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
UNUSED(entry.HQ_valid = tableData.getIntField(13, -1)); UNUSED(entry.HQ_valid = tableData.getIntField("HQ_valid", -1));
this->entries.insert(std::make_pair(entry.id, entry)); this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow(); tableData.nextRow();
@ -100,3 +100,4 @@ const CDObjects& CDObjectsTable::GetByID(unsigned int LOT) {
return m_default; return m_default;
} }

View File

@ -21,9 +21,9 @@ CDPackageComponentTable::CDPackageComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PackageComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PackageComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDPackageComponent entry; CDPackageComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.LootMatrixIndex = tableData.getIntField(1, -1); entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
entry.packageType = tableData.getIntField(2, -1); entry.packageType = tableData.getIntField("packageType", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -54,3 +54,4 @@ std::vector<CDPackageComponent> CDPackageComponentTable::Query(std::function<boo
std::vector<CDPackageComponent> CDPackageComponentTable::GetEntries(void) const { std::vector<CDPackageComponent> CDPackageComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -4,22 +4,22 @@ CDPhysicsComponentTable::CDPhysicsComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PhysicsComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PhysicsComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDPhysicsComponent* entry = new CDPhysicsComponent(); CDPhysicsComponent* entry = new CDPhysicsComponent();
entry->id = tableData.getIntField(0, -1); entry->id = tableData.getIntField("id", -1);
entry->bStatic = tableData.getIntField(1, -1) != 0; entry->bStatic = tableData.getIntField("static", -1) != 0;
entry->physicsAsset = tableData.getStringField(2, ""); entry->physicsAsset = tableData.getStringField("physics_asset", "");
UNUSED(entry->jump = tableData.getIntField(3, -1) != 0); UNUSED(entry->jump = tableData.getIntField("jump", -1) != 0);
UNUSED(entry->doublejump = tableData.getIntField(4, -1) != 0); UNUSED(entry->doublejump = tableData.getIntField("doublejump", -1) != 0);
entry->speed = tableData.getFloatField(5, -1); entry->speed = tableData.getFloatField("speed", -1);
UNUSED(entry->rotSpeed = tableData.getFloatField(6, -1)); UNUSED(entry->rotSpeed = tableData.getFloatField("rotSpeed", -1));
entry->playerHeight = tableData.getFloatField(7); entry->playerHeight = tableData.getFloatField("playerHeight");
entry->playerRadius = tableData.getFloatField(8); entry->playerRadius = tableData.getFloatField("playerRadius");
entry->pcShapeType = tableData.getIntField(9); entry->pcShapeType = tableData.getIntField("pcShapeType");
entry->collisionGroup = tableData.getIntField(10); entry->collisionGroup = tableData.getIntField("collisionGroup");
UNUSED(entry->airSpeed = tableData.getFloatField(11)); UNUSED(entry->airSpeed = tableData.getFloatField("airSpeed"));
UNUSED(entry->boundaryAsset = tableData.getStringField(12)); UNUSED(entry->boundaryAsset = tableData.getStringField("boundaryAsset"));
UNUSED(entry->jumpAirSpeed = tableData.getFloatField(13)); UNUSED(entry->jumpAirSpeed = tableData.getFloatField("jumpAirSpeed"));
UNUSED(entry->friction = tableData.getFloatField(14)); UNUSED(entry->friction = tableData.getFloatField("friction"));
UNUSED(entry->gravityVolumeAsset = tableData.getStringField(15)); UNUSED(entry->gravityVolumeAsset = tableData.getStringField("gravityVolumeAsset"));
m_entries.insert(std::make_pair(entry->id, entry)); m_entries.insert(std::make_pair(entry->id, entry));
tableData.nextRow(); tableData.nextRow();
@ -47,3 +47,4 @@ CDPhysicsComponent* CDPhysicsComponentTable::GetByID(unsigned int componentID) {
return nullptr; return nullptr;
} }

View File

@ -18,11 +18,11 @@ CDPropertyEntranceComponentTable::CDPropertyEntranceComponentTable() {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyEntranceComponent;"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyEntranceComponent;");
while (!tableData.eof()) { while (!tableData.eof()) {
auto entry = CDPropertyEntranceComponent{ auto entry = CDPropertyEntranceComponent{
static_cast<uint32_t>(tableData.getIntField(0, -1)), static_cast<uint32_t>(tableData.getIntField("id", -1)),
static_cast<uint32_t>(tableData.getIntField(1, -1)), static_cast<uint32_t>(tableData.getIntField("mapID", -1)),
tableData.getStringField(2, ""), tableData.getStringField("propertyName", ""),
static_cast<bool>(tableData.getIntField(3, false)), static_cast<bool>(tableData.getIntField("isOnProperty", false)),
tableData.getStringField(4, "") tableData.getStringField("groupType", "")
}; };
this->entries.push_back(entry); this->entries.push_back(entry);
@ -46,3 +46,4 @@ CDPropertyEntranceComponent CDPropertyEntranceComponentTable::GetByID(uint32_t i
return defaultEntry; return defaultEntry;
} }

View File

@ -17,10 +17,10 @@ CDPropertyTemplateTable::CDPropertyTemplateTable() {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyTemplate;"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyTemplate;");
while (!tableData.eof()) { while (!tableData.eof()) {
auto entry = CDPropertyTemplate{ auto entry = CDPropertyTemplate{
static_cast<uint32_t>(tableData.getIntField(0, -1)), static_cast<uint32_t>(tableData.getIntField("id", -1)),
static_cast<uint32_t>(tableData.getIntField(1, -1)), static_cast<uint32_t>(tableData.getIntField("mapID", -1)),
static_cast<uint32_t>(tableData.getIntField(2, -1)), static_cast<uint32_t>(tableData.getIntField("vendorMapID", -1)),
tableData.getStringField(3, "") tableData.getStringField("spawnName", "")
}; };
this->entries.push_back(entry); this->entries.push_back(entry);
@ -44,3 +44,4 @@ CDPropertyTemplate CDPropertyTemplateTable::GetByMapID(uint32_t mapID) {
return defaultEntry; return defaultEntry;
} }

View File

@ -21,10 +21,10 @@ CDProximityMonitorComponentTable::CDProximityMonitorComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ProximityMonitorComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ProximityMonitorComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDProximityMonitorComponent entry; CDProximityMonitorComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.Proximities = tableData.getStringField(1, ""); entry.Proximities = tableData.getStringField("Proximities", "");
entry.LoadOnClient = tableData.getIntField(2, -1); entry.LoadOnClient = tableData.getIntField("LoadOnClient", -1);
entry.LoadOnServer = tableData.getIntField(3, -1); entry.LoadOnServer = tableData.getIntField("LoadOnServer", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -55,3 +55,4 @@ std::vector<CDProximityMonitorComponent> CDProximityMonitorComponentTable::Query
std::vector<CDProximityMonitorComponent> CDProximityMonitorComponentTable::GetEntries(void) const { std::vector<CDProximityMonitorComponent> CDProximityMonitorComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -6,35 +6,35 @@ CDRailActivatorComponentTable::CDRailActivatorComponentTable() {
while (!tableData.eof()) { while (!tableData.eof()) {
CDRailActivatorComponent entry; CDRailActivatorComponent entry;
entry.id = tableData.getIntField(0); entry.id = tableData.getIntField("id", 0);
entry.startAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField(1, "")); entry.startAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField("startAnim", ""));
entry.loopAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField(2, "")); entry.loopAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField("loopAnim", ""));
entry.stopAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField(3, "")); entry.stopAnimation = GeneralUtils::ASCIIToUTF16(tableData.getStringField("stopAnim", ""));
entry.startSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField(4, "")); entry.startSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField("startSound", ""));
entry.loopSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField(5, "")); entry.loopSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField("loopSound", ""));
entry.stopSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField(6, "")); entry.stopSound = GeneralUtils::ASCIIToUTF16(tableData.getStringField("stopSound", ""));
std::string loopEffectString(tableData.getStringField(7, "")); std::string loopEffectString(tableData.getStringField("effectIDs", ""));
entry.loopEffectID = EffectPairFromString(loopEffectString); entry.loopEffectID = EffectPairFromString(loopEffectString);
entry.preconditions = tableData.getStringField(8, "-1"); entry.preconditions = tableData.getStringField("preconditions", "-1");
entry.playerCollision = tableData.getIntField(9, 0); entry.playerCollision = tableData.getIntField("playerCollision", 0);
entry.cameraLocked = tableData.getIntField(10, 0); entry.cameraLocked = tableData.getIntField("cameraLocked", 0);
std::string startEffectString(tableData.getStringField(11, "")); std::string startEffectString(tableData.getStringField("StartEffectID", ""));
entry.startEffectID = EffectPairFromString(startEffectString); entry.startEffectID = EffectPairFromString(startEffectString);
std::string stopEffectString(tableData.getStringField(12, "")); std::string stopEffectString(tableData.getStringField("StopEffectID", ""));
entry.stopEffectID = EffectPairFromString(stopEffectString); entry.stopEffectID = EffectPairFromString(stopEffectString);
entry.damageImmune = tableData.getIntField(13, 0); entry.damageImmune = tableData.getIntField("DamageImmune", 0);
entry.noAggro = tableData.getIntField(14, 0); entry.noAggro = tableData.getIntField("NoAggro", 0);
entry.showNameBillboard = tableData.getIntField(15, 0); entry.showNameBillboard = tableData.getIntField("ShowNameBillboard", 0);
m_Entries.push_back(entry); m_Entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -70,3 +70,4 @@ std::pair<uint32_t, std::u16string> CDRailActivatorComponentTable::EffectPairFro
return {}; return {};
} }

View File

@ -21,10 +21,10 @@ CDRarityTableTable::CDRarityTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RarityTable"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RarityTable");
while (!tableData.eof()) { while (!tableData.eof()) {
CDRarityTable entry; CDRarityTable entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.randmax = tableData.getFloatField(1, -1); entry.randmax = tableData.getFloatField("randmax", -1);
entry.rarity = tableData.getIntField(2, -1); entry.rarity = tableData.getIntField("rarity", -1);
entry.RarityTableIndex = tableData.getIntField(3, -1); entry.RarityTableIndex = tableData.getIntField("RarityTableIndex", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -55,3 +55,4 @@ std::vector<CDRarityTable> CDRarityTableTable::Query(std::function<bool(CDRarity
const std::vector<CDRarityTable>& CDRarityTableTable::GetEntries(void) const { const std::vector<CDRarityTable>& CDRarityTableTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -21,16 +21,16 @@ CDRebuildComponentTable::CDRebuildComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RebuildComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RebuildComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDRebuildComponent entry; CDRebuildComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.reset_time = tableData.getFloatField(1, -1.0f); entry.reset_time = tableData.getFloatField("reset_time", -1.0f);
entry.complete_time = tableData.getFloatField(2, -1.0f); entry.complete_time = tableData.getFloatField("complete_time", -1.0f);
entry.take_imagination = tableData.getIntField(3, -1); entry.take_imagination = tableData.getIntField("take_imagination", -1);
entry.interruptible = tableData.getIntField(4, -1) == 1 ? true : false; entry.interruptible = tableData.getIntField("interruptible", -1) == 1 ? true : false;
entry.self_activator = tableData.getIntField(5, -1) == 1 ? true : false; entry.self_activator = tableData.getIntField("self_activator", -1) == 1 ? true : false;
entry.custom_modules = tableData.getStringField(6, ""); entry.custom_modules = tableData.getStringField("custom_modules", "");
entry.activityID = tableData.getIntField(7, -1); entry.activityID = tableData.getIntField("activityID", -1);
entry.post_imagination_cost = tableData.getIntField(8, -1); entry.post_imagination_cost = tableData.getIntField("post_imagination_cost", -1);
entry.time_before_smash = tableData.getFloatField(9, -1.0f); entry.time_before_smash = tableData.getFloatField("time_before_smash", -1.0f);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -61,3 +61,4 @@ std::vector<CDRebuildComponent> CDRebuildComponentTable::Query(std::function<boo
std::vector<CDRebuildComponent> CDRebuildComponentTable::GetEntries(void) const { std::vector<CDRebuildComponent> CDRebuildComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -4,12 +4,12 @@ CDRewardsTable::CDRewardsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Rewards"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Rewards");
while (!tableData.eof()) { while (!tableData.eof()) {
CDRewards* entry = new CDRewards(); CDRewards* entry = new CDRewards();
entry->id = tableData.getIntField(0, -1); entry->id = tableData.getIntField("id", -1);
entry->levelID = tableData.getIntField(1, -1); entry->levelID = tableData.getIntField("LevelID", -1);
entry->missionID = tableData.getIntField(2, -1); entry->missionID = tableData.getIntField("MissionID", -1);
entry->rewardType = tableData.getIntField(3, -1); entry->rewardType = tableData.getIntField("RewardType", -1);
entry->value = tableData.getIntField(4, -1); entry->value = tableData.getIntField("value", -1);
entry->count = tableData.getIntField(5, -1); entry->count = tableData.getIntField("count", -1);
m_entries.insert(std::make_pair(entry->id, entry)); m_entries.insert(std::make_pair(entry->id, entry));
tableData.nextRow(); tableData.nextRow();
@ -38,3 +38,4 @@ std::vector<CDRewards*> CDRewardsTable::GetByLevelID(uint32_t levelID) {
return result; return result;
} }

View File

@ -18,9 +18,9 @@ CDScriptComponentTable::CDScriptComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ScriptComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ScriptComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDScriptComponent entry; CDScriptComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.script_name = tableData.getStringField(1, ""); entry.script_name = tableData.getStringField("script_name", "");
entry.client_script_name = tableData.getStringField(2, ""); entry.client_script_name = tableData.getStringField("client_script_name", "");
this->entries.insert(std::make_pair(entry.id, entry)); this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow(); tableData.nextRow();
@ -45,3 +45,4 @@ const CDScriptComponent& CDScriptComponentTable::GetByID(unsigned int id) {
return m_ToReturnWhenNoneFound; return m_ToReturnWhenNoneFound;
} }

View File

@ -23,25 +23,25 @@ CDSkillBehaviorTable::CDSkillBehaviorTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SkillBehavior"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SkillBehavior");
while (!tableData.eof()) { while (!tableData.eof()) {
CDSkillBehavior entry; CDSkillBehavior entry;
entry.skillID = tableData.getIntField(0, -1); entry.skillID = tableData.getIntField("skillID", -1);
UNUSED(entry.locStatus = tableData.getIntField(1, -1)); UNUSED(entry.locStatus = tableData.getIntField("locStatus", -1));
entry.behaviorID = tableData.getIntField(2, -1); entry.behaviorID = tableData.getIntField("behaviorID", -1);
entry.imaginationcost = tableData.getIntField(3, -1); entry.imaginationcost = tableData.getIntField("imaginationcost", -1);
entry.cooldowngroup = tableData.getIntField(4, -1); entry.cooldowngroup = tableData.getIntField("cooldowngroup", -1);
entry.cooldown = tableData.getFloatField(5, -1.0f); entry.cooldown = tableData.getFloatField("cooldown", -1.0f);
UNUSED(entry.isNpcEditor = tableData.getIntField(6, -1) == 1 ? true : false); UNUSED(entry.isNpcEditor = tableData.getIntField("isNpcEditor", -1) == 1 ? true : false);
UNUSED(entry.skillIcon = tableData.getIntField(7, -1)); UNUSED(entry.skillIcon = tableData.getIntField("skillIcon", -1));
UNUSED(entry.oomSkillID = tableData.getStringField(8, "")); UNUSED(entry.oomSkillID = tableData.getStringField("oomSkillID", ""));
UNUSED(entry.oomBehaviorEffectID = tableData.getIntField(9, -1)); UNUSED(entry.oomBehaviorEffectID = tableData.getIntField("oomBehaviorEffectID", -1));
UNUSED(entry.castTypeDesc = tableData.getIntField(10, -1)); UNUSED(entry.castTypeDesc = tableData.getIntField("castTypeDesc", -1));
UNUSED(entry.imBonusUI = tableData.getIntField(11, -1)); UNUSED(entry.imBonusUI = tableData.getIntField("imBonusUI", -1));
UNUSED(entry.lifeBonusUI = tableData.getIntField(12, -1)); UNUSED(entry.lifeBonusUI = tableData.getIntField("lifeBonusUI", -1));
UNUSED(entry.armorBonusUI = tableData.getIntField(13, -1)); UNUSED(entry.armorBonusUI = tableData.getIntField("armorBonusUI", -1));
UNUSED(entry.damageUI = tableData.getIntField(14, -1)); UNUSED(entry.damageUI = tableData.getIntField("damageUI", -1));
UNUSED(entry.hideIcon = tableData.getIntField(15, -1) == 1 ? true : false); UNUSED(entry.hideIcon = tableData.getIntField("hideIcon", -1) == 1 ? true : false);
UNUSED(entry.localize = tableData.getIntField(16, -1) == 1 ? true : false); UNUSED(entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false);
UNUSED(entry.gate_version = tableData.getStringField(17, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
UNUSED(entry.cancelType = tableData.getIntField(18, -1)); UNUSED(entry.cancelType = tableData.getIntField("cancelType", -1));
this->entries.insert(std::make_pair(entry.skillID, entry)); this->entries.insert(std::make_pair(entry.skillID, entry));
//this->entries.push_back(entry); //this->entries.push_back(entry);
@ -82,3 +82,4 @@ const CDSkillBehavior& CDSkillBehaviorTable::GetSkillByID(unsigned int skillID)
return m_empty; return m_empty;
} }

View File

@ -21,11 +21,11 @@ CDVendorComponentTable::CDVendorComponentTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VendorComponent"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VendorComponent");
while (!tableData.eof()) { while (!tableData.eof()) {
CDVendorComponent entry; CDVendorComponent entry;
entry.id = tableData.getIntField(0, -1); entry.id = tableData.getIntField("id", -1);
entry.buyScalar = tableData.getFloatField(1, -1.0f); entry.buyScalar = tableData.getFloatField("buyScalar", -1.0f);
entry.sellScalar = tableData.getFloatField(2, -1.0f); entry.sellScalar = tableData.getFloatField("sellScalar", -1.0f);
entry.refreshTimeSeconds = tableData.getFloatField(3, -1.0f); entry.refreshTimeSeconds = tableData.getFloatField("refreshTimeSeconds", -1.0f);
entry.LootMatrixIndex = tableData.getIntField(4, -1); entry.LootMatrixIndex = tableData.getIntField("LootMatrixIndex", -1);
this->entries.push_back(entry); this->entries.push_back(entry);
tableData.nextRow(); tableData.nextRow();
@ -56,3 +56,4 @@ std::vector<CDVendorComponent> CDVendorComponentTable::Query(std::function<bool(
std::vector<CDVendorComponent> CDVendorComponentTable::GetEntries(void) const { std::vector<CDVendorComponent> CDVendorComponentTable::GetEntries(void) const {
return this->entries; return this->entries;
} }

View File

@ -18,33 +18,33 @@ CDZoneTableTable::CDZoneTableTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ZoneTable"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ZoneTable");
while (!tableData.eof()) { while (!tableData.eof()) {
CDZoneTable entry; CDZoneTable entry;
entry.zoneID = tableData.getIntField(0, -1); entry.zoneID = tableData.getIntField("zoneID", -1);
entry.locStatus = tableData.getIntField(1, -1); entry.locStatus = tableData.getIntField("locStatus", -1);
entry.zoneName = tableData.getStringField(2, ""); entry.zoneName = tableData.getStringField("zoneName", "");
entry.scriptID = tableData.getIntField(3, -1); entry.scriptID = tableData.getIntField("scriptID", -1);
entry.ghostdistance_min = tableData.getFloatField(4, -1.0f); entry.ghostdistance_min = tableData.getFloatField("ghostdistance_min", -1.0f);
entry.ghostdistance = tableData.getFloatField(5, -1.0f); entry.ghostdistance = tableData.getFloatField("ghostdistance", -1.0f);
entry.population_soft_cap = tableData.getIntField(6, -1); entry.population_soft_cap = tableData.getIntField("population_soft_cap", -1);
entry.population_hard_cap = tableData.getIntField(7, -1); entry.population_hard_cap = tableData.getIntField("population_hard_cap", -1);
UNUSED(entry.DisplayDescription = tableData.getStringField(8, "")); UNUSED(entry.DisplayDescription = tableData.getStringField("DisplayDescription", ""));
UNUSED(entry.mapFolder = tableData.getStringField(9, "")); UNUSED(entry.mapFolder = tableData.getStringField("mapFolder", ""));
entry.smashableMinDistance = tableData.getFloatField(10, -1.0f); entry.smashableMinDistance = tableData.getFloatField("smashableMinDistance", -1.0f);
entry.smashableMaxDistance = tableData.getFloatField(11, -1.0f); entry.smashableMaxDistance = tableData.getFloatField("smashableMaxDistance", -1.0f);
UNUSED(entry.mixerProgram = tableData.getStringField(12, "")); UNUSED(entry.mixerProgram = tableData.getStringField("mixerProgram", ""));
UNUSED(entry.clientPhysicsFramerate = tableData.getStringField(13, "")); UNUSED(entry.clientPhysicsFramerate = tableData.getStringField("clientPhysicsFramerate", ""));
UNUSED(entry.serverPhysicsFramerate = tableData.getStringField(14, "")); UNUSED(entry.serverPhysicsFramerate = tableData.getStringField("serverPhysicsFramerate", ""));
entry.zoneControlTemplate = tableData.getIntField(15, -1); entry.zoneControlTemplate = tableData.getIntField("zoneControlTemplate", -1);
entry.widthInChunks = tableData.getIntField(16, -1); entry.widthInChunks = tableData.getIntField("widthInChunks", -1);
entry.heightInChunks = tableData.getIntField(17, -1); entry.heightInChunks = tableData.getIntField("heightInChunks", -1);
entry.petsAllowed = tableData.getIntField(18, -1) == 1 ? true : false; entry.petsAllowed = tableData.getIntField("petsAllowed", -1) == 1 ? true : false;
entry.localize = tableData.getIntField(19, -1) == 1 ? true : false; entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false;
entry.fZoneWeight = tableData.getFloatField(20, -1.0f); entry.fZoneWeight = tableData.getFloatField("fZoneWeight", -1.0f);
UNUSED(entry.thumbnail = tableData.getStringField(21, "")); UNUSED(entry.thumbnail = tableData.getStringField("thumbnail", ""));
entry.PlayerLoseCoinsOnDeath = tableData.getIntField(22, -1) == 1 ? true : false; entry.PlayerLoseCoinsOnDeath = tableData.getIntField("PlayerLoseCoinsOnDeath", -1) == 1 ? true : false;
UNUSED(entry.disableSaveLoc = tableData.getIntField(23, -1) == 1 ? true : false); UNUSED(entry.disableSaveLoc = tableData.getIntField("disableSaveLoc", -1) == 1 ? true : false);
entry.teamRadius = tableData.getFloatField(24, -1.0f); entry.teamRadius = tableData.getFloatField("teamRadius", -1.0f);
UNUSED(entry.gate_version = tableData.getStringField(25, "")); UNUSED(entry.gate_version = tableData.getStringField("gate_version", ""));
UNUSED(entry.mountsAllowed = tableData.getIntField(26, -1) == 1 ? true : false); UNUSED(entry.mountsAllowed = tableData.getIntField("mountsAllowed", -1) == 1 ? true : false);
this->m_Entries.insert(std::make_pair(entry.zoneID, entry)); this->m_Entries.insert(std::make_pair(entry.zoneID, entry));
tableData.nextRow(); tableData.nextRow();
@ -71,3 +71,4 @@ const CDZoneTable* CDZoneTableTable::Query(unsigned int zoneID) {
return nullptr; return nullptr;
} }

View File

@ -17,6 +17,11 @@
#include "UserManager.h" #include "UserManager.h"
#include "dpWorld.h" #include "dpWorld.h"
#include "Player.h" #include "Player.h"
#include "LUTriggers.h"
#include "User.h"
#include "EntityTimer.h"
#include "EntityCallbackTimer.h"
#include "Loot.h"
//Component includes: //Component includes:
#include "Component.h" #include "Component.h"

View File

@ -4,30 +4,35 @@
#include <functional> #include <functional>
#include <typeinfo> #include <typeinfo>
#include <type_traits> #include <type_traits>
#include <unordered_map>
#include <vector> #include <vector>
#include "../thirdparty/raknet/Source/Replica.h"
#include "../thirdparty/raknet/Source/ReplicaManager.h"
#include "dCommonVars.h"
#include "User.h"
#include "NiPoint3.h" #include "NiPoint3.h"
#include "NiQuaternion.h" #include "NiQuaternion.h"
#include "LDFFormat.h" #include "LDFFormat.h"
#include "Loot.h"
#include "Zone.h"
#include "EntityTimer.h" namespace Loot {
#include "EntityCallbackTimer.h" class Info;
#include "EntityInfo.h" };
namespace tinyxml2 {
class XMLDocument;
};
namespace LUTriggers {
struct Trigger;
};
class Player; class Player;
class EntityInfo;
class User;
class Spawner; class Spawner;
class ScriptComponent; class ScriptComponent;
class dpEntity; class dpEntity;
class EntityTimer;
class Component; class Component;
class Item; class Item;
class Character; class Character;
class EntityCallbackTimer;
namespace CppScripts { namespace CppScripts {
class Script; class Script;

View File

@ -17,6 +17,7 @@
#include "MissionComponent.h" #include "MissionComponent.h"
#include "Game.h" #include "Game.h"
#include "dLogger.h" #include "dLogger.h"
#include "MessageIdentifiers.h"
EntityManager* EntityManager::m_Address = nullptr; EntityManager* EntityManager::m_Address = nullptr;

View File

@ -2,15 +2,17 @@
#define ENTITYMANAGER_H #define ENTITYMANAGER_H
#include "dCommonVars.h" #include "dCommonVars.h"
#include "../thirdparty/raknet/Source/Replica.h"
#include <map> #include <map>
#include <stack> #include <stack>
#include "Entity.h"
#include <vector> #include <vector>
#include <unordered_map>
class Entity;
class EntityInfo;
class Player;
class User;
struct SystemAddress; struct SystemAddress;
class User;
class EntityManager { class EntityManager {
public: public:

View File

@ -13,7 +13,9 @@
#include "dZoneManager.h" #include "dZoneManager.h"
#include "CharacterComponent.h" #include "CharacterComponent.h"
#include "Mail.h" #include "Mail.h"
#include "User.h"
#include "CppScripts.h" #include "CppScripts.h"
#include "Loot.h"
std::vector<Player*> Player::m_Players = {}; std::vector<Player*> Player::m_Players = {};

View File

@ -22,6 +22,7 @@
#include "SkillComponent.h" #include "SkillComponent.h"
#include "AssetManager.h" #include "AssetManager.h"
#include "CDClientDatabase.h" #include "CDClientDatabase.h"
#include "dMessageIdentifiers.h"
UserManager* UserManager::m_Address = nullptr; UserManager* UserManager::m_Address = nullptr;

View File

@ -48,6 +48,7 @@
#include "PlayEffectBehavior.h" #include "PlayEffectBehavior.h"
#include "DamageAbsorptionBehavior.h" #include "DamageAbsorptionBehavior.h"
#include "VentureVisionBehavior.h" #include "VentureVisionBehavior.h"
#include "PropertyTeleportBehavior.h"
#include "BlockBehavior.h" #include "BlockBehavior.h"
#include "ClearTargetBehavior.h" #include "ClearTargetBehavior.h"
#include "PullToPointBehavior.h" #include "PullToPointBehavior.h"
@ -263,7 +264,9 @@ Behavior* Behavior::CreateBehavior(const uint32_t behaviorId) {
case BehaviorTemplates::BEHAVIOR_DAMAGE_REDUCTION: case BehaviorTemplates::BEHAVIOR_DAMAGE_REDUCTION:
behavior = new DamageReductionBehavior(behaviorId); behavior = new DamageReductionBehavior(behaviorId);
break; break;
case BehaviorTemplates::BEHAVIOR_PROPERTY_TELEPORT: break; case BehaviorTemplates::BEHAVIOR_PROPERTY_TELEPORT:
behavior = new PropertyTeleportBehavior(behaviorId);
break;
case BehaviorTemplates::BEHAVIOR_PROPERTY_CLEAR_TARGET: case BehaviorTemplates::BEHAVIOR_PROPERTY_CLEAR_TARGET:
behavior = new ClearTargetBehavior(behaviorId); behavior = new ClearTargetBehavior(behaviorId);
break; break;

View File

@ -10,8 +10,9 @@
#include <sstream> #include <sstream>
#include "dMessageIdentifiers.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "EchoSyncSkill.h"
#include "PhantomPhysicsComponent.h" #include "PhantomPhysicsComponent.h"
#include "RebuildComponent.h" #include "RebuildComponent.h"
@ -216,7 +217,7 @@ bool BehaviorContext::CalculateUpdate(const float deltaTime) {
} }
// Echo sync // Echo sync
GameMessages::EchoSyncSkill echo; EchoSyncSkill echo;
echo.bDone = true; echo.bDone = true;
echo.uiBehaviorHandle = entry.handle; echo.uiBehaviorHandle = entry.handle;

View File

@ -35,6 +35,7 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp"
"OverTimeBehavior.cpp" "OverTimeBehavior.cpp"
"PlayEffectBehavior.cpp" "PlayEffectBehavior.cpp"
"ProjectileAttackBehavior.cpp" "ProjectileAttackBehavior.cpp"
"PropertyTeleportBehavior.cpp"
"PullToPointBehavior.cpp" "PullToPointBehavior.cpp"
"RemoveBuffBehavior.cpp" "RemoveBuffBehavior.cpp"
"RepairBehavior.cpp" "RepairBehavior.cpp"

View File

@ -6,28 +6,47 @@
#include "Game.h" #include "Game.h"
#include "dLogger.h" #include "dLogger.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "ControllablePhysicsComponent.h"
void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) { void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) {
auto* target = EntityManager::Instance()->GetEntity(branch.target); auto* target = EntityManager::Instance()->GetEntity(branch.target);
if (target == nullptr) { if (!target) {
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target); Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
return; return;
} }
auto* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(COMPONENT_TYPE_DESTROYABLE)); auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
if (destroyableComponent) {
if (destroyable == nullptr) { destroyableComponent->SetStatusImmunity(
return; eStateChangeType::PUSH,
this->m_ImmuneToBasicAttack,
this->m_ImmuneToDamageOverTime,
this->m_ImmuneToKnockback,
this->m_ImmuneToInterrupt,
this->m_ImmuneToSpeed,
this->m_ImmuneToImaginationGain,
this->m_ImmuneToImaginationLoss,
this->m_ImmuneToQuickbuildInterrupt,
this->m_ImmuneToPullToPoint
);
} }
if (!this->m_immuneBasicAttack) { auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
return; if (controllablePhysicsComponent) {
controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::PUSH,
context->caster,
this->m_ImmuneToStunAttack,
this->m_ImmuneToStunEquip,
this->m_ImmuneToStunInteract,
this->m_ImmuneToStunJump,
this->m_ImmuneToStunMove,
this->m_ImmuneToStunTurn,
this->m_ImmuneToStunUseItem
);
} }
destroyable->PushImmunity();
context->RegisterTimerBehavior(this, branch, target->GetObjectID()); context->RegisterTimerBehavior(this, branch, target->GetObjectID());
} }
@ -38,21 +57,60 @@ void ImmunityBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bi
void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, const LWOOBJID second) { void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, const LWOOBJID second) {
auto* target = EntityManager::Instance()->GetEntity(second); auto* target = EntityManager::Instance()->GetEntity(second);
if (target == nullptr) { if (!target) {
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", second); Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", second);
return; return;
} }
auto* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(COMPONENT_TYPE_DESTROYABLE)); auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
if (destroyableComponent) {
if (destroyable == nullptr) { destroyableComponent->SetStatusImmunity(
return; eStateChangeType::POP,
this->m_ImmuneToBasicAttack,
this->m_ImmuneToDamageOverTime,
this->m_ImmuneToKnockback,
this->m_ImmuneToInterrupt,
this->m_ImmuneToSpeed,
this->m_ImmuneToImaginationGain,
this->m_ImmuneToImaginationLoss,
this->m_ImmuneToQuickbuildInterrupt,
this->m_ImmuneToPullToPoint
);
}
auto* controllablePhysicsComponent = target->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) {
controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::POP,
context->caster,
this->m_ImmuneToStunAttack,
this->m_ImmuneToStunEquip,
this->m_ImmuneToStunInteract,
this->m_ImmuneToStunJump,
this->m_ImmuneToStunMove,
this->m_ImmuneToStunTurn,
this->m_ImmuneToStunUseItem
);
} }
destroyable->PopImmunity();
} }
void ImmunityBehavior::Load() { void ImmunityBehavior::Load() {
this->m_immuneBasicAttack = GetBoolean("immune_basic_attack"); //Stun
this->m_ImmuneToStunAttack = GetBoolean("immune_stun_attack", false);
this->m_ImmuneToStunEquip = GetBoolean("immune_stun_equip", false);
this->m_ImmuneToStunInteract = GetBoolean("immune_stun_interact", false);
this->m_ImmuneToStunMove = GetBoolean("immune_stun_move", false);
this->m_ImmuneToStunTurn = GetBoolean("immune_stun_rotate", false);
// Status
this->m_ImmuneToBasicAttack = GetBoolean("immune_basic_attack", false);
this->m_ImmuneToDamageOverTime = GetBoolean("immune_damage_over_time", false);
this->m_ImmuneToKnockback = GetBoolean("immune_knockback", false);
this->m_ImmuneToInterrupt = GetBoolean("immune_interrupt", false);
this->m_ImmuneToSpeed = GetBoolean("immune_speed", false);
this->m_ImmuneToImaginationGain = GetBoolean("immune_imagination_gain", false);
this->m_ImmuneToImaginationLoss = GetBoolean("immune_imagination_loss", false);
this->m_ImmuneToQuickbuildInterrupt = GetBoolean("immune_quickbuild_interrupts", false);
this->m_ImmuneToPullToPoint = GetBoolean("immune_pulltopoint", false);
} }

View File

@ -4,8 +4,6 @@
class ImmunityBehavior final : public Behavior class ImmunityBehavior final : public Behavior
{ {
public: public:
uint32_t m_immuneBasicAttack;
/* /*
* Inherited * Inherited
*/ */
@ -20,4 +18,25 @@ public:
void Timer(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) override; void Timer(BehaviorContext* context, BehaviorBranchContext branch, LWOOBJID second) override;
void Load() override; void Load() override;
private:
// stuns
bool m_ImmuneToStunAttack = false;
bool m_ImmuneToStunEquip = false;
bool m_ImmuneToStunInteract = false;
bool m_ImmuneToStunJump = false; // Unused
bool m_ImmuneToStunMove = false;
bool m_ImmuneToStunTurn = false;
bool m_ImmuneToStunUseItem = false; // Unused
//status
bool m_ImmuneToBasicAttack = false;
bool m_ImmuneToDamageOverTime = false;
bool m_ImmuneToKnockback = false;
bool m_ImmuneToInterrupt = false;
bool m_ImmuneToSpeed = false;
bool m_ImmuneToImaginationGain = false;
bool m_ImmuneToImaginationLoss = false;
bool m_ImmuneToQuickbuildInterrupt = false;
bool m_ImmuneToPullToPoint = false; // Unused in cdclient, but used in client
}; };

View File

@ -0,0 +1,61 @@
#include "PropertyTeleportBehavior.h"
#include "BehaviorBranchContext.h"
#include "BehaviorContext.h"
#include "Character.h"
#include "CharacterComponent.h"
#include "ChatPackets.h"
#include "WorldPackets.h"
#include "EntityManager.h"
#include "Game.h"
#include "ZoneInstanceManager.h"
#include "dZoneManager.h"
void PropertyTeleportBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
auto* caster = EntityManager::Instance()->GetEntity(context->caster);
if (!caster) return;
auto* character = caster->GetCharacter();
if (!character) return;
LWOOBJID objId = caster->GetObjectID();
LWOMAPID targetMapId = m_MapId;
LWOCLONEID targetCloneId = character->GetPropertyCloneID();
if (dZoneManager::Instance()->GetZoneID().GetCloneID() == character->GetPropertyCloneID()) {
targetMapId = character->GetLastNonInstanceZoneID();
targetCloneId = 0;
} else {
character->SetLastNonInstanceZoneID(dZoneManager::Instance()->GetZoneID().GetMapID());
}
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, targetMapId, targetCloneId, false, [objId](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
auto* entity = EntityManager::Instance()->GetEntity(objId);
if (!entity) return;
const auto sysAddr = entity->GetSystemAddress();
if (zoneClone != 0) ChatPackets::SendSystemMessage(sysAddr, u"Transfering to your property!");
else ChatPackets::SendSystemMessage(sysAddr, u"Transfering back to previous world!");
Game::logger->Log("PropertyTeleportBehavior", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
entity->GetCharacter()->SetZoneInstance(zoneInstance);
entity->GetCharacter()->SetZoneClone(zoneClone);
entity->GetComponent<CharacterComponent>()->SetLastRocketConfig(u"");
}
entity->GetCharacter()->SaveXMLToDatabase();
WorldPackets::SendTransferToWorld(sysAddr, serverIP, serverPort, mythranShift);
return;
});
}
void PropertyTeleportBehavior::Load() {
this->m_CancelIfInteracting = GetBoolean("cancel_if_interacting"); // TODO unused
this->m_MapId = LWOMAPID(GetInt("mapID"));
}

View File

@ -0,0 +1,21 @@
#pragma once
#include "Behavior.h"
class PropertyTeleportBehavior final : public Behavior
{
public:
/*
* Inherited
*/
explicit PropertyTeleportBehavior(const uint32_t behavior_id) : Behavior(behavior_id) {
}
void Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) override;
void Load() override;
private:
LWOMAPID m_MapId;
bool m_CancelIfInteracting;
};

View File

@ -7,6 +7,8 @@
#include "dLogger.h" #include "dLogger.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "RebuildComponent.h" #include "RebuildComponent.h"
#include "Entity.h"
#include "EntityInfo.h"
void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) { void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
auto* origin = EntityManager::Instance()->GetEntity(context->originator); auto* origin = EntityManager::Instance()->GetEntity(context->originator);

View File

@ -13,6 +13,7 @@
#include "VehiclePhysicsComponent.h" #include "VehiclePhysicsComponent.h"
#include "GameMessages.h" #include "GameMessages.h"
#include "Item.h" #include "Item.h"
#include "AMFFormat.h"
CharacterComponent::CharacterComponent(Entity* parent, Character* character) : Component(parent) { CharacterComponent::CharacterComponent(Entity* parent, Character* character) : Component(parent) {
m_Character = character; m_Character = character;

View File

@ -31,10 +31,25 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Com
m_GravityScale = 1; m_GravityScale = 1;
m_DirtyCheats = false; m_DirtyCheats = false;
m_IgnoreMultipliers = false; m_IgnoreMultipliers = false;
m_DirtyEquippedItemInfo = true;
m_PickupRadius = 0.0f; m_PickupRadius = 0.0f;
m_DirtyPickupRadiusScale = true;
m_DirtyBubble = false;
m_IsInBubble = false;
m_SpecialAnims = false;
m_BubbleType = eBubbleType::DEFAULT;
m_IsTeleporting = false; m_IsTeleporting = false;
m_ImmuneToStunAttackCount = 0;
m_ImmuneToStunEquipCount = 0;
m_ImmuneToStunInteractCount = 0;
m_ImmuneToStunJumpCount = 0;
m_ImmuneToStunMoveCount = 0;
m_ImmuneToStunTurnCount = 0;
m_ImmuneToStunUseItemCount = 0;
if (entity->GetLOT() != 1) // Other physics entities we care about will be added by BaseCombatAI if (entity->GetLOT() != 1) // Other physics entities we care about will be added by BaseCombatAI
return; return;
@ -71,7 +86,14 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bo
outBitStream->Write(m_JetpackBypassChecks); outBitStream->Write(m_JetpackBypassChecks);
} }
outBitStream->Write0(); //This contains info about immunities, but for now I'm leaving it out. outBitStream->Write1(); // always write these on construction
outBitStream->Write(m_ImmuneToStunMoveCount);
outBitStream->Write(m_ImmuneToStunJumpCount);
outBitStream->Write(m_ImmuneToStunTurnCount);
outBitStream->Write(m_ImmuneToStunAttackCount);
outBitStream->Write(m_ImmuneToStunUseItemCount);
outBitStream->Write(m_ImmuneToStunEquipCount);
outBitStream->Write(m_ImmuneToStunInteractCount);
} }
if (m_IgnoreMultipliers) m_DirtyCheats = false; if (m_IgnoreMultipliers) m_DirtyCheats = false;
@ -84,14 +106,22 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bo
m_DirtyCheats = false; m_DirtyCheats = false;
} }
outBitStream->Write(m_DirtyPickupRadiusScale); outBitStream->Write(m_DirtyEquippedItemInfo);
if (m_DirtyPickupRadiusScale) { if (m_DirtyEquippedItemInfo) {
outBitStream->Write(m_PickupRadius); outBitStream->Write(m_PickupRadius);
outBitStream->Write0(); //No clue what this is so im leaving it false. outBitStream->Write(m_InJetpackMode);
m_DirtyPickupRadiusScale = false; m_DirtyEquippedItemInfo = false;
} }
outBitStream->Write0(); outBitStream->Write(m_DirtyBubble);
if (m_DirtyBubble) {
outBitStream->Write(m_IsInBubble);
if (m_IsInBubble) {
outBitStream->Write(m_BubbleType);
outBitStream->Write(m_SpecialAnims);
}
m_DirtyBubble = false;
}
outBitStream->Write(m_DirtyPosition || bIsInitialUpdate); outBitStream->Write(m_DirtyPosition || bIsInitialUpdate);
if (m_DirtyPosition || bIsInitialUpdate) { if (m_DirtyPosition || bIsInitialUpdate) {
@ -248,7 +278,7 @@ void ControllablePhysicsComponent::AddPickupRadiusScale(float value) {
m_ActivePickupRadiusScales.push_back(value); m_ActivePickupRadiusScales.push_back(value);
if (value > m_PickupRadius) { if (value > m_PickupRadius) {
m_PickupRadius = value; m_PickupRadius = value;
m_DirtyPickupRadiusScale = true; m_DirtyEquippedItemInfo = true;
} }
} }
@ -264,7 +294,7 @@ void ControllablePhysicsComponent::RemovePickupRadiusScale(float value) {
// Recalculate pickup radius since we removed one by now // Recalculate pickup radius since we removed one by now
m_PickupRadius = 0.0f; m_PickupRadius = 0.0f;
m_DirtyPickupRadiusScale = true; m_DirtyEquippedItemInfo = true;
for (uint32_t i = 0; i < m_ActivePickupRadiusScales.size(); i++) { for (uint32_t i = 0; i < m_ActivePickupRadiusScales.size(); i++) {
auto candidateRadius = m_ActivePickupRadiusScales[i]; auto candidateRadius = m_ActivePickupRadiusScales[i];
if (m_PickupRadius < candidateRadius) m_PickupRadius = candidateRadius; if (m_PickupRadius < candidateRadius) m_PickupRadius = candidateRadius;
@ -298,3 +328,62 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
SetSpeedMultiplier(m_SpeedBoost / 500.0f); // 500 being the base speed SetSpeedMultiplier(m_SpeedBoost / 500.0f); // 500 being the base speed
EntityManager::Instance()->SerializeEntity(m_Parent); EntityManager::Instance()->SerializeEntity(m_Parent);
} }
void ControllablePhysicsComponent::ActivateBubbleBuff(eBubbleType bubbleType, bool specialAnims){
if (m_IsInBubble) {
Game::logger->Log("ControllablePhysicsComponent", "Already in bubble");
return;
}
m_BubbleType = bubbleType;
m_IsInBubble = true;
m_DirtyBubble = true;
m_SpecialAnims = specialAnims;
EntityManager::Instance()->SerializeEntity(m_Parent);
}
void ControllablePhysicsComponent::DeactivateBubbleBuff(){
m_DirtyBubble = true;
m_IsInBubble = false;
EntityManager::Instance()->SerializeEntity(m_Parent);
};
void ControllablePhysicsComponent::SetStunImmunity(
const eStateChangeType state,
const LWOOBJID originator,
const bool bImmuneToStunAttack,
const bool bImmuneToStunEquip,
const bool bImmuneToStunInteract,
const bool bImmuneToStunJump,
const bool bImmuneToStunMove,
const bool bImmuneToStunTurn,
const bool bImmuneToStunUseItem){
if (state == eStateChangeType::POP){
if (bImmuneToStunAttack && m_ImmuneToStunAttackCount > 0) m_ImmuneToStunAttackCount -= 1;
if (bImmuneToStunEquip && m_ImmuneToStunEquipCount > 0) m_ImmuneToStunEquipCount -= 1;
if (bImmuneToStunInteract && m_ImmuneToStunInteractCount > 0) m_ImmuneToStunInteractCount -= 1;
if (bImmuneToStunJump && m_ImmuneToStunJumpCount > 0) m_ImmuneToStunJumpCount -= 1;
if (bImmuneToStunMove && m_ImmuneToStunMoveCount > 0) m_ImmuneToStunMoveCount -= 1;
if (bImmuneToStunTurn && m_ImmuneToStunTurnCount > 0) m_ImmuneToStunTurnCount -= 1;
if (bImmuneToStunUseItem && m_ImmuneToStunUseItemCount > 0) m_ImmuneToStunUseItemCount -= 1;
} else if (state == eStateChangeType::PUSH) {
if (bImmuneToStunAttack) m_ImmuneToStunAttackCount += 1;
if (bImmuneToStunEquip) m_ImmuneToStunEquipCount += 1;
if (bImmuneToStunInteract) m_ImmuneToStunInteractCount += 1;
if (bImmuneToStunJump) m_ImmuneToStunJumpCount += 1;
if (bImmuneToStunMove) m_ImmuneToStunMoveCount += 1;
if (bImmuneToStunTurn) m_ImmuneToStunTurnCount += 1;
if (bImmuneToStunUseItem) m_ImmuneToStunUseItemCount += 1;
}
GameMessages::SendSetStunImmunity(
m_Parent->GetObjectID(), state, m_Parent->GetSystemAddress(), originator,
bImmuneToStunAttack,
bImmuneToStunEquip,
bImmuneToStunInteract,
bImmuneToStunJump,
bImmuneToStunMove,
bImmuneToStunTurn,
bImmuneToStunUseItem
);
}

View File

@ -9,6 +9,7 @@
#include "Component.h" #include "Component.h"
#include "dpCollisionChecks.h" #include "dpCollisionChecks.h"
#include "PhantomPhysicsComponent.h" #include "PhantomPhysicsComponent.h"
#include "eBubbleType.h"
class Entity; class Entity;
class dpEntity; class dpEntity;
@ -257,13 +258,63 @@ public:
*/ */
std::vector<float> GetActivePickupRadiusScales() { return m_ActivePickupRadiusScales; }; std::vector<float> GetActivePickupRadiusScales() { return m_ActivePickupRadiusScales; };
/**
* Add a Speed boost to the entity
* This will recalculate the speed boost based on what is being added
*/
void AddSpeedboost(float value); void AddSpeedboost(float value);
/**
* Remove speed boost from entity
* This will recalculate the speed boost based on what is the last one in te vector
*/
void RemoveSpeedboost(float value); void RemoveSpeedboost(float value);
/**
* The speed boosts of this component.
* @return All active Speed boosts for this component.
*/
std::vector<float> GetActiveSpeedboosts() { return m_ActivePickupRadiusScales; }; std::vector<float> GetActiveSpeedboosts() { return m_ActivePickupRadiusScales; };
/**
* Activates the Bubble Buff
*/
void ActivateBubbleBuff(eBubbleType bubbleType = eBubbleType::DEFAULT, bool specialAnims = true);
/**
* Deactivates the Bubble Buff
*/
void DeactivateBubbleBuff();
/**
* Gets if the Entity is in a bubble
*/
bool GetIsInBubble(){ return m_IsInBubble; };
/**
* Push or Pop a layer of stun immunity to this entity
*/
void SetStunImmunity(
const eStateChangeType state,
const LWOOBJID originator = LWOOBJID_EMPTY,
const bool bImmuneToStunAttack = false,
const bool bImmuneToStunEquip = false,
const bool bImmuneToStunInteract = false,
const bool bImmuneToStunJump = false,
const bool bImmuneToStunMove = false,
const bool bImmuneToStunTurn = false,
const bool bImmuneToStunUseItem = false
);
// getters for stun immunities
const bool GetImmuneToStunAttack() { return m_ImmuneToStunAttackCount > 0;};
const bool GetImmuneToStunEquip() { return m_ImmuneToStunEquipCount > 0;};
const bool GetImmuneToStunInteract() { return m_ImmuneToStunInteractCount > 0;};
const bool GetImmuneToStunJump() { return m_ImmuneToStunJumpCount > 0;};
const bool GetImmuneToStunMove() { return m_ImmuneToStunMoveCount > 0;};
const bool GetImmuneToStunTurn() { return m_ImmuneToStunTurnCount > 0;};
const bool GetImmuneToStunUseItem() { return m_ImmuneToStunUseItemCount > 0;};
private: private:
/** /**
* The entity that owns this component * The entity that owns this component
@ -363,7 +414,7 @@ private:
/** /**
* Whether the pickup scale is dirty. * Whether the pickup scale is dirty.
*/ */
bool m_DirtyPickupRadiusScale; bool m_DirtyEquippedItemInfo;
/** /**
* The list of pickup radius scales for this entity * The list of pickup radius scales for this entity
@ -389,6 +440,37 @@ private:
* The active speed boost for this entity * The active speed boost for this entity
*/ */
float m_SpeedBoost; float m_SpeedBoost;
/*
* If Bubble info is dirty
*/
bool m_DirtyBubble;
/*
* If the entity is in a bubble
*/
bool m_IsInBubble;
/*
* The type of bubble the entity has
*/
eBubbleType m_BubbleType;
/*
* If the entity should be using the special animations
*/
bool m_SpecialAnims;
/**
* stun immunity counters
*/
int32_t m_ImmuneToStunAttackCount;
int32_t m_ImmuneToStunEquipCount;
int32_t m_ImmuneToStunInteractCount;
int32_t m_ImmuneToStunJumpCount;
int32_t m_ImmuneToStunMoveCount;
int32_t m_ImmuneToStunTurnCount;
int32_t m_ImmuneToStunUseItemCount;
}; };
#endif // CONTROLLABLEPHYSICSCOMPONENT_H #endif // CONTROLLABLEPHYSICSCOMPONENT_H

View File

@ -55,8 +55,17 @@ DestroyableComponent::DestroyableComponent(Entity* parent) : Component(parent) {
m_LootMatrixID = 0; m_LootMatrixID = 0;
m_MinCoins = 0; m_MinCoins = 0;
m_MaxCoins = 0; m_MaxCoins = 0;
m_ImmuneStacks = 0;
m_DamageReduction = 0; m_DamageReduction = 0;
m_ImmuneToBasicAttackCount = 0;
m_ImmuneToDamageOverTimeCount = 0;
m_ImmuneToKnockbackCount = 0;
m_ImmuneToInterruptCount = 0;
m_ImmuneToSpeedCount = 0;
m_ImmuneToImaginationGainCount = 0;
m_ImmuneToImaginationLossCount = 0;
m_ImmuneToQuickbuildInterruptCount = 0;
m_ImmuneToPullToPointCount = 0;
} }
DestroyableComponent::~DestroyableComponent() { DestroyableComponent::~DestroyableComponent() {
@ -106,7 +115,16 @@ void DestroyableComponent::Reinitialize(LOT templateID) {
void DestroyableComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, uint32_t& flags) { void DestroyableComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, uint32_t& flags) {
if (bIsInitialUpdate) { if (bIsInitialUpdate) {
outBitStream->Write0(); //Contains info about immunities this object has, but it's left out for now. outBitStream->Write1(); // always write these on construction
outBitStream->Write(m_ImmuneToBasicAttackCount);
outBitStream->Write(m_ImmuneToDamageOverTimeCount);
outBitStream->Write(m_ImmuneToKnockbackCount);
outBitStream->Write(m_ImmuneToInterruptCount);
outBitStream->Write(m_ImmuneToSpeedCount);
outBitStream->Write(m_ImmuneToImaginationGainCount);
outBitStream->Write(m_ImmuneToImaginationLossCount);
outBitStream->Write(m_ImmuneToQuickbuildInterruptCount);
outBitStream->Write(m_ImmuneToPullToPointCount);
} }
outBitStream->Write(m_DirtyHealth || bIsInitialUpdate); outBitStream->Write(m_DirtyHealth || bIsInitialUpdate);
@ -336,7 +354,7 @@ void DestroyableComponent::SetDamageReduction(int32_t value) {
void DestroyableComponent::SetIsImmune(bool value) { void DestroyableComponent::SetIsImmune(bool value) {
m_DirtyHealth = true; m_DirtyHealth = true;
m_ImmuneStacks = value ? 1 : 0; m_ImmuneToBasicAttackCount = value ? 1 : 0;
} }
void DestroyableComponent::SetIsGMImmune(bool value) { void DestroyableComponent::SetIsGMImmune(bool value) {
@ -439,7 +457,7 @@ void DestroyableComponent::SetAttacksToBlock(const uint32_t value) {
} }
bool DestroyableComponent::IsImmune() const { bool DestroyableComponent::IsImmune() const {
return m_ImmuneStacks > 0 || m_IsGMImmune; return m_IsGMImmune || m_ImmuneToBasicAttackCount > 0;
} }
bool DestroyableComponent::IsKnockbackImmune() const { bool DestroyableComponent::IsKnockbackImmune() const {
@ -804,12 +822,53 @@ void DestroyableComponent::SetFaction(int32_t factionID, bool ignoreChecks) {
AddFaction(factionID, ignoreChecks); AddFaction(factionID, ignoreChecks);
} }
void DestroyableComponent::PushImmunity(int32_t stacks) { void DestroyableComponent::SetStatusImmunity(
m_ImmuneStacks += stacks; const eStateChangeType state,
} const bool bImmuneToBasicAttack,
const bool bImmuneToDamageOverTime,
const bool bImmuneToKnockback,
const bool bImmuneToInterrupt,
const bool bImmuneToSpeed,
const bool bImmuneToImaginationGain,
const bool bImmuneToImaginationLoss,
const bool bImmuneToQuickbuildInterrupt,
const bool bImmuneToPullToPoint) {
void DestroyableComponent::PopImmunity(int32_t stacks) { if (state == eStateChangeType::POP) {
m_ImmuneStacks -= stacks; if (bImmuneToBasicAttack && m_ImmuneToBasicAttackCount > 0) m_ImmuneToBasicAttackCount -= 1;
if (bImmuneToDamageOverTime && m_ImmuneToDamageOverTimeCount > 0) m_ImmuneToDamageOverTimeCount -= 1;
if (bImmuneToKnockback && m_ImmuneToKnockbackCount > 0) m_ImmuneToKnockbackCount -= 1;
if (bImmuneToInterrupt && m_ImmuneToInterruptCount > 0) m_ImmuneToInterruptCount -= 1;
if (bImmuneToSpeed && m_ImmuneToSpeedCount > 0) m_ImmuneToSpeedCount -= 1;
if (bImmuneToImaginationGain && m_ImmuneToImaginationGainCount > 0) m_ImmuneToImaginationGainCount -= 1;
if (bImmuneToImaginationLoss && m_ImmuneToImaginationLossCount > 0) m_ImmuneToImaginationLossCount -= 1;
if (bImmuneToQuickbuildInterrupt && m_ImmuneToQuickbuildInterruptCount > 0) m_ImmuneToQuickbuildInterruptCount -= 1;
if (bImmuneToPullToPoint && m_ImmuneToPullToPointCount > 0) m_ImmuneToPullToPointCount -= 1;
} else if (state == eStateChangeType::PUSH){
if (bImmuneToBasicAttack) m_ImmuneToBasicAttackCount += 1;
if (bImmuneToDamageOverTime) m_ImmuneToDamageOverTimeCount += 1;
if (bImmuneToKnockback) m_ImmuneToKnockbackCount += 1;
if (bImmuneToInterrupt) m_ImmuneToInterruptCount += 1;
if (bImmuneToSpeed) m_ImmuneToSpeedCount += 1;
if (bImmuneToImaginationGain) m_ImmuneToImaginationGainCount += 1;
if (bImmuneToImaginationLoss) m_ImmuneToImaginationLossCount += 1;
if (bImmuneToQuickbuildInterrupt) m_ImmuneToQuickbuildInterruptCount += 1;
if (bImmuneToPullToPoint) m_ImmuneToPullToPointCount += 1;
}
GameMessages::SendSetStatusImmunity(
m_Parent->GetObjectID(), state, m_Parent->GetSystemAddress(),
bImmuneToBasicAttack,
bImmuneToDamageOverTime,
bImmuneToKnockback,
bImmuneToInterrupt,
bImmuneToSpeed,
bImmuneToImaginationGain,
bImmuneToImaginationLoss,
bImmuneToQuickbuildInterrupt,
bImmuneToPullToPoint
);
} }
void DestroyableComponent::FixStats() { void DestroyableComponent::FixStats() {

View File

@ -396,16 +396,31 @@ public:
void Smash(LWOOBJID source, eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"", uint32_t skillID = 0); void Smash(LWOOBJID source, eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"", uint32_t skillID = 0);
/** /**
* Pushes a layer of immunity to this entity, making it immune for longer * Push or Pop a layer of status immunity to this entity
* @param stacks the amount of immunity to add
*/ */
void PushImmunity(int32_t stacks = 1); void SetStatusImmunity(
const eStateChangeType state,
const bool bImmuneToBasicAttack = false,
const bool bImmuneToDamageOverTime = false,
const bool bImmuneToKnockback = false,
const bool bImmuneToInterrupt = false,
const bool bImmuneToSpeed = false,
const bool bImmuneToImaginationGain = false,
const bool bImmuneToImaginationLoss = false,
const bool bImmuneToQuickbuildInterrupt = false,
const bool bImmuneToPullToPoint = false
);
/** // Getters for status immunities
* Pops layers of immunity, making it immune for less longer const bool GetImmuneToBasicAttack() {return m_ImmuneToBasicAttackCount > 0;};
* @param stacks the number of layers of immunity to remove const bool GetImmuneToDamageOverTime() {return m_ImmuneToDamageOverTimeCount > 0;};
*/ const bool GetImmuneToKnockback() {return m_ImmuneToKnockbackCount > 0;};
void PopImmunity(int32_t stacks = 1); const bool GetImmuneToInterrupt() {return m_ImmuneToInterruptCount > 0;};
const bool GetImmuneToSpeed() {return m_ImmuneToSpeedCount > 0;};
const bool GetImmuneToImaginationGain() {return m_ImmuneToImaginationGainCount > 0;};
const bool GetImmuneToImaginationLoss() {return m_ImmuneToImaginationLossCount > 0;};
const bool GetImmuneToQuickbuildInterrupt() {return m_ImmuneToQuickbuildInterruptCount > 0;};
const bool GetImmuneToPullToPoint() {return m_ImmuneToPullToPointCount > 0;};
/** /**
* Utility to reset all stats to the default stats based on items and completed missions * Utility to reset all stats to the default stats based on items and completed missions
@ -493,11 +508,6 @@ private:
*/ */
uint32_t m_AttacksToBlock; uint32_t m_AttacksToBlock;
/**
* The layers of immunity this entity has left
*/
int32_t m_ImmuneStacks;
/** /**
* The amount of damage that should be reduced from every attack * The amount of damage that should be reduced from every attack
*/ */
@ -577,6 +587,19 @@ private:
* The list of scripts subscribed to this components actions * The list of scripts subscribed to this components actions
*/ */
std::map<LWOOBJID, CppScripts::Script*> m_SubscribedScripts; std::map<LWOOBJID, CppScripts::Script*> m_SubscribedScripts;
/**
* status immunity counters
*/
uint32_t m_ImmuneToBasicAttackCount;
uint32_t m_ImmuneToDamageOverTimeCount;
uint32_t m_ImmuneToKnockbackCount;
uint32_t m_ImmuneToInterruptCount;
uint32_t m_ImmuneToSpeedCount;
uint32_t m_ImmuneToImaginationGainCount;
uint32_t m_ImmuneToImaginationLossCount;
uint32_t m_ImmuneToQuickbuildInterruptCount;
uint32_t m_ImmuneToPullToPointCount;
}; };
#endif // DESTROYABLECOMPONENT_H #endif // DESTROYABLECOMPONENT_H

View File

@ -959,7 +959,7 @@ void InventoryComponent::HandlePossession(Item* item) {
return; return;
} }
GameMessages::SendSetStunned(m_Parent->GetObjectID(), eStunState::PUSH, m_Parent->GetSystemAddress(), LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true); GameMessages::SendSetStunned(m_Parent->GetObjectID(), eStateChangeType::PUSH, m_Parent->GetSystemAddress(), LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true);
// Set the mount Item ID so that we know what were handling // Set the mount Item ID so that we know what were handling
possessorComponent->SetMountItemID(item->GetId()); possessorComponent->SetMountItemID(item->GetId());

View File

@ -12,11 +12,12 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "CppScripts.h" #include "CppScripts.h"
#include "SimplePhysicsComponent.h" #include "SimplePhysicsComponent.h"
#include "Zone.h"
MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) { MoverSubComponent::MoverSubComponent(const NiPoint3& startPos) {
mPosition = {}; mPosition = {};
mState = MovementPlatformState::Stopped; mState = eMovementPlatformState::Stopped;
mDesiredWaypointIndex = 0; // -1; mDesiredWaypointIndex = 0; // -1;
mInReverse = false; mInReverse = false;
mShouldStopAtDesiredWaypoint = false; mShouldStopAtDesiredWaypoint = false;
@ -127,7 +128,7 @@ void MovingPlatformComponent::OnCompleteRebuild() {
StartPathing(); StartPathing();
} }
void MovingPlatformComponent::SetMovementState(MovementPlatformState value) { void MovingPlatformComponent::SetMovementState(eMovementPlatformState value) {
auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent); auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent);
subComponent->mState = value; subComponent->mState = value;
@ -152,7 +153,7 @@ void MovingPlatformComponent::StartPathing() {
auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent); auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent);
subComponent->mShouldStopAtDesiredWaypoint = true; subComponent->mShouldStopAtDesiredWaypoint = true;
subComponent->mState = MovementPlatformState::Stationary; subComponent->mState = eMovementPlatformState::Stationary;
NiPoint3 targetPosition; NiPoint3 targetPosition;
@ -174,7 +175,7 @@ void MovingPlatformComponent::StartPathing() {
} }
m_Parent->AddCallbackTimer(subComponent->mWaitTime, [this] { m_Parent->AddCallbackTimer(subComponent->mWaitTime, [this] {
SetMovementState(MovementPlatformState::Moving); SetMovementState(eMovementPlatformState::Moving);
}); });
const auto travelTime = Vector3::Distance(targetPosition, subComponent->mPosition) / subComponent->mSpeed + 1.5f; const auto travelTime = Vector3::Distance(targetPosition, subComponent->mPosition) / subComponent->mSpeed + 1.5f;
@ -199,7 +200,7 @@ void MovingPlatformComponent::StartPathing() {
void MovingPlatformComponent::ContinuePathing() { void MovingPlatformComponent::ContinuePathing() {
auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent); auto* subComponent = static_cast<MoverSubComponent*>(m_MoverSubComponent);
subComponent->mState = MovementPlatformState::Stationary; subComponent->mState = eMovementPlatformState::Stationary;
subComponent->mCurrentWaypointIndex = subComponent->mNextWaypointIndex; subComponent->mCurrentWaypointIndex = subComponent->mNextWaypointIndex;
@ -282,7 +283,7 @@ void MovingPlatformComponent::ContinuePathing() {
m_Parent->CancelCallbackTimers(); m_Parent->CancelCallbackTimers();
m_Parent->AddCallbackTimer(subComponent->mWaitTime, [this] { m_Parent->AddCallbackTimer(subComponent->mWaitTime, [this] {
SetMovementState(MovementPlatformState::Moving); SetMovementState(eMovementPlatformState::Moving);
}); });
auto travelTime = Vector3::Distance(targetPosition, subComponent->mPosition) / subComponent->mSpeed + 1.5; auto travelTime = Vector3::Distance(targetPosition, subComponent->mPosition) / subComponent->mSpeed + 1.5;
@ -313,7 +314,7 @@ void MovingPlatformComponent::StopPathing() {
m_PathingStopped = true; m_PathingStopped = true;
subComponent->mState = MovementPlatformState::Stopped; subComponent->mState = eMovementPlatformState::Stopped;
subComponent->mDesiredWaypointIndex = -1; subComponent->mDesiredWaypointIndex = -1;
subComponent->mShouldStopAtDesiredWaypoint = false; subComponent->mShouldStopAtDesiredWaypoint = false;

View File

@ -13,6 +13,9 @@
#include "dCommonVars.h" #include "dCommonVars.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "Component.h" #include "Component.h"
#include "eMovementPlatformState.h"
class Path;
/** /**
* Different types of available platforms * Different types of available platforms
@ -26,16 +29,6 @@ enum class eMoverSubComponentType : uint32_t {
simpleMover = 5, simpleMover = 5,
}; };
/**
* The different types of platform movement state, supposedly a bitmap
*/
enum class MovementPlatformState : uint32_t
{
Moving = 0b00010,
Stationary = 0b11001,
Stopped = 0b01100
};
/** /**
* Sub component for moving platforms that determine the actual current movement state * Sub component for moving platforms that determine the actual current movement state
*/ */
@ -49,7 +42,7 @@ public:
/** /**
* The state the platform is currently in * The state the platform is currently in
*/ */
MovementPlatformState mState = MovementPlatformState::Stationary; eMovementPlatformState mState = eMovementPlatformState::Stationary;
/** /**
* The waypoint this platform currently wants to traverse to * The waypoint this platform currently wants to traverse to
@ -133,7 +126,7 @@ public:
* Updates the movement state for the moving platform * Updates the movement state for the moving platform
* @param value the movement state to set * @param value the movement state to set
*/ */
void SetMovementState(MovementPlatformState value); void SetMovementState(eMovementPlatformState value);
/** /**
* Instructs the moving platform to go to some waypoint * Instructs the moving platform to go to some waypoint

View File

@ -20,6 +20,7 @@
#include "dConfig.h" #include "dConfig.h"
#include "dChatFilter.h" #include "dChatFilter.h"
#include "Database.h" #include "Database.h"
#include "EntityInfo.h"
std::unordered_map<LOT, PetComponent::PetPuzzleData> PetComponent::buildCache{}; std::unordered_map<LOT, PetComponent::PetPuzzleData> PetComponent::buildCache{};
std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::currentActivities{}; std::unordered_map<LWOOBJID, LWOOBJID> PetComponent::currentActivities{};

View File

@ -19,6 +19,7 @@
#include "CDComponentsRegistryTable.h" #include "CDComponentsRegistryTable.h"
#include "CDPhysicsComponentTable.h" #include "CDPhysicsComponentTable.h"
#include "dServer.h" #include "dServer.h"
#include "EntityInfo.h"
#include "dpWorld.h" #include "dpWorld.h"
#include "dpEntity.h" #include "dpEntity.h"

View File

@ -54,7 +54,7 @@ void PossessorComponent::Mount(Entity* mount) {
// GM's to send // GM's to send
GameMessages::SendSetJetPackMode(m_Parent, false); GameMessages::SendSetJetPackMode(m_Parent, false);
GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_Parent->GetSystemAddress()); GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_Parent->GetSystemAddress());
GameMessages::SendSetStunned(m_Parent->GetObjectID(), eStunState::PUSH, m_Parent->GetSystemAddress(), LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true); GameMessages::SendSetStunned(m_Parent->GetObjectID(), eStateChangeType::PUSH, m_Parent->GetSystemAddress(), LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true);
EntityManager::Instance()->SerializeEntity(m_Parent); EntityManager::Instance()->SerializeEntity(m_Parent);
EntityManager::Instance()->SerializeEntity(mount); EntityManager::Instance()->SerializeEntity(mount);

View File

@ -11,6 +11,7 @@
#include "CharacterComponent.h" #include "CharacterComponent.h"
#include "UserManager.h" #include "UserManager.h"
#include "dLogger.h" #include "dLogger.h"
#include "AMFFormat.h"
PropertyEntranceComponent::PropertyEntranceComponent(uint32_t componentID, Entity* parent) : Component(parent) { PropertyEntranceComponent::PropertyEntranceComponent(uint32_t componentID, Entity* parent) : Component(parent) {
this->propertyQueries = {}; this->propertyQueries = {};

View File

@ -21,6 +21,7 @@
#include "dServer.h" #include "dServer.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "dConfig.h" #include "dConfig.h"
#include "Loot.h"
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288 #define M_PI 3.14159265358979323846264338327950288

View File

@ -95,7 +95,7 @@ void RailActivatorComponent::OnUse(Entity* originator) {
void RailActivatorComponent::OnRailMovementReady(Entity* originator) const { void RailActivatorComponent::OnRailMovementReady(Entity* originator) const {
// Stun the originator // Stun the originator
GameMessages::SendSetStunned(originator->GetObjectID(), PUSH, originator->GetSystemAddress(), LWOOBJID_EMPTY, GameMessages::SendSetStunned(originator->GetObjectID(), eStateChangeType::PUSH, originator->GetSystemAddress(), LWOOBJID_EMPTY,
true, true, true, true, true, true, true true, true, true, true, true, true, true
); );
@ -123,7 +123,7 @@ void RailActivatorComponent::OnRailMovementReady(Entity* originator) const {
void RailActivatorComponent::OnCancelRailMovement(Entity* originator) { void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
// Remove the stun from the originator // Remove the stun from the originator
GameMessages::SendSetStunned(originator->GetObjectID(), POP, originator->GetSystemAddress(), LWOOBJID_EMPTY, GameMessages::SendSetStunned(originator->GetObjectID(), eStateChangeType::POP, originator->GetSystemAddress(), LWOOBJID_EMPTY,
true, true, true, true, true, true, true true, true, true, true, true, true, true
); );

View File

@ -14,6 +14,7 @@
#include "Spawner.h" #include "Spawner.h"
#include "MovingPlatformComponent.h" #include "MovingPlatformComponent.h"
#include "Preconditions.h" #include "Preconditions.h"
#include "Loot.h"
#include "TeamManager.h" #include "TeamManager.h"
#include "CppScripts.h" #include "CppScripts.h"

View File

@ -18,6 +18,8 @@
#include "dConfig.h" #include "dConfig.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "dMessageIdentifiers.h"
#include "Loot.h"
ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activityID) : Component(parent) { ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activityID) : Component(parent) {
m_ActivityID = activityID; m_ActivityID = activityID;

View File

@ -19,7 +19,9 @@
#include "BaseCombatAIComponent.h" #include "BaseCombatAIComponent.h"
#include "ScriptComponent.h" #include "ScriptComponent.h"
#include "BuffComponent.h" #include "BuffComponent.h"
#include "EchoStartSkill.h"
#include "dMessageIdentifiers.h"
#include "DoClientProjectileImpact.h"
ProjectileSyncEntry::ProjectileSyncEntry() { ProjectileSyncEntry::ProjectileSyncEntry() {
} }
@ -240,7 +242,7 @@ SkillExecutionResult SkillComponent::CalculateBehavior(const uint32_t skillId, c
if (!clientInitalized) { if (!clientInitalized) {
// Echo start skill // Echo start skill
GameMessages::EchoStartSkill start; EchoStartSkill start;
start.iCastType = 0; start.iCastType = 0;
start.skillID = skillId; start.skillID = skillId;
@ -384,7 +386,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
behavior->Calculate(entry.context, bitStream, entry.branchContext); behavior->Calculate(entry.context, bitStream, entry.branchContext);
GameMessages::DoClientProjectileImpact projectileImpact; DoClientProjectileImpact projectileImpact;
projectileImpact.sBitStream.assign((char*)bitStream->GetData(), bitStream->GetNumberOfBytesUsed()); projectileImpact.sBitStream.assign((char*)bitStream->GetData(), bitStream->GetNumberOfBytesUsed());
projectileImpact.i64OwnerID = this->m_Parent->GetObjectID(); projectileImpact.i64OwnerID = this->m_Parent->GetObjectID();

View File

@ -0,0 +1,83 @@
#ifndef __DOCLIENTPROJECTILEIMPACT__H__
#define __DOCLIENTPROJECTILEIMPACT__H__
#include "dMessageIdentifiers.h"
#include "dCommonVars.h"
/* Tell a client local projectile to impact */
class DoClientProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_DO_CLIENT_PROJECTILE_IMPACT;
public:
DoClientProjectileImpact() {
i64OrgID = LWOOBJID_EMPTY;
i64OwnerID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
DoClientProjectileImpact(std::string _sBitStream, LWOOBJID _i64OrgID = LWOOBJID_EMPTY, LWOOBJID _i64OwnerID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64OrgID = _i64OrgID;
i64OwnerID = _i64OwnerID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
DoClientProjectileImpact(RakNet::BitStream* stream) : DoClientProjectileImpact() {
Deserialize(stream);
}
~DoClientProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(i64OrgID != LWOOBJID_EMPTY);
if (i64OrgID != LWOOBJID_EMPTY) stream->Write(i64OrgID);
stream->Write(i64OwnerID != LWOOBJID_EMPTY);
if (i64OwnerID != LWOOBJID_EMPTY) stream->Write(i64OwnerID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64OrgIDIsDefault{};
stream->Read(i64OrgIDIsDefault);
if (i64OrgIDIsDefault != 0) stream->Read(i64OrgID);
bool i64OwnerIDIsDefault{};
stream->Read(i64OwnerIDIsDefault);
if (i64OwnerIDIsDefault != 0) stream->Read(i64OwnerID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64OrgID;
LWOOBJID i64OwnerID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
#endif //!__DOCLIENTPROJECTILEIMPACT__H__

View File

@ -0,0 +1,132 @@
#ifndef __ECHOSTARTSKILL__H__
#define __ECHOSTARTSKILL__H__
#include "dCommonVars.h"
#include "dMessageIdentifiers.h"
#include "NiPoint3.h"
#include "NiQuaternion.h"
/* Same as start skill but with different network options. An echo down to other clients that need to play the skill. */
class EchoStartSkill {
static const GAME_MSG MsgID = GAME_MSG_ECHO_START_SKILL;
public:
EchoStartSkill() {
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
EchoStartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, uint32_t _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
EchoStartSkill(RakNet::BitStream* stream) : EchoStartSkill() {
Deserialize(stream);
}
~EchoStartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(bUsedMouse);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse;
float fCasterLatency;
int32_t iCastType;
NiPoint3 lastClickedPosit;
LWOOBJID optionalOriginatorID;
LWOOBJID optionalTargetID;
NiQuaternion originatorRot;
std::string sBitStream;
TSkillID skillID;
uint32_t uiSkillHandle;
};
#endif //!__ECHOSTARTSKILL__H__

View File

@ -0,0 +1,70 @@
#ifndef __ECHOSYNCSKILL__H__
#define __ECHOSYNCSKILL__H__
#include <string>
#include "BitStream.h"
#include "dMessageIdentifiers.h"
/* Message to synchronize a skill cast */
class EchoSyncSkill {
static const GAME_MSG MsgID = GAME_MSG_ECHO_SYNC_SKILL;
public:
EchoSyncSkill() {
bDone = false;
}
EchoSyncSkill(std::string _sBitStream, uint32_t _uiBehaviorHandle, uint32_t _uiSkillHandle, bool _bDone = false) {
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
EchoSyncSkill(RakNet::BitStream* stream) : EchoSyncSkill() {
Deserialize(stream);
}
~EchoSyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
uint32_t uiBehaviorHandle{};
uint32_t uiSkillHandle{};
};
#endif //!__ECHOSYNCSKILL__H__

View File

@ -26,6 +26,11 @@
#include "CDSkillBehaviorTable.h" #include "CDSkillBehaviorTable.h"
#include "SkillComponent.h" #include "SkillComponent.h"
#include "RacingControlComponent.h" #include "RacingControlComponent.h"
#include "RequestServerProjectileImpact.h"
#include "SyncSkill.h"
#include "StartSkill.h"
#include "EchoStartSkill.h"
#include "EchoSyncSkill.h"
using namespace std; using namespace std;
@ -251,7 +256,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case GAME_MSG_REQUEST_SERVER_PROJECTILE_IMPACT: case GAME_MSG_REQUEST_SERVER_PROJECTILE_IMPACT:
{ {
auto message = GameMessages::RequestServerProjectileImpact(); auto message = RequestServerProjectileImpact();
message.Deserialize(inStream); message.Deserialize(inStream);
@ -269,7 +274,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
} }
case GAME_MSG_START_SKILL: { case GAME_MSG_START_SKILL: {
GameMessages::StartSkill startSkill = GameMessages::StartSkill(); StartSkill startSkill = StartSkill();
startSkill.Deserialize(inStream); // inStream replaces &bitStream startSkill.Deserialize(inStream); // inStream replaces &bitStream
if (startSkill.skillID == 1561 || startSkill.skillID == 1562 || startSkill.skillID == 1541) return; if (startSkill.skillID == 1561 || startSkill.skillID == 1562 || startSkill.skillID == 1541) return;
@ -309,7 +314,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
PacketUtils::WriteHeader(bitStreamLocal, CLIENT, MSG_CLIENT_GAME_MSG); PacketUtils::WriteHeader(bitStreamLocal, CLIENT, MSG_CLIENT_GAME_MSG);
bitStreamLocal.Write(entity->GetObjectID()); bitStreamLocal.Write(entity->GetObjectID());
GameMessages::EchoStartSkill echoStartSkill; EchoStartSkill echoStartSkill;
echoStartSkill.bUsedMouse = startSkill.bUsedMouse; echoStartSkill.bUsedMouse = startSkill.bUsedMouse;
echoStartSkill.fCasterLatency = startSkill.fCasterLatency; echoStartSkill.fCasterLatency = startSkill.fCasterLatency;
echoStartSkill.iCastType = startSkill.iCastType; echoStartSkill.iCastType = startSkill.iCastType;
@ -333,7 +338,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
//bitStreamLocal.Write((unsigned short)GAME_MSG_ECHO_SYNC_SKILL); //bitStreamLocal.Write((unsigned short)GAME_MSG_ECHO_SYNC_SKILL);
//bitStreamLocal.Write(inStream); //bitStreamLocal.Write(inStream);
GameMessages::SyncSkill sync = GameMessages::SyncSkill(inStream); // inStream replaced &bitStream SyncSkill sync = SyncSkill(inStream); // inStream replaced &bitStream
//sync.Serialize(&bitStreamLocal); //sync.Serialize(&bitStreamLocal);
ostringstream buffer; ostringstream buffer;
@ -356,7 +361,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
delete bs; delete bs;
} }
GameMessages::EchoSyncSkill echo = GameMessages::EchoSyncSkill(); EchoSyncSkill echo = EchoSyncSkill();
echo.bDone = sync.bDone; echo.bDone = sync.bDone;
echo.sBitStream = sync.sBitStream; echo.sBitStream = sync.sBitStream;
echo.uiBehaviorHandle = sync.uiBehaviorHandle; echo.uiBehaviorHandle = sync.uiBehaviorHandle;
@ -660,9 +665,14 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case GAME_MSG_DISMOUNT_COMPLETE: case GAME_MSG_DISMOUNT_COMPLETE:
GameMessages::HandleDismountComplete(inStream, entity, sysAddr); GameMessages::HandleDismountComplete(inStream, entity, sysAddr);
break; break;
case GAME_MSG_DEACTIVATE_BUBBLE_BUFF:
GameMessages::HandleDeactivateBubbleBuff(inStream, entity);
break;
case GAME_MSG_ACTIVATE_BUBBLE_BUFF:
GameMessages::HandleActivateBubbleBuff(inStream, entity);
break;
default: default:
//Game::logger->Log("GameMessageHandler", "Unknown game message ID: %X", messageID); // Game::logger->Log("GameMessageHandler", "Unknown game message ID: %i", messageID);
break; break;
} }
} }

View File

@ -25,9 +25,12 @@
#include "dConfig.h" #include "dConfig.h"
#include "TeamManager.h" #include "TeamManager.h"
#include "ChatPackets.h" #include "ChatPackets.h"
#include "GameConfig.h"
#include "RocketLaunchLupComponent.h" #include "RocketLaunchLupComponent.h"
#include "eUnequippableActiveType.h" #include "eUnequippableActiveType.h"
#include "eMovementPlatformState.h"
#include "LeaderboardManager.h"
#include "AMFFormat.h"
#include "Loot.h"
#include "RacingTaskParam.h" #include "RacingTaskParam.h"
#include <sstream> #include <sstream>
@ -73,6 +76,7 @@
#include "ControlBehaviors.h" #include "ControlBehaviors.h"
#include "AMFDeserialize.h" #include "AMFDeserialize.h"
#include "eBlueprintSaveResponseType.h" #include "eBlueprintSaveResponseType.h"
#include "eAninmationFlags.h"
void GameMessages::SendFireEventClientSide(const LWOOBJID& objectID, const SystemAddress& sysAddr, std::u16string args, const LWOOBJID& object, int64_t param1, int param2, const LWOOBJID& sender) { void GameMessages::SendFireEventClientSide(const LWOOBJID& objectID, const SystemAddress& sysAddr, std::u16string args, const LWOOBJID& object, int64_t param1, int param2, const LWOOBJID& sender) {
CBITSTREAM; CBITSTREAM;
@ -330,7 +334,7 @@ void GameMessages::SendStartPathing(Entity* entity) {
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint, void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
int iIndex, int iDesiredWaypointIndex, int nextIndex, int iIndex, int iDesiredWaypointIndex, int nextIndex,
MovementPlatformState movementState) { eMovementPlatformState movementState) {
CBITSTREAM; CBITSTREAM;
CMSGHEADER; CMSGHEADER;
@ -341,7 +345,7 @@ void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAd
iIndex = 0; iIndex = 0;
nextIndex = 0; nextIndex = 0;
bStopAtDesiredWaypoint = true; bStopAtDesiredWaypoint = true;
movementState = MovementPlatformState::Stationary; movementState = eMovementPlatformState::Stationary;
} }
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());
@ -575,7 +579,7 @@ void GameMessages::SendModifyLEGOScore(Entity* entity, const SystemAddress& sysA
SEND_PACKET; SEND_PACKET;
} }
void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, NDGFxValue args) { void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, AMFValue* args) {
CBITSTREAM; CBITSTREAM;
CMSGHEADER; CMSGHEADER;
@ -593,7 +597,7 @@ void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const Syste
SEND_PACKET; SEND_PACKET;
} }
void GameMessages::SendUIMessageServerToAllClients(const std::string& message, NDGFxValue args) { void GameMessages::SendUIMessageServerToAllClients(const std::string& message, AMFValue* args) {
CBITSTREAM; CBITSTREAM;
CMSGHEADER; CMSGHEADER;
@ -1000,7 +1004,7 @@ void GameMessages::SendSetNetworkScriptVar(Entity* entity, const SystemAddress&
} }
void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, LOT item, int currency, NiPoint3 spawnPos, int count) { void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID, LOT item, int currency, NiPoint3 spawnPos, int count) {
if (GameConfig::GetValue<int32_t>("no_drops") == 1) { if (Game::config->GetValue("disable_drops") == "1") {
return; return;
} }
@ -2900,7 +2904,7 @@ void GameMessages::HandleCinematicUpdate(RakNet::BitStream* inStream, Entity* en
} }
} }
void GameMessages::SendSetStunned(LWOOBJID objectId, eStunState stateChangeType, const SystemAddress& sysAddr, void GameMessages::SendSetStunned(LWOOBJID objectId, eStateChangeType stateChangeType, const SystemAddress& sysAddr,
LWOOBJID originator, bool bCantAttack, bool bCantEquip, LWOOBJID originator, bool bCantAttack, bool bCantEquip,
bool bCantInteract, bool bCantJump, bool bCantMove, bool bCantTurn, bool bCantInteract, bool bCantJump, bool bCantMove, bool bCantTurn,
bool bCantUseItem, bool bDontTerminateInteract, bool bIgnoreImmunity, bool bCantUseItem, bool bDontTerminateInteract, bool bIgnoreImmunity,
@ -2948,6 +2952,69 @@ void GameMessages::SendSetStunned(LWOOBJID objectId, eStunState stateChangeType,
SEND_PACKET; SEND_PACKET;
} }
void GameMessages::SendSetStunImmunity(LWOOBJID target, eStateChangeType state, const SystemAddress& sysAddr,
LWOOBJID originator,
bool bImmuneToStunAttack,
bool bImmuneToStunEquip,
bool bImmuneToStunInteract,
bool bImmuneToStunJump,
bool bImmuneToStunMove,
bool bImmuneToStunTurn,
bool bImmuneToStunUseItem) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(target);
bitStream.Write(GAME_MSG::GAME_MSG_SET_STUN_IMMUNITY);
bitStream.Write(originator != LWOOBJID_EMPTY);
if (originator != LWOOBJID_EMPTY) bitStream.Write(originator);
bitStream.Write(state);
bitStream.Write(bImmuneToStunAttack);
bitStream.Write(bImmuneToStunEquip);
bitStream.Write(bImmuneToStunInteract);
bitStream.Write(bImmuneToStunJump);
bitStream.Write(bImmuneToStunMove);
bitStream.Write(bImmuneToStunTurn);
bitStream.Write(bImmuneToStunUseItem);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
}
void GameMessages::SendSetStatusImmunity(LWOOBJID objectId, eStateChangeType state, const SystemAddress& sysAddr,
bool bImmuneToBasicAttack,
bool bImmuneToDamageOverTime,
bool bImmuneToKnockback,
bool bImmuneToInterrupt,
bool bImmuneToSpeed,
bool bImmuneToImaginationGain,
bool bImmuneToImaginationLoss,
bool bImmuneToQuickbuildInterrupt,
bool bImmuneToPullToPoint) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectId);
bitStream.Write(GAME_MSG::GAME_MSG_SET_STATUS_IMMUNITY);
bitStream.Write(state);
bitStream.Write(bImmuneToBasicAttack);
bitStream.Write(bImmuneToDamageOverTime);
bitStream.Write(bImmuneToKnockback);
bitStream.Write(bImmuneToInterrupt);
bitStream.Write(bImmuneToSpeed);
bitStream.Write(bImmuneToImaginationGain);
bitStream.Write(bImmuneToImaginationLoss);
bitStream.Write(bImmuneToQuickbuildInterrupt);
bitStream.Write(bImmuneToPullToPoint);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
}
void GameMessages::SendOrientToAngle(LWOOBJID objectId, bool bRelativeToCurrent, float fAngle, const SystemAddress& sysAddr) { void GameMessages::SendOrientToAngle(LWOOBJID objectId, bool bRelativeToCurrent, float fAngle, const SystemAddress& sysAddr) {
CBITSTREAM; CBITSTREAM;
@ -3987,7 +4054,7 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
EntityManager::Instance()->SerializeEntity(entity); EntityManager::Instance()->SerializeEntity(entity);
// We aren't mounted so remove the stun // We aren't mounted so remove the stun
GameMessages::SendSetStunned(entity->GetObjectID(), eStunState::POP, UNASSIGNED_SYSTEM_ADDRESS, LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true); GameMessages::SendSetStunned(entity->GetObjectID(), eStateChangeType::POP, UNASSIGNED_SYSTEM_ADDRESS, LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true);
} }
} }
} }
@ -6017,3 +6084,43 @@ void GameMessages::HandleUpdatePlayerStatistic(RakNet::BitStream* inStream, Enti
characterComponent->UpdatePlayerStatistic((StatisticID)updateID, (uint64_t)std::max(updateValue, int64_t(0))); characterComponent->UpdatePlayerStatistic((StatisticID)updateID, (uint64_t)std::max(updateValue, int64_t(0)));
} }
} }
void GameMessages::HandleDeactivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity) {
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) controllablePhysicsComponent->DeactivateBubbleBuff();
}
void GameMessages::HandleActivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity) {
bool specialAnimations;
if (!inStream->Read(specialAnimations)) return;
std::u16string type = GeneralUtils::ReadWString(inStream);
auto bubbleType = eBubbleType::DEFAULT;
if (type == u"skunk") bubbleType = eBubbleType::SKUNK;
else if (type == u"energy") bubbleType = eBubbleType::ENERGY;
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent) controllablePhysicsComponent->ActivateBubbleBuff(bubbleType, specialAnimations);
}
void GameMessages::SendActivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectId);
bitStream.Write(GAME_MSG::GAME_MSG_ACTIVATE_BUBBLE_BUFF_FROM_SERVER);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
}
void GameMessages::SendDeactivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectId);
bitStream.Write(GAME_MSG::GAME_MSG_DEACTIVATE_BUBBLE_BUFF_FROM_SERVER);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
}

View File

@ -1,27 +1,26 @@
#ifndef GAMEMESSAGES_H #ifndef GAMEMESSAGES_H
#define GAMEMESSAGES_H #define GAMEMESSAGES_H
#include "dCommonVars.h" #include "dCommonVars.h"
#include "RakNetTypes.h" #include <map>
#include <string> #include <string>
#include "dMessageIdentifiers.h" #include <vector>
#include "AMFFormat.h" #include "eMovementPlatformState.h"
#include "AMFFormat_BitStream.h" #include "NiPoint3.h"
#include "NiQuaternion.h"
#include "PropertySelectQueryProperty.h"
#include "TradingManager.h"
#include "LeaderboardManager.h"
#include "MovingPlatformComponent.h"
#include "eAninmationFlags.h"
class AMFValue;
class Entity;
class Item;
class NiQuaternion; class NiQuaternion;
class User; class User;
class Entity; class Leaderboard;
class NiPoint3; class PropertySelectQueryProperty;
class TradeItem;
enum class eAnimationFlags : uint32_t;
enum class eUnequippableActiveType; enum class eUnequippableActiveType;
enum eInventoryType : uint32_t; enum eInventoryType : uint32_t;
class Item;
namespace GameMessages { namespace GameMessages {
class PropertyDataMessage; class PropertyDataMessage;
@ -57,7 +56,7 @@ namespace GameMessages {
void SendStartPathing(Entity* entity); void SendStartPathing(Entity* entity);
void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false, void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false,
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1, int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
MovementPlatformState movementState = MovementPlatformState::Moving); eMovementPlatformState movementState = eMovementPlatformState::Moving);
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr); void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
void SendServerDoneLoadingAllObjects(Entity* entity, const SystemAddress& sysAddr); void SendServerDoneLoadingAllObjects(Entity* entity, const SystemAddress& sysAddr);
@ -74,8 +73,8 @@ namespace GameMessages {
void NotifyLevelRewards(LWOOBJID objectID, const SystemAddress& sysAddr, int level, bool sending_rewards); void NotifyLevelRewards(LWOOBJID objectID, const SystemAddress& sysAddr, int level, bool sending_rewards);
void SendModifyLEGOScore(Entity* entity, const SystemAddress& sysAddr, int64_t score, eLootSourceType sourceType); void SendModifyLEGOScore(Entity* entity, const SystemAddress& sysAddr, int64_t score, eLootSourceType sourceType);
void SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, NDGFxValue args); void SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, AMFValue* args);
void SendUIMessageServerToAllClients(const std::string& message, NDGFxValue args); void SendUIMessageServerToAllClients(const std::string& message, AMFValue* args);
void SendPlayEmbeddedEffectOnAllClientsNearObject(Entity* entity, std::u16string effectName, const LWOOBJID& fromObjectID, float radius); void SendPlayEmbeddedEffectOnAllClientsNearObject(Entity* entity, std::u16string effectName, const LWOOBJID& fromObjectID, float radius);
void SendPlayFXEffect(Entity* entity, int32_t effectID, const std::u16string& effectType, const std::string& name, LWOOBJID secondary, float priority = 1, float scale = 1, bool serialize = true); void SendPlayFXEffect(Entity* entity, int32_t effectID, const std::u16string& effectType, const std::string& name, LWOOBJID secondary, float priority = 1, float scale = 1, bool serialize = true);
@ -269,7 +268,7 @@ namespace GameMessages {
float leadOut = -1.0f, bool leavePlayerLocked = false); float leadOut = -1.0f, bool leavePlayerLocked = false);
void HandleCinematicUpdate(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr); void HandleCinematicUpdate(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void SendSetStunned(LWOOBJID objectId, eStunState stateChangeType, const SystemAddress& sysAddr, void SendSetStunned(LWOOBJID objectId, eStateChangeType stateChangeType, const SystemAddress& sysAddr,
LWOOBJID originator = LWOOBJID_EMPTY, bool bCantAttack = false, bool bCantEquip = false, LWOOBJID originator = LWOOBJID_EMPTY, bool bCantAttack = false, bool bCantEquip = false,
bool bCantInteract = false, bool bCantJump = false, bool bCantMove = false, bool bCantTurn = false, bool bCantInteract = false, bool bCantJump = false, bool bCantMove = false, bool bCantTurn = false,
bool bCantUseItem = false, bool bDontTerminateInteract = false, bool bIgnoreImmunity = true, bool bCantUseItem = false, bool bDontTerminateInteract = false, bool bIgnoreImmunity = true,
@ -278,6 +277,35 @@ namespace GameMessages {
bool bCantMoveOutChangeWasApplied = false, bool bCantTurnOutChangeWasApplied = false, bool bCantMoveOutChangeWasApplied = false, bool bCantTurnOutChangeWasApplied = false,
bool bCantUseItemOutChangeWasApplied = false); bool bCantUseItemOutChangeWasApplied = false);
void SendSetStunImmunity(
LWOOBJID target,
eStateChangeType state,
const SystemAddress& sysAddr,
LWOOBJID originator = LWOOBJID_EMPTY,
bool bImmuneToStunAttack = false,
bool bImmuneToStunEquip = false,
bool bImmuneToStunInteract = false,
bool bImmuneToStunJump = false,
bool bImmuneToStunMove = false,
bool bImmuneToStunTurn = false,
bool bImmuneToStunUseItem = false
);
void SendSetStatusImmunity(
LWOOBJID objectId,
eStateChangeType state,
const SystemAddress& sysAddr,
bool bImmuneToBasicAttack = false,
bool bImmuneToDamageOverTime = false,
bool bImmuneToKnockback = false,
bool bImmuneToInterrupt = false,
bool bImmuneToSpeed = false,
bool bImmuneToImaginationGain = false,
bool bImmuneToImaginationLoss = false,
bool bImmuneToQuickbuildInterrupt = false,
bool bImmuneToPullToPoint = false
);
void SendOrientToAngle(LWOOBJID objectId, bool bRelativeToCurrent, float fAngle, const SystemAddress& sysAddr); void SendOrientToAngle(LWOOBJID objectId, bool bRelativeToCurrent, float fAngle, const SystemAddress& sysAddr);
void SendAddRunSpeedModifier(LWOOBJID objectId, LWOOBJID caster, uint32_t modifier, const SystemAddress& sysAddr); void SendAddRunSpeedModifier(LWOOBJID objectId, LWOOBJID caster, uint32_t modifier, const SystemAddress& sysAddr);
@ -590,549 +618,14 @@ namespace GameMessages {
void SendRemoveBuff(Entity* entity, bool fromUnEquip, bool removeImmunity, uint32_t buffId); void SendRemoveBuff(Entity* entity, bool fromUnEquip, bool removeImmunity, uint32_t buffId);
/* Message to synchronize a skill cast */ // bubble
class EchoSyncSkill { void HandleDeactivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity);
static const GAME_MSG MsgID = GAME_MSG_ECHO_SYNC_SKILL;
public: void HandleActivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity);
EchoSyncSkill() {
bDone = false;
}
EchoSyncSkill(std::string _sBitStream, unsigned int _uiBehaviorHandle, unsigned int _uiSkillHandle, bool _bDone = false) { void SendActivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr);
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
EchoSyncSkill(RakNet::BitStream* stream) { void SendDeactivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr);
bDone = false;
Deserialize(stream);
}
~EchoSyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
unsigned int uiBehaviorHandle{};
unsigned int uiSkillHandle{};
};
/* Message to synchronize a skill cast */
class SyncSkill {
static const GAME_MSG MsgID = GAME_MSG_SYNC_SKILL;
public:
SyncSkill() {
bDone = false;
}
SyncSkill(std::string _sBitStream, unsigned int _uiBehaviorHandle, unsigned int _uiSkillHandle, bool _bDone = false) {
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
SyncSkill(RakNet::BitStream* stream) {
bDone = false;
Deserialize(stream);
}
~SyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
unsigned int uiBehaviorHandle{};
unsigned int uiSkillHandle{};
};
/* Notifying the server that a locally owned projectil impacted. Sent to the caster of the projectile
should always be the local char. */
class RequestServerProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_REQUEST_SERVER_PROJECTILE_IMPACT;
public:
RequestServerProjectileImpact() {
i64LocalID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
RequestServerProjectileImpact(std::string _sBitStream, LWOOBJID _i64LocalID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64LocalID = _i64LocalID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
RequestServerProjectileImpact(RakNet::BitStream* stream) {
i64LocalID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
Deserialize(stream);
}
~RequestServerProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(i64LocalID != LWOOBJID_EMPTY);
if (i64LocalID != LWOOBJID_EMPTY) stream->Write(i64LocalID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64LocalIDIsDefault{};
stream->Read(i64LocalIDIsDefault);
if (i64LocalIDIsDefault != 0) stream->Read(i64LocalID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64LocalID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
/* Tell a client local projectile to impact */
class DoClientProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_DO_CLIENT_PROJECTILE_IMPACT;
public:
DoClientProjectileImpact() {
i64OrgID = LWOOBJID_EMPTY;
i64OwnerID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
DoClientProjectileImpact(std::string _sBitStream, LWOOBJID _i64OrgID = LWOOBJID_EMPTY, LWOOBJID _i64OwnerID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64OrgID = _i64OrgID;
i64OwnerID = _i64OwnerID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
DoClientProjectileImpact(RakNet::BitStream* stream) {
i64OrgID = LWOOBJID_EMPTY;
i64OwnerID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
Deserialize(stream);
}
~DoClientProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(i64OrgID != LWOOBJID_EMPTY);
if (i64OrgID != LWOOBJID_EMPTY) stream->Write(i64OrgID);
stream->Write(i64OwnerID != LWOOBJID_EMPTY);
if (i64OwnerID != LWOOBJID_EMPTY) stream->Write(i64OwnerID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64OrgIDIsDefault{};
stream->Read(i64OrgIDIsDefault);
if (i64OrgIDIsDefault != 0) stream->Read(i64OrgID);
bool i64OwnerIDIsDefault{};
stream->Read(i64OwnerIDIsDefault);
if (i64OwnerIDIsDefault != 0) stream->Read(i64OwnerID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64OrgID;
LWOOBJID i64OwnerID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
/* Same as start skill but with different network options. An echo down to other clients that need to play the skill. */
class EchoStartSkill {
static const GAME_MSG MsgID = GAME_MSG_ECHO_START_SKILL;
public:
EchoStartSkill() {
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
EchoStartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, float _fCasterLatency = 0.0f, int _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, unsigned int _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
EchoStartSkill(RakNet::BitStream* stream) {
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
Deserialize(stream);
}
~EchoStartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bUsedMouse);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse;
float fCasterLatency;
int iCastType;
NiPoint3 lastClickedPosit;
LWOOBJID optionalOriginatorID;
LWOOBJID optionalTargetID;
NiQuaternion originatorRot;
std::string sBitStream;
TSkillID skillID;
unsigned int uiSkillHandle;
};
/* Same as sync skill but with different network options. An echo down to other clients that need to play the skill. */
class StartSkill {
static const GAME_MSG MsgID = GAME_MSG_START_SKILL;
public:
StartSkill() {
bUsedMouse = false;
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
StartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, LWOOBJID _consumableItemID = LWOOBJID_EMPTY, float _fCasterLatency = 0.0f, int _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, unsigned int _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
consumableItemID = _consumableItemID;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
StartSkill(RakNet::BitStream* stream) {
bUsedMouse = false;
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
Deserialize(stream);
}
~StartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bUsedMouse);
stream->Write(consumableItemID != LWOOBJID_EMPTY);
if (consumableItemID != LWOOBJID_EMPTY) stream->Write(consumableItemID);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool consumableItemIDIsDefault{};
stream->Read(consumableItemIDIsDefault);
if (consumableItemIDIsDefault != 0) stream->Read(consumableItemID);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse = false;
LWOOBJID consumableItemID{};
float fCasterLatency{};
int iCastType{};
NiPoint3 lastClickedPosit{};
LWOOBJID optionalOriginatorID{};
LWOOBJID optionalTargetID{};
NiQuaternion originatorRot{};
std::string sBitStream = "";
TSkillID skillID = 0;
unsigned int uiSkillHandle = 0;
};
}; };
#endif // GAMEMESSAGES_H #endif // GAMEMESSAGES_H

View File

@ -0,0 +1,74 @@
#ifndef __REQUESTSERVERPROJECTILEIMPACT__H__
#define __REQUESTSERVERPROJECTILEIMPACT__H__
#include "dCommonVars.h"
#include "dMessageIdentifiers.h"
/* Notifying the server that a locally owned projectile impacted. Sent to the caster of the projectile
should always be the local char. */
class RequestServerProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_REQUEST_SERVER_PROJECTILE_IMPACT;
public:
RequestServerProjectileImpact() {
i64LocalID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
RequestServerProjectileImpact(std::string _sBitStream, LWOOBJID _i64LocalID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64LocalID = _i64LocalID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
RequestServerProjectileImpact(RakNet::BitStream* stream) : RequestServerProjectileImpact() {
Deserialize(stream);
}
~RequestServerProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(i64LocalID != LWOOBJID_EMPTY);
if (i64LocalID != LWOOBJID_EMPTY) stream->Write(i64LocalID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64LocalIDIsDefault{};
stream->Read(i64LocalIDIsDefault);
if (i64LocalIDIsDefault != 0) stream->Read(i64LocalID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64LocalID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
#endif //!__REQUESTSERVERPROJECTILEIMPACT__H__

View File

@ -0,0 +1,144 @@
#ifndef __STARTSKILL__H__
#define __STARTSKILL__H__
#include "dCommonVars.h"
#include "dMessageIdentifiers.h"
#include "NiPoint3.h"
#include "NiQuaternion.h"
/**
* Same as sync skill but with different network options. An echo down to other clients that need to play the skill.
*/
class StartSkill {
static const GAME_MSG MsgID = GAME_MSG_START_SKILL;
public:
StartSkill() {
bUsedMouse = false;
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
StartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, LWOOBJID _consumableItemID = LWOOBJID_EMPTY, float _fCasterLatency = 0.0f, int32_t _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, uint32_t _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
consumableItemID = _consumableItemID;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
StartSkill(RakNet::BitStream* stream) : StartSkill() {
Deserialize(stream);
}
~StartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(bUsedMouse);
stream->Write(consumableItemID != LWOOBJID_EMPTY);
if (consumableItemID != LWOOBJID_EMPTY) stream->Write(consumableItemID);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool consumableItemIDIsDefault{};
stream->Read(consumableItemIDIsDefault);
if (consumableItemIDIsDefault != 0) stream->Read(consumableItemID);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse = false;
LWOOBJID consumableItemID{};
float fCasterLatency{};
int32_t iCastType{};
NiPoint3 lastClickedPosit{};
LWOOBJID optionalOriginatorID{};
LWOOBJID optionalTargetID{};
NiQuaternion originatorRot{};
std::string sBitStream = "";
TSkillID skillID = 0;
uint32_t uiSkillHandle = 0;
};
#endif //!__STARTSKILL__H__

View File

@ -0,0 +1,68 @@
#ifndef __SYNCSKILL__H__
#define __SYNCSKILL__H__
#include <cstdint>
#include <string>
#include "BitStream.h"
/* Message to synchronize a skill cast */
class SyncSkill {
static const GAME_MSG MsgID = GAME_MSG_SYNC_SKILL;
public:
SyncSkill() {
bDone = false;
}
SyncSkill(std::string _sBitStream, uint32_t _uiBehaviorHandle, uint32_t _uiSkillHandle, bool _bDone = false) {
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
SyncSkill(RakNet::BitStream* stream) : SyncSkill() {
Deserialize(stream);
}
~SyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write(MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (uint32_t k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
uint32_t uiBehaviorHandle{};
uint32_t uiSkillHandle{};
};
#endif //!__SYNCSKILL__H__

View File

@ -15,6 +15,7 @@
#include "eItemType.h" #include "eItemType.h"
#include "AssetManager.h" #include "AssetManager.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "Loot.h"
Item::Item(const LWOOBJID id, const LOT lot, Inventory* inventory, const uint32_t slot, const uint32_t count, const bool bound, const std::vector<LDFBaseData*>& config, const LWOOBJID parent, LWOOBJID subKey, eLootSourceType lootSourceType) { Item::Item(const LWOOBJID id, const LOT lot, Inventory* inventory, const uint32_t slot, const uint32_t count, const bool bound, const std::vector<LDFBaseData*>& config, const LWOOBJID parent, LWOOBJID subKey, eLootSourceType lootSourceType) {
if (!Inventory::IsValidItem(lot)) { if (!Inventory::IsValidItem(lot)) {

View File

@ -17,6 +17,7 @@
#include "dServer.h" #include "dServer.h"
#include "dZoneManager.h" #include "dZoneManager.h"
#include "InventoryComponent.h" #include "InventoryComponent.h"
#include "User.h"
#include "Database.h" #include "Database.h"
#include "WorldConfig.h" #include "WorldConfig.h"

View File

@ -13,6 +13,10 @@
#include "MissionState.h" #include "MissionState.h"
#include "MissionLockState.h" #include "MissionLockState.h"
namespace tinyxml2 {
class XMLElement;
};
class MissionComponent; class MissionComponent;
/** /**

View File

@ -7,6 +7,7 @@
#include "ModelComponent.h" #include "ModelComponent.h"
#include "../../dWorldServer/ObjectIDManager.h" #include "../../dWorldServer/ObjectIDManager.h"
#include "dLogger.h" #include "dLogger.h"
#include "User.h"
uint32_t GetBehaviorIDFromArgument(AMFArrayValue* arguments, const std::string& key = "BehaviorID") { uint32_t GetBehaviorIDFromArgument(AMFArrayValue* arguments, const std::string& key = "BehaviorID") {
auto* behaviorIDValue = arguments->FindValue<AMFStringValue>(key); auto* behaviorIDValue = arguments->FindValue<AMFStringValue>(key);

View File

@ -4,6 +4,7 @@
#include "BrickDatabase.h" #include "BrickDatabase.h"
#include "Game.h" #include "Game.h"
#include "AssetManager.h" #include "AssetManager.h"
#include "tinyxml2.h"
std::vector<Brick> BrickDatabase::emptyCache{}; std::vector<Brick> BrickDatabase::emptyCache{};
BrickDatabase* BrickDatabase::m_Address = nullptr; BrickDatabase* BrickDatabase::m_Address = nullptr;

View File

@ -1,5 +1,4 @@
set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp" set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp"
"GameConfig.cpp"
"GUID.cpp" "GUID.cpp"
"Loot.cpp" "Loot.cpp"
"Mail.cpp" "Mail.cpp"

View File

@ -1,50 +0,0 @@
#include "GameConfig.h"
#include <sstream>
std::map<std::string, std::string> GameConfig::m_Config{};
std::string GameConfig::m_EmptyString{};
void GameConfig::Load(const std::string& filepath) {
m_EmptyString = "";
std::ifstream in(filepath);
if (!in.good()) return;
std::string line;
while (std::getline(in, line)) {
if (line.length() > 0) {
if (line[0] != '#') ProcessLine(line);
}
}
}
const std::string& GameConfig::GetValue(const std::string& key) {
const auto& it = m_Config.find(key);
if (it != m_Config.end()) {
return it->second;
}
return m_EmptyString;
}
void GameConfig::SetValue(const std::string& key, const std::string& value) {
m_Config.insert_or_assign(key, value);
}
void GameConfig::ProcessLine(const std::string& line) {
std::stringstream ss(line);
std::string segment;
std::vector<std::string> seglist;
while (std::getline(ss, segment, '=')) {
seglist.push_back(segment);
}
if (seglist.size() != 2) return;
//Make sure that on Linux, we remove special characters:
if (!seglist[1].empty() && seglist[1][seglist[1].size() - 1] == '\r')
seglist[1].erase(seglist[1].size() - 1);
m_Config.insert_or_assign(seglist[0], seglist[1]);
}

View File

@ -1,38 +0,0 @@
#pragma once
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include "GeneralUtils.h"
class GameConfig {
public:
static void Load(const std::string& filepath);
static const std::string& GetValue(const std::string& key);
static void SetValue(const std::string& key, const std::string& value);
template <typename T>
static T GetValue(const std::string& key) {
T value;
if (GeneralUtils::TryParse(GetValue(key), value)) {
return value;
}
return T();
}
template <typename T>
static void SetValue(const std::string& key, const T& value) {
SetValue(key, std::to_string(value));
}
private:
static void ProcessLine(const std::string& line);
static std::map<std::string, std::string> m_Config;
static std::string m_EmptyString;
};

View File

@ -50,6 +50,9 @@
#include "Item.h" #include "Item.h"
#include "PropertyManagementComponent.h" #include "PropertyManagementComponent.h"
#include "PacketUtils.h" #include "PacketUtils.h"
#include "Loot.h"
#include "EntityInfo.h"
#include "LUTriggers.h"
#include "Player.h" #include "Player.h"
#include "PhantomPhysicsComponent.h" #include "PhantomPhysicsComponent.h"
#include "ProximityMonitorComponent.h" #include "ProximityMonitorComponent.h"
@ -60,12 +63,15 @@
#include "BuffComponent.h" #include "BuffComponent.h"
#include "SkillComponent.h" #include "SkillComponent.h"
#include "VanityUtilities.h" #include "VanityUtilities.h"
#include "GameConfig.h"
#include "ScriptedActivityComponent.h" #include "ScriptedActivityComponent.h"
#include "LevelProgressionComponent.h" #include "LevelProgressionComponent.h"
#include "AssetManager.h" #include "AssetManager.h"
#include "BinaryPathFinder.h" #include "BinaryPathFinder.h"
#include "dConfig.h" #include "dConfig.h"
#include "eBubbleType.h"
#include "AMFFormat.h"
#include "MovingPlatformComponent.h"
#include "dMessageIdentifiers.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) { void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
std::string chatCommand; std::string chatCommand;
@ -1192,11 +1198,17 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
EntityManager::Instance()->SerializeEntity(entity); EntityManager::Instance()->SerializeEntity(entity);
} }
if (chatCommand == "lookup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 1) { if (chatCommand == "lookup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
auto query = CDClientDatabase::CreatePreppedStmt( auto query = CDClientDatabase::CreatePreppedStmt(
"SELECT `id`, `name` FROM `Objects` WHERE `displayName` LIKE ?1 OR `name` LIKE ?1 OR `description` LIKE ?1 LIMIT 50"); "SELECT `id`, `name` FROM `Objects` WHERE `displayName` LIKE ?1 OR `name` LIKE ?1 OR `description` LIKE ?1 LIMIT 50");
// Concatenate all of the arguments into a single query so a multi word query can be used properly.
std::string conditional = args[0];
args.erase(args.begin());
for (auto& argument : args) {
conditional += ' ' + argument;
}
const std::string query_text = "%" + args[0] + "%"; const std::string query_text = "%" + conditional + "%";
query.bind(1, query_text.c_str()); query.bind(1, query_text.c_str());
auto tables = query.execQuery(); auto tables = query.execQuery();
@ -1695,25 +1707,6 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
return; return;
} }
if (chatCommand == "config-set" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 2) {
GameConfig::SetValue(args[0], args[1]);
ChatPackets::SendSystemMessage(
sysAddr, u"Set config value: " + GeneralUtils::UTF8ToUTF16(args[0]) + u" to " + GeneralUtils::UTF8ToUTF16(args[1])
);
}
if (chatCommand == "config-get" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
const auto& value = GameConfig::GetValue(args[0]);
std::u16string u16key = GeneralUtils::UTF8ToUTF16(args[0]);
if (value.empty()) {
ChatPackets::SendSystemMessage(sysAddr, u"No value found for " + u16key);
} else {
ChatPackets::SendSystemMessage(sysAddr, u"Value for " + u16key + u": " + GeneralUtils::UTF8ToUTF16(value));
}
}
if (chatCommand == "metrics" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) { if (chatCommand == "metrics" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
for (const auto variable : Metrics::GetAllMetrics()) { for (const auto variable : Metrics::GetAllMetrics()) {
auto* metric = Metrics::GetMetric(variable); auto* metric = Metrics::GetMetric(variable);

View File

@ -14,6 +14,7 @@
#include "Game.h" #include "Game.h"
#include "dLogger.h" #include "dLogger.h"
#include "BinaryPathFinder.h" #include "BinaryPathFinder.h"
#include "EntityInfo.h"
#include <fstream> #include <fstream>

View File

@ -31,7 +31,7 @@
#include "dConfig.h" #include "dConfig.h"
#include "CharacterComponent.h" #include "CharacterComponent.h"
#include "Database.h" #include "Database.h"
#include "dMessageIdentifiers.h"
void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* packet) { void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* packet) {

View File

@ -5,6 +5,8 @@
#include "GameMessages.h" #include "GameMessages.h"
#include "SkillComponent.h" #include "SkillComponent.h"
#include "BaseCombatAIComponent.h" #include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "eAninmationFlags.h"
void AmDarklingDragon::OnStartup(Entity* self) { void AmDarklingDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0); self->SetVar<int32_t>(u"weakspot", 0);

View File

@ -3,6 +3,8 @@
#include "SkillComponent.h" #include "SkillComponent.h"
#include "BaseCombatAIComponent.h" #include "BaseCombatAIComponent.h"
#include "DestroyableComponent.h" #include "DestroyableComponent.h"
#include "eAninmationFlags.h"
#include "EntityInfo.h"
void FvMaelstromDragon::OnStartup(Entity* self) { void FvMaelstromDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0); self->SetVar<int32_t>(u"weakspot", 0);

Some files were not shown because too many files have changed in this diff Show More