fix(wire): PlaceModelResponse writes the model's rotation

The client's PlaceModelResponse::Deserialize (0x00dc0170) reads the rotation
as an optional w, x, y, z quaternion, but DLU wrote the 4-byte response
after the rotation flag. With any rotation other than identity the client
ran out of data. A live capture of a model turned 90 degrees shows the
server echoing the rotation the client placed it with. Bytes only change
when the rotation is not identity; a golden test pins the new layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 04:03:43 -05:00
parent 6d430881b9
commit dd16c67177
4 changed files with 24 additions and 15 deletions

View File

@@ -298,9 +298,7 @@ namespace GameMessages {
BitStreamUtils::WriteOptional(bitStream, position, NiPoint3Constant::ZERO);
BitStreamUtils::WriteOptional(bitStream, propertyPlaqueID, LWOOBJID_EMPTY);
BitStreamUtils::WriteOptional(bitStream, response, 0);
// WIRE BUG (kept, see the struct): the value written after rotation's flag is response, not rotation.
bitStream.Write(rotation != QuatUtils::IDENTITY);
if (rotation != QuatUtils::IDENTITY) bitStream.Write(response);
BitStreamUtils::WriteOptional(bitStream, rotation, QuatUtils::IDENTITY);
}
bool PlaceModelResponse::Deserialize(RakNet::BitStream& bitStream) {

View File

@@ -134,10 +134,9 @@ namespace GameMessages {
std::vector<std::pair<LWOOBJID, LWOOBJID>> models{}; // u32 count, then both IDs of each pair
};
// Server -> client.
// WIRE BUG (kept): DLU writes rotation's flag, but then writes response (4 bytes) instead of the quaternion
// (16 bytes) that the client's PlaceModelResponse::Deserialize (0x00dc0170) reads. Deserialize reads the
// client's layout, so a message with a non-identity rotation does not round trip.
// Server -> client. Laid out as the client's PlaceModelResponse::Deserialize (0x00dc0170) reads it: every field is
// optional and the rotation is a w, x, y, z quaternion. response is 14 when a model was placed and 16 when one was
// taken off the property (picked up or put away).
struct PlaceModelResponse : public NetGameMsg {
PlaceModelResponse() : NetGameMsg(MessageType::Game::PLACE_MODEL_RESPONSE) {}
void Serialize(RakNet::BitStream& bitStream) const override;