mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-01-05 20:22:44 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
46abc1899d
1 changed files with 6 additions and 1 deletions
|
@ -111,7 +111,7 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
@loadDependenciesForSession @session
|
@loadDependenciesForSession @session
|
||||||
|
|
||||||
loadSession: ->
|
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 = {}
|
@sessionDependenciesRegistered = {}
|
||||||
|
|
||||||
if @sessionID
|
if @sessionID
|
||||||
|
@ -147,6 +147,7 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
@listenToOnce @opponentSession, 'sync', @loadDependenciesForSession
|
@listenToOnce @opponentSession, 'sync', @loadDependenciesForSession
|
||||||
|
|
||||||
loadDependenciesForSession: (session) ->
|
loadDependenciesForSession: (session) ->
|
||||||
|
console.log "Loading dependencies for session: ", session
|
||||||
if me.id isnt session.get 'creator'
|
if me.id isnt session.get 'creator'
|
||||||
session.patch = session.save = -> console.error "Not saving session, since we didn't create it."
|
session.patch = session.save = -> console.error "Not saving session, since we didn't create it."
|
||||||
else if codeLanguage = utils.getQueryVariable 'codeLanguage'
|
else if codeLanguage = utils.getQueryVariable 'codeLanguage'
|
||||||
|
@ -171,10 +172,13 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
@consolidateFlagHistory() if @session.loaded
|
@consolidateFlagHistory() if @session.loaded
|
||||||
if @level.get('type', true) in ['course'] # course-ladder is hard to handle because there's 2 sessions
|
if @level.get('type', true) in ['course'] # course-ladder is hard to handle because there's 2 sessions
|
||||||
heroConfig = me.get('heroConfig')
|
heroConfig = me.get('heroConfig')
|
||||||
|
console.log "Course mode, loading custom hero: ", heroConfig
|
||||||
return if not heroConfig
|
return if not heroConfig
|
||||||
url = "/db/thang.type/#{heroConfig.thangType}/version"
|
url = "/db/thang.type/#{heroConfig.thangType}/version"
|
||||||
if heroResource = @maybeLoadURL(url, ThangType, 'thang')
|
if heroResource = @maybeLoadURL(url, ThangType, 'thang')
|
||||||
|
console.log "Pushing resource: ", heroResource
|
||||||
@worldNecessities.push heroResource
|
@worldNecessities.push heroResource
|
||||||
|
@sessionDependenciesRegistered[session.id] = true
|
||||||
return
|
return
|
||||||
return unless @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop']
|
return unless @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop']
|
||||||
heroConfig = session.get('heroConfig')
|
heroConfig = session.get('heroConfig')
|
||||||
|
@ -341,6 +345,7 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
true
|
true
|
||||||
|
|
||||||
onWorldNecessitiesLoaded: ->
|
onWorldNecessitiesLoaded: ->
|
||||||
|
console.log "World necessities loaded."
|
||||||
@initWorld()
|
@initWorld()
|
||||||
@supermodel.clearMaxProgress()
|
@supermodel.clearMaxProgress()
|
||||||
@trigger 'world-necessities-loaded'
|
@trigger 'world-necessities-loaded'
|
||||||
|
|
Loading…
Reference in a new issue