srogue: don't store machine-dependent metadata in the savefile.
Super-Rogue, like Rogue V4, stored data of machine-dependent length in the savefile, to prevent cheating. This made saved games non-portable. Also deleted was a check that used this data, and prevented restoring savefiles from backup. This change BREAKS SAVEFILE COMPATIBILITY, but old files can be converted by removing the block at offset 0x1e with length sizeof(ino_t) + sizeof(dev_t) + 2 * sizeof(time_t). That seems to be 0x14 on i686 and 0x20 on x86_64.
This commit is contained in:
parent
fdc346deb1
commit
a210387f8d
1 changed files with 0 additions and 16 deletions
|
|
@ -186,10 +186,6 @@ FILE *savef;
|
|||
write(fnum, "RDK", 4);
|
||||
lseek(fnum, 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("");
|
||||
|
|
@ -238,10 +234,6 @@ char *file, **envp;
|
|||
|
||||
fstat(inf, &sbuf2);
|
||||
|
||||
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);
|
||||
|
||||
|
|
@ -250,14 +242,6 @@ char *file, **envp;
|
|||
* inode for as long as possible
|
||||
*/
|
||||
|
||||
if (!wizard)
|
||||
{
|
||||
if(sbuf2.st_ino!=sbuf.st_ino || sbuf2.st_dev!=sbuf.st_dev) {
|
||||
printf("Sorry, saved game is not in the same file.\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __INTERIX
|
||||
setenv("TERM","interix");
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue