diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-09-05 19:15:47 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-09-11 15:19:17 +1000 |
commit | 37f3178d33ab77de064bcbf10b4b03ddb47cc979 (patch) | |
tree | 76e3b3ce2d8716577af98e2bbbc4a41021db5107 /source/game/StarPlantDrop.cpp | |
parent | 90db1e0fbadaeb625691d3d0d13f5ae6ef057109 (diff) |
Network compatibility changes
Diffstat (limited to 'source/game/StarPlantDrop.cpp')
-rw-r--r-- | source/game/StarPlantDrop.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/game/StarPlantDrop.cpp b/source/game/StarPlantDrop.cpp index ccb57d8..b41705d 100644 --- a/source/game/StarPlantDrop.cpp +++ b/source/game/StarPlantDrop.cpp @@ -86,11 +86,12 @@ PlantDrop::PlantDrop(List<Plant::PlantPiece> pieces, Vec2F const& position, Vec2 m_collisionRect = fullBounds; } -PlantDrop::PlantDrop(ByteArray const& netStore) { +PlantDrop::PlantDrop(ByteArray const& netStore, NetCompatibilityRules rules) { m_netGroup.addNetElement(&m_movementController); m_netGroup.addNetElement(&m_spawnedDrops); DataStreamBuffer ds(netStore); + ds.setStreamCompatibilityVersion(rules); ds >> m_time; ds >> m_master; ds >> m_description; @@ -113,7 +114,7 @@ PlantDrop::PlantDrop(ByteArray const& netStore) { m_spawnedDropEffects = true; } -ByteArray PlantDrop::netStore() { +ByteArray PlantDrop::netStore(NetCompatibilityRules rules) { DataStreamBuffer ds; ds << m_time; ds << m_master; @@ -358,12 +359,12 @@ void PlantDrop::render(RenderCallback* renderCallback) { } } -pair<ByteArray, uint64_t> PlantDrop::writeNetState(uint64_t fromVersion) { - return m_netGroup.writeNetState(fromVersion); +pair<ByteArray, uint64_t> PlantDrop::writeNetState(uint64_t fromVersion, NetCompatibilityRules rules) { + return m_netGroup.writeNetState(fromVersion, rules); } -void PlantDrop::readNetState(ByteArray data, float interpolationTime) { - m_netGroup.readNetState(std::move(data), interpolationTime); +void PlantDrop::readNetState(ByteArray data, float interpolationTime, NetCompatibilityRules rules) { + m_netGroup.readNetState(data, interpolationTime, rules); } void PlantDrop::enableInterpolation(float extrapolationHint) { |