removed storing and sending system UUID again
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 10 Aug 2021 12:54:30 +0000 (14:54 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 10 Aug 2021 12:54:30 +0000 (14:54 +0200)
src/files.c
src/libgame/misc.c
src/libgame/misc.h
src/libgame/system.c
src/libgame/system.h

index 71c966a22ef80129f01bf5e365bcfb9ea20ff594..f486dba01745e9fc418ecd6bf29942b90145f159 100644 (file)
@@ -9342,7 +9342,6 @@ static void UploadScoreToServerExt(struct HttpRequest *request,
   char *level_author        = getEscapedJSON(level.author);
   char *player_name         = getEscapedJSON(score_entry->name);
   char *player_uuid         = getEscapedJSON(setup.player_uuid);
-  char *system_uuid         = getEscapedJSON(setup.system_uuid);
 
   snprintf(request->body, MAX_HTTP_BODY_SIZE,
           "{\n"
@@ -9359,7 +9358,6 @@ static void UploadScoreToServerExt(struct HttpRequest *request,
           "  \"rate_time_over_score\": \"%d\",\n"
           "  \"player_name\":          \"%s\",\n"
           "  \"player_uuid\":          \"%s\",\n"
-          "  \"system_uuid\":          \"%s\",\n"
           "  \"score\":                \"%d\",\n"
           "  \"time\":                 \"%d\",\n"
           "  \"tape_basename\":        \"%s\",\n"
@@ -9378,7 +9376,6 @@ static void UploadScoreToServerExt(struct HttpRequest *request,
           level.rate_time_over_score,
           player_name,
           player_uuid,
-          system_uuid,
           score_entry->score,
           score_entry->time,
           score_entry->tape_basename,
@@ -9393,7 +9390,6 @@ static void UploadScoreToServerExt(struct HttpRequest *request,
   checked_free(level_author);
   checked_free(player_name);
   checked_free(player_uuid);
-  checked_free(system_uuid);
 
   ConvertHttpRequestBodyToServerEncoding(request);
 
@@ -9521,10 +9517,6 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_STRING,
     &setup.player_uuid,                                "player_uuid"
   },
-  {
-    TYPE_STRING,
-    &setup.system_uuid,                                "system_uuid"
-  },
   {
     TYPE_SWITCH,
     &setup.multiple_users,                     "multiple_users"
@@ -10336,9 +10328,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   int i;
 
   si->player_name = getStringCopy(getDefaultUserName(user.nr));
-
   si->player_uuid = NULL;      // (will be set later)
-  si->system_uuid = NULL;      // (will be set later)
 
   si->multiple_users = TRUE;
 
@@ -10886,19 +10876,13 @@ static void LoadSetup_SpecialPostProcessing(void)
   setup.scroll_delay_value =
     MIN(MAX(MIN_SCROLL_DELAY, setup.scroll_delay_value), MAX_SCROLL_DELAY);
 
-  if (setup.player_uuid == NULL ||
-      setup.system_uuid == NULL)
+  if (setup.player_uuid == NULL)
   {
-    if (setup.player_uuid == NULL)
-      setup.player_uuid = getStringCopy(GetPlayerUUID());
-
-    if (setup.system_uuid == NULL)
-      setup.system_uuid = getStringCopy(GetSystemUUID());
+    // player UUID does not yet exist in setup file
+    setup.player_uuid = getStringCopy(getUUID());
 
     SaveSetup();
   }
-
-  SetSystemUUID(setup.system_uuid);
 }
 
 void LoadSetup(void)
@@ -11031,8 +11015,7 @@ void SaveSetup(void)
   for (i = 0; i < ARRAY_SIZE(global_setup_tokens); i++)
   {
     // just to make things nicer :)
-    if (global_setup_tokens[i].value == &setup.player_uuid             ||
-       global_setup_tokens[i].value == &setup.multiple_users           ||
+    if (global_setup_tokens[i].value == &setup.multiple_users          ||
        global_setup_tokens[i].value == &setup.sound                    ||
        global_setup_tokens[i].value == &setup.graphics_set             ||
        global_setup_tokens[i].value == &setup.volume_simple            ||
index bd93e1ce170af1cc4f74a2a2a37b5869f11e50f6..b950dfd6c14c37a49febdab16d64f4db07fc45c5 100644 (file)
@@ -557,7 +557,7 @@ boolean getTokenValueFromString(char *string, char **token, char **value)
 #define UUID_CHARS             (UUID_BYTES * 2)
 #define UUID_LENGTH            (UUID_CHARS + 4)
 
-static char *getUUID(void)
+char *getUUID(void)
 {
   static char uuid[UUID_LENGTH + 1];
   int data[UUID_BYTES];
@@ -582,27 +582,6 @@ static char *getUUID(void)
   return uuid;
 }
 
-char *GetPlayerUUID(void)
-{
-  return getUUID();
-}
-
-char *GetSystemUUID(void)
-{
-  if (program.system_uuid != NULL)
-    return program.system_uuid;
-
-  return getUUID();
-}
-
-void SetSystemUUID(char *uuid)
-{
-  if (program.system_uuid != NULL)
-    checked_free(program.system_uuid);
-
-  program.system_uuid = getStringCopy(uuid);
-}
-
 
 // ----------------------------------------------------------------------------
 // counter functions
index 1665a2469f32cb34a9640a84bd1a73b043712b20..83b7773018d21f24b374cac499885da11e1a2aac 100644 (file)
@@ -120,9 +120,7 @@ int log_2(unsigned int);
 
 boolean getTokenValueFromString(char *, char **, char **);
 
-char *GetPlayerUUID(void);
-char *GetSystemUUID(void);
-void SetSystemUUID(char *);
+char *getUUID(void);
 
 void InitCounter(void);
 unsigned int Counter(void);
index f186c143d298cfd4c933e19938e8b226d13b5d41..28d8ebae635b09027136b57abed0035f377ec8c9 100644 (file)
@@ -103,8 +103,6 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir,
   program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout;
   program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr;
 
-  program.system_uuid = NULL;
-
   program.headless = FALSE;
 }
 
index bf7ec1a4306200bf146ed2e6047eab6925aa2bf9..4f17a86c198ccd562640ac9de19fb859b267563c 100644 (file)
@@ -1013,8 +1013,6 @@ struct ProgramInfo
   void (*exit_message_function)(char *, va_list);
   void (*exit_function)(int);
 
-  char *system_uuid;           // initialized when reading first setup file
-
   boolean headless;
 };
 
@@ -1432,9 +1430,7 @@ struct SetupDebugInfo
 struct SetupInfo
 {
   char *player_name;
-
   char *player_uuid;
-  char *system_uuid;
 
   boolean multiple_users;