mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-19 02:05:28 +00:00
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>
This commit is contained in:
31
dGame/dComponents/BBBComponent.h
Normal file
31
dGame/dComponents/BBBComponent.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user