mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 09:23:41 -04:00
Fix selection
This commit is contained in:
parent
7bc4a0451c
commit
d59c163493
1 changed files with 4 additions and 1 deletions
|
@ -134,7 +134,7 @@ module.exports.getTwoGames = (req, res) ->
|
||||||
"levelID":"greed"
|
"levelID":"greed"
|
||||||
"submitted":true
|
"submitted":true
|
||||||
"team":"humans"
|
"team":"humans"
|
||||||
selection = "team totalScore transpiledCode teamSpells levelID creatorName creator"
|
selection = "team totalScore transpiledCode teamSpells levelID creatorName creator submitDate"
|
||||||
LevelSession.count queryParams, (err, numberOfHumans) =>
|
LevelSession.count queryParams, (err, numberOfHumans) =>
|
||||||
if err? then return errors.serverError(res, "Couldn't get the number of human games")
|
if err? then return errors.serverError(res, "Couldn't get the number of human games")
|
||||||
humanSkipCount = selectRandomSkipIndex(numberOfHumans)
|
humanSkipCount = selectRandomSkipIndex(numberOfHumans)
|
||||||
|
@ -495,6 +495,8 @@ deleteQueueMessage = (callback) ->
|
||||||
fetchLevelSession = (callback) ->
|
fetchLevelSession = (callback) ->
|
||||||
findParameters =
|
findParameters =
|
||||||
_id: @clientResponseObject.originalSessionID
|
_id: @clientResponseObject.originalSessionID
|
||||||
|
console.log "Find parameters are",findParameters
|
||||||
|
|
||||||
query = LevelSession
|
query = LevelSession
|
||||||
.findOne(findParameters)
|
.findOne(findParameters)
|
||||||
.lean()
|
.lean()
|
||||||
|
@ -589,6 +591,7 @@ updateMatchesInSession = (matchObject, sessionID, callback) ->
|
||||||
opponentsArray = _.toArray opponentsClone
|
opponentsArray = _.toArray opponentsClone
|
||||||
currentMatchObject.opponents = opponentsArray
|
currentMatchObject.opponents = opponentsArray
|
||||||
LevelSession.findOne {"_id": sessionID}, (err, session) ->
|
LevelSession.findOne {"_id": sessionID}, (err, session) ->
|
||||||
|
console.log "Updated session #{sessionID}"
|
||||||
session = session.toObject()
|
session = session.toObject()
|
||||||
currentMatchObject.playtime = session.playtime ? 0
|
currentMatchObject.playtime = session.playtime ? 0
|
||||||
sessionUpdateObject =
|
sessionUpdateObject =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue