added sending level set name when getting scores from server
authorHolger Schemel <info@artsoft.org>
Sun, 24 Oct 2021 10:29:02 +0000 (12:29 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 24 Oct 2021 10:29:02 +0000 (12:29 +0200)
src/files.c

index 11eba8f4b95dd2c3cd72b620d64c9ae8e388381e..0b5ff039a98f385270e469ca2bd459eae6c64fa8 100644 (file)
@@ -9114,20 +9114,28 @@ static boolean SetRequest_ApiGetScore(struct HttpRequest *request,
   request->method   = API_SERVER_METHOD;
   request->uri      = API_SERVER_URI_GET;
 
+  char *levelset_identifier = getEscapedJSON(leveldir_current->identifier);
+  char *levelset_name       = getEscapedJSON(leveldir_current->name);
+
   snprintf(request->body, MAX_HTTP_BODY_SIZE,
           "{\n"
           "%s"
           "  \"game_version\":         \"%s\",\n"
           "  \"game_platform\":        \"%s\",\n"
           "  \"levelset_identifier\":  \"%s\",\n"
+          "  \"levelset_name\":        \"%s\",\n"
           "  \"level_nr\":             \"%d\"\n"
           "}\n",
           getPasswordJSON(setup.api_server_password),
           getProgramRealVersionString(),
           getProgramPlatformString(),
-          levelset.identifier,
+          levelset_identifier,
+          levelset_name,
           level_nr);
 
+  checked_free(levelset_identifier);
+  checked_free(levelset_name);
+
   ConvertHttpRequestBodyToServerEncoding(request);
 
   return TRUE;