DaFluffyPotato / hitbloq

a competitive beat saber service
MIT License
20 stars 4 forks source link

Add Matchmaking API Endpoints #50

Closed DaFluffyPotato closed 2 years ago

DaFluffyPotato commented 2 years ago

[GET] /api/mm/ss_user/<scoresaber_id> Get a matchmaking profile based on ScoreSaber ID. At a minimum, the Hitbloq ID, the ScoreSaber ID, the username, and the mmr will be returned.

Preview (JSON)

{
    "_id": <int:hitbloq_id>,
    "scoresaber_id": <str:scoresaber_id>,
    "rating": <float:mmr>,
    "username": <str:username>
}

[GET] /api/mm/user/<hitbloq_id> Get a matchmaking profile based on Hitbloq ID. Returns the same data as the other endpoint.

[POST] /api/mm/submit_match Send in new match results with a valid matchmaker's key.

Example Format (JSON)

{
    "key": "3180af9e8cd33",
    "players": ["76561198098172449", "76561198364346087"],
    "pool": "funtech",
    "left": [false, false],
    "maps": [
        {
             "map_id": "664F8823D370AF4D4F47450F84159A9DA4225B3F|_ExpertPlus_SoloStandard",
             "scores": [42069, 69420]
        },
        {
             "map_id": "56B6D3A24056D8EA831066CFC896BD04884DEE71|_ExpertPlus_SoloStandard",
             "scores": [133742, 421337]
        }
    ]
}

Scores are assigned to the corresponding player based on the index of the score. For example, 133742 is 76561198098172449's score.

The "left" field keeps track of who left mid-match. false meant they stayed and true means they left.

[GET] /api/mm/active_pools Get a list of active matchmaking pools.

{
   "pools": ["bbbear", "funtech"],
}