Aller au contenu

omniplay/steam Référence de l’API

Étage
Fournisseur · Omniplay
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Vérifié en partie
Licence
MIT
composer require omniplay/steam:1.x-dev

Lue dans les fichiers PHP du paquet au commit f60e828152c0 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omniplay\Steam

  • SteamFactory class

    "steam": options key (a Steam Web API key: only for a player's library and ownership; the store needs none), language ("english", or "fr"), country ("US": the prices'), user_agent, store, api; for a player's identity, appid (the game's Steam app id: without it, no identity), publisher_key (the reference of the publisher Web API key: "STEAM_PUBLISHER_KEY", read through the secrets given, the environment by default), identity (the string the game passes to GetAuthTicketForWebApi; none by default), refuse_banned (false), partner_api ("https://partner.steam-api.com").

    11 options · 1 method

  • SteamIdentity class

    A player's Steam session ticket verified by Steam, on the platform: ISteamUserAuth/AuthenticateUserTicket (GET, the Steamworks Web API) with the publisher Web API key - read by its reference at each call, never returned - the game's app id, the ticket as hex, and the identity string the game passed to GetAuthTicketForWebApi when one is configured. The answer is the player's SteamID ("steam:<SteamID64>"), or a refusal that quotes Steam.

    4 methods · 1 constant

  • SteamProvider class

    Steam: the store's record of an app and its search (the storefront's own endpoints, no key: appdetails, storesearch), and - with a Web API key - a player's library (IPlayerService/GetOwnedGames) and whether they own a game. A player is a 64-bit Steam ID; a private profile reads as an empty library. With the game's app id and a publisher key, a player's session ticket verified on the platform (ISteamUserAuth/AuthenticateUserTicket, SteamIdentity), answering their SteamID.

    10 methods

Omniplay\Steam

SteamFactory class

final class SteamFactory extends ProviderFactory SteamFactory.php:26

"steam": options key (a Steam Web API key: only for a player's library and ownership; the store needs none), language ("english", or "fr"), country ("US": the prices'), user_agent, store, api; for a player's identity, appid (the game's Steam app id: without it, no identity), publisher_key (the reference of the publisher Web API key: "STEAM_PUBLISHER_KEY", read through the secrets given, the environment by default), identity (the string the game passes to GetAuthTicketForWebApi; none by default), refuse_banned (false), partner_api ("https://partner.steam-api.com").

Options

OptionDefault
keynull
language'english'
country'US'
user_agent'omniplay/1.0 (+https://github.com/glitchr-omnisense/omniplay)'
store'https://store.steampowered.com'
api'https://api.steampowered.com'
appidnull
publisher_key'STEAM_PUBLISHER_KEY'
identitynull
refuse_bannedfalse
partner_api'https://partner.steam-api.com'

SteamFactory::__construct()

public function __construct(readonly ?HttpClientInterface $http = null, readonly ?SecretsInterface $secrets = null)

SteamIdentity class

final class SteamIdentity implements IdentityInterface SteamIdentity.php:25

A player's Steam session ticket verified by Steam, on the platform: ISteamUserAuth/AuthenticateUserTicket (GET, the Steamworks Web API) with the publisher Web API key - read by its reference at each call, never returned - the game's app id, the ticket as hex, and the identity string the game passed to GetAuthTicketForWebApi when one is configured. The answer is the player's SteamID ("steam:<SteamID64>"), or a refusal that quotes Steam.

SteamProvider answers IdentityInterface through it when the "appid" option is given. Lobbies are not here: they stay in the game, through the Steamworks SDK.

const PLATFORM = 'steam'

SteamIdentity::__construct()

public function __construct(readonly JsonClient $json, readonly SecretsInterface $secrets, readonly string $key, readonly int $appid, readonly ?string $identity = null, readonly bool $refuseBanned = false, readonly string $api = 'https://partner.steam-api.com')
$key

the reference of the publisher Web API key (an environment variable's name, a vault's key)

$identity

the string the game passes to GetAuthTicketForWebApi; Steam then authenticates only the tickets made with it

$refuseBanned

a player banned by VAC or by the publisher is refused, not answered

SteamIdentity::where()

public function where(): string

Whom it asks, for a person to read: Capabilities::$where.

SteamIdentity::platform()

public function platform(): string

SteamIdentity::verify()

public function verify(string $proof): Identity

The player whose session ticket this is (the hex the game made of GetAuthTicketForWebApi's bytes). Claims: "owner" (the SteamID that owns the game, another when it is lent through Family Sharing), "vac_banned", "publisher_banned", "appid".

SteamProvider class

final class SteamProvider implements ProviderInterface, SearchInterface, CatalogueInterface, LibraryInterface, OwnershipInterface, IdentityInterface SteamProvider.php:38

Steam: the store's record of an app and its search (the storefront's own endpoints, no key: appdetails, storesearch), and - with a Web API key - a player's library (IPlayerService/GetOwnedGames) and whether they own a game. A player is a 64-bit Steam ID; a private profile reads as an empty library. With the game's app id and a publisher key, a player's session ticket verified on the platform (ISteamUserAuth/AuthenticateUserTicket, SteamIdentity), answering their SteamID.

SteamProvider::__construct()

public function __construct(readonly JsonClient $json, readonly ?string $key = null, readonly string $language = 'english', readonly string $country = 'US', readonly string $store = 'https://store.steampowered.com', readonly string $api = 'https://api.steampowered.com', readonly ?SteamIdentity $identity = null)

SteamProvider::getName()

public function getName(): string

SteamProvider::getTitle()

public function getTitle(): string

SteamProvider::capabilities()

public function capabilities(): Capabilities
public function search(Query $query): array

SteamProvider::game()

public function game(GameRef $ref, ?string $language = null, ?string $country = null): ?Game

SteamProvider::library()

public function library(string $player): array

SteamProvider::owns()

public function owns(string $player, GameRef $game): bool

SteamProvider::platform()

public function platform(): string

SteamProvider::verify()

public function verify(string $proof): Identity

The player whose session ticket this is, verified by Steam (SteamIdentity::verify()).

Throws

InvalidConfigException when no appid is configured: the store only