载入中...
搜索中...
未找到
PixelWorldStreaming.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Result.h"
6#include "common/Snapshot.h"
8
9#include <cstdint>
10#include <set>
11#include <utility>
12
14
16enum class PixelChunkArchiveCodec : std::uint8_t { None = 0, Zstd = 1 };
17
28 const eve::SnapshotHashProvider& hashProvider);
29
37 const eve::SnapshotEnvelope& snapshot, const eve::SnapshotHashProvider& hashProvider);
38
47
56public:
64 [[nodiscard]] eve::Result<PixelChunkStreamUpdate> capture(
66
68 void reset() noexcept;
69
71 [[nodiscard]] std::uint64_t revision() const noexcept { return revision_; }
73 [[nodiscard]] std::size_t knownChunkCount() const noexcept { return known_.size(); }
74
75private:
77 std::uint64_t revision_ = 0;
78 std::set<std::pair<int, int>> known_;
79};
80
81} // namespace eve::pixelworld_streaming
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Move-only, checked operation results for the common layer.
Versioned, integrity-checked persistence envelopes.
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Id128 public API.
Definition Identity.h:112
Sparse, chunked, deterministic 2D falling-material world.
Definition PixelWorld.h:224
Stateful revision cursor that projects one PixelWorld interest region.
std::uint64_t revision() const noexcept
Last successfully captured source revision, or zero before first capture.
std::size_t knownChunkCount() const noexcept
Number of present Chunk coordinates believed to be held by the consumer.
eve::Result< eve::SnapshotEnvelope > archiveChunkBatch(const eve::pixelworld::PixelChunkBatch &batch, eve::PersistentId instanceId, PixelChunkArchiveCodec codec, const eve::SnapshotHashProvider &hashProvider)
Encode one authoritative batch as pixelworld:chunk-batch SnapshotEnvelope version 3.
PixelChunkArchiveCodec
Stable physical codec for one independently stored PixelWorld Chunk.
eve::Result< eve::pixelworld::PixelChunkBatch > decodeChunkBatchArchive(const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider)
Verify and decode a version 1, 2 or 3 Chunk-batch archive into an owning candidate.
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36
Stable outer format shared by persistence and cross-process snapshots.
Definition Snapshot.h:46
Owning authoritative Chunk correction with source world metadata.
Definition PixelWorld.h:89
Inclusive finite rectangle expressed in Chunk coordinates.
Definition PixelWorld.h:104
One interest-stream update suitable for persistence or network transport.
bool fullResync
Mirrors batch.fullResync for capture diagnostics.