--Update dgl-wall.c or fold the functionality into dgl itself.
- (see below)
-BUG: cannot quit watching until caught up with the stream.
-make default_fmode configurable, and add config
file command "chmod file mode"
-maybe allow changing the watching-screen &c layouts too?
-add commandline parameters to dgamelaunch:
dgamelaunch --chpasswd "nick" "newpass"
- dgamelaunch --wall "message to mail everyone"
- these are obviously only for the server admin...
--allow setting the default watch-screen sortmode in config file.
-some games (robotfindskitten?) are not worth saving into ttyrecs, make it configurable.
-allow configuring ttyplay.c; some games may use different clear-screen
commands. (see for example crawl)
"inprogressdir" { return TYPE_PATH_INPROGRESS; }
"game_args" { return TYPE_GAME_ARGS; }
"rc_fmt" { return TYPE_RC_FMT; }
+sortmode { return TYPE_WATCH_SORTMODE; }
commands { return TYPE_CMDQUEUE; }
yes { yylval.i = 1; return TYPE_BOOL; }
no { yylval.i = 0; return TYPE_BOOL; }
}
%token TYPE_SUSER TYPE_SGROUP TYPE_SGID TYPE_SUID TYPE_MAX TYPE_MAXNICKLEN
-%token TYPE_GAME_SHORT_NAME
+%token TYPE_GAME_SHORT_NAME TYPE_WATCH_SORTMODE
%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
globalconfig.chroot = strdup ($3);
break;
+ case TYPE_WATCH_SORTMODE:
+ {
+ int tmpi, okay = 0;
+ for (tmpi = 0; tmpi < NUM_SORTMODES; tmpi++)
+ if (!strcasecmp(SORTMODE_NAME[tmpi], $3 )) {
+ globalconfig.sortmode = tmpi;
+ okay = 1;
+ break;
+ }
+ if (!okay)
+ fprintf(stderr, "%s:%d: unknown sortmode '%s'\n", config, line, $3);
+ }
+ break;
case TYPE_PATH_DGLDIR:
if (globalconfig.dglroot) free(globalconfig.dglroot);
| TYPE_PATH_LOCKFILE { $$ = TYPE_PATH_LOCKFILE; }
| TYPE_PATH_INPROGRESS { $$ = TYPE_PATH_INPROGRESS; }
| TYPE_RC_FMT { $$ = TYPE_RC_FMT; }
+ | TYPE_WATCH_SORTMODE { $$ = TYPE_WATCH_SORTMODE; }
;
%%
case TYPE_PATH_INPROGRESS: return "inprogressdir";
case TYPE_GAME_ARGS: return "game_args";
case TYPE_RC_FMT: return "rc_fmt";
+ case TYPE_WATCH_SORTMODE: return "sortmode";
default: abort();
}
}
inprogressmenu (int gameid)
{
int i, menuchoice, len = 20, offset = 0, doresizewin = 0;
- static dg_sortmode sortmode = SORTMODE_NONE;
+ static dg_sortmode sortmode = NUM_SORTMODES;
time_t ctime;
struct dg_game **games;
char ttyrecname[130], *replacestr = NULL, gametype[10];
int is_nhext[14];
sigset_t oldmask, toblock;
+ if (sortmode == NUM_SORTMODES)
+ sortmode = globalconfig.sortmode;
+
games = populate_games (gameid, &len);
games = sort_games (games, len, sortmode);
char* passwd;
char* lockfile;
int allow_registration; /* allow registering new nicks */
+ int sortmode; /* default watching-screen sortmode */
struct dg_cmdpart *cmdqueue[NUM_DGLTIMES];
NUM_SORTMODES
} dg_sortmode;
-static const char *SORTMODE_NAME[] = {
+static const char *SORTMODE_NAME[NUM_SORTMODES] = {
"Unsorted",
"Username",
- "Idletime",
- "",
+ "Idletime"
};
if (!globalconfig.allow_registration) globalconfig.allow_registration = 1;
globalconfig.menulist = NULL;
+ globalconfig.sortmode = SORTMODE_NONE;
+
if (config)
{
if ((config_file = fopen(config, "r")) != NULL)
# the record/logfile.
maxnicklen = 10
+# Set the default watching-screen sorting mode. Can be one of
+# "unsorted", "username" or "idletime". Unsorted is the default.
+#sortmode = "username"
+
# Path to a prepared chroot jail.
chroot_path = "/var/lib/dgamelaunch/"