mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Added error handling for findNearestBetterSessionID
This commit is contained in:
parent
a7f24ab04f
commit
47c41e0a6e
1 changed files with 10 additions and 7 deletions
|
@ -614,13 +614,16 @@ determineIfSessionShouldContinueAndUpdateLog = (cb) ->
|
||||||
|
|
||||||
|
|
||||||
findNearestBetterSessionID = (cb) ->
|
findNearestBetterSessionID = (cb) ->
|
||||||
levelOriginalID = @levelSession.level.original
|
try
|
||||||
levelMajorVersion = @levelSession.level.majorVersion
|
levelOriginalID = @levelSession.level.original
|
||||||
sessionID = @clientResponseObject.originalSessionID
|
levelMajorVersion = @levelSession.level.majorVersion
|
||||||
sessionTotalScore = @newScoresObject[sessionID].totalScore
|
sessionID = @clientResponseObject.originalSessionID
|
||||||
opponentSessionID = _.pull(_.keys(@newScoresObject), sessionID)
|
sessionTotalScore = @newScoresObject[sessionID].totalScore
|
||||||
opponentSessionTotalScore = @newScoresObject[opponentSessionID].totalScore
|
opponentSessionID = _.pull(_.keys(@newScoresObject), sessionID)
|
||||||
opposingTeam = calculateOpposingTeam(@clientResponseObject.originalSessionTeam)
|
opponentSessionTotalScore = @newScoresObject[opponentSessionID].totalScore
|
||||||
|
opposingTeam = calculateOpposingTeam(@clientResponseObject.originalSessionTeam)
|
||||||
|
catch e
|
||||||
|
cb e
|
||||||
|
|
||||||
retrieveAllOpponentSessionIDs sessionID, (err, opponentSessionIDs) ->
|
retrieveAllOpponentSessionIDs sessionID, (err, opponentSessionIDs) ->
|
||||||
if err? then return cb err, null
|
if err? then return cb err, null
|
||||||
|
|
Loading…
Reference in a new issue