mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-10 23:03:44 +00:00
test(capture): fixtures check client game messages, with a synthetic fixture
The fixture check now also reads every recorded client game message with the struct the server reads it with (GameMessageHandler::CreateReceived) and writes it again: it must read the whole message and give back the same bits. Game message fields are decoded with the server's structs in the fixture tests. A synthetic fixture, built in the test from the server's own structs (login, position update, a client game message), goes through the export steps (portable, anonymised, saved, read again) and passes the same checks; recorded fixtures stay in tests/fixtures-local and are never committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -269,3 +269,8 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
|
||||
LOG_DEBUG("Received Unknown GM with ID: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
}
|
||||
|
||||
std::unique_ptr<GameMessages::NetGameMsg> GameMessageHandler::CreateReceived(MessageType::Game messageID) {
|
||||
const auto handler = g_MessageHandlers.find(messageID);
|
||||
return handler == g_MessageHandlers.end() ? nullptr : handler->second();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user