refactor: racing and vehicle game messages as structs

Converts the 12 racing / vehicle / modular assembly messages DLU sends
and the 8 it receives to NetGameMsgs in RacingMessages.{h,cpp}, adds
eRacingClientNotificationType for NotifyRacingClient's event type,
switches the callers (RacingControlComponent, CarBoostBehavior,
PossessorComponent, slash commands), registers the received messages
in GameMessageHandler's map and deletes the old functions. Handlers are
copied verbatim. Also moves the byte-equality test helpers into a
shared GameMessageTestUtils.h.

No wire change. Verified byte for byte against a frozen verbatim copy
of the old functions over an input grid, to one client and broadcast;
received messages compared with the old handlers' read sequences
(including all 16 optional-field combinations of
VehicleNotifyHitImaginationServer) and every truncated payload
rejected; hand computed golden bytes; round trips; a deliberate field
mutation made the tests fail. Layouts confirmed against the 1.10.64
client in Ghidra. Malformed received messages are
dropped (see the foundations commit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-26 10:34:31 -05:00
parent 7fb75f0484
commit 2681cc51ff
16 changed files with 1198 additions and 463 deletions

View File

@@ -0,0 +1,17 @@
#ifndef ERACINGCLIENTNOTIFICATIONTYPE_H
#define ERACINGCLIENTNOTIFICATIONTYPE_H
#include <cstdint>
// NotifyRacingClient event types, as in the client. Sent on the wire as an int32.
enum class eRacingClientNotificationType : int32_t {
INVALID = 0,
ACTIVITY_START,
REWARD_PLAYER,
EXIT,
REPLAY,
REMOVE_PLAYER,
LEADERBOARD_UPDATED,
};
#endif // ERACINGCLIENTNOTIFICATIONTYPE_H