Skip to content

rc_api_process_fetch_game_sets_server_response

Jamiras edited this page Jun 17, 2025 · 1 revision

Parses the response for fetching the achievement information for a game and its subsets.

Syntax

int rc_api_process_fetch_game_sets_server_response(
    rc_api_fetch_game_sets_response_t* response,
    const rc_api_server_response_t* server_response
);

Parameters

response

The rc_api_fetch_game_sets_response_t to construct.

server_response

The body of the HTTP response received from the server.


struct rc_api_fetch_game_sets_response_t
{
  unsigned id;
  unsigned console_id;
  const char* title;
  const char* image_name;
  const char* image_url;
  const char* rich_presence_script;
  uint32_t session_game_id;

  rc_api_achievement_set_definition_t* sets;
  unsigned num_sets;

  rc_api_response_t response;
};

id

The unique identifier of the game.

console_id

The console associated to the game.

title

The title of the game.

image_name

The image name for the game.

image_url

The URL to the badge image for the game.

rich_presence_script

The rich presence script for the game.

session_game_id

The unique identifier of the game that owns the subsets (usually matches id).

sets

An array of rc_api_achievement_set_definition_t associated to the game.

num_sets

The number of items in the sets array.

response

Common server-provided response information. Contains a succeeded flag, and an error_message field.


struct rc_api_achievement_set_definition_t
{
  unsigned id;
  unsigned game_id;
  const char* title;
  const char* image_name;
  const char* image_url;

  rc_api_achievement_definition_t* achievements;
  unsigned num_achievements;

  rc_api_leaderboard_definition_t* leaderboards;
  unsigned num_leaderboards;

  uint8_t type;
};

id

The unique identifier of the achievement set.

game_id

The unique identifier of the game that owns the achievement set.

title

The title of the achievement set.

image_name

The name of the image for the achievement set.

image_url

URL to the badge image for the achievement set.

achievements

An array of rc_api_achievement_definition_t associated to the game. (See rc_api_process_fetch_game_data_response for definition of rc_api_achievement_definition_t).

num_achievements

The number of items in the achievements array.

leaderboards

An array of rc_api_leaderboard_definition_t associated to the game. (See rc_api_process_fetch_game_data_response for definition of rc_api_leaderboard_definition_t).

num_leaderboards

The number of items in the leaderboards array.

Return value

If the function succeeds, the return value is RC_OK. Otherwise, the error code can be converted to a string using rc_error_str.

  • RC_INVALID_JSON - the response was not valid JSON.
  • RC_MISSING_VALUE - one or more required fields was not found in the response.

Remarks

The rc_api_fetch_game_sets_response_t must be destroyed by rc_api_destroy_fetch_game_sets_response when the caller is done with it.

Minimum version: 12.0.0

See also

rc_api_init_fetch_game_sets_request

rc_api_destroy_fetch_game_sets_response

rcheevos
rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime
rhash
rapi

common

user

runtime

info

Clone this wiki locally