"game_args" { return TYPE_GAME_ARGS; }
"rc_fmt" { return TYPE_RC_FMT; }
commands { return TYPE_CMDQUEUE; }
+yes { yylval.i = 1; return TYPE_BOOL; }
+no { yylval.i = 0; return TYPE_BOOL; }
dglstart { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; }
login { yylval.i = DGLTIME_LOGIN; return TYPE_CMDQUEUENAME; }
register { yylval.i = DGLTIME_REGISTER; return TYPE_CMDQUEUENAME; }
%type <kt> KeyType
%token <i> TYPE_DGLCMD1 TYPE_DGLCMD2
%token TYPE_DEFINE_GAME
+%token <i> TYPE_BOOL
%%
free($3);
}
| KeyType '=' TYPE_MALSTRING {}
+ | KeyType '=' TYPE_BOOL {
+ switch ($1) {
+ case TYPE_ALLOW_REGISTRATION:
+ globalconfig.allow_registration = $<i>3;
+ break;
+ default:
+ fprintf(stderr, "%s:%d: token %s does not take a boolean, bailing out\n",
+ config, line, lookup_token($1));
+ exit(1);
+ }
+ }
| KeyType '=' TYPE_NUMBER {
globalconfig.shed_uid = (uid_t)-1;
globalconfig.shed_gid = $3;
break;
- case TYPE_ALLOW_REGISTRATION:
- globalconfig.allow_registration = $3;
- break;
-
case TYPE_MAX:
globalconfig.max = $3;
break;
# compiled with SQLite
maxusers = 64000
-# Allow registration of new nicks? (0 or 1)
-allow_new_nicks = 1
+# Allow registration of new nicks? (yes or no)
+allow_new_nicks = yes
# Max length for newly registered nicks. Must be less than 20.
# By default, NetHack only stores the first 10 chars of a name into