saved-games menu for vms (1 of 2) (trunk only)
First cut at implementing SELECTSAVED for VMS. Unfortunately, it only
works by default if the player is using a [probably] shared account called
"games" or "nethack", and displaying a menu of games available to restore
will likely have the side-effect of encouraging other players sharing that
account to steal each others saved games. To use it with a normal account,
the player has to include "-ugames" or "-unethack" on the command line
(or OPTIONS=name:games in config file) to force the program to reach the
"Who are you?" stage.
I've added a flag argument to set_savefile_name() so regularization
can be suppressed, allowing it to be used to construct a wildcarded file
specification. I'm using that for VMS and have attempted to put in place
for WIN32CON, but the latter is not tested.
The current WIN32CON and UNIX+QT_GRAPHICS methods of collecting save
file names is bug-prone if used on a shared playground directory. Counting
matching file names first, then allocating memory and retraversing the
directory to copy those names into the allocated memory has a window of
vulnerability where the number of matching files could increase between the
counting and the copying.
This commit is contained in:
@@ -696,7 +696,7 @@ E void FDECL(commit_bonesfile, (d_level *));
|
||||
E int FDECL(open_bonesfile, (d_level*,char **));
|
||||
E int FDECL(delete_bonesfile, (d_level*));
|
||||
E void NDECL(compress_bonesfile);
|
||||
E void NDECL(set_savefile_name);
|
||||
E void FDECL(set_savefile_name, (BOOLEAN_P));
|
||||
#ifdef INSURANCE
|
||||
E void FDECL(save_savefile_name, (int));
|
||||
#endif
|
||||
@@ -726,6 +726,9 @@ E int FDECL(sym_val, (const char *));
|
||||
#endif
|
||||
E void FDECL(paniclog, (const char *, const char *));
|
||||
E int FDECL(validate_prefix_locations, (char *));
|
||||
#ifdef SELECTSAVED
|
||||
E void FDECL(get_plname_from_file, (int, char *));
|
||||
#endif
|
||||
E char** NDECL(get_saved_games);
|
||||
E void FDECL(free_saved_games, (char**));
|
||||
#ifdef SELF_RECOVER
|
||||
@@ -2437,6 +2440,9 @@ E int FDECL(vms_doshell, (const char *,BOOLEAN_P));
|
||||
# ifdef SUSPEND
|
||||
E int NDECL(dosuspend);
|
||||
# endif
|
||||
# ifdef SELECTSAVED
|
||||
E int FDECL(vms_get_saved_games, (const char *,char ***));
|
||||
# endif
|
||||
|
||||
#endif /* VMS */
|
||||
|
||||
|
||||
@@ -74,6 +74,12 @@
|
||||
*/
|
||||
#define DLB /* use data librarian code */
|
||||
|
||||
/*
|
||||
* Provide menu of saved games to choose from at start.
|
||||
* [Player needs to use ``nethack "-ugames"'' for this to work.]
|
||||
*/
|
||||
#define SELECTSAVED
|
||||
|
||||
/*
|
||||
* You may define TEXTCOLOR if your system has any terminals that recognize
|
||||
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is
|
||||
|
||||
Reference in New Issue
Block a user