OSDN Git Service

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

index 472656d..1d038c2 100644 (file)
@@ -4128,8 +4128,6 @@ static void process_command(player_type *creature_ptr)
                break;
        }
 
-#ifndef VERIFY_SAVEFILE
-
        /* Hack -- Save and don't quit */
        case KTRL('S'):
        {
@@ -4137,8 +4135,6 @@ static void process_command(player_type *creature_ptr)
                break;
        }
 
-#endif /* VERIFY_SAVEFILE */
-
        case KTRL('T'):
        {
                do_cmd_time(creature_ptr);
index 00e2bd3..602ece1 100644 (file)
 # define SAFE_SETUID_POSIX
 #endif
 
-
-/*
- * 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
- * either locks the savefile, or creates a fake "xxx.lok" file to prevent
- * the use of the savefile until the file is deleted.  Not ready yet.
- */
-/* #define VERIFY_SAVEFILE */
-
  /*
  * OPTION: Handle signals
  */
  * React to the "VERIFY_HONOR" flag
  */
 #ifdef VERIFY_HONOR
-# define VERIFY_SAVEFILE
 #endif
 
 #ifndef HAVE_CONFIG_H
index 4019480..4de68b3 100644 (file)
@@ -196,18 +196,6 @@ static void change_path(concptr info)
                        break;
                }
 
-#ifdef VERIFY_SAVEFILE
-
-               case 'b':
-               case 'd':
-               case 'e':
-               case 's':
-               {
-                       quit_fmt("Restricted option '-d%s'", info);
-               }
-
-#else /* VERIFY_SAVEFILE */
-
                case 'b':
                {
                        string_free(ANGBAND_DIR_BONE);
@@ -243,8 +231,6 @@ static void change_path(concptr info)
                        break;
                }
 
-#endif /* VERIFY_SAVEFILE */
-
                default:
                {
                        quit_fmt("Bad semantics in '-d%s'", info);
index 631b255..62da068 100644 (file)
@@ -1533,24 +1533,6 @@ bool save_player(player_type *player_ptr)
                /* Hack -- Pretend the character was loaded */
                current_world_ptr->character_loaded = TRUE;
 
-#ifdef VERIFY_SAVEFILE
-
-               /* Lock on savefile */
-               strcpy(temp, savefile);
-               strcat(temp, ".lok");
-
-               /* Grab permissions */
-               safe_setuid_grab();
-
-               /* Remove lock file */
-               fd_kill(temp);
-
-               /* Drop permissions */
-               safe_setuid_drop();
-
-#endif
-
-               /* Success */
                result = TRUE;
        }
 
@@ -1618,45 +1600,6 @@ bool load_player(player_type *player_ptr)
 #endif
 
        errr err = 0;
-#ifdef VERIFY_SAVEFILE
-
-       /* Verify savefile usage */
-       if (!err)
-       {
-               FILE *fkk;
-
-               char temp[1024];
-
-               /* Extract name of lock file */
-               strcpy(temp, savefile);
-               strcat(temp, ".lok");
-
-               /* Check for lock */
-               fkk = my_fopen(temp, "r");
-
-               /* Oops, lock exists */
-               if (fkk)
-               {
-                       my_fclose(fkk);
-
-                       msg_print(_("セーブファイルは現在使用中です。", "Savefile is currently in use."));
-                       msg_print(NULL);
-
-                       return FALSE;
-               }
-
-               /* Create a lock file */
-               fkk = my_fopen(temp, "w");
-
-               /* Dump a line of info */
-               fprintf(fkk, "Lock file for savefile '%s'\n", savefile);
-
-               /* Close the lock file */
-               my_fclose(fkk);
-       }
-
-#endif
-
        int fd = -1;
        byte vvv[4];
        if (!err)
@@ -1764,23 +1707,6 @@ bool load_player(player_type *player_ptr)
                return TRUE;
        }
 
-#ifdef VERIFY_SAVEFILE
-
-       /* Verify savefile usage */
-       if (TRUE)
-       {
-               char temp[1024];
-
-               /* Extract name of lock file */
-               strcpy(temp, savefile);
-               strcat(temp, ".lok");
-
-               /* Remove lock */
-               fd_kill(temp);
-       }
-
-#endif
-
        msg_format(_("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込み中に発生。", "Error (%s) reading %d.%d.%d savefile."),
                what, (current_world_ptr->z_major > 9) ? current_world_ptr->z_major - 10 : current_world_ptr->z_major, current_world_ptr->z_minor, current_world_ptr->z_patch);
        msg_print(NULL);
@@ -1794,20 +1720,6 @@ bool load_player(player_type *player_ptr)
  */
 void remove_loc(void)
 {
-#ifdef VERIFY_SAVEFILE
-       char temp[1024];
-#endif /* VERIFY_SAVEFILE */
-
-#ifdef VERIFY_SAVEFILE
-
-       /* Lock on savefile */
-       strcpy(temp, savefile);
-       strcat(temp, ".lok");
-
-       /* Remove lock file */
-       fd_kill(temp);
-
-#endif /* VERIFY_SAVEFILE */
 }