Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 12:55:25 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 12:55:25 +1000
commit46edf8d0018e8bbbe62373c5c69c0ff9e8cea2b3 (patch)
tree999761448e0101efa4eae1dd00417726068e712d
parentd3d4345e057d95d784e34be9b23e7fe07fb9a7c1 (diff)
bump protocol version for applyDamage
-rw-r--r--source/core/StarDataStream.cpp2
-rw-r--r--source/core/StarNetCompatibility.cpp2
-rw-r--r--source/game/StarNetPackets.cpp8
3 files changed, 8 insertions, 4 deletions
diff --git a/source/core/StarDataStream.cpp b/source/core/StarDataStream.cpp
index 2688123..13bd2c0 100644
--- a/source/core/StarDataStream.cpp
+++ b/source/core/StarDataStream.cpp
@@ -6,7 +6,7 @@
namespace Star {
-unsigned const CurrentStreamVersion = 6; // update OpenProtocolVersion too!
+unsigned const CurrentStreamVersion = 7; // update OpenProtocolVersion too!
DataStream::DataStream()
: m_byteOrder(ByteOrder::BigEndian),
diff --git a/source/core/StarNetCompatibility.cpp b/source/core/StarNetCompatibility.cpp
index 220e31e..37eef95 100644
--- a/source/core/StarNetCompatibility.cpp
+++ b/source/core/StarNetCompatibility.cpp
@@ -2,6 +2,6 @@
namespace Star {
-VersionNumber const OpenProtocolVersion = 6; // update StreamCompatibilityVersion too!
+VersionNumber const OpenProtocolVersion = 7; // update StreamCompatibilityVersion too!
} \ No newline at end of file
diff --git a/source/game/StarNetPackets.cpp b/source/game/StarNetPackets.cpp
index a121beb..953743c 100644
--- a/source/game/StarNetPackets.cpp
+++ b/source/game/StarNetPackets.cpp
@@ -764,13 +764,17 @@ ReplaceTileListPacket::ReplaceTileListPacket(TileModificationList modifications,
void ReplaceTileListPacket::read(DataStream& ds) {
ds.readContainer(modifications);
ds.read(tileDamage);
- ds.read(applyDamage);
+ if (ds.streamCompatibilityVersion() >= 7)
+ ds.read(applyDamage);
+ else
+ applyDamage = false;
}
void ReplaceTileListPacket::write(DataStream& ds) const {
ds.writeContainer(modifications);
ds.write(tileDamage);
- ds.write(applyDamage);
+ if (ds.streamCompatibilityVersion() >= 7)
+ ds.write(applyDamage);
}
DamageTileGroupPacket::DamageTileGroupPacket() : layer(TileLayer::Foreground) {}