Add recordfile control to SYSCF.
Add sys/unix/sysconf, a sample sysconf file. Move defines from topten.c to config.h so they can be seen globally. Add persmax, pers_is_uid, entrymax, and pointsmin to struct sysopt, use in topten.c, populate in files.c Warning cleanup in files.c. BUGFIX: don't crash in unixmain.c if WIZARDS left unspecified. hints/macosx10.5: don't hardcode "keni"; install sample sysconf; install sample ~/nethackrc makedefs: add "system configuration" to compiled-with options list. BUGFIX: if a game doesn't meet the criteria for making the record file it's shown to the user as having zero points because t1->points is set to zero to indicate that it doesn't get written back; display u.urexp instead.
This commit is contained in:
@@ -31,6 +31,9 @@ If you are using the traditional configuration system, see Install.unx.
|
||||
4. Install:
|
||||
Depending on your configuration, this step may or may not need to be done
|
||||
as root; check the hints file.
|
||||
NB: "make install" deletes nethackdir and recreates it from scratch - so
|
||||
if you want the record, logfile, or sysconf files, you must save and
|
||||
restore them manually.
|
||||
cd $Top
|
||||
make install
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ endif
|
||||
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
|
||||
# - 'make install' must be run as "sudo make install"
|
||||
#WANT_SHARE_INSTALL=1
|
||||
GAMEUID = keni
|
||||
GAMEUID = $(USER)
|
||||
GAMEGRP = games
|
||||
|
||||
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
|
||||
@@ -128,9 +128,10 @@ endif
|
||||
VARFILEPERM = 0664
|
||||
VARDIRPERM = 0775
|
||||
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
|
||||
# XXX it's nice we don't write over sysconf, but we've already erased it
|
||||
# make sure we have group GAMEUID and group GAMEGRP
|
||||
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
|
||||
POSTINSTALL= touch $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf
|
||||
POSTINSTALL= cp -n sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf
|
||||
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
|
||||
else
|
||||
PREFIX:=$(wildcard ~)
|
||||
@@ -142,7 +143,8 @@ GAMEPERM = 0700
|
||||
VARFILEPERM = 0600
|
||||
VARDIRPERM = 0700
|
||||
ifdef WANT_WIN_X11
|
||||
# XXX install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
|
||||
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
|
||||
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
37
sys/unix/sysconf
Normal file
37
sys/unix/sysconf
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# NetHack 3.5 sysconf $Date$ $Revision$
|
||||
#
|
||||
# Sample sysconf file.
|
||||
# The sysconf file is only used if NetHack is compiled with SYSCF defined.
|
||||
# This file uses the same syntax as nethack.cf.
|
||||
|
||||
# Which users can use WIZARD (debugging) mode (the -D flag).
|
||||
# A value of * allows anyone to enter debugging mode.
|
||||
WIZARDS=root,games
|
||||
|
||||
# Users allowed to use the ! (shell escape) command. Uses the same syntax
|
||||
# as the WIZARDS option above.
|
||||
#SHELLERS=
|
||||
|
||||
# Limit the number of simultaneous games (see also and nethack.sh).
|
||||
MAXPLAYERS=10
|
||||
|
||||
# If not null, added to string "To get local support, " in the support
|
||||
# information help.
|
||||
#SUPPORT=call Izchak at extension 42.
|
||||
|
||||
# If not null, displayed at the end of a panic-save sequence.
|
||||
#RECOVER=Run the recover program.
|
||||
|
||||
# Record (high score) file options.
|
||||
# CAUTION: changing these after people have started playing games can
|
||||
# lead to lost high scores!
|
||||
# Maximum entries for one persion.
|
||||
#PERSMAX=10
|
||||
# Maximum entries in the record file.
|
||||
#ENTRYMAX=100
|
||||
# Minimum points to get an entry.
|
||||
#POINTSMIN=1
|
||||
# Determine identity of "person" in the score file with name (0) or
|
||||
# numeric (1) user id.
|
||||
#PERS_IS_UID=1
|
||||
@@ -549,7 +549,7 @@ authorize_wizard_mode()
|
||||
#ifdef WIZARD
|
||||
struct passwd *pw = get_unix_pw();
|
||||
#ifdef SYSCF
|
||||
if (pw && sysopt.wizards[0]) {
|
||||
if (pw && sysopt.wizards && sysopt.wizards[0]) {
|
||||
if(check_user_string(sysopt.wizards)) return TRUE;
|
||||
} else
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user