From: Holger Schemel Date: Fri, 14 May 2021 16:43:49 +0000 (+0200) Subject: removed support for global (common/system-wide) scores directory X-Git-Tag: 4.3.0.0~149 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=380f1f693d72b034d9b56dbc9c974ba8c6c490e7;p=rocksndiamonds.git removed support for global (common/system-wide) scores directory --- diff --git a/src/files.c b/src/files.c index f3bf9f75..b43b89c8 100644 --- a/src/files.c +++ b/src/files.c @@ -8792,7 +8792,6 @@ void LoadScore(int nr) void SaveScore_OLD(int nr) { int i; - int permissions = (program.global_scores ? PERMS_PUBLIC : PERMS_PRIVATE); char *filename = getScoreFilename(nr); FILE *file; @@ -8813,7 +8812,7 @@ void SaveScore_OLD(int nr) fclose(file); - SetFilePermissions(filename, permissions); + SetFilePermissions(filename, PERMS_PRIVATE); } #endif @@ -8882,7 +8881,6 @@ static void SaveScore_TAPE(FILE *file, struct ScoreInfo *scores) static void SaveScoreToFilename(char *filename) { FILE *file; - int permissions = (program.global_scores ? PERMS_PUBLIC : PERMS_PRIVATE); int info_chunk_size; int name_chunk_size; int scor_chunk_size; @@ -8925,7 +8923,7 @@ static void SaveScoreToFilename(char *filename) fclose(file); - SetFilePermissions(filename, permissions); + SetFilePermissions(filename, PERMS_PRIVATE); } void SaveScore(int nr) diff --git a/src/game.c b/src/game.c index 914c2520..23fe5f91 100644 --- a/src/game.c +++ b/src/game.c @@ -5115,7 +5115,7 @@ static int addScoreEntry(struct ScoreInfo *list, struct ScoreEntry *new_entry, void NewHighScore(int level_nr) { struct ScoreEntry new_entry = {{ 0 }}; // (prevent warning from GCC bug 53119) - boolean one_per_name = !program.many_scores_per_name; + boolean one_per_name = FALSE; strncpy(new_entry.tape_basename, tape.score_tape_basename, MAX_FILENAME_LEN); strncpy(new_entry.name, setup.player_name, MAX_PLAYER_NAME_LEN); @@ -5145,7 +5145,7 @@ void NewHighScore(int level_nr) void MergeServerScore(void) { struct ScoreEntry last_added_entry; - boolean one_per_name = !program.many_scores_per_name; + boolean one_per_name = FALSE; int i; if (scores.last_added >= 0) diff --git a/src/init.c b/src/init.c index fbd103da..5888e26f 100644 --- a/src/init.c +++ b/src/init.c @@ -6188,8 +6188,6 @@ void OpenAll(void) print_timestamp_time("[init setup/config stuff (1)]"); - InitScoresInfo(); - if (options.execute_command) Execute_Command(options.execute_command); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 1d3be4fa..2580b6dc 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -105,12 +105,7 @@ static char *getScoreDir(char *level_subdir) char *score_subdir = SCORES_DIRECTORY; if (score_dir == NULL) - { - if (program.global_scores) - score_dir = getPath2(getCommonDataDir(), score_subdir); - else - score_dir = getPath2(getMainUserGameDataDir(), score_subdir); - } + score_dir = getPath2(getMainUserGameDataDir(), score_subdir); if (level_subdir != NULL) { @@ -1141,15 +1136,9 @@ void InitTapeDirectory(char *level_subdir) void InitScoreDirectory(char *level_subdir) { - int permissions = (program.global_scores ? PERMS_PUBLIC : PERMS_PRIVATE); - - if (program.global_scores) - createDirectory(getCommonDataDir(), "common data", permissions); - else - createDirectory(getMainUserGameDataDir(), "main user data", permissions); - - createDirectory(getScoreDir(NULL), "main score", permissions); - createDirectory(getScoreDir(level_subdir), "level score", permissions); + createDirectory(getMainUserGameDataDir(), "main user data", PERMS_PRIVATE); + createDirectory(getScoreDir(NULL), "main score", PERMS_PRIVATE); + createDirectory(getScoreDir(level_subdir), "level score", PERMS_PRIVATE); } void InitScoreCacheDirectory(char *level_subdir) @@ -1162,11 +1151,9 @@ void InitScoreCacheDirectory(char *level_subdir) void InitScoreTapeDirectory(char *level_subdir, int nr) { - int permissions = (program.global_scores ? PERMS_PUBLIC : PERMS_PRIVATE); - InitScoreDirectory(level_subdir); - createDirectory(getScoreTapeDir(level_subdir, nr), "score tape", permissions); + createDirectory(getScoreTapeDir(level_subdir, nr), "score tape", PERMS_PRIVATE); } static void SaveUserLevelInfo(void); diff --git a/src/libgame/system.c b/src/libgame/system.c index edae9c60..9f8e3075 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -131,33 +131,6 @@ void InitRuntimeInfo() runtime.api_server = setup.api_server; } -void InitScoresInfo(void) -{ - char *global_scores_dir = getPath2(getCommonDataDir(), SCORES_DIRECTORY); - - program.global_scores = directoryExists(global_scores_dir); - program.many_scores_per_name = !program.global_scores; - -#if 0 - if (options.debug) - { - if (program.global_scores) - { - Debug("internal:path", "Using global, multi-user scores directory '%s'.", - global_scores_dir); - Debug("internal:path", "Remove to enable single-user scores directory."); - Debug("internal:path", "(This enables multipe score entries per user.)"); - } - else - { - Debug("internal:path", "Using private, single-user scores directory."); - } - } -#endif - - free(global_scores_dir); -} - void SetWindowTitle(void) { program.window_title = program.window_title_function(); diff --git a/src/libgame/system.h b/src/libgame/system.h index 77c6c367..9d44373c 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1017,9 +1017,6 @@ struct ProgramInfo void (*exit_message_function)(char *, va_list); void (*exit_function)(int); - boolean global_scores; - boolean many_scores_per_name; - boolean headless; }; @@ -1875,7 +1872,6 @@ void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *, void InitNetworkInfo(boolean, boolean, boolean, char *, int); void InitRuntimeInfo(void); -void InitScoresInfo(void); void SetWindowTitle(void); void InitWindowTitleFunction(char *(*window_title_function)(void));