mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
Protection and logging for #1463. Fixed an issue with spectate camera script bounds.
This commit is contained in:
parent
bfae70ef13
commit
8c45e22741
2 changed files with 12 additions and 1 deletions
app
|
@ -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
|
||||
|
|
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue