dGame Precompiled header improvements (#876)

* moving branch

* Add deleteinven slash command

* Change name of BRICKS_IN_BBB

* Use string_view instead of strcmp

* Clean up include tree

* Remove unneeded headers from PCH files

Removes unneeded headers from pre-compiled headers.  This increases compile time, however reduces development time for most files.

* Update Entity.h

* Update EntityManager.h

* Update GameMessages.cpp

* There it compiles now

Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
This commit is contained in:
David Markowitz 2023-01-06 21:17:05 -08:00 committed by GitHub
parent 8bcb4bd36d
commit fc75d6048f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
99 changed files with 821 additions and 648 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,6 +28,10 @@
#include "GameConfig.h"
#include "RocketLaunchLupComponent.h"
#include "eUnequippableActiveType.h"
#include "eMovementPlatformState.h"
#include "LeaderboardManager.h"
#include "AMFFormat.h"
#include "Loot.h"
#include "RacingTaskParam.h"
#include <sstream>
@ -73,6 +77,7 @@
#include "ControlBehaviors.h"
#include "AMFDeserialize.h"
#include "eBlueprintSaveResponseType.h"
#include "eAninmationFlags.h"
void GameMessages::SendFireEventClientSide(const LWOOBJID& objectID, const SystemAddress& sysAddr, std::u16string args, const LWOOBJID& object, int64_t param1, int param2, const LWOOBJID& sender) {
CBITSTREAM;
@ -330,7 +335,7 @@ void GameMessages::SendStartPathing(Entity* entity) {
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
int iIndex, int iDesiredWaypointIndex, int nextIndex,
MovementPlatformState movementState) {
eMovementPlatformState movementState) {
CBITSTREAM;
CMSGHEADER;
@ -341,7 +346,7 @@ void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAd
iIndex = 0;
nextIndex = 0;
bStopAtDesiredWaypoint = true;
movementState = MovementPlatformState::Stationary;
movementState = eMovementPlatformState::Stationary;
}
bitStream.Write(entity->GetObjectID());
@ -575,7 +580,7 @@ void GameMessages::SendModifyLEGOScore(Entity* entity, const SystemAddress& sysA
SEND_PACKET;
}
void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, NDGFxValue args) {
void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, AMFValue* args) {
CBITSTREAM;
CMSGHEADER;
@ -593,7 +598,7 @@ void GameMessages::SendUIMessageServerToSingleClient(Entity* entity, const Syste
SEND_PACKET;
}
void GameMessages::SendUIMessageServerToAllClients(const std::string& message, NDGFxValue args) {
void GameMessages::SendUIMessageServerToAllClients(const std::string& message, AMFValue* args) {
CBITSTREAM;
CMSGHEADER;

View File

@ -1,27 +1,26 @@
#ifndef GAMEMESSAGES_H
#define GAMEMESSAGES_H
#include "dCommonVars.h"
#include "RakNetTypes.h"
#include <map>
#include <string>
#include "dMessageIdentifiers.h"
#include "AMFFormat.h"
#include "AMFFormat_BitStream.h"
#include "NiQuaternion.h"
#include "PropertySelectQueryProperty.h"
#include "TradingManager.h"
#include "LeaderboardManager.h"
#include "MovingPlatformComponent.h"
#include "eAninmationFlags.h"
#include <vector>
#include "eMovementPlatformState.h"
#include "NiPoint3.h"
class AMFValue;
class Entity;
class Item;
class NiQuaternion;
class User;
class Entity;
class NiPoint3;
class Leaderboard;
class PropertySelectQueryProperty;
class TradeItem;
enum class eAnimationFlags : uint32_t;
enum class eUnequippableActiveType;
enum eInventoryType : uint32_t;
class Item;
namespace GameMessages {
class PropertyDataMessage;
@ -57,7 +56,7 @@ namespace GameMessages {
void SendStartPathing(Entity* entity);
void SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint = false,
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
MovementPlatformState movementState = MovementPlatformState::Moving);
eMovementPlatformState movementState = eMovementPlatformState::Moving);
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
void SendServerDoneLoadingAllObjects(Entity* entity, const SystemAddress& sysAddr);
@ -74,8 +73,8 @@ namespace GameMessages {
void NotifyLevelRewards(LWOOBJID objectID, const SystemAddress& sysAddr, int level, bool sending_rewards);
void SendModifyLEGOScore(Entity* entity, const SystemAddress& sysAddr, int64_t score, eLootSourceType sourceType);
void SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, NDGFxValue args);
void SendUIMessageServerToAllClients(const std::string& message, NDGFxValue args);
void SendUIMessageServerToSingleClient(Entity* entity, const SystemAddress& sysAddr, const std::string& message, AMFValue* args);
void SendUIMessageServerToAllClients(const std::string& message, AMFValue* args);
void SendPlayEmbeddedEffectOnAllClientsNearObject(Entity* entity, std::u16string effectName, const LWOOBJID& fromObjectID, float radius);
void SendPlayFXEffect(Entity* entity, int32_t effectID, const std::u16string& effectType, const std::string& name, LWOOBJID secondary, float priority = 1, float scale = 1, bool serialize = true);
@ -589,550 +588,6 @@ namespace GameMessages {
void HandleReportBug(RakNet::BitStream* inStream, Entity* entity);
void SendRemoveBuff(Entity* entity, bool fromUnEquip, bool removeImmunity, uint32_t buffId);
/* Message to synchronize a skill cast */
class EchoSyncSkill {
static const GAME_MSG MsgID = GAME_MSG_ECHO_SYNC_SKILL;
public:
EchoSyncSkill() {
bDone = false;
}
EchoSyncSkill(std::string _sBitStream, unsigned int _uiBehaviorHandle, unsigned int _uiSkillHandle, bool _bDone = false) {
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
EchoSyncSkill(RakNet::BitStream* stream) {
bDone = false;
Deserialize(stream);
}
~EchoSyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
unsigned int uiBehaviorHandle{};
unsigned int uiSkillHandle{};
};
/* Message to synchronize a skill cast */
class SyncSkill {
static const GAME_MSG MsgID = GAME_MSG_SYNC_SKILL;
public:
SyncSkill() {
bDone = false;
}
SyncSkill(std::string _sBitStream, unsigned int _uiBehaviorHandle, unsigned int _uiSkillHandle, bool _bDone = false) {
bDone = _bDone;
sBitStream = _sBitStream;
uiBehaviorHandle = _uiBehaviorHandle;
uiSkillHandle = _uiSkillHandle;
}
SyncSkill(RakNet::BitStream* stream) {
bDone = false;
Deserialize(stream);
}
~SyncSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bDone);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(uiBehaviorHandle);
stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bDone);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(uiBehaviorHandle);
stream->Read(uiSkillHandle);
return true;
}
bool bDone{};
std::string sBitStream{};
unsigned int uiBehaviorHandle{};
unsigned int uiSkillHandle{};
};
/* Notifying the server that a locally owned projectil impacted. Sent to the caster of the projectile
should always be the local char. */
class RequestServerProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_REQUEST_SERVER_PROJECTILE_IMPACT;
public:
RequestServerProjectileImpact() {
i64LocalID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
RequestServerProjectileImpact(std::string _sBitStream, LWOOBJID _i64LocalID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64LocalID = _i64LocalID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
RequestServerProjectileImpact(RakNet::BitStream* stream) {
i64LocalID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
Deserialize(stream);
}
~RequestServerProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(i64LocalID != LWOOBJID_EMPTY);
if (i64LocalID != LWOOBJID_EMPTY) stream->Write(i64LocalID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64LocalIDIsDefault{};
stream->Read(i64LocalIDIsDefault);
if (i64LocalIDIsDefault != 0) stream->Read(i64LocalID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64LocalID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
/* Tell a client local projectile to impact */
class DoClientProjectileImpact {
static const GAME_MSG MsgID = GAME_MSG_DO_CLIENT_PROJECTILE_IMPACT;
public:
DoClientProjectileImpact() {
i64OrgID = LWOOBJID_EMPTY;
i64OwnerID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
}
DoClientProjectileImpact(std::string _sBitStream, LWOOBJID _i64OrgID = LWOOBJID_EMPTY, LWOOBJID _i64OwnerID = LWOOBJID_EMPTY, LWOOBJID _i64TargetID = LWOOBJID_EMPTY) {
i64OrgID = _i64OrgID;
i64OwnerID = _i64OwnerID;
i64TargetID = _i64TargetID;
sBitStream = _sBitStream;
}
DoClientProjectileImpact(RakNet::BitStream* stream) {
i64OrgID = LWOOBJID_EMPTY;
i64OwnerID = LWOOBJID_EMPTY;
i64TargetID = LWOOBJID_EMPTY;
Deserialize(stream);
}
~DoClientProjectileImpact() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(i64OrgID != LWOOBJID_EMPTY);
if (i64OrgID != LWOOBJID_EMPTY) stream->Write(i64OrgID);
stream->Write(i64OwnerID != LWOOBJID_EMPTY);
if (i64OwnerID != LWOOBJID_EMPTY) stream->Write(i64OwnerID);
stream->Write(i64TargetID != LWOOBJID_EMPTY);
if (i64TargetID != LWOOBJID_EMPTY) stream->Write(i64TargetID);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
}
bool Deserialize(RakNet::BitStream* stream) {
bool i64OrgIDIsDefault{};
stream->Read(i64OrgIDIsDefault);
if (i64OrgIDIsDefault != 0) stream->Read(i64OrgID);
bool i64OwnerIDIsDefault{};
stream->Read(i64OwnerIDIsDefault);
if (i64OwnerIDIsDefault != 0) stream->Read(i64OwnerID);
bool i64TargetIDIsDefault{};
stream->Read(i64TargetIDIsDefault);
if (i64TargetIDIsDefault != 0) stream->Read(i64TargetID);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
return true;
}
LWOOBJID i64OrgID;
LWOOBJID i64OwnerID;
LWOOBJID i64TargetID;
std::string sBitStream;
};
/* Same as start skill but with different network options. An echo down to other clients that need to play the skill. */
class EchoStartSkill {
static const GAME_MSG MsgID = GAME_MSG_ECHO_START_SKILL;
public:
EchoStartSkill() {
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
EchoStartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, float _fCasterLatency = 0.0f, int _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, unsigned int _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
EchoStartSkill(RakNet::BitStream* stream) {
bUsedMouse = false;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
Deserialize(stream);
}
~EchoStartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bUsedMouse);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse;
float fCasterLatency;
int iCastType;
NiPoint3 lastClickedPosit;
LWOOBJID optionalOriginatorID;
LWOOBJID optionalTargetID;
NiQuaternion originatorRot;
std::string sBitStream;
TSkillID skillID;
unsigned int uiSkillHandle;
};
/* Same as sync skill but with different network options. An echo down to other clients that need to play the skill. */
class StartSkill {
static const GAME_MSG MsgID = GAME_MSG_START_SKILL;
public:
StartSkill() {
bUsedMouse = false;
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
}
StartSkill(LWOOBJID _optionalOriginatorID, std::string _sBitStream, TSkillID _skillID, bool _bUsedMouse = false, LWOOBJID _consumableItemID = LWOOBJID_EMPTY, float _fCasterLatency = 0.0f, int _iCastType = 0, NiPoint3 _lastClickedPosit = NiPoint3::ZERO, LWOOBJID _optionalTargetID = LWOOBJID_EMPTY, NiQuaternion _originatorRot = NiQuaternion::IDENTITY, unsigned int _uiSkillHandle = 0) {
bUsedMouse = _bUsedMouse;
consumableItemID = _consumableItemID;
fCasterLatency = _fCasterLatency;
iCastType = _iCastType;
lastClickedPosit = _lastClickedPosit;
optionalOriginatorID = _optionalOriginatorID;
optionalTargetID = _optionalTargetID;
originatorRot = _originatorRot;
sBitStream = _sBitStream;
skillID = _skillID;
uiSkillHandle = _uiSkillHandle;
}
StartSkill(RakNet::BitStream* stream) {
bUsedMouse = false;
consumableItemID = LWOOBJID_EMPTY;
fCasterLatency = 0.0f;
iCastType = 0;
lastClickedPosit = NiPoint3::ZERO;
optionalTargetID = LWOOBJID_EMPTY;
originatorRot = NiQuaternion::IDENTITY;
uiSkillHandle = 0;
Deserialize(stream);
}
~StartSkill() {
}
void Serialize(RakNet::BitStream* stream) {
stream->Write((unsigned short)MsgID);
stream->Write(bUsedMouse);
stream->Write(consumableItemID != LWOOBJID_EMPTY);
if (consumableItemID != LWOOBJID_EMPTY) stream->Write(consumableItemID);
stream->Write(fCasterLatency != 0.0f);
if (fCasterLatency != 0.0f) stream->Write(fCasterLatency);
stream->Write(iCastType != 0);
if (iCastType != 0) stream->Write(iCastType);
stream->Write(lastClickedPosit != NiPoint3::ZERO);
if (lastClickedPosit != NiPoint3::ZERO) stream->Write(lastClickedPosit);
stream->Write(optionalOriginatorID);
stream->Write(optionalTargetID != LWOOBJID_EMPTY);
if (optionalTargetID != LWOOBJID_EMPTY) stream->Write(optionalTargetID);
stream->Write(originatorRot != NiQuaternion::IDENTITY);
if (originatorRot != NiQuaternion::IDENTITY) stream->Write(originatorRot);
uint32_t sBitStreamLength = sBitStream.length();
stream->Write(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
stream->Write(sBitStream[k]);
}
stream->Write(skillID);
stream->Write(uiSkillHandle != 0);
if (uiSkillHandle != 0) stream->Write(uiSkillHandle);
}
bool Deserialize(RakNet::BitStream* stream) {
stream->Read(bUsedMouse);
bool consumableItemIDIsDefault{};
stream->Read(consumableItemIDIsDefault);
if (consumableItemIDIsDefault != 0) stream->Read(consumableItemID);
bool fCasterLatencyIsDefault{};
stream->Read(fCasterLatencyIsDefault);
if (fCasterLatencyIsDefault != 0) stream->Read(fCasterLatency);
bool iCastTypeIsDefault{};
stream->Read(iCastTypeIsDefault);
if (iCastTypeIsDefault != 0) stream->Read(iCastType);
bool lastClickedPositIsDefault{};
stream->Read(lastClickedPositIsDefault);
if (lastClickedPositIsDefault != 0) stream->Read(lastClickedPosit);
stream->Read(optionalOriginatorID);
bool optionalTargetIDIsDefault{};
stream->Read(optionalTargetIDIsDefault);
if (optionalTargetIDIsDefault != 0) stream->Read(optionalTargetID);
bool originatorRotIsDefault{};
stream->Read(originatorRotIsDefault);
if (originatorRotIsDefault != 0) stream->Read(originatorRot);
uint32_t sBitStreamLength{};
stream->Read(sBitStreamLength);
for (unsigned int k = 0; k < sBitStreamLength; k++) {
unsigned char character;
stream->Read(character);
sBitStream.push_back(character);
}
stream->Read(skillID);
bool uiSkillHandleIsDefault{};
stream->Read(uiSkillHandleIsDefault);
if (uiSkillHandleIsDefault != 0) stream->Read(uiSkillHandle);
return true;
}
bool bUsedMouse = false;
LWOOBJID consumableItemID{};
float fCasterLatency{};
int iCastType{};
NiPoint3 lastClickedPosit{};
LWOOBJID optionalOriginatorID{};
LWOOBJID optionalTargetID{};
NiQuaternion originatorRot{};
std::string sBitStream = "";
TSkillID skillID = 0;
unsigned int uiSkillHandle = 0;
};
};
#endif // GAMEMESSAGES_H

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -50,6 +50,9 @@
#include "Item.h"
#include "PropertyManagementComponent.h"
#include "PacketUtils.h"
#include "Loot.h"
#include "EntityInfo.h"
#include "LUTriggers.h"
#include "Player.h"
#include "PhantomPhysicsComponent.h"
#include "ProximityMonitorComponent.h"
@ -66,6 +69,9 @@
#include "AssetManager.h"
#include "BinaryPathFinder.h"
#include "dConfig.h"
#include "AMFFormat.h"
#include "MovingPlatformComponent.h"
#include "dMessageIdentifiers.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
std::string chatCommand;

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,9 @@
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "SkillComponent.h"
#include "eAninmationFlags.h"
void BaseEnemyApe::OnStartup(Entity* self) {
self->SetVar<uint32_t>(u"timesStunned", 2);

View File

@ -3,6 +3,7 @@
#include "ControllablePhysicsComponent.h"
#include "EntityManager.h"
#include "dpWorld.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
#include "DestroyableComponent.h"

View File

@ -2,6 +2,7 @@
#include "ScriptedActivityComponent.h"
#include "TeamManager.h"
#include "EntityManager.h"
#include "Loot.h"
void TreasureChestDragonServer::OnStartup(Entity* self) {

View File

@ -3,6 +3,7 @@
#include "RenderComponent.h"
#include "MissionComponent.h"
#include "MissionTaskType.h"
#include "Loot.h"
void BootyDigServer::OnStartup(Entity* self) {
auto* zoneControlObject = EntityManager::Instance()->GetZoneControlEntity();

View File

@ -1,4 +1,5 @@
#include "NpcPirateServer.h"
#include "MissionState.h"
#include "InventoryComponent.h"
void NpcPirateServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {

View File

@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "Entity.h"
#include "GameMessages.h"
#include "MissionState.h"
void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
if (missionID != 1849 && missionID != 1883)

View File

@ -1,6 +1,7 @@
#include "RemoveRentalGear.h"
#include "InventoryComponent.h"
#include "Item.h"
#include "MissionState.h"
#include "Character.h"
/*

View File

@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "ZoneAgProperty.h"
#include "DestroyableComponent.h"
#include "EntityInfo.h"
void ZoneAgSpiderQueen::SetGameVariables(Entity* self) {
ZoneAgProperty::SetGameVariables(self);

View File

@ -1,6 +1,7 @@
#include "AmBlueX.h"
#include "SkillComponent.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "Character.h"
void AmBlueX::OnUse(Entity* self, Entity* user) {

View File

@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "MovementAIComponent.h"
#include "BaseCombatAIComponent.h"
#include "SkillComponent.h"

View File

@ -5,6 +5,7 @@
#include "MovementAIComponent.h"
#include "BaseCombatAIComponent.h"
#include "SkillComponent.h"
#include "EntityInfo.h"
#include "RebuildComponent.h"
#include "MissionComponent.h"

View File

@ -4,6 +4,7 @@
#include "DestroyableComponent.h"
#include "ProximityMonitorComponent.h"
#include "MissionComponent.h"
#include "EntityInfo.h"
void AmSkullkinDrill::OnStartup(Entity* self) {
self->SetNetworkVar(u"bIsInUse", false);

View File

@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "MovingPlatformComponent.h"
#include "EntityInfo.h"
#include "GameMessages.h"
#include "MissionComponent.h"

View File

@ -1,6 +1,7 @@
#include "EnemyRoninSpawner.h"
#include "SkillComponent.h"
#include "RenderComponent.h"
#include "EntityInfo.h"
#include "EntityManager.h"
void EnemyRoninSpawner::OnStartup(Entity* self) {

View File

@ -1,5 +1,7 @@
#include "BankInteractServer.h"
#include "GameMessages.h"
#include "Entity.h"
#include "AMFFormat.h"
void BankInteractServer::OnUse(Entity* self, Entity* user) {
AMFArrayValue args;

View File

@ -1,5 +1,6 @@
#include "GrowingFlower.h"
#include "MissionComponent.h"
#include "Loot.h"
void GrowingFlower::OnSkillEventFired(Entity* self, Entity* target, const std::string& message) {
if (!self->GetVar<bool>(u"blooming") && (message == "waterspray" || message == "shovelgrow")) {

View File

@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "Character.h"
#include "PetComponent.h"
#include "User.h"
std::vector<LWOOBJID> PetDigServer::treasures{};

View File

@ -1,6 +1,7 @@
#include "PropertyPlatform.h"
#include "RebuildComponent.h"
#include "GameMessages.h"
#include "MovingPlatformComponent.h"
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
@ -9,7 +10,7 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
// movingPlatform->SetNoAutoStart(true);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, MovementPlatformState::Stationary);
0, 0, eMovementPlatformState::Stationary);
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
@ -20,7 +21,7 @@ void PropertyPlatform::OnUse(Entity* self, Entity* user) {
// movingPlatform->GotoWaypoint(1);
// }
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
self->AddCallbackTimer(movementDelay + effectDelay, [self, this]() {
self->SetNetworkVar<float_t>(u"startEffect", dieDelay);

View File

@ -1,5 +1,6 @@
#include "QbSpawner.h"
#include "BaseCombatAIComponent.h"
#include "EntityInfo.h"
#include "MovementAIComponent.h"
void QbSpawner::OnStartup(Entity* self) {
@ -133,4 +134,3 @@ void QbSpawner::AggroTargetObject(Entity* self, Entity* enemy) {
}
}

View File

@ -1,6 +1,8 @@
#include "WishingWellServer.h"
#include "ScriptedActivityComponent.h"
#include "GameMessages.h"
#include "Loot.h"
#include "EntityManager.h"
void WishingWellServer::OnStartup(Entity* self) {
}

View File

@ -1,4 +1,5 @@
#include "NsConcertChoiceBuildManager.h"
#include "EntityInfo.h"
#include "EntityManager.h"
const std::vector<Crate> NsConcertChoiceBuildManager::crates{

View File

@ -2,6 +2,7 @@
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
class NsLegoClubDoor : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{

View File

@ -2,6 +2,7 @@
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
class NsLupTeleport : public CppScripts::Script, ChooseYourDestinationNsToNt, BaseConsoleTeleportServer
{

View File

@ -1,6 +1,7 @@
#include "NtCombatChallengeServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"

View File

@ -1,5 +1,6 @@
#include "NtVandaServer.h"
#include "InventoryComponent.h"
#include "MissionState.h"
void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {

View File

@ -1,6 +1,7 @@
#include "EnemySpiderSpawner.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
//----------------------------------------------

View File

@ -1,6 +1,7 @@
#include "PropertyBankInteract.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "AMFFormat.h"
void PropertyBankInteract::OnStartup(Entity* self) {
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();

View File

@ -2,6 +2,8 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "MissionState.h"
#include "Entity.h"
void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* character = target->GetCharacter();

View File

@ -2,6 +2,7 @@
#include "InventoryComponent.h"
#include "Character.h"
#include "GameMessages.h"
#include "Loot.h"
void VeMissionConsole::OnUse(Entity* self, Entity* user) {
LootGenerator::Instance().DropActivityLoot(user, self, 12551);

View File

@ -2,6 +2,7 @@
#include "SkillComponent.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "EntityInfo.h"
void EnemySkeletonSpawner::OnStartup(Entity* self) {
self->SetProximityRadius(15, "ronin");

View File

@ -1,5 +1,8 @@
#include "NjDragonEmblemChestServer.h"
#include "Character.h"
#include "EntityInfo.h"
#include "Loot.h"
#include "Entity.h"
#include "DestroyableComponent.h"
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {

View File

@ -1,6 +1,7 @@
#include "NjNPCMissionSpinjitzuServer.h"
#include "Character.h"
#include "EntityManager.h"
#include "MissionState.h"
void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
MissionState missionState) {

View File

@ -1,6 +1,7 @@
#include "RainOfArrows.h"
#include "EntityManager.h"
#include "SkillComponent.h"
#include "EntityInfo.h"
#include "GameMessages.h"
void RainOfArrows::OnStartup(Entity* self) {

View File

@ -3,6 +3,7 @@
#include "TeamManager.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Loot.h"
void MinigameTreasureChestServer::OnUse(Entity* self, Entity* user) {
auto* sac = self->GetComponent<ScriptedActivityComponent>();

View File

@ -1,5 +1,6 @@
#include "StinkyFishTarget.h"
#include "EntityManager.h"
#include "EntityInfo.h"
void StinkyFishTarget::OnStartup(Entity* self) {
auto position = self->GetPosition();

View File

@ -5,6 +5,7 @@
#include "GameMessages.h"
#include <algorithm>
#include "dLogger.h"
#include "Loot.h"
bool ActivityManager::IsPlayerInActivity(Entity* self, LWOOBJID playerID) {
const auto* sac = self->GetComponent<ScriptedActivityComponent>();

View File

@ -1,12 +1,13 @@
#pragma once
#include "dCommonVars.h"
#include "MissionState.h"
#include <cstdint>
#include <string>
#include <vector>
class User;
class Entity;
class NiPoint3;
enum class MissionState : int32_t;
namespace CppScripts {
/**

View File

@ -1,5 +1,6 @@
#include "NPCAddRemoveItem.h"
#include "InventoryComponent.h"
#include "MissionState.h"
void NPCAddRemoveItem::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* inventory = target->GetComponent<InventoryComponent>();

View File

@ -1,6 +1,7 @@
#include "ScriptedPowerupSpawner.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "Loot.h"
void ScriptedPowerupSpawner::OnTemplateStartup(Entity* self) {
self->SetVar<uint32_t>(u"currentCycle", 1);

View File

@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "PetComponent.h"
#include "EntityInfo.h"
void SpawnPetBaseServer::OnStartup(Entity* self) {
SetVariables(self);

View File

@ -2,6 +2,7 @@
#include "EntityManager.h"
#include "GeneralUtils.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
void AgImagSmashable::OnDie(Entity* self, Entity* killer) {

View File

@ -1,5 +1,7 @@
#include "AgPicnicBlanket.h"
#include "Loot.h"
#include "GameMessages.h"
#include "Entity.h"
void AgPicnicBlanket::OnUse(Entity* self, Entity* user) {
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());

View File

@ -15,7 +15,7 @@ void AgQbElevator::OnRebuildComplete(Entity* self, Entity* target) {
if (delayTime < 1) delayTime = 1;
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
0, 0, MovementPlatformState::Stationary);
0, 0, eMovementPlatformState::Stationary);
//add a timer that will kill the QB if no players get on in the killTime
self->AddTimer("startKillTimer", killTime);
@ -33,7 +33,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
self->CancelTimer("StartElevator");
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
} else if (!self->GetBoolean(u"StartTimer")) {
self->SetBoolean(u"StartTimer", true);
self->AddTimer("StartElevator", startTime);
@ -45,7 +45,7 @@ void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "StartElevator") {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, true, 0,
1, 1, MovementPlatformState::Moving);
1, 1, eMovementPlatformState::Moving);
} else if (timerName == "startKillTimer") {
killTimerStartup(self);
} else if (timerName == "KillTimer") {

View File

@ -1,4 +1,5 @@
#include "AgSpaceStuff.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
#include "GameMessages.h"
#include "EntityManager.h"

View File

@ -2,6 +2,7 @@
#include "Character.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "EntityInfo.h"
#include "ScriptedActivityComponent.h"
void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {

View File

@ -2,6 +2,7 @@
#include "Entity.h"
#include "DestroyableComponent.h"
#include "EntityInfo.h"
#include "EntityManager.h"
void GfBanana::SpawnBanana(Entity* self) {

View File

@ -1,5 +1,6 @@
#include "PetDigBuild.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "MissionComponent.h"
void PetDigBuild::OnRebuildComplete(Entity* self, Entity* target) {

View File

@ -1,5 +1,7 @@
#include "PirateRep.h"
#include "Character.h"
#include "MissionState.h"
#include "Entity.h"
void PirateRep::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
if (missionID == m_PirateRepMissionID && missionState >= MissionState::MISSION_STATE_READY_TO_COMPLETE) {

View File

@ -11,6 +11,7 @@
#include "MovementAIComponent.h"
#include "../dWorldServer/ObjectIDManager.h"
#include "MissionComponent.h"
#include "Loot.h"
#include "InventoryComponent.h"
void SGCannon::OnStartup(Entity* self) {

View File

@ -1,5 +1,6 @@
#include "RockHydrantSmashable.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
void RockHydrantSmashable::OnDie(Entity* self, Entity* killer) {

View File

@ -1,5 +1,6 @@
#include "HydrantSmashable.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "GeneralUtils.h"
void HydrantSmashable::OnDie(Entity* self, Entity* killer) {

View File

@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "MissionState.h"
void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
auto* character = target->GetCharacter();

View File

@ -42,6 +42,9 @@
#include "CharacterComponent.h"
#include "EntityManager.h"
#include "EntityInfo.h"
#include "User.h"
#include "Loot.h"
#include "Entity.h"
#include "Character.h"
#include "ChatPackets.h"
@ -58,6 +61,8 @@
#include "AssetManager.h"
#include "LevelProgressionComponent.h"
#include "eBlueprintSaveResponseType.h"
#include "AMFFormat.h"
#include "NiPoint3.h"
#include "ZCompression.h"

30
dZoneManager/LUTriggers.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef __LUTRIGGERS__H__
#define __LUTRIGGERS__H__
#include <string>
#include <vector>
class Command;
class Event;
namespace LUTriggers {
struct Command {
std::string id;
std::string target;
std::string targetName;
std::string args;
};
struct Event {
std::string eventID;
std::vector<Command*> commands;
};
struct Trigger {
uint32_t id;
bool enabled;
std::vector<Event*> events;
};
};
#endif //!__LUTRIGGERS__H__

View File

@ -9,6 +9,7 @@
#include <string>
#include <functional>
#include "LDFFormat.h"
#include "EntityInfo.h"
struct SpawnerNode {
NiPoint3 position = NiPoint3::ZERO;

View File

@ -6,6 +6,7 @@
#include "dLogger.h"
#include "GeneralUtils.h"
#include "BinaryIO.h"
#include "LUTriggers.h"
#include "AssetManager.h"
#include "CDClientManager.h"

View File

@ -1,35 +1,18 @@
#pragma once
#include "dZMCommon.h"
#include "LDFFormat.h"
#include "../thirdparty/tinyxml2/tinyxml2.h"
#include "tinyxml2.h"
#include <string>
#include <vector>
#include <map>
class Level;
class LUTriggers {
public:
struct Command {
std::string id;
std::string target;
std::string targetName;
std::string args;
};
struct Event {
std::string eventID;
std::vector<Command*> commands;
};
struct Trigger {
uint32_t id;
bool enabled;
std::vector<Event*> events;
};
namespace LUTriggers {
struct Trigger;
};
class Level;
struct SceneRef {
std::string filename;
uint32_t id;
@ -110,7 +93,7 @@ enum class PropertyPathType : int32_t {
GenetatedRectangle = 2
};
enum class PropertyType : int32_t{
enum class PropertyType : int32_t {
Premiere = 0,
Prize = 1,
LUP = 2,
@ -222,7 +205,7 @@ public:
uint32_t GetWorldID() const { return m_WorldID; }
[[nodiscard]] std::string GetZoneName() const { return m_ZoneName; }
std::string GetZoneRawPath() const { return m_ZoneRawPath;}
std::string GetZoneRawPath() const { return m_ZoneRawPath; }
std::string GetZonePath() const { return m_ZonePath; }
const NiPoint3& GetSpawnPos() const { return m_Spawnpoint; }

View File

@ -4,6 +4,7 @@
#include "Game.h"
#include "dLogger.h"
#include "dServer.h"
#include "EntityInfo.h"
#include "EntityManager.h"
#include <gtest/gtest.h>