add MAXPLAYERS to SYSCF (trunk only)

Add MAXPLAYERS to SYSCF config file; deprecate (but continue to support)
 MAX_NR_OF_PLAYERS in nethack.sh since it is trivially overridden in many
 (all?) cases and isn't useful for ports that don't use nethack.sh.
This commit is contained in:
keni
2008-04-07 22:27:18 +00:00
parent 47d1eea0dd
commit 97abafd41a
7 changed files with 28 additions and 2 deletions

View File

@@ -2078,6 +2078,15 @@ int src;
if(sysopt.recover) free(sysopt.recover);
sysopt.recover = alloc(strlen(bufp));
(void) strcpy(sysopt.recover, bufp);
} else if ( (src==SET_IN_SYS) && match_varname(buf, "MAXPLAYERS", 10)) {
int temp = atoi(bufp);
/* XXX to get more than 25, need to rewrite all lock code */
if(temp > 0 && temp <= 25){
sysopt.maxplayers = temp;
} else {
raw_printf("Illegal value in MAXPLAYERS.");
return 0;
}
#endif
} else if (match_varname(buf, "BOULDER", 3)) {
(void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,

View File

@@ -14,5 +14,6 @@ sys_early_init(){
/* replace use of WIZARD vs WIZARD_NAME vs KR1ED, by filling this in */
#endif
sysopt.wizards = NULL;
sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
}