# Changelog

All notable changes to **CoolAPI** (the Cool GameX Unity SDK).
This project follows [Semantic Versioning](https://semver.org/).

## [2.0.0] — 2026-09-25
The big one. Everything from 1.x still works — existing code and scenes keep compiling.

### Added
- **Setup window** — *Tools › Cool GameX › Setup*: enter your game slug, test the
  connection, **sign in for Editor testing** (no more pasting tokens), load your
  achievements and DLC, test-unlock them, and tweak options. Opens by itself on first import.
- **Zero-code start** — a settings asset (`Resources/CoolGameXSettings`) starts the SDK
  automatically. No `Initialize()` call or scene object required.
- **Type-safe IDs** — *Generate IDs* writes `Ids.Achievements.*` and `Ids.DLC.*`
  constants, so a typo is a compile error instead of a silently failed unlock.
- **Leaderboards** — `CoolAPI.Leaderboards.Submit / GetTop / GetAroundMe`. Boards are
  created on first submit; keep-best by default; ascending boards for speedruns.
- **Cloud saves** — `CoolAPI.CloudSave.Save / Load / Delete / List`, with generic
  `Save<T>` / `Load<T>` for any `[Serializable]` class (50 slots × 512 KB).
- **Player & ownership** — `CoolAPI.Player.GetProfile()`, `CoolAPI.Ownership.OwnsGame()`.
- **Achievement state** — `Achievements.GetAll()` (with unlock state), `IsUnlocked()`,
  the `Unlocked` event with name/points/icon, and `Progress(slug, current, target)` for
  incremental achievements.
- **Offline queue** — unlocks, stat changes and playtime made offline are saved and
  synced automatically when the connection returns.
- **Debug overlay** (F8) — connection, session, queue, one-click test unlocks and the
  recent SDK log. On in the Editor and development builds.
- **In-game toasts** for unlocks when the game isn't started from the launcher.
- `CoolAPI.InitializeAsync`, `Configure`, `ConnectAsync`, `ConnectionChanged` and
  `SignedIn` events, `LaunchedFromLauncher`, `LogLevel`.

### Changed
- **Secure game sessions.** Games started from the launcher now receive a token scoped
  to that one game instead of the player's account token. It lasts 12 hours and the SDK
  refreshes it automatically — sessions no longer expire after an hour.
- Requests retry automatically on network hiccups and show the server's error message.
- Games read the backend address from the launcher (`--cgx-api`), so a leftover
  `localhost` URL can't break a shipped build.
- Playtime: with the default *Auto* mode the launcher times games it starts and the SDK
  only tracks standalone runs — minutes are no longer counted twice. The remainder of a
  session is saved on quit and sent next launch.
- Request bodies are built with `JsonUtility`, so special characters are always escaped.

## [1.4.0] — 2026-06-06
### Added
- **Player Stats are real now** (no longer a stub): `CoolAPI.Stats.Set`,
  `CoolAPI.Stats.Add` (returns the new total), `CoolAPI.Stats.Get`, and
  `CoolAPI.Stats.GetAllJson()`. Stats persist on the backend, across machines.
  Convenience helpers on the component: `CoolGameXManager.SetStat/AddStat`.
- **Typed achievement list:** `CoolAPI.Achievements.GetDefinitions()` returns
  `AchievementInfo[]` (slug, name, description, points, hidden, icon URL).
- **One-click install:** download a ready-to-import `.unitypackage` from
  `coolgamex.com/sdk` — double-click to add CoolAPI to any Unity project.

## [1.3.0] — 2026-06-06
### Added
- **Connection status for devs:** `CoolAPI.IsConnected` (auto-updated after every
  request) and `CoolAPI.CheckConnection()` to ping the server on demand — great
  for an online/offline indicator.
- `CoolAPI.StatusLine()` — one-line debug string of
  `initialized` / `connected` / `authenticated` state.
- This **CHANGELOG**, plus a clearer "free for everyone" description.

## [1.2.0] — 2026-06-05
### Added
- **DLC ownership:** `CoolAPI.DLC.Owns("slug")` and `CoolAPI.DLC.ListOwned()`.
- **Request timeouts** (`Net.TimeoutSeconds`, default 20s) so calls can't hang.

## [1.1.0] — 2026-06-05
### Added
- **`CoolGameXManager`** drop-in component — zero-code setup + playtime heartbeat.
- **`Achievements.OnAchievementUnlocked`** event (fires only on first unlock).
- **`UnlockDetailed()`** returning `{ Success, NewlyUnlocked, Error }`.
- **`CoolAPI.LastError` / `LastStatus`** for easier debugging.

## [1.0.0] — 2026-06-05
### Added
- Initial release: `Initialize`, launcher-token auth (`--cgx-token`),
  achievements (`Unlock`), playtime tracking, and the awaitable HTTP layer.
