Skip to content

Add WebSocket messages for beatmap data and user activity#38071

Open
tsunyoku wants to merge 1 commit into
ppy:masterfrom
tsunyoku:add-basic-websocket-data
Open

Add WebSocket messages for beatmap data and user activity#38071
tsunyoku wants to merge 1 commit into
ppy:masterfrom
tsunyoku:add-basic-websocket-data

Conversation

@tsunyoku

Copy link
Copy Markdown
Member

Warning

To any onlookers, this API is still rapidly changing. Please expect further breaking changes and do not use this PR to flood requests for what data should be available.

RFC.

Example beatmap message

{
    "beatmap_id": 1614228,
    "beatmap_set_id": 760694,
    "beatmap_hash": "1cf9f752f9c92dc5b8a2138d0c2e1653",
    "metadata": {
        "artist": "Loki",
        "artist_unicode": "Loki",
        "title": "A New King Is Born",
        "title_unicode": "A New King Is Born",
        "author": "DTM9 Nowa",
        "source": "osu!",
        "tags": "Mapping with rewards MWR The Fall of a Hero symphonic metal",
        "user_tags": []
    },
    "difficulty": {
        "approach_rate": 8.5,
        "circle_size": 3.5,
        "overall_difficulty": 6.0,
        "drain_rate": 5.0
    },
    "difficulty_name": "Hyper",
    "ruleset_id": 0,
    "bpm": 190.0,
    "star_rating": 4.05,
    "status": 1,
    "type": "BeatmapMessage"
}

Example user activity message

{"status":"ChoosingBeatmap","type":"UserActivityMessage"}

public required double StarRating { get; init; }

[JsonProperty("status")]
public required BeatmapOnlineStatus Status { get; init; }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want this enum (and any future cases) to serialize as a string rather than an int, depending on what future documentation for the WebSocket may look like once it reaches a mature state.

Indifferent, would appreciate another opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant