mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Trying to stagger LevelSessions saves on wins on replayable levels to see if that might help #2108 at all.
This commit is contained in:
parent
e75e0791d0
commit
e3bf8f74ab
2 changed files with 7 additions and 4 deletions
|
@ -54,13 +54,13 @@ module.exports = class LevelSession extends CocoModel
|
|||
return if @shouldAvoidCorruptData attrs
|
||||
super attrs, options
|
||||
|
||||
increaseDifficulty: ->
|
||||
increaseDifficulty: (callback) ->
|
||||
state = @get('state') ? {}
|
||||
state.difficulty = (state.difficulty ? 0) + 1
|
||||
delete state.lastUnsuccessfulSubmissionTime
|
||||
@set 'state', state
|
||||
@save()
|
||||
@trigger 'change-difficulty'
|
||||
@save null, success: callback
|
||||
|
||||
timeUntilResubmit: ->
|
||||
state = @get('state') ? {}
|
||||
|
|
|
@ -523,8 +523,11 @@ module.exports = class PlayLevelView extends RootView
|
|||
return if @destroyed
|
||||
# TODO: Show a victory dialog specific to hero-ladder level
|
||||
if @goalManager.checkOverallStatus() is 'success' and not @options.realTimeMultiplayerSessionID?
|
||||
@session.increaseDifficulty() if @level.get 'replayable'
|
||||
Backbone.Mediator.publish 'level:show-victory', showModal: true
|
||||
showModalFn = -> Backbone.Mediator.publish 'level:show-victory', showModal: true
|
||||
if @level.get 'replayable'
|
||||
@session.increaseDifficulty showModalFn
|
||||
else
|
||||
showModalFn()
|
||||
|
||||
destroy: ->
|
||||
@levelLoader?.destroy()
|
||||
|
|
Loading…
Reference in a new issue