Skip to content

rc_client_deserialize_progress

Jamiras edited this page Mar 1, 2024 · 3 revisions

Restores the state of the runtime from a buffer created by rc_client_serialize_progress.

Syntax

// 11.2+
int rc_client_deserialize_progress_sized(
    rc_client_t* client,
    const uint8_t* serialized,
    size_t serialized_size
);

// [deprecated]
int rc_client_deserialize_progress(
    rc_client_t* client,
    const uint8_t* serialized
);

Parameters

client

The rc_client_t containing a loaded game.

serialized

A buffer containing data previously generated by rc_client_serialize_progress.

It may be from previous runs of the application (stored on disk), or even from previous versions of the runtime (if compatible).

If passed NULL, all achievements and leaderboards will be set back to waiting state (same as if rc_client_reset were called).

serialized_size

The number of bytes in serialized.

Return value

RC_OK on success, or an error code indicating failure.

result description
RC_OK The runtime data was successfully deserialized from serialized.
RC_NO_GAME_LOADED No game is loaded.
RC_INVALID_STATE A deserialization error occurred.

Remarks

Events may be raised to update the visible trackers/indicators after the state is restored.

The buffer size is inferred from the data in the buffer. If the buffer is incomplete or corrupted, the deserializer may attempt to read past the end of the buffer. The serialized format has several markers, and will abort if they are not found when expected.

Minimum version: 11.0.0

See also

rc_client_serialize_progress

rc_client_set_event_handler

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