# V2 Steamworks SDK Integration

Phase 72 task 72.21.1.2 is implemented by the
[Steamworks SDK integration contract](../../ue/Content/V2/Online/SteamworksSdkIntegration_V2_Contract.json)
and the `V2OnlineServices` Steamworks API surface. The integration routes
Steamworks calls through `FV2SteamworksSdkIntegrationConfig`,
`FV2SteamworksSdkRequest`, and `FV2SteamworksSdkOperationPlan` so gameplay code
plans native calls without including Steamworks headers.

The `V2SteamworksSdkBridge` covers achievements friends rich presence overlay
cloud saves matchmaking and Workshop operations for the Steamworks provider.

## Feature Coverage

| Feature       | Steam interface       | Required calls                                                                                                                         |
| ------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Achievements  | `ISteamUserStats`     | `RequestCurrentStats`, `GetAchievement`, `SetAchievement`, `IndicateAchievementProgress`, `StoreStats`                                 |
| Friends       | `ISteamFriends`       | `GetFriendCount`, `GetFriendByIndex`, `GetFriendPersonaName`, `GetFriendPersonaState`                                                  |
| Rich presence | `ISteamFriends`       | `SetRichPresence`, `ClearRichPresence`, `GetFriendRichPresence`, `InviteUserToGame`                                                    |
| Overlay       | `ISteamFriends`       | `ActivateGameOverlay`, `ActivateGameOverlayToStore`, `ISteamUtils::IsOverlayEnabled`                                                   |
| Cloud saves   | `ISteamRemoteStorage` | `FileWrite`, `FileRead`, `FileExists`, `GetFileSize`, `FileForget`                                                                     |
| Matchmaking   | `ISteamMatchmaking`   | `CreateLobby`, `JoinLobby`, `LeaveLobby`, `InviteUserToLobby`, `RequestLobbyList`, `SetLobbyData`, `GetLobbyData`                      |
| Workshop      | `ISteamUGC`           | `CreateItem`, `StartItemUpdate`, `SubmitItemUpdate`, `DownloadItem`, `SubscribeItem`, `GetSubscribedItems`, `GetItemState`, vote calls |

Workshop operations deliberately delegate to the existing
`V2SteamWorkshopBridge` from the modding integration. The online Steamworks
planner owns the platform SDK route and preflight checks; the modding bridge
owns upload, download, subscription, update, rating, and local state projection.

## Guard Rails

The default config uses Steam's dev sandbox AppId `480` for local planning and
requires production configuration to supply the shipping AppId outside this
contract. The native bridge must report that the Steam client is running and the
Steam user is authenticated before any operation is marked ready.

Achievements require stats initialization before unlock calls. Rich presence is
cleared on sign-out. Overlay requests require an explicit user gesture. Cloud
save writes are treated as atomic operations. Matchmaking plans validate lobby
metadata. Workshop publishing requires accepted Workshop terms.

## Verification

Run the focused gate with:

```bash
python3 V2/ue/Tools/check-v2-steamworks-sdk-integration.py
```

The checker validates the contract, C++ source declarations, automation spec,
CI/Horde wiring, this document, and the Phase 72 TODO evidence.
