GamesWorldSavedPayload games.world.saved@1
Generated at from
openvibe-contracts v0.34.2 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- games
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/events/payloads/games.world.saved.v1.json
games.world.saved v1 (OpenVibe.Games apps/server/src/platform/gameEvents.ts worldSavedEvent, via GameEventRecorder.recordWorldSaved from game/gameServer.ts flush). The authoritative world was written: a checkpoint at most once per WORLD_SAVED_EVENT_MINUTES (default 15) and only when something was written, and always on shutdown, in the transaction of the flush that triggers it. The counts are totals of the flushes since `since` (the previous event, or process start); players_written counts dirty characters saved by flushes, not the single-character saves on disconnect. Envelope: subject { type: world, id: <world> }, visibility internal, priority low, actor service:games. No consumer yet.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
world | string | yes | World id (the loaded content world, e.g. openvibeville_v2). Also the envelope subject id of games.world.saved. | |
reason | enum | yes |
| |
entities_written | integer | yes | World entity rows written since `since`. |
|
players_written | integer | yes | Character rows written by flushes since `since`. |
|
since | string | yes | Start of the period these totals cover. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: checkpoint
{
"world": "openvibeville_v2",
"reason": "checkpoint",
"entities_written": 91,
"players_written": 0,
"since": "2026-09-24T01:15:34.078Z"
}Valid: shutdown
{
"world": "openvibeville_v2",
"reason": "shutdown",
"entities_written": 0,
"players_written": 3,
"since": "2026-09-23T22:40:02.511Z"
}Rejected: epoch-ms-since
{
"world": "openvibeville_v2",
"reason": "checkpoint",
"entities_written": 1,
"players_written": 0,
"since": 1790212534078
}Rejected: missing-world
{
"reason": "checkpoint",
"entities_written": 1,
"players_written": 0,
"since": "2026-09-24T01:15:34.078Z"
}Rejected: unknown-reason
{
"world": "openvibeville_v2",
"reason": "manual",
"entities_written": 1,
"players_written": 0,
"since": "2026-09-24T01:15:34.078Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('games.world.saved@1', value); // { valid, errors: [{ path, message }] }