Files
DarkflameServer/dGame/dComponents/BBBComponent.h
Aaron Kimbrell 6627b022d4 feat(component): the BBB component only where the client has one
The client makes a BBB component (76) for a character (DoObjectPreLoad, LOT 1)
and for registry entries (none in the CDClient), and reads it last
(LWOBBBComponent::Deserialize: a metadata-source-item bit and the item).
DLU wrote a placeholder 0 bit at the end of every construction; now only a
character's BBBComponent writes it. Every other object sends one bit less,
which the client never read (live non-player constructions decode without
it; the zone control object stays byte for byte equal to live).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 17:18:52 -05:00

32 lines
1.0 KiB
C++

#ifndef BBBCOMPONENT_H
#define BBBCOMPONENT_H
#include "BitStream.h"
#include "Component.h"
#include "dCommonVars.h"
#include "eReplicaComponentType.h"
/**
* The BBB component (76), as the client's LWOBBBComponent: DoObjectPreLoad gives every character one (and the registry
* any object listing it). It sends whether there is a metadata source item, then the item's ID.
*/
class BBBComponent final : public Component {
public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::BBB;
BBBComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {}
// LWOBBBComponent::Deserialize 0x00bd6690
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override {
outBitStream.Write(m_MetadataSourceItem != LWOOBJID_EMPTY);
if (m_MetadataSourceItem != LWOOBJID_EMPTY) outBitStream.Write(m_MetadataSourceItem);
}
void SetMetadataSourceItem(const LWOOBJID item) { m_MetadataSourceItem = item; }
private:
LWOOBJID m_MetadataSourceItem = LWOOBJID_EMPTY;
};
#endif // BBBCOMPONENT_H