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

FieldTypeRequiredDescriptionConstraints
worldstringyesWorld id (the loaded content world, e.g. openvibeville_v2). Also the envelope subject id of games.world.saved.
reasonenumyes
  • one of "checkpoint", "shutdown"
entities_writtenintegeryesWorld entity rows written since `since`.
  • minimum 0
players_writtenintegeryesCharacter rows written by flushes since `since`.
  • minimum 0
sincestringyesStart of the period these totals cover.
  • format date-time

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 }] }