removed support for global (common/system-wide) scores directory
authorHolger Schemel <info@artsoft.org>
Fri, 14 May 2021 16:43:49 +0000 (18:43 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 14 May 2021 16:43:49 +0000 (18:43 +0200)
src/files.c
src/game.c
src/init.c
src/libgame/setup.c
src/libgame/system.c
src/libgame/system.h

index f3bf9f757856260f3a77f672ced1f06a1dd3b9c0..b43b89c8035cfa8646e4f0220260515f9371f71f 100644 (file)
@@ -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)
index 914c25206477f1e8cd9516af34d8571618128ac4..23fe5f91eae8572a6dc463d56e2392806bf28970 100644 (file)
@@ -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)
index fbd103da06dece9cb8f34c5f18822cae05964563..5888e26f88b0bc3bda95f634734767a32b02036f 100644 (file)
@@ -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);
 
index 1d3be4fa3e064992cc59eecaa6fb029f8f9c6db1..2580b6dcbb1bfce7c6782f3fb98c1eb82699a644 100644 (file)
@@ -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);
index edae9c60944407647aa230587271253dba7938fd..9f8e3075cc468ce87647497d090c302571245522 100644 (file)
@@ -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();
index 77c6c367601a1d6b8e304e374be19cd8ef7fba04..9d44373cf42c54cf0f4d036f98c843fe2b43aed5 100644 (file)
@@ -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));