R-Type  2
Doom but in better
Loading...
Searching...
No Matches
message.hpp
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
3#include <vector>
4
9struct Message {
10 uint8_t type;
11 std::vector<uint8_t> payload;
12};
13
14// In your case, 'type' might match the 'messageType' enum from GameMessage.hpp.
15// You can define: CONNECT=1, DISCONNECT=2, MOVE=3, etc. or directly use the enum's values.
Minimal network message with a 4-byte header (type + length) and a payload.
Definition message.hpp:9
uint8_t type
Could map to messageType in GameMessage.hpp (CONNECT, DISCONNECT, etc.)
Definition message.hpp:10
std::vector< uint8_t > payload
Arbitrary payload bytes.
Definition message.hpp:11