From 2dc66f5947c8b870149f0cf8686fed53930a1ff1 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Tue, 14 Jun 2016 11:54:29 -0700 Subject: [PATCH 1/2] Log some stuff for debugging --- app/lib/LevelLoader.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/lib/LevelLoader.coffee b/app/lib/LevelLoader.coffee index d4f225a38..b607ad144 100644 --- a/app/lib/LevelLoader.coffee +++ b/app/lib/LevelLoader.coffee @@ -147,6 +147,7 @@ module.exports = class LevelLoader extends CocoClass @listenToOnce @opponentSession, 'sync', @loadDependenciesForSession loadDependenciesForSession: (session) -> + console.log "Loading dependencies for session: ", session if me.id isnt session.get 'creator' session.patch = session.save = -> console.error "Not saving session, since we didn't create it." else if codeLanguage = utils.getQueryVariable 'codeLanguage' @@ -171,9 +172,11 @@ module.exports = class LevelLoader extends CocoClass @consolidateFlagHistory() if @session.loaded if @level.get('type', true) in ['course'] # course-ladder is hard to handle because there's 2 sessions heroConfig = me.get('heroConfig') + console.log "Course mode, loading custom hero: ", heroConfig return if not heroConfig url = "/db/thang.type/#{heroConfig.thangType}/version" if heroResource = @maybeLoadURL(url, ThangType, 'thang') + console.log "Pushing resource: ", heroResource @worldNecessities.push heroResource return return unless @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] @@ -341,6 +344,7 @@ module.exports = class LevelLoader extends CocoClass true onWorldNecessitiesLoaded: -> + console.log "World necessities loaded." @initWorld() @supermodel.clearMaxProgress() @trigger 'world-necessities-loaded' From b3f8b79897fdfcbea1c13b62ae0c3e1e62ab9ace Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Tue, 14 Jun 2016 12:01:12 -0700 Subject: [PATCH 2/2] Register dependencies for course mode too --- app/lib/LevelLoader.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/LevelLoader.coffee b/app/lib/LevelLoader.coffee index b607ad144..2dbd1e6a4 100644 --- a/app/lib/LevelLoader.coffee +++ b/app/lib/LevelLoader.coffee @@ -111,7 +111,7 @@ module.exports = class LevelLoader extends CocoClass @loadDependenciesForSession @session loadSession: -> - if @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] + if @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop', 'course'] @sessionDependenciesRegistered = {} if @sessionID @@ -178,6 +178,7 @@ module.exports = class LevelLoader extends CocoClass if heroResource = @maybeLoadURL(url, ThangType, 'thang') console.log "Pushing resource: ", heroResource @worldNecessities.push heroResource + @sessionDependenciesRegistered[session.id] = true return return unless @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] heroConfig = session.get('heroConfig')