载入中...
搜索中...
未找到
PixelWorldReplay.cpp
浏览该文件的文档.
30 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "replay object has unknown or missing fields",
35 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "replay object has unknown or missing fields",
55 if (!number || *number < std::numeric_limits<int>::min() || *number > std::numeric_limits<int>::max())
74eve::Result<eve::pixelworld::PixelEditCommand> parseCommand(const eve::Value& value, const std::string& path) {
75 auto record = object(value, path, {"centerX", "centerY", "kind", "material", "radius", "sequence",
87 if (!centerX || !centerY || !kind || !material || !radius || !sequence || !strength || !temperature)
90 if (kind.value() < 0 || kind.value() > static_cast<int>(eve::pixelworld::PixelEditKind::Explosion) ||
95 eve::Diagnostic::error(eve::DiagnosticCode::ParseError, "replay command enum or scalar is out of range",
200 if (expectedPresent && actualPresent && expected.chunks[index] == actual.chunks[index]) continue;
266 if (checkpointIndex < checkpoints_.size() && checkpoints_[checkpointIndex].tick.value() == tick) {
284 const std::uint64_t checkpointTick = checkpoints_.empty() ? 0 : checkpoints_.back().tick.value();
288 eve::SimulationTick(std::max(entryTick, checkpointTick)), replayPayload(entries_, checkpoints_),
300 if (snapshot.schemaVersion.value() < 1 || snapshot.schemaVersion.value() > kReplaySchemaVersion)
325 auto appended = candidate.append({eve::SimulationTick(tick.value()), std::move(command).value()});
342 if (!tick || !revision || !worldDigest || tick.value() == 0 || tick.value() <= previousCheckpointTick)
383 const std::uint64_t entryTick = candidate.entries_.empty() ? 0 : candidate.entries_.back().tick.value();
390 eve::DiagnosticCode::Conflict, "replay payload count or Tick disagrees with envelope metadata", "payload",
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
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
Sparse, chunked, deterministic 2D falling-material world.
Definition PixelWorld.h:224
Owning command log and periodic checkpoint projection for PixelWorld.
Definition PixelWorldReplay.h:67
eve::Result< void > append(PixelReplayEntry entry)
Append the next sequenced command; Tick order must be nondecreasing.
Definition PixelWorldReplay.cpp:210
MaterialId
Compact stable material identifier stored in each authoritative cell.
Definition PixelMaterial.h:16
PixelEditKind
Canonical deterministic edit operation admitted at a Tick boundary.
Definition PixelWorld.h:148
@ Explosion
@ InvalidArgument
@ UnknownVersion
@ PreconditionViolation
@ ParseError
@ Conflict
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31
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, immutable projection of one authoritative simulation chunk.
Definition PixelWorld.h:77
Owning replayable edit command. Sequence must be exactly previous + 1.
Definition PixelWorld.h:155
std::int16_t temperatureDelta
Definition PixelWorld.h:163
Canonical content digest for one authoritative PixelWorld Chunk.
Definition PixelWorldReplay.h:24
Periodic replay checkpoint containing world and per-Chunk diagnostics.
Definition PixelWorldReplay.h:33
std::uint64_t worldDigest
Definition PixelWorldReplay.h:36
eve::SimulationTick tick
Definition PixelWorldReplay.h:34
std::vector< PixelChunkDigest > chunks
Definition PixelWorldReplay.h:37
std::uint64_t revision
Definition PixelWorldReplay.h:35
One deterministic edit admitted immediately before its simulation Tick.
Definition PixelWorldReplay.h:18
eve::SimulationTick tick
Definition PixelWorldReplay.h:19
eve::pixelworld::PixelEditCommand command
Definition PixelWorldReplay.h:20
Receipt from deterministic replay through an exact target Tick.
Definition PixelWorldReplay.h:53
std::optional< PixelReplayDivergence > firstDivergence
Definition PixelWorldReplay.h:57
std::uint64_t commandsApplied
Definition PixelWorldReplay.h:56
eve::SimulationTick reachedTick
Definition PixelWorldReplay.h:55
PixelReplayMatch match
Definition PixelWorldReplay.h:54