载入中...
搜索中...
未找到
PixelWorldArchive.cpp
浏览该文件的文档.
50 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "invalid or oversized hexadecimal payload",
107 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "archive object has unknown or missing fields",
112 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "archive object has unknown or missing fields",
121 eve::DiagnosticCode::ParseError, "expected decimal string", path, {}, "pixelworld.chunk-archive"));
125 return eve::Result<std::uint64_t>::failure(eve::Diagnostic::error(eve::DiagnosticCode::ParseError,
133 if (!number || *number < std::numeric_limits<int>::min() || *number > std::numeric_limits<int>::max())
144 eve::DiagnosticCode::Unsupported, "archive hash provider is required", {}, {}, "pixelworld.chunk-archive"));
155 eve::DiagnosticCode::Unsupported, "unknown Chunk archive codec", {}, {}, "pixelworld.chunk-archive"));
158 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "Chunk archive exceeds record budget",
166 eve::DiagnosticCode::InvalidArgument, "Chunks must be unique canonical y/x order", "chunks", {},
174 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "invalid Chunk revision or cell shape",
209 if (!verified) return eve::Result<eve::pixelworld::PixelChunkBatch>::failure(verified.status());
212 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "Chunk archive type or schema does not match",
216 eve::Diagnostic::error(eve::DiagnosticCode::UnknownVersion, "unsupported Chunk archive version",
238 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "invalid Chunk archive payload", "payload", {},
251 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "invalid fullResync flag", "payload.fullResync",
274 eve::DiagnosticCode::ParseError, "invalid Chunk archive record", path, {}, "pixelworld.chunk-archive"));
278 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "Chunk records are not canonical", path, {},
287 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "Chunk decoded size exceeds budget", path, {},
295 eve::DiagnosticCode::ParseError, "removed Chunk must have empty uncompressed payload", path, {},
304 eve::Diagnostic::error(eve::DiagnosticCode::HashMismatch, "decoded Chunk content hash does not match",
Bounded deterministic compression used by the .evpack wire format.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
static std::optional< LogicalId > parse(std::string_view text)
Parses a scoped logical name.
Definition Identity.cpp:36
const T & value() const &
Borrow the value from a const lvalue after checking success.
Definition Result.h:308
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static std::optional< Id128 > parse(std::string_view text) noexcept
Parses canonical UUID text.
Definition Identity.h:151
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
Result< std::vector< std::uint8_t > > compressEvpackChunk(EvpackCodec codec, std::span< const std::uint8_t > decoded)
Compress decoded chunk bytes using the selected stable wire codec.
Definition EvpackCompression.cpp:12
Result< std::vector< std::uint8_t > > decompressEvpackChunk(EvpackCodec codec, std::span< const std::uint8_t > stored, std::uint64_t decodedSize, std::uint64_t maximumDecodedBytes)
Decode one chunk into its authenticated canonical bytes.
Definition EvpackCompression.cpp:34
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.
Definition PixelWorldArchive.cpp:150
PixelChunkArchiveCodec
Stable physical codec for one independently stored PixelWorld Chunk.
Definition PixelWorldStreaming.h:16
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.
Definition PixelWorldArchive.cpp:206
MaterialId
Compact stable material identifier stored in each authoritative cell.
Definition PixelMaterial.h:16
@ HashMismatch
@ InvalidArgument
@ UnknownVersion
@ Unsupported
@ ParseError
Result< SnapshotEnvelope > makeSnapshotEnvelope(std::string type, LogicalId schema, SchemaVersion schemaVersion, PersistentId instanceId, Revision revision, SimulationTick tick, Value payload, const SnapshotHashProvider &hashProvider)
Construct and seal a snapshot envelope.
Definition Snapshot.cpp:103
Result< void > verifySnapshotEnvelope(const SnapshotEnvelope &snapshot, const SnapshotHashProvider &hashProvider)
Verify an envelope's content hash without modifying it.
Definition Snapshot.cpp:63
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
std::uint64_t sourceRevision
Definition PixelWorld.h:92
bool fullResync
Replace the replica projection instead of applying an incremental correction.
Definition PixelWorld.h:96
std::vector< PixelChunkSnapshot > chunks
Definition PixelWorld.h:97
std::uint64_t catalogFingerprint
Definition PixelWorld.h:90
eve::SimulationTick sourceTick
Definition PixelWorld.h:93
std::uint64_t sourceLastEditSequence
Definition PixelWorld.h:94
Owning, immutable projection of one authoritative simulation chunk.
Definition PixelWorld.h:77