mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 21:18:36 +00:00
Account Modal - Games Tab (#4473)
Continuation of https://github.com/openfrontio/infra/pull/386, adds play games sessions <img width="971" height="771" alt="image" src="https://github.com/user-attachments/assets/42c6bcbb-d690-4cd1-b859-3299a03f4350" /> - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory regression is found: w.o.n --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+52
@@ -120,6 +120,58 @@ GET https://api.openfront.io/public/player/:playerId/sessions
|
||||
curl "https://api.openfront.io/public/player/HabCsQYR/sessions"
|
||||
```
|
||||
|
||||
### Get Player Games
|
||||
|
||||
Retrieve a player's personal game history, newest first. Uses keyset (cursor)
|
||||
pagination rather than the `page`/`limit` scheme used elsewhere.
|
||||
|
||||
**Endpoint:**
|
||||
|
||||
```
|
||||
GET https://api.openfront.io/public/player/:playerId/games
|
||||
```
|
||||
|
||||
**Query Parameters:**
|
||||
|
||||
- `filter` (optional): Mode bucket, one of `[ffa, team, hvn, ranked]`. Omit for all modes.
|
||||
- `type` (optional): Game type, one of `[public, private, singleplayer]`. Omit for all types. `filter` and `type` are orthogonal and may be combined.
|
||||
- `cursor` (optional): Opaque continuation token. Pass the `nextCursor` value from the previous response verbatim to fetch the next page — do not construct or parse it.
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"gameId": "abc123",
|
||||
"start": "2026-05-17T21:04:00.000Z",
|
||||
"durationSeconds": 1234,
|
||||
"map": "World",
|
||||
"mode": "Team",
|
||||
"type": "Public",
|
||||
"playerTeams": "Duos",
|
||||
"rankedType": "unranked",
|
||||
"result": "victory",
|
||||
"totalPlayers": 8,
|
||||
"username": "alice",
|
||||
"clanTag": "ABC"
|
||||
}
|
||||
],
|
||||
"nextCursor": "opaque-token"
|
||||
}
|
||||
```
|
||||
|
||||
- `result` is one of `[victory, defeat, incomplete]` (`incomplete` = no recorded winner).
|
||||
- `playerTeams`, `totalPlayers`, and `clanTag` may be `null`.
|
||||
- `nextCursor` is `null` when there are no more games.
|
||||
- `username`/`clanTag` reflect the identity the player used in that specific game.
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
curl "https://api.openfront.io/public/player/HabCsQYR/games?filter=team&type=public"
|
||||
```
|
||||
|
||||
## Clans
|
||||
|
||||
### Clan Leaderboard
|
||||
|
||||
Reference in New Issue
Block a user