diff --git a/config.l b/config.l index 003d91a..d0bfaa8 100644 --- a/config.l +++ b/config.l @@ -69,8 +69,6 @@ COMMENT ^#.* "game_name" { return TYPE_NAME_GAME; } "short_name" { return TYPE_GAME_SHORT_NAME; } "game_path" { return TYPE_PATH_GAME; } -"chdir" { return TYPE_PATH_CHDIR; } -"mkdir" { return TYPE_PATH_MKDIR; } "dglroot" { return TYPE_PATH_DGLDIR; } "spooldir" { return TYPE_PATH_SPOOL; } "banner" { return TYPE_PATH_BANNER; } @@ -85,11 +83,11 @@ dglstart { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; } login { yylval.i = DGLTIME_LOGIN; return TYPE_CMDQUEUENAME; } register { yylval.i = DGLTIME_REGISTER; return TYPE_CMDQUEUENAME; } game_start { yylval.i = DGLTIME_GAMESTART; return TYPE_CMDQUEUENAME; } -cmdmkdir { yylval.i = DGLCMD_MKDIR; return TYPE_DGLCMD1; } -cmdchdir { yylval.i = DGLCMD_CHDIR; return TYPE_DGLCMD1; } -cmdcp { yylval.i = DGLCMD_CP; return TYPE_DGLCMD1; } -cmdunlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; } -cmdsetenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; } +mkdir { yylval.i = DGLCMD_MKDIR; return TYPE_DGLCMD1; } +chdir { yylval.i = DGLCMD_CHDIR; return TYPE_DGLCMD1; } +cp { yylval.i = DGLCMD_CP; return TYPE_DGLCMD2; } +unlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; } +setenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; } DEFINE { return TYPE_DEFINE_GAME; } diff --git a/config.y b/config.y index 661d5a1..acf98ad 100644 --- a/config.y +++ b/config.y @@ -33,7 +33,7 @@ static const char* lookup_token (int t); } %token TYPE_SUSER TYPE_SGROUP TYPE_SGID TYPE_SUID TYPE_MAX TYPE_MAXNICKLEN -%token TYPE_PATH_CHDIR TYPE_PATH_MKDIR TYPE_GAME_SHORT_NAME +%token TYPE_GAME_SHORT_NAME %token TYPE_ALLOW_REGISTRATION %token TYPE_PATH_GAME TYPE_NAME_GAME TYPE_PATH_DGLDIR TYPE_PATH_SPOOL %token TYPE_PATH_BANNER TYPE_PATH_CANNED TYPE_PATH_CHROOT @@ -270,16 +270,6 @@ game_definition : TYPE_CMDQUEUE myconfig[ncnf]->shortname = strdup($3); break; - case TYPE_PATH_CHDIR: - if (myconfig[ncnf]->chdir) free(myconfig[ncnf]->chdir); - myconfig[ncnf]->chdir = strdup ($3); - break; - - case TYPE_PATH_MKDIR: - if (myconfig[ncnf]->mkdir) free(myconfig[ncnf]->mkdir); - myconfig[ncnf]->mkdir = strdup ($3); - break; - case TYPE_RC_FMT: if (myconfig[ncnf]->rc_fmt) free(myconfig[ncnf]->rc_fmt); myconfig[ncnf]->rc_fmt = strdup($3); @@ -391,8 +381,6 @@ KeyType : TYPE_SUSER { $$ = TYPE_SUSER; } | TYPE_PATH_GAME { $$ = TYPE_PATH_GAME; } | TYPE_NAME_GAME { $$ = TYPE_NAME_GAME; } | TYPE_GAME_SHORT_NAME { $$ = TYPE_GAME_SHORT_NAME; } - | TYPE_PATH_CHDIR { $$ = TYPE_PATH_CHDIR; } - | TYPE_PATH_MKDIR { $$ = TYPE_PATH_MKDIR; } | TYPE_PATH_DGLDIR { $$ = TYPE_PATH_DGLDIR; } | TYPE_PATH_SPOOL { $$ = TYPE_PATH_SPOOL; } | TYPE_PATH_BANNER { $$ = TYPE_PATH_BANNER; } @@ -417,8 +405,6 @@ const char* lookup_token (int t) case TYPE_MAX: return "maxusers"; case TYPE_MAXNICKLEN: return "maxnicklen"; case TYPE_PATH_CHROOT: return "chroot_path"; - case TYPE_PATH_CHDIR: return "chdir"; - case TYPE_PATH_MKDIR: return "mkdir"; case TYPE_PATH_GAME: return "game_path"; case TYPE_NAME_GAME: return "game_name"; case TYPE_ALLOW_REGISTRATION: return "allow_new_nicks"; diff --git a/dgamelaunch.c b/dgamelaunch.c index a6ce475..9e44d88 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -2106,17 +2106,21 @@ main (int argc, char** argv) myconfig[userchoice]->bin_args[i] = tmp; } + /* if (myconfig[userchoice]->mkdir) { tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->mkdir)); free(myconfig[userchoice]->mkdir); myconfig[userchoice]->mkdir = tmp; } + */ + /* if (myconfig[userchoice]->chdir) { tmp = strdup(dgl_format_str(userchoice, me, myconfig[userchoice]->chdir)); free(myconfig[userchoice]->chdir); myconfig[userchoice]->chdir = tmp; } + */ /* launch program */ ttyrec_main (userchoice, me->username, gen_ttyrec_filename()); diff --git a/dgamelaunch.h b/dgamelaunch.h index 24abfee..62525e7 100644 --- a/dgamelaunch.h +++ b/dgamelaunch.h @@ -67,8 +67,6 @@ struct dg_config char* game_path; char* game_name; char* shortname; - char* chdir; - char* mkdir; char* rcfile; char* spool; /*char* savefilefmt;*/ diff --git a/dgl-common.c b/dgl-common.c index f13b609..7e30492 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -22,8 +22,8 @@ struct dg_config defconfig = { /* game_path = */ "/bin/nethack", /* game_name = */ "NetHack", /* shortname = */ "NH", - /* chdir = */ NULL, - /* mkdir = */ NULL, + /* chdir = */ /*NULL,*/ + /* mkdir = */ /*NULL,*/ /* dglroot = *//* "/dgldir/",*/ /* lockfile = */ /*"/dgl-lock",*/ /* passwd = */ /*"/dgl-login",*/ diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index f4e91c4..f080b69 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -165,7 +165,6 @@ game_path = "/bin/crawlss017" game_name = "Crawl Stone Soup 0.1.7" short_name = "Cr017" -chdir = "/crawlss017/" game_args = "/bin/crawlss017" game_args = "-name" @@ -197,8 +196,6 @@ game_path = "/bin/crawlss020" game_name = "Crawl Stone Soup 0.2.0" short_name = "Cr020" -mkdir = "/crawlss020/plr/%n" -chdir = "/crawlss020/" game_args = "/bin/crawlss020" game_args = "-name" diff --git a/ttyrec.c b/ttyrec.c index c4a3b95..45ffb99 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -271,11 +271,13 @@ doshell (int game, char *username) (void) dup2 (slave, 2); (void) close (slave); + /* if (myconfig[game]->mkdir) (void) mkdir(myconfig[game]->mkdir, 0755); if (myconfig[game]->chdir) (void) chdir(myconfig[game]->chdir); + */ execvp (myconfig[game]->game_path, myconfig[game]->bin_args);