Mercurial > hg > rlgallery-misc
comparison dgl/dgamelaunch.conf @ 14:9945b472aac2
Add dgamelaunch configuration to the project.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Sat, 15 Sep 2012 08:46:06 -0700 |
parents | |
children | f501c8dd6884 |
comparison
equal
deleted
inserted
replaced
13:d34f2e40e67d | 14:9945b472aac2 |
---|---|
1 # rlgallery.org configuration file for dgamelaunch | |
2 | |
3 | |
4 # Global config variables: | |
5 | |
6 | |
7 # Max amount of registered users to allow. Has no effect if dgl was | |
8 # compiled with SQLite | |
9 maxusers = 4096 | |
10 | |
11 # Allow registration of new nicks? (yes or no) | |
12 allow_new_nicks = yes | |
13 | |
14 # Max length for newly registered nicks. Must be less than 20. | |
15 # By default, NetHack only stores the first 10 chars of a name into | |
16 # the record/logfile. | |
17 maxnicklen = 10 | |
18 | |
19 # Set the default watching-screen sorting mode. Can be one of | |
20 # "unsorted", "username" or "idletime". Unsorted is the default. | |
21 sortmode = "username" | |
22 | |
23 # Path to a prepared chroot jail. | |
24 chroot_path = "/var/dgl/" | |
25 | |
26 # From inside the jail, dgamelaunch's working directory for rcfiles/ttyrec/etc | |
27 dglroot = "/dgldir/" | |
28 | |
29 # Server ID string | |
30 server_id = "Roguelike Gallery - rlgallery.org" | |
31 | |
32 # From inside the jail, location of a banner file, the topmost line will be | |
33 # shown in submenus that cannot be defined separately. | |
34 # Some string substitution is done for the file: | |
35 # $VERSION replaced with "dgamelaunch v" + dgl version number. | |
36 # $SERVERID replaced with the server_id string, as defined above. | |
37 banner = "/dgldir/dgl-banner" | |
38 | |
39 # The following two options are fairly insecure. They will force us to | |
40 # load the password/group database into memory while still having root | |
41 # privileges. Replace them with shed_uid/shed_gid entries as soon as | |
42 # possible if you decide to use them. dgamelaunch will inform you of | |
43 # the uids/gids corresponding to your choices when it loads. | |
44 # | |
45 # Note that shed_uid and shed_gid will always take precedence over | |
46 # shed_user and shed_group if they are specified. | |
47 | |
48 # shed_user: username to shed privileges to | |
49 #shed_user = "games" | |
50 # shed_group: group name to shed privileges to | |
51 #shed_group = "games" | |
52 | |
53 # Preferably, you may use the respective gids/uids. This is for Debian: | |
54 # Use the rodney account instead of games:games | |
55 shed_uid = 501 | |
56 shed_gid = 501 | |
57 | |
58 # The defaults are usually just fine for this. passwd refers to the file | |
59 # that stores the user database, and lockfile is only used internally by | |
60 # dgamelaunch. | |
61 # passwd doesn't matter if dgl was compiled with SQLite, as the name of | |
62 # the sqlite database will be defined at compile time. | |
63 passwd = "/dgldir/dgl-login" | |
64 lockfile = "/dgldir/dgl-lock" | |
65 | |
66 # | |
67 # define some commands that are run when something happens. format is | |
68 # commands [ <time> ] = <command> ... | |
69 # | |
70 # <time> can be one of: | |
71 # dglstart = when someone telnets in | |
72 # login = when user has logged in | |
73 # register = right after a new user is registered | |
74 # gamestart = just before a game is started | |
75 # | |
76 # <command> is: | |
77 # mkdir "foo" = create a directory "foo" | |
78 # chdir "foo" = change current work dir to "foo" | |
79 # cp "foo" "bar" = copy file "foo" to "bar", overwriting previous "bar" | |
80 # ifnxcp "foo" "bar" = copy file "foo" to "bar", if "bar" doesn't exist | |
81 # unlink "foo" = delete file "foo" | |
82 # setenv "foo" "bar" = set environment variable "foo" to "bar" | |
83 # exec "foo" "bar" = execute "foo" with "bar" as it's param | |
84 # chpasswd = do the change password prompting, if logged in | |
85 # chmail = do the change email prompting, if logged in | |
86 # watch_menu = go to the watching menu | |
87 # quit = quit dgl | |
88 # ask_login = do the login prompting, if not logged in | |
89 # ask_register = do register new user prompting, if not logged in and | |
90 # registration of new nicks is allowed. | |
91 # edit_options "foo" = edit options for game which has the short name "foo" | |
92 # (user must be logged in) | |
93 # play_game "foo" = start game which has the short name "foo" | |
94 # (user must be logged in) | |
95 # submenu "foo" = go to submenu "foo" | |
96 # return = return from submenu | |
97 # | |
98 # The commands will be done inside the chroot and with the uid and gid | |
99 # defined above. | |
100 # Parameters to the commands are subject to variable substitution: | |
101 # %r = dglroot, as defined above | |
102 # %n = user nick, if user is logged in | |
103 # %u = shed_uid, as defined above, but numeric | |
104 # %g = game name, if user has selected a game. | |
105 # | |
106 # eg. commands[login] = mkdir "foo", unlink "bar", setenv "Z" "foo" | |
107 # | |
108 | |
109 # create the user's dirs when they register | |
110 commands[register] = mkdir "%ruserdata/%n", | |
111 mkdir "%rttyrec/%n", | |
112 mkdir "%rttyrec/%n/rogue3", | |
113 mkdir "%rttyrec/%n/rogue4", | |
114 mkdir "%rttyrec/%n/rogue5", | |
115 mkdir "%rttyrec/%n/srogue", | |
116 mkdir "%rttyrec/%n/arogue5" | |
117 | |
118 commands[login] = mkdir "%ruserdata/%n", | |
119 mkdir "%rttyrec/%n", | |
120 mkdir "%rttyrec/%n/rogue3", | |
121 mkdir "%rttyrec/%n/rogue4", | |
122 mkdir "%rttyrec/%n/rogue5", | |
123 mkdir "%rttyrec/%n/srogue", | |
124 mkdir "%rttyrec/%n/arogue5" | |
125 | |
126 | |
127 | |
128 | |
129 | |
130 # Define the main menus. | |
131 # You _must_ define "mainmenu_anon" and "mainmenu_user". | |
132 # $VERSION and $SERVERID will be replaced, as per the bannerfile above. | |
133 | |
134 # First, the menu shown to anonymous user: | |
135 menu["mainmenu_anon"] { | |
136 bannerfile = "/dgldir/dgl_menu_main_anon.txt" | |
137 cursor = (5,18) | |
138 commands["l"] = ask_login | |
139 commands["r"] = ask_register | |
140 commands["w"] = watch_menu | |
141 commands["q"] = quit | |
142 } | |
143 | |
144 # Then the menu shown when the user has logged in: | |
145 # $USERNAME in here will be replaced with the user name. | |
146 menu["mainmenu_user"] { | |
147 # contents of this file are written to screen. | |
148 # the file must be inside the chroot. | |
149 bannerfile = "/dgldir/dgl_menu_main_user.txt" | |
150 # after which cursor is moved to this location | |
151 # if cursor-definition is missing, the cursor is put | |
152 # to the end of the last line of the banner. | |
153 # cursor = (5,18) | |
154 # keys we accept. format is | |
155 # commands["string_of_keys"] = <commandlist> | |
156 # for example, you could use commands["qQ"] = quit | |
157 commands["c"] = chpasswd | |
158 commands["e"] = chmail | |
159 commands["w"] = watch_menu | |
160 commands["3"] = play_game "RogV3" | |
161 commands["4"] = play_game "RogV4" | |
162 commands["5"] = play_game "RogV5" | |
163 commands["Ss"] = play_game "SRog" | |
164 commands["Aa"] = play_game "ARog5" | |
165 commands["q"] = quit | |
166 } | |
167 | |
168 # this menu is shown when user presses '?' in the watching menu | |
169 menu["watchmenu_help"] { | |
170 bannerfile = "/dgldir/dgl_menu_watchmenu_help.txt" | |
171 commands["qQ "] = return | |
172 } | |
173 | |
174 | |
175 # Next, we'll define one game's data: | |
176 | |
177 #DEFINE { | |
178 # # From inside the jail, the location of the binary to be launched. | |
179 # game_path = "/bin/nethackstub" | |
180 # | |
181 # # Full name of the game | |
182 # game_name = "NetHack stub" | |
183 # | |
184 # # Short name, used in the watching menu | |
185 # short_name = "NHstb" | |
186 # | |
187 # # arguments for when we exec the binary | |
188 # game_args = "/bin/nethackstub", | |
189 # "foo", | |
190 # "user:%n", | |
191 # "shed_uid:%u", | |
192 # "bar" | |
193 # | |
194 # # From inside the jail, where dgamelaunch should put mail. | |
195 # spooldir = "/var/mail/" | |
196 # | |
197 # # From inside the jail, the default .nethackrc that is copied for new users. | |
198 # # rc_template = "/dgl-default-rcfile" | |
199 # | |
200 # # Make sure the inprogress dir actually exists. default is "inprogress/" | |
201 # # Each game you define here must have it's own. | |
202 # inprogressdir = "%rinprogress-nethackstub/" | |
203 # | |
204 # # We can also define per-game commands, that are executed | |
205 # # when the game starts: | |
206 # # commands = chdir "/dgldir", mkdir "foo_%u_%g" | |
207 #} | |
208 | |
209 | |
210 #DEFINE { | |
211 # game_path = "/nh343/nethack" | |
212 # game_name = "NetHack 3.4.3" | |
213 # short_name = "NH343" | |
214 # | |
215 # game_args = "/nh343/nethack", "-u", "%n" | |
216 # | |
217 # spooldir = "/mail/" | |
218 # rc_template = "/dgl-default-rcfile.nh343" | |
219 # | |
220 # rc_fmt = "%ruserdata/%n/%n.nh343rc" | |
221 # | |
222 # inprogressdir = "%rinprogress-nh343/" | |
223 # | |
224 ## The place where ttyrecs are stored for this game. | |
225 ## If this is not defined, ttyrecs are not saved for this game. | |
226 ## Leaving this undefined also means the games cannot be spectated. | |
227 # ttyrecdir = "%ruserdata/%n/ttyrec/" | |
228 # | |
229 # | |
230 # # back up savefile | |
231 # commands = cp "/nh343/var/save/%u%n.gz" "/nh343/var/save/%u%n.gz.bak", | |
232 # # set NETHACKOPTIONS to point to the rcfile | |
233 # setenv "NETHACKOPTIONS" "@%ruserdata/%n/%n.nh343rc", | |
234 # # set up nethack mail stuff, assuming it's compiled with it... | |
235 # setenv "MAIL" "/mail/%n", | |
236 # setenv "SIMPLEMAIL" "1", | |
237 # # don't let the mail file grow | |
238 # unlink "/mail/%n" | |
239 #} | |
240 | |
241 # Rogue V3: short and simple, like the game | |
242 DEFINE { | |
243 game_path = "/bin/rogue3" | |
244 game_name = "Rogue V3 (3.6)" | |
245 short_name = "RogV3" | |
246 | |
247 game_args = "/bin/rogue3", "-n", "%n" | |
248 | |
249 inprogressdir = "%rinprogress-rogue3/" | |
250 ttyrecdir = "%rttyrec/%n/rogue3/" | |
251 | |
252 # Don't do anything with rcfiles. Rogue has none. | |
253 | |
254 # Back up the savefile, just in case | |
255 commands = cp "/var/games/roguelike/rogue3save/%u-%n.r3sav" "%rbackup/%u-%n.r3sav.bak" | |
256 } | |
257 | |
258 # Rogue V4: just like it, but a little different | |
259 DEFINE { | |
260 game_path = "/bin/rogue4" | |
261 game_name = "Rogue V4 (5.2)" | |
262 short_name = "RogV4" | |
263 | |
264 game_args = "/bin/rogue4", "-n", "%n" | |
265 inprogressdir = "%rinprogress-rogue4/" | |
266 ttyrecdir = "%rttyrec/%n/rogue4/" | |
267 | |
268 commands = cp "/var/games/roguelike/rogue4save/%u-%n.r4sav" "%rbackup/%u-%n.r4sav.bak" | |
269 } | |
270 | |
271 # Rogue V5: a little more different from both | |
272 DEFINE { | |
273 game_path = "/bin/rogue5" | |
274 game_name = "Rogue V5 (5.4)" | |
275 short_name = "RogV5" | |
276 | |
277 game_args = "/bin/rogue5", "-n", "%n" | |
278 inprogressdir = "%rinprogress-rogue5/" | |
279 ttyrecdir = "%rttyrec/%n/rogue5/" | |
280 | |
281 commands = cp "/var/games/roguelike/rogue5save/%u-%n.r5sav" "%rbackup/%u-%n.r5sav.bak" | |
282 } | |
283 | |
284 # Super-Rogue: different? | |
285 DEFINE { | |
286 game_path = "/bin/srogue" | |
287 game_name = "Super-Rogue" | |
288 short_name = "SRog" | |
289 | |
290 game_args = "/bin/srogue", "-n", "%n" | |
291 inprogressdir = "%rinprogress-srogue/" | |
292 ttyrecdir = "%rttyrec/%n/srogue/" | |
293 | |
294 commands = cp "/var/games/roguelike/sroguesave/%u-%n.srsav" "%rbackup/%u-%n.srsav.bak" | |
295 } | |
296 | |
297 # Advanced Rogue 5: not different? | |
298 DEFINE { | |
299 game_path = "/bin/arogue5" | |
300 game_name = "Advanced Rogue 5" | |
301 short_name = "ARog5" | |
302 | |
303 game_args = "/bin/arogue5", "-n", "%n" | |
304 inprogressdir = "%rinprogress-arogue5/" | |
305 ttyrecdir = "%rttyrec/%n/arogue5/" | |
306 | |
307 commands = cp "/var/games/roguelike/arogue5save/%u-%n.ar5sav" "%rbackup/%u-%n.ar5sav.bak" | |
308 } |