mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
The three components were made from the registry and wrote nothing, so the client read the next component's bits as theirs. - LWOChestComponent::Deserialize (0x00c22010), construction only: the player (u64) and the loot offer count (u32). - LWOChoiceBuildComponent::Deserialize (0x00bf26d0): a flag, then the state (u32, 0 waiting, 1 building), the built object and the user (u64 each). Always in a construction. - LWORollerComponent::Deserialize (0x00c15920), construction: the level's activity_camera_pos and activity_camera_lookat_pos (3 floats each) and the projectile skill (u32, the client starts at 1348); then the flag of the block about its user, which is never set. LWOGameObject::Deserialize (0x00f99690) reads the components in the order of the object's component list, which ObjectLoader2::DoObjectComponentLoad (0x0105ebb0) fills in the order of FillComponentOrder (0x0101f8e0): the roller after the shooting gallery and before the moving platform, the choice build after the moving platform and before the LUP exhibit and the model, the chest after the zone control and before render. They are placed against the components their objects have. The gate rush control (103) is left out: its two registry entries have no object, and there is no component for it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
55 lines
2.2 KiB
C++
55 lines
2.2 KiB
C++
#ifndef ROLLERCOMPONENT_H
|
|
#define ROLLERCOMPONENT_H
|
|
|
|
#include "BitStream.h"
|
|
#include "Component.h"
|
|
#include "NiPoint3.h"
|
|
#include "dCommonVars.h"
|
|
#include "eReplicaComponentType.h"
|
|
|
|
/**
|
|
* Roller (a launcher a player fires from: LOTs 2714, 13951), as the client's LWORollerComponent makes it from the
|
|
* registry. Its construction carries the activity camera and the projectile skill; nobody uses one on the server
|
|
* yet, so the block about its user is never sent.
|
|
*/
|
|
class RollerComponent final : public Component {
|
|
public:
|
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::ROLLER;
|
|
|
|
// The projectile skill the client's constructor starts with (LWORollerComponent::Initialize 0x00cc7e30)
|
|
static constexpr uint32_t DEFAULT_PROJECTILE_SKILL = 1348;
|
|
|
|
RollerComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {}
|
|
|
|
// The level's activity_camera_pos and activity_camera_lookat_pos (LWORollerComponent::LoadConfigData 0x00c31820);
|
|
// both stay at the origin without the key, as in the client
|
|
void LoadConfigData() override;
|
|
|
|
// LWORollerComponent::Deserialize (0x00c15920) reads on construction: the camera position and what it looks at
|
|
// (3 floats each) and the projectile skill (u32). Then, in constructions and updates alike, a flag in front of the
|
|
// block about the player using it (3 x u64, 3 floats, a float, 3 floats, the player u64, a float): never set here.
|
|
void Serialize(RakNet::BitStream& outBitStream, const bool isConstruction) override {
|
|
if (isConstruction) {
|
|
outBitStream.Write(m_CameraPosition.x);
|
|
outBitStream.Write(m_CameraPosition.y);
|
|
outBitStream.Write(m_CameraPosition.z);
|
|
outBitStream.Write(m_CameraLookAt.x);
|
|
outBitStream.Write(m_CameraLookAt.y);
|
|
outBitStream.Write(m_CameraLookAt.z);
|
|
outBitStream.Write(m_ProjectileSkill);
|
|
}
|
|
outBitStream.Write0();
|
|
}
|
|
|
|
const NiPoint3& GetCameraPosition() const { return m_CameraPosition; }
|
|
const NiPoint3& GetCameraLookAt() const { return m_CameraLookAt; }
|
|
uint32_t GetProjectileSkill() const { return m_ProjectileSkill; }
|
|
|
|
private:
|
|
NiPoint3 m_CameraPosition = NiPoint3Constant::ZERO;
|
|
NiPoint3 m_CameraLookAt = NiPoint3Constant::ZERO;
|
|
uint32_t m_ProjectileSkill = DEFAULT_PROJECTILE_SKILL;
|
|
};
|
|
|
|
#endif // ROLLERCOMPONENT_H
|