manifold:world 0.2.0
Contract reference · Payloads · contract.json (crates/manifold-wasm-abi/wit/contract.json)
Contract 0.2.0, track 0.2: open, unreleased. Nothing on track 0.2 is released yet, so any item may still change in place (spec §7.2).
| Interface | Kind | Consent | Sides | Owner |
|---|---|---|---|---|
block-world | import | listed | server | enki |
Interface block-world
import · consent listed · sides server · owner enki · since 0.2.0
Server-side voxel-edit decision ABI of the player-edit handler (Enki B
§3.4). Moved from manifold:game@0.1.0 with its records taken from
core/types.
The engine net-inbound phase fills the pending edit-request queue; the
guest drains it and decides each edit. A decided edit is submitted during
the call as a one-cell transaction of the host’s native write path; it
validates first in this tick’s apply slot, commits the same tick and
replicates as a block update. Its outcome arrives through take-results.
get-block (voxel read) is intentionally deferred to its first consumer.
Functions
queue-edit
queue-edit: func(edit: decided-edit) -> result<batch-id, submit-error>
Queue a decided edit: a one-cell transaction, submitted now, that
validates first in this tick’s apply slot. Fails only with the shared
submit-error: malformed for a value wider than a block id,
actor-unknown when the peer is not a connected player (the client is
told of both), and other("not-handler") / other("outside-server-tick")
when the caller is not the handler or calls outside a server-tick
system.
- Reports
other("not-handler"): the caller is not the player-edit handler. - Reports
other("outside-server-tick"): called outside a server-tick system.
reject-edit
reject-edit: func(peer: u64, client-seq: u32, reason: localized-text)
Reject a request for a game reason, routed back to the peer. The reason is shown in the requesting player’s language.
take-edit-requests
take-edit-requests: func() -> list<edit-request>
Drain this tick’s pending inbound edit requests.
take-results
take-results: func() -> list<u8>
Schema payload: the TxnResult records queue-edit’s batch ids resolve
to, oldest first, with an Overflow record when some were dropped.
An edit that writes the value already there is Committed with
changed-cells 0; a refusal is Rejected.
result: schema payloadtxn-results.
Types
batch-id (alias)
= core/ops.batch-id
block-pos (alias)
= core/types.block-pos
decided-edit (record)
A decided edit. Carries the origin so an apply-failure rejection
routes back to the requesting client. new-block is AIR for a break.
| Field | Type | About |
|---|---|---|
peer | u64 | |
client-seq | u32 | |
pos | block-pos | |
world-space | world-space-id | |
new-block | u32 |
edit-action (variant)
Mirror of net-protocol’s EditAction. place carries the block id.
| Index | Case | Payload | About |
|---|---|---|---|
| 0 | break | none | |
| 1 | place | u32 |
edit-request (record)
An inbound client edit request, pre-staged by the host this tick.
| Field | Type | About |
|---|---|---|
peer | u64 | |
client-seq | u32 | |
pos | block-pos | |
world-space | world-space-id | |
action | edit-action |
localized-text (alias)
= core/text.localized-text
submit-error (alias)
= core/ops.submit-error
world-space-id (alias)
= core/types.world-space-id