[BACK]Return to dgamelaunch.conf CVS log [TXT][DIR] Up to [contributed] / dgamelaunch-openbsd / examples

Annotation of dgamelaunch-openbsd/examples/dgamelaunch.conf, Revision 1.1

1.1     ! rubenllo    1: # This is a sample dgamelaunch configuration file. Only bash-style comments
        !             2: # are allowed, such as this. Each configuration option will be explained
        !             3: # along with its default value.
        !             4:
        !             5:
        !             6:
        !             7: # Global config variables:
        !             8:
        !             9:
        !            10: # Max amount of registered users to allow. Has no effect if dgl was
        !            11: # compiled with SQLite
        !            12: maxusers = 64000
        !            13:
        !            14: # Allow registration of new nicks? (yes or no)
        !            15: allow_new_nicks = yes
        !            16:
        !            17: # Max length for newly registered nicks. Must be less than 20.
        !            18: # By default, NetHack only stores the first 10 chars of a name into
        !            19: # the record/logfile.
        !            20: maxnicklen = 10
        !            21:
        !            22: # Set the default watching-screen sorting mode. Can be one of
        !            23: # "username", "game", "windowsize", "starttime" or "idletime".
        !            24: # "username" is the default.
        !            25: #sortmode = "username"
        !            26:
        !            27: # Set the columns displayed in the watching-screen. Each column definition
        !            28: # must have four elements as:
        !            29: #   [ "<display title>", "<sortname>", <Screen column>, "<printf format>" ]
        !            30: #
        !            31: # <sortname> may be "unsorted", "username", "game", "windowsize", "starttime",
        !            32: # "duration", "idletime", or (if shmem is enabled) "watchers".
        !            33: #
        !            34: # watch_columns = [ ["", "", 1, "%s)"],
        !            35: #                   ["User", "username", 4, "%-15s"],
        !            36: #                   ["Game", "game", 21, "%-11s"],
        !            37: #                   ["Term", "windowsize", 34, "%s"],
        !            38: #                   ["Idle", "idletime", 43, "%-10s"],
        !            39: #                   ["Watchers", "watchers", 55, "%5s"],
        !            40: #                   ["Started", "starttime", 65, "%s"]
        !            41: #                 ]
        !            42:
        !            43: # Path to a prepared chroot jail.
        !            44: chroot_path = "/opt/nethack/nethack.alt.org/"
        !            45:
        !            46: # From inside the jail, dgamelaunch's working directory for rcfiles/ttyrec/etc
        !            47: dglroot = "/dgldir/"
        !            48:
        !            49: # Strings to be replaced in every banner
        !            50: # you can have either direct string replacements, like
        !            51: # "$FOO" = "BAR", or you can get the server time with
        !            52: # "$FOO" = timeformat("%F %T")
        !            53: # for the timeformat parameter string format, see man strftime
        !            54: bannervars = [ "$MOTDTIME" = "2011.10.08",
        !            55:               "$SERVERID" = "$ATTR(14)nethack.alt.org - http://nethack.alt.org/$ATTR()",
        !            56:               "$DATETIME" = timeformat("%F %T")
        !            57:             ]
        !            58:
        !            59: # From inside the jail, location of a banner file, which is
        !            60: # shown in submenus that cannot be defined separately.
        !            61: # Some string substitution is done for every banner file contents:
        !            62: # - bannervars from above
        !            63: # - $VERSION replaced with "dgamelaunch v" + dgl version number.
        !            64: # - $USERNAME replaced with logged-in user's name, or with "[Anonymous]"
        !            65: # - $INCLUDE(filename) the named file will be inserted here.
        !            66: banner = "/dgl-banner"
        !            67:
        !            68: # The following two options are fairly insecure. They will force us to
        !            69: # load the password/group database into memory while still having root
        !            70: # privileges. Replace them with shed_uid/shed_gid entries as soon as
        !            71: # possible if you decide to use them. dgamelaunch will inform you of
        !            72: # the uids/gids corresponding to your choices when it loads.
        !            73: #
        !            74: # Note that shed_uid and shed_gid will always take precedence over
        !            75: # shed_user and shed_group if they are specified.
        !            76:
        !            77: # shed_user: username to shed privileges to
        !            78: #shed_user = "games"
        !            79: # shed_group: group name to shed privileges to
        !            80: #shed_group = "games"
        !            81:
        !            82: # Preferably, you may use the respective gids/uids. This is for Debian:
        !            83: shed_uid = 5
        !            84: shed_gid = 60
        !            85:
        !            86: # Locale. Leaving this out, dgamelaunch will not explicitly set locale.
        !            87: locale = "en_US.UTF-8"
        !            88:
        !            89: # Default TERM, used if the user's $TERM is unknown.
        !            90: # If undefined, dgamelaunch will just terminate in that case.
        !            91: default_term = "xterm"
        !            92:
        !            93: # Should dgl send select-UTF8-charset escape code? (that is: ESC % G)
        !            94: # default is no.
        !            95: #utf8esc = yes
        !            96:
        !            97: # Should dgl allow XON/XOFF? Default is "yes", meaning "don't touch it".
        !            98: # "no" disables XON/XOFF
        !            99: #flowcontrol = no
        !           100:
        !           101: # Maximum time in seconds user can idle in the dgamelaunch menus
        !           102: # before dgl exits. Default value is 0, which disables the idling timer.
        !           103: # Does not apply to external programs or config editors.
        !           104: # For setting game idle time, use max_idle_time in the game DEFINE.
        !           105: # menu_max_idle_time = 1024
        !           106:
        !           107: # Passwd refers to the file that stores the user database.
        !           108: # The default passwd file is "/dgl-login" for flat-text database, and for
        !           109: # sqlite, whatever value was defined for the sqlite database at compile time.
        !           110: # This is also used for the shared memory key, if shmem is enabled at compile
        !           111: # time.
        !           112: #passwd = "/dgl-login"
        !           113:
        !           114: # Lockfile is used only when dgl was compiled without sqlite.
        !           115: #lockfile = "/dgl-lock"
        !           116:
        !           117: #
        !           118: # define some commands that are run when something happens. format is
        !           119: # commands [ <time> ] = <command> ...
        !           120: #
        !           121: # <time> can be one of:
        !           122: #   dglstart  = when someone telnets in
        !           123: #   login     = when user has logged in
        !           124: #   register  = right after a new user is registered
        !           125: #   gamestart = just before a game is started
        !           126: #   gameend   = after a game ends (see also per-game "postcommand" define)
        !           127: #
        !           128: # <command> is:
        !           129: #   mkdir "foo"        = create a directory "foo"
        !           130: #   chdir "foo"        = change current work dir to "foo"
        !           131: #   cp "foo" "bar"     = copy file "foo" to "bar", overwriting previous "bar"
        !           132: #   ifnxcp "foo" "bar" = copy file "foo" to "bar", if "bar" doesn't exist
        !           133: #   unlink "foo"       = delete file "foo"
        !           134: #   setenv "foo" "bar" = set environment variable "foo" to "bar"
        !           135: #   exec "foo" "bar"   = execute "foo" with "bar" as it's param
        !           136: #   rawprint "foo"     = output string "foo"
        !           137: #   chpasswd           = do the change password prompting, if logged in
        !           138: #   chmail             = do the change email prompting, if logged in
        !           139: #   watch_menu         = go to the watching menu
        !           140: #   quit               = quit dgl
        !           141: #   ask_login          = do the login prompting, if not logged in
        !           142: #   ask_register       = do register new user prompting, if not logged in and
        !           143: #                        registration of new nicks is allowed.
        !           144: #   play_game "foo"    = start game which has the short name "foo"
        !           145: #                        (user must be logged in)
        !           146: #   play_if_exist "foo" "file" = start game "foo", if file "file" exists.
        !           147: #   submenu "foo"      = go to submenu "foo"
        !           148: #   return             = return from submenu
        !           149: #
        !           150: #  NOTE: edit_options-command was removed. use ifnxcp and exec to simulate it.
        !           151: #
        !           152: # The commands will be done inside the chroot and with the uid and gid
        !           153: # defined above.
        !           154: # Parameters to the commands are subject to variable substitution:
        !           155: #   %r = dglroot, as defined above
        !           156: #   %n = user nick, if user is logged in
        !           157: #   %N = first character of user name, if user is logged in
        !           158: #   %u = shed_uid, as defined above, but numeric
        !           159: #   %g = game name, if user has selected a game.
        !           160: #   %s = short game name, if user has selected a game.
        !           161: #   %t = ttyrec path & filename of the last game played.
        !           162: #
        !           163: # Also some escape codes:
        !           164: #   \\ = backslash
        !           165: #   \a = bell
        !           166: #   \b = backspace
        !           167: #   \e = escape character
        !           168: #   \f = form feed
        !           169: #   \n = newline
        !           170: #   \r = carriage return
        !           171: #   \t = tab
        !           172: #   \v = vertical tab
        !           173: #
        !           174: # eg. commands[login] = mkdir "foo", unlink "bar", setenv "Z" "foo"
        !           175: #
        !           176:
        !           177: # Change the terminal title: (assuming terminals support the escape code)
        !           178: #commands[dglstart] = rawprint "\e]2;nethack.alt.org\a"
        !           179:
        !           180: # create the user's dirs when they register
        !           181: commands[register] = mkdir "%ruserdata/%n",
        !           182:                      mkdir "%ruserdata/%n/dumplog",
        !           183:                      mkdir "%ruserdata/%n/ttyrec"
        !           184:
        !           185: commands[login] = mkdir "%ruserdata/%n",
        !           186:                      mkdir "%ruserdata/%n/dumplog",
        !           187:                      mkdir "%ruserdata/%n/ttyrec"
        !           188:
        !           189: # file mode for when commands copy files.
        !           190: # readable and writable by all. you could use eg. "0644" to be more secure.
        !           191: filemode = "0666"
        !           192:
        !           193:
        !           194:
        !           195:
        !           196: # Define the main menus.
        !           197: # You _must_ define "mainmenu_anon" and "mainmenu_user".
        !           198: # $VERSION and $SERVERID will be replaced, as per the bannerfile above.
        !           199:
        !           200: # First, the menu shown to anonymous user:
        !           201: menu["mainmenu_anon"] {
        !           202:         bannerfile = "dgl_menu_main_anon.txt"
        !           203:         cursor = (5,18)
        !           204:         commands["l"] = ask_login
        !           205:         commands["r"] = ask_register
        !           206:         commands["w"] = watch_menu
        !           207:         commands["q"] = quit
        !           208: }
        !           209:
        !           210: # Then the menu shown when the user has logged in:
        !           211: # $USERNAME in here will be replaced with the user name.
        !           212: menu["mainmenu_user"] {
        !           213: # contents of this file are written to screen.
        !           214: # the file must be inside the chroot.
        !           215: # Some string subsitutions can be done in the file:
        !           216: # $INCLUDE(filename) =  includes the file to this file.
        !           217: # String substitutions defined in bannervars-section above.
        !           218: # $VERSION           =  dgamelaunch version
        !           219: # $USERNAME          =  user name (or [Anonymous] if not logged in)
        !           220: # $ATTR(params)      =  change text color and attributes.
        !           221: #        params can be either number (to set the text color),
        !           222: #       one, or any of "b" (bold), "s" (standout), "u" (underline),
        !           223: #       "r" (reverse) or "d" (dim),
        !           224: #       or both color number and attribute characters, separated by colon.
        !           225: #       Empty param resets color and attributes to default.
        !           226:         bannerfile = "dgl_menu_main_user.txt"
        !           227: # after which cursor is moved to this location
        !           228: # if cursor-definition is missing, the cursor is put
        !           229: # to the end of the last line of the banner.
        !           230: #        cursor = (5,18)
        !           231: # keys we accept. format is
        !           232: #  commands["string_of_keys"] = <commandlist>
        !           233: # for example, you could use commands["qQ"] = quit
        !           234:         commands["c"] = chpasswd
        !           235:         commands["e"] = chmail
        !           236:         commands["w"] = watch_menu
        !           237:         commands["o"] = ifnxcp "/dgl-default-rcfile.nh343" "%ruserdata/%n/%n.nh343rc",
        !           238:                        exec "/bin/virus" "%ruserdata/%n/%n.nh343rc"
        !           239:         commands["p"] = play_game "NH343"
        !           240:         commands["q"] = quit
        !           241: }
        !           242:
        !           243: # this menu is shown when user presses '?' in the watching menu
        !           244: menu["watchmenu_help"] {
        !           245:        bannerfile = "dgl_menu_watchmenu_help.txt"
        !           246:        commands["qQ "] = return
        !           247: }
        !           248:
        !           249:
        !           250:
        !           251:
        !           252: # Next, we'll define one game's data:
        !           253:
        !           254: #DEFINE {
        !           255: #  # From inside the jail, the location of the binary to be launched.
        !           256: #  game_path = "/bin/nethackstub"
        !           257: #
        !           258: #  # Full name of the game
        !           259: #  game_name = "NetHack stub"
        !           260: #
        !           261: #  # Short name, used in the watching menu
        !           262: #  short_name = "NHstb"
        !           263: #
        !           264: #  # Game ID - should be unique. Defaults to game_name, if not defined.
        !           265: #  # Used to determine which game is which for "play_game" and "play_if_exists" commands
        !           266: #  game_id = "NHstb"
        !           267: #
        !           268: #  # arguments for when we exec the binary
        !           269: #  game_args = "/bin/nethackstub",
        !           270: #            "foo",
        !           271: #            "user:%n",
        !           272: #            "shed_uid:%u",
        !           273: #            "bar"
        !           274: #
        !           275: #  # From inside the jail, where dgamelaunch should put mail.
        !           276: #  spooldir = "/var/mail/"
        !           277: #
        !           278: #  # From inside the jail, the default .nethackrc that is copied for new users.
        !           279: #  # rc_template = "/dgl-default-rcfile"
        !           280: #
        !           281: #  # If player idles longer than max_idle_time seconds, the game will
        !           282: #  # receive a sighup. Default value is 0, which disables the idling timer.
        !           283: #  max_idle_time = 2000
        !           284: #
        !           285: #  # Player-specific path to an extra information file written by the game
        !           286: #  # The game should write the extra information on one line in this format:
        !           287: #  #    <numeric-weight>|extra-information
        !           288: #  # For example, the game might write: "100|Astral", "1|D:1", etc. to indicate
        !           289: #  # where the player is in the game world. The numeric weight is used when
        !           290: #  # a spectator sorts games by the extra information field: higher weights
        !           291: #  # will be sorted to appear before lower weights.
        !           292: #  #
        !           293: #  extra_info_file = "%rgamedir/%n.extrainfo"
        !           294: #
        !           295: #  # Make sure the inprogress dir actually exists. default is "inprogress/"
        !           296: #  # Each game you define here must have it's own.
        !           297: #  inprogressdir = "%rinprogress-nethackstub/"
        !           298: #
        !           299: #  # We can also define per-game commands, that are executed
        !           300: #  # when the game starts:
        !           301: #  # commands = chdir "/dgldir", mkdir "foo_%u_%g"
        !           302: #
        !           303: #  # We can also define per-game commands executed after the game ends,
        !           304: #  # but before commands[gameend]
        !           305: #  postcommands = chdir "/"
        !           306: #
        !           307: #  # If the game uses an ancient encoding, you may specify "ibm" or "dec".
        !           308: #  # If set to "ask", the game will be run with --print-charset beforehand,
        !           309: #  # expected to return one of these values.
        !           310: #  encoding = "unicode"
        !           311: #}
        !           312:
        !           313:
        !           314: #
        !           315: # the second game
        !           316: #
        !           317: #
        !           318:
        !           319: DEFINE {
        !           320:   game_path = "/nh343/nethack"
        !           321:   game_name = "NetHack 3.4.3"
        !           322:   short_name = "NH343"
        !           323:
        !           324:   game_args = "/nh343/nethack", "-u", "%n"
        !           325:
        !           326:   spooldir = "/mail/"
        !           327:   rc_template = "/dgl-default-rcfile.nh343"
        !           328:
        !           329:   rc_fmt = "%ruserdata/%n/%n.nh343rc"
        !           330:
        !           331:   inprogressdir = "%rinprogress-nh343/"
        !           332:
        !           333: # The place where ttyrecs are stored for this game.
        !           334: # If this is not defined, ttyrecs are not saved for this game.
        !           335: # Leaving this undefined also means the games cannot be spectated.
        !           336:   ttyrecdir = "%ruserdata/%n/ttyrec/"
        !           337:
        !           338:
        !           339:   # back up savefile
        !           340:   commands = cp "/nh343/var/save/%u%n.gz" "/nh343/var/save/%u%n.gz.bak",
        !           341:   # set NETHACKOPTIONS to point to the rcfile
        !           342:              setenv "NETHACKOPTIONS" "@%ruserdata/%n/%n.nh343rc",
        !           343:   # set up nethack mail stuff, assuming it's compiled with it...
        !           344:              setenv "MAIL" "/mail/%n",
        !           345:              setenv "SIMPLEMAIL" "1",
        !           346:   # don't let the mail file grow
        !           347:              unlink "/mail/%n"
        !           348: }
        !           349:
        !           350: #
        !           351: # third game
        !           352: #
        !           353: #
        !           354:
        !           355: #DEFINE {
        !           356: #  game_path = "/bin/crawlss017"
        !           357: #  game_name = "Crawl Stone Soup 0.1.7"
        !           358: #  short_name = "Cr017"
        !           359: #
        !           360: #  game_args = "/bin/crawlss017",
        !           361: #            "-name",   "%n",
        !           362: #            "-dir",    "/crawlss017/",
        !           363: #            "-rc",     "%rrcfiles/%n.crawlrc",
        !           364: #            "-morgue", "/crawlss017/morgues/",
        !           365: #            "-macro",  "/crawlss017/macros/%n.macro"
        !           366: #
        !           367: #  rc_template = "/dgl-default-rcfile.crawl"
        !           368: #  rc_fmt = "%rrcfiles/%n.crawlrc"
        !           369: #  inprogressdir = "%rinprogress-crawlss017/"
        !           370: #  encoding = ask
        !           371: #}
        !           372:
        !           373: #
        !           374: # fourth game
        !           375: #
        !           376: #
        !           377:
        !           378: #DEFINE {
        !           379: #  game_path = "/bin/crawlss020"
        !           380: #  game_name = "Crawl Stone Soup 0.2.0"
        !           381: #  short_name = "Cr020"
        !           382: #
        !           383: #  game_args = "/bin/crawlss020",
        !           384: #            "-name",   "%n",
        !           385: #            "-dir",    "/crawlss020/",
        !           386: #            "-rc",     "/crawlss020/plr/%n/%n.crawlrc",
        !           387: #            "-morgue", "/crawlss020/plr/%n/",
        !           388: #            "-macro",  "/crawlss020/plr/%n/"
        !           389: #
        !           390: #  rc_template = "/dgl-default-rcfile.crawl"
        !           391: #  rc_fmt = "/crawlss020/plr/%n/%n.crawlrc"
        !           392: #  inprogressdir = "%rinprogress-crawlss020/"
        !           393: #}

CVSweb