mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
Merge branch 'master' of https://github.com/codecombat/codecombat
Conflicts: app/lib/simulator/Simulator.coffee
This commit is contained in:
commit
65aae86dcc
3 changed files with 12 additions and 8 deletions
app
|
@ -55,6 +55,7 @@ module.exports = class Simulator extends CocoClass
|
|||
console.log info
|
||||
@trigger 'statusUpdate', info
|
||||
@simulateAnotherTaskAfterDelay()
|
||||
application.tracker?.trackEvent 'Simulator Result', label: "No Games"
|
||||
|
||||
simulateAnotherTaskAfterDelay: =>
|
||||
console.log "Retrying in #{@retryDelayInSeconds}"
|
||||
|
@ -170,6 +171,7 @@ module.exports = class Simulator extends CocoClass
|
|||
unless @options.headlessClient
|
||||
simulatedBy = parseInt($('#simulated-by-you').text(), 10) + 1
|
||||
$('#simulated-by-you').text(simulatedBy)
|
||||
application.tracker?.trackEvent 'Simulator Result', label: "Success"
|
||||
|
||||
handleTaskResultsTransferError: (error) =>
|
||||
@trigger 'statusUpdate', 'There was an error sending the results back to the server.'
|
||||
|
@ -271,7 +273,8 @@ module.exports = class Simulator extends CocoClass
|
|||
if spellTeam not in playerTeams then useProtectAPI = false
|
||||
@spells[spellKey].thangs[thang.id].aether = @createAether @spells[spellKey].name, method, useProtectAPI
|
||||
|
||||
transpileSpell: (thang, spellKey, methodName) ->
|
||||
|
||||
transpileSpell: (thang, spellKey, methodName) ->
|
||||
slugifiedThangID = _.string.slugify thang.id
|
||||
generatedSpellKey = [slugifiedThangID,methodName].join '/'
|
||||
source = @currentUserCodeMap[generatedSpellKey] ? ""
|
||||
|
@ -335,10 +338,10 @@ class SimulationTask
|
|||
getSpellKeyToTeamMap: -> @spellKeyToTeamMap
|
||||
|
||||
getPlayerTeams: -> _.pluck @rawData.sessions, 'team'
|
||||
|
||||
setWorld: (@world) ->
|
||||
|
||||
|
||||
|
||||
setWorld: (@world) ->
|
||||
|
||||
|
||||
generateSpellKeyToSourceMap: ->
|
||||
playerTeams = _.pluck @rawData.sessions, 'team'
|
||||
spellKeyToSourceMap = {}
|
||||
|
@ -362,7 +365,7 @@ class SimulationTask
|
|||
teamCode[fullSpellName]=spell
|
||||
|
||||
_.merge spellKeyToSourceMap, teamCode
|
||||
|
||||
|
||||
spellKeyToSourceMap
|
||||
|
||||
getWorldProgrammableSource: (desiredSpellKey ,world) ->
|
||||
|
@ -382,5 +385,5 @@ class SimulationTask
|
|||
@thangSpells[thang.id].push spellKey
|
||||
if not method.cloneOf and spellKey is desiredSpellKey
|
||||
console.log "Setting #{desiredSpellKey} from world!"
|
||||
|
||||
|
||||
return method.source
|
||||
|
|
|
@ -38,6 +38,7 @@ module.exports = class SimulateTabView extends CocoView
|
|||
# Simulations
|
||||
|
||||
onSimulateButtonClick: (e) ->
|
||||
application.tracker?.trackEvent 'Simulate Button Click', {}
|
||||
$("#simulate-button").prop "disabled", true
|
||||
$("#simulate-button").text "Simulating..."
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = class ProblemAlertView extends View
|
|||
|
||||
getRenderData: (context={}) ->
|
||||
context = super context
|
||||
format = (s) -> s?.replace('<', '<').replace('>', '>').replace("\n", "<br>")
|
||||
format = (s) -> s?.replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br>')
|
||||
message = @problem.aetherProblem.message
|
||||
age = @problem.aetherProblem.userInfo.age
|
||||
if age?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue