From: Holger Schemel Date: Tue, 10 Aug 2021 12:54:30 +0000 (+0200) Subject: removed storing and sending system UUID again X-Git-Tag: 4.3.0.0~96 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c8a6ab54243a4f0b45ae03e6acbf55b15fb4338f;p=rocksndiamonds.git removed storing and sending system UUID again --- diff --git a/src/files.c b/src/files.c index 71c966a2..f486dba0 100644 --- a/src/files.c +++ b/src/files.c @@ -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 || diff --git a/src/libgame/misc.c b/src/libgame/misc.c index bd93e1ce..b950dfd6 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -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 diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 1665a246..83b77730 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -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); diff --git a/src/libgame/system.c b/src/libgame/system.c index f186c143..28d8ebae 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -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; } diff --git a/src/libgame/system.h b/src/libgame/system.h index bf7ec1a4..4f17a86c 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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;