OSDN Git Service

[Refactor] #37353 使われていないVERIFY_TIMESTAMPを削除 / Removed unused preprocessors VERIFY_STAMP
authorHourier <hourier@users.sourceforge.jp>
Tue, 28 Jan 2020 13:31:34 +0000 (22:31 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 28 Jan 2020 13:31:34 +0000 (22:31 +0900)
src/h-config.h
src/save.c

index a50663a..00e2bd3 100644 (file)
 
 
 /*
- * OPTION: Forbid the use of "fiddled" savefiles.  As far as I can tell,
- * a fiddled savefile is one with an internal timestamp different from
- * the actual timestamp.  Thus, turning this option on forbids one from
- * copying a savefile to a different name.  Combined with disabling the
- * ability to save the game without quitting, and with some method of
- * stopping the user from killing the process at the tombstone screen,
- * this should prevent the use of backup savefiles.  It may also stop
- * the use of savefiles from other platforms, so be careful.
- */
-/* #define VERIFY_TIMESTAMP */
-
-
-/*
  * OPTION: Forbid the "savefile over-write" cheat, in which you simply
  * run another copy of the game, loading a previously saved savefile,
  * and let that copy over-write the "dead" savefile later.  This option
  */
 #ifdef VERIFY_HONOR
 # define VERIFY_SAVEFILE
-# define VERIFY_TIMESTAMPS
 #endif
 
 #ifndef HAVE_CONFIG_H
index c8c2cbf..631b255 100644 (file)
@@ -1589,10 +1589,6 @@ bool save_player(player_type *player_ptr)
  */
 bool load_player(player_type *player_ptr)
 {
-#ifdef VERIFY_TIMESTAMP
-       struct stat     statbuf;
-#endif
-
        concptr    what = "generic";
 
        current_world_ptr->game_turn = 0;
@@ -1678,11 +1674,6 @@ bool load_player(player_type *player_ptr)
        /* Process file */
        if (!err)
        {
-#ifdef VERIFY_TIMESTAMP
-               /* Get the timestamp */
-               (void)fstat(fd, &statbuf);
-#endif
-
                /* Read the first four bytes */
                if (fd_read(fd, (char*)(vvv), 4)) err = -1;
 
@@ -1718,21 +1709,6 @@ bool load_player(player_type *player_ptr)
                if (err) what = _("セーブファイルが壊れています", "Broken savefile");
        }
 
-#ifdef VERIFY_TIMESTAMP
-       /* Verify timestamp */
-       if (!err && !arg_wizard)
-       {
-               /* Hack -- Verify the timestamp */
-               if (current_world_ptr->sf_when > (statbuf.st_ctime + 100) ||
-                       current_world_ptr->sf_when < (statbuf.st_ctime - 100))
-               {
-                       what = _("無効なタイム・スタンプです", "Invalid timestamp");
-
-                       err = -1;
-               }
-       }
-#endif
-
        if (!err)
        {
                /* Give a conversion warning */