Commit Graph

956 Commits

Author SHA1 Message Date
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
f3b1cc74c6 Set max players in sysconf, not in the shell script 2016-12-14 16:49:52 +02:00
Pasi Kallinen
17e13f1e53 X11: Handle define-lines in NetHack.ad
xrdb can load a X recource file with #define-lines, but NetHack
cannot. Substitute the defines in Makefile during compile.

Requires grep
2016-10-14 16:50:25 +03:00
PatR
5e0cf04b04 update sys/unix/hints/macosx10.10
On OSX, one of the XQuartz header files triggers a compiler warning
about using a gcc extension, resulting in a diagnostic for each of
the files compiled with the WANT_WIN_X11 set of CFLAGS.  Use the
same fix as hints/macosx10.8 already does.
2016-07-30 01:59:27 -07:00
PatR
d69f0787be add '(uchar)' casts to ctype calls
This is from the pull request for the assertion failure fix.  It
did not mention how to reproduce the assertion failure, just added
casts to a bunch of isspace/isprint/tolower calls that didn't already
have such.

I removed an obsolete change for win/tty/topl.c and changed the
win/win32/mswproc.c code to avoid using an expression with side-effects
(*colorstring++) in calls to tolower() in case someone overrides that
with a macro which evaluates its argument more than once as some pre-
ANSI ones used to do.  Not tested, might have typos....

sys/wince/*.c still needs similar casts.
2016-07-19 05:40:09 -07:00
Pasi Kallinen
5f35d49105 X11: Make statue tiles look like grayscale monsters 2016-06-23 09:44:07 +03:00
Pasi Kallinen
942ee14d0f Move generic usernames to sysconf 2016-06-13 11:01:05 +03:00
PatR
4ff8d8ac7e fix #H4060 - sysconf is re-read if no config file
Config file handling remembers the name of the last config file
read in order for options processing to use it in messages, but
it was also reused as default config file name if user-supplied
config file name failed access() test.  So the SYSCF file became
the default user config file after it was used.  The config file
handling was a real mess.

This patch fixes it for Unix but there is a lot of scope for
typos in the changes for other platforms.  Testing is needed.
2016-06-12 17:52:12 -07:00
PatR
9c6e5a0563 dat/keyhelp for vms
Update vms/install.com (rather than Makefile.top) to install the new
data file for the 'whatdoes' command.

Also, the 3.6.0 distribution puts version number 3.5.0 into vms
binaries (all the programs, not just nethack itself).  It's something
observable with native tools without running the program, nothing to
do with nethack's 'v' command which gets its version number from
patchlevel.h via makedefs.
2016-06-05 06:33:42 -07:00
PatR
4ef23c6ac4 'whatdoes' command and new file: dat/keyhelp
Make the whatdoes ('&' or '?f') command support the 'altmeta' option
for meta-characters generated by two character seqeunce 'ESC char'.
Also, make it be more descriptive when reporting "no such command"
by including the numeric value it operated on when failing to match
any command.  That might provide a way for us to get some extra
information when players report problems with odd keystrokes:  we ask
them to type such at the "what command?" prompt and then tell us what
numbers come up.

It's been given a help file to deal with assorted idiosyncracies
which can come up when querying what keys do.  Unfortunately that
ended up being way more verbose than intended.

Installation of the extra data file has only been done for Unix.
Other platforms will get "can't open file" if they respond with
'&' or '?' to the "what command?" prompt.  The command will still
work though, just without the extra text.
2016-06-05 01:09:52 -07:00
PatR
d63ff7700d fix #H4287 - inconsistent handling of CPPFLAGS
[Subject should mention Unix, but would exceed 50 characters.]

Explicit build rules ignore $(CPPFLAGS), but the implicit C rule
(at least in GNU make) specifies it.  If user has a value for this
in the environment, that value would apply to building some source
files but not others.  This patch gives it an explicit empty value,
so building via implicit rule should expand it to nothing and match
the fact that it's omitted from explicit rules.

There was one C++ file which relied on the implicit C++ rule.  I've
added it to the files processed by 'make depend' and re-run that.
It now will get built via an explicit rule.

Also, a small amount of reformatting for HACKCSRC.
2016-04-01 16:49:49 -07:00
PatR
ca979cbc2b REPRODUCIBLE_BUILD, part 2
Other half of the Debian reproducible-builds patch.  For Unix
Makefile.top, explicitly set locale to generic 'C' when running
'dlb' during install, so that wildcard expansion will yield a
predictable ordering regardless of collation order specified by
the local enviroenment.  Otherwise contents of the 'nhdat'
container might be different--when viewed as a single data file
itself--during subsequent rebuild even when no changes to source
or data have been made and each module inside remains the same.

This assumes that locale doesn't matter during generation of any
of the data files (whether destined for dlb or not).  I don't
think the utility programs attempt any sorting on the fly or
other locale-dependent output but wouldn't swear to that....
2016-03-31 18:09:59 -07:00
Haoyang Wang
f81543aa4f MacOS 10.11.3 now requires the exec bits to be set on macosx.sh 2016-03-28 02:36:43 -07:00
PatR
105fd0a9a2 fix #H4286 - race condition during Unix build
Update sys/unix/Makefile.src to force it to build monst.o and
objects.o before attempting to build makedefs, so that building
the latter doesn't use the rules for those two object files in
Makefile.utl.  Prior to this, if 'make' was building multiple
targets in parallel monst.o and/or objects.o might be clobbered
when a process using util/Makefile tries to build them while its
parent is also building them via src/Makefile.

This includes a bit of reformatting which wasn't present in
yesterday's email attachment.
2016-03-27 16:50:38 -07:00
nhmall
4aec98ce9c missed a file MSDOS 2016-03-07 08:36:24 -05:00
nhmall
78857961d2 some of Ray Chason's MSDOS and other fixes 2016-03-05 14:44:50 -05:00
PatR
552b73b3f0 sys/unix/hints/macosx.sh permissions 2016-02-19 17:07:13 -08:00
PatR
9cc20d66ac OSX sysconf bit
Prefer macports gdb over Xcode gdb.  No effect if macports gdb isn't
installed or if user's sysconf doesn't set PANICTRACE_GDB to 1 or 2.
2016-02-17 14:20:56 -08:00
PatR
cd932656ff sys/share/lev_yacc.c 2016-02-17 14:10:36 -08:00
PatR
87edc53f31 sys/share/ dgn_comp and lev_comp code 2016-02-13 18:00:44 -08:00
PatR
860e7ee9c6 unix/hints/macosx10.8
10.8 is different from 10.7 (major change for X11) and from 10.10
(install issues due to root directory tree), so needs its own hints.
2016-02-13 12:58:54 -08:00
PatR
928be29dd1 Makefile.utl dependency bug for dlb.o
For make install or update, dlb.o was being recompiled unnecessarily
when building util/dlb because the dependency in Makefile.utl listed
hack.h instead of config.h for it.  Then attempting to run nethack
under debugger control could cause debugger complaints about dlb.o
being newer than nethack.

Updated for unix and vms.
2016-02-05 14:41:16 -08: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
nhmall
309ad50f61 Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0 2016-02-01 21:58:28 -05:00
nhmall
297d4d11e7 ensure raw_printf has visible output
Changes to be committed:
	modified:   sys/winnt/nttty.c
2016-02-01 21:57:35 -05:00
PatR
2e9a2002c4 NH_HEAPLOG vs tile utilities
I just tried to build with MONITOR_HEAP defined in unixconf.h plus
WANT_WIN_X11=1 for make.  tile2x11 wouldn't link.  It doesn't use
alloc() and free(), but it does link with drawing.o, and drawing.o
has calls to free(), so MONITOR_HEAP makes it need nhfree() from
alloc.o.

All the miscellaneous tile utilities seem to link with drawing.o, so
they all need alloc.o too, and that drags in util/panic.o as well.
I've only changed it for Unix where I can actually test the change
but other platforms probably should do this too.  Or we need to redo
drawing.c so that the small subset of stuff utilities want is
separate from the code the core uses for that same stuff.
2016-02-01 17:30:09 -08:00
nhmall
5774804524 typo bit nttty.c 2016-01-31 18:16:13 -05:00
nhmall
37b79d68cd some updates to nttty.c
Changes to be committed:
	modified:   sys/winnt/nttty.c

better attribute support
more functional inverse support
2016-01-31 18:08:03 -05:00
PatR
9d1a3be7d7 revert fix for #H4041 - decl for has_color()
Since the attempted fix for the warning about has_color() being
implicitly declared introduced a worse problem of conflicting
declaration in cases where it's already declared, back that change
out.
2016-01-26 17:39:41 -08:00
PatR
7482be39e8 lev_comp update for older Unix system
Increase the lex paramaters in lev_comp.l and replace use of snprintf
with sprintf in lev_comp.y and lev_main.c.

Also some reformatting for lev_comp.y, but I gave up pretty quickly:
some early tab replacement and adjusting of the spacing for casts.
2016-01-19 16:27:39 -08:00
nhmall
7e52c605a9 Merge branch 'NetHack-3.6.0' into win32-guitty 2016-01-11 18:35:50 -05:00
Pasi Kallinen
fe01018d90 Enable TIMED_DELAY for linux hints files
runmode is completely useless in TTY without this
2016-01-10 15:09:03 +02:00
Alex Kompel
c4bf762ec1 win32_gui: mimic tty interface when "Nethack mode" is selected (remove window features) 2016-01-03 19:52:05 -08:00
nhmall
14ce76a159 windows visual studio 2013 build updates 2016-01-01 22:01:25 -05:00
nhmall
61148f05bb SYSCF_FILE corrections for windows
Changes to be committed:
	modified:   src/files.c
	modified:   sys/share/pcmain.c

Related to #H4170, bz274

The current startup code seeks out the SYSCONFPREFIX using:
	envp = nh_getenv("COMMONPROGRAMFILES");
which is fine and usually translates to something like
"C:\\Program Files (x86)\\Common Files\\
NetHack then tacks on the NetHack subfolder to the path
"C:\\Program Files (x86)\\Common Files\\NetHack\\"

That should always be the definitive location.

However, in the event that there is no SYSCF_FILE actually
located at that system-wide spot (and ONLY in that event),
fall back to a secondary location of HACKDIR for locating
the SYSCF_FILE.

Also, there's some explicit tweaking added for the Microsoft
visual studio compiler debug execution to all a debug
session to correctly locate things. By default, on a
visual studio build, the executables are linked down in
subfolders of the build directory (Release, or Debug,
depending on visual studio build configuration options).
2016-01-01 20:33:14 -05:00
nhmall
4566b2903f windows: PDB files in Debug and Release 2015-12-31 20:16:48 -05:00
Haoyang Wang
efe2ca1f92 create 'games' group from the postinstall script of Mac binary package 2015-12-24 16:14:50 -08:00
PatR
ad838c7e79 fix #H4041 - implicit declaration of has_colors()
_M_UNIX (SCO UNIX) and __linux__ (all flavors of linux?) both call
has_colors() for TTY_GRAPHICS+TEXTCOLOR configuration, but neither
declared it.  The new declaration is just a guess based on usage.
2015-12-23 16:25:06 -08:00
Haoyang Wang
69e1113aa9 fix #H4082: create games group from package postinstall script 2015-12-23 04:53:28 -08:00
PatR
c5e2604cca still more while-helpless 2015-12-18 07:42:23 -08:00
Haoyang Wang
69cfa4b134 set permissions of symbols file in package postinstall script 2015-12-17 06:53:14 -08:00
Haoyang Wang
ad138be8fb use 'macosx.sh editsysconf' to install sysconf 2015-12-17 06:06:20 -08:00
Haoyang Wang
894c751043 added editsysconf command in macosx.sh 2015-12-17 06:06:20 -08:00
Haoyang Wang
bf7a259646 turn off use_darkgray in sysconf 2015-12-17 06:06:20 -08:00
nhmall
fa092f5fe9 housekeeping for 3.6.1
Changes to be committed:
	modified:   Files
	modified:   README
	modified:   dat/history
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/global.h
	modified:   include/obj.h
	modified:   include/patchlevel.h
	modified:   src/invent.c
	modified:   src/objnam.c
	modified:   src/shknam.c
	modified:   src/sounds.c
	modified:   src/spell.c
	modified:   sys/winnt/Install.nt
	modified:   sys/winnt/nethack.def
	modified:   win/macosx/NetHackGuidebook.applescript
	modified:   win/macosx/NetHackTerm.applescript
	modified:   win/win32/mswproc.c
2015-12-16 17:52:34 -05:00
nhmall
215060219d fix windows bugs H4030 and H4045 (123 and 138)
Changes to be committed:
	modified:   sys/share/pcmain.c
	modified:   sys/winnt/nttty.c
	modified:   sys/winnt/stubs.c

Bug 123 Report 4030:
Minor thing I've noticed - if I quit the game, at the "Hit <Enter> to end."
prompt, if I close the window rather than pressing Enter, I get the following:

Bug 138  - #H4045:
 "nethack -s" leads to "-s is not supported for the Graphical Interface".
 That's wrong.
 (The Graphical Interface comes with "nethackw".)
2015-12-11 23:08:01 -05:00
PatR
ebdfafb42d sys/vms/*.c - mostly reformatting
I'm not sure whether basic formatting cleanup belongs in 3.6.1, but
there are also a couple of strings that got split and require the
implicit concatenation of adjacent string literals introduced with
C89/C90.  The code itself compiles with pre-ANSI compilers, or at
least used to--most of it was developed with one....

Much of it is tabs in comments.  But there was one substantive item:
an obsolete reference to "use 'Q' to Quit" after however many years....
2015-12-10 18:42:27 -08:00
Pasi Kallinen
f4a6ccf3f0 Update sysconf MAXPLAYERS docs a bit 2015-12-10 10:14:24 +02:00
Pasi Kallinen
43550bee53 Allow unlimited number of players
This is important for public servers.  Setting the MAXPLAYERS
sysconf value to 0 (or commenting it out) constructs the lock
files with the player UID and player name, so each player may
have one game at a time.
2015-12-09 22:27:26 +02:00
PatR
bb72860ce2 fix #H4011 - sys/unix/Makefile.top
Some commented make variables for X11 misspelled 'pilemark.xbm' with
bad '.xbm' suffix.

'symbols' was handled strangely, but it still should have been working
during playground installation.  This removes the strangeness but I have
no idea whether it solves #H4015 ('unable to access "symbols" file' for
the Mac OSX binary).
2015-12-08 16:39:39 -08:00