Fixed . LevelLoader wasn't handling cached session objects passed in with the supermodel.

This commit is contained in:
Scott Erickson 2014-05-07 13:28:42 -07:00
parent ff51f18a90
commit c037ce14f2

View file

@ -59,13 +59,13 @@ module.exports = class LevelLoader extends CocoClass
url = "/db/level/#{@levelID}/session"
url += "?team=#{@team}" if @team
@session = new LevelSession().setURL url
@supermodel.loadModel(@session, 'level_session', {cache:false})
session = new LevelSession().setURL url
@session = @supermodel.loadModel(session, 'level_session', {cache:false}).model
@session.once 'sync', -> @url = -> '/db/level.session/' + @id
if @opponentSessionID
@opponentSession = new LevelSession().setURL "/db/level_session/#{@opponentSessionID}"
@supermodel.loadModel(@opponentSession, 'opponent_session')
opponentSession = new LevelSession().setURL "/db/level_session/#{@opponentSessionID}"
@opponentSession = @supermodel.loadModel(opponentSession, 'opponent_session').model
# Supermodel (Level) Loading