Skip to content

rc_client_begin_load_game

Jamiras edited this page Jun 30, 2023 · 3 revisions

Starts loading a game from a previously generated hash.

Syntax

rc_client_async_handle_t* rc_client_begin_load_game(
    rc_client_t* client,
    const char* hash,
    rc_client_callback_t callback,
    void* callback_userdata
);

Parameters

client

The rc_client_t to manage the game.

hash

The RetroAchievements hash that identifies the game to be loaded.

callback

Function to call when the game load process completes.

callback_userdata

Additional information to pass to the callback function.

Returns

Pointer to an rc_client_async_handle_t that can be passed to rc_client_abort_async to cancel the load game request. The rc_client_async_handle_t is invalid after callback has been called.


rc_client_callback_t

void (*rc_client_callback_t)(
    int result,
    const char* error_message,
    rc_client_t* client,
    void* userdata
);

result

RC_OK on success, or an error code indicating the failure.

result problem
RC_OK Game was successfully loaded.
RC_NO_GAME_LOADED The game could not be identified.
RC_LOGIN_REQUIRED A logged in user is required.
RC_ABORTED The process was canceled before it finished (rc_client_unload_game was called, or another game started loading).
RC_INVALID_STATE Generic failure. See error_message for details.
RC_INVALID_JSON Server response could not be processed.
RC_MISSING_VALUE Server response was not complete.
RC_API_FAILURE Error occurred on the server. See error_message for details.

error_message

NULL on success, or a message related to a non-successful result.

client

The rc_client_t that was handling the load game attempt.

userdata

A client provided pointer passed to the begin function as callback_userdata.

Remarks

If successful, rc_client_get_game_info will return information about the game.

If the game could not be identified, rc_client_get_game_info will return a dummy game object containing the hash that did not resolve.

Minimum version: 11.0.0

See also

rc_client_begin_identify_and_load_game

rc_client_get_game_info

rc_client_unload_game

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