restore

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package restore drives the crash-restore check: snapshot a running world, rebuild it in a fresh one, and compare.

This is the path a shard takes after a crash, and it is not the same path as physics2d.ResetRuntime on a live world. A restore round-trips every component through MarshalWire and UnmarshalWire, which for PhysicsBody2D means going through its custom UnmarshalJSON — the code that decides whether an absent field means "false" or "Box2D's default of true". Only a real snapshot exercises that.

Cardinal's own ordering is reproduced exactly: World.run calls world.Init() first, so the game's Init systems spawn a whole scene and the physics plugin builds a Box2D world from it, and only *then* does restore() call FromProto and throw that ECS state away. The C-side world is left describing a scene that no longer exists, which is why the plugin documents calling ResetRuntime after FromProto. Both variants are available here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg harness.Config, callResetRuntime bool) int

Run performs the check and returns the process exit code.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL