Пример #1
0
def appengine_run_game(argv_str, appengine_file_name=None):
    logging.basicConfig(level=logging.INFO)
    argv = argv_str.split()
    options, args = parseOptions(argv)
    reload(settings)
    reload(map_settings)
    loadMap(options.map)
    ais = loadAIModules(args) or []
    highlighted_ais = loadAIModules(options.highlight, highlight=True)
    if highlighted_ais:
        ais.extend(highlighted_ais)
        settings.SHOW_HIGHLIGHTS = set(highlighted_ais)

    settings.SINGLE_THREAD = True
    settings.IGNORE_EXCEPTIONS = True

    if options.fps: settings.FPS = int(options.fps)

    cli.appengine_main(ais, appengine_file_name)
Пример #2
0
def appengine_run_game(argv_str, appengine_file_name=None):
  logging.basicConfig(level=logging.INFO)
  argv = argv_str.split()
  options, args = parseOptions(argv)
  reload(settings)
  reload(map_settings)
  loadMap(options.map)
  ais = loadAIModules(args) or []
  highlighted_ais = loadAIModules(options.highlight, highlight=True)
  if highlighted_ais:
    ais.extend(highlighted_ais)
    settings.SHOW_HIGHLIGHTS = set(highlighted_ais)

  settings.SINGLE_THREAD = True
  settings.IGNORE_EXCEPTIONS = True

  if options.fps: settings.FPS = int(options.fps)

  cli.appengine_main(ais, appengine_file_name)
Пример #3
0
def appengine_tournament_game(ai_files, map_file, tournament_key):
  from appengine.appengine import record_ladder_match
  logging.basicConfig(level=logging.INFO)
  reload(settings)
  reload(map_settings)
  loadMap(map_file)
  ais = loadAIModules(ai_files)

  settings.SINGLE_THREAD = True
  settings.IGNORE_EXCEPTIONS = True

  world = cli.appengine_main(ais, tournament_key=tournament_key)


  record_ladder_match(world)
Пример #4
0
def appengine_tournament_game(ai_files, map_file, tournament_key):
    from appengine.appengine import record_ladder_match, skip_disabled_ai
    logging.basicConfig(level=logging.INFO)
    reload(settings)
    reload(map_settings)
    loadMap(map_file)
    map_settings.SEED = int(hash(tournament_key))

    ai_files = skip_disabled_ai(ai_files)
    ais = loadAIModules(ai_files)

    settings.SINGLE_THREAD = True
    settings.IGNORE_EXCEPTIONS = True

    world = cli.appengine_main(ais, tournament_key=tournament_key)

    record_ladder_match(world)