diff options
author | Bardur Arantsson <bardur@scientician.net> | 2011-03-31 17:24:50 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-03-29 19:53:56 +0200 |
commit | cc2b0014e4151dd019134cd5b12c9cb3190cd27e (patch) | |
tree | 1f28326c0c661b5e026d1eccd4cac78df56fdcbd | |
parent | dac2f1a94d2514137fb409b9a4a3268ac08506d7 (diff) |
Files: Remove VERIFY_* load/save compile-time flags.
These flags were either not used or made things more complicated for
no good reason.
-rw-r--r-- | src/config.h | 49 | ||||
-rw-r--r-- | src/dungeon.c | 4 | ||||
-rw-r--r-- | src/loadsave.c | 103 | ||||
-rw-r--r-- | src/main.c | 14 |
4 files changed, 1 insertions, 169 deletions
diff --git a/src/config.h b/src/config.h index 23e94c0f..9984d975 100644 --- a/src/config.h +++ b/src/config.h @@ -114,37 +114,6 @@ /* - * OPTION: Verify savefile Checksums (Angband 2.7.0 and up) - * This option can help prevent "corruption" of savefiles, and also - * stop intentional modification by amateur users. - */ -#define VERIFY_CHECKSUMS - - -/* - * 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 - * 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: Allow characteres to be "auto-rolled" */ #define ALLOW_AUTOROLLER @@ -301,8 +270,7 @@ * machines, once you manage to "load" a savefile, it stays that way. * Macintosh is particularly weird because you can load savefiles that * are not contained in the "lib:save:" folder, and if you change the - * player's name, it will then save the savefile elsewhere. Note that - * this also gives a method of "bypassing" the "VERIFY_TIMESTAMP" code. + * player's name, it will then save the savefile elsewhere. */ #if defined(MACINTOSH) || defined(WINDOWS) /* #define SAVEFILE_MUTABLE */ @@ -338,21 +306,6 @@ -/* - * OPTION: Attempt to prevent all "cheating" - */ -/* #define VERIFY_HONOR */ - - -/* - * React to the "VERIFY_HONOR" flag - */ -#ifdef VERIFY_HONOR -# define VERIFY_SAVEFILE -# define VERIFY_CHECKSUMS -# define VERIFY_TIMESTAMPS -#endif - /* ToME options: */ /* Should the player know his / her starting life rate? */ diff --git a/src/dungeon.c b/src/dungeon.c index 6a016e55..6867abbf 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -4166,8 +4166,6 @@ static void process_command(void) break; } -#ifndef VERIFY_SAVEFILE - /* Hack -- Save and don't quit */ case KTRL('S'): { @@ -4176,8 +4174,6 @@ static void process_command(void) break; } -#endif /* VERIFY_SAVEFILE */ - case KTRL('T'): { do_cmd_time(); diff --git a/src/loadsave.c b/src/loadsave.c index 6951628f..7710bc86 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -832,17 +832,6 @@ bool_ save_player(void) /* Hack -- Pretend the character was loaded */ character_loaded = TRUE; -#ifdef VERIFY_SAVEFILE - - /* Lock on savefile */ - strcpy(temp, savefile); - strcat(temp, ".lok"); - - /* Remove lock file */ - fd_kill(temp); - -#endif - /* Success */ result = TRUE; } @@ -893,10 +882,6 @@ bool_ load_player(void) errr err = 0; -#ifdef VERIFY_TIMESTAMP - struct stat statbuf; -#endif /* VERIFY_TIMESTAMP */ - cptr what = "generic"; /* Paranoia */ @@ -923,50 +908,6 @@ bool_ load_player(void) return (TRUE); } - -#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) - { - /* Close the file */ - my_fclose(fkk); - - /* Message */ - msg_print("Savefile is currently in use."); - msg_print(NULL); - - /* Oops */ - 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 - - /* Okay */ if (!err) { @@ -983,13 +924,6 @@ bool_ load_player(void) /* Process file */ if (!err) { -#ifdef VERIFY_TIMESTAMP - - /* Get the timestamp */ - (void)fstat(fd, &statbuf); - -#endif - /* Open the file XXX XXX XXX XXX Should use Angband file interface */ fff = my_fopen(savefile, "rb"); /* fff = fdopen(fd, "r"); */ @@ -1036,25 +970,6 @@ bool_ load_player(void) if (err) what = "Broken savefile"; } -#ifdef VERIFY_TIMESTAMP - - /* Verify timestamp */ - if (!err && !arg_wizard) - { - /* Hack -- Verify the timestamp */ - if (sf_when > (statbuf.st_ctime + 100) || - sf_when < (statbuf.st_ctime - 100)) - { - /* Message */ - what = "Invalid timestamp"; - - /* Oops */ - err = -1; - } - } - -#endif - /* Okay */ if (!err) @@ -1108,24 +1023,6 @@ bool_ load_player(void) } -#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 - - /* Message */ msg_format("Error (%s) reading %d.%d.%d savefile.", what, sf_major, sf_minor, sf_patch); @@ -217,18 +217,6 @@ static void change_path(cptr info) break; } -#ifdef VERIFY_SAVEFILE - - case 'b': - case 'd': - case 'e': - case 's': - { - quit_fmt("Restricted option '-d%s'", info); - } - -#else /* VERIFY_SAVEFILE */ - case 'd': { string_free(ANGBAND_DIR_DATA); @@ -250,8 +238,6 @@ static void change_path(cptr info) break; } -#endif /* VERIFY_SAVEFILE */ - default: { quit_fmt("Bad semantics in '-d%s'", info); |