Documentação do Steamworks
Interface ISteamUser
Funções para acessar e manipular informações de usuários Steam.

Também é a interface que expõe as APIs de Voz no Steam.

Funções de membro

Funções de membro de ISteamUser são chamadas por meio da função de acesso global SteamUser().

AdvertiseGame

void AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer );
NomeTipoDescrição
steamIDGameServerCSteamIDDeve conter o valor k_steamIDNonSteamGS se estiver definindo o endereço IP/porta; deve conter a constante k_steamIDNil se estiver limpando o valor.
unIPServeruint32O endereço IP do servidor, em ordem de host, i.é., 127.0.0.1 == 0x7f000001.
usPortServeruint16A porta de conexão ao servidor, em ordem de host.

Define os dados de presença rica para um servidor não protegido no qual o usuário está jogando, permitindo que amigos vejam as informações e entrem na partida.

Quando estiver usando o sistema de autenticação do Steam, essa chamada nunca é necessária; a presença rica será definida automaticamente.

BeginAuthSession

EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID );
NomeTipoDescrição
pAuthTicketconst void *O ticket de autenticação a ser validado.
cbAuthTicketintO tamanho, em bytes, do ticket de autenticação. Deve ser o tamanho do pcbTicket retornado pela chamada criadora do ticket.
steamIDCSteamIDO ID Steam da entidade que enviou o ticket.

Authenticate the ticket from the entity Steam ID to be sure it is valid and isn't reused. Note that identity is not confirmed until the callback ValidateAuthTicketResponse_t is received and the return value in that callback is checked for success.

O ticket é criado na entidade por meio da função GetAuthSessionTicket ou ISteamGameServer::GetAuthSessionTicket e então deve ser enviado pela rede para validação do outro lado.

This registers for additional ValidateAuthTicketResponse_t callbacks if the entity goes offline or cancels the ticket. Consulte EAuthSessionResponse para mais informações.

Quando a sessão multijogadora for encerrada, você deverá chamar a função EndAuthSession.

Retorna: EBeginAuthSessionResult
Dispara um retorno de chamada ValidateAuthTicketResponse_t.



Consulte também: Autenticação de usuário e titularidade

BIsBehindNAT

bool BIsBehindNAT();
Verifica se o usuário atual aparenta estar atrás de um dispositivo com NAT.

Válido apenas se o usuário estiver conectado aos servidores Steam. Não garante a detecção de todos os tipos de NAT.

Retorna: bool
true se o usuário atual estiver atrás de NAT; false caso contrário.

BIsPhoneIdentifying

bool BIsPhoneIdentifying();
Verifica se o nº de telefone do usuário é usado para identificá-lo de forma única.

Retorna: bool
true se o telefone do usuário verifica a identidade de forma única; false caso contrário.

BIsPhoneRequiringVerification

bool BIsPhoneRequiringVerification();
Verifica se o nº de telefone atual está aguardando (re)verificação.

Retorna: bool
true se o nº de telefone atual do usuário estiver aguardando verificação; false caso contrário.

BIsPhoneVerified

bool BIsPhoneVerified();
Verifica se o usuário atual verificou o nº de telefone.

Consulte o artigo do Suporte Steam Autenticador móvel do Steam Guard para mais informações.

Retorna: bool
true se o usuário atual ativou a verificação de telefone; false caso contrário.

BIsTwoFactorEnabled

bool BIsTwoFactorEnabled();
Verifica se o usuário atual ativou a autenticação em duas etapas Steam Guard na conta.

Consulte o artigo do Suporte Steam Autenticador móvel do Steam Guard para mais informações.

Retorna: bool
true se o usuário atual ativou a autenticação em duas etapas; false caso contrário.

BLoggedOn

bool BLoggedOn();
Verifica se o cliente Steam do usuário atual está conectado aos servidores Steam.

Se não estiver, então nenhum serviço em tempo real oferecido pela API do Steamworks estará ativado. O cliente Steam tentará recriar a conexão o mais frequente possível. Quando a conexão for restaurada, um retorno de chamada SteamServersConnected_t será disparado.

Não é necessário fazer essa verificação manualmente. Todas as chamadas à API dependentes de conexão farão a verificação internamente. Desativar recursos manualmente quando o jogador perde a conexão costuma não resultar em uma boa experiência para o jogador, além de poder impedir acesso a APIs que não precisam de uma conexão ativa ao Steam.

Retorna: bool
true se o cliente Steam possuir uma conexão ativa aos servidores Steam; false se não houver conexão ativa devido a um problema de rede na máquina local ou se os servidores Steam estiverem fora do ar ou ocupados.

BSetDurationControlOnlineState

bool BSetDurationControlOnlineState( EDurationControlOnlineState eNewState );
Permite que o jogo especifique se está em modo on-line ou off-line para o sistema de controle antivício do Steam China.

Parâmetros: EDurationControlOnlineState

Retorna: bool
true se o novo estado foi definido com sucesso; false caso contrário.

Funções associadas:
GetDurationControl

CancelAuthTicket

void CancelAuthTicket( HAuthTicket hAuthTicket );
NomeTipoDescrição
hAuthTicketHAuthTicketO ticket de autenticação ativo a cancelar.

Cancela um ticket de autenticação recebido da função GetAuthSessionTicket. Deve ser chamada quando não estiver mais jogando com a entidade especificada.

Consulte também: Autenticação de usuário e titularidade

DecompressVoice

EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate );
NomeTipoDescrição
pCompressedconst void *Os dados comprimidos recebidos pela função GetVoice.
cbCompresseduint32O tamanho do buffer alocado para pCompressed.
pDestBuffervoid *O buffer para o qual os dados brutos do áudio serão retornados. Depois é possível passar esse parâmetro aos seus subsistemas de áudio para reprodução.
cbDestBufferSizeuint32O tamanho do buffer alocado para pDestBuffer.
nBytesWrittenuint32 *Retorna a quantidade de bytes escritos no buffer pDestBuffer, ou o tamanho do buffer exibido para descomprimir os dados informados se cbDestBufferSize não for grande o bastante (e k_EVoiceResultBufferTooSmall for retornado).
nDesiredSampleRateuint32A taxa de amostragem que será retornada. Pode ir de 11025 a 48000; use a taxa mais adequada para o seu sistema de reprodução de áudio, que provavelmente leva o hardware de áudio do usuário em conta, ou use a função GetVoiceOptimalSampleRate para recuperar a taxa de amostragem nativa do decodificador de voz do Steam.

Decodifica os dados de voz comprimidos retornados pela função GetVoice.

Os dados de saída são um áudio bruto no formato PCM de 16 bits com um só canal. O decodificador aceita taxas de amostragem entre 11025 e 48000. Consulte GetVoiceOptimalSampleRate para mais informações.

É aconselhável começar com um buffer de 20 KiB e realocar conforme necessário.

Consulte Voz no Steam para mais informações.

Retorna: EVoiceResult
A taxa de amostragem interna do decodificador de voz do Steam.

EndAuthSession

void EndAuthSession( CSteamID steamID );
NomeTipoDescrição
steamIDCSteamIDA entidade com a qual encerrar a sessão de autenticação ativa.

Encerra uma sessão de autenticação iniciada pela função BeginAuthSession. Deve ser chamada quando não estiver mais jogando com a entidade especificada.

Consulte também: Autenticação de usuário e titularidade

GetAuthSessionTicket

HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pIdentityRemote );
NomeTipoDescrição
pTicketvoid *O buffer para o qual o novo ticket de autenticação será copiado.
cbMaxTicketintO tamanho do buffer alocado para pTicket. Normalmente um buffer com 1024 de tamanho será suficiente. Contudo, em certos casos (como aplicativos com muitos conteúdos adicionais disponíveis), um buffer de maior tamanho pode ser necessário.
pcbTicketuint32 *Retorna o tamanho verdadeiro do ticket.
pIdentityRemote SteamNetworkingIdentity *The identity of the remote system that will authenticate the ticket. If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained from a trusted 3rd party, otherwise use the IP address. If it is a service, a string identifier of that service if one if provided.
NOTE: This API can not be used to create a ticket for use by the ISteamUserAuth/AuthenticateUserTicket Web API. Use the GetAuthTicketForWebApi call instead

Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.

After calling this you can send the ticket to the entity where they can then call BeginAuthSession/ISteamGameServer::BeginAuthSession to verify this entity's integrity.

Retorna: HAuthTicket
Dispara um retorno de chamada GetAuthSessionTicketResponse_t.
Um handle do ticket de autenticação. Quando terminar de interagir com a entidade, você deverá chamar a função CancelAuthTicket com o handle como argumento.

Retorna k_HAuthTicketInvalid se a chamada falhar.

Consulte também: Autenticação de usuário e titularidade

GetAuthTicketForWebApi

HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity );
NomeTipoDescrição
*pchIdentity const char *The identity of the remote service that will authenticate the ticket. The service should provide a string identifier. Pass null if none was provided.

Retrieve an authentication ticket to be sent to the entity that wishes to authenticate you using the ISteamUserAuth/AuthenticateUserTicket Web API.
The calling application must wait for the GetTicketForWebApiResponse_t callback generated by the API call to access the ticket.

It is best practice to use an identity string for each service that will consume tickets.
NOTE: This API can not be used to create a ticket for use by the BeginAuthSession/ISteamGameServer::BeginAuthSession . Use the GetAuthSessionTicket API instead

Retorna: HAuthTicket
Triggers a GetTicketForWebApiResponse_t callback.
A handle to the auth ticket. When you're done interacting with the entity you must call CancelAuthTicket on the handle.

Returns k_HAuthTicketInvalid if the call fails.

See Also: Autenticação de usuário e titularidade

GetAvailableVoice

EVoiceResult GetAvailableVoice( uint32 *pcbCompressed, uint32 *pcbUncompressed_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 );
NomeTipoDescrição
pcbCompresseduint32 *Returns the size of the available voice data in bytes.
pcbUncompressed_Deprecateduint32 *Deprecated.
nUncompressedVoiceDesiredSampleRate_Deprecateduint32Deprecated.

Checks to see if there is captured audio data available from GetVoice, and gets the size of the data.

Most applications will only use compressed data and should ignore the other parameters, which exist primarily for backwards compatibility. See GetVoice for further explanation of "uncompressed" data.

See Voz no Steam for more information.

Returns: EVoiceResult

GetDurationControl

SteamAPICall_t GetDurationControl();

Retrieves anti indulgence / duration control for current user / game combination.


Returns: SteamAPICall_t to be used with a DurationControl_t call result.
Returns k_uAPICallInvalid if no connection to the Steam servers could be made.

Associated Functions:
BSetDurationControlOnlineState

GetEncryptedAppTicket

bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket );
NomeTipoDescrição
pTicketvoid *The encrypted app ticket is copied into this buffer.
cbMaxTicketintThe total size of the pTicket buffer in bytes.
pcbTicketuint32 *Returns the number of bytes copied into pTicket.

Retrieve an encrypted ticket.

This should be called after requesting an encrypted app ticket with RequestEncryptedAppTicket and receiving the EncryptedAppTicketResponse_t call result.

You should then pass this encrypted ticket to your secure servers to be decrypted using your secret key using SteamEncryptedAppTicket::BDecryptTicket.

NOTE: If you call this without calling RequestEncryptedAppTicket, the call may succeed but you will likely get a stale ticket.

Returns: bool
true if the call successfully returned an app ticket into pTicket.
false under the following conditions:
  • pcbTicket for NULL;
  • pTicket for NULL;
  • pTicket for muito pequeno para armazenar o ticket;
  • Não havia ticket disponível. (Você esperou EncryptedAppTicketResponse_t ser disparado?)

GetGameBadgeLevel

int GetGameBadgeLevel( int nSeries, bool bFoil );
NomeTipoDescrição
nSeriesintIf you only have one set of cards, the series will be 1.
bFoilboolCheck if they have received the foil badge.

Gets the level of the users Steam badge for your game.

The user can have two different badges for a series; the regular badge (max level 5) and the foil badge (max level 1).

Retorna: int
The level of the badge, 0 if they don't have it.

GetHSteamUser

HSteamUser GetHSteamUser();
Gets Steam user handle that this interface represents.

This is only used internally by the API, and by a few select interfaces that support multi-user.

Retorna: HSteamUser

GetPlayerSteamLevel

int GetPlayerSteamLevel();
Gets the Steam level of the user, as shown on their Steam community profile.

Returns: int
The level of the current user.

GetSteamID

CSteamID GetSteamID();
Gets the Steam ID of the account currently logged into the Steam client. This is commonly called the 'current user', or 'local user'.

A Steam ID is a unique identifier for a Steam accounts, Steam groups, Lobbies and Chat rooms, and used to differentiate users in all parts of the Steamworks API.

Retorna: CSteamID


Example:
CSteamID steamID = SteamUser()->GetSteamID();

GetUserDataFolder

bool GetUserDataFolder( char *pchBuffer, int cubBuffer );
NomeTipoDescrição
pchBufferchar *
cubBufferint

Deprecated - You should use the Nuvem Steam API from ISteamRemoteStorage instead.

Retorna: bool

GetVoice

EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed_Deprecated = false, void *pUncompressedDestBuffer_Deprecated = 0, uint32 cbUncompressedDestBufferSize_Deprecated = 0, uint32 *nUncompressBytesWritten_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 );
NomeTipoDescrição
bWantCompressedboolThis should always be true.
pDestBuffervoid *The buffer where the audio data will be copied into.
cbDestBufferSizeuint32The size of the buffer allocated for pDestBuffer.
nBytesWrittenuint32 *Returns the number of bytes written into pDestBuffer. This should always be the size returned by ISteamUser::GetAvailableVoice.
bWantUncompressed_DeprecatedboolDeprecated.
pUncompressedDestBuffer_Deprecatedvoid *Deprecated.
cbUncompressedDestBufferSize_Deprecateduint32Deprecated.
nUncompressBytesWritten_Deprecateduint32 *Deprecated.
nUncompressedVoiceDesiredSampleRate_Deprecateduint32Deprecated.

Read captured audio data from the microphone buffer.

The compressed data can be transmitted by your application and decoded back into raw audio data using DecompressVoice on the other side. The compressed data provided is in an arbitrary format and is not meant to be played directly.

This should be called once per frame, and at worst no more than four times a second to keep the microphone input delay as low as possible. Calling this any less may result in gaps in the returned stream.

It is recommended that you pass in an 8 kilobytes or larger destination buffer for compressed audio. Static buffers are recommended for performance reasons. However, if you would like to allocate precisely the right amount of space for a buffer before each call you may use GetAvailableVoice to find out how much data is available to be read.

NOTE: "Uncompressed" audio is a deprecated feature and should not be used by most applications. It is raw single-channel 16-bit PCM wave data which may have been run through preprocessing filters and/or had silence removed, so the uncompressed audio could have a shorter duration than you expect. There may be no data at all during long periods of silence. Also, fetching uncompressed audio will cause GetVoice to discard any leftover compressed audio, so you must fetch both types at once. Finally, GetAvailableVoice is not precisely accurate when the uncompressed size is requested. So if you really need to use uncompressed audio, you should call GetVoice frequently with two very large (20KiB+) output buffers instead of trying to allocate perfectly-sized buffers. But most applications should ignore all of these details and simply leave the "uncompressed" parameters as NULL/0.

See Voz no Steam for more information.

Returns: EVoiceResult

GetVoiceOptimalSampleRate

uint32 GetVoiceOptimalSampleRate();
Gets the native sample rate of the Steam voice decoder.

Using this sample rate for DecompressVoice will perform the least CPU processing. However, the final audio quality will depend on how well the audio device (and/or your application's audio output SDK) deals with lower sample rates. You may find that you get the best audio output quality when you ignore this function and use the native sample rate of your audio output device, which is usually 48000 or 44100.

See Voz no Steam for more information.

Returns: uint32

InitiateGameConnection

int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure );
NomeTipoDescrição
pAuthBlobvoid *A pointer to empty memory that will be filled in with the authentication token.
cbMaxAuthBlobintThe number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
steamIDGameServerCSteamIDThe Steam ID of the game server, received from the game server by the client.
unIPServeruint32The IP address of the game server in host order, i.e 127.0.0.1 == 0x7f000001.
usPortServeruint16The connection port of the game server, in host order.
bSecureboolWhether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running.)

This starts the state machine for authenticating the game client with the game server.

It is the client portion of a three-way handshake between the client, the game server, and the steam servers.

NOTE: When you're done with the connection you must call TerminateGameConnection.

NOTE: This is part of the old user authentication API and should not be mixed with the new API.

Returns: int
The number of bytes written to pBlob.

Returns 0 indicating failure, signifying that the pAuthBlob buffer passed in was too small, and the call has failed.

The contents of pAuthBlob should then be sent to the game server, for it to use to complete the authentication process.

RequestEncryptedAppTicket

SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude );
NomeTipoDescrição
pDataToIncludevoid *The data which will be encrypted into the ticket.
cbDataToIncludeintThe total size in bytes of pDataToInclude.

Requests an application ticket encrypted with the secret "encrypted app ticket key".

The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app.

There can only be one EncryptedAppTicketResponse_t pending, and this call is subject to a 60 second rate limit.

After receiving the response you should call GetEncryptedAppTicket to get the ticket data, and then you need to send it to a secure server to be decrypted with the SteamEncryptedAppTicket functions.

Returns: SteamAPICall_t to be used with a EncryptedAppTicketResponse_t call result.


Example:
class CEncryptedAppTicketExample { public: void RetrieveEncryptedAppTicket(); private: void OnEncryptedAppTicketResponse( EncryptedAppTicketResponse_t *pEncryptedAppTicketResponse, bool bIOFailure ); CCallResult< CEncryptedAppTicketExample, EncryptedAppTicketResponse_t > m_EncryptedAppTicketResponseCallResult; }; void CEncryptedAppTicketExample::RetrieveEncryptedAppTicket() { SteamAPICall_t hSteamAPICall = SteamUser()->RequestEncryptedAppTicket( &k_unSecretData, sizeof( k_unSecretData ) ); m_EncryptedAppTicketResponseCallResult.Set( hSteamAPICall, this, &CEncryptedAppTicketExample::OnEncryptedAppTicketResponse ); } void CEncryptedAppTicketExample::OnEncryptedAppTicketResponse( EncryptedAppTicketResponse_t *pEncryptedAppTicketResponse, bool bIOFailure ) { if ( bIOFailure ) { printf( "There has been an IO Failure when requesting the Encrypted App Ticket.\n" ); return; } switch ( pEncryptedAppTicketResponse->m_eResult ) { case k_EResultOK: { uint8 rgubTicket[1024]; uint32 cubTicket; if ( SteamUser()->GetEncryptedAppTicket( rgubTicket, sizeof( rgubTicket ), &cubTicket ) ) { // Normally at this point you would transmit the encrypted ticket to a trusted service that knows the decryption key // This code is just to demonstrate the ticket decrypting library DecryptTicket( rgubTicket, cubTicket ); } else printf( "GetEncryptedAppTicket failed.\n" ); } break; case k_EResultNoConnection: printf( "Calling RequestEncryptedAppTicket while not connected to steam results in this error.\n" ); break; case k_EResultDuplicateRequest: printf( "Calling RequestEncryptedAppTicket while there is already a pending request results in this error.\n" ); break; case k_EResultLimitExceeded: printf( "Calling RequestEncryptedAppTicket more than once per minute returns this error.\n" ); break; } }

RequestStoreAuthURL

SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL );
NomeTipoDescrição
pchRedirectURLconst char *

Requests a URL which authenticates an in-game browser for store check-out, and then redirects to the specified URL.

As long as the in-game browser accepts and handles session cookies, Steam microtransaction checkout pages will automatically recognize the user instead of presenting a login page.

NOTE: The URL has a very short lifetime to prevent history-snooping attacks, so you should only call this API when you are about to launch the browser, or else immediately navigate to the result URL using a hidden browser window.

AVISO: The resulting authorization cookie has an expiration time of one day, so it would be a good idea to request and visit a new auth URL every 12 hours.

Retorna: SteamAPICall_t to be used with a StoreAuthURLResponse_t call result.
Returns k_uAPICallInvalid if no connection to the Steam servers could be made.

StartVoiceRecording

void StartVoiceRecording();
Starts voice recording.

Once started, use GetAvailableVoice and GetVoice to get the data, and then call StopVoiceRecording when the user has released their push-to-talk hotkey or the game session has completed.

See Voz no Steam for more information.

StopVoiceRecording

void StopVoiceRecording();
Stops voice recording.

Because people often release push-to-talk keys early, the system will keep recording for a little bit after this function is called. As such, GetVoice should continue to be called until it returns k_EVoiceResultNotRecording, only then will voice recording be stopped.

TerminateGameConnection

void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer );
NomeTipoDescrição
unIPServeruint32
usPortServeruint16

Notify the game server that we are disconnecting.

This needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection call.

NOTE: This is part of the old user authentication API and should not be mixed with the new API.

TrackAppUsageEvent

void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" );
NomeTipoDescrição
gameIDCGameID
eAppUsageEventint
pchExtraInfoconst char *

Deprecated - Only used by only a few games to track usage events before Estatísticas e conquistas was introduced.

UserHasLicenseForApp

EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID );
NomeTipoDescrição
steamIDCSteamIDThe Steam ID of the user that sent the auth ticket.
appIDAppId_tThe DLC App ID to check if the user owns it.

Checks if the user owns a specific piece of Conteúdo adicional (DLC).

This can only be called after sending the users auth ticket to ISteamGameServer::BeginAuthSession

Returns: EUserHasLicenseForAppResult


See Also: Autenticação de usuário e titularidade

Retornos de chamada

These are callbacks which can be fired by calling SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of ISteamUser.

ClientGameServerDeny_t

Sent by the Steam server to the client telling it to disconnect from the specified game server, which it may be in the process of or already connected to.
The game client should immediately disconnect upon receiving this message.
This can usually occur if the user doesn't have rights to play on the game server.

NomeTipoDescrição
m_uAppIDuint32The App ID this call is for. Verify that it's the same as the current App ID with ISteamUtils::GetAppID.
m_unGameServerIPuint32The IP of the game server that is telling us to disconnect, in host order, i.e 127.0.0.1 == 0x7f000001.
m_usGameServerPortuint16The port of the game server that is telling us to disconnect, in host order.
m_bSecureuint16Is the game server VAC secure (true) or not (false)?
m_uReasonuint32

DurationControl_t


Sent for games with enabled anti indulgence / duration control, for enabled users. Lets the game know whether the feature applies to the user, whether the user needs to exit the game soon, and the remaining daily playtime for the user.

This callback is fired asynchronously in response to timers triggering. It is also fired in response to calls to GetDurationControl().

NomeTipoDescrição
m_eResultEResultresult of call (always k_EResultOK for asynchronous timer-based notifications)
m_appidAppId_tappid generating playtime
m_bApplicableboolis duration control applicable to user + game combination
m_csecsLast5hint32playtime in trailing 5 hour window plus current session, in seconds
m_progressEDurationControlProgressDescription of whether the game should exit
m_notificationEDurationControlNotificationnotification to show, if any (always k_EDurationControlNotification_None for API calls)

Funções associadas: GetDurationControl

EncryptedAppTicketResponse_t

Called when an encrypted application ticket has been received.

NomeTipoDescrição
m_eResultEResultWas the call successful?
Possible results:

Funções associadas: RequestEncryptedAppTicket

GameWebCallback_t

Sent to your game in response to a steam://gamewebcallback/ command from a user clicking a link in the Steam overlay browser.
You can use this to add support for external site signups where you want to pop back into the browser after some web page signup sequence, and optionally get back some detail about that.

NomeTipoDescrição
m_szURLchar[256]The complete url that the user clicked on.

GetAuthSessionTicketResponse_t

Result when creating an auth session ticket.

NomeTipoDescrição
m_hAuthTicketHAuthTicketThe handle to the ticket that was created.
m_eResultEResultO resultado da operação.

Funções associadas: GetAuthSessionTicket

GetTicketForWebApiResponse_t

Result when creating an webapi ticket from GetAuthTicketForWebApi.

NomeTipoDescrição
m_hAuthTicketHAuthTicketThe handle to the ticket that was created.
m_eResultEResultO resultado da operação.
m_cubTicketint The length of the ticket that was created.
m_rgubTicketuint8[2560]The ticket that was created.

Funções associadas: GetAuthTicketForWebApi

IPCFailure_t

Called when the callback system for this client is in an error state (and has flushed pending callbacks)
When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
This usually occurs in the rare event the Steam client has some kind of fatal error.

NomeTipoDescrição
m_eFailureTypeuint8This is a EFailureType.

LicensesUpdated_t

Called whenever the users licenses (owned packages) changes.

This callback has no fields.

MicroTxnAuthorizationResponse_t

Called when a user has responded to a microtransaction authorization request.

NomeTipoDescrição
m_unAppIDuint32App ID for this microtransaction
m_ulOrderIDuint64Order ID provided for the microtransaction.
m_bAuthorizeduint8Did the user authorize the transaction (1) or not (0)?

SteamServerConnectFailure_t

Called when a connection attempt has failed.
This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection.

NomeTipoDescrição
m_eResultEResultThe reason why the connection failed.
m_bStillRetryingboolIs the Steam client still trying to connect to the server?

SteamServersConnected_t

Called when a connections to the Steam back-end has been established.
This means the Steam client now has a working connection to the Steam servers. Usually this will have occurred before the game has launched, and should only be seen if the user has dropped connection due to a networking issue or a Steam server update.

This callback has no fields.

SteamServersDisconnected_t

Called if the client has lost connection to the Steam servers.
Real-time services will be disabled until a matching SteamServersConnected_t has been posted.

NomeTipoDescrição
m_eResultEResultThe reason we were disconnected from Steam.

StoreAuthURLResponse_t

Response when we have recieved the authentication URL after a call to RequestStoreAuthURL.

NomeTipoDescrição
m_szURLchar[512]The authentication URL.

Funções associadas: RequestStoreAuthURL

ValidateAuthTicketResponse_t

Called when an auth ticket has been validated.

NomeTypeDescrição
m_SteamIDCSteamIDThe Steam ID of the entity that provided the auth ticket.
m_eAuthSessionResponseEAuthSessionResponseThe result of the validation.
m_OwnerSteamIDCSteamIDThe Steam ID that owns the game, this will be different from m_SteamID if the game is being accessed via Steam Family Sharing.

Funções associadas: BeginAuthSession

Structs

These are structs which functions in ISteamUser may return and/or interact with.

CallbackMsg_t

The structure that contains client callback data. This is only used internally inside SteamAPI_RunCallbacks.

NomeTypeDescrição
m_hSteamUserHSteamUserThe user this callback is sent to.
m_iCallbackintThe unique ID of the callback.
m_pubParamuint8 *The pointer to the callback data.
m_cubParamintThe size of [param]m_pubParam[/param].

Enumerações

These are enums which are defined for use with ISteamUser.

EFailureType

Specifies what type of failure happened in IPCFailure_t.

NomeValorDescrição
k_EFailureFlushedCallbackQueue0
k_EFailurePipeFail1

EDurationControlProgress

Describes playtime restrictions that apply for games with duration control / anti-indulgence enabled for minor Steam China users.

NomeValorDescrição
k_EDurationControlProgress_Full0Normal play
k_EDurationControlProgress_Half1(This value is deprecated)
k_EDurationControlProgress_None2User's playtime has run out. Steam will terminate the game soon

Associated Functions:
GetDurationControl
BSetDurationControlOnlineState

EDurationControlNotification

Describes which notification timer has expired, for steam china duration control feature. Some of these notifications are deprecated and are no longer sent.

NomeValueDescription
k_EDurationControlNotification_None0Callback is just informing you about progress, no notification to show
k_EDurationControlNotification_1Hour1player has been playing for an hour - game can show something at this time if desired
k_EDurationControlNotification_3Hours2(deprecated)
k_EDurationControlNotification_HalfProgress3(deprecated)
k_EDurationControlNotification_ExitSoon_3h4player has been playing for the allowed time and should exit the game
k_EDurationControlNotification_ExitSoon_5h4player has been playing for the allowed time and should exit the game
k_EDurationControlNotification_ExitSoon_Night4player has been playing until the locally allowed time of day (10PM) and should exit the game

Associated Functions:
GetDurationControl
BSetDurationControlOnlineState

EDurationControlOnlineState

Describes the online/offline play state of a game. Currently this is only used to support the game being able to prevent steam from exiting the game automatically when the user's playtime is consumed. If the game calls BSetDurationControlOnlineState(k_EDurationControlOnlineState_OnlineHighPri) then Steam will not force exit the game - in this case it is up to the game to do so! Steam will continue to send DurationControl_t notifications to the game. If the game later calls BSetDurationControlOnlineState to remove the OnlineHighPri state, then Steam will force exit the game soon thereafter.

NameValueDescription
k_EDurationControlOnlineState_Offline1Offline play
k_EDurationControlOnlineState_Online2Online play
k_EDurationControlOnlineState_OnlineHighPri3Online play - game requests that steam not force exit the game

Associated Functions:
GetDurationControl
BSetDurationControlOnlineState

Constantes

These are constants which are defined for use with ISteamUser.

NameTypeValueDescription
STEAMUSER_INTERFACE_VERSIONconst char *"SteamUser019"