Allow admin to disable explore mode

Some public servers want to disable explore mode, so
make it configurable in sysconf.
This commit is contained in:
Pasi Kallinen
2015-03-31 18:14:10 +03:00
parent 8ee2d5976e
commit ca80675d59
8 changed files with 27 additions and 0 deletions

View File

@@ -509,6 +509,14 @@ enter_explore_mode(VOID_ARGS)
} else if (discover) {
You("are already in explore mode.");
} else {
#ifdef SYSCF
if (!sysopt.explorers ||
!sysopt.explorers[0] ||
!check_user_string(sysopt.explorers)) {
You("cannot access explore mode.");
return 0;
}
#endif
pline(
"Beware! From explore mode there will be no return to normal game.");
if (paranoid_query(ParanoidQuit,

View File

@@ -2184,6 +2184,9 @@ int src;
} else if (src == SET_IN_SYS && match_varname(buf, "SHELLERS", 8)) {
if (sysopt.shellers) free(sysopt.shellers);
sysopt.shellers = dupstr(bufp);
} else if (src == SET_IN_SYS && match_varname(buf, "EXPLORERS", 7)) {
if (sysopt.explorers) free(sysopt.explorers);
sysopt.explorers = dupstr(bufp);
} else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) {
if (sysopt.debugfiles) free(sysopt.debugfiles);
/* if showdebug() has already been called (perhaps we've added

View File

@@ -33,6 +33,7 @@ sys_early_init()
#endif
sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */
sysopt.shellers = NULL;
sysopt.explorers = NULL;
sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
/* record file */