# HG changeset patch # User John "Elwin" Edwards # Date 1375760981 25200 # Node ID 0e212d46b68f9a1cde99e3c246a298b695c97b46 # Parent c8726c9fec82ae0705e26fe969ec6ccde02fd3a0 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. diff -r c8726c9fec82 -r 0e212d46b68f rogue4/save.c --- a/rogue4/save.c Mon Jul 01 07:58:55 2013 -0700 +++ b/rogue4/save.c Mon Aug 05 20:49:41 2013 -0700 @@ -173,10 +173,6 @@ 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 @@ 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);