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 );
Nome | Tipo | Descrição |
steamIDGameServer | CSteamID | Deve conter o valor k_steamIDNonSteamGS se estiver definindo o endereço IP/porta; deve conter a constante k_steamIDNil se estiver limpando o valor. |
unIPServer | uint32 | O endereço IP do servidor, em ordem de host, i.é., 127.0.0.1 == 0x7f000001. |
usPortServer | uint16 | A 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 );
Nome | Tipo | Descrição |
pAuthTicket | const void * | O ticket de autenticação a ser validado. |
cbAuthTicket | int | O tamanho, em bytes, do ticket de autenticação. Deve ser o tamanho do pcbTicket retornado pela chamada criadora do ticket. |
steamID | CSteamID | O 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: EBeginAuthSessionResultDispara um retorno de chamada
ValidateAuthTicketResponse_t.
Consulte também: Autenticação de usuário e titularidadeBIsBehindNAT
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: EDurationControlOnlineStateRetorna: bool
true se o novo estado foi definido com sucesso;
false caso contrário.
Funções associadas:GetDurationControlCancelAuthTicket
void CancelAuthTicket( HAuthTicket hAuthTicket );
Nome | Tipo | Descrição |
hAuthTicket | HAuthTicket | O 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 titularidadeDecompressVoice
EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate );
Nome | Tipo | Descrição |
pCompressed | const void * | Os dados comprimidos recebidos pela função GetVoice. |
cbCompressed | uint32 | O tamanho do buffer alocado para pCompressed . |
pDestBuffer | void * | 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. |
cbDestBufferSize | uint32 | O tamanho do buffer alocado para pDestBuffer . |
nBytesWritten | uint32 * | 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). |
nDesiredSampleRate | uint32 | A 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: EVoiceResultA taxa de amostragem interna do decodificador de voz do Steam.
EndAuthSession
void EndAuthSession( CSteamID steamID );
Nome | Tipo | Descrição |
steamID | CSteamID | A 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 titularidadeGetAuthSessionTicket
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pIdentityRemote );
Nome | Tipo | Descrição |
pTicket | void * | O buffer para o qual o novo ticket de autenticação será copiado. |
cbMaxTicket | int | O 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. |
pcbTicket | uint32 * | 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. |
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: HAuthTicketDispara 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 titularidadeGetAuthTicketForWebApi
HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity );
Nome | Tipo | Descriçã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.
It is best practice to use an identity string for each service that will consume tickets.
Retorna: HAuthTicketTriggers 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 titularidadeGetAvailableVoice
EVoiceResult GetAvailableVoice( uint32 *pcbCompressed, uint32 *pcbUncompressed_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 );
Nome | Tipo | Descrição |
pcbCompressed | uint32 * | Returns the size of the available voice data in bytes. |
pcbUncompressed_Deprecated | uint32 * | Deprecated. |
nUncompressedVoiceDesiredSampleRate_Deprecated | uint32 | Deprecated. |
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: EVoiceResultGetDurationControl
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:BSetDurationControlOnlineStateGetEncryptedAppTicket
bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket );
Nome | Tipo | Descrição |
pTicket | void * | The encrypted app ticket is copied into this buffer. |
cbMaxTicket | int | The total size of the pTicket buffer in bytes. |
pcbTicket | uint32 * | 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 );
Nome | Tipo | Descrição |
nSeries | int | If you only have one set of cards, the series will be 1. |
bFoil | bool | Check 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: HSteamUserGetPlayerSteamLevel
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: CSteamIDExample:CSteamID steamID = SteamUser()->GetSteamID();
GetUserDataFolder
bool GetUserDataFolder( char *pchBuffer, int cubBuffer );
Nome | Tipo | Descrição |
pchBuffer | char * | |
cubBuffer | int | |
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 );
Nome | Tipo | Descrição |
bWantCompressed | bool | This should always be true. |
pDestBuffer | void * | The buffer where the audio data will be copied into. |
cbDestBufferSize | uint32 | The size of the buffer allocated for pDestBuffer . |
nBytesWritten | uint32 * | Returns the number of bytes written into pDestBuffer . This should always be the size returned by ISteamUser::GetAvailableVoice . |
bWantUncompressed_Deprecated | bool | Deprecated. |
pUncompressedDestBuffer_Deprecated | void * | Deprecated. |
cbUncompressedDestBufferSize_Deprecated | uint32 | Deprecated. |
nUncompressBytesWritten_Deprecated | uint32 * | Deprecated. |
nUncompressedVoiceDesiredSampleRate_Deprecated | uint32 | Deprecated. |
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: EVoiceResultGetVoiceOptimalSampleRate
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: uint32InitiateGameConnection
int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure );
Nome | Tipo | Descrição |
pAuthBlob | void * | A pointer to empty memory that will be filled in with the authentication token. |
cbMaxAuthBlob | int | The number of bytes of allocated memory in pBlob. Should be at least 2048 bytes. |
steamIDGameServer | CSteamID | The Steam ID of the game server, received from the game server by the client. |
unIPServer | uint32 | The IP address of the game server in host order, i.e 127.0.0.1 == 0x7f000001. |
usPortServer | uint16 | The connection port of the game server, in host order. |
bSecure | bool | Whether 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 );
Nome | Tipo | Descrição |
pDataToInclude | void * | The data which will be encrypted into the ticket. |
cbDataToInclude | int | The 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 );
Nome | Tipo | Descrição |
pchRedirectURL | const 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 );
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 = "" );
Nome | Tipo | Descrição |
gameID | CGameID | |
eAppUsageEvent | int | |
pchExtraInfo | const 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 );
Nome | Tipo | Descrição |
steamID | CSteamID | The Steam ID of the user that sent the auth ticket. |
appID | AppId_t | The 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::BeginAuthSessionReturns: EUserHasLicenseForAppResultSee Also: Autenticação de usuário e titularidadeRetornos 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.
Nome | Tipo | Descrição |
m_uAppID | uint32 | The App ID this call is for. Verify that it's the same as the current App ID with ISteamUtils::GetAppID. |
m_unGameServerIP | uint32 | The IP of the game server that is telling us to disconnect, in host order, i.e 127.0.0.1 == 0x7f000001. |
m_usGameServerPort | uint16 | The port of the game server that is telling us to disconnect, in host order. |
m_bSecure | uint16 | Is the game server VAC secure (true) or not (false)? |
m_uReason | uint32 | |
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().
Nome | Tipo | Descrição |
m_eResult | EResult | result of call (always k_EResultOK for asynchronous timer-based notifications) |
m_appid | AppId_t | appid generating playtime |
m_bApplicable | bool | is duration control applicable to user + game combination |
m_csecsLast5h | int32 | playtime in trailing 5 hour window plus current session, in seconds |
m_progress | EDurationControlProgress | Description of whether the game should exit |
m_notification | EDurationControlNotification | notification to show, if any (always k_EDurationControlNotification_None for API calls) |
Funções associadas: GetDurationControlEncryptedAppTicketResponse_t
Called when an encrypted application ticket has been received.
Nome | Tipo | Descrição |
m_eResult | EResult | Was the call successful? Possible results:
|
Funções associadas: RequestEncryptedAppTicketGameWebCallback_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.
Nome | Tipo | Descrição |
m_szURL | char[256] | The complete url that the user clicked on. |
GetAuthSessionTicketResponse_t
Result when creating an auth session ticket.
Nome | Tipo | Descrição |
m_hAuthTicket | HAuthTicket | The handle to the ticket that was created. |
m_eResult | EResult | O resultado da operação. |
Funções associadas: GetAuthSessionTicketGetTicketForWebApiResponse_t
Result when creating an webapi ticket from GetAuthTicketForWebApi.
Nome | Tipo | Descrição |
m_hAuthTicket | HAuthTicket | The handle to the ticket that was created. |
m_eResult | EResult | O resultado da operação. |
m_cubTicket | int | The length of the ticket that was created. |
m_rgubTicket | uint8[2560] | The ticket that was created. |
Funções associadas: GetAuthTicketForWebApiIPCFailure_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.
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.
Nome | Tipo | Descrição |
m_unAppID | uint32 | App ID for this microtransaction |
m_ulOrderID | uint64 | Order ID provided for the microtransaction. |
m_bAuthorized | uint8 | Did 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.
Nome | Tipo | Descrição |
m_eResult | EResult | The reason why the connection failed. |
m_bStillRetrying | bool | Is 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.
Nome | Tipo | Descrição |
m_eResult | EResult | The reason we were disconnected from Steam. |
StoreAuthURLResponse_t
Response when we have recieved the authentication URL after a call to
RequestStoreAuthURL.
Nome | Tipo | Descrição |
m_szURL | char[512] | The authentication URL. |
Funções associadas: RequestStoreAuthURLValidateAuthTicketResponse_t
Called when an auth ticket has been validated.
Nome | Type | Descrição |
m_SteamID | CSteamID | The Steam ID of the entity that provided the auth ticket. |
m_eAuthSessionResponse | EAuthSessionResponse | The result of the validation. |
m_OwnerSteamID | CSteamID | The 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: BeginAuthSessionStructs
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.
Nome | Type | Descrição |
m_hSteamUser | HSteamUser | The user this callback is sent to. |
m_iCallback | int | The unique ID of the callback. |
m_pubParam | uint8 * | The pointer to the callback data. |
m_cubParam | int | The 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.
Nome | Valor | Descrição |
k_EFailureFlushedCallbackQueue | 0 | |
k_EFailurePipeFail | 1 | |
EDurationControlProgress
Describes playtime restrictions that apply for games with duration control / anti-indulgence enabled for minor Steam China users.
Nome | Valor | Descrição |
k_EDurationControlProgress_Full | 0 | Normal play |
k_EDurationControlProgress_Half | 1 | (This value is deprecated) |
k_EDurationControlProgress_None | 2 | User's playtime has run out. Steam will terminate the game soon |
Associated Functions:GetDurationControlBSetDurationControlOnlineStateEDurationControlNotification
Describes which notification timer has expired, for steam china duration control feature. Some of these notifications are deprecated and are no longer sent.
Nome | Value | Description |
k_EDurationControlNotification_None | 0 | Callback is just informing you about progress, no notification to show |
k_EDurationControlNotification_1Hour | 1 | player has been playing for an hour - game can show something at this time if desired |
k_EDurationControlNotification_3Hours | 2 | (deprecated) |
k_EDurationControlNotification_HalfProgress | 3 | (deprecated) |
k_EDurationControlNotification_ExitSoon_3h | 4 | player has been playing for the allowed time and should exit the game |
k_EDurationControlNotification_ExitSoon_5h | 4 | player has been playing for the allowed time and should exit the game |
k_EDurationControlNotification_ExitSoon_Night | 4 | player has been playing until the locally allowed time of day (10PM) and should exit the game |
Associated Functions:GetDurationControlBSetDurationControlOnlineStateEDurationControlOnlineState
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.
Name | Value | Description |
k_EDurationControlOnlineState_Offline | 1 | Offline play |
k_EDurationControlOnlineState_Online | 2 | Online play |
k_EDurationControlOnlineState_OnlineHighPri | 3 | Online play - game requests that steam not force exit the game |
Associated Functions:GetDurationControlBSetDurationControlOnlineStateConstantes
These are constants which are defined for use with ISteamUser.
Name | Type | Value | Description |
STEAMUSER_INTERFACE_VERSION | const char * | "SteamUser019" | |