2014-08-27 15:24:03 -04:00
|
|
|
c = require 'schemas/schemas'
|
|
|
|
|
2014-04-11 08:22:49 -04:00
|
|
|
module.exports =
|
2014-04-11 14:09:50 -04:00
|
|
|
# TODO There should be a better way to divide these channels into smaller ones
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:session-will-save': c.object {required: ['session']},
|
|
|
|
session: {type: 'object'}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:shift-space-pressed': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:escape-pressed': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:enable-controls': c.object {},
|
|
|
|
controls: c.array {},
|
|
|
|
c.shortString()
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:disable-controls': c.object {},
|
|
|
|
controls: c.array {},
|
|
|
|
c.shortString()
|
2014-04-11 08:22:49 -04:00
|
|
|
|
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:set-letterbox': c.object {},
|
|
|
|
on: {type: 'boolean'}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:started': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:set-debug': c.object {required: ['debug']},
|
|
|
|
debug: {type: 'boolean'}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:restart': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:restarted': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:set-volume': c.object {required: ['volume']},
|
|
|
|
volume: {type: 'number', minimum: 0, maximum: 1}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:set-time': c.object {},
|
|
|
|
time: {type: 'number', minimum: 0}
|
|
|
|
ratio: {type: 'number', minimum: 0, maximum: 1}
|
2014-08-28 12:41:47 -04:00
|
|
|
ratioOffset: {type: 'number'}
|
2014-09-02 21:42:41 -04:00
|
|
|
frameOffset: {type: 'number'}
|
|
|
|
scrubDuration: {type: 'number', minimum: 0}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:select-sprite': c.object {},
|
|
|
|
thangID: {type: ['string', 'null', 'undefined']}
|
|
|
|
spellName: {type: ['string', 'null', 'undefined']}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:set-playing': c.object {required: ['playing']},
|
|
|
|
playing: {type: 'boolean'}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:team-set': c.object {required: ['team']},
|
|
|
|
team: c.shortString()
|
2014-05-21 17:50:27 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:docs-shown': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:docs-hidden': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:flag-color-selected': c.object {},
|
|
|
|
color:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'null'}
|
|
|
|
{type: 'string', enum: ['green', 'black', 'violet'], description: 'The flag color to place next, or omitted/null if deselected.'}
|
|
|
|
]
|
|
|
|
pos: c.object {required: ['x', 'y']},
|
|
|
|
x: {type: 'number'}
|
|
|
|
y: {type: 'number'}
|
|
|
|
|
|
|
|
'level:flag-updated': c.object {required: ['player', 'color', 'time', 'active']},
|
|
|
|
player: {type: 'string'}
|
|
|
|
team: {type: 'string'}
|
|
|
|
color: {type: 'string', enum: ['green', 'black', 'violet']}
|
|
|
|
time: {type: 'number', minimum: 0}
|
|
|
|
active: {type: 'boolean'}
|
|
|
|
pos: c.object {required: ['x', 'y']},
|
|
|
|
x: {type: 'number'}
|
|
|
|
y: {type: 'number'}
|
2014-11-15 19:56:18 -05:00
|
|
|
source: {type: 'string', enum: ['click', 'code']}
|
2014-08-27 15:24:03 -04:00
|
|
|
|
|
|
|
'level:next-game-pressed': c.object {}
|
|
|
|
|
2014-09-21 18:52:49 -04:00
|
|
|
'level:loaded': c.object {required: ['level']},
|
|
|
|
level: {type: 'object'}
|
|
|
|
team: {type: ['string', 'null', 'undefined']}
|
|
|
|
|
2014-09-21 23:19:27 -04:00
|
|
|
'level:session-loaded': c.object {required: ['level', 'session']},
|
|
|
|
level: {type: 'object'}
|
|
|
|
session: {type: 'object'}
|
|
|
|
|
2014-09-21 18:52:49 -04:00
|
|
|
'level:loading-view-unveiling': c.object {}
|
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:loading-view-unveiled': c.object {required: ['view']},
|
|
|
|
view: {type: 'object'}
|
|
|
|
|
|
|
|
'playback:manually-scrubbed': c.object {required: ['ratio']},
|
|
|
|
ratio: {type: 'number', minimum: 0, maximum: 1}
|
|
|
|
|
|
|
|
'playback:stop-real-time-playback': c.object {}
|
2014-08-23 20:26:56 -04:00
|
|
|
|
2014-08-30 00:46:26 -04:00
|
|
|
'playback:real-time-playback-waiting': c.object {}
|
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'playback:real-time-playback-started': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'playback:real-time-playback-ended': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-11-05 20:47:23 -05:00
|
|
|
'playback:ended-changed': c.object {required: ['ended']},
|
|
|
|
ended: {type: 'boolean'}
|
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:toggle-playing': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:toggle-grid': c.object {}
|
2014-05-20 18:31:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:toggle-debug': c.object {}
|
2014-04-11 08:22:49 -04:00
|
|
|
|
2014-08-27 15:24:03 -04:00
|
|
|
'level:toggle-pathfinding': c.object {}
|
|
|
|
|
|
|
|
'level:scrub-forward': c.object {}
|
|
|
|
|
|
|
|
'level:scrub-back': c.object {}
|
|
|
|
|
|
|
|
'level:show-victory': c.object {required: ['showModal']},
|
|
|
|
showModal: {type: 'boolean'}
|
|
|
|
|
|
|
|
'level:highlight-dom': c.object {required: ['selector']},
|
|
|
|
selector: {type: 'string'}
|
2014-08-28 12:27:42 -04:00
|
|
|
delay: {type: ['number', 'null', 'undefined']}
|
2014-08-27 15:24:03 -04:00
|
|
|
sides: {type: 'array', items: {'enum': ['left', 'right', 'top', 'bottom']}}
|
|
|
|
offset: {type: 'object'}
|
|
|
|
rotation: {type: 'number'}
|
|
|
|
|
|
|
|
'level:end-highlight-dom': c.object {}
|
|
|
|
|
|
|
|
'level:focus-dom': c.object {},
|
|
|
|
selector: {type: 'string'}
|
|
|
|
|
|
|
|
'level:lock-select': c.object {},
|
|
|
|
lock: {type: ['boolean', 'array']}
|
|
|
|
|
|
|
|
'level:suppress-selection-sounds': c.object {required: ['suppress']},
|
|
|
|
suppress: {type: 'boolean'}
|
|
|
|
|
|
|
|
'goal-manager:new-goal-states': c.object {required: ['goalStates', 'goals', 'overallStatus', 'timedOut']},
|
|
|
|
goalStates:
|
|
|
|
type: 'object'
|
|
|
|
additionalProperties:
|
2014-05-20 18:31:49 -04:00
|
|
|
type: 'object'
|
2014-08-27 15:24:03 -04:00
|
|
|
required: ['status']
|
|
|
|
properties:
|
|
|
|
status:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'null'}
|
|
|
|
{type: 'string', enum: ['success', 'failure', 'incomplete']}
|
|
|
|
]
|
|
|
|
keyFrame:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'integer', minimum: 0}
|
|
|
|
{type: 'string', enum: ['end']}
|
|
|
|
]
|
2014-08-27 19:31:39 -04:00
|
|
|
team: {type: ['null', 'string', 'undefined']}
|
2014-08-27 15:24:03 -04:00
|
|
|
goals: c.array {},
|
|
|
|
{type: 'object'}
|
|
|
|
overallStatus:
|
|
|
|
oneOf: [
|
|
|
|
{type: 'null'}
|
|
|
|
{type: 'string', enum: ['success', 'failure', 'incomplete']}
|
|
|
|
]
|
|
|
|
timedOut: {type: 'boolean'}
|
|
|
|
|
2014-09-20 18:18:21 -04:00
|
|
|
'level:hero-config-changed': c.object {}
|
2014-09-21 02:06:28 -04:00
|
|
|
|
|
|
|
'level:hero-selection-updated': c.object {required: ['hero']},
|
|
|
|
hero: {type: 'object'}
|
2014-12-04 16:18:00 -05:00
|
|
|
|
|
|
|
'level:subscription-required': c.object {}
|