Files
DarkflameServer/dGame/dGameMessages/GameMessageHandler.h
Aaron Kimbrell b6518caa9c 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>
2026-09-29 22:34:35 -05:00

33 lines
875 B
C++

/*
* Darkflame Universe
* Copyright 2018
*/
#ifndef GAMEMESSAGEHANDLER_H
#define GAMEMESSAGEHANDLER_H
#include "RakNetTypes.h"
#include "dCommonVars.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <unordered_map>
#include "BitStream.h"
#include "Entity.h"
#include "EntityManager.h"
#include "Game.h"
#include "Logger.h"
#include "GameMessages.h"
#include "CDClientDatabase.h"
#include "MessageType/Game.h"
namespace GameMessageHandler {
void HandleMessage(RakNet::BitStream& inStream, const SystemAddress& sysAddr, LWOOBJID objectID, MessageType::Game messageID);
// A new, empty typed struct for a message a client sends, or nullptr when the server reads it inline (capture
// fixtures read recorded messages with it)
std::unique_ptr<GameMessages::NetGameMsg> CreateReceived(MessageType::Game messageID);
};
#endif // GAMEMESSAGEHANDLER_H