home | help
RECOVER(6)			  Games Manual			      RECOVER(6)

NAME
     recover - recover a NetHack game interrupted by disaster

SYNOPSIS
     recover [-d playground-directory] base ...

DESCRIPTION
     Occasionally, a NetHack game is interrupted by disaster when the program or
     the  system  crashes.  Prior to NetHack v3.1, these games were lost because
     information like the player's inventory was kept only in memory.  Now,  all
     pertinent	information can be written out to disk, so such games can be re-
     covered at the point of the last level change.

     Base operands tell recover which files to process.  Each base specifies re-
     covery of a separate game.

     The -d option, which must be the first argument if it appears, supplies the
     directory housing the NetHack playground.	It overrides the  value  of  the
     environment  variables  NETHACKDIR and HACKDIR, and the directory specified
     by    the	  game	   administrator     during	compilation	(usually
     /usr/games/lib/nethackdir).   nethack(6) normally writes out files for lev-
     els as the player leaves them, so they will be  ready  for  return  visits.
     When  checkpointing,  it  also writes out the level entered and the current
     game state on every level change.	This procedure slows level changes.

     The level file names are of the form base.nn,where nn is an internal  book-
     keeping  number  for the level.  The file base.0 is used for game identity,
     locking, and, when checkpointing, for the game  state.   Various  OSes  use
     different	strategies  for constructing the base name.  Single-user systems
     use the character name, possibly truncated and modified to be a legal file-
     name on that system.  Multi-user systems use the (modified) character  name
     prefixed  by  a  user  number to avoid conflicts, or xlock if the number of
     concurrent players is being limited.  It may be necessary to  look  in  the
     playground  to find the correct base name of the interrupted game.  recover
     transforms these level files into a save file of the same name that nethack
     would have used.

     Since recover must be able to read and delete files from the playground and
     create files in the save directory, it has  interesting  interactions  with
     game security.  Giving ordinary players access to recover through setuid or
     setgid is tantamount to leaving the playground world-writable, with respect
     to  both  cheating and messing up other players.  For a single-user system,
     this of course does not change anything, so some of these ports install re-
     cover by default.

     For a multi-user system, the game administrator may want to arrange for all
     .0 files in the playground to be fed  to  recover	when  the  host  machine
     boots,  and  handle  game	crashes individually.  If the user population is
     sufficiently trustworthy, recover can be installed with  the  same  permis-
     sions  the  nethack executable has.  In either case, recover is easily com-
     piled from the distribution utility directory.

NOTES
     Like nethack itself, recover will overwrite existing save files of the same
     name.  Savefiles created by recover are  uncompressed;  they  may	be  com-
     pressed  afterwards  if  desired, but even a compression-using nethack will
     find them in the uncompressed form.

SEE ALSO
     xnethack(6)

BUGS
     recover makes no attempt to find out if a base name  specifies  a	game  in
     progress.	 If multiple machines share a playground, this would be impossi-
     ble to determine.

     recover should be taught to use the nethack playground locking mechanism to
     avoid conflicts.

COPYRIGHT
     This file is Copyright (C) Kenneth Lorber, 2024 for version NetHack-5:1.12.
     NetHack may be freely redistributed.  See license for details.

NETHACK 			  26 April 2026 		      RECOVER(6)

home | help