LBPUnion / ProjectLighthouse

Project Lighthouse is a clean-room, open-source custom server for LittleBigPlanet.
GNU Affero General Public License v3.0
211 stars 53 forks source link

Implement player count per platform and player list API endpoints #1014

Closed Slendy closed 2 months ago

Slendy commented 7 months ago

This PR adds new endpoints to the v1 API to support fetching player counts grouped by platform as well as fetching the entire list of online users.

Example /api/v1/players response:

{
  "players": [
    {
      "username": "Slendy",
      "game": "LittleBigPlanet2",
      "platform": "RPCS3"
    }
  ]
}

Example /api/v1/playerCount/platform response:

{
  "platforms": [
    {
      "platform": "PS3",
      "playerCount": 0
    },
    {
      "platform": "RPCS3",
      "playerCount": 1
    },
    {
      "platform": "Vita",
      "playerCount": 0
    },
    {
      "platform": "PSP",
      "playerCount": 0
    }
  ],
  "totalPlayerCount": 1
}
W0lf4llo commented 6 months ago

LGTM