Skip to content

rc_client_begin_identify_and_change_media

Jamiras edited this page Jun 17, 2025 · 1 revision

Switches the loaded media for the active game.

Syntax

rc_client_async_handle_t* rc_client_begin_identify_and_change_media(
    rc_client_t* client,
    const char* file_path,
    const uint8_t* data,
    size_t data_size,
    rc_client_callback_t callback,
    void* callback_userdata
);

Parameters

client

The rc_client_t to manage the game.

file_path

The path to the file to be hashed. If providing data, this must still be set so the filename extension can be used to help select the appropriate hashing algorithm for the data.

data

Pointer to the data to be hashed (usually an in-memory copy of the game file). If NULL, the file specified by the path parameter will be used.

data_size

The number of bytes pointed to by the data parameter. Ignored if data is NULL.

callback

Function to call when the media change 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 change media 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
);

result

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

result problem
RC_OK Game was successfully loaded.
RC_NO_GAME_LOADED An active game is required.
RC_HARDCORE_DISABLED The new media could not be identified, so hardcore was disabled.
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.

Remarks

If a hash cannot be generated for the new media, it is assumed to not be able to affect the loaded game (i.e. an audio CD for a rhythm game). If the hash does resolve to a known hash, it will be allowed as either a valid media for the loaded game, or something that won't affect the loaded game. If the hash does not resolve to a known hash, hardcore will be disabled and RC_HARDCORE_DISABLED will be passed to the callback.

Minimum version: 11.2.0 (renamed from rc_client_begin_change_media_from_hash in 12.0.0)

See also

rc_client_begin_change_media

rc_client_begin_identify_and_load_game

rc_client_begin_load_game

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