GamesScriptCall games.script-call@1

Generated at from openvibe-contracts v0.143.0 and openvibe-sdk v0.44.0.

Version
1.0.0
Owner
games
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/games/script-call.v1.json

games.script-call@1: one hook call into a script mod's QuickJS sandbox (games.script.run): the hook the place fires and its JSON payload. The call runs under the mod's CPU budget; changes come back only as intents the server validates.

Fields

FieldTypeRequiredDescriptionConstraints
hookstringyes
  • pattern ^[a-z][a-zA-Z0-9]{0,39}$
payloadany

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: join
{
  "hook": "onPlayerJoin",
  "payload": {
    "playerId": "plr_1"
  }
}
Valid: tick
{
  "hook": "onTick",
  "payload": {
    "dt": 0.05
  }
}
Rejected: bad-hook
{
  "hook": "../x"
}
Rejected: no-hook
{
  "payload": {}
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('games.script-call@1', value);   // { valid, errors: [{ path, message }] }