# see webserver/config.py for more documentation on how to define games and
# templates, and how to use string templating. A game definition needs to
# provide various paths that allow running the game, saving in the right
# place, etc. The settings in here are designed for running the webserver
# in the repository from the `source` directory.
# Games are called with the following argv, which illustrates the bare minimum:
# [
#   $crawl_binary,
#   *$pre_options,
#   "-name", "%n",
#   "-rc", "$rcfile_path/%n.rc",
#   "-macro", "$macro_path/%n.macro",
#   "-morgue", "$morgue_path,"
#   *$options,
#   "-dir", "$dir_path"
#   "-webtiles-socket", "$socket_path/%n:$timestamp.sock",
#   "-await-connection"
# ]
#
# `socket_path` is used for communication between the webtiles server and DCSS
# executable. If you change the CWD with a crawl_binary script, this path
# will have to be absolute (so both the server and DCSS can find it).
#
# Any relative paths are relative to the directory that the server is run from.
# The in-repo configuration uses lots of relative paths, but for a production
# server you probably just want to avoid this. You can also, optionally, use
# the `cwd` parameter to force a CWD to use as the relative path base.
# For example official server configs, see branches in the dgamelaunch-config
# repository.
# Templating hints (see config.py): %v: version, %n: username

templates:
  - id: default # id must be unique for each template and game
    crawl_binary: ./crawl
    rcfile_path: ./rcs/
    macro_path: ./rcs/
    morgue_path: ./rcs/%n
    socket_path: ./rcs
    # # Optional: `dir_path` is where save games + logfile/milestones are written.
    # # if not set, it uses local crawl system settings.
    # dir_path: .
    inprogress_path: ./rcs/running
    ttyrec_path: ./rcs/ttyrecs/%n
    client_path: ./webserver/game_data/

    # # Optional: a (public) URL that will point to morgue files. Example: on
    # # CAO, this is set to: "http://crawl.akrasiac.org/rawdata/%n/"
    morgue_url: None
    # # By default, `milestone_path` is inferred based on `dir_path`.
    # milestone_path: ./rcs/milestones
    # # Optional: an array of extra options to add to the start of the DCSS
    # # command. Generally used for custom launcher scripts, consult the
    # # documentation for such scripts.
    # pre_options: []
    # # Optional: an array of extra options to add to the DCSS command. See
    # examples below.
    # options: []
    # # Optional: Map of extra environment variables to set when executing crawl.
    # # All env vars from the webtiles server environment are automatically
    # # inherited.
    # env:
    #   LANG: en_US.UTF8
    # # show_save_info: set to True if the binary supports save info json
    # # and you want it to be queried each time the player enters the lobby.
    # # (With a lot of binaries, it isn't necessarily recommended yet to blanket
    # # enable this, as it can slow down a player's lobby loading.)
    show_save_info: True
    # # Is this game mode allowed for accounts with an account hold? Note:
    # # account holds use features for preventing bones file generation that
    # # may not be supported on older versions of crawl. If unset, this defaults
    # # to True.
    allowed_with_hold: True
  # this template doesn't specify a base template, and so inherits from
  # `default` above
  - id: trunk
    version: trunk

# Games are stored in order. The order of games you define in these files will
# be preserved, and the files will be loaded in sorted order.
games:
  # id must be unique for each game
  - id: dcss-web-trunk
    template: trunk
    name: Play %v # `name` is what is shown in the webtiles lobby
  - id: seeded-web-trunk
    template: trunk
    name: Seeded
    options:
      - -seed
  - id: descent-web-trunk
    template: trunk
    name: Descent
    options:
      - -descent
  - id: tut-web-trunk
    template: trunk
    name: Tutorial
    options:
      - -tutorial
  - id: sprint-web-trunk
    template: trunk
    name: Sprint %v
    options:
      - -sprint
