GamesScriptMessage games.script-message@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-message.v1.json
games.script-message@1: game.message(playerId, text), a private announcement to one player in the mod's place, prefixed with the mod's name (games.player.message).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
playerId | string | yes |
| |
text | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: hi
{
"playerId": "plr_1",
"text": "Welcome to the scrapyard."
}Rejected: empty
{
"playerId": "plr_1",
"text": ""
}Rejected: long
{
"playerId": "plr_1",
"text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('games.script-message@1', value); // { valid, errors: [{ path, message }] }