Commit Graph

2470 Commits

Author SHA1 Message Date
Michael Meyer
b993edca74 Follow-ups on EXPLORERS authorization
I realized that failed explore-mode authorization on a special-mode
saved game cannot downgrade the game mode further down to a normal game,
because this would dump the player back into a state where she has
completed some part of the game in explore mode but is eligible for the
topten list.  This is even more true when the game was formerly a
wizard-mode game.  Unforunately, that was the state my previous commits
left the game in.

Instead, if restoring an explore-mode or wizard-mode savegame, and the
player is authorized via sysconf for neither of those modes, fail
restoration entirely and start a new game instead.  That's sort of
clunky and there could probably be more explanation provided, but it
should be an exceedingly rare occurance and I'm not sure what
alternative exists that would still honor the EXPLORERS and WIZARDS
restrictions.  This shouldn't affect the way they default 'down a mode'
in other circumstances, i.e. the overwhelming majority of situations in
which EXPLORERS authorization is needed/checked.

For the same reason, I realized that the player can't be prompted
whether or not to enter explore mode, if being downgraded from a
no-longer-authorized wizmode save while explore mode is authorized.  The
change from wizard mode to explore mode must be mandatory.  I have also
switched that up so that it will force the change -- unfortunately, this
has the side effect of allowing the preservation of the save, but it's
more important to make sure a wizard mode game doesn't get reverted to
normal mode.  They won't be able to load the save into wizard mode
anyway.
2023-11-07 15:38:10 -08:00
Michael Meyer
1e237e4b8f Fix: shunt to explore mode after wizmode auth fail
If an unauthorized player requests the game launch in wizard mode, it
will try to put her in explore mode instead.  If this happened during
restoration of a previous (normal) saved game, the setting of discover
in wd_message() would bypass iflags.deferred_X, allowing the player to
select to keep the non-explore-mode save file.  [Actually, when I tested
it I always got an error when answering yes to the "keep the save file?"
prompt, but that's a problem too...]  Because deferred_X was still 1
after this, the pline "You are already in explore mode" would also be
printed following the prompt (when moveloop_preamble() attempted to set
explore mode).

Fix this so that loading a normal game with -D, then failing the
authorization, boots into explore mode via iflags.deferred_X and the
"really enter explore mode?" prompt, as it would have if -X were
specified on the command line to begin with.
2023-11-07 15:38:10 -08:00
Michael Meyer
85b727c92c Apply sysconf EXPLORERS restriction on startup
The sysconf EXPLORERS list restricting access to explore mode was being
evaluated and used when a player used the #exploremode command in-game,
or when specifying -X or OPTIONS=playmode:explore on the command line
when resuming a normal game, but not when starting an entirely new game.
When SYSCF is avilable, check for authorization early, similar to debug
mode authorization, to restrict access to explore mode to EXPLORERS
under (hopefully) all circumstances.
2023-11-07 15:38:08 -08:00
Michael Meyer
4f405b77ce Remove pw check in authorize_wizard_mode
Now that CHECK_PLNAME is a sysconf option, it can be possible to
authorize wizard mode even if get_unix_pw() fails to return the user's
login name, so I think the call to check_user_string() should go out
either way in case that's what's happening.
2023-11-07 15:38:08 -08:00
G. Branden Robinson
363f8db139 Use *roffier method of producing Guidebook.dat
doc/Gbk-1pg-sfx.mn is already using one half of a sound technique: set
the page length to a very large value, guaranteed to overshoot the
vertical space required by the document's text.  The other half is to,
at the end of the document, set the page length to the current vertical
position, so that it ends immediately.

https://www.gnu.org/software/groff/manual/groff.html.node/Manipulating-Spacing.html
2023-11-06 14:43:50 -06:00
G. Branden Robinson
9a96e0a198 Fix *roff string usage nit
String definitions were being used with a pointless leading double
quote.  This syntax is used only to define strings containing leading
space characters.  (You might also use it defensively if you're defining
one string whose contents start with the interpolation of another, and
the latter might interpolate leading space--but that is not the case
here.)

Remove unnecessary leading quotes from string definitions.

* doc/Guidebook.mn: Do it.  Also annotate empty strings with comment.
* sys/unix/hints/include/gbdates-post.370: Don't put them back.

https://www.gnu.org/software/groff/manual/groff.html.node/Strings.html
2023-11-06 14:43:34 -06:00
PatR
1b04533b35 fix #4027 - unix command line parsing bug
'nethack --show' is rejected, which is ok, but the feedback is
'prscore: bad arguments (2)' which is pretty confusing.

Reject any --s unless it's the start of --scores or --showpath[s].
'nethack --show' will be rejected as "Unknown option: --show."
'nethack -show' is still accepted and will report that it can't find
any scores for how as it always has (assuming that there aren't any
score entries for "how" :-).
2023-11-05 17:16:02 -08:00
nhmall
196fd41817 comment out font warning argument to groff 1.23
The font warnings are no longer being generated as of b73e4815,
so there is no need for the '-W font' argument to groff at this time.
2023-11-02 10:31:50 -04:00
nhmall
5c87596597 support builds incl Qt6 with clang-14,15,16,17 2023-10-31 13:08:32 -04:00
nhmall
ead8053f91 outdated dependency for alloc.o in Makefile.utl 2023-10-31 10:11:15 -04:00
nhmall
df4d945395 The same warnings resulted with groff 1.23 on macOS 2023-10-30 16:59:58 -04:00
nhmall
a70cae04a3 Linux: refine warning suppression
groff 1.23 is known to have the issue
2023-10-30 16:20:49 -04:00
nhmall
f42108d255 suppress warnings with recent *roff
This does not fix the actual problem that is causing the warnings.
It merely suppresses the hundreds of warnings until the actual
problem is corrected.

If there is no NROFF_FLAGS defined in a hints file, there should be
no change in behavior.

At this time, only sys/unix/hints/linux.370 sets NROFF_FLAGS.
2023-10-30 12:52:48 -04:00
nhmall
351a1eb9d5 suffix tag files for directories in Makefile.nmake 2023-10-29 08:51:24 -04:00
Pasi Kallinen
48b10a1c8d MSDOS: example hilite_status in default config 2023-10-25 09:50:47 +03:00
Pasi Kallinen
614e6c9d5e MSDOS: implement inverse text attribute 2023-10-24 18:34:15 +03:00
Pasi Kallinen
76471e890b MSDOS: Fix VESA mode text background color 2023-10-24 09:37:36 +03:00
nhmall
4aa0bf4a09 MSYS post-compiler fix 2023-10-17 19:54:15 -04:00
PatR
1d0e4729bd 'make depend' again
Having source files with the same name in different subdirectories
won't work because their object files would conflict, but don't allow
the failure to be because depend.awk left out the conflicting rules.

No change in behavior from the most recent commit.
2023-10-14 14:36:42 -07:00
PatR
db48b92dd3 avoid redundant unix dependency for tile.o 2023-10-14 13:48:47 -07:00
PatR
284452796c redo tty resizing
Rest of 'not PR #1102'.  Resizing the terminal while getpos was in
operation recalculated the map from scratch instead of redrawing what
the core considers to already be shown.  And it was always operating
while an asynchronous signal was excuting which could potentially
clobber whatever was running at the time the signal arrived.

This uses same redrawing as the prior '^R during getpos()' fix.  It
also only performs the resize while tty_nhgetch() is waiting for
input.  If that is the situation at the time that the signal arrives
then it will resize immediately (while in the asynchronous signal
handler); if not, it will set a flag and tty_nhgetch() will do the
resize the next time it gets called.

This builds with TTY_PERM_INVENT enabled and doesn't seem to be any
worse than before, but there are bugs with that.  The only way I could
get perminv to appear was to save and restore, then perm_invent was
honored for both RC file and mO command.  And once I managed to get it
to display, moving an item from a lower case slot to slot 'A', made
that item vanish; nothing appeared in the invent's right hand panel.

Both of those misbehaviors already happen prior to this commit.  I
also saw an abort+panictrace if I resized while at the "Dump core?"
prompt when running the pre-commit code and didn't see that with the
post-commit code (although the prompt wasn't shown so I couldn't tell
that it was waiting for an answer).  The abort probably sounds scarier
than it warrants; I suspect that the pre-commit code just treated the
resize as answering 'y' for some reason, possibly a stale value in the
variable it uses.
2023-10-12 18:45:14 -07:00
nhmall
e5c6bf8ec0 update tested versions of Visual Studio 2023-10-11 2023-10-11 19:52:40 -04:00
nhmall
50b213bdc5 update dependencies in Makefile.nmake Oct 2, 2023 2023-10-02 07:50:42 -04:00
PatR
4df37c1eb2 unix 'make depend' update
Mostly seems to be a different order of #include in hack.h and/or its
descendants but I didn't investigate.
2023-10-01 13:59:13 -07:00
nhmall
cf3cbcf832 attempt to fix github issue #1104 gui build curses
Check for pdcursesmod explicitly, since it is require for
curses support under the NetHackW gui version

Closes #1104
2023-09-30 10:20:27 -04:00
nhmall
e1e9a2f364 avoid crash upon exit under Windows with curses 2023-09-24 11:34:58 -04:00
nhmall
69afa93cb3 visual studio subproject build order
pdcursesgui.lib must be built before nethackw.exe
pdcurses.lib must be built before nethack.exe
2023-09-23 16:02:34 -04:00
nhmall
44ecbb2a1b some work on conditional components in vs build 2023-09-23 15:26:09 -04:00
nhmall
384d726b9c adjust some fmod integration bits 2023-09-23 10:01:37 -04:00
nhmall
14faa682c4 improve selectsave handling for Windows
If there were outdated savefiles encountered during
startup, each individual one was getting a wait_synch
that required a <return> even though a message window
wasn't being used at that point.

Allow suppression of the individual per-file wait_synch()
calls on Windows, so that a single one can be done once
the selectsave processing is overwith.

This was a little messy because an indicator had to flow
down through validate(), uptodate(), etc.

There shouldn't be any change in how things behave on
any non-Windows platforms.
2023-09-22 15:14:53 -04:00
nhmall
0c2004c0d1 visual studio build with curses wide support 2023-09-21 16:50:58 -04:00
nhmall
61cc98af3c quiet a couple of Windows warnings 2023-09-21 16:31:34 -04:00
nhmall
49c7a136c8 fix a symbols file issue encountered under Windows 2023-09-21 15:12:34 -04:00
MrEveryDay98
6164357ed9 Added FMOD library support (needs work)
removed extra initializer
fmod.c int to int32_t
fmod support now functional
Added snd_lib check in windmain
fmod_ambience func for future implementation
updated some funcs
(CAN'T BUILD) -- static'd vars
2023-09-16 11:37:56 -04:00
nhmall
499a3654e5 typo fix in Makefile.nmake for 3rd party soundlib 2023-09-16 09:03:42 -04:00
nhmall
8845ead907 update tested versions of Visual Studio 2023-09-14 2023-09-14 10:18:07 -04:00
nhkeni
b75bc87662 Improve run fetch-lua required message - it has to be run in top. 2023-09-07 12:17:53 -04:00
nhkeni
385d860bef Merge branch 'keni-crashweb3' into NetHack-3.7 2023-09-06 12:39:17 -04:00
nhkeni
8c095b009a Add CRASHREPORT, show contact form on panic/impossible
When calling panic() or impossible(), create the option
of opening a browser window with most of the fields
already populated.  Code for MacOS and linux is included;
other ports are affected by argument change to early_init
which are done but not tested.

To enable, define CRASHREPORT in config.h and set
CRASHREPORTURL in sysconf to (for the moment at least)
http[s]://www.nethack.org/common/contactcr.html

Adds --grep-defined option to makedefs for Makefiles.

Adds "bid" (binary identifier), an MD4 of the main nethack
binary.  This is ONLY for helping (in the future) contact.html
to set the "NetHack from" field automatically for our own
binaries.  This can be faked, but the user can lie so nothing
lost.  There's nothing magic about MD4; other ports can use
anything that prodcues a long apparently random string we can
match against.

- new option --bidshow for us to get the MD4 of a
  released binary so I can add it to the website.
  Only available in wizard mode and not in nethack.6.
- typo macos -> macosx in hints file

No support for packaging builds as I'm not sure what that
would look like.

Adds a javascript helper for MacOS.
Adds a lua helper for linux (and builds and installs
 nhlua).
2023-09-06 12:27:13 -04:00
nhkeni
87434a49ab Merge branch 'keni-luacksum2' into NetHack-3.7 2023-09-06 12:20:02 -04:00
nhkeni
1a2836577b check the checksum for Lua in "make fetch-lua"
Works for MacOS and linux.
2023-09-06 12:15:54 -04:00
PatR
6bb9b8a955 missing dependency in sys/unix/Makefile.utl
The dependencies in util/Makefile duplicate those in src/Makefile for
objects.o and monst.o but the latter got changed last year and the
change wasn't replicated.
2023-08-29 11:38:06 -07:00
nhkeni
06a3bd0424 mac: don't fail "make install" if SHELLDIR already exists 2023-08-28 19:18:36 -04:00
nhmall
f625d2efcf more tabs to spaces 2023-08-16 10:22:10 -04:00
nhmall
1a99c9382e Qt6 on Linux Makefile tweak 2023-08-13 12:06:19 -04:00
nhmall
7b2a72d083 update tested versions of Visual Studio 2023-08-10 2023-08-10 09:49:54 -04:00
nhmall
036ad82074 doc follow-up 2023-08-08 12:49:29 -04:00
nhmall
b7c92b498d support Linux build with qt6-base-dev & qt6-multimedia-dev
There was an error:
    ../win/Qt/qt_main.cpp:767:37: error: attempt to use a deleted function
                        action->setData(actchar);
                                        ^
    /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:199:5: note: 'QVariant<char *, false>' has been explicitly marked deleted here
        QVariant(T) = delete;
        ^
    1 error generated.

I'm hoping the fix applied is the correct one for the error.
2023-08-08 12:41:44 -04:00
nhmall
025edeb443 CROSS_TO_MIPS=1 build fix 2023-08-01 10:42:20 -04:00
nhmall
536a4bd8b3 update tested versions of Visual Studio 2023-07-16 2023-07-16 12:32:42 -04:00