MCPcopy Create free account
hub / github.com/codecombat/codecombat / onClickSimulateAllButton

Method onClickSimulateAllButton

app/views/ladder/LadderView.js:402–449  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

400 // Backbone.Mediator.publish 'router:navigate', route: url
401
402 onClickSimulateAllButton (e) {
403 if (this.tournamentId) {
404 let options
405 if (key.shift) {
406 // TODO: make this configurable
407 options = {
408 sessionLimit: 50000,
409 matchLimit: 2e6,
410 matchmakingType: 'king-of-the-hill',
411 minPlayerMatches: 40,
412 topN: 10
413 }
414 } else {
415 options = {}
416 }
417 return $.ajax({
418 url: `/db/tournament/${this.tournamentId}/end`,
419 data: options,
420 type: 'POST',
421 success (res) {
422 return console.log(res)
423 },
424 error (err) {
425 return alert('tournament end failed')
426 }
427 })
428 } else {
429 let left
430 return $.ajax({
431 url: '/queue/scoring/loadTournamentSimulationTasks',
432 data: {
433 originalLevelID: this.level.get('original'),
434 levelMajorVersion: 0,
435 leagueID: this.leagueID,
436 mirrorMatch: (left = this.level.get('mirrorMatch')) != null ? left : false,
437 sessionLimit: 750
438 },
439 type: 'POST',
440 parse: true,
441 success (res) {
442 return console.log(res)
443 },
444 error (err) {
445 return console.error(err)
446 }
447 })
448 }
449 }
450
451 onClickEarlyResultsButton (e) {
452 return this.checkTournamentClose()

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected