-
Notifications
You must be signed in to change notification settings - Fork 34
rc_client_set_event_handler
Provides a callback for notifying the emulator when things happen inside the runtime as the result of a call to rc_client_do_frame, rc_client_reset, or rc_client_deserialize_progress so the emulator can provide visual cues to the player.
void rc_client_set_event_handler(
rc_client_t* client,
rc_client_event_handler_t handler
);
client
The rc_client_t
to associate the handler
to.
handler
Function to call when various events happen during processing.
void (*rc_client_event_handler_t)(
const rc_client_event_t* event,
rc_client_t* client
);
event
Information about the event that occurred.
client
The rc_client_t
that spawned the event.
typedef struct rc_client_event_t
{
uint32_t type;
rc_client_achievement_t* achievement;
rc_client_leaderboard_t* leaderboard;
rc_client_leaderboard_tracker_t* leaderboard_tracker;
rc_client_server_error_t* server_error;
} rc_client_event_t;
type
The type of event that occurred.
achievement
The achievement associated to the event (for achievement events).
leaderboard
The leaderboard associated to the event (for leaderboard events).
leaderboard_tracker
The leaderboard tracker associated to the event (for leaderboard tracker events).
server_error
Additional information about the error.
An achievement
was earned by the player. The handler should notify the player that the achievement was earned.
A challenge achievement
has become active. The handler should show a small version of the achievement icon to indicate the challenge is active.
A challenge achievement
has become inactive. The handler should hide the small version of the achievement icon that was shown by the corresponding RC_CLIENT_EVENT_ACHIEVEMENT_CHALLENGE_INDICATOR_SHOW event.
An achievement
that tracks progress has changed the amount of progress that has been made. The handler should show a small version of the achievement icon along with the achievement->measured_progress
text (for two seconds).
Only one progress indicator should be shown at a time. If a progress indicator is already visible, it should be updated with the new icon and text, and the two second timer should be restarted.
All achievements for the game have been earned. The handler should notify the player that the game was completed (softcore) or mastered (hardcore), preferably with the user's display name for screenshot purposes, and the user's total playtime.
A leaderboard
attempt has started. The handler may show a message with the leaderboard title and/or description indicating the attempt started.
A leaderboard
attempt has failed. The handler may show a message with the leaderboard title and/or description indicating the attempt failed.
A leaderboard
attempt was completed. The handler may show a message with the leaderboard title and/or description indicating the final value being submitted to the server.
A leaderboard_tracker
has become active. The handler should show the tracker text on screen.
Multiple active leaderboards may share a single tracker if they have the same definition and value. As such, the leaderboard tracker IDs are unique amongst the leaderboard trackers, and have no correlation to the active leaderboard(s).
The leaderboard_tracker
value has been updated. The handler should update the tracker text on the screen.
A leaderboard_tracker
has become inactive. The handler should hide the tracker text from the screen.
A leaderboard
entry has been successfully submitted and the server returned information about the player's rank and the top entries for the leaderboard_scoreboard
.
The runtime is requesting that the emulator be reset. As part of the reset progress, the emulator should call rc_client_reset to inform the runtime that the reset occurred.
Called when a server error should be reported to the player. The handler should display the error.
This is only raised for errors that occur as the result of the runtime making server calls outside of rc_client_begin_ interactions (such as unlocking an achievement).
An request to update the user's state on the server failed in a non-fatal manner and has been queued to be attempted again. The handler can place an indicator on the screen to show the user that their state is not synchronized.
All pending updates to the user's state have been completed. The handler can remove any indicator shown by the RC_CLIENT_EVENT_DISCONNECTED
event.
Minimum version: 11.0.0
- rc_client_abort_async
- rc_client_create
- rc_client_destroy
- rc_client_enable_logging
- rc_client_get_encore_mode_enabled
- rc_client_get_hardcore_enabled
- rc_client_get_spectator_mode_enabled
- rc_client_get_unofficial_enabled
- rc_client_get_user_agent_clause
- rc_client_get_userdata
- rc_client_set_encore_mode_enabled
- rc_client_set_hardcore_enabled
- rc_client_set_host
- rc_client_set_spectator_mode_enabled
- rc_client_set_unofficial_enabled
- rc_client_set_userdata
- rc_client_begin_login_with_password
- rc_client_begin_login_with_token
- rc_client_get_user_info
- rc_client_get_user_game_summary
- rc_client_logout
- rc_client_user_get_image_url
- rc_client_achievement_get_image_url
- rc_client_begin_change_media
- rc_client_begin_change_media_from_hash
- rc_client_begin_fetch_leaderboard_entries
- rc_client_begin_fetch_leaderboard_entries_around_user
- rc_client_begin_identify_and_load_game
- rc_client_begin_load_game
- rc_client_create_achievement_list
- rc_client_create_leaderboard_list
- rc_client_destroy_achievement_list
- rc_client_destroy_leaderboard_entry_list
- rc_client_destroy_leaderboard_list
- rc_client_game_get_image_url
- rc_client_get_achievement_info
- rc_client_get_game_info
- rc_client_get_leaderboard_info
- rc_client_get_load_game_state
- rc_client_get_rich_presence_message
- rc_client_has_achievements
- rc_client_has_leaderboards
- rc_client_has_rich_presence
- rc_client_is_game_loaded
- rc_client_leaderboard_entry_get_user_image_url
- rc_client_unload_game
- rc_client_can_pause
- rc_client_deserialize_progress
- rc_client_do_frame
- rc_client_idle
- rc_client_is_processing_required
- rc_client_progress_size
- rc_client_reset
- rc_client_serialize_progress
- rc_client_set_event_handler
- rc_client_set_read_memory_function
- rc_client_begin_load_raintegration
- rc_client_raintegration_activate_menu_item
- rc_client_raintegration_get_achievement_state
- rc_client_raintegration_get_menu
- rc_client_raintegration_has_modifications
- rc_client_raintegration_rebuild_submenu
- rc_client_raintegration_set_console_id
- rc_client_raintegration_set_event_handler
- rc_client_raintegration_set_get_game_name_function
- rc_client_raintegration_set_write_memory_function
- rc_client_raintegration_update_main_window_handle
- rc_client_raintegration_update_menu_item
- rc_client_unload_raintegration
- rc_runtime_activate_achievement
- rc_runtime_activate_lboard
- rc_runtime_activate_richpresence
- rc_runtime_deactivate_achievement
- rc_runtime_deactivate_lboard
- rc_runtime_deserialize_progress
- rc_runtime_destroy
- rc_runtime_do_frame
- rc_runtime_format_achievement_measured
- rc_runtime_format_lboard_value
- rc_runtime_get_achievement
- rc_runtime_get_achievement_measured
- rc_runtime_get_lboard
- rc_runtime_get_richpresence
- rc_runtime_init
- rc_runtime_invalidate_address
- rc_runtime_progress_size
- rc_runtime_reset
- rc_runtime_serialize_progress
- rc_runtime_validate_addresses
- rc_hash_destroy_iterator
- rc_hash_generate_from_buffer
- rc_hash_generate_from_file
- rc_hash_init_custom_cdreader
- rc_hash_init_custom_filereader
- rc_hash_init_error_message_callback
- rc_hash_init_verbose_message_callback
- rc_hash_initialize_iterator
- rc_hash_iterate
- rc_api_destroy_fetch_user_unlocks_response
- rc_api_destroy_login_response
- rc_api_destroy_start_session_response
- rc_api_init_fetch_user_unlocks_request
- rc_api_init_login_request
- rc_api_init_start_session_request
- rc_api_process_fetch_user_unlocks_response
- rc_api_process_login_response
- rc_api_process_start_session_response
- rc_api_destroy_award_achievement_response
- rc_api_destroy_fetch_game_data_response
- rc_api_destroy_ping_response
- rc_api_destroy_resolve_hash_response
- rc_api_destroy_submit_lboard_entry_response
- rc_api_init_award_achievement_request
- rc_api_init_fetch_game_data_request
- rc_api_init_fetch_image_request
- rc_api_init_ping_request
- rc_api_init_resolve_hash_request
- rc_api_init_submit_lboard_entry_request
- rc_api_process_award_achievement_response
- rc_api_process_fetch_game_data_response
- rc_api_process_ping_response
- rc_api_process_resolve_hash_response
- rc_api_process_submit_lboard_entry_response
- rc_api_destroy_fetch_achievement_info_response
- rc_api_destroy_fetch_game_titles_response
- rc_api_destroy_fetch_games_list_response
- rc_api_destroy_fetch_leaderboard_info_response
- rc_api_init_fetch_achievement_info_request
- rc_api_init_fetch_game_titles_request
- rc_api_init_fetch_games_list_request
- rc_api_init_fetch_leaderboard_info_request
- rc_api_process_fetch_achievement_info_response
- rc_api_process_fetch_game_titles_server_response
- rc_api_process_fetch_games_list_response
- rc_api_process_fetch_leaderboard_info_response