"inprogressdir" { return TYPE_PATH_INPROGRESS; }
"game_args" { return TYPE_GAME_ARGS; }
"rc_fmt" { return TYPE_RC_FMT; }
+server_id { return TYPE_SERVER_ID; }
sortmode { return TYPE_WATCH_SORTMODE; }
commands { return TYPE_CMDQUEUE; }
yes { yylval.i = 1; return TYPE_BOOL; }
}
%token TYPE_SUSER TYPE_SGROUP TYPE_SGID TYPE_SUID TYPE_MAX TYPE_MAXNICKLEN
-%token TYPE_GAME_SHORT_NAME TYPE_WATCH_SORTMODE
+%token TYPE_GAME_SHORT_NAME TYPE_WATCH_SORTMODE TYPE_SERVER_ID
%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
}
break;
+ case TYPE_SERVER_ID:
+ if (globalconfig.server_id) free(globalconfig.server_id);
+ globalconfig.server_id = strdup($3);
+ break;
+
case TYPE_PATH_DGLDIR:
if (globalconfig.dglroot) free(globalconfig.dglroot);
globalconfig.dglroot = strdup($3);
| TYPE_PATH_INPROGRESS { $$ = TYPE_PATH_INPROGRESS; }
| TYPE_RC_FMT { $$ = TYPE_RC_FMT; }
| TYPE_WATCH_SORTMODE { $$ = TYPE_WATCH_SORTMODE; }
+ | TYPE_SERVER_ID { $$ = TYPE_SERVER_ID; }
;
%%
case TYPE_GAME_ARGS: return "game_args";
case TYPE_RC_FMT: return "rc_fmt";
case TYPE_WATCH_SORTMODE: return "sortmode";
+ case TYPE_SERVER_ID: return "server_id";
default: abort();
}
}
strncpy(bufnew, buf, 80);
strncpy(bufnew, bannerstrmangle(bufnew, "$VERSION", PACKAGE_STRING), 80);
+ strncpy(bufnew, bannerstrmangle(bufnew, "$SERVERID", globalconfig.server_id ? globalconfig.server_id : ""), 80);
if (me && loggedin) {
strncpy(bufnew, bannerstrmangle(bufnew, "$USERNAME", me->username), 80);
+ } else {
+ strncpy(bufnew, bannerstrmangle(bufnew, "$USERNAME", "[Anonymous]"), 80);
}
ban->lines[ban->len - 1] = strdup(bufnew);
char* lockfile;
int allow_registration; /* allow registering new nicks */
int sortmode; /* default watching-screen sortmode */
+ char *server_id; /* string for the server name or whatever */
struct dg_cmdpart *cmdqueue[NUM_DGLTIMES];
if (!globalconfig.allow_registration) globalconfig.allow_registration = 1;
globalconfig.menulist = NULL;
+ globalconfig.server_id = NULL;
globalconfig.sortmode = SORTMODE_NONE;
# From inside the jail, dgamelaunch's working directory for rcfiles/ttyrec/etc
dglroot = "/dgldir/"
+# Server ID string
+server_id = "nethack.alt.org - http://nethack.alt.org/"
+
# From inside the jail, location of a banner file, the topmost line will be
# shown in submenus that cannot be defined separately.
-# string $VERSION will be replaced with "dgamelaunch v" + dgl version number.
+# Some string substitution is done for the file:
+# $VERSION replaced with "dgamelaunch v" + dgl version number.
+# $SERVERID replaced with the server_id string, as defined above.
banner = "/dgl-banner"
# The following two options are fairly insecure. They will force us to
# define the main menus. you _must_ define "mainmenu_anon"
# and "mainmenu_user".
-# $VERSION will be replaced with dgl version string, as
-# in the bannerfile above.
+# $VERSION and $SERVERID will be replaced, as per the bannerfile above.
# first, the menu shown to anonymous user:
menu["mainmenu_anon"] {
bannerfile = "dgl_menu_main_anon.txt"