Steam¶
OwnId¶
string Steam::OwnId()
The player's 64-bit Steam ID as text ("" if Steam isn't there). Names change; this doesn't. Requires host 0.26.0.
Example
string me = Steam::OwnId();
PersonaName¶
string Steam::PersonaName(const string &in steamId)
A Steam user's name as Steam shows it to this player, "" until Steam has it (asking starts the request). Requires host 0.26.0.
Example
string name = Steam::PersonaName(Steam::OwnId());
RequestWebTicket¶
bool Steam::RequestWebTicket(const string &in identity = "")
Asks Steam for a Web API auth ticket (GetAuthTicketForWebApi) for your plugin, so your server can check the player's
Steam ID with ISteamUserAuth/AuthenticateUserTicket. The ticket's identity is always ballest-plugin:<your plugin id>
(Steam::WebTicketIdentity), whatever is passed: your server checks the ticket with that identity. Only for a plugin
that declares [net] domains in its info.toml (false otherwise). Each plugin has its own ticket; asking again replaces
yours. Read-only: nothing is uploaded. Poll Steam::WebTicketState. A sandboxed test copy blocks tickets, so there it
ends in an error. Requires host 0.26.0.
Example
Steam::RequestWebTicket(); // server side: AuthenticateUserTicket with identity "ballest-plugin:my-plugin"
WebTicketIdentity¶
string Steam::WebTicketIdentity()
The identity your plugin's tickets are made for: ballest-plugin: and your plugin's id (its folder name without
ballest-). Your server passes it to AuthenticateUserTicket. Requires host 0.26.0.
Example
Log::Info("tickets for " + Steam::WebTicketIdentity());
WebTicketState¶
string Steam::WebTicketState()
"idle", "pending", "ready" or "error: ...". Requires host 0.26.0.
Example
if (Steam::WebTicketState() == "ready")
Log::Info("ticket ready");
WebTicket¶
string Steam::WebTicket()
The ticket as hex once ready, else "". Requires host 0.26.0.
Example
string ticket = Steam::WebTicket();