]> git.localhorst.tv Git - blank.git/blob - src/net/ChunkTransmission.hpp
transmit chunks from server to client
[blank.git] / src / net / ChunkTransmission.hpp
1 #ifndef BLANK_NET_CHUNKTRANSMISSION_HPP_
2 #define BLANK_NET_CHUNKTRANSMISSION_HPP_
3
4 #include "../world/Chunk.hpp"
5
6 #include <cstdint>
7 #include <glm/glm.hpp>
8
9
10 namespace blank {
11
12 struct ChunkTransmission {
13
14         std::uint32_t id;
15         std::uint32_t flags;
16         glm::ivec3 coords;
17         std::uint32_t data_size;
18         std::uint32_t data_received;
19
20         int last_update;
21
22         bool header_received;
23         bool active;
24
25         std::uint8_t buffer[Chunk::BlockSize() + 10];
26
27
28         ChunkTransmission();
29
30         void Clear() noexcept;
31
32         bool Complete() const noexcept;
33
34         bool Compressed() const noexcept;
35
36 };
37
38 };
39
40 #endif