Commit Graph

34 Commits

Author SHA1 Message Date
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
nhmall
98976b3141 Merge branch 'NetHack-3.6' 2019-12-18 07:38:59 -05:00
nhmall
5f0d06fb80 update and simplify the windows portable_device_paths sysconf option
Requires a sysconf file in the windows executable directory in order to work
2019-12-17 23:16:44 -05:00
nhmall
5d4208cd15 Merge branch 'NetHack-3.6' 2019-12-17 12:01:49 -05:00
nhmall
ac6e13fd7a allow run-from-removable-device configuration on Windows
Allow a way to configure NetHack to run entirely from a USB stick
or other removable device in a way that allows everything to
reside entirely on the USB stick, and nothing on the computer's
hard drive. That could be done in versions prior to 3.6.3.

Sample:

i: is a USB stick

i:\nhdist contains the NetHack Windows distribution and a sysconf
file dropped into that distribution with the following entry in it:
	portable_device_top = nethack

No device is included in the portable_device_top entry, the device
is always the device that the nethack exe resides on. If you try
to specify a device in the portable_device_top path, the device
portion will be ignored.

portable_device_top specifies the folder on the device that is writable
by NetHack and as such it cannot be the same folder that the executable
resides in.

i:\nhdist\nethack --showpaths
Variable playground locations:
    [hackdir   ]="i:\nethack\"
    [leveldir  ]="i:\nethack\"
    [savedir   ]="i:\nethack\"
    [bonesdir  ]="i:\nethack\"
    [datadir   ]="i:\nhdist\"
    [scoredir  ]="i:\nethack\"
    [lockdir   ]="i:\nethack\"
    [sysconfdir]="i:\nhdist\"
    [configdir ]="i:\nethack\"
    [troubledir]="i:\nethack\"
NetHack's system configuration file (in sysconfdir):
    "i:\nhdist\sysconf"
The loadable symbols file (in sysconfdir):
    "i:\nhdist\symbols"
Basic data files (in datadir) are collected inside:
    "i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Writable folder for portable device config (sysconf portable_device_top):
    "i:\nethack\"
Your personal configuration file (in configdir):
    "i:\nethack\.nethackrc"

Without that sysconf file in the NetHack distribution folder on the
USB stick with the 'portable_device_top = '  entry, the paths
return to the default locations for 3.6.3 on Windows:

i:\nhdist\nethack --showpaths
Variable playground locations:
    [hackdir   ]="C:\Users\JaneDoe\NetHack\3.6\"
    [leveldir  ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
    [savedir   ]="C:\Users\JaneDoe\AppData\Local\NetHack\3.6\"
    [bonesdir  ]="C:\ProgramData\NetHack\3.6\"
    [datadir   ]="i:\nhdist\"
    [scoredir  ]="C:\ProgramData\NetHack\3.6\"
    [lockdir   ]="C:\ProgramData\NetHack\3.6\"
    [sysconfdir]="C:\ProgramData\NetHack\3.6\"
    [configdir ]="C:\Users\JaneDoe\NetHack\"
    [troubledir]="C:\Users\JaneDoe\NetHack\3.6\"
NetHack's system configuration file (in sysconfdir):
    "C:\ProgramData\NetHack\3.6\sysconf"
The loadable symbols file (in sysconfdir):
    "C:\ProgramData\NetHack\3.6\symbols"
Basic data files (in datadir) are collected inside:
    "i:\nhdist\nhdat363"
No end-of-game disclosure file (disabled).
Your personal configuration file (in configdir):
    "C:\Users\JaneDoe\NetHack\.nethackrc"
2019-12-17 00:41:55 -05:00
nhmall
34d38dcf82 Merge branch 'NetHack-3.6' 2019-10-28 00:45:56 -04:00
nhmall
a399151d01 some symbol tweaks
A few symbol-related modifications:

- fulfill a request from a blind player to allow them to
  specify a unique/recognizable character for all pets and/or
  the player in the config file for use when using a screen
  reader (S_player_override, S_pet_override). Requires sysconf
  setting ACCESSIBILITY to be set to have an effect, although
  they can still be specified in the config file.

- Config file SYMBOLS entries were not working properly on
  the rogue level. Allow ROGUESYMBOLS as well as SYMBOLS to be
  specified in the config file independently.

- When values are moved into showsyms[], the overriding SYMBOLS
  or ROGUESYMBOLS entry from the config file is used if there is
  one; if there is no overriding value for a particular symbol,
  the loaded symset value is used; if there is no symset entry
  loaded for the symbol then a default symbol is used.
2019-10-27 23:12:11 -04:00
nhmall
7054e06e42 NetHack minor release checklist items - savefiles
Make some progress on a couple of next minor release checklist
items, hopefully without introducing too many new bugs. This
is just the initial commit, and work continues.

Checklist items:

Savefiles compatible between Windows versions, whether 64-bit
or 32-bit in little-endian field format.

Selection of file formats:
 historical (structlevel saves),
 lendian (little-endian, fieldlevel saves),
 and just for proof-of-concept, ascii fieldlevel saves
 (the ascii is huge! 10x bigger than little-endian).

For the fieldlevel save, all complex data structures recursively
get broken down until until it is one of the simple types that
can't be broken down any further, and that gets when it gets
written to the output file.

New files needed for this build:

hand-coded:
include/sfprocs.h
src/sfbase.c      - really a dispatcher to one of the
                    output/input format routines.
src/sflendian.c   - little-endian output writer/reader.
src/sfascii.c     - ascii text output writer/reader.

auto-coded (generated):
include/sfproto.h
src/sfdata.c

This is just one approach. I'm sure there are countless others
and they have different pros and cons.

For producing the auto-coded files a utility called
universal-ctags, that is actively maintained and evolving,
was used to do all the heavy-lifting of parsing the
NetHack C sources to tabulate the data fields, and store
them in an intermediate file called util/nethack.tags
(not required for building NetHack if you already have a
generated include/sfproto.h and src/sfdata.c)

util/readtags (also not required for building NetHack
itself) will decipher the nethack.tags file and produce
the functions that can deal with the NetHack struct data
fields.

You can obtain the source for universal-ctags by cloning it
from here:
https://github.com/universal-ctags/ctags.git

The combination universal-ctags + util/readtags has been
tried and tested under both Windows and Linux, so it is
not tied to a particular platform.

Note: util/readtags will work only with universal-ctags
output, so other ctags are unlikely to work as-is.
Universal-ctags can be build from source very easily
under Linux, or under Windows using visual studio.
2019-06-23 00:11:46 -04:00
Pasi Kallinen
1eca824321 Add sysconf BONES_POOLS to allow more bones-files per level
Reduce the chance of a player playing on a public server encountering
their own bones, by implementing separate bones pools. The pool a player
belongs to is determined at game start, and only bones in that pool
are used. The sysconf BONES_POOLS allows the sysadmin to define how
many pools there are.
2017-08-20 23:04:59 +03:00
Pasi Kallinen
7d8b4d4f97 Add end-of-game dumplogs
This is based on the "new" dumplog patch for 3.6.0, by Maxime Bacoux.

Define DUMPLOG to enable. By default only enabled for the TTY linux.
2017-02-19 15:33:27 +02:00
Pasi Kallinen
942ee14d0f Move generic usernames to sysconf 2016-06-13 11:01:05 +03:00
Pasi Kallinen
fe006b9c0a Add CHECK_PLNAME to sysconf
Setting CHECK_PLNAME to 1 makes WIZARDS, EXPLORERS, and SHELLERS
check the player name instead of the user's login name.

This is mostly useful for public servers which have external
login system and don't create user accounts for players.
2016-02-05 20:39:17 +02:00
PatR
9f6f3f5180 PANICTRACE option parsing
Fix the situation where disabling PANICTRACE, which happened implicitly
when BETA  got disabled, caused SYSCF option processing to complain and
quit if the 'sysconf' file contained any PANICTRACE settings.

Now accept all the PANICTRACE options (assuming SYSCF is defined) even
if PANICTRACE is not defined.  Their values are recorded in the 'sysopt'
struct, but only validated when the appropriate macros (PANICTRACE,
PANICTRACE_LIB) are defined.
2015-12-04 22:18:17 -08:00
PatR
3edfcffccc SYSCF WIZARDS
Preformat SYSCF entry 'WIZARDS' so that it can be displayed during panic
feedback without allocating memory for the formatted list at that time.
It also gets displayed for help's "support information" ('?k').

For panic(), push "it may be possible to rebuild" to a second line since
the formatted usernames might make the line long.
2015-11-22 17:23:11 -08:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
8b57d96fd2 Reformat .h files.
I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.

The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.
2015-05-25 09:21:15 +09:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Pasi Kallinen
eb77c57a6c Allow disabling savefile UID checking in sysconf 2015-04-11 21:07:57 +03:00
Pasi Kallinen
ca80675d59 Allow admin to disable explore mode
Some public servers want to disable explore mode, so
make it configurable in sysconf.
2015-03-31 18:14:16 +03:00
PatR
562fa952ce allow DEBUGFILES to be overridden via getenv()
If getenv("DEBUGFILES") yields a value then it takes precedence over
sysconf.DEBUGFILES or sys.c's #define DEBUGFILES.  (It probably should
only be controlled via environment since it is not a system-wide
attribute, but I haven't taken out the SYSCF handling for it.)
2015-03-16 15:54:10 -07:00
PatR
a983a58b6a free 'sysopt' strings upon termination 2015-03-16 02:03:40 -07:00
Pasi Kallinen
a335f8306f Add MAX_STATUENAME_RANK sysconf setting
MAX_STATUENAME_RANK tells how many score file entries to use
for random statue names.
2015-03-11 19:59:52 +02:00
Sean Hunt
6e9fa71b05 Make SEDUCE unconditional. 2015-02-27 19:33:48 -05:00
Pasi Kallinen
612852f7de Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.
Move debugging output into couple preprocessor defines, which
    are no-op without DEBUG.  To show debugging output from a
    certain source files, use sysconf:

    DEBUGFILES=dungeon.c questpgr.c

    Also fix couple debug lines which did not compile.

This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
2015-02-27 19:33:45 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
keni
1d219b4e1b SYSCF bits
(This covers some thing that Pat found and some things I found while working
on those.)
Unscramble duplicate use of GREPPATH and GDBPATH symbols.
Add some more info to config.h.
Make missing SYSCF_FILE a fatal error.
Make a parse error in SYSCF_FILE a fatal error.
Rename PANICTRACE_GLIBC (et al) to PANICTRACE_LIBC (et al) since FreeBSD
 and Mac OS X (at least) also implement the needed API.
Allow SYSCF_FILE to be unreadable by the user (for setgid installs).
If SYSCF, do NOT fall back to the compiled in WIZARD account.
Put WIZARD into sysopt and remove special cases in authorize_wizard_mode().
2012-01-27 20:15:31 +00:00
keni
bd1a922dae Guidebook update and SEDUCE runtime switch
add SYSCF docs to the Guidebook because it's info needed in a binary distro
Guidebook.tex - also add some missing italics to some "NetHack" occurances
call nethack.org "official"
Guidebook.txt - didn't regenerate cleanly so no diff
add SEDUCE to SYSCF (only partly inspired by the recent email)
2010-05-13 00:54:13 +00:00
keni
9cd309157b make grep's path adjustable for PANICTRACE + more bits
Mac OS X doesn't have /bin/grep, only /usr/bin/grep.  Grr.
Don't try to parse PANICTRACE_GLIBC if the field doesn't exist.
2010-01-17 19:36:16 +00:00
keni
d80fcaada4 PANICTRACE (stacktrace on panic or signal) + bits
On crash signal or panic(), use a configurable method to get a stacktrace
the user can easily report to us.  Currently only for Unix/Linux and only
ifdef BETA.  Hopefully ports can add additional methods.

Bits:
- linux hints file had PREFIX definition in the wrong place
- sample sysconf file used wrong delimiter for WIZARDS
- fix grammar error in support message when using sysconf.wizards
- options.c comment typo
- capitalize "Crash test" output from #panic command
2010-01-15 19:54:37 +00:00
keni
df20791e59 Add RCS version lines 2009-05-06 10:45:32 +00:00
keni
8593cf6547 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.
2009-05-03 14:08:15 +00:00
keni
b5d05b2bca SHELLERS for SYSCF, MacOS 10.5 hints file (trunk only)
Add SHELLERS - people allowed to use ! command with same syntax as WIZARDS.
Add new hints file for 10.5, since the rules and commands for groups changed
(new commands introduced in 10.4, old ones removed in 10.5; creating a new
user under 10.4 gave you a matching group, in 10.5 it doesn't).  Also move
shared build into roughly right place in file system when being installed
for root - don't use ~root.
Makefile.top - don't remove ./-p unless it exists (that's always annoyed me).
fix error invoking macosx.sh
2008-06-14 20:57:21 +00:00
keni
97abafd41a 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.
2008-04-07 22:27:18 +00:00
keni
6f0e178368 more SYSCF and related bits - cleanup and features
infrastructure for "system options" - things currently specified at build
 time that should be changeable at install time or run time but not really
 under user control
generalize contact info so it can be localized and it doesn't have to be
 an email address
move recently introduced WIZARDS into sysopt
drop bogus OPTIONS=wizards possibility
new function build_english_list() to comma-ize and add 'or' from a whitespace separated list: A.  A or B.  A, B, or C.
syscf file now handles: WIZARDS SUPPORT RECOVER
 SUPPORT specifies local support information
 RECOVER will eventually supply port-specific and/or localized info on how
  to run recover (or get it run for you).
Note: in sys/msdos I changed sys.o (generated from pcsys.c) to pcsys.o
Note: sys/msdos/Makefile.GCC has 2 rules for sys.o (now pcsys.o)
2008-01-31 00:56:59 +00:00