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"
" \"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"
level.rate_time_over_score,
player_name,
player_uuid,
- system_uuid,
score_entry->score,
score_entry->time,
score_entry->tape_basename,
checked_free(level_author);
checked_free(player_name);
checked_free(player_uuid);
- checked_free(system_uuid);
ConvertHttpRequestBodyToServerEncoding(request);
TYPE_STRING,
&setup.player_uuid, "player_uuid"
},
- {
- TYPE_STRING,
- &setup.system_uuid, "system_uuid"
- },
{
TYPE_SWITCH,
&setup.multiple_users, "multiple_users"
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;
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)
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 ||
#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];
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