# Leaderboard Score Submit

## Goal

Report a score and optionally open the native Leaderboard UI.

## Prerequisite

Make sure the player is authenticated first. Use `use-case-1-auth-bootstrap.md` for a safe startup flow.

## Actions used

* `GameServicesReportScore`
* `GameServicesGetReportScoreSuccessResult` (on success)
* `GameServicesGetReportScoreError` (on failure)
* `GameServicesShowLeaderboardUI` (optional)

## Variables

* `leaderboardId` (String) e.g. `"top_scores"`
* `scoreValue` (Int)

## Flow

1. When the match ends (or on a milestone), store the score in `scoreValue`.
2. State: `ReportScore`
   * Action: `GameServicesReportScore`
   * Inputs: `leaderboardId`, `scoreValue` (and optional `tag`)
   * Events:
     * `successEvent` → `GetReportScoreSuccessResult` → (optional) `ShowLeaderboardUI`
     * `failureEvent` → `GetReportScoreError` (log/ignore)
3. State: `ShowLeaderboardUI` (optional)
   * Action: `GameServicesShowLeaderboardUI`
   * Input: `leaderboardId` (to open a specific board)

## Notes

* `GameServicesReportScore` waits for completion. Use the extractor actions immediately after its `successEvent`/`failureEvent`.
* Some platforms keep only the best score; submitting a lower score may not change ranking.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://assetstore.essentialkit.voxelbusters.com/features/game-services/playmaker/use-cases/use-case-3-leaderboard-submit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
