Skip to content

rc_api_process_submit_lboard_entry_response

Jamiras edited this page Mar 1, 2024 · 3 revisions

Parses the response for submitting a leaderboard entry for a user.

Syntax

// 11.0+
int rc_api_process_submit_lboard_entry_server_response(
    rc_api_submit_lboard_entry_response_t* response,
    const rc_api_server_response_t* server_response
);

// [deprecated]
int rc_api_process_submit_lboard_entry_response(
    rc_api_submit_lboard_entry_response_t* response,
    const char* server_response
);

Parameters

response

The rc_api_submit_lboard_entry_response_t to construct.

server_response

The body of the HTTP response received from the server.


struct rc_api_submit_lboard_entry_response_t
{
  int submitted_score;
  int best_score;
  unsigned new_rank;
  unsigned num_entries;

  rc_api_lboard_entry_t* top_entries;
  unsigned num_top_entries;

  rc_api_response_t response;
};

submitted_score

The value that was submitted.

best_score

The player's best submitted value.

new_rank

The player's new rank within the leaderboard.

num_entries

The number of entries in the leaderboard.

top_entries

An array of rc_api_lboard_entry_t for the best entries in the leaderboard.

num_top_entries

The number of items in the top_entries array.

response

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


struct rc_api_submit_lboard_entry_response_t
{
  const char* username;
  unsigned rank;
  int score;
}

username

The name of the user associated to the entry.

rank

The rank of the user associated to the entry.

score

The score for the user associated to the entry.

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_submit_lboard_entry_response_t must be destroyed by rc_api_destroy_submit_lboard_entry_response when the caller is done with it.

Minimum version: 10.0.0

See also

rc_api_init_submit_lboard_entry_request

rc_api_destroy_submit_lboard_entry_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