Made sure session objects are loaded from the server fresh, no caching.

This commit is contained in:
Scott Erickson 2014-02-14 15:35:54 -08:00
parent 13caae2690
commit d55e4cd624
3 changed files with 6 additions and 3 deletions

View file

@ -45,7 +45,10 @@ module.exports = class LevelLoader extends CocoClass
@session = new LevelSession()
@session.url = -> url
@session.fetch()
# Unless you specify cache:false, sometimes the browser will use a cached session
# and players will 'lose' code
@session.fetch({cache:false})
@session.once 'sync', @onSessionLoaded, @
if @opponentSessionID

View file

@ -252,7 +252,7 @@ module.exports = class SpriteBoss extends CocoClass
# Marks
updateSelection: ->
if @selectedSprite and (not @selectedSprite.thang.exists or not @world.getThangByID @selectedSprite.thang.id)
if @selectedSprite?.thang and (not @selectedSprite.thang.exists or not @world.getThangByID @selectedSprite.thang.id)
@selectSprite null, null, null
@updateTarget()
return unless @selectionMark

View file

@ -81,7 +81,7 @@ class CocoModel extends Backbone.Model
return super attrs, options
fetch: ->
super()
super(arguments...)
@loading = true
markToRevert: ->