Skip to content

Add user-info message support to RetroArch WebSocket monitor#55

Merged
kzryzstof merged 30 commits into
mainfrom
copilot/add-web-socket-client
Apr 3, 2026
Merged

Add user-info message support to RetroArch WebSocket monitor#55
kzryzstof merged 30 commits into
mainfrom
copilot/add-web-socket-client

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 21, 2026

Handles the "user" and "no_user" messages introduced in Octelys/retro-arch#4, alongside the previously added "game_playing", "no_game", and "achievements" messages.

retro_achievements_monitor.h

  • New retro_user_t struct:
    typedef struct {
        char     username[128];
        char     display_name[128];
        uint32_t score;
        uint32_t score_softcore;
        char     avatar_url[512];
    } retro_user_t;
  • New callback types on_retro_user_t / on_retro_no_user_t
  • New subscription API: retro_achievements_subscribe_user() / retro_achievements_subscribe_no_user()

retro_achievements_monitor.c

  • user_subscription_t / no_user_subscription_t linked lists and notify_user() / notify_no_user() dispatch helpers
  • Parses {"type":"user", "username":"...", "display_name":"...", "score":N, "score_softcore":N, "avatar_url":"..."} and {"type":"no_user"}, dispatching to subscribers
  • Real and HAVE_LIBWEBSOCKETS-guarded stub implementations for both new subscription functions

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI changed the title [WIP] Add dedicated web-socket client for retro-achievements Add RetroArch WebSocket client in src/retro-achievements Mar 21, 2026
Copilot AI requested a review from kzryzstof March 21, 2026 12:54
@kzryzstof
Copy link
Copy Markdown
Collaborator

@copilot It is now missing the code to start & stop the monitoring of RA

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 21, 2026

@copilot It is now missing the code to start & stop the monitoring of RA

Done in 5c30d57. retro_achievements_monitor_start() is now called in obs_module_load and retro_achievements_monitor_stop() is called in obs_module_unload, following the same pattern as the Xbox monitor.

@kzryzstof
Copy link
Copy Markdown
Collaborator

@copilot In the PR Octelys/retro-arch#4, I just have added the support to send the retro-achievements as another message. Update this current branch to retrieve them.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 21, 2026

@copilot In the PR Octelys/retro-arch#4, I just have added the support to send the retro-achievements as another message. Update this current branch to retrie...

Done in 9c4971c. The monitor now handles the new "achievements" message shape from retro-arch#4:

New retro_achievement_t struct (in the header):

typedef struct {
    uint32_t id;
    char     name[256];
    uint32_t points;
    char     status[16];    // "unlocked" or "locked"
    char     badge_url[512];
} retro_achievement_t;

New callback type and subscription API:

typedef void (*on_retro_achievements_t)(const retro_achievement_t *achievements, size_t count);
void retro_achievements_subscribe_achievements(on_retro_achievements_t callback);

The monitor parses the incoming {"type":"achievements","items":[...]} message, builds the array of retro_achievement_t records, and dispatches it to all subscribers.

Copilot AI changed the title Add RetroArch WebSocket client in src/retro-achievements Add user-info message support to RetroArch WebSocket monitor Mar 21, 2026
…ith bitwise operations, improve logging, and streamline iteration.
…ate related files to `integrations` directory, introduce `identity` abstraction, and clean up includes.
…ntegrations, centralize event handling, and simplify source dependencies.
…s into a unified, platform-agnostic abstraction; migrate platform-specific logic to `integrations/*`; update monitoring service to centralize game and achievement event handling.
…ostic components; introduce game cover URL support, centralized event handling, and HTTP URL normalization.
…l cover URLs, adjust logging levels in RetroAchievements integration.
…ion and cache handling in Xbox and platform integrations.
…sure consistent setup and initialization across monitoring and game-played events.
… and Retro sources; rename and generalize source types
…e identity notifications and source prioritization across Xbox and RetroAchievements integrations.
…e identity notifications and source prioritization across Xbox and RetroAchievements integrations.
…esponding unit tests to verify callback behavior and source prioritization.
@kzryzstof kzryzstof marked this pull request as ready for review April 3, 2026 23:55
@kzryzstof kzryzstof merged commit 821b97f into main Apr 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants