OSDN Git Service

upgrade to 3.6.1
[jnethack/source.git] / doc / recover.6
1 .TH RECOVER 6 "14 December 2015" NETHACK
2 .de ND
3 .ds Nd \\$3
4 ..
5 .de NB
6 .ds Nb \\$2
7 ..
8 .de NR
9 .ds Nr \\$2
10 ..
11 .ND $NHDT-Date: 1524689550 2018/04/25 20:52:30 $
12 .NB $NHDT-Branch: NetHack-3.6.0 $
13 .NR $NHDT-Revision: 1.9 $
14 .ds Na Kenneth Lorber
15 .SH NAME
16 recover \- recover a NetHack game interrupted by disaster
17 .SH SYNOPSIS
18 .B recover
19 [
20 .B \-d
21 .I directory
22 ]
23 .I "base1 base2" ...
24 .SH DESCRIPTION
25 .PP
26 Occasionally, a NetHack game will be interrupted by disaster
27 when the game or the system crashes.
28 Prior to NetHack v3.1, these games were lost because various information
29 like the player's inventory was kept only in memory.
30 Now, all pertinent information can be written out to disk,
31 so such games can be recovered at the point of the last level change.
32 .PP
33 The
34 .I base
35 options tell
36 .I recover
37 which files to process.
38 Each base option specifies recovery of a separate game.
39 .PP
40 The
41 .B \-d
42 option, which must be the first argument if it appears,
43 supplies a directory which is the NetHack playground.
44 It overrides the value from NETHACKDIR, HACKDIR, or the directory
45 specified by the game administrator during compilation
46 (usually /usr/games/lib/nethackdir).
47 .PP
48 ^?ALLDOCS
49 For recovery to be possible,
50 .I nethack
51 must have been compiled with the INSURANCE option, and the run-time option
52 .I checkpoint
53 must also have been on.
54 ^:
55 ^?INSURANCE
56 For recovery to be possible,
57 .I nethack
58 must have been compiled with the INSURANCE option (this configuration was),
59 and the run-time option
60 .I checkpoint
61 must also have been on.
62 ^:
63 This configuration of
64 .I nethack
65 was created without support for recovery.
66 ^.
67 ^.
68 NetHack normally writes out files for levels as the player leaves them,
69 so they will be ready for return visits.
70 When checkpointing, NetHack also writes out the level entered and
71 the current game state on every level change.
72 This naturally slows level changes down somewhat.
73 .PP
74 The level file names are of the form base.nn, where nn is an internal
75 bookkeeping number for the level.
76 The file base.0 is used for game identity, locking, and, when checkpointing,
77 for the game state.
78 Various OSes use different strategies for constructing the base name.
79 Microcomputers use the character name, possibly truncated and modified
80 to be a legal filename on that system.
81 Multi-user systems use the (modified) character name prefixed
82 by a user number to avoid conflicts,
83 or "xlock" if the number of concurrent players is being limited.
84 It may be necessary to look in the playground to find the correct
85 base name of the interrupted game.
86 .I recover
87 will transform these level files into a save file of the same name as
88 .I nethack
89 would have used.
90 .PP
91 Since
92 .I recover
93 must be able to read and delete files from the playground
94 and create files in the save directory,
95 it has interesting interactions with game security.
96 Giving ordinary players access to
97 .I recover
98 through setuid or setgid is tantamount to leaving the playground
99 world-writable,
100 with respect to both cheating and messing up other players.
101 For a single-user system, this of course does not change anything,
102 so some of the microcomputer ports install
103 .I recover
104 by default.
105 .PP
106 For a multi-user system,
107 the game administrator may want to arrange for all .0 files in the
108 playground to be fed to recover when the host machine boots,
109 and handle game crashes individually.
110 If the user population is sufficiently trustworthy,
111 .I recover
112 can be installed with the same permissions the
113 .I nethack
114 executable has.
115 In either case,
116 .I recover
117 is easily compiled from the distribution utility directory.
118 .SH NOTES
119 .PP
120 Like
121 .I nethack
122 itself,
123 .I recover
124 will overwrite existing savefiles of the same name.
125 Savefiles created by
126 .I recover
127 are uncompressed;
128 they may be compressed afterwards if desired,
129 but even a compression-using
130 .I nethack
131 will find them in the uncompressed form.
132 .SH "SEE ALSO"
133 nethack(6)
134 .SH BUGS
135 .PP
136 .I recover
137 makes no attempt to find out if a base name specifies a game in progress.
138 If multiple machines share a playground, this would be impossible to
139 determine.
140 .PP
141 .I recover
142 should be taught to use the nethack playground locking mechanism to
143 avoid conflicts.
144 .SH COPYRIGHT
145 This file is Copyright (C) \*(Na and was last modified \*(Nd (version
146 \*(Nb:\*(Nr).
147 NetHack may be freely redistributed.  See license for details.