From 3f16aaab61da47babca83c6b38921eb32d7bd834 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 27 Aug 2014 16:31:39 -0700 Subject: [PATCH] Fixed a few more Backbone Mediator event validation issues. --- app/lib/scripts/ScriptManager.coffee | 2 +- app/schemas/models/level.coffee | 4 ---- app/schemas/subscriptions/god.coffee | 2 +- app/schemas/subscriptions/play.coffee | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/lib/scripts/ScriptManager.coffee b/app/lib/scripts/ScriptManager.coffee index 9892e0201..796551f58 100644 --- a/app/lib/scripts/ScriptManager.coffee +++ b/app/lib/scripts/ScriptManager.coffee @@ -88,7 +88,7 @@ module.exports = ScriptManager = class ScriptManager extends CocoClass scriptStates: scriptStates timeSinceLastScriptEnded: (if @lastScriptEnded then now - @lastScriptEnded else 0) / 1000 - Backbone.Mediator.publish 'script:tick', stateEvent # Is this even needed? + Backbone.Mediator.publish 'script:tick', stateEvent # Used to trigger level scripts. loadFromSession: -> # load the queue with note groups to skip through diff --git a/app/schemas/models/level.coffee b/app/schemas/models/level.coffee index 7a8fd713c..90bcde6c0 100644 --- a/app/schemas/models/level.coffee +++ b/app/schemas/models/level.coffee @@ -109,10 +109,6 @@ NoteGroupSchema = c.object {title: 'Note Group', description: 'A group of notes lock: {title: 'Lock', description: 'Whether the interface should be locked so that the player\'s focus is on the script, or specific areas to lock.', type: ['boolean', 'array'], items: {type: 'string', enum: ['surface', 'editor', 'palette', 'hud', 'playback', 'playback-hover', 'level']}} letterbox: {type: 'boolean', title: 'Letterbox', description: 'Turn letterbox mode on or off. Disables surface and playback controls.'} - goals: c.object {title: 'Goals (Old)', description: 'Deprecated. Goals added here have no effect. Add goals in the level settings instead.'}, - add: c.array {title: 'Add', description: 'Deprecated. Goals added here have no effect. Add goals in the level settings instead.'}, {} - remove: c.array {title: 'Remove', description: 'Deprecated. Goals removed here have no effect. Adjust goals in the level settings instead.'}, {} - playback: c.object {title: 'Playback', description: 'Control the playback of the level.'}, playing: {type: 'boolean', title: 'Set Playing', description: 'Set whether playback is playing or paused.'} scrub: c.object {title: 'Scrub', description: 'Scrub the level playback time to a certain point.', default: {offset: 2, duration: 1000, toRatio: 0.5}}, diff --git a/app/schemas/subscriptions/god.coffee b/app/schemas/subscriptions/god.coffee index 5a8f0f09f..dfe382497 100644 --- a/app/schemas/subscriptions/god.coffee +++ b/app/schemas/subscriptions/god.coffee @@ -16,7 +16,7 @@ goalStatesSchema = {type: 'integer', minimum: 0} {type: 'string', enum: ['end']} ] - team: {type: ['null', 'string']} + team: {type: ['null', 'string', 'undefined']} worldUpdatedEventSchema = c.object {required: ['world', 'firstWorld', 'goalStates', 'team', 'firstChangedFrame']}, world: {type: 'object'} diff --git a/app/schemas/subscriptions/play.coffee b/app/schemas/subscriptions/play.coffee index 3575cc1fc..a19530bf3 100644 --- a/app/schemas/subscriptions/play.coffee +++ b/app/schemas/subscriptions/play.coffee @@ -140,7 +140,7 @@ module.exports = {type: 'integer', minimum: 0} {type: 'string', enum: ['end']} ] - team: {type: ['null', 'string']} + team: {type: ['null', 'string', 'undefined']} goals: c.array {}, {type: 'object'} overallStatus: