mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-16 01:24:08 +00:00
Merge exp/decoder-live-check: replica decoders checked on live captures, moving platform/pet/model wire fixes
This commit is contained in:
@@ -146,6 +146,11 @@ void ModelComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialU
|
||||
outBitStream.Write(m_OriginalPosition); // Original position
|
||||
outBitStream.Write(m_OriginalRotation); // Original rotation
|
||||
|
||||
// The client makes the mutable model component, which reads the behaviors and editing info, only for objects whose
|
||||
// config (the settings sent with a model) has propertyObjectID or inInventory; the plain one it makes for every
|
||||
// other model reads only the block above, as live wrote it
|
||||
if (!m_Parent->HasVar(u"propertyObjectID") && !m_Parent->GetVar<bool>(u"inInventory")) return;
|
||||
|
||||
outBitStream.Write1(); // We are writing behavior info
|
||||
outBitStream.Write<uint32_t>(m_Behaviors.size()); // Number of behaviors
|
||||
outBitStream.Write(m_IsPaused); // Is this model paused
|
||||
|
||||
@@ -118,6 +118,9 @@ void MovingPlatformComponent::Serialize(RakNet::BitStream& outBitStream, bool bI
|
||||
} else {
|
||||
mover->Serialize(outBitStream, bIsInitialUpdate);
|
||||
}
|
||||
|
||||
// The client reads subcomponents while a 1 bit comes before one: a 0 bit ends the list
|
||||
outBitStream.Write0();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,10 @@ void PetComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpd
|
||||
outBitStream.Write(m_Owner);
|
||||
}
|
||||
|
||||
if (bIsInitialUpdate) {
|
||||
// The client reads this bit on every update while dirty (as live wrote it): the names follow when it is set
|
||||
if (!bIsInitialUpdate) {
|
||||
outBitStream.Write0();
|
||||
} else {
|
||||
outBitStream.Write(tamed);
|
||||
if (tamed) {
|
||||
outBitStream.Write(m_ModerationStatus);
|
||||
|
||||
Reference in New Issue
Block a user