Protection and logging for . Fixed an issue with spectate camera script bounds.

This commit is contained in:
Nick Winter 2014-09-04 11:04:16 -07:00
parent bfae70ef13
commit 8c45e22741
2 changed files with 12 additions and 1 deletions

View file

@ -42,3 +42,14 @@ module.exports = class LevelSession extends CocoModel
completed: ->
@get('state')?.complete || false
shouldAvoidCorruptData: (attrs) ->
return false unless me.team is 'humans'
if _.string.startsWith (attrs?.code ? @get('code'))?.anya?.makeBid ? '', 'var __interceptThis'
noty text: "Not saving session--it's trying to overwrite Anya's code with transpiled output. Please let us know and help us reproduce this bug!", layout: 'topCenter', type: 'error', killer: false, timeout: 120000
return true
false
save: (attrs, options) ->
return if @shouldAvoidCorruptData attrs
super attrs, options

View file

@ -217,7 +217,7 @@ module.exports = class SpectateLevelView extends RootView
initScriptManager: ->
if @world.scripts
nonVictoryPlaybackScripts = _.reject @world.scripts, (script) ->
script.id.indexOf('Set Camera Boundaries and Goals') == -1
script.id.indexOf('Set Camera Boundaries') is -1
else
console.log 'World scripts don\'t exist!'
nonVictoryPlaybackScripts = []