rogue4: don't put savefile metadata into the savefile.
The save_file() function in save.c stored the savefile's device number, inode number, creation time, and modification time in the file. The restore() function read them back, and apparently used to compare them to protect against cheaters. Unfortunately, the types and sizes of these numbers differ from system to system, which ruins the Roguelike Restoration Project's fine portability work. So they have been removed from the savefile. This BREAKS SAVEFILE COMPATIBILITY, but old files can be converted by excising the chunk starting at offset 0x22 with length sizeof(ino_t) + sizeof(dev_t) + 2 * sizeof(time_t). That's 0x14 on i686 and 0x20 on x86_64, at least with current versions of Linux and glibc.
This commit is contained in:
parent
7f094a6b77
commit
fdc346deb1
1 changed files with 0 additions and 8 deletions
|
|
@ -173,10 +173,6 @@ register FILE *savef;
|
|||
fseek(savef, 0L, 0);
|
||||
|
||||
encwrite(version,strlen(version)+1,savef);
|
||||
encwrite(&sbuf.st_ino,sizeof(sbuf.st_ino),savef);
|
||||
encwrite(&sbuf.st_dev,sizeof(sbuf.st_dev),savef);
|
||||
encwrite(&sbuf.st_ctime,sizeof(sbuf.st_ctime),savef);
|
||||
encwrite(&sbuf.st_mtime,sizeof(sbuf.st_mtime),savef);
|
||||
encwrite(&slines,sizeof(slines),savef);
|
||||
encwrite(&scols,sizeof(scols),savef);
|
||||
msg("");
|
||||
|
|
@ -246,10 +242,6 @@ char **envp;
|
|||
|
||||
fflush(stdout);
|
||||
|
||||
encread(&sbuf.st_ino,sizeof(sbuf.st_ino), inf);
|
||||
encread(&sbuf.st_dev,sizeof(sbuf.st_dev), inf);
|
||||
encread(&sbuf.st_ctime,sizeof(sbuf.st_ctime), inf);
|
||||
encread(&sbuf.st_mtime,sizeof(sbuf.st_mtime), inf);
|
||||
encread(&slines,sizeof(slines),inf);
|
||||
encread(&scols,sizeof(scols),inf);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue