Skip to content

Commit

Permalink
Update required protocol version to 0.6.0 and handle new inputs in a …
Browse files Browse the repository at this point in the history
…non-breaking way
  • Loading branch information
SirLynix committed Oct 25, 2024
1 parent 27f507f commit 837bccf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/CommonLib/InternalConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace tsom::Constants
{
// Network constants
constexpr Nz::UInt32 NetworkChannelCount = 3;
constexpr Nz::UInt32 ProtocolRequiredClientVersion = BuildVersion(0, 5, 0);
constexpr Nz::UInt32 ProtocolRequiredClientVersion = BuildVersion(0, 6, 0);
constexpr Nz::Time TickDuration = Nz::Time::TickDuration(60);

// Serialization constants
Expand Down
10 changes: 7 additions & 3 deletions src/CommonLib/Protocol/Packets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ namespace tsom
serializer &= shipInputs.moveBackward;
serializer &= shipInputs.moveLeft;
serializer &= shipInputs.moveRight;
serializer &= shipInputs.moveUp;
serializer &= shipInputs.moveDown;
serializer &= shipInputs.rollLeft;
serializer &= shipInputs.rollRight;
serializer &= shipInputs.stabilize;

serializer &= shipInputs.pitch;
serializer &= shipInputs.yaw;

if (serializer.GetProtocolVersion() >= BuildVersion(0, 6, 1))
{
serializer &= shipInputs.moveUp;
serializer &= shipInputs.moveDown;
serializer &= shipInputs.stabilize;
}
}
});
}
Expand Down

0 comments on commit 837bccf

Please sign in to comment.