]> git.localhorst.tv Git - blank.git/blob - src/net/Packet.hpp
special treatment for players
[blank.git] / src / net / Packet.hpp
1 #ifndef BLANK_NET_PACKET_HPP_
2 #define BLANK_NET_PACKET_HPP_
3
4 #include <cstdint>
5
6
7 namespace blank {
8
9 struct Packet {
10
11         static constexpr std::uint32_t TAG = 0xFB1AB1AF;
12
13         enum Type {
14                 PING,
15         };
16
17         struct Header {
18                 std::uint32_t tag;
19                 std::uint8_t type;
20         } header;
21
22         std::uint8_t payload[500 - sizeof(Header)];
23
24
25         void Tag() noexcept;
26
27         std::size_t Ping() noexcept;
28
29 };
30
31 }
32
33 #endif