diff options
| author | sfan5 <sfan5@live.de> | 2019-08-15 20:14:44 +0200 |
|---|---|---|
| committer | sfan5 <sfan5@live.de> | 2019-08-16 20:03:53 +0200 |
| commit | 428a4c86e3c5bdb93bc8ba152e90c759b4f6d504 (patch) | |
| tree | 19f15e1014917d55693336dacc91c6e858d8d02b /src/network/connection.h | |
| parent | fc2f55d931d4f67f75c78625464600ecf69ee049 (diff) | |
| download | minetest-428a4c86e3c5bdb93bc8ba152e90c759b4f6d504.tar.xz | |
Minor refactor of IncomingSplitBuffer
Diffstat (limited to 'src/network/connection.h')
| -rw-r--r-- | src/network/connection.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/connection.h b/src/network/connection.h index 9141bb1e8..5b1902deb 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -121,16 +121,20 @@ struct IncomingSplitPacket IncomingSplitPacket() = delete; - // Key is chunk number, value is data without headers - std::map<u16, SharedBuffer<u8>> chunks; - u32 chunk_count; float time = 0.0f; // Seconds from adding - bool reliable = false; // If true, isn't deleted on timeout + u32 chunk_count; + bool reliable; // If true, isn't deleted on timeout bool allReceived() const { return (chunks.size() == chunk_count); } + bool insert(u32 chunk_num, SharedBuffer<u8> &chunkdata); + SharedBuffer<u8> reassemble(); + +private: + // Key is chunk number, value is data without headers + std::map<u16, SharedBuffer<u8>> chunks; }; /* |
