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
app
|
@ -54,13 +54,13 @@ module.exports = class LevelSession extends CocoModel
|
||||||
return if @shouldAvoidCorruptData attrs
|
return if @shouldAvoidCorruptData attrs
|
||||||
super attrs, options
|
super attrs, options
|
||||||
|
|
||||||
increaseDifficulty: ->
|
increaseDifficulty: (callback) ->
|
||||||
state = @get('state') ? {}
|
state = @get('state') ? {}
|
||||||
state.difficulty = (state.difficulty ? 0) + 1
|
state.difficulty = (state.difficulty ? 0) + 1
|
||||||
delete state.lastUnsuccessfulSubmissionTime
|
delete state.lastUnsuccessfulSubmissionTime
|
||||||
@set 'state', state
|
@set 'state', state
|
||||||
@save()
|
|
||||||
@trigger 'change-difficulty'
|
@trigger 'change-difficulty'
|
||||||
|
@save null, success: callback
|
||||||
|
|
||||||
timeUntilResubmit: ->
|
timeUntilResubmit: ->
|
||||||
state = @get('state') ? {}
|
state = @get('state') ? {}
|
||||||
|
|
|
@ -523,8 +523,11 @@ module.exports = class PlayLevelView extends RootView
|
||||||
return if @destroyed
|
return if @destroyed
|
||||||
# TODO: Show a victory dialog specific to hero-ladder level
|
# TODO: Show a victory dialog specific to hero-ladder level
|
||||||
if @goalManager.checkOverallStatus() is 'success' and not @options.realTimeMultiplayerSessionID?
|
if @goalManager.checkOverallStatus() is 'success' and not @options.realTimeMultiplayerSessionID?
|
||||||
@session.increaseDifficulty() if @level.get 'replayable'
|
showModalFn = -> Backbone.Mediator.publish 'level:show-victory', showModal: true
|
||||||
Backbone.Mediator.publish 'level:show-victory', showModal: true
|
if @level.get 'replayable'
|
||||||
|
@session.increaseDifficulty showModalFn
|
||||||
|
else
|
||||||
|
showModalFn()
|
||||||
|
|
||||||
destroy: ->
|
destroy: ->
|
||||||
@levelLoader?.destroy()
|
@levelLoader?.destroy()
|
||||||
|
|
Reference in a new issue