Interface to create a new steam instance or to connect to an existing steam instance, whether it's in a different process or is local.
In most scenarios this is all handled automatically via
SteamAPI_Init.
You'll only ever need to use these APIs if you have a more complex versioning scheme, or if you want to implement a multiplexed gameserver where a single process is handling multiple games at once with independent gameserver Steam IDs.
Member Functions
Member functions for
ISteamClient
are called through the global accessor function
SteamClient()
.
BReleaseSteamPipe
bool BReleaseSteamPipe( HSteamPipe hSteamPipe );
Name | Type | Description |
hSteamPipe | HSteamPipe | The pipe to release. |
Releases a previously created communications pipe.
NOT THREADSAFE - Ensure that no other threads are accessing Steamworks API when calling!
Returns: bool
true if the pipe was valid and released successfully; otherwise,
false.
BShutdownIfAllPipesClosed
bool BShutdownIfAllPipesClosed();
Triggers global shutdown for the DLL if all pipes are closed.
Returns: bool
ConnectToGlobalUser
HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe );
Name | Type | Description |
hSteamPipe | HSteamPipe | The connection pipe to connect with. |
Connects to an existing global user, failing if none exists.
Used by the game to coordinate with the SteamUI.
NOT THREADSAFE - Ensure that no other threads are accessing Steamworks API when calling!
Returns: HSteamUserThe HSteamUser handle of the global user. Returns 0 upon failure if the pipe is invalid or there is no global user.
CreateLocalUser
HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType );
Create a Steam user that won't be shared with anyone else. Only used by game servers.
NOT THREADSAFE - Ensure that no other threads are accessing Steamworks API when calling!
Returns: HSteamUserA new handle to a SteamUser.
CreateSteamPipe
HSteamPipe CreateSteamPipe();
Creates a communication pipe to the Steam client.
NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
Returns: HSteamPipeGetIPCCallCount
uint32 GetIPCCallCount();
Returns the number of IPC (Inter-Process Communication) calls made since the last time this function was called.
Used for perf debugging so you can understand how many IPC calls your game makes per frame. Each IPC call is at minimum a thread context switch if not a process switch so you want to be diligent and possibly rate control how often you do them.
Returns: uint32GetISteamApps
ISteamApps * GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamApps interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMAPPS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamApps()
Returns: ISteamApps *
A pointer to the implementation of SteamApps associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamController
ISteamController * GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamController interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMCONTROLLER_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamController()
Returns: ISteamController *
A pointer to the implementation of SteamController associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamFriends
ISteamFriends * GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamFriends interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMFRIENDS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamFriends()
Returns: ISteamFriends *
A pointer to the implementation of SteamFriends associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamGameServer
ISteamGameServer * GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamGameServer interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMGAMESERVER_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamGameServer()
Returns: ISteamGameServer *
A pointer to the implementation of SteamGameServer associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamGameServerStats
ISteamGameServerStats * GetISteamGameServerStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamGameServerStats interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMGAMESERVERSTATS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamGameServerStats()
Returns: ISteamGameServerStats *
A pointer to the implementation of SteamGameServerStats associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamGenericInterface
void * GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves a generic interface associated with a user handle.
You should never need to use this under normal conditions.
Returns: void *
A pointer to an implementation of an interface associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamHTMLSurface
ISteamHTMLSurface * GetISteamHTMLSurface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamHTMLSurface interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMHTMLSURFACE_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamHTMLSurface()
Returns: ISteamHTMLSurface *
A pointer to the implementation of SteamHTMLSurface associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamHTTP
ISteamHTTP * GetISteamHTTP( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamHTTP interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMHTTP_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamHTTP()
Returns: ISteamHTTP *
A pointer to the implementation of SteamHTTP associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamInventory
ISteamInventory * GetISteamInventory( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamInventory interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMINVENTORY_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamInventory()
Returns: ISteamInventory *
A pointer to the implementation of SteamInventory associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamMatchmaking
ISteamMatchmaking * GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamMatchmaking interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMMATCHMAKING_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamMatchmaking()
Returns: ISteamMatchmaking *
A pointer to the implementation of SteamMatchmaking associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamMatchmakingServers
ISteamMatchmakingServers * GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamMatchmakingServers interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamMatchmakingServers()
Returns: ISteamMatchmakingServers *
A pointer to the implementation of SteamMatchmakingServers associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamMusic
ISteamMusic * GetISteamMusic( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamMusic interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMMUSIC_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamMusic()
Returns: ISteamMusic *
A pointer to the implementation of SteamMusic associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamMusicRemote
ISteamMusicRemote * GetISteamMusicRemote( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamMusicRemote interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMMUSICREMOTE_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamMusicRemote()
Returns: ISteamMusicRemote *
A pointer to the implementation of SteamMusicRemote associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamNetworking
ISteamNetworking * GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamNetworking interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMNETWORKING_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamNetworking()
Returns: ISteamNetworking *
A pointer to the implementation of SteamNetworking associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamRemoteStorage
ISteamRemoteStorage * GetISteamRemoteStorage( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamRemoteStorage interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMREMOTESTORAGE_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamRemoteStorage()
Returns: ISteamRemoteStorage *
A pointer to the implementation of SteamRemoteStorage associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamScreenshots
ISteamScreenshots * GetISteamScreenshots( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamScreenshots interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMSCREENSHOTS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamScreenshots()
Returns: ISteamScreenshots *
A pointer to the implementation of SteamScreenshots associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamUGC
ISteamUGC * GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamUGC interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMUGC_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamUGC()
Returns: ISteamUGC *
A pointer to the implementation of SteamUGC associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamUnifiedMessages
ISteamUnifiedMessages * GetISteamUnifiedMessages( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamUnifiedMessages interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamUnifiedMessages()
Returns: ISteamUnifiedMessages *
A pointer to the implementation of SteamUnifiedMessages associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamUser
ISteamUser * GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamUser interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMUSER_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamUser()
Returns: ISteamUser *
A pointer to the implementation of SteamUser associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamUserStats
ISteamUserStats * GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamUserStats interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMUSERSTATS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamUserStats()
Returns: ISteamUserStats *
A pointer to the implementation of SteamUserStats associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamUtils
ISteamUtils * GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamUtils interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMUTILS_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamUtils()
Returns: ISteamUtils *
A pointer to the implementation of SteamUtils associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
GetISteamVideo
ISteamVideo * GetISteamVideo( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
Name | Type | Description |
hSteamUser | HSteamUser | The user handle to get the interface from. |
hSteamPipe | HSteamPipe | The pipe to access the interface over. |
pchVersion | const char * | The version string that identifies the version of the interface that you receive. |
Retrieves the
ISteamVideo interface associated with the specified user handle.
A constant containing the current version of the interface is: "STEAMVIDEO_INTERFACE_VERSION"
You should never need to use this under normal conditions, it's usually functionally equivalent to calling the global accessor:
SteamVideo()
Returns: ISteamVideo *
A pointer to the implementation of SteamVideo associated with the given HSteamUser.
Returns NULL if any of the arguments are not valid.
ReleaseUser
void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser );
Name | Type | Description |
hSteamPipe | HSteamPipe | The connection pipe to remove the user over. |
hUser | HSteamUser | The user to remove. |
Removes an allocated user.
NOT THREADSAFE - Ensure that no other threads are accessing Steamworks API when calling!
SetLocalIPBinding
void SetLocalIPBinding( uint32 unIP, uint16 usPort );
Name | Type | Description |
unIP | uint32 | The local IP to bind to. |
usPort | uint16 | The port to bind to. |
Set the local IP and Port to bind to.
This must be set before calling
CreateLocalUser!
SetWarningMessageHook
void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction );
Name | Type | Description |
pFunction | SteamAPIWarningMessageHook_t | Function pointer to the callback function. |
Sets a warning message hook to receive SteamAPI warnings and info messages in a callback function.
The function prototype must match the definition in SteamAPIWarningMessageHook_t. This includes the extern "C" linkage and __cdecl calling convention.
'int nSeverity' is the severity; 0 for msg, 1 for warning. If you are running in through a debugger only warnings will be sent. If you add -debug_steamapi to the command-line then informational messages will also be sent.
'const char * pchDebugText' is the text of the message.
Callbacks will occur directly after the API function is called that generated the warning or message
Passing NULL will unhook.
Example:extern "C" void __cdecl SteamAPIDebugTextHook( int nSeverity, const char *pchDebugText )
{
::OutputDebugString( pchDebugText );
if ( nSeverity >= 1 )
{
// place to set a breakpoint for catching API errors
int x = 3;
x = x;
}
}
void EnableWarningMessageHook()
{
SteamUtils()->SetWarningMessageHook( &SteamAPIDebugTextHook );
}
Typedefs
These are typedefs which are defined for use with ISteamClient.
Name | Base type | Description |
HSteamPipe | int32 | Handle to a communication pipe to the Steam client. |
HSteamUser | int32 | Handle to single instance of a steam user. |