Merge branch 'main' into better-bitstream-tools

This commit is contained in:
Aaron Kimbre 2023-08-04 21:35:48 -05:00
commit 5c4a174691
38 changed files with 2379 additions and 703 deletions

View File

@ -14,4 +14,4 @@ EXTERNAL_IP=localhost
MARIADB_USER=darkflame MARIADB_USER=darkflame
MARIADB_PASSWORD=SECRET_VALUE_CHANGE_ME MARIADB_PASSWORD=SECRET_VALUE_CHANGE_ME
MARIADB_ROOT_PASSWORD=SECRET_VALUE_CHANGE_ME MARIADB_ROOT_PASSWORD=SECRET_VALUE_CHANGE_ME
MARIADB_DATABASE=darkflame MARIADB_DATABASE=darkflame

View File

@ -1,12 +1,8 @@
PROJECT_VERSION_MAJOR=1 PROJECT_VERSION_MAJOR=1
PROJECT_VERSION_MINOR=1 PROJECT_VERSION_MINOR=0
PROJECT_VERSION_PATCH=0 PROJECT_VERSION_PATCH=1
# LICENSE # LICENSE
LICENSE=AGPL-3.0 LICENSE=AGPL-3.0
# The network version.
# 171023 - Darkflame Universe client
# 171022 - Unmodded client
NET_VERSION=171022
# Debugging # Debugging
# Set __dynamic to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs. # Set __dynamic to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs.
__dynamic=1 __dynamic=1

View File

@ -179,7 +179,7 @@ If you would like to build the server faster, append `-j<number>` where number i
### Notes ### Notes
Depending on your operating system, you may need to adjust some pre-processor defines in [CMakeVariables.txt](./CMakeVariables.txt) before building: Depending on your operating system, you may need to adjust some pre-processor defines in [CMakeVariables.txt](./CMakeVariables.txt) before building:
* If you are on MacOS, ensure OPENSSL_ROOT_DIR is pointing to the openssl root directory. * If you are on MacOS, ensure OPENSSL_ROOT_DIR is pointing to the openssl root directory.
* If you are using a Darkflame Universe client, ensure NET_VERSION is changed to 171023. * If you are using a Darkflame Universe client, ensure `client_net_version` in `build/sharedconfig.ini` is changed to 171023.
## Configuring your server ## Configuring your server
This server has a few steps that need to be taken to configure the server for your use case. This server has a few steps that need to be taken to configure the server for your use case.

View File

@ -33,6 +33,7 @@ namespace Game {
dChatFilter* chatFilter = nullptr; dChatFilter* chatFilter = nullptr;
AssetManager* assetManager = nullptr; AssetManager* assetManager = nullptr;
bool shouldShutdown = false; bool shouldShutdown = false;
std::mt19937 randomEngine;
} }
@ -114,6 +115,8 @@ int main(int argc, char** argv) {
Game::server = new dServer(Game::config->GetValue("external_ip"), ourPort, 0, maxClients, false, true, Game::logger, masterIP, masterPort, ServerType::Chat, Game::config, &Game::shouldShutdown); Game::server = new dServer(Game::config->GetValue("external_ip"), ourPort, 0, maxClients, false, true, Game::logger, masterIP, masterPort, ServerType::Chat, Game::config, &Game::shouldShutdown);
Game::chatFilter = new dChatFilter(Game::assetManager->GetResPath().string() + "/chatplus_en_us", bool(std::stoi(Game::config->GetValue("dont_generate_dcf")))); Game::chatFilter = new dChatFilter(Game::assetManager->GetResPath().string() + "/chatplus_en_us", bool(std::stoi(Game::config->GetValue("dont_generate_dcf"))));
Game::randomEngine = std::mt19937(time(0));
//Run it until server gets a kill message from Master: //Run it until server gets a kill message from Master:
auto t = std::chrono::high_resolution_clock::now(); auto t = std::chrono::high_resolution_clock::now();

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,30 @@
#include "CDBehaviorParameterTable.h" #include "CDBehaviorParameterTable.h"
#include "GeneralUtils.h" #include "GeneralUtils.h"
CDBehaviorParameterTable::CDBehaviorParameterTable(void) { uint64_t GetHash(const uint32_t behaviorID, const uint32_t parameterID) {
uint64_t hash = behaviorID;
hash <<= 31U;
hash |= parameterID;
return hash;
}
CDBehaviorParameterTable::CDBehaviorParameterTable() {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorParameter"); auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorParameter");
uint32_t uniqueParameterId = 0;
uint64_t hash = 0;
while (!tableData.eof()) { while (!tableData.eof()) {
CDBehaviorParameter entry; uint32_t behaviorID = tableData.getIntField("behaviorID", -1);
entry.behaviorID = tableData.getIntField("behaviorID", -1);
auto candidateStringToAdd = std::string(tableData.getStringField("parameterID", "")); auto candidateStringToAdd = std::string(tableData.getStringField("parameterID", ""));
auto parameter = m_ParametersList.find(candidateStringToAdd); auto parameter = m_ParametersList.find(candidateStringToAdd);
uint32_t parameterId;
if (parameter != m_ParametersList.end()) { if (parameter != m_ParametersList.end()) {
entry.parameterID = parameter; parameterId = parameter->second;
} else { } else {
entry.parameterID = m_ParametersList.insert(std::make_pair(candidateStringToAdd, uniqueParameterId)).first; parameterId = m_ParametersList.insert(std::make_pair(candidateStringToAdd, m_ParametersList.size())).first->second;
uniqueParameterId++;
} }
hash = entry.behaviorID; uint64_t hash = GetHash(behaviorID, parameterId);
hash = (hash << 31U) | entry.parameterID->second; float value = tableData.getFloatField("value", -1.0f);
entry.value = tableData.getFloatField("value", -1.0f);
m_Entries.insert(std::make_pair(hash, entry)); m_Entries.insert(std::make_pair(hash, value));
tableData.nextRow(); tableData.nextRow();
} }
@ -30,27 +34,22 @@ CDBehaviorParameterTable::CDBehaviorParameterTable(void) {
float CDBehaviorParameterTable::GetValue(const uint32_t behaviorID, const std::string& name, const float defaultValue) { float CDBehaviorParameterTable::GetValue(const uint32_t behaviorID, const std::string& name, const float defaultValue) {
auto parameterID = this->m_ParametersList.find(name); auto parameterID = this->m_ParametersList.find(name);
if (parameterID == this->m_ParametersList.end()) return defaultValue; if (parameterID == this->m_ParametersList.end()) return defaultValue;
auto hash = GetHash(behaviorID, parameterID->second);
uint64_t hash = behaviorID;
hash = (hash << 31U) | parameterID->second;
// Search for specific parameter // Search for specific parameter
const auto& it = m_Entries.find(hash); auto it = m_Entries.find(hash);
return it != m_Entries.end() ? it->second.value : defaultValue; return it != m_Entries.end() ? it->second : defaultValue;
} }
std::map<std::string, float> CDBehaviorParameterTable::GetParametersByBehaviorID(uint32_t behaviorID) { std::map<std::string, float> CDBehaviorParameterTable::GetParametersByBehaviorID(uint32_t behaviorID) {
uint64_t hashBase = behaviorID; uint64_t hashBase = behaviorID;
std::map<std::string, float> returnInfo; std::map<std::string, float> returnInfo;
uint64_t hash; for (auto& [parameterString, parameterId] : m_ParametersList) {
for (auto& parameterCandidate : m_ParametersList) { uint64_t hash = GetHash(hashBase, parameterId);
hash = (hashBase << 31U) | parameterCandidate.second;
auto infoCandidate = m_Entries.find(hash); auto infoCandidate = m_Entries.find(hash);
if (infoCandidate != m_Entries.end()) { if (infoCandidate != m_Entries.end()) {
returnInfo.insert(std::make_pair(infoCandidate->second.parameterID->first, infoCandidate->second.value)); returnInfo.insert(std::make_pair(parameterString, infoCandidate->second));
} }
} }
return returnInfo; return returnInfo;
} }

View File

@ -5,18 +5,15 @@
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
struct CDBehaviorParameter {
unsigned int behaviorID; //!< The Behavior ID
std::unordered_map<std::string, uint32_t>::iterator parameterID; //!< The Parameter ID
float value; //!< The value of the behavior template
};
class CDBehaviorParameterTable : public CDTable<CDBehaviorParameterTable> { class CDBehaviorParameterTable : public CDTable<CDBehaviorParameterTable> {
private: private:
std::unordered_map<uint64_t, CDBehaviorParameter> m_Entries; typedef uint64_t BehaviorParameterHash;
typedef float BehaviorParameterValue;
std::unordered_map<BehaviorParameterHash, BehaviorParameterValue> m_Entries;
std::unordered_map<std::string, uint32_t> m_ParametersList; std::unordered_map<std::string, uint32_t> m_ParametersList;
public: public:
CDBehaviorParameterTable(); CDBehaviorParameterTable();
float GetValue(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0); float GetValue(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0);
std::map<std::string, float> GetParametersByBehaviorID(uint32_t behaviorID); std::map<std::string, float> GetParametersByBehaviorID(uint32_t behaviorID);

View File

@ -50,6 +50,7 @@
#include "BuildBorderComponent.h" #include "BuildBorderComponent.h"
#include "MovementAIComponent.h" #include "MovementAIComponent.h"
#include "VendorComponent.h" #include "VendorComponent.h"
#include "DonationVendorComponent.h"
#include "RocketLaunchpadControlComponent.h" #include "RocketLaunchpadControlComponent.h"
#include "PropertyComponent.h" #include "PropertyComponent.h"
#include "BaseCombatAIComponent.h" #include "BaseCombatAIComponent.h"
@ -577,6 +578,9 @@ void Entity::Initialize() {
if ((compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::VENDOR) > 0)) { if ((compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::VENDOR) > 0)) {
VendorComponent* comp = new VendorComponent(this); VendorComponent* comp = new VendorComponent(this);
m_Components.insert(std::make_pair(eReplicaComponentType::VENDOR, comp)); m_Components.insert(std::make_pair(eReplicaComponentType::VENDOR, comp));
} else if ((compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::DONATION_VENDOR, -1) != -1)) {
DonationVendorComponent* comp = new DonationVendorComponent(this);
m_Components.insert(std::make_pair(eReplicaComponentType::DONATION_VENDOR, comp));
} }
if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::PROPERTY_VENDOR, -1) != -1) { if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::PROPERTY_VENDOR, -1) != -1) {
@ -1159,6 +1163,11 @@ void Entity::WriteComponents(RakNet::BitStream* outBitStream, eReplicaPacketType
vendorComponent->Serialize(outBitStream, bIsInitialUpdate, flags); vendorComponent->Serialize(outBitStream, bIsInitialUpdate, flags);
} }
DonationVendorComponent* donationVendorComponent;
if (TryGetComponent(eReplicaComponentType::DONATION_VENDOR, donationVendorComponent)) {
donationVendorComponent->Serialize(outBitStream, bIsInitialUpdate, flags);
}
BouncerComponent* bouncerComponent; BouncerComponent* bouncerComponent;
if (TryGetComponent(eReplicaComponentType::BOUNCER, bouncerComponent)) { if (TryGetComponent(eReplicaComponentType::BOUNCER, bouncerComponent)) {
bouncerComponent->Serialize(outBitStream, bIsInitialUpdate, flags); bouncerComponent->Serialize(outBitStream, bIsInitialUpdate, flags);

View File

@ -85,6 +85,7 @@ public:
bool GetPlayerReadyForUpdates() const { return m_PlayerIsReadyForUpdates; } bool GetPlayerReadyForUpdates() const { return m_PlayerIsReadyForUpdates; }
bool GetIsGhostingCandidate() const; bool GetIsGhostingCandidate() const;
void SetIsGhostingCandidate(bool value) { m_IsGhostingCandidate = value; };
int8_t GetObservers() const; int8_t GetObservers() const;

View File

@ -131,8 +131,8 @@ void Leaderboard::QueryToLdf(std::unique_ptr<sql::ResultSet>& rows) {
// Time:1 // Time:1
break; break;
case Type::Donations: case Type::Donations:
entry.push_back(new LDFData<int32_t>(u"Points", rows->getInt("primaryScore"))); entry.push_back(new LDFData<int32_t>(u"Score", rows->getInt("primaryScore")));
// Score:1 // Score:1
break; break;
case Type::None: case Type::None:
// This type is included here simply to resolve a compiler warning on mac about unused enum types // This type is included here simply to resolve a compiler warning on mac about unused enum types
@ -170,32 +170,32 @@ void Leaderboard::SetupLeaderboard(bool weekly, uint32_t resultStart, uint32_t r
resultEnd++; resultEnd++;
// We need everything except 1 column so i'm selecting * from leaderboard // We need everything except 1 column so i'm selecting * from leaderboard
const std::string queryBase = const std::string queryBase =
R"QUERY( R"QUERY(
WITH leaderboardsRanked AS ( WITH leaderboardsRanked AS (
SELECT leaderboard.*, charinfo.name, SELECT leaderboard.*, charinfo.name,
RANK() OVER RANK() OVER
( (
ORDER BY %s, UNIX_TIMESTAMP(last_played) ASC, id DESC ORDER BY %s, UNIX_TIMESTAMP(last_played) ASC, id DESC
) AS ranking ) AS ranking
FROM leaderboard JOIN charinfo on charinfo.id = leaderboard.character_id FROM leaderboard JOIN charinfo on charinfo.id = leaderboard.character_id
WHERE game_id = ? %s WHERE game_id = ? %s
), ),
myStanding AS ( myStanding AS (
SELECT SELECT
ranking as myRank ranking as myRank
FROM leaderboardsRanked FROM leaderboardsRanked
WHERE id = ? WHERE id = ?
), ),
lowestRanking AS ( lowestRanking AS (
SELECT MAX(ranking) AS lowestRank SELECT MAX(ranking) AS lowestRank
FROM leaderboardsRanked FROM leaderboardsRanked
) )
SELECT leaderboardsRanked.*, character_id, UNIX_TIMESTAMP(last_played) as lastPlayed, leaderboardsRanked.name, leaderboardsRanked.ranking FROM leaderboardsRanked, myStanding, lowestRanking SELECT leaderboardsRanked.*, character_id, UNIX_TIMESTAMP(last_played) as lastPlayed, leaderboardsRanked.name, leaderboardsRanked.ranking FROM leaderboardsRanked, myStanding, lowestRanking
WHERE leaderboardsRanked.ranking WHERE leaderboardsRanked.ranking
BETWEEN BETWEEN
LEAST(GREATEST(CAST(myRank AS SIGNED) - 5, %i), lowestRanking.lowestRank - 9) LEAST(GREATEST(CAST(myRank AS SIGNED) - 5, %i), lowestRanking.lowestRank - 9)
AND AND
LEAST(GREATEST(myRank + 5, %i), lowestRanking.lowestRank) LEAST(GREATEST(myRank + 5, %i), lowestRanking.lowestRank)
ORDER BY ranking ASC; ORDER BY ranking ASC;
)QUERY"; )QUERY";
@ -277,15 +277,15 @@ std::string FormatInsert(const Leaderboard::Type& type, const Score& score, cons
if (useUpdate) { if (useUpdate) {
insertStatement = insertStatement =
R"QUERY( R"QUERY(
UPDATE leaderboard UPDATE leaderboard
SET primaryScore = %f, secondaryScore = %f, tertiaryScore = %f, SET primaryScore = %f, secondaryScore = %f, tertiaryScore = %f,
timesPlayed = timesPlayed + 1 WHERE character_id = ? AND game_id = ?; timesPlayed = timesPlayed + 1 WHERE character_id = ? AND game_id = ?;
)QUERY"; )QUERY";
} else { } else {
insertStatement = insertStatement =
R"QUERY( R"QUERY(
INSERT leaderboard SET INSERT leaderboard SET
primaryScore = %f, secondaryScore = %f, tertiaryScore = %f, primaryScore = %f, secondaryScore = %f, tertiaryScore = %f,
character_id = ?, game_id = ?; character_id = ?, game_id = ?;
)QUERY"; )QUERY";
} }
@ -300,9 +300,8 @@ std::string FormatInsert(const Leaderboard::Type& type, const Score& score, cons
void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activityId, const float primaryScore, const float secondaryScore, const float tertiaryScore) { void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activityId, const float primaryScore, const float secondaryScore, const float tertiaryScore) {
const Leaderboard::Type leaderboardType = GetLeaderboardType(activityId); const Leaderboard::Type leaderboardType = GetLeaderboardType(activityId);
auto* lookup = "SELECT * FROM leaderboard WHERE character_id = ? AND game_id = ?;";
std::unique_ptr<sql::PreparedStatement> query(Database::CreatePreppedStmt(lookup)); std::unique_ptr<sql::PreparedStatement> query(Database::CreatePreppedStmt("SELECT * FROM leaderboard WHERE character_id = ? AND game_id = ?;"));
query->setInt(1, playerID); query->setInt(1, playerID);
query->setInt(2, activityId); query->setInt(2, activityId);
std::unique_ptr<sql::ResultSet> myScoreResult(query->executeQuery()); std::unique_ptr<sql::ResultSet> myScoreResult(query->executeQuery());
@ -337,6 +336,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
case Leaderboard::Type::UnusedLeaderboard4: case Leaderboard::Type::UnusedLeaderboard4:
case Leaderboard::Type::Donations: { case Leaderboard::Type::Donations: {
oldScore.SetPrimaryScore(myScoreResult->getInt("primaryScore")); oldScore.SetPrimaryScore(myScoreResult->getInt("primaryScore"));
newScore.SetPrimaryScore(oldScore.GetPrimaryScore() + newScore.GetPrimaryScore());
break; break;
} }
case Leaderboard::Type::Racing: { case Leaderboard::Type::Racing: {
@ -382,7 +382,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
saveStatement->setInt(1, playerID); saveStatement->setInt(1, playerID);
saveStatement->setInt(2, activityId); saveStatement->setInt(2, activityId);
saveStatement->execute(); saveStatement->execute();
// track wins separately // track wins separately
if (leaderboardType == Leaderboard::Type::Racing && tertiaryScore != 0.0f) { if (leaderboardType == Leaderboard::Type::Racing && tertiaryScore != 0.0f) {
std::unique_ptr<sql::PreparedStatement> winUpdate(Database::CreatePreppedStmt("UPDATE leaderboard SET numWins = numWins + 1 WHERE character_id = ? AND game_id = ?;")); std::unique_ptr<sql::PreparedStatement> winUpdate(Database::CreatePreppedStmt("UPDATE leaderboard SET numWins = numWins + 1 WHERE character_id = ? AND game_id = ?;"));

View File

@ -318,7 +318,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
// Speed towards start position // Speed towards start position
if (m_MovementAI != nullptr) { if (m_MovementAI != nullptr) {
m_MovementAI->SetHaltDistance(0); m_MovementAI->SetHaltDistance(0);
m_MovementAI->SetSpeed(m_PursuitSpeed); m_MovementAI->SetMaxSpeed(m_PursuitSpeed);
m_MovementAI->SetDestination(m_StartPosition); m_MovementAI->SetDestination(m_StartPosition);
} }
@ -382,8 +382,6 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
} }
LWOOBJID BaseCombatAIComponent::FindTarget() { LWOOBJID BaseCombatAIComponent::FindTarget() {
//const auto reference = m_MovementAI == nullptr ? m_StartPosition : m_MovementAI->ApproximateLocation();
NiPoint3 reference = m_StartPosition; NiPoint3 reference = m_StartPosition;
if (m_MovementAI) reference = m_MovementAI->ApproximateLocation(); if (m_MovementAI) reference = m_MovementAI->ApproximateLocation();
@ -660,17 +658,17 @@ void BaseCombatAIComponent::Wander() {
destination.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(destination); destination.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(destination);
} }
if (Vector3::DistanceSquared(destination, m_MovementAI->GetCurrentPosition()) < 2 * 2) { if (Vector3::DistanceSquared(destination, m_MovementAI->GetParent()->GetPosition()) < 2 * 2) {
m_MovementAI->Stop(); m_MovementAI->Stop();
return; return;
} }
m_MovementAI->SetSpeed(m_TetherSpeed); m_MovementAI->SetMaxSpeed(m_TetherSpeed);
m_MovementAI->SetDestination(destination); m_MovementAI->SetDestination(destination);
m_Timer += (m_MovementAI->GetCurrentPosition().x - destination.x) / m_TetherSpeed; m_Timer += (m_MovementAI->GetParent()->GetPosition().x - destination.x) / m_TetherSpeed;
} }
void BaseCombatAIComponent::OnAggro() { void BaseCombatAIComponent::OnAggro() {
@ -685,21 +683,21 @@ void BaseCombatAIComponent::OnAggro() {
m_MovementAI->SetHaltDistance(m_AttackRadius); m_MovementAI->SetHaltDistance(m_AttackRadius);
NiPoint3 targetPos = target->GetPosition(); NiPoint3 targetPos = target->GetPosition();
NiPoint3 currentPos = m_MovementAI->GetCurrentPosition(); NiPoint3 currentPos = m_MovementAI->GetParent()->GetPosition();
// If the player's position is within range, attack // If the player's position is within range, attack
if (Vector3::DistanceSquared(currentPos, targetPos) <= m_AttackRadius * m_AttackRadius) { if (Vector3::DistanceSquared(currentPos, targetPos) <= m_AttackRadius * m_AttackRadius) {
m_MovementAI->Stop(); m_MovementAI->Stop();
} else if (Vector3::DistanceSquared(m_StartPosition, targetPos) > m_HardTetherRadius * m_HardTetherRadius) //Return to spawn if we're too far } else if (Vector3::DistanceSquared(m_StartPosition, targetPos) > m_HardTetherRadius * m_HardTetherRadius) //Return to spawn if we're too far
{ {
m_MovementAI->SetSpeed(m_PursuitSpeed); m_MovementAI->SetMaxSpeed(m_PursuitSpeed);
m_MovementAI->SetDestination(m_StartPosition); m_MovementAI->SetDestination(m_StartPosition);
} else //Chase the player's new position } else //Chase the player's new position
{ {
if (IsMech() && Vector3::DistanceSquared(targetPos, currentPos) > m_AttackRadius * m_AttackRadius * 3 * 3) return; if (IsMech() && Vector3::DistanceSquared(targetPos, currentPos) > m_AttackRadius * m_AttackRadius * 3 * 3) return;
m_MovementAI->SetSpeed(m_PursuitSpeed); m_MovementAI->SetMaxSpeed(m_PursuitSpeed);
m_MovementAI->SetDestination(targetPos); m_MovementAI->SetDestination(targetPos);
@ -725,7 +723,7 @@ void BaseCombatAIComponent::OnTether() {
m_MovementAI->Stop(); m_MovementAI->Stop();
} else if (Vector3::DistanceSquared(m_StartPosition, targetPos) > m_HardTetherRadius * m_HardTetherRadius) //Return to spawn if we're too far } else if (Vector3::DistanceSquared(m_StartPosition, targetPos) > m_HardTetherRadius * m_HardTetherRadius) //Return to spawn if we're too far
{ {
m_MovementAI->SetSpeed(m_PursuitSpeed); m_MovementAI->SetMaxSpeed(m_PursuitSpeed);
m_MovementAI->SetDestination(m_StartPosition); m_MovementAI->SetDestination(m_StartPosition);
@ -733,7 +731,7 @@ void BaseCombatAIComponent::OnTether() {
} else { } else {
if (IsMech() && Vector3::DistanceSquared(targetPos, currentPos) > m_AttackRadius * m_AttackRadius * 3 * 3) return; if (IsMech() && Vector3::DistanceSquared(targetPos, currentPos) > m_AttackRadius * m_AttackRadius * 3 * 3) return;
m_MovementAI->SetSpeed(m_PursuitSpeed); m_MovementAI->SetMaxSpeed(m_PursuitSpeed);
m_MovementAI->SetDestination(targetPos); m_MovementAI->SetDestination(targetPos);
} }

View File

@ -6,6 +6,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"Component.cpp" "Component.cpp"
"ControllablePhysicsComponent.cpp" "ControllablePhysicsComponent.cpp"
"DestroyableComponent.cpp" "DestroyableComponent.cpp"
"DonationVendorComponent.cpp"
"InventoryComponent.cpp" "InventoryComponent.cpp"
"LevelProgressionComponent.cpp" "LevelProgressionComponent.cpp"
"LUPExhibitComponent.cpp" "LUPExhibitComponent.cpp"

View File

@ -276,6 +276,10 @@ public:
*/ */
void UpdateClientMinimap(bool showFaction, std::string ventureVisionType) const; void UpdateClientMinimap(bool showFaction, std::string ventureVisionType) const;
void SetCurrentInteracting(LWOOBJID objectID) {m_CurrentInteracting = objectID;};
LWOOBJID GetCurrentInteracting() {return m_CurrentInteracting;};
/** /**
* Character info regarding this character, including clothing styles, etc. * Character info regarding this character, including clothing styles, etc.
*/ */
@ -560,6 +564,8 @@ private:
* ID of the last rocket used * ID of the last rocket used
*/ */
LWOOBJID m_LastRocketItemID = LWOOBJID_EMPTY; LWOOBJID m_LastRocketItemID = LWOOBJID_EMPTY;
LWOOBJID m_CurrentInteracting = LWOOBJID_EMPTY;
}; };
#endif // CHARACTERCOMPONENT_H #endif // CHARACTERCOMPONENT_H

View File

@ -0,0 +1,50 @@
#include "DonationVendorComponent.h"
#include "Database.h"
DonationVendorComponent::DonationVendorComponent(Entity* parent) : VendorComponent(parent) {
//LoadConfigData
m_PercentComplete = 0.0;
m_TotalDonated = 0;
m_TotalRemaining = 0;
// custom attribute to calculate other values
m_Goal = m_Parent->GetVar<int32_t>(u"donationGoal");
if (m_Goal == 0) m_Goal = INT32_MAX;
// Default to the nexus tower jawbox activity and setup settings
m_ActivityId = m_Parent->GetVar<uint32_t>(u"activityID");
if ((m_ActivityId == 0) || (m_ActivityId == 117)) {
m_ActivityId = 117;
m_PercentComplete = 1.0;
m_TotalDonated = INT32_MAX;
m_TotalRemaining = 0;
m_Goal = INT32_MAX;
return;
}
std::unique_ptr<sql::PreparedStatement> query(Database::CreatePreppedStmt("SELECT SUM(primaryScore) as donation_total FROM leaderboard WHERE game_id = ?;"));
query->setInt(1, m_ActivityId);
std::unique_ptr<sql::ResultSet> donation_total(query->executeQuery());
if (donation_total->next()) m_TotalDonated = donation_total->getInt("donation_total");
m_TotalRemaining = m_Goal - m_TotalDonated;
m_PercentComplete = m_TotalDonated/static_cast<float>(m_Goal);
}
void DonationVendorComponent::SubmitDonation(uint32_t count) {
if (count <= 0 && ((m_TotalDonated + count) > 0)) return;
m_TotalDonated += count;
m_TotalRemaining = m_Goal - m_TotalDonated;
m_PercentComplete = m_TotalDonated/static_cast<float>(m_Goal);
m_DirtyDonationVendor = true;
}
void DonationVendorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
VendorComponent::Serialize(outBitStream, bIsInitialUpdate, flags);
outBitStream->Write(bIsInitialUpdate || m_DirtyDonationVendor);
if (bIsInitialUpdate || m_DirtyDonationVendor) {
outBitStream->Write(m_PercentComplete);
outBitStream->Write(m_TotalDonated);
outBitStream->Write(m_TotalRemaining);
if (!bIsInitialUpdate) m_DirtyDonationVendor = false;
}
}

View File

@ -0,0 +1,27 @@
#ifndef __DONATIONVENDORCOMPONENT__H__
#define __DONATIONVENDORCOMPONENT__H__
#include "VendorComponent.h"
#include "eReplicaComponentType.h"
class Entity;
class DonationVendorComponent final : public VendorComponent {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::DONATION_VENDOR;
DonationVendorComponent(Entity* parent);
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
uint32_t GetActivityID() {return m_ActivityId;};
void SubmitDonation(uint32_t count);
private:
bool m_DirtyDonationVendor = false;
float m_PercentComplete = 0.0;
int32_t m_TotalDonated = 0;
int32_t m_TotalRemaining = 0;
uint32_t m_ActivityId = 0;
int32_t m_Goal = 0;
};
#endif //!__DONATIONVENDORCOMPONENT__H__

View File

@ -116,6 +116,9 @@ Inventory* InventoryComponent::GetInventory(const eInventoryType type) {
case eInventoryType::VENDOR_BUYBACK: case eInventoryType::VENDOR_BUYBACK:
size = 27u; size = 27u;
break; break;
case eInventoryType::DONATION:
size = 24u;
break;
default: default:
break; break;
} }

View File

@ -10,85 +10,77 @@
#include "EntityManager.h" #include "EntityManager.h"
#include "SimplePhysicsComponent.h" #include "SimplePhysicsComponent.h"
#include "CDClientManager.h" #include "CDClientManager.h"
#include "Game.h"
#include "dZoneManager.h"
#include "CDComponentsRegistryTable.h" #include "CDComponentsRegistryTable.h"
#include "CDPhysicsComponentTable.h" #include "CDPhysicsComponentTable.h"
std::map<LOT, float> MovementAIComponent::m_PhysicsSpeedCache = {}; namespace {
/**
* Cache of all lots and their respective speeds
*/
std::map<LOT, float> m_PhysicsSpeedCache;
}
MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) : Component(parent) { MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) : Component(parent) {
m_Info = std::move(info); m_Info = info;
m_Done = true; m_AtFinalWaypoint = true;
m_BaseCombatAI = nullptr; m_BaseCombatAI = nullptr;
m_BaseCombatAI = reinterpret_cast<BaseCombatAIComponent*>(m_Parent->GetComponent(eReplicaComponentType::BASE_COMBAT_AI)); m_BaseCombatAI = m_Parent->GetComponent<BaseCombatAIComponent>();
//Try and fix the insane values: //Try and fix the insane values:
if (m_Info.wanderRadius > 5.0f) m_Info.wanderRadius = m_Info.wanderRadius * 0.5f; if (m_Info.wanderRadius > 5.0f) m_Info.wanderRadius *= 0.5f;
if (m_Info.wanderRadius > 8.0f) m_Info.wanderRadius = 8.0f; if (m_Info.wanderRadius > 8.0f) m_Info.wanderRadius = 8.0f;
if (m_Info.wanderSpeed > 0.5f) m_Info.wanderSpeed = m_Info.wanderSpeed * 0.5f; if (m_Info.wanderSpeed > 0.5f) m_Info.wanderSpeed *= 0.5f;
m_BaseSpeed = GetBaseSpeed(m_Parent->GetLOT()); m_BaseSpeed = GetBaseSpeed(m_Parent->GetLOT());
m_NextWaypoint = GetCurrentPosition(); m_NextWaypoint = m_Parent->GetPosition();
m_Acceleration = 0.4f; m_Acceleration = 0.4f;
m_Interrupted = false; m_PullingToPoint = false;
m_PullPoint = {}; m_PullPoint = NiPoint3::ZERO;
m_HaltDistance = 0; m_HaltDistance = 0;
m_Timer = 0; m_TimeToTravel = 0;
m_TimeTravelled = 0;
m_CurrentSpeed = 0; m_CurrentSpeed = 0;
m_Speed = 0; m_MaxSpeed = 0;
m_TotalTime = 0;
m_LockRotation = false; m_LockRotation = false;
} }
MovementAIComponent::~MovementAIComponent() = default;
void MovementAIComponent::Update(const float deltaTime) { void MovementAIComponent::Update(const float deltaTime) {
if (m_Interrupted) { if (m_PullingToPoint) {
const auto source = GetCurrentWaypoint(); const auto source = GetCurrentWaypoint();
const auto speed = deltaTime * 2.5f; const auto speed = deltaTime * 2.5f;
NiPoint3 velocity; NiPoint3 velocity = (m_PullPoint - source) * speed;
velocity.x = (m_PullPoint.x - source.x) * speed;
velocity.y = (m_PullPoint.y - source.y) * speed;
velocity.z = (m_PullPoint.z - source.z) * speed;
SetPosition(source + velocity); SetPosition(source + velocity);
if (Vector3::DistanceSquared(GetCurrentPosition(), m_PullPoint) < 2 * 2) { if (Vector3::DistanceSquared(m_Parent->GetPosition(), m_PullPoint) < std::pow(2, 2)) {
m_Interrupted = false; m_PullingToPoint = false;
} }
return; return;
} }
if (AtFinalWaypoint()) // Are we done? // Are we done?
{ if (AtFinalWaypoint()) return;
return;
}
if (m_HaltDistance > 0) { if (m_HaltDistance > 0) {
if (Vector3::DistanceSquared(ApproximateLocation(), GetDestination()) < m_HaltDistance * m_HaltDistance) // Prevent us from hugging the target // Prevent us from hugging the target
{ if (Vector3::DistanceSquared(ApproximateLocation(), GetDestination()) < std::pow(m_HaltDistance, 2)) {
Stop(); Stop();
return; return;
} }
} }
if (m_Timer > 0) { m_TimeTravelled += deltaTime;
m_Timer -= deltaTime; if (m_TimeTravelled < m_TimeToTravel) return;
m_TimeTravelled = 0.0f;
if (m_Timer > 0) {
return;
}
m_Timer = 0;
}
const auto source = GetCurrentWaypoint(); const auto source = GetCurrentWaypoint();
@ -101,48 +93,44 @@ void MovementAIComponent::Update(const float deltaTime) {
m_NextWaypoint = GetCurrentWaypoint(); m_NextWaypoint = GetCurrentWaypoint();
if (m_NextWaypoint == source) { if (m_NextWaypoint == source) {
m_Timer = 0; m_TimeToTravel = 0.0f;
goto nextAction; goto nextAction;
} }
if (m_CurrentSpeed < m_Speed) { if (m_CurrentSpeed < m_MaxSpeed) {
m_CurrentSpeed += m_Acceleration; m_CurrentSpeed += m_Acceleration;
} }
if (m_CurrentSpeed > m_Speed) { if (m_CurrentSpeed > m_MaxSpeed) {
m_CurrentSpeed = m_Speed; m_CurrentSpeed = m_MaxSpeed;
} }
const auto speed = m_CurrentSpeed * m_BaseSpeed; const auto speed = m_CurrentSpeed * m_BaseSpeed; // scale speed based on base speed
const auto delta = m_NextWaypoint - source; const auto delta = m_NextWaypoint - source;
// Normalize the vector // Normalize the vector
const auto length = sqrtf(delta.x * delta.x + delta.y * delta.y + delta.z * delta.z); const auto length = delta.Length();
if (length > 0) { if (length > 0) {
velocity.x = (delta.x / length) * speed; velocity = (delta / length) * speed;
velocity.y = (delta.y / length) * speed;
velocity.z = (delta.z / length) * speed;
} }
// Calclute the time it will take to reach the next waypoint with the current speed // Calclute the time it will take to reach the next waypoint with the current speed
m_TotalTime = m_Timer = length / speed; m_TimeTravelled = 0.0f;
m_TimeToTravel = length / speed;
SetRotation(NiQuaternion::LookAt(source, m_NextWaypoint)); SetRotation(NiQuaternion::LookAt(source, m_NextWaypoint));
} else { } else {
// Check if there are more waypoints in the queue, if so set our next destination to the next waypoint // Check if there are more waypoints in the queue, if so set our next destination to the next waypoint
if (!m_Queue.empty()) { if (m_CurrentPath.empty()) {
SetDestination(m_Queue.top());
m_Queue.pop();
} else {
// We have reached our final waypoint
Stop(); Stop();
return; return;
} }
SetDestination(m_CurrentPath.top());
m_CurrentPath.pop();
} }
nextAction: nextAction:
@ -157,7 +145,7 @@ const MovementAIInfo& MovementAIComponent::GetInfo() const {
} }
bool MovementAIComponent::AdvanceWaypointIndex() { bool MovementAIComponent::AdvanceWaypointIndex() {
if (m_PathIndex >= m_CurrentPath.size()) { if (m_PathIndex >= m_InterpolatedWaypoints.size()) {
return false; return false;
} }
@ -167,37 +155,19 @@ bool MovementAIComponent::AdvanceWaypointIndex() {
} }
NiPoint3 MovementAIComponent::GetCurrentWaypoint() const { NiPoint3 MovementAIComponent::GetCurrentWaypoint() const {
if (m_PathIndex >= m_CurrentPath.size()) { return m_PathIndex >= m_InterpolatedWaypoints.size() ? m_Parent->GetPosition() : m_InterpolatedWaypoints[m_PathIndex];
return GetCurrentPosition();
}
return m_CurrentPath[m_PathIndex];
}
NiPoint3 MovementAIComponent::GetNextWaypoint() const {
return m_NextWaypoint;
}
NiPoint3 MovementAIComponent::GetCurrentPosition() const {
return m_Parent->GetPosition();
} }
NiPoint3 MovementAIComponent::ApproximateLocation() const { NiPoint3 MovementAIComponent::ApproximateLocation() const {
auto source = GetCurrentPosition(); auto source = m_Parent->GetPosition();
if (m_Done) { if (AtFinalWaypoint()) return source;
return source;
}
auto destination = m_NextWaypoint; auto destination = m_NextWaypoint;
auto factor = m_TotalTime > 0 ? (m_TotalTime - m_Timer) / m_TotalTime : 0; auto percentageToWaypoint = m_TimeToTravel > 0 ? m_TimeTravelled / m_TimeToTravel : 0;
auto x = source.x + factor * (destination.x - source.x); auto approximation = source + ((destination - source) * percentageToWaypoint);
auto y = source.y + factor * (destination.y - source.y);
auto z = source.z + factor * (destination.z - source.z);
NiPoint3 approximation = NiPoint3(x, y, z);
if (dpWorld::Instance().IsLoaded()) { if (dpWorld::Instance().IsLoaded()) {
approximation.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(approximation); approximation.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(approximation);
@ -226,28 +196,20 @@ bool MovementAIComponent::Warp(const NiPoint3& point) {
return true; return true;
} }
float MovementAIComponent::GetTimer() const {
return m_Timer;
}
bool MovementAIComponent::AtFinalWaypoint() const {
return m_Done;
}
void MovementAIComponent::Stop() { void MovementAIComponent::Stop() {
if (m_Done) { if (AtFinalWaypoint()) return;
return;
}
SetPosition(ApproximateLocation()); SetPosition(ApproximateLocation());
SetVelocity(NiPoint3::ZERO); SetVelocity(NiPoint3::ZERO);
m_TotalTime = m_Timer = 0; m_TimeToTravel = 0;
m_TimeTravelled = 0;
m_Done = true; m_AtFinalWaypoint = true;
m_CurrentPath = {}; m_InterpolatedWaypoints.clear();
while (!m_CurrentPath.empty()) m_CurrentPath.pop();
m_PathIndex = 0; m_PathIndex = 0;
@ -259,20 +221,17 @@ void MovementAIComponent::Stop() {
void MovementAIComponent::PullToPoint(const NiPoint3& point) { void MovementAIComponent::PullToPoint(const NiPoint3& point) {
Stop(); Stop();
m_Interrupted = true; m_PullingToPoint = true;
m_PullPoint = point; m_PullPoint = point;
} }
void MovementAIComponent::SetPath(std::vector<NiPoint3> path) { void MovementAIComponent::SetPath(std::vector<NiPoint3> path) {
std::reverse(path.begin(), path.end()); if (path.empty()) return;
std::for_each(path.rbegin(), path.rend() - 1, [this](const NiPoint3& point) {
this->m_CurrentPath.push(point);
});
for (const auto& point : path) { SetDestination(path.front());
m_Queue.push(point);
}
SetDestination(m_Queue.top());
m_Queue.pop();
} }
float MovementAIComponent::GetBaseSpeed(LOT lot) { float MovementAIComponent::GetBaseSpeed(LOT lot) {
@ -291,26 +250,14 @@ float MovementAIComponent::GetBaseSpeed(LOT lot) {
componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::CONTROLLABLE_PHYSICS, -1); componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::CONTROLLABLE_PHYSICS, -1);
if (componentID != -1) { if (componentID == -1) {
physicsComponent = physicsComponentTable->GetByID(componentID); componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::SIMPLE_PHYSICS, -1);
goto foundComponent;
} }
componentID = componentRegistryTable->GetByIDAndType(lot, eReplicaComponentType::SIMPLE_PHYSICS, -1); physicsComponent = physicsComponentTable->GetByID(componentID);
if (componentID != -1) {
physicsComponent = physicsComponentTable->GetByID(componentID);
goto foundComponent;
}
foundComponent:
// Client defaults speed to 10 and if the speed is also null in the table, it defaults to 10. // Client defaults speed to 10 and if the speed is also null in the table, it defaults to 10.
float speed = 10.0f; float speed = physicsComponent != nullptr ? physicsComponent->speed : 10.0f;
if (physicsComponent) speed = physicsComponent->speed;
float delta = fabs(speed) - 1.0f; float delta = fabs(speed) - 1.0f;
@ -322,39 +269,11 @@ foundComponent:
} }
void MovementAIComponent::SetPosition(const NiPoint3& value) { void MovementAIComponent::SetPosition(const NiPoint3& value) {
auto* controllablePhysicsComponent = m_Parent->GetComponent<ControllablePhysicsComponent>(); m_Parent->SetPosition(value);
if (controllablePhysicsComponent != nullptr) {
controllablePhysicsComponent->SetPosition(value);
return;
}
auto* simplePhysicsComponent = m_Parent->GetComponent<SimplePhysicsComponent>();
if (simplePhysicsComponent != nullptr) {
simplePhysicsComponent->SetPosition(value);
}
} }
void MovementAIComponent::SetRotation(const NiQuaternion& value) { void MovementAIComponent::SetRotation(const NiQuaternion& value) {
if (m_LockRotation) { if (!m_LockRotation) m_Parent->SetRotation(value);
return;
}
auto* controllablePhysicsComponent = m_Parent->GetComponent<ControllablePhysicsComponent>();
if (controllablePhysicsComponent != nullptr) {
controllablePhysicsComponent->SetRotation(value);
return;
}
auto* simplePhysicsComponent = m_Parent->GetComponent<SimplePhysicsComponent>();
if (simplePhysicsComponent != nullptr) {
simplePhysicsComponent->SetRotation(value);
}
} }
void MovementAIComponent::SetVelocity(const NiPoint3& value) { void MovementAIComponent::SetVelocity(const NiPoint3& value) {
@ -373,15 +292,8 @@ void MovementAIComponent::SetVelocity(const NiPoint3& value) {
} }
} }
void MovementAIComponent::SetDestination(const NiPoint3& value) { void MovementAIComponent::SetDestination(const NiPoint3& destination) {
if (m_Interrupted) { if (m_PullingToPoint) return;
return;
}
/*if (Vector3::DistanceSquared(value, GetDestination()) < 2 * 2)
{
return;
}*/
const auto location = ApproximateLocation(); const auto location = ApproximateLocation();
@ -390,97 +302,53 @@ void MovementAIComponent::SetDestination(const NiPoint3& value) {
} }
std::vector<NiPoint3> computedPath; std::vector<NiPoint3> computedPath;
if (dpWorld::Instance().IsLoaded()) { if (dpWorld::Instance().IsLoaded()) {
computedPath = dpWorld::Instance().GetNavMesh()->GetPath(GetCurrentPosition(), value, m_Info.wanderSpeed); computedPath = dpWorld::Instance().GetNavMesh()->GetPath(m_Parent->GetPosition(), destination, m_Info.wanderSpeed);
} else { }
// Somehow failed
if (computedPath.empty()) {
// Than take 10 points between the current position and the destination and make that the path // Than take 10 points between the current position and the destination and make that the path
auto point = location; auto start = location;
auto delta = value - point; auto delta = destination - start;
auto step = delta / 10; auto step = delta / 10.0f;
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
point = point + step; // TODO: Replace this with += when the NiPoint3::operator+= is fixed
start = start + step;
computedPath.push_back(point); computedPath.push_back(start);
} }
} }
if (computedPath.empty()) // Somehow failed m_InterpolatedWaypoints.clear();
{
return;
}
m_CurrentPath.clear();
m_CurrentPath.push_back(location);
// Simply path // Simply path
for (auto point : computedPath) { for (auto& point : computedPath) {
if (dpWorld::Instance().IsLoaded()) { if (dpWorld::Instance().IsLoaded()) {
point.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(point); point.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(point);
} }
m_CurrentPath.push_back(point); m_InterpolatedWaypoints.push_back(point);
} }
m_CurrentPath.push_back(computedPath[computedPath.size() - 1]);
m_PathIndex = 0; m_PathIndex = 0;
m_TotalTime = m_Timer = 0; m_TimeTravelled = 0;
m_TimeToTravel = 0;
m_Done = false; m_AtFinalWaypoint = false;
} }
NiPoint3 MovementAIComponent::GetDestination() const { NiPoint3 MovementAIComponent::GetDestination() const {
if (m_CurrentPath.empty()) { return m_InterpolatedWaypoints.empty() ? m_Parent->GetPosition() : m_InterpolatedWaypoints.back();
return GetCurrentPosition();
}
return m_CurrentPath[m_CurrentPath.size() - 1];
} }
void MovementAIComponent::SetSpeed(const float value) { void MovementAIComponent::SetMaxSpeed(const float value) {
m_Speed = value; if (value == m_MaxSpeed) return;
m_MaxSpeed = value;
m_Acceleration = value / 5; m_Acceleration = value / 5;
} }
float MovementAIComponent::GetSpeed() const {
return m_Speed;
}
void MovementAIComponent::SetAcceleration(const float value) {
m_Acceleration = value;
}
float MovementAIComponent::GetAcceleration() const {
return m_Acceleration;
}
void MovementAIComponent::SetHaltDistance(const float value) {
m_HaltDistance = value;
}
float MovementAIComponent::GetHaltDistance() const {
return m_HaltDistance;
}
void MovementAIComponent::SetCurrentSpeed(float value) {
m_CurrentSpeed = value;
}
float MovementAIComponent::GetCurrentSpeed() const {
return m_CurrentSpeed;
}
void MovementAIComponent::SetLockRotation(bool value) {
m_LockRotation = value;
}
bool MovementAIComponent::GetLockRotation() const {
return m_LockRotation;
}

View File

@ -1,6 +1,6 @@
/* /*
* Darkflame Universe * Darkflame Universe
* Copyright 2018 * Copyright 2023
*/ */
#ifndef MOVEMENTAICOMPONENT_H #ifndef MOVEMENTAICOMPONENT_H
@ -60,7 +60,6 @@ public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI; static const eReplicaComponentType ComponentType = eReplicaComponentType::MOVEMENT_AI;
MovementAIComponent(Entity* parentEntity, MovementAIInfo info); MovementAIComponent(Entity* parentEntity, MovementAIInfo info);
~MovementAIComponent() override;
void Update(float deltaTime) override; void Update(float deltaTime) override;
@ -86,61 +85,55 @@ public:
* Sets the max speed at which this entity may run * Sets the max speed at which this entity may run
* @param value the speed value to set * @param value the speed value to set
*/ */
void SetSpeed(float value); void SetMaxSpeed(float value);
/**
* Returns the max speed at which this entity may run
* @return the max speed at which this entity may run
*/
float GetSpeed() const;
/** /**
* Sets how fast the entity will accelerate when not running at full speed * Sets how fast the entity will accelerate when not running at full speed
* @param value the acceleration to set * @param value the acceleration to set
*/ */
void SetAcceleration(float value); void SetAcceleration(float value) { m_Acceleration = value; };
/** /**
* Returns the current speed at which this entity accelerates when not running at full speed * Returns the current speed at which this entity accelerates when not running at full speed
* @return the current speed at which this entity accelerates when not running at full speed * @return the current speed at which this entity accelerates when not running at full speed
*/ */
float GetAcceleration() const; float GetAcceleration() const { return m_Acceleration; };
/** /**
* Sets the halting distance (the distance at which we consider the target to be reached) * Sets the halting distance (the distance at which we consider the target to be reached)
* @param value the halting distance to set * @param value the halting distance to set
*/ */
void SetHaltDistance(float value); void SetHaltDistance(float value) { m_HaltDistance = value; }
/** /**
* Returns the current halting distance (the distance at which we consider the target to be reached) * Returns the current halting distance (the distance at which we consider the target to be reached)
* @return the current halting distance * @return the current halting distance
*/ */
float GetHaltDistance() const; float GetHaltDistance() const { return m_HaltDistance; }
/** /**
* Sets the speed the entity is currently running at * Sets the speed the entity is currently running at
* @param value the speed value to set * @param value the speed value to set
*/ */
void SetCurrentSpeed(float value); void SetCurrentSpeed(float value) { m_CurrentSpeed = value; }
/** /**
* Returns the speed the entity is currently running at * Returns the speed the entity is currently running at
* @return the speed the entity is currently running at * @return the speed the entity is currently running at
*/ */
float GetCurrentSpeed() const; float GetCurrentSpeed() const { return m_CurrentSpeed; }
/** /**
* Locks the rotation of this entity in place, depending on the argument * Locks the rotation of this entity in place, depending on the argument
* @param value if true, the entity will be rotationally locked * @param value if true, the entity will be rotationally locked
*/ */
void SetLockRotation(bool value); void SetLockRotation(bool value) { m_LockRotation = value; }
/** /**
* Returns whether this entity is currently rotationally locked * Returns whether this entity is currently rotationally locked
* @return true if the entity is rotationally locked, false otherwise * @return true if the entity is rotationally locked, false otherwise
*/ */
bool GetLockRotation() const; bool GetLockRotation() const { return m_LockRotation; };
/** /**
* Attempts to update the waypoint index, making the entity move to the next waypoint * Attempts to update the waypoint index, making the entity move to the next waypoint
@ -158,13 +151,7 @@ public:
* Returns the waypoint this entity is supposed to move towards next * Returns the waypoint this entity is supposed to move towards next
* @return the waypoint this entity is supposed to move towards next * @return the waypoint this entity is supposed to move towards next
*/ */
NiPoint3 GetNextWaypoint() const; NiPoint3 GetNextWaypoint() const { return m_NextWaypoint; }
/**
* Returns the current position of this entity
* @return the current position of this entity
*/
NiPoint3 GetCurrentPosition() const;
/** /**
* Returns the approximate current location of the entity, including y coordinates * Returns the approximate current location of the entity, including y coordinates
@ -180,17 +167,11 @@ public:
*/ */
bool Warp(const NiPoint3& point); bool Warp(const NiPoint3& point);
/**
* Returns the time it will take to reach the final waypoint according to the current speed
* @return the time it will take to reach the final waypoint according to the current speed
*/
float GetTimer() const;
/** /**
* Returns if the entity is at its final waypoint * Returns if the entity is at its final waypoint
* @return if the entity is at its final waypoint * @return if the entity is at its final waypoint
*/ */
bool AtFinalWaypoint() const; bool AtFinalWaypoint() const { return m_AtFinalWaypoint; }
/** /**
* Renders the entity stationary * Renders the entity stationary
@ -250,17 +231,12 @@ private:
/** /**
* The max speed this entity may move at * The max speed this entity may move at
*/ */
float m_Speed; float m_MaxSpeed;
/** /**
* The time it will take to reach the next waypoint using the current speed * The time it will take to reach the next waypoint using the current speed
*/ */
float m_Timer; float m_TimeTravelled;
/**
* The total time it will take to reach the waypoint form its starting point
*/
float m_TotalTime;
/** /**
* The path this entity is currently traversing * The path this entity is currently traversing
@ -270,7 +246,7 @@ private:
/** /**
* If the entity has reached it last waypoint * If the entity has reached it last waypoint
*/ */
bool m_Done; bool m_AtFinalWaypoint;
/** /**
* The speed the entity is currently moving at * The speed the entity is currently moving at
@ -287,6 +263,11 @@ private:
*/ */
float m_HaltDistance; float m_HaltDistance;
/**
* The total time it will take to reach the waypoint form its starting point
*/
float m_TimeToTravel;
/** /**
* The base speed this entity has * The base speed this entity has
*/ */
@ -295,7 +276,7 @@ private:
/** /**
* If the AI is currently turned of (e.g. when teleporting to some location) * If the AI is currently turned of (e.g. when teleporting to some location)
*/ */
bool m_Interrupted; bool m_PullingToPoint;
/** /**
* A position that the entity is currently moving towards while being interrupted * A position that the entity is currently moving towards while being interrupted
@ -315,17 +296,12 @@ private:
/** /**
* The path the entity is currently following * The path the entity is currently following
*/ */
std::vector<NiPoint3> m_CurrentPath; std::vector<NiPoint3> m_InterpolatedWaypoints;
/** /**
* Queue of positions to traverse * The path from the current position to the destination.
*/ */
std::stack<NiPoint3> m_Queue; std::stack<NiPoint3> m_CurrentPath;
/**
* Cache of all lots and their respective speeds
*/
static std::map<LOT, float> m_PhysicsSpeedCache;
}; };
#endif // MOVEMENTAICOMPONENT_H #endif // MOVEMENTAICOMPONENT_H

View File

@ -395,7 +395,7 @@ void PetComponent::Update(float deltaTime) {
} }
auto destination = owner->GetPosition(); auto destination = owner->GetPosition();
NiPoint3 position = m_MovementAI->GetCurrentPosition(); NiPoint3 position = m_MovementAI->GetParent()->GetPosition();
float distanceToOwner = Vector3::DistanceSquared(position, destination); float distanceToOwner = Vector3::DistanceSquared(position, destination);
@ -466,7 +466,7 @@ skipTresure:
m_MovementAI->SetHaltDistance(haltDistance); m_MovementAI->SetHaltDistance(haltDistance);
m_MovementAI->SetSpeed(2.5f); m_MovementAI->SetMaxSpeed(2.5f);
m_MovementAI->SetDestination(destination); m_MovementAI->SetDestination(destination);
@ -822,17 +822,17 @@ void PetComponent::Wander() {
destination.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(destination); destination.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(destination);
} }
if (Vector3::DistanceSquared(destination, m_MovementAI->GetCurrentPosition()) < 2 * 2) { if (Vector3::DistanceSquared(destination, m_MovementAI->GetParent()->GetPosition()) < 2 * 2) {
m_MovementAI->Stop(); m_MovementAI->Stop();
return; return;
} }
m_MovementAI->SetSpeed(info.wanderSpeed); m_MovementAI->SetMaxSpeed(info.wanderSpeed);
m_MovementAI->SetDestination(destination); m_MovementAI->SetDestination(destination);
m_Timer += (m_MovementAI->GetCurrentPosition().x - destination.x) / info.wanderSpeed; m_Timer += (m_MovementAI->GetParent()->GetPosition().x - destination.x) / info.wanderSpeed;
} }
void PetComponent::Activate(Item* item, bool registerPet, bool fromTaming) { void PetComponent::Activate(Item* item, bool registerPet, bool fromTaming) {

View File

@ -179,7 +179,7 @@ void RebuildComponent::Update(float deltaTime) {
{ {
Entity* builder = GetBuilder(); Entity* builder = GetBuilder();
if (builder == nullptr) { if (!builder) {
ResetRebuild(false); ResetRebuild(false);
return; return;
@ -197,16 +197,16 @@ void RebuildComponent::Update(float deltaTime) {
if (!destComp) break; if (!destComp) break;
int newImagination = destComp->GetImagination(); int newImagination = destComp->GetImagination();
if (newImagination <= 0) {
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
break;
}
++m_DrainedImagination; ++m_DrainedImagination;
--newImagination; --newImagination;
destComp->SetImagination(newImagination); destComp->SetImagination(newImagination);
Game::entityManager->SerializeEntity(builder); Game::entityManager->SerializeEntity(builder);
if (newImagination <= 0) {
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
break;
}
} }
@ -481,7 +481,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId); if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
} }
} }
} else{ } else {
auto* missionComponent = builder->GetComponent<MissionComponent>(); auto* missionComponent = builder->GetComponent<MissionComponent>();
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId); if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
} }

View File

@ -48,10 +48,11 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
if (!entity) { if (!entity) {
Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID); Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID);
return; return;
} }
if (messageID != eGameMessageType::READY_FOR_UPDATES) Game::logger->LogDebug("GameMessageHandler", "received game message ID: %i", messageID);
switch (messageID) { switch (messageID) {
case eGameMessageType::UN_USE_BBB_MODEL: { case eGameMessageType::UN_USE_BBB_MODEL: {
@ -73,11 +74,11 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
break; break;
} }
case eGameMessageType::EQUIP_ITEM: case eGameMessageType::EQUIP_INVENTORY:
GameMessages::HandleEquipItem(inStream, entity); GameMessages::HandleEquipItem(inStream, entity);
break; break;
case eGameMessageType::UN_EQUIP_ITEM: case eGameMessageType::UN_EQUIP_INVENTORY:
GameMessages::HandleUnequipItem(inStream, entity); GameMessages::HandleUnequipItem(inStream, entity);
break; break;
@ -252,7 +253,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
}*/ }*/
break; break;
} }
case eGameMessageType::HANDLE_HOT_PROPERTY_DATA: { case eGameMessageType::GET_HOT_PROPERTY_DATA: {
GameMessages::HandleGetHotPropertyData(inStream, entity, sysAddr); GameMessages::HandleGetHotPropertyData(inStream, entity, sysAddr);
break; break;
} }
@ -547,7 +548,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
GameMessages::HandleBBBSaveRequest(inStream, entity, sysAddr); GameMessages::HandleBBBSaveRequest(inStream, entity, sysAddr);
break; break;
case eGameMessageType::CONTROL_BEHAVIOR: case eGameMessageType::CONTROL_BEHAVIORS:
GameMessages::HandleControlBehaviors(inStream, entity, sysAddr); GameMessages::HandleControlBehaviors(inStream, entity, sysAddr);
break; break;
@ -596,11 +597,11 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
GameMessages::HandleRequestDie(inStream, entity, sysAddr); GameMessages::HandleRequestDie(inStream, entity, sysAddr);
break; break;
case eGameMessageType::VEHICLE_NOTIFY_SERVER_ADD_PASSIVE_BOOST_ACTION: case eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION:
GameMessages::HandleVehicleNotifyServerAddPassiveBoostAction(inStream, entity, sysAddr); GameMessages::HandleVehicleNotifyServerAddPassiveBoostAction(inStream, entity, sysAddr);
break; break;
case eGameMessageType::VEHICLE_NOTIFY_SERVER_REMOVE_PASSIVE_BOOST_ACTION: case eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION:
GameMessages::HandleVehicleNotifyServerRemovePassiveBoostAction(inStream, entity, sysAddr); GameMessages::HandleVehicleNotifyServerRemovePassiveBoostAction(inStream, entity, sysAddr);
break; break;
@ -668,7 +669,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case eGameMessageType::DISMOUNT_COMPLETE: case eGameMessageType::DISMOUNT_COMPLETE:
GameMessages::HandleDismountComplete(inStream, entity, sysAddr); GameMessages::HandleDismountComplete(inStream, entity, sysAddr);
break; break;
case eGameMessageType::DEACTIVATE_BUBBLE_BUFF: case eGameMessageType::DECTIVATE_BUBBLE_BUFF:
GameMessages::HandleDeactivateBubbleBuff(inStream, entity); GameMessages::HandleDeactivateBubbleBuff(inStream, entity);
break; break;
case eGameMessageType::ACTIVATE_BUBBLE_BUFF: case eGameMessageType::ACTIVATE_BUBBLE_BUFF:
@ -680,8 +681,20 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case eGameMessageType::REQUEST_ACTIVITY_EXIT: case eGameMessageType::REQUEST_ACTIVITY_EXIT:
GameMessages::HandleRequestActivityExit(inStream, entity); GameMessages::HandleRequestActivityExit(inStream, entity);
break; break;
case eGameMessageType::ADD_DONATION_ITEM:
GameMessages::HandleAddDonationItem(inStream, entity, sysAddr);
break;
case eGameMessageType::REMOVE_DONATION_ITEM:
GameMessages::HandleRemoveDonationItem(inStream, entity, sysAddr);
break;
case eGameMessageType::CONFIRM_DONATION_ON_PLAYER:
GameMessages::HandleConfirmDonationOnPlayer(inStream, entity);
break;
case eGameMessageType::CANCEL_DONATION_ON_PLAYER:
GameMessages::HandleCancelDonationOnPlayer(inStream, entity);
break;
default: default:
// Game::logger->Log("GameMessageHandler", "Unknown game message ID: %i", messageID); Game::logger->LogDebug("GameMessageHandler", "Unknown game message ID: %i", messageID);
break; break;
} }
} }

View File

@ -77,6 +77,7 @@
#include "RacingControlComponent.h" #include "RacingControlComponent.h"
#include "RailActivatorComponent.h" #include "RailActivatorComponent.h"
#include "LevelProgressionComponent.h" #include "LevelProgressionComponent.h"
#include "DonationVendorComponent.h"
// Message includes: // Message includes:
#include "dZoneManager.h" #include "dZoneManager.h"
@ -975,7 +976,7 @@ void GameMessages::SendStop2DAmbientSound(Entity* entity, bool force, std::strin
CMSGHEADER; CMSGHEADER;
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());
bitStream.Write((uint16_t)eGameMessageType::PLAY2_DAMBIENT_SOUND); bitStream.Write((uint16_t)eGameMessageType::STOP2_D_AMBIENT_SOUND);
uint32_t audioGUIDSize = audioGUID.size(); uint32_t audioGUIDSize = audioGUID.size();
@ -998,7 +999,7 @@ void GameMessages::SendPlay2DAmbientSound(Entity* entity, std::string audioGUID,
CMSGHEADER; CMSGHEADER;
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());
bitStream.Write((uint16_t)eGameMessageType::PLAY2_DAMBIENT_SOUND); bitStream.Write((uint16_t)eGameMessageType::PLAY2_D_AMBIENT_SOUND);
uint32_t audioGUIDSize = audioGUID.size(); uint32_t audioGUIDSize = audioGUID.size();
@ -1017,7 +1018,7 @@ void GameMessages::SendSetNetworkScriptVar(Entity* entity, const SystemAddress&
CMSGHEADER; CMSGHEADER;
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());
bitStream.Write((uint16_t)eGameMessageType::SET_NETWORK_SCRIPT_VAR); bitStream.Write((uint16_t)eGameMessageType::SCRIPT_NETWORK_VAR_UPDATE);
// FIXME: this is a bad place to need to do a conversion because we have no clue whether data is utf8 or plain ascii // FIXME: this is a bad place to need to do a conversion because we have no clue whether data is utf8 or plain ascii
// an this has performance implications // an this has performance implications
@ -1295,6 +1296,7 @@ void GameMessages::SendVendorStatusUpdate(Entity* entity, const SystemAddress& s
bitStream.Write(bUpdateOnly); bitStream.Write(bUpdateOnly);
bitStream.Write<uint32_t>(vendorItems.size()); bitStream.Write<uint32_t>(vendorItems.size());
for (const auto& item : vendorItems) { for (const auto& item : vendorItems) {
bitStream.Write(item.lot); bitStream.Write(item.lot);
bitStream.Write(item.sortPriority); bitStream.Write(item.sortPriority);
@ -2116,7 +2118,7 @@ void GameMessages::SendUGCEquipPreCreateBasedOnEditMode(LWOOBJID objectId, const
CMSGHEADER; CMSGHEADER;
bitStream.Write(objectId); bitStream.Write(objectId);
bitStream.Write(eGameMessageType::HANDLE_UGC_EQUIP_PRE_CREATE_BASED_ON_EDIT_MODE); bitStream.Write(eGameMessageType::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE);
bitStream.Write(modelCount); bitStream.Write(modelCount);
bitStream.Write(model); bitStream.Write(model);
@ -2130,7 +2132,7 @@ void GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(LWOOBJID objectId, cons
CMSGHEADER; CMSGHEADER;
bitStream.Write(objectId); bitStream.Write(objectId);
bitStream.Write(eGameMessageType::HANDLE_UGC_EQUIP_POST_DELETE_BASED_ON_EDIT_MODE); bitStream.Write(eGameMessageType::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE);
bitStream.Write(inventoryItem); bitStream.Write(inventoryItem);
@ -2459,7 +2461,7 @@ void GameMessages::SendUnSmash(Entity* entity, LWOOBJID builderID, float duratio
CMSGHEADER; CMSGHEADER;
bitStream.Write(entity->GetObjectID()); bitStream.Write(entity->GetObjectID());
bitStream.Write(eGameMessageType::UNSMASH); bitStream.Write(eGameMessageType::UN_SMASH);
bitStream.Write(builderID != LWOOBJID_EMPTY); bitStream.Write(builderID != LWOOBJID_EMPTY);
if (builderID != LWOOBJID_EMPTY) bitStream.Write(builderID); if (builderID != LWOOBJID_EMPTY) bitStream.Write(builderID);
@ -3462,7 +3464,7 @@ void GameMessages::SendNotifyPetTamingPuzzleSelected(LWOOBJID objectId, const st
CMSGHEADER; CMSGHEADER;
bitStream.Write(objectId); bitStream.Write(objectId);
bitStream.Write(eGameMessageType::NOTIFY_PET_TAMING_PUZZLE_SELECTED); bitStream.Write(eGameMessageType::NOTIFY_TAMING_PUZZLE_SELECTED);
bitStream.Write(static_cast<uint32_t>(bricks.size())); bitStream.Write(static_cast<uint32_t>(bricks.size()));
for (const auto& brick : bricks) { for (const auto& brick : bricks) {
@ -6208,3 +6210,104 @@ void GameMessages::HandleRequestActivityExit(RakNet::BitStream* inStream, Entity
if (!entity || !player) return; if (!entity || !player) return;
entity->RequestActivityExit(entity, player_id, canceled); entity->RequestActivityExit(entity, player_id, canceled);
} }
void GameMessages::HandleAddDonationItem(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
uint32_t count = 1;
bool hasCount = false;
inStream->Read(hasCount);
if (hasCount) inStream->Read(count);
LWOOBJID itemId = LWOOBJID_EMPTY;
inStream->Read(itemId);
if (!itemId) return;
auto* donationVendorComponent = entity->GetComponent<DonationVendorComponent>();
if (!donationVendorComponent) return;
if (donationVendorComponent->GetActivityID() == 0) {
Game::logger->Log("GameMessages", "WARNING: Trying to dontate to a vendor with no activity");
return;
}
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) return;
Entity* player = Game::entityManager->GetEntity(user->GetLoggedInChar());
if (!player) return;
auto* characterComponent = player->GetComponent<CharacterComponent>();
if (!characterComponent) return;
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
if (!inventoryComponent) return;
Item* item = inventoryComponent->FindItemById(itemId);
if (!item) return;
if (item->GetCount() < count) return;
characterComponent->SetCurrentInteracting(entity->GetObjectID());
inventoryComponent->MoveItemToInventory(item, eInventoryType::DONATION, count, true, false, true);
}
void GameMessages::HandleRemoveDonationItem(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
bool confirmed = false;
inStream->Read(confirmed);
uint32_t count = 1;
bool hasCount = false;
inStream->Read(hasCount);
if (hasCount) inStream->Read(count);
LWOOBJID itemId = LWOOBJID_EMPTY;
inStream->Read(itemId);
if (!itemId) return;
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) return;
Entity* player = Game::entityManager->GetEntity(user->GetLoggedInChar());
if (!player) return;
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
if (!inventoryComponent) return;
Item* item = inventoryComponent->FindItemById(itemId);
if (!item) return;
if (item->GetCount() < count) return;
inventoryComponent->MoveItemToInventory(item, eInventoryType::BRICKS, count, true, false, true);
}
void GameMessages::HandleConfirmDonationOnPlayer(RakNet::BitStream* inStream, Entity* entity) {
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
if (!inventoryComponent) return;
auto* missionComponent = entity->GetComponent<MissionComponent>();
if (!missionComponent) return;
auto* characterComponent = entity->GetComponent<CharacterComponent>();
if (!characterComponent || !characterComponent->GetCurrentInteracting()) return;
auto* donationEntity = Game::entityManager->GetEntity(characterComponent->GetCurrentInteracting());
if (!donationEntity) return;
auto* donationVendorComponent = donationEntity->GetComponent<DonationVendorComponent>();
if(!donationVendorComponent) return;
if (donationVendorComponent->GetActivityID() == 0) {
Game::logger->Log("GameMessages", "WARNING: Trying to dontate to a vendor with no activity");
return;
}
auto* inventory = inventoryComponent->GetInventory(eInventoryType::DONATION);
if (!inventory) return;
auto items = inventory->GetItems();
if (!items.empty()) {
uint32_t count = 0;
for (auto& [itemID, item] : items){
count += item->GetCount();
item->RemoveFromInventory();
}
missionComponent->Progress(eMissionTaskType::DONATION, 0, LWOOBJID_EMPTY, "", count);
LeaderboardManager::SaveScore(entity->GetObjectID(), donationVendorComponent->GetActivityID(), count);
donationVendorComponent->SubmitDonation(count);
Game::entityManager->SerializeEntity(donationEntity);
}
characterComponent->SetCurrentInteracting(LWOOBJID_EMPTY);
}
void GameMessages::HandleCancelDonationOnPlayer(RakNet::BitStream* inStream, Entity* entity) {
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
if (!inventoryComponent) return;
auto* inventory = inventoryComponent->GetInventory(eInventoryType::DONATION);
if (!inventory) return;
auto items = inventory->GetItems();
for (auto& [itemID, item] : items){
inventoryComponent->MoveItemToInventory(item, eInventoryType::BRICKS, item->GetCount(), false, false, true);
}
auto* characterComponent = entity->GetComponent<CharacterComponent>();
if (!characterComponent) return;
characterComponent->SetCurrentInteracting(LWOOBJID_EMPTY);
}

View File

@ -649,6 +649,12 @@ namespace GameMessages {
void HandleZoneSummaryDismissed(RakNet::BitStream* inStream, Entity* entity); void HandleZoneSummaryDismissed(RakNet::BitStream* inStream, Entity* entity);
void HandleRequestActivityExit(RakNet::BitStream* inStream, Entity* entity); void HandleRequestActivityExit(RakNet::BitStream* inStream, Entity* entity);
// Donation vendor
void HandleAddDonationItem(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void HandleRemoveDonationItem(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void HandleConfirmDonationOnPlayer(RakNet::BitStream* inStream, Entity* entity);
void HandleCancelDonationOnPlayer(RakNet::BitStream* inStream, Entity* entity);
}; };
#endif // GAMEMESSAGES_H #endif // GAMEMESSAGES_H

View File

@ -449,6 +449,9 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
AddProgress(count); AddProgress(count);
break; break;
} }
case eMissionTaskType::DONATION:
AddProgress(count);
break;
default: default:
Game::logger->Log("MissionTask", "Invalid mission task type (%i)!", static_cast<int>(type)); Game::logger->Log("MissionTask", "Invalid mission task type (%i)!", static_cast<int>(type));
return; return;

View File

@ -80,10 +80,10 @@ void VanityUtilities::SpawnVanity() {
// Spawn the NPC // Spawn the NPC
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf); auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
if (!npc.m_Phrases.empty()) {
npcEntity->SetVar<std::vector<std::string>>(u"chats", m_PartyPhrases); npcEntity->SetVar<std::vector<std::string>>(u"chats", m_PartyPhrases);
SetupNPCTalk(npcEntity);
SetupNPCTalk(npcEntity); }
} }
return; return;
@ -114,21 +114,21 @@ void VanityUtilities::SpawnVanity() {
// Spawn the NPC // Spawn the NPC
auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf); auto* npcEntity = SpawnNPC(npc.m_LOT, npc.m_Name, location.m_Position, location.m_Rotation, npc.m_Equipment, npc.ldf);
if (!npc.m_Phrases.empty()){
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases);
npcEntity->SetVar<std::vector<std::string>>(u"chats", npc.m_Phrases); auto* scriptComponent = npcEntity->GetComponent<ScriptComponent>();
auto* scriptComponent = npcEntity->GetComponent<ScriptComponent>(); if (scriptComponent && !npc.m_Script.empty()) {
scriptComponent->SetScript(npc.m_Script);
scriptComponent->SetSerialized(false);
if (scriptComponent && !npc.m_Script.empty()) { for (const auto& npc : npc.m_Flags) {
scriptComponent->SetScript(npc.m_Script); npcEntity->SetVar<bool>(GeneralUtils::ASCIIToUTF16(npc.first), npc.second);
scriptComponent->SetSerialized(false); }
for (const auto& npc : npc.m_Flags) {
npcEntity->SetVar<bool>(GeneralUtils::ASCIIToUTF16(npc.first), npc.second);
} }
SetupNPCTalk(npcEntity);
} }
SetupNPCTalk(npcEntity);
} }
if (zoneID == 1200) { if (zoneID == 1200) {
@ -160,6 +160,7 @@ Entity* VanityUtilities::SpawnNPC(LOT lot, const std::string& name, const NiPoin
auto* entity = Game::entityManager->CreateEntity(info); auto* entity = Game::entityManager->CreateEntity(info);
entity->SetVar(u"npcName", name); entity->SetVar(u"npcName", name);
if (entity->GetVar<bool>(u"noGhosting")) entity->SetIsGhostingCandidate(false);
auto* inventoryComponent = entity->GetComponent<InventoryComponent>(); auto* inventoryComponent = entity->GetComponent<InventoryComponent>();

View File

@ -113,6 +113,17 @@ int main(int argc, char** argv) {
Game::logger->SetLogToConsole(Game::config->GetValue("log_to_console") != "0"); Game::logger->SetLogToConsole(Game::config->GetValue("log_to_console") != "0");
Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1"); Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1");
uint32_t clientNetVersion = 0;
if (!GeneralUtils::TryParse(Game::config->GetValue("client_net_version"), clientNetVersion)) {
Game::logger->Log("MasterServer", "Failed to parse (%s) as net version. Cannot start server as no clients could connect.",Game::config->GetValue("client_net_version").c_str());
Game::logger->Log("MasterServer", "As of version 1.1.1, client_net_version is required to be defined in sharedconfig.ini as opposed to in CMakeVariables.txt as NET_VERSION.");
Game::logger->Log("MasterServer", "Rerun cmake to ensure all config values exist. If client_net_version already exists in sharedconfig.ini, please ensure it is a valid number.");
Game::logger->Log("MasterServer", "like 171022");
return EXIT_FAILURE;
}
Game::logger->Log("MasterServer", "Using net version %s", Game::config->GetValue("client_net_version").c_str());
Game::logger->Log("MasterServer", "Starting Master server..."); Game::logger->Log("MasterServer", "Starting Master server...");
Game::logger->Log("MasterServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR); Game::logger->Log("MasterServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("MasterServer", "Compiled on: %s", __TIMESTAMP__); Game::logger->Log("MasterServer", "Compiled on: %s", __TIMESTAMP__);

View File

@ -85,9 +85,13 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) {
void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort, const ServerType serverType) { void AuthPackets::SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort, const ServerType serverType) {
RakNet::BitStream handshakeResponse; RakNet::BitStream handshakeResponse;
BitstreamUtils::WriteHeader(handshakeResponse, eConnectionType::SERVER, eServerMessageType::VERSION_CONFIRM); BitstreamUtils::WriteHeader(handshakeResponse, eConnectionType::SERVER, eServerMessageType::VERSION_CONFIRM);
handshakeResponse.Write<uint32_t>(NET_VERSION); uint32_t netVersion;
if (!GeneralUtils::TryParse(Game::config->GetValue("client_net_version"), netVersion)) {
Game::logger->Log("AuthPackets", "Failed to parse client_net_version. Cannot authenticate to %s:%i", nextServerIP.c_str(), nextServerPort);
return;
}
handshakeResponse.Write<uint32_t>(netVersion);
handshakeResponse.Write<uint32_t>(0); // Unused/Unknown/Padding handshakeResponse.Write<uint32_t>(0); // Unused/Unknown/Padding
if (serverType == ServerType::Auth) handshakeResponse.Write(ServiceId::Auth); if (serverType == ServerType::Auth) handshakeResponse.Write(ServiceId::Auth);
else if (serverType == ServerType::World) handshakeResponse.Write(ServiceId::World); else if (serverType == ServerType::World) handshakeResponse.Write(ServiceId::World);
else handshakeResponse.Write(ServiceId::General); else handshakeResponse.Write(ServiceId::General);

View File

@ -136,7 +136,7 @@ void AmShieldGenerator::EnemyEnteredShield(Entity* self, Entity* intruder) {
// TODO: Figure out how todo knockback, I'll stun them for now // TODO: Figure out how todo knockback, I'll stun them for now
if (NiPoint3::DistanceSquared(self->GetPosition(), movementAIComponent->GetCurrentPosition()) < 20 * 20) { if (NiPoint3::DistanceSquared(self->GetPosition(), intruder->GetPosition()) < 20 * 20) {
baseCombatAIComponent->Stun(2.0f); baseCombatAIComponent->Stun(2.0f);
movementAIComponent->SetDestination(baseCombatAIComponent->GetStartPosition()); movementAIComponent->SetDestination(baseCombatAIComponent->GetStartPosition());
} }

View File

@ -194,7 +194,7 @@ void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intru
// TODO: Figure out how todo knockback, I'll stun them for now // TODO: Figure out how todo knockback, I'll stun them for now
if (NiPoint3::DistanceSquared(self->GetPosition(), movementAIComponent->GetCurrentPosition()) < 20 * 20) { if (NiPoint3::DistanceSquared(self->GetPosition(), intruder->GetPosition()) < 20 * 20) {
baseCombatAIComponent->Stun(2.0f); baseCombatAIComponent->Stun(2.0f);
movementAIComponent->SetDestination(baseCombatAIComponent->GetStartPosition()); movementAIComponent->SetDestination(baseCombatAIComponent->GetStartPosition());
} }

View File

@ -52,12 +52,6 @@ void EnemySpiderSpawner::OnTimerDone(Entity* self, std::string timerName) {
if (newEntity) { if (newEntity) {
Game::entityManager->ConstructEntity(newEntity); Game::entityManager->ConstructEntity(newEntity);
newEntity->GetGroups().push_back("BabySpider"); newEntity->GetGroups().push_back("BabySpider");
/*
auto* movementAi = newEntity->GetComponent<MovementAIComponent>();
movementAi->SetDestination(newEntity->GetPosition());
*/
} }
self->ScheduleKillAfterUpdate(); self->ScheduleKillAfterUpdate();

View File

@ -472,7 +472,7 @@ std::vector<uint32_t> BaseSurvivalServer::GetRandomMobSet(SpawnerNetworkCollecti
if (mobSets.sets.find(spawnerNetworkCollection.mobSetName) != mobSets.sets.end()) { if (mobSets.sets.find(spawnerNetworkCollection.mobSetName) != mobSets.sets.end()) {
auto mobSet = mobSets.sets.at(spawnerNetworkCollection.mobSetName); auto mobSet = mobSets.sets.at(spawnerNetworkCollection.mobSetName);
if (setNumber < mobSet.size()) { if (setNumber < mobSet.size()) {
return mobSet.at(setNumber).at(rand() % mobSet.at(setNumber).size()); return mobSet.at(setNumber).at(GeneralUtils::GenerateRandomNumber<int32_t>(0, mobSet.at(setNumber).size() - 1));
} }
} }
@ -487,7 +487,7 @@ SpawnerNetwork BaseSurvivalServer::GetRandomSpawner(SpawnerNetworkCollection& sp
} }
if (!validSpawners.empty()) { if (!validSpawners.empty()) {
auto spawner = validSpawners.at(rand() % validSpawners.size()); auto spawner = validSpawners.at(GeneralUtils::GenerateRandomNumber<int32_t>(0, validSpawners.size() - 1));
spawner.isActive = true; spawner.isActive = true;
return spawner; return spawner;
} }

View File

@ -291,7 +291,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
enemy->AddComponent(eReplicaComponentType::MOVEMENT_AI, movementAI); enemy->AddComponent(eReplicaComponentType::MOVEMENT_AI, movementAI);
movementAI->SetSpeed(toSpawn.initialSpeed); movementAI->SetMaxSpeed(toSpawn.initialSpeed);
movementAI->SetCurrentSpeed(toSpawn.initialSpeed); movementAI->SetCurrentSpeed(toSpawn.initialSpeed);
movementAI->SetHaltDistance(0.0f); movementAI->SetHaltDistance(0.0f);

View File

@ -12,6 +12,7 @@ services:
- DATABASE_USER=${MARIADB_USER:-darkflame} - DATABASE_USER=${MARIADB_USER:-darkflame}
- DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame} - DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame}
- EXTERNAL_IP=${EXTERNAL_IP:-darkflame} - EXTERNAL_IP=${EXTERNAL_IP:-darkflame}
- BUILD_VERSION=${BUILD_VERSION:?171022}
volumes: volumes:
- ${CLIENT_PATH:?missing_client_path}:/client - ${CLIENT_PATH:?missing_client_path}:/client
- shared_configs:/docker/ - shared_configs:/docker/

View File

@ -32,13 +32,12 @@ COPY .clang-* CMake* LICENSE /build/
ARG BUILD_THREADS=1 ARG BUILD_THREADS=1
ARG BUILD_VERSION=171022 ARG BUILD_VERSION=171022
RUN echo "Build server" && \ RUN echo "Build server"
mkdir -p cmake_build && \ RUN sed -i -e "s/__maria_db_connector_compile_jobs__=.*/__maria_db_connector_compile_jobs__=${BUILD_THREADS}/g" CMakeVariables.txt
cd cmake_build && \ RUN mkdir -p cmake_build
sed -i -e "s/NET_VERSION=.*/NET_VERSION=${BUILD_VERSION}/g" ../CMakeVariables.txt && \ RUN cd cmake_build && \
sed -i -e "s/__maria_db_connector_compile_jobs__=.*/__maria_db_connector_compile_jobs__=${BUILD_THREADS}/g" ../CMakeVariables.txt && \ cmake .. -DCMAKE_BUILD_RPATH_USE_ORIGIN=TRUE && \
cmake .. -DCMAKE_BUILD_RPATH_USE_ORIGIN=TRUE && \ make -j$BUILD_THREADS
make -j $BUILD_THREADS
FROM gcc:12 as runtime FROM gcc:12 as runtime

View File

@ -17,9 +17,8 @@ function update_database_ini_values_for() {
update_ini $INI_FILE mysql_database $DATABASE update_ini $INI_FILE mysql_database $DATABASE
update_ini $INI_FILE mysql_username $DATABASE_USER update_ini $INI_FILE mysql_username $DATABASE_USER
update_ini $INI_FILE mysql_password $DATABASE_PASSWORD update_ini $INI_FILE mysql_password $DATABASE_PASSWORD
if [[ "$INI_FILE" != "worldconfig.ini" ]]; then update_ini $INI_FILE client_net_version $BUILD_VERSION
update_ini $INI_FILE external_ip $EXTERNAL_IP update_ini $INI_FILE external_ip $EXTERNAL_IP
fi
} }
function update_ini_values() { function update_ini_values() {

View File

@ -36,3 +36,10 @@ maximum_outgoing_bandwidth=80000
# from 512 <= maximum_mtu_size <= 1492 so make sure to keep this # from 512 <= maximum_mtu_size <= 1492 so make sure to keep this
# value within that range. # value within that range.
maximum_mtu_size=1228 maximum_mtu_size=1228
# The client network version to allow to connect to this server.
# Client's that do not match this value will be kicked from the server.
# If you are using a Darkflame Universe client, set this value to 171023.
# This cannot just be any arbitrary number. This has to match the same value that is in your client.
# If you do not know what this value is, default it to 171022.
client_net_version=171022

View File

@ -1,5 +1,6 @@
SET(DGAMEMESSAGES_TESTS SET(DGAMEMESSAGES_TESTS
"GameMessageTests.cpp") "GameMessageTests.cpp"
"LegacyGameMessageTests.cpp")
# Get the folder name and prepend it to the files above # Get the folder name and prepend it to the files above
get_filename_component(thisFolderName ${CMAKE_CURRENT_SOURCE_DIR} NAME) get_filename_component(thisFolderName ${CMAKE_CURRENT_SOURCE_DIR} NAME)

View File

@ -0,0 +1,298 @@
#include <gtest/gtest.h>
#include "eGameMessageType.h"
TEST(LegacyGameMessageTests, AssertLegacyGmValues) {
EXPECT_EQ(eGameMessageType::TELEPORT, (eGameMessageType)19);
EXPECT_EQ(eGameMessageType::SET_PLAYER_CONTROL_SCHEME, (eGameMessageType)26);
EXPECT_EQ(eGameMessageType::DROP_CLIENT_LOOT, (eGameMessageType)30);
EXPECT_EQ(eGameMessageType::DIE, (eGameMessageType)37);
EXPECT_EQ(eGameMessageType::REQUEST_DIE, (eGameMessageType)38);
EXPECT_EQ(eGameMessageType::PLAY_EMOTE, (eGameMessageType)41);
EXPECT_EQ(eGameMessageType::PLAY_ANIMATION, (eGameMessageType)43);
EXPECT_EQ(eGameMessageType::CONTROL_BEHAVIORS, (eGameMessageType)48);
EXPECT_EQ(eGameMessageType::SET_NAME, (eGameMessageType)72);
EXPECT_EQ(eGameMessageType::ECHO_START_SKILL, (eGameMessageType)118);
EXPECT_EQ(eGameMessageType::START_SKILL, (eGameMessageType)119);
EXPECT_EQ(eGameMessageType::VERIFY_ACK, (eGameMessageType)121);
EXPECT_EQ(eGameMessageType::ADD_SKILL, (eGameMessageType)127);
EXPECT_EQ(eGameMessageType::REMOVE_SKILL, (eGameMessageType)128);
EXPECT_EQ(eGameMessageType::SET_CURRENCY, (eGameMessageType)133);
EXPECT_EQ(eGameMessageType::PICKUP_CURRENCY, (eGameMessageType)137);
EXPECT_EQ(eGameMessageType::PICKUP_ITEM, (eGameMessageType)139);
EXPECT_EQ(eGameMessageType::TEAM_PICKUP_ITEM, (eGameMessageType)140);
EXPECT_EQ(eGameMessageType::PLAY_FX_EFFECT, (eGameMessageType)154);
EXPECT_EQ(eGameMessageType::STOP_FX_EFFECT, (eGameMessageType)155);
EXPECT_EQ(eGameMessageType::REQUEST_RESURRECT, (eGameMessageType)159);
EXPECT_EQ(eGameMessageType::RESURRECT, (eGameMessageType)160);
EXPECT_EQ(eGameMessageType::PUSH_EQUIPPED_ITEMS_STATE, (eGameMessageType)191);
EXPECT_EQ(eGameMessageType::POP_EQUIPPED_ITEMS_STATE, (eGameMessageType)192);
EXPECT_EQ(eGameMessageType::SET_GM_LEVEL, (eGameMessageType)193);
EXPECT_EQ(eGameMessageType::SET_STUNNED, (eGameMessageType)198);
EXPECT_EQ(eGameMessageType::SET_STUN_IMMUNITY, (eGameMessageType)200);
EXPECT_EQ(eGameMessageType::KNOCKBACK, (eGameMessageType)202);
EXPECT_EQ(eGameMessageType::REBUILD_CANCEL, (eGameMessageType)209);
EXPECT_EQ(eGameMessageType::ENABLE_REBUILD, (eGameMessageType)213);
EXPECT_EQ(eGameMessageType::MOVE_ITEM_IN_INVENTORY, (eGameMessageType)224);
EXPECT_EQ(eGameMessageType::ADD_ITEM_TO_INVENTORY_CLIENT_SYNC, (eGameMessageType)227);
EXPECT_EQ(eGameMessageType::REMOVE_ITEM_FROM_INVENTORY, (eGameMessageType)230);
EXPECT_EQ(eGameMessageType::EQUIP_INVENTORY, (eGameMessageType)231);
EXPECT_EQ(eGameMessageType::UN_EQUIP_INVENTORY, (eGameMessageType)233);
EXPECT_EQ(eGameMessageType::OFFER_MISSION, (eGameMessageType)248);
EXPECT_EQ(eGameMessageType::RESPOND_TO_MISSION, (eGameMessageType)249);
EXPECT_EQ(eGameMessageType::NOTIFY_MISSION, (eGameMessageType)254);
EXPECT_EQ(eGameMessageType::NOTIFY_MISSION_TASK, (eGameMessageType)255);
EXPECT_EQ(eGameMessageType::REBUILD_NOTIFY_STATE, (eGameMessageType)336);
EXPECT_EQ(eGameMessageType::TERMINATE_INTERACTION, (eGameMessageType)357);
EXPECT_EQ(eGameMessageType::SERVER_TERMINATE_INTERACTION, (eGameMessageType)358);
EXPECT_EQ(eGameMessageType::REQUEST_USE, (eGameMessageType)364);
EXPECT_EQ(eGameMessageType::VENDOR_OPEN_WINDOW, (eGameMessageType)369);
EXPECT_EQ(eGameMessageType::BUY_FROM_VENDOR, (eGameMessageType)373);
EXPECT_EQ(eGameMessageType::SELL_TO_VENDOR, (eGameMessageType)374);
EXPECT_EQ(eGameMessageType::TEAM_SET_OFF_WORLD_FLAG, (eGameMessageType)383);
EXPECT_EQ(eGameMessageType::SET_INVENTORY_SIZE, (eGameMessageType)389);
EXPECT_EQ(eGameMessageType::ACKNOWLEDGE_POSSESSION, (eGameMessageType)391);
EXPECT_EQ(eGameMessageType::SET_SHOOTING_GALLERY_PARAMS, (eGameMessageType)400);
EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_START_STOP, (eGameMessageType)402);
EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_ENTER, (eGameMessageType)403);
EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_EXIT, (eGameMessageType)404);
EXPECT_EQ(eGameMessageType::ACTIVITY_ENTER, (eGameMessageType)405);
EXPECT_EQ(eGameMessageType::ACTIVITY_EXIT, (eGameMessageType)406);
EXPECT_EQ(eGameMessageType::ACTIVITY_START, (eGameMessageType)407);
EXPECT_EQ(eGameMessageType::ACTIVITY_STOP, (eGameMessageType)408);
EXPECT_EQ(eGameMessageType::SHOOTING_GALLERY_CLIENT_AIM_UPDATE, (eGameMessageType)409);
EXPECT_EQ(eGameMessageType::SHOOTING_GALLERY_FIRE, (eGameMessageType)411);
EXPECT_EQ(eGameMessageType::REQUEST_VENDOR_STATUS_UPDATE, (eGameMessageType)416);
EXPECT_EQ(eGameMessageType::VENDOR_STATUS_UPDATE, (eGameMessageType)417);
EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_SHOOTING_GALLERY_SCORE, (eGameMessageType)425);
EXPECT_EQ(eGameMessageType::CONSUME_CLIENT_ITEM, (eGameMessageType)427);
EXPECT_EQ(eGameMessageType::CLIENT_ITEM_CONSUMED, (eGameMessageType)428);
EXPECT_EQ(eGameMessageType::UPDATE_SHOOTING_GALLERY_ROTATION, (eGameMessageType)448);
EXPECT_EQ(eGameMessageType::SET_FLAG, (eGameMessageType)471);
EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_FLAG_CHANGE, (eGameMessageType)472);
EXPECT_EQ(eGameMessageType::VENDOR_TRANSACTION_RESULT, (eGameMessageType)476);
EXPECT_EQ(eGameMessageType::HAS_BEEN_COLLECTED, (eGameMessageType)486);
EXPECT_EQ(eGameMessageType::DISPLAY_CHAT_BUBBLE, (eGameMessageType)495);
EXPECT_EQ(eGameMessageType::SPAWN_PET, (eGameMessageType)498);
EXPECT_EQ(eGameMessageType::DESPAWN_PET, (eGameMessageType)499);
EXPECT_EQ(eGameMessageType::PLAYER_LOADED, (eGameMessageType)505);
EXPECT_EQ(eGameMessageType::PLAYER_READY, (eGameMessageType)509);
EXPECT_EQ(eGameMessageType::REQUEST_LINKED_MISSION, (eGameMessageType)515);
EXPECT_EQ(eGameMessageType::INVALID_ZONE_TRANSFER_LIST, (eGameMessageType)519);
EXPECT_EQ(eGameMessageType::MISSION_DIALOGUE_OK, (eGameMessageType)520);
EXPECT_EQ(eGameMessageType::DISPLAY_MESSAGE_BOX, (eGameMessageType)529);
EXPECT_EQ(eGameMessageType::MESSAGE_BOX_RESPOND, (eGameMessageType)530);
EXPECT_EQ(eGameMessageType::CHOICE_BOX_RESPOND, (eGameMessageType)531);
EXPECT_EQ(eGameMessageType::SMASH, (eGameMessageType)537);
EXPECT_EQ(eGameMessageType::UN_SMASH, (eGameMessageType)538);
EXPECT_EQ(eGameMessageType::PLACE_MODEL_RESPONSE, (eGameMessageType)547);
EXPECT_EQ(eGameMessageType::SET_SHOOTING_GALLERY_RETICULE_EFFECT, (eGameMessageType)546);
EXPECT_EQ(eGameMessageType::SET_JET_PACK_MODE, (eGameMessageType)561);
EXPECT_EQ(eGameMessageType::REGISTER_PET_ID, (eGameMessageType)565);
EXPECT_EQ(eGameMessageType::REGISTER_PET_DBID, (eGameMessageType)566);
EXPECT_EQ(eGameMessageType::SHOW_ACTIVITY_COUNTDOWN, (eGameMessageType)568);
EXPECT_EQ(eGameMessageType::START_ACTIVITY_TIME, (eGameMessageType)576);
EXPECT_EQ(eGameMessageType::ACTIVITY_PAUSE, (eGameMessageType)602);
EXPECT_EQ(eGameMessageType::USE_NON_EQUIPMENT_ITEM, (eGameMessageType)603);
EXPECT_EQ(eGameMessageType::USE_ITEM_RESULT, (eGameMessageType)607);
EXPECT_EQ(eGameMessageType::COMMAND_PET, (eGameMessageType)640);
EXPECT_EQ(eGameMessageType::PET_RESPONSE, (eGameMessageType)641);
EXPECT_EQ(eGameMessageType::REQUEST_ACTIVITY_SUMMARY_LEADERBOARD_DATA, (eGameMessageType)648);
EXPECT_EQ(eGameMessageType::SEND_ACTIVITY_SUMMARY_LEADERBOARD_DATA, (eGameMessageType)649);
EXPECT_EQ(eGameMessageType::NOTIFY_OBJECT, (eGameMessageType)656);
EXPECT_EQ(eGameMessageType::CLIENT_NOTIFY_PET, (eGameMessageType)659);
EXPECT_EQ(eGameMessageType::NOTIFY_PET, (eGameMessageType)660);
EXPECT_EQ(eGameMessageType::NOTIFY_PET_TAMING_MINIGAME, (eGameMessageType)661);
EXPECT_EQ(eGameMessageType::START_SERVER_PET_MINIGAME_TIMER, (eGameMessageType)662);
EXPECT_EQ(eGameMessageType::CLIENT_EXIT_TAMING_MINIGAME, (eGameMessageType)663);
EXPECT_EQ(eGameMessageType::PET_NAME_CHANGED, (eGameMessageType)686);
EXPECT_EQ(eGameMessageType::PET_TAMING_MINIGAME_RESULT, (eGameMessageType)667);
EXPECT_EQ(eGameMessageType::PET_TAMING_TRY_BUILD_RESULT, (eGameMessageType)668);
EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_BUILD_SUCCESS, (eGameMessageType)673);
EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_MODEL_LOADED_ON_SERVER, (eGameMessageType)674);
EXPECT_EQ(eGameMessageType::ACTIVATE_BUBBLE_BUFF, (eGameMessageType)678);
EXPECT_EQ(eGameMessageType::DECTIVATE_BUBBLE_BUFF, (eGameMessageType)679);
EXPECT_EQ(eGameMessageType::ADD_PET_TO_PLAYER, (eGameMessageType)681);
EXPECT_EQ(eGameMessageType::REQUEST_SET_PET_NAME, (eGameMessageType)683);
EXPECT_EQ(eGameMessageType::SET_PET_NAME, (eGameMessageType)684);
EXPECT_EQ(eGameMessageType::NOTIFY_TAMING_PUZZLE_SELECTED, (eGameMessageType)675);
EXPECT_EQ(eGameMessageType::SHOW_PET_ACTION_BUTTON, (eGameMessageType)692);
EXPECT_EQ(eGameMessageType::SET_EMOTE_LOCK_STATE, (eGameMessageType)693);
EXPECT_EQ(eGameMessageType::USE_ITEM_REQUIREMENTS_RESPONSE, (eGameMessageType)703);
EXPECT_EQ(eGameMessageType::PLAY_EMBEDDED_EFFECT_ON_ALL_CLIENTS_NEAR_OBJECT, (eGameMessageType)713);
EXPECT_EQ(eGameMessageType::DOWNLOAD_PROPERTY_DATA, (eGameMessageType)716);
EXPECT_EQ(eGameMessageType::QUERY_PROPERTY_DATA, (eGameMessageType)717);
EXPECT_EQ(eGameMessageType::PROPERTY_EDITOR_BEGIN, (eGameMessageType)724);
EXPECT_EQ(eGameMessageType::PROPERTY_EDITOR_END, (eGameMessageType)725);
EXPECT_EQ(eGameMessageType::IS_MINIFIG_IN_A_BUBBLE, (eGameMessageType)729);
EXPECT_EQ(eGameMessageType::START_PATHING, (eGameMessageType)733);
EXPECT_EQ(eGameMessageType::ACTIVATE_BUBBLE_BUFF_FROM_SERVER, (eGameMessageType)734);
EXPECT_EQ(eGameMessageType::DEACTIVATE_BUBBLE_BUFF_FROM_SERVER, (eGameMessageType)735);
EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_ZONE_OBJECT, (eGameMessageType)737);
EXPECT_EQ(eGameMessageType::UPDATE_REPUTATION, (eGameMessageType)746);
EXPECT_EQ(eGameMessageType::PROPERTY_RENTAL_RESPONSE, (eGameMessageType)750);
EXPECT_EQ(eGameMessageType::REQUEST_PLATFORM_RESYNC, (eGameMessageType)760);
EXPECT_EQ(eGameMessageType::PLATFORM_RESYNC, (eGameMessageType)761);
EXPECT_EQ(eGameMessageType::PLAY_CINEMATIC, (eGameMessageType)762);
EXPECT_EQ(eGameMessageType::END_CINEMATIC, (eGameMessageType)763);
EXPECT_EQ(eGameMessageType::CINEMATIC_UPDATE, (eGameMessageType)764);
EXPECT_EQ(eGameMessageType::TOGGLE_GHOST_REFERENCE_OVERRIDE, (eGameMessageType)767);
EXPECT_EQ(eGameMessageType::SET_GHOST_REFERENCE_POSITION, (eGameMessageType)768);
EXPECT_EQ(eGameMessageType::FIRE_EVENT_SERVER_SIDE, (eGameMessageType)770);
EXPECT_EQ(eGameMessageType::SCRIPT_NETWORK_VAR_UPDATE, (eGameMessageType)781);
EXPECT_EQ(eGameMessageType::UPDATE_MODEL_FROM_CLIENT, (eGameMessageType)793);
EXPECT_EQ(eGameMessageType::DELETE_MODEL_FROM_CLIENT, (eGameMessageType)794);
EXPECT_EQ(eGameMessageType::PLAY_ND_AUDIO_EMITTER, (eGameMessageType)821);
EXPECT_EQ(eGameMessageType::PLAY2_D_AMBIENT_SOUND, (eGameMessageType)831);
EXPECT_EQ(eGameMessageType::ENTER_PROPERTY1, (eGameMessageType)840);
EXPECT_EQ(eGameMessageType::ENTER_PROPERTY2, (eGameMessageType)841);
EXPECT_EQ(eGameMessageType::PROPERTY_ENTRANCE_SYNC, (eGameMessageType)842);
EXPECT_EQ(eGameMessageType::PROPERTY_SELECT_QUERY, (eGameMessageType)845);
EXPECT_EQ(eGameMessageType::PARSE_CHAT_MESSAGE, (eGameMessageType)850);
EXPECT_EQ(eGameMessageType::BROADCAST_TEXT_TO_CHATBOX, (eGameMessageType)858);
EXPECT_EQ(eGameMessageType::OPEN_PROPERTY_MANAGEMENT, (eGameMessageType)860);
EXPECT_EQ(eGameMessageType::OPEN_PROPERTY_VENDOR, (eGameMessageType)861);
EXPECT_EQ(eGameMessageType::UPDATE_PROPERTY_OR_MODEL_FOR_FILTER_CHECK, (eGameMessageType)863);
EXPECT_EQ(eGameMessageType::CLIENT_TRADE_REQUEST, (eGameMessageType)868);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_REQUEST, (eGameMessageType)869);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_INVITE, (eGameMessageType)870);
EXPECT_EQ(eGameMessageType::CLIENT_TRADE_REPLY, (eGameMessageType)871);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_REPLY, (eGameMessageType)872);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_INITIAL_REPLY, (eGameMessageType)873);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_FINAL_REPLY, (eGameMessageType)874);
EXPECT_EQ(eGameMessageType::CLIENT_TRADE_UPDATE, (eGameMessageType)875);
EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_UPDATE, (eGameMessageType)876);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_UPDATE, (eGameMessageType)877);
EXPECT_EQ(eGameMessageType::CLIENT_TRADE_CANCEL, (eGameMessageType)878);
EXPECT_EQ(eGameMessageType::CLIENT_SIDE_TRADE_CANCEL, (eGameMessageType)879);
EXPECT_EQ(eGameMessageType::CLIENT_TRADE_ACCEPT, (eGameMessageType)880);
EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_ACCEPT, (eGameMessageType)881);
EXPECT_EQ(eGameMessageType::SERVER_SIDE_TRADE_CANCEL, (eGameMessageType)882);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_CANCEL, (eGameMessageType)883);
EXPECT_EQ(eGameMessageType::SERVER_TRADE_ACCEPT, (eGameMessageType)884);
EXPECT_EQ(eGameMessageType::READY_FOR_UPDATES, (eGameMessageType)888);
EXPECT_EQ(eGameMessageType::ORIENT_TO_OBJECT, (eGameMessageType)905);
EXPECT_EQ(eGameMessageType::ORIENT_TO_POSITION, (eGameMessageType)906);
EXPECT_EQ(eGameMessageType::ORIENT_TO_ANGLE, (eGameMessageType)907);
EXPECT_EQ(eGameMessageType::BOUNCER_ACTIVE_STATUS, (eGameMessageType)942);
EXPECT_EQ(eGameMessageType::UN_USE_BBB_MODEL, (eGameMessageType)999);
EXPECT_EQ(eGameMessageType::BBB_LOAD_ITEM_REQUEST, (eGameMessageType)1000);
EXPECT_EQ(eGameMessageType::BBB_SAVE_REQUEST, (eGameMessageType)1001);
EXPECT_EQ(eGameMessageType::BBB_SAVE_RESPONSE, (eGameMessageType)1005);
EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_OBJECT, (eGameMessageType)1042);
EXPECT_EQ(eGameMessageType::DISPLAY_ZONE_SUMMARY, (eGameMessageType)1043);
EXPECT_EQ(eGameMessageType::ZONE_SUMMARY_DISMISSED, (eGameMessageType)1044);
EXPECT_EQ(eGameMessageType::ACTIVITY_STATE_CHANGE_REQUEST, (eGameMessageType)1053);
EXPECT_EQ(eGameMessageType::MODIFY_PLAYER_ZONE_STATISTIC, (eGameMessageType)1046);
EXPECT_EQ(eGameMessageType::START_BUILDING_WITH_ITEM, (eGameMessageType)1057);
EXPECT_EQ(eGameMessageType::START_ARRANGING_WITH_ITEM, (eGameMessageType)1061);
EXPECT_EQ(eGameMessageType::FINISH_ARRANGING_WITH_ITEM, (eGameMessageType)1062);
EXPECT_EQ(eGameMessageType::DONE_ARRANGING_WITH_ITEM, (eGameMessageType)1063);
EXPECT_EQ(eGameMessageType::SET_BUILD_MODE, (eGameMessageType)1068);
EXPECT_EQ(eGameMessageType::BUILD_MODE_SET, (eGameMessageType)1069);
EXPECT_EQ(eGameMessageType::SET_BUILD_MODE_CONFIRMED, (eGameMessageType)1073);
EXPECT_EQ(eGameMessageType::NOTIFY_CLIENT_FAILED_PRECONDITION, (eGameMessageType)1081);
EXPECT_EQ(eGameMessageType::MOVE_ITEM_BETWEEN_INVENTORY_TYPES, (eGameMessageType)1093);
EXPECT_EQ(eGameMessageType::MODULAR_BUILD_BEGIN, (eGameMessageType)1094);
EXPECT_EQ(eGameMessageType::MODULAR_BUILD_END, (eGameMessageType)1095);
EXPECT_EQ(eGameMessageType::MODULAR_BUILD_MOVE_AND_EQUIP, (eGameMessageType)1096);
EXPECT_EQ(eGameMessageType::MODULAR_BUILD_FINISH, (eGameMessageType)1097);
EXPECT_EQ(eGameMessageType::REPORT_BUG, (eGameMessageType)1198);
EXPECT_EQ(eGameMessageType::MISSION_DIALOGUE_CANCELLED, (eGameMessageType)1129);
EXPECT_EQ(eGameMessageType::ECHO_SYNC_SKILL, (eGameMessageType)1144);
EXPECT_EQ(eGameMessageType::SYNC_SKILL, (eGameMessageType)1145);
EXPECT_EQ(eGameMessageType::REQUEST_SERVER_PROJECTILE_IMPACT, (eGameMessageType)1148);
EXPECT_EQ(eGameMessageType::DO_CLIENT_PROJECTILE_IMPACT, (eGameMessageType)1151);
EXPECT_EQ(eGameMessageType::MODULAR_BUILD_CONVERT_MODEL, (eGameMessageType)1155);
EXPECT_EQ(eGameMessageType::SET_PLAYER_ALLOWED_RESPAWN, (eGameMessageType)1165);
EXPECT_EQ(eGameMessageType::UI_MESSAGE_SERVER_TO_SINGLE_CLIENT, (eGameMessageType)1184);
EXPECT_EQ(eGameMessageType::UI_MESSAGE_SERVER_TO_ALL_CLIENTS, (eGameMessageType)1185);
EXPECT_EQ(eGameMessageType::PET_TAMING_TRY_BUILD, (eGameMessageType)1197);
EXPECT_EQ(eGameMessageType::REQUEST_SMASH_PLAYER, (eGameMessageType)1202);
EXPECT_EQ(eGameMessageType::FIRE_EVENT_CLIENT_SIDE, (eGameMessageType)1213);
EXPECT_EQ(eGameMessageType::TOGGLE_GM_INVIS, (eGameMessageType)1218);
EXPECT_EQ(eGameMessageType::CHANGE_OBJECT_WORLD_STATE, (eGameMessageType)1223);
EXPECT_EQ(eGameMessageType::VEHICLE_LOCK_INPUT, (eGameMessageType)1230);
EXPECT_EQ(eGameMessageType::VEHICLE_UNLOCK_INPUT, (eGameMessageType)1231);
EXPECT_EQ(eGameMessageType::RACING_RESET_PLAYER_TO_LAST_RESET, (eGameMessageType)1252);
EXPECT_EQ(eGameMessageType::RACING_SERVER_SET_PLAYER_LAP_AND_PLANE, (eGameMessageType)1253);
EXPECT_EQ(eGameMessageType::RACING_SET_PLAYER_RESET_INFO, (eGameMessageType)1254);
EXPECT_EQ(eGameMessageType::RACING_PLAYER_INFO_RESET_FINISHED, (eGameMessageType)1255);
EXPECT_EQ(eGameMessageType::LOCK_NODE_ROTATION, (eGameMessageType)1260);
EXPECT_EQ(eGameMessageType::VEHICLE_SET_WHEEL_LOCK_STATE, (eGameMessageType)1273);
EXPECT_EQ(eGameMessageType::NOTIFY_VEHICLE_OF_RACING_OBJECT, (eGameMessageType)1276);
EXPECT_EQ(eGameMessageType::SET_NAME_BILLBOARD_STATE, (eGameMessageType)1284);
EXPECT_EQ(eGameMessageType::PLAYER_REACHED_RESPAWN_CHECKPOINT, (eGameMessageType)1296);
EXPECT_EQ(eGameMessageType::HANDLE_UGC_POST_DELETE_BASED_ON_EDIT_MODE, (eGameMessageType)1300);
EXPECT_EQ(eGameMessageType::HANDLE_UGC_POST_CREATE_BASED_ON_EDIT_MODE, (eGameMessageType)1301);
EXPECT_EQ(eGameMessageType::PROPERTY_CONTENTS_FROM_CLIENT, (eGameMessageType)1305);
EXPECT_EQ(eGameMessageType::GET_MODELS_ON_PROPERTY, (eGameMessageType)1306);
EXPECT_EQ(eGameMessageType::MATCH_REQUEST, (eGameMessageType)1308);
EXPECT_EQ(eGameMessageType::MATCH_RESPONSE, (eGameMessageType)1309);
EXPECT_EQ(eGameMessageType::MATCH_UPDATE, (eGameMessageType)1310);
EXPECT_EQ(eGameMessageType::MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT, (eGameMessageType)1131);
EXPECT_EQ(eGameMessageType::MODULE_ASSEMBLY_QUERY_DATA, (eGameMessageType)1132);
EXPECT_EQ(eGameMessageType::SHOW_BILLBOARD_INTERACT_ICON, (eGameMessageType)1337);
EXPECT_EQ(eGameMessageType::CHANGE_IDLE_FLAGS, (eGameMessageType)1338);
EXPECT_EQ(eGameMessageType::VEHICLE_ADD_PASSIVE_BOOST_ACTION, (eGameMessageType)1340);
EXPECT_EQ(eGameMessageType::VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, (eGameMessageType)1341);
EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_PASSIVE_BOOST_ACTION, (eGameMessageType)1342);
EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION, (eGameMessageType)1343);
EXPECT_EQ(eGameMessageType::VEHICLE_ADD_SLOWDOWN_ACTION, (eGameMessageType)1344);
EXPECT_EQ(eGameMessageType::VEHICLE_REMOVE_SLOWDOWN_ACTION, (eGameMessageType)1345);
EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_ADD_SLOWDOWN_ACTION, (eGameMessageType)1346);
EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_VEHICLE_REMOVE_SLOWDOWN_ACTION, (eGameMessageType)1347);
EXPECT_EQ(eGameMessageType::BUYBACK_FROM_VENDOR, (eGameMessageType)1350);
EXPECT_EQ(eGameMessageType::SET_PROPERTY_ACCESS, (eGameMessageType)1366);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_PLACED, (eGameMessageType)1369);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_ROTATED, (eGameMessageType)1370);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_REMOVED_WHILE_EQUIPPED, (eGameMessageType)1371);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_EQUIPPED, (eGameMessageType)1372);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_PICKED_UP, (eGameMessageType)1373);
EXPECT_EQ(eGameMessageType::ZONE_PROPERTY_MODEL_REMOVED, (eGameMessageType)1374);
EXPECT_EQ(eGameMessageType::NOTIFY_RACING_CLIENT, (eGameMessageType)1390);
EXPECT_EQ(eGameMessageType::RACING_PLAYER_HACK_CAR, (eGameMessageType)1391);
EXPECT_EQ(eGameMessageType::RACING_PLAYER_LOADED, (eGameMessageType)1392);
EXPECT_EQ(eGameMessageType::RACING_CLIENT_READY, (eGameMessageType)1393);
EXPECT_EQ(eGameMessageType::UPDATE_CHAT_MODE, (eGameMessageType)1395);
EXPECT_EQ(eGameMessageType::VEHICLE_NOTIFY_FINISHED_RACE, (eGameMessageType)1396);
EXPECT_EQ(eGameMessageType::SET_CONSUMABLE_ITEM, (eGameMessageType)1409);
EXPECT_EQ(eGameMessageType::SET_STATUS_IMMUNITY, (eGameMessageType)1435);
EXPECT_EQ(eGameMessageType::SET_PET_NAME_MODERATED, (eGameMessageType)1448);
EXPECT_EQ(eGameMessageType::MODIFY_LEGO_SCORE, (eGameMessageType)1459);
EXPECT_EQ(eGameMessageType::RESTORE_TO_POST_LOAD_STATS, (eGameMessageType)1468);
EXPECT_EQ(eGameMessageType::SET_RAIL_MOVEMENT, (eGameMessageType)1471);
EXPECT_EQ(eGameMessageType::START_RAIL_MOVEMENT, (eGameMessageType)1472);
EXPECT_EQ(eGameMessageType::CANCEL_RAIL_MOVEMENT, (eGameMessageType)1474);
EXPECT_EQ(eGameMessageType::CLIENT_RAIL_MOVEMENT_READY, (eGameMessageType)1476);
EXPECT_EQ(eGameMessageType::PLAYER_RAIL_ARRIVED_NOTIFICATION, (eGameMessageType)1477);
EXPECT_EQ(eGameMessageType::UPDATE_PLAYER_STATISTIC, (eGameMessageType)1481);
EXPECT_EQ(eGameMessageType::MODULAR_ASSEMBLY_NIF_COMPLETED, (eGameMessageType)1498);
EXPECT_EQ(eGameMessageType::NOTIFY_NOT_ENOUGH_INV_SPACE, (eGameMessageType)1516);
EXPECT_EQ(eGameMessageType::TEAM_SET_LEADER, (eGameMessageType)1557);
EXPECT_EQ(eGameMessageType::TEAM_INVITE_CONFIRM, (eGameMessageType)1558);
EXPECT_EQ(eGameMessageType::TEAM_GET_STATUS_RESPONSE, (eGameMessageType)1559);
EXPECT_EQ(eGameMessageType::TEAM_ADD_PLAYER, (eGameMessageType)1562);
EXPECT_EQ(eGameMessageType::TEAM_REMOVE_PLAYER, (eGameMessageType)1563);
EXPECT_EQ(eGameMessageType::START_CELEBRATION_EFFECT, (eGameMessageType)1618);
EXPECT_EQ(eGameMessageType::ADD_BUFF, (eGameMessageType)1647);
EXPECT_EQ(eGameMessageType::SERVER_DONE_LOADING_ALL_OBJECTS, (eGameMessageType)1642);
EXPECT_EQ(eGameMessageType::PLACE_PROPERTY_MODEL, (eGameMessageType)1170);
EXPECT_EQ(eGameMessageType::VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER, (eGameMessageType)1606);
EXPECT_EQ(eGameMessageType::ADD_RUN_SPEED_MODIFIER, (eGameMessageType)1505);
EXPECT_EQ(eGameMessageType::GET_HOT_PROPERTY_DATA, (eGameMessageType)1511);
EXPECT_EQ(eGameMessageType::SEND_HOT_PROPERTY_DATA, (eGameMessageType)1510);
EXPECT_EQ(eGameMessageType::REMOVE_RUN_SPEED_MODIFIER, (eGameMessageType)1506);
EXPECT_EQ(eGameMessageType::UPDATE_PROPERTY_PERFORMANCE_COST, (eGameMessageType)1547);
EXPECT_EQ(eGameMessageType::PROPERTY_ENTRANCE_BEGIN, (eGameMessageType)1553);
EXPECT_EQ(eGameMessageType::SET_RESURRECT_RESTORE_VALUES, (eGameMessageType)1591);
EXPECT_EQ(eGameMessageType::VEHICLE_STOP_BOOST, (eGameMessageType)1617);
EXPECT_EQ(eGameMessageType::REMOVE_BUFF, (eGameMessageType)1648);
EXPECT_EQ(eGameMessageType::REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, (eGameMessageType)1666);
EXPECT_EQ(eGameMessageType::RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES, (eGameMessageType)1667);
EXPECT_EQ(eGameMessageType::PLAYER_SET_CAMERA_CYCLING_MODE, (eGameMessageType)1676);
EXPECT_EQ(eGameMessageType::SET_MOUNT_INVENTORY_ID, (eGameMessageType)1727);
EXPECT_EQ(eGameMessageType::NOTIFY_SERVER_LEVEL_PROCESSING_COMPLETE, (eGameMessageType)1734);
EXPECT_EQ(eGameMessageType::NOTIFY_LEVEL_REWARDS, (eGameMessageType)1735);
EXPECT_EQ(eGameMessageType::DISMOUNT_COMPLETE, (eGameMessageType)1756);
EXPECT_EQ(eGameMessageType::MARK_INVENTORY_ITEM_AS_ACTIVE, (eGameMessageType)1767);
}