Steamworks Documentation
ISteamFriends Interface
Interface to access information about individual users and interact with the Steam Overlay.

Member Functions

Member functions for ISteamFriends are called through the global accessor function SteamFriends().

ActivateGameOverlay

void ActivateGameOverlay( const char *pchDialog );
NameTypeDescription
pchDialogconst char *The dialog to open. Valid options are: "friends", "community", "players", "settings", "officialgamegroup", "stats", "achievements".

Activates the Steam Overlay to a specific dialog.

This is equivalent to calling ActivateGameOverlayToUser with steamID set to ISteamUser::GetSteamID.

Example:
SteamFriends()->ActivateGameOverlay( "friends" );

ActivateGameOverlayInviteDialog

void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby );
NameTypeDescription
steamIDLobbyCSteamIDThe Steam ID of the lobby that selected users will be invited to.

Activates the Steam Overlay to open the invite dialog. Invitations sent from this dialog will be for the provided lobby.

ActivateGameOverlayToStore

void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag );
NameTypeDescription
nAppIDAppId_tThe app ID to show the store page of.
eFlagEOverlayToStoreFlagFlags to modify the behavior when the page opens.

Activates the Steam Overlay to the Steam store page for the provided app.

Using k_uAppIdInvalid brings the user to the front page of the Steam store.

ActivateGameOverlayToUser

void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID );
NameTypeDescription
pchDialogconst char *The dialog to open.
steamIDCSteamIDThe Steam ID of the context to open this dialog to.

Activates Steam Overlay to a specific dialog.

Valid pchDialog options are:
  • "steamid" - Opens the overlay web browser to the specified user or groups profile.
  • "chat" - Opens a chat window to the specified user, or joins the group chat.
  • "jointrade" - Opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API.
  • "stats" - Opens the overlay web browser to the specified user's stats.
  • "achievements" - Opens the overlay web browser to the specified user's achievements.
  • "friendadd" - Opens the overlay in minimal mode prompting the user to add the target user as a friend.
  • "friendremove" - Opens the overlay in minimal mode prompting the user to remove the target friend.
  • "friendrequestaccept" - Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.
  • "friendrequestignore" - Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.

ActivateGameOverlayToWebPage

void ActivateGameOverlayToWebPage( const char *pchURL );
NameTypeDescription
pchURLconst char *The webpage to open. (A fully qualified address with the protocol is required, e.g. "http://www.steampowered.com")
eModeEActivateGameOverlayToWebPageModeMode for the web page. Defaults to k_EActivateGameOverlayToWebPageMode_Default

Activates Steam Overlay web browser directly to the specified URL.

ClearRichPresence

void ClearRichPresence();
Clears all of the current user's Rich Presence key/values.

CloseClanChatWindowInSteam

bool CloseClanChatWindowInSteam( CSteamID steamIDClanChat );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the Steam group chat room to close.

Closes the specified Steam group chat room in the Steam UI.

Returns: bool
true if the user successfully left the Steam group chat room.
false if the user is not in the provided Steam group chat room.

See Also: IsClanChatWindowOpenInSteam, OpenClanChatWindowInSteam

DownloadClanActivityCounts

SteamAPICall_t DownloadClanActivityCounts( CSteamID *psteamIDClans, int cClansToRequest );
NameTypeDescription
psteamIDClansCSteamID *A list of steam groups to get the updated data for.
cClansToRequestintThis MUST be the number of groups in psteamIDClans.

Refresh the Steam Group activity data or get the data from groups other than one that the current user is a member.

After receiving the callback you can then use GetClanActivityCounts to get the up to date user counts.

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

EnumerateFollowingList

SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex );
NameTypeDescription
unStartIndexuint32The index to start receiving followers from. This should be 0 on the initial call.

Gets the list of users that the current user is following.

You can be following people that are not your friends. Following allows you to receive updates when the person does things like post a new piece of content to the Steam Workshop.

NOTE: This returns up to k_cEnumerateFollowersMax users at once. If the current user is following more than that, you will need to call this repeatedly, with unStartIndex set to the total number of followers that you have received so far.
I.E. If you have received 50 followers, and the user is following 105, you will need to call this again with unStartIndex = 50 to get the next 50, and then again with unStartIndex = 100 to get the remaining 5 users.

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


Example:
class CEnumerateFollowingListExample { public: void GetWhoWeFollow(); private: void OnFriendsEnumerateFollowingList( FriendsEnumerateFollowingList_t *pCallback, bool bIOFailure ); CCallResult< CEnumerateFollowingListExample, FriendsEnumerateFollowingList_t > m_SteamCallResultFriendsEnumerateFollowingList; int m_nFollowersParsed; }; void CEnumerateFollowingListExample::GetWhoWeFollow() { m_nFollowersParsed = 0; printf( "Getting the list of users that we follow.\n" ); SteamAPICall_t handle = SteamFriends()->EnumerateFollowingList( 0 ); m_SteamCallResultFriendsEnumerateFollowingList.Set( handle, this, &CEnumerateFollowingListExample::OnFriendsEnumerateFollowingList ); } void CEnumerateFollowingListExample::OnFriendsEnumerateFollowingList( FriendsEnumerateFollowingList_t *pCallback, bool bIOFailure ) { if ( pCallback->m_eResult != k_EResultOK || bIOFailure ) { printf( "OnFriendsEnumerateFollowingList failed with m_eResult: %d and bIOFailure: %d!", pCallback->m_eResult, bIOFailure ); return; } printf( "FriendsEnumerateFollowingList retrieved %d of %d people that we follow.\n", pCallback->m_nResultsReturned, pCallback->m_nTotalResultCount ); for ( int i = 0; i < pCallback->m_nResultsReturned; ++i ) { printf( " %d: %lld\n", i, pCallback->m_rgSteamID[i].ConvertToUint64() ); } m_nFollowersParsed += pCallback->m_nResultsReturned; // There are more followers! Gets the next set of them! if ( m_nFollowersParsed < pCallback->m_nTotalResultCount ) { SteamAPICall_t handle = SteamFriends()->EnumerateFollowingList( pCallback->m_nResultsReturned ); m_SteamCallResultFriendsEnumerateFollowingList.Set( handle, this, &CEnumerateFollowingListExample::OnFriendsEnumerateFollowingList ); } }

GetChatMemberByIndex

CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser );
NameTypeDescription
steamIDClanCSteamIDThis MUST be the same source used in the previous call to GetClanChatMemberCount!
iUserintAn index between 0 and GetClanChatMemberCount.

Gets the Steam ID at the given index in a Steam group chat.

NOTE: You must call GetClanChatMemberCount before calling this.

Returns: CSteamID
Invalid indices return k_steamIDNil.

GetClanActivityCounts

bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the activity of.
pnOnlineint *Returns the number of members that are online.
pnInGameint *Returns the number members that are in game (excluding those with their status set to offline).
pnChattingint *Returns the number of members in the group chat room.

Gets the most recent information we have about what the users in a Steam Group are doing.

This can only retrieve data that the local client knows about. To refresh the data or get data from a group other than one that the current user is a member of you must call DownloadClanActivityCounts.

Returns: bool
true if the data was successfully returned.
false if the provided Steam ID is invalid or the local client does not have info about the Steam group and sets all the other parameters to 0.

GetClanByIndex

CSteamID GetClanByIndex( int iClan );
NameTypeDescription
iClanintAn index between 0 and GetClanCount.

This API is deprecated.

Gets the Steam group's Steam ID at the given index.

NOTE: You must call GetClanCount before calling this.

Returns: CSteamID
Invalid indices return k_steamIDNil.

GetClanChatMemberCount

int GetClanChatMemberCount( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the chat count of.

This API is deprecated.

Get the number of users in a Steam group chat.

NOTE: Large steam groups cannot be iterated by the local user.

NOTE: The current user must be in a lobby to retrieve the Steam IDs of other users in that lobby.

This is used for iteration, after calling this then GetChatMemberByIndex can be used to get the Steam ID of each person in the chat.

Returns: int
0 if the Steam ID provided is invalid or if the local user doesn't have the data available.

GetClanChatMessage

int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, CSteamID *psteamidChatter );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the Steam group chat room.
iMessageintThe index of the message. This should be the m_iMessageID field of GameConnectedClanChatMsg_t.
prgchTextvoid *The buffer where the chat message will be copied into. (Should be big enough to hold 2048 UTF-8 characters. So 8192 bytes + 1 for '\0')
cchTextMaxintThe size of prgchText.
peChatEntryTypeEChatEntryType *Returns the type of chat entry that was received.
psteamidChatterCSteamID *Returns the Steam ID of the user that sent the message.

Gets the data from a Steam group chat room message.

This should only ever be called in response to a GameConnectedClanChatMsg_t callback.

Returns: int
The number of bytes copied into prgchText.
Returns 0 and sets peChatEntryType to k_EChatEntryTypeInvalid if the current user is not in the specified Steam group chat room or if the index provided in iMessage is invalid.

GetClanCount

int GetClanCount();
Gets the number of Steam groups that the current user is a member of.

This is used for iteration, after calling this then GetClanByIndex can be used to get the Steam ID of each Steam group.

Returns: int
The number of Steam groups that the user is a member of.

Example:
void ListSteamGroups() { int nGroups = SteamFriends()->GetClanCount(); printf( "Listing %d Steam Groups\n", nGroups ); for ( int i = 0; i < nGroups; ++i ) { CSteamID groupSteamID = SteamFriends()->GetClanByIndex( i ); const char *szGroupName = SteamFriends()->GetClanName( groupSteamID ); const char *szGroupTag = SteamFriends()->GetClanTag( groupSteamID ); int nOnline, nInGame, nChatting; bool success = SteamFriends()->GetClanActivityCounts( groupSteamID, &nOnline, &nInGame, &nChatting ); printf( "Group %d - ID: %lld - Name: '%s' - Tag: '%s'\n", i, groupSteamID.ConvertToUint64(), szGroupName, szGroupTag ); printf( " - Online: %d, In Game: %d, Chatting: %d\n", nOnline, nInGame, nChatting ); } }

GetClanName

const char * GetClanName( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the name of.

Gets the display name for the specified Steam group; if the local client knows about it.

Returns: const char *
The Steam group's name in UTF-8 format. Returns an empty string ("") if the provided Steam ID is invalid or the user does not know about the group.

See Also: DownloadClanActivityCounts

GetClanOfficerByIndex

CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer );
NameTypeDescription
steamIDClanCSteamIDThis must be the same steam group used in the previous call to GetClanOfficerCount!
iOfficerintAn index between 0 and GetClanOfficerCount.

Gets the Steam ID of the officer at the given index in a Steam group.

NOTE: You must call GetClanOfficerCount before calling this.

Returns: CSteamID
k_steamIDNil if steamIDClan or iOfficer are invalid.

GetClanOfficerCount

int GetClanOfficerCount( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the officer count of.

Gets the number of officers (administrators and moderators) in a specified Steam group.

This also includes the owner of the Steam group.

This is used for iteration, after calling this then GetClanOfficerByIndex can be used to get the Steam ID of each officer.

NOTE: You must call RequestClanOfficerList before this to get the required data!

Returns: int
The number of officers in the Steam group. Returns 0 if steamIDClan is invalid or if RequestClanOfficerList has not been called for it.

GetClanOwner

CSteamID GetClanOwner( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam ID of the Steam group to get the owner for.

Gets the owner of a Steam Group.

NOTE: You must call RequestClanOfficerList before this to get the required data!

Returns: CSteamID
Returns k_steamIDNil if steamIDClan is invalid or if RequestClanOfficerList has not been called for it.

GetClanTag

const char * GetClanTag( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the tag of.

Gets the unique tag (abbreviation) for the specified Steam group; If the local client knows about it.

The Steam group abbreviation is a unique way for people to identify the group and is limited to 12 characters. In some games this will appear next to the name of group members.

Returns: const char *
The Steam groups tag in UTF-8 format. Returns an empty string ("") if the provided Steam ID is invalid or the user does not know about the group.

See Also: DownloadClanActivityCounts

GetCoplayFriend

CSteamID GetCoplayFriend( int iCoplayFriend );
NameTypeDescription
iCoplayFriendintAn index between 0 and GetCoplayFriendCount.

Gets the Steam ID of the recently played with user at the given index.

NOTE: You must call GetCoplayFriendCount before calling this.

Returns: CSteamID
Invalid indices return k_steamIDNil.

GetCoplayFriendCount

int GetCoplayFriendCount();
Gets the number of players that the current user has recently played with, across all games.

This is used for iteration, after calling this then GetCoplayFriend can be used to get the Steam ID of each player.

These players are have been set with previous calls to SetPlayedWith.

Returns: int
The number of users that the current user has recently played with.

Example:
void ListRecentlyPlayedWithList() { int nPlayers = SteamFriends()->GetCoplayFriendCount(); printf( "Listing %d Recently Played with Players\n", nPlayers ); for ( int i = 0; i < nPlayers; ++i ) { CSteamID playerSteamID = SteamFriends()->GetCoplayFriend( i ); int iTimeStamp = SteamFriends()->GetFriendCoplayTime( playerSteamID ); AppId_t app = SteamFriends()->GetFriendCoplayGame( playerSteamID ); printf( "Player %d - ID: %lld - Time: %d - App: %d\n", i, playerSteamID.ConvertToUint64(), iTimeStamp, app ); } }

GetFollowerCount

SteamAPICall_t GetFollowerCount( CSteamID steamID );
NameTypeDescription
steamIDCSteamIDThe user to get the follower count for.

Gets the number of users following the specified user.

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


Example:
class GetFollowerCountExample { public: void GetFollowerCount(); private: void OnFriendsGetFollowerCount( FriendsGetFollowerCount_t *pCallback, bool bIOFailure ); CCallResult< GetFollowerCountExample, FriendsGetFollowerCount_t > m_SteamCallResultFriendsGetFollowerCount; }; void GetFollowerCountExample::GetFollowerCount() { printf( "Getting the number of users who follow us.\n" ); SteamAPICall_t handle = SteamFriends()->GetFollowerCount( SteamUser()->GetSteamID() ); m_SteamCallResultFriendsGetFollowerCount.Set( handle, this, &GetFollowerCountExample::OnFriendsGetFollowerCount ); } void GetFollowerCountExample::OnFriendsGetFollowerCount( FriendsGetFollowerCount_t *pCallback, bool bIOFailure ) { if ( pCallback->m_eResult != k_EResultOK || bIOFailure ) { printf( "OnFriendsGetFollowerCount failed for %lld with m_eResult: %d and bIOFailure: %d!", pCallback->m_steamID.ConvertToUint64(), pCallback->m_eResult, bIOFailure ); return; } printf( "Got a FriendsGetFollowerCount_t, we have %d followers.\n", pCallback->m_nCount ); }

GetFriendByIndex

CSteamID GetFriendByIndex( int iFriend, int iFriendFlags );
NameTypeDescription
iFriendintAn index between 0 and GetFriendCount.
iFriendFlagsintA combined union (binary "or") of EFriendFlags. This must be the same value as used in the previous call to GetFriendCount.

Gets the Steam ID of the user at the given index.

NOTE: You must call GetFriendCount before calling this.

Returns: CSteamID
Invalid indices return k_steamIDNil.

GetFriendCoplayGame

AppId_t GetFriendCoplayGame( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the user on the recently-played-with list to get the game played.

Gets the app ID of the game that user played with someone on their recently-played-with list.

Returns: AppId_t
Steam IDs not in the recently-played-with list return k_uAppIdInvalid.

GetFriendCoplayTime

int GetFriendCoplayTime( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the user on the recently-played-with list to get the timestamp for.

Gets the timestamp of when the user played with someone on their recently-played-with list.

Returns: int
The time is provided in Unix epoch format (seconds since Jan 1st 1970).
Steam IDs not in the recently-played-with list return 0.

GetFriendCount

int GetFriendCount( int iFriendFlags );
NameTypeDescription
iFriendFlagsintA combined union (binary "or") of one or more EFriendFlags.

Gets the number of users the client knows about who meet a specified criteria. (Friends, blocked, users on the same server, etc)

This can be used to iterate over all of the users by calling GetFriendByIndex to get the Steam IDs of each user.

Returns: int
The number of users that meet the specified criteria.

NOTE: Returns -1 if the current user is not logged on.

Example:
int nFriends = SteamFriends()->GetFriendCount( k_EFriendFlagImmediate ); if ( nFriends == -1) { printf( "GetFriendCount returned -1, the current user is not logged in.\n" ); // We always recommend resetting to 0 just in case you were to do something like allocate // an array with this value, or loop over it in a way that doesn't take into the -1 into account. nFriends = 0; } for ( int i = 0; i < nFriends; ++i ) { CSteamID friendSteamID = SteamFriends()->GetFriendByIndex( i, k_EFriendFlagImmediate ); const char *friendName = SteamFriends()->GetFriendPersonaName( friendSteamID ); printf( "Friend %d: %lld - %s\n", i, friendSteamID.ConvertToUint64(), friendName ); }

GetFriendCountFromSource

int GetFriendCountFromSource( CSteamID steamIDSource );
NameTypeDescription
steamIDSourceCSteamIDThe Steam group, chat room, lobby or game server to get the user count of.

Get the number of users in a source (Steam group, chat room, lobby, or game server).

NOTE: Large Steam groups cannot be iterated by the local user.

NOTE: If you're getting the number of lobby members then you should use ISteamMatchmaking::GetNumLobbyMembers instead.

This is used for iteration, after calling this then GetFriendFromSourceByIndex can be used to get the Steam ID of each person in the source.

Returns: int
0 if the Steam ID provided is invalid or if the local user doesn't have the data available.

GetFriendFromSourceByIndex

CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend );
NameTypeDescription
steamIDSourceCSteamIDThis MUST be the same source used in the previous call to GetFriendCountFromSource!
iFriendintAn index between 0 and GetFriendCountFromSource.

Gets the Steam ID at the given index from a source (Steam group, chat room, lobby, or game server).

NOTE: You must call GetFriendCountFromSource before calling this.

Returns: CSteamID
Invalid indices return k_steamIDNil.

GetFriendGamePlayed

bool GetFriendGamePlayed( CSteamID steamIDFriend, FriendGameInfo_t *pFriendGameInfo );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the other user.
pFriendGameInfoFriendGameInfo_t *Fills in the details if the user is in a game.

Checks if the specified friend is in a game, and gets info about the game if they are.

Returns: bool
true if the user is a friend and is in a game; otherwise, false.

GetFriendMessage

int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the friend that sent this message.
iMessageIDintThe index of the message. This should be the m_iMessageID field of GameConnectedFriendChatMsg_t.
pvDatavoid *The buffer where the chat message will be copied into.
cubDataintThe size of pvData.
peChatEntryTypeEChatEntryType *Returns the type of chat entry that was received.

Gets the data from a Steam friends message.

This should only ever be called in response to a GameConnectedFriendChatMsg_t callback.

Returns: int
The number of bytes copied into pvData.
Returns 0 and sets peChatEntryType to k_EChatEntryTypeInvalid if the current user is chat restricted, if the provided Steam ID is not a friend, or if the index provided in iMessageID is invalid.

GetFriendPersonaName

const char * GetFriendPersonaName( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the other user.

Gets the specified user's persona (display) name.

This will only be known to the current user if the other user is in their friends list, on the same game server, in a chat room or lobby, or in a small Steam group with the local user.

NOTE: Upon on first joining a lobby, chat room, or game server the current user will not known the name of the other users automatically; that information will arrive asynchronously via PersonaStateChange_t callbacks.

To get the persona name of the current user use GetPersonaName.

Returns: const char *
The current user's persona name in UTF-8 format. Guaranteed to not be NULL.

Returns an empty string (""), or "[unknown]" if the Steam ID is invalid or not known to the caller.

GetFriendPersonaNameHistory

const char * GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the other user.
iPersonaNameintThe index of the history to receive. 0 is their current persona name, 1 is their most recent before they changed it, etc.

Gets one of the previous display names for the specified user.

This only works for display names that the current user has seen on the local computer.

Returns: const char *
The players old persona name at the given index. Returns an empty string when there are no further items in the history.

GetFriendPersonaState

EPersonaState GetFriendPersonaState( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the other user.

Gets the current status of the specified user.

This will only be known to the current user if the other user is in their friends list, on the same game server, in a chat room or lobby, or in a small Steam group with the local user.

To get the state of the current user use GetPersonaState.

Returns: EPersonaState
The friend state of the specified user. (Online, Offline, In-Game, etc)

GetFriendRelationship

EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the other user.

Gets a relationship to a specified user.

Returns: EFriendRelationship
How the users know each other.

GetFriendRichPresence

const char * GetFriendRichPresence( CSteamID steamIDFriend, const char *pchKey );
NameTypeDescription
steamIDFriendCSteamIDThe friend to get the Rich Presence value for.
pchKeyconst char *The Rich Presence key to request.

Get a Rich Presence value from a specified friend.

Returns: const char *
Returns an empty string ("") if the specified key is not set.

See Also: RequestFriendRichPresence, SetRichPresence

GetFriendRichPresenceKeyByIndex

const char * GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int iKey );
NameTypeDescription
steamIDFriendCSteamIDThis should be the same user provided to the previous call to GetFriendRichPresenceKeyCount!
iKeyintAn index between 0 and GetFriendRichPresenceKeyCount.



Returns: const char *
Returns an empty string ("") if the index is invalid or the specified user has no Rich Presence data available.

GetFriendRichPresenceKeyCount

int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the user to get the Rich Presence Key Count of.

Gets the number of Rich Presence keys that are set on the specified user.

This is used for iteration, after calling this then GetFriendRichPresenceKeyByIndex to get the rich presence keys.

This is typically only ever used for debugging purposes.

Returns: int
Returns 0 if there is no Rich Presence information for the specified user.

GetFriendsGroupCount

int GetFriendsGroupCount();
Gets the number of friends groups (tags) the user has created.

This is used for iteration, after calling this then GetFriendsGroupIDByIndex can be used to get the ID of each friend group.

This is not to be confused with Steam groups. Those can be obtained with GetClanCount.

Returns: int
The number of friends groups the current user has.

Example:
void ListFriendsGroups() { int nGroups = SteamFriends()->GetFriendsGroupCount(); for ( int i = 0; i < nGroups; ++i ) { FriendsGroupID_t friendsGroupID = SteamFriends()->GetFriendsGroupIDByIndex( i ); const char *szFriendsGroupName = SteamFriends()->GetFriendsGroupName( friendsGroupID ); int nFriendsGroupMembers = SteamFriends()->GetFriendsGroupMembersCount( friendsGroupID ); printf( "Group %d - ID: %d - Name: '%s' - Members: %d\n", i, friendsGroupID, szFriendsGroupName, nFriendsGroupMembers ); std::vector<CSteamID> friends( nFriendsGroupMembers ); SteamFriends()->GetFriendsGroupMembersList( friendsGroupID, friends.data(), nFriendsGroupMembers ); for ( int j = 0; j < nFriendsGroupMembers; ++j ) { printf( " - Member %d - ID: %lld\n", j, friends[j].ConvertToUint64() ); } } }

GetFriendsGroupIDByIndex

FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG );
NameTypeDescription
iFGintAn index between 0 and GetFriendsGroupCount.

Gets the friends group ID for the given index.

NOTE: You must call GetFriendsGroupCount before calling this.

Returns: FriendsGroupID_t
Invalid indices return k_FriendsGroupID_Invalid.

GetFriendsGroupMembersCount

int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID );
NameTypeDescription
friendsGroupIDFriendsGroupID_tThe friends group ID to get the number of friends in.

Gets the number of friends in a given friends group.

This should be called before getting the list of friends with GetFriendsGroupMembersList.

Returns: int
The number of friends in the specified friends group.

See Also: GetFriendsGroupCount

GetFriendsGroupMembersList

void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, CSteamID *pOutSteamIDMembers, int nMembersCount );
NameTypeDescription
friendsGroupIDFriendsGroupID_tThe friends group ID to get the members list of.
pOutSteamIDMembersCSteamID *Returns the Steam IDs of the friends by setting them in this array.
nMembersCountintThis should match the number of elements allocated pOutSteamIDMembers and the value returned by GetFriendsGroupMembersCount.

Gets the number of friends in the given friends group.

If fewer friends exist than requested those positions' Steam IDs will be invalid.

You must call GetFriendsGroupMembersCount before calling this to set up the pOutSteamIDMembers array with an appropriate size!

See Also: GetFriendsGroupCount

GetFriendsGroupName

const char * GetFriendsGroupName( FriendsGroupID_t friendsGroupID );
NameTypeDescription
friendsGroupIDFriendsGroupID_tThe friends group ID to get the name of.

Gets the name for the given friends group.

Returns: const char *
The friend groups name in UTF-8 format. Returns NULL if the group ID is invalid.

See Also: GetFriendsGroupCount

GetFriendSteamLevel

int GetFriendSteamLevel( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the user.

Gets the Steam level of the specified user.

You can use the local users Steam ID (ISteamUser::GetSteamID) to get their level.

Returns: int
The Steam level if it's available.

If the Steam level is not immediately available for the specified user then this returns 0 and queues it to be downloaded from the Steam servers. When it gets downloaded a PersonaStateChange_t callback will be posted with m_nChangeFlags including k_EPersonaChangeSteamLevel.

GetLargeFriendAvatar

int GetLargeFriendAvatar( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamID

Gets a handle to the large (128*128px) avatar for the specified user.

You can pass in ISteamUser::GetSteamID to get the current user's avatar.

NOTE: This only works for users that the local user knows about. They will automatically know about their friends, people on leaderboards they've requested, or people in the same source as them (Steam group, chat room, lobby, or game server). If they don't know about them then you must call RequestUserInformation to cache the avatar locally.

Returns: int
Triggers a AvatarImageLoaded_t callback.
A Steam image handle which is used with ISteamUtils::GetImageSize and ISteamUtils::GetImageRGBA.
Returns 0 if no avatar is set for the user.
Returns -1 if the avatar image data has not been loaded yet and requests that it gets download. In this case wait for a AvatarImageLoaded_t callback and then call this again.

See Also: GetMediumFriendAvatar, GetSmallFriendAvatar

GetMediumFriendAvatar

int GetMediumFriendAvatar( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamID

Gets a handle to the medium (64*64px) avatar for the specified user.

You can pass in ISteamUser::GetSteamID to get the current user's avatar.

NOTE: This only works for users that the local user knows about. They will automatically know about their friends, people on leaderboards they've requested, or people in the same source as them (Steam group, chat room, lobby, or game server). If they don't know about them then you must call RequestUserInformation to cache the avatar locally.

Returns: int
A Steam image handle which is used with ISteamUtils::GetImageSize and ISteamUtils::GetImageRGBA.
Returns 0 if no avatar is set for the user.

See Also: GetLargeFriendAvatar, GetSmallFriendAvatar

GetPersonaName

const char * GetPersonaName();
Gets the current user's persona (display) name.

This is the same name that is displayed the user's community profile page.

To get the persona name of other users use GetFriendPersonaName.

Returns: const char *
The current user's persona name in UTF-8 format. Guaranteed to not be NULL.

GetPersonaState

EPersonaState GetPersonaState();
Gets the friend status of the current user.

To get the state of other users use GetFriendPersonaState.

Returns: EPersonaState
The friend state of the current user. (Online, Offline, In-Game, etc)

GetPlayerNickname

const char * GetPlayerNickname( CSteamID steamIDPlayer );
NameTypeDescription
steamIDPlayerCSteamIDThe Steam ID of the user.

Gets the nickname that the current user has set for the specified user.

Returns: const char *
NULL if the no nickname has been set for that user.

GetSmallFriendAvatar

int GetSmallFriendAvatar( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamID

Gets a handle to the small (32*32px) avatar for the specified user.

You can pass in ISteamUser::GetSteamID to get the current user's avatar.

NOTE: This only works for users that the local user knows about. They will automatically know about their friends, people on leaderboards they've requested, or people in the same source as them (Steam group, chat room, lobby, or game server). If they don't know about them then you must call RequestUserInformation to cache the avatar locally.

Returns: int
A Steam image handle which is used with ISteamUtils::GetImageSize and ISteamUtils::GetImageRGBA.
Returns 0 if no avatar is set for the user.

See Also: GetLargeFriendAvatar, GetMediumFriendAvatar

GetUserRestrictions

uint32 GetUserRestrictions();
Checks if current user is chat restricted.

If they are restricted, then they can't send or receive any text/voice chat messages, can't see custom avatars.
A chat restricted user can't add friends or join any groups.
Restricted users can still be online and send/receive game invites.

Returns: uint32
See: EUserRestriction

HasFriend

bool HasFriend( CSteamID steamIDFriend, int iFriendFlags );
NameTypeDescription
steamIDFriendCSteamIDThe Steam user to check the friend status of.
iFriendFlagsintA combined union (binary "or") of one or more EFriendFlags.

Checks if the user meets the specified criteria. (Friends, blocked, users on the same server, etc)

Returns: bool
true if the specified user meets any of the criteria specified in iFriendFlags; otherwise, false.

InviteUserToGame

bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the friend to invite.
pchConnectStringconst char *A string that lets the friend know how to join the game (I.E. the game server IP). This can not be longer than specified in k_cchMaxRichPresenceValueLength.

Invites a friend or clan member to the current game using a special invite string.

If the target user accepts the invite then the pchConnectString gets added to the command-line when launching the game.
If the game is already running for that user, then they will receive a GameRichPresenceJoinRequested_t callback with the connect string.

Returns: bool
Triggers a GameRichPresenceJoinRequested_t callback.
true if the invite was successfully sent.
false under the following conditions:
  • The Steam ID provided to steamIDFriend was invalid.
  • The Steam ID provided to steamIDFriend is not a friend or does not share the same Steam Group as the current user.
  • The value provided to pchConnectString was too long.

See Also: ISteamMatchmaking::InviteUserToLobby

IsClanChatAdmin

bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the Steam group chat room.
steamIDUserCSteamIDThe Steam ID of the user to check the admin status of.

Checks if a user in the Steam group chat room is an admin.

Returns: bool
true if the specified user is an admin.
false if the user is not an admin, if the current user is not in the chat room specified, or the specified user is not in the chat room.

IsClanPublic

bool IsClanPublic( CSteamID steamIDClan );
NameTypeDescription
steamIDClan CSteamIDThe Steam ID of the Steam group.

Checks if the Steam group is public.

Returns: bool
true if the specified group is public
false if the specified group is not public

IsClanOfficialGameGroup

bool IsClanOfficialGameGroup( CSteamID steamIDClan );
NameTypeDescription
steamIDClan CSteamIDThe Steam ID of the Steam group.

Checks if the Steam group is an official game group/community hub.

Returns: bool
true if the specified group is an official game group/community hub
false if the specified group is not an official game group/community hub

IsClanChatWindowOpenInSteam

bool IsClanChatWindowOpenInSteam( CSteamID steamIDClanChat );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the Steam group chat room to check.

Checks if the Steam Group chat room is open in the Steam UI.

Returns: bool
true if the specified Steam group chat room is opened; otherwise, false.
This also returns false if the specified Steam group chat room is unknown.

See Also: OpenClanChatWindowInSteam, CloseClanChatWindowInSteam

IsFollowing

SteamAPICall_t IsFollowing( CSteamID steamID );
NameTypeDescription
steamIDCSteamIDThe Steam ID of the check if we are following.

Checks if the current user is following the specified user.

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


Example:
class CIsFollowingExample { public: CIsFollowingExample(); void CheckWhichFriendsWeAreFollowing(); private: void OnFriendsIsFollowing( FriendsIsFollowing_t *pCallback, bool bIOFailure ); CCallResult< CIsFollowingExample, FriendsIsFollowing_t > m_SteamCallResultFriendsIsFollowing; int m_nFriends; int m_iFriendIndex; }; CIsFollowingExample::CIsFollowingExample() { m_nFriends = SteamFriends()->GetFriendCount( k_EFriendFlagImmediate ); if ( m_nFriends == -1 ) { printf( "GetFriendCount returned -1, the current user is not logged in.\n" ); m_nFriends = 0; } m_iFriendIndex = 0; } void CIsFollowingExample::CheckWhichFriendsWeAreFollowing() { if ( m_iFriendIndex < m_nFriends ) { CSteamID steamID = SteamFriends()->GetFriendByIndex( m_iFriendIndex, k_EFriendFlagImmediate ); printf( "Checking if we follow %lld (%d of %d).\n", steamID.ConvertToUint64(), m_iFriendIndex, m_nFriends ); SteamAPICall_t handle = SteamFriends()->IsFollowing( steamID ); m_SteamCallResultFriendsIsFollowing.Set( handle, this, &CIsFollowingExample::OnFriendsIsFollowing ); } } void CIsFollowingExample::OnFriendsIsFollowing( FriendsIsFollowing_t *pCallback, bool bIOFailure ) { if ( pCallback->m_eResult != k_EResultOK || bIOFailure ) { printf( "OnFriendsIsFollowing failed for %lld with m_eResult: %d and bIOFailure: %d!\n", pCallback->m_steamID.ConvertToUint64(), pCallback->m_eResult, bIOFailure ); return; } if ( pCallback->m_bIsFollowing ) printf( "We are following %lld\n", pCallback->m_steamID.ConvertToUint64() ); // Recursively check our whole friends list. m_iFriendIndex++; CheckWhichFriendsWeAreFollowing(); }

IsUserInSource

bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource );
NameTypeDescription
steamIDUserCSteamIDThe user to check if they are in the source.
steamIDSourceCSteamIDThe source to check for the user.

This API is deprecated.

Checks if a specified user is in a source (Steam group, chat room, lobby, or game server).

Returns: bool
true if the local user can see that steamIDUser is a member or in steamIDSource; otherwise, false.

JoinClanChatRoom

SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam ID of the Steam group to join.

Allows the user to join Steam group (clan) chats right within the game.

The behavior is somewhat complicated, because the user may or may not be already in the group chat from outside the game or in the overlay.

You can use ActivateGameOverlayToUser to open the in-game overlay version of the chat.

If you have joined a Steam group chat then you should be watching for the following callbacks:

Returns: SteamAPICall_t to be used with a JoinClanChatRoomCompletionResult_t call result.
Triggers a GameConnectedChatJoin_t callback.
Triggers a GameConnectedClanChatMsg_t callback.


See Also: LeaveClanChatRoom, GetClanChatMemberCount, GetChatMemberByIndex, SendClanChatMessage, GetClanChatMessage, IsClanChatAdmin, IsClanChatWindowOpenInSteam

LeaveClanChatRoom

bool LeaveClanChatRoom( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam ID of the Steam group chat to leave.

Leaves a Steam group chat that the user has previously entered with JoinClanChatRoom.

Returns: bool
Triggers a GameConnectedChatLeave_t callback.
true if user is in the specified chat room, otherwise false.

OpenClanChatWindowInSteam

bool OpenClanChatWindowInSteam( CSteamID steamIDClanChat );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the Steam group chat room to open.

Opens the specified Steam group chat room in the Steam UI.

Returns: bool
true if the user successfully entered the Steam group chat room.
false in one of the following situations:
  • The provided Steam group chat room does not exist or the user does not have access to join it.
  • The current user is currently rate limited.
  • The current user is chat restricted.

See Also: IsClanChatWindowOpenInSteam, CloseClanChatWindowInSteam

ReplyToFriendMessage

bool ReplyToFriendMessage( CSteamID steamIDFriend, const char *pchMsgToSend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the friend to send the message to.
pchMsgToSendconst char *The UTF-8 formatted message to send.

Sends a message to a Steam friend.

Returns: bool
true if the message was successfully sent.
false if the current user is rate limited or chat restricted.

RequestClanOfficerList

SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan );
NameTypeDescription
steamIDClanCSteamIDThe Steam group to get the officers list for.

Requests information about a Steam group officers (administrators and moderators).

NOTE: You can only ask about Steam groups that a user is a member of.
NOTE: This won't download avatars for the officers automatically. If no avatar image is available for an officer, then call RequestUserInformation to download the avatar.

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


See Also: GetClanOwner, GetClanOfficerCount, GetClanOfficerByIndex

Example:
class CClanOfficerListExample { public: void RequestOfficerList(); private: void OnClanOfficerListResponse( ClanOfficerListResponse_t *pCallback, bool bIOFailure ); CCallResult< CClanOfficerListExample, ClanOfficerListResponse_t > m_SteamCallResultClanOfficerListResponse; }; void CClanOfficerListExample::RequestOfficerList() { printf( "Requesting the Clan Officer List\n" ); const CSteamID SteamworksDevGroup = 103582791433474333ull; SteamAPICall_t handle = SteamFriends()->RequestClanOfficerList( SteamworksDevGroup ); m_SteamCallResultClanOfficerListResponse.Set( handle, this, &CClanOfficerListExample::OnClanOfficerListResponse ); } void CClanOfficerListExample::OnClanOfficerListResponse( ClanOfficerListResponse_t *pCallback, bool bIOFailure ) { if ( !pCallback->m_bSuccess || bIOFailure ) { printf( "ClanOfficerListResponse failed for %lld!", pCallback->m_steamIDClan.ConvertToUint64() ); return; } printf( "Got a ClanOfficerListResponse for: %s (%lld)\n", SteamFriends()->GetClanName( pCallback->m_steamIDClan ), pCallback->m_steamIDClan.ConvertToUint64() ); CSteamID ownerSteamID = SteamFriends()->GetClanOwner(pCallback->m_steamIDClan); printf( " The owner of the clan is: %s (%lld) and there are %d officers.\n", SteamFriends()->GetFriendPersonaName( ownerSteamID ), ownerSteamID.ConvertToUint64(), pCallback->m_cOfficers ); int nOfficers = SteamFriends()->GetClanOfficerCount( pCallback->m_steamIDClan ); printf( " GetClanOfficerCount reports: %d", nOfficers ); for ( int i = 0; i < nOfficers; ++i ) { CSteamID officerSteamID = SteamFriends()->GetClanOfficerByIndex( pCallback->m_steamIDClan, i ); printf( " Officer %d: %s (%lld)\n", i, SteamFriends()->GetFriendPersonaName(officerSteamID), officerSteamID.ConvertToUint64() ); } }

RequestFriendRichPresence

void RequestFriendRichPresence( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriendCSteamIDThe Steam ID of the user to request the rich presence of.

Requests Rich Presence data from a specific user.

This is used to get the Rich Presence information from a user that is not a friend of the current user, like someone in the same lobby or game server.

This function is rate limited, if you call this too frequently for a particular user then it will just immediately post a callback without requesting new data from the server.

Returns: void
Triggers a FriendRichPresenceUpdate_t callback.


See Also: GetFriendRichPresence, SetRichPresence

RequestUserInformation

bool RequestUserInformation( CSteamID steamIDUser, bool bRequireNameOnly );
NameTypeDescription
steamIDUserCSteamIDThe user to request the information of.
bRequireNameOnlyboolRetrieve the Persona name only (true)? Or both the name and the avatar (false)?

Requests the persona name and optionally the avatar of a specified user.

NOTE: It's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them.

Returns: bool
Triggers a PersonaStateChange_t callback.
true means that the data has being requested, and a PersonaStateChange_t callback will be posted when it's retrieved.
false means that we already have all the details about that user, and functions that require this information can be used immediately.

SendClanChatMessage

bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText );
NameTypeDescription
steamIDClanChatCSteamIDThe Steam ID of the group chat to send the message to.
pchTextconst char *The UTF-8 formatted message to send. This can be up to 2048 characters long.

Sends a message to a Steam group chat room.

Returns: bool
true if the message was successfully sent.
false under one of the following circumstances:
  • The current user is not in the specified group chat.
  • The current user is not connected to Steam.
  • The current user is rate limited.
  • The current user is chat restricted.
  • The message in pchText exceeds 2048 characters.

SetInGameVoiceSpeaking

void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking );
NameTypeDescription
steamIDUserCSteamIDUnused.
bSpeakingboolDid the user start speaking in game (true) or stopped speaking in game (false)?

Let Steam know that the user is currently using voice chat in game.

This will suppress the microphone for all voice communication in the Steam UI.

SetListenForFriendsMessages

bool SetListenForFriendsMessages( bool bInterceptEnabled );
NameTypeDescription
bInterceptEnabledboolTurn friends message interception on (true) or off (false)?

Listens for Steam friends chat messages.

You can then show these chats inline in the game. For example, the chat system in Dota 2.

After enabling this you will receive GameConnectedFriendChatMsg_t callbacks whenever the user receives a chat message. You can get the actual message data from this callback with GetFriendMessage. You can send messages with ReplyToFriendMessage.

Returns: bool
Triggers a GameConnectedFriendChatMsg_t callback.
Always returns true.

SetPersonaName

SteamAPICall_t SetPersonaName( const char *pchPersonaName );
NameTypeDescription
pchPersonaNameconst char *The users new persona name. Can not be longer than k_cchPersonaNameMax bytes.

Sets the current user's persona name, stores it on the server and publishes the changes to all friends who are online.

Changes take place locally immediately, and a PersonaStateChange_t callback is posted, presuming success.

If the name change fails to happen on the server, then an additional PersonaStateChange_t callback will be posted to change the name back, in addition to the final result available in the call result.

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

SetPlayedWith

void SetPlayedWith( CSteamID steamIDUserPlayedWith );
NameTypeDescription
steamIDUserPlayedWithCSteamIDThe other user that we have played with.

Mark a target user as 'played with'.

NOTE: The current user must be in game with the other player for the association to work.

You can view the players you have recently played with here on the Steam community and in the Steam Overlay.

SetRichPresence

bool SetRichPresence( const char *pchKey, const char *pchValue );
NameTypeDescription
pchKeyconst char *The rich presence 'key' to set. This can not be longer than specified in k_cchMaxRichPresenceKeyLength.
pchValueconst char *The rich presence 'value' to associate with pchKey. This can not be longer than specified in k_cchMaxRichPresenceValueLength.
If this is set to an empty string ("") or NULL then the key is removed if it's set.

Sets a Rich Presence key/value for the current user that is automatically shared to all friends playing the same game.

Each user can have up to 20 keys set as defined by k_cchMaxRichPresenceKeys.

There are two special keys used for viewing/joining games:
  • "status" - A UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list.
  • "connect" - A UTF-8 string that contains the command-line for how a friend can connect to a game. This enables the 'join game' button in the 'view game info' dialog, in the steam friends list right click menu, and on the players Steam community profile. Be sure your app implements ISteamApps::GetLaunchCommandLine so you can disable the popup warning when launched via a command line.

There are three additional special keys used by the new Steam Chat:
  • "steam_display" - Names a rich presence localization token that will be displayed in the viewing user's selected language in the Steam client UI. See Rich Presence Localization for more info, including a link to a page for testing this rich presence data. If steam_display is not set to a valid localization tag, then rich presence will not be displayed in the Steam client.
  • "steam_player_group" - When set, indicates to the Steam client that the player is a member of a particular group. Players in the same group may be organized together in various places in the Steam UI. This string could identify a party, a server, or whatever grouping is relevant for your game. The string itself is not displayed to users.
  • "steam_player_group_size" - When set, indicates the total number of players in the steam_player_group. The Steam client may use this number to display additional information about a group when all of the members are not part of a user's friends list. (For example, "Bob, Pete, and 4 more".)

You can clear all of the keys for the current user with ClearRichPresence.

To get rich presence keys for friends see: GetFriendRichPresence.

Returns: bool
true if the rich presence was set successfully.
false under the following conditions:

RequestEquippedProfileItems

SteamAPICall_t RequestEquippedProfileItems( CSteamID steamID);
NameTypeDescription
steamIDCSteamIDThe user that you want to retrieve equipped items for.

Requests the list of equipped Steam Community profile items for the given user from Steam.

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

BHasEquippedProfileItem

bool BHasEquippedProfileItem( CSteamID steamID, ECommunityProfileItemType itemType);
NameTypeDescription
steamIDCSteamIDThe user that you had already retrieved equipped items for
itemTypeECommunityProfileItemTypeType of item you want to see is equipped or not

After calling RequestEquippedProfileItems, you can use this function to check if the user has a type of profile item equipped or not.

Returns: bool
true if the itemType is equipped for the user
false if the itemType is not equipped for the user

See Also: RequestEquippedProfileItems, GetProfileItemPropertyString, GetProfileItemPropertyUint

GetProfileItemPropertyString

bool GetProfileItemPropertyString( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop);
NameTypeDescription
steamIDCSteamIDThe user that you had already retrieved equipped items for
itemTypeECommunityProfileItemTypeType of item you are retrieving the property for
propECommunityProfileItemPropertyThe string property you want to retrieve

Returns a string property for a user's equipped profile item.

Returns: const char *

See Also: RequestEquippedProfileItems, GetProfileItemPropertyUint

GetProfileItemPropertyUint

bool GetProfileItemPropertyUint( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop);
NameTypeDescription
steamIDCSteamIDThe user that you had already retrieved equipped items for
itemTypeECommunityProfileItemTypeType of item you are retrieving the property for
propECommunityProfileItemPropertyThe unsigned integer property you want to retrieve

Returns an unsigned integer property for a user's equipped profile item.

Returns: uint32

See Also: RequestEquippedProfileItems, GetProfileItemPropertyString

Callbacks

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 ISteamFriends.

AvatarImageLoaded_t

Called when a large avatar is loaded if you have tried requesting it when it was unavailable.

NameTypeDescription
m_steamIDCSteamIDThe Steam ID that the avatar has been loaded for.
m_iImageintThe Steam image handle of the now loaded image.
m_iWideintWidth of the loaded image.
m_iTallintHeight of the loaded image.

Associated Functions: GetLargeFriendAvatar

ClanOfficerListResponse_t

Marks the return of a request officer list call.

NameTypeDescription
m_steamIDClanCSteamIDThe Steam group that we just got the officer list for.
m_cOfficersintThe number of officers in the group. This is the same as GetClanOfficerCount.
m_bSuccessuint8Was the call successful? If it wasn't this may indicate a temporary loss of connection to Steam.
If this returns true, this does not necessarily mean that all of the info for this Steam group has been downloaded.

Associated Functions: RequestClanOfficerList

DownloadClanActivityCountsResult_t

Called when a Steam group activity has been received.

NameTypeDescription
m_bSuccessboolWas the call successful?

Associated Functions: DownloadClanActivityCounts

FriendRichPresenceUpdate_t

Called when Rich Presence data has been updated for a user, this can happen automatically when friends in the same game update their rich presence, or after a call to RequestFriendRichPresence.

NameTypeDescription
m_steamIDFriendCSteamIDThe Steam ID of the user who's rich presence has changed.
m_nAppIDAppId_tThe App ID of the game. This should always be the current game.

Associated Functions: RequestFriendRichPresence

FriendsEnumerateFollowingList_t

Returns the result of EnumerateFollowingList.

NameTypeDescription
m_eResultEResultThe result of the operation.
m_rgSteamIDCSteamIDk_cEnumerateFollowersMaxThe list of users that we are following.
m_nResultsReturnedint32The number of results returned in m_rgSteamID.
m_nTotalResultCountint32The total number of people we are following. If this is greater than m_nResultsReturned Then you should make a subsequent call to EnumerateFollowingList with m_nResultsReturned as the index to get the next portion of followers.

Associated Functions: EnumerateFollowingList

FriendsGetFollowerCount_t

Returns the result of GetFollowerCount.

NameTypeDescription
m_eResultEResultThe result of the operation.
m_steamIDCSteamIDThe Steam ID of the user we requested the follower count for.
m_nCountintThe number of followers the user has.

Associated Functions: GetFollowerCount

FriendsIsFollowing_t

Returns the result of IsFollowing.

NameTypeDescription
m_eResultEResultThe result of the operation.
m_steamIDCSteamIDThe Steam ID that was checked.
m_bIsFollowingboolAre we following the user? (true) or not? (false)

Associated Functions: IsFollowing

GameConnectedChatJoin_t

Called when a user has joined a Steam group chat that we are in.

NameTypeDescription
m_steamIDClanChatCSteamIDThe Steam ID of the chat that a user has joined.
m_steamIDUserCSteamIDThe Steam ID of the user that has joined the chat.

Associated Functions: JoinClanChatRoom

GameConnectedChatLeave_t

Called when a user has left a Steam group chat that the we are in.

NameTypeDescription
m_steamIDClanChatCSteamIDThe Steam ID of the chat that a user has left.
m_steamIDUserCSteamIDThe Steam ID of the user that has left the chat.
m_bKickedboolWas the user kicked by an officer (true), or not (false)?
m_bDroppedboolWas the user's connection to Steam dropped (true), or did they leave via other means (false)?

Associated Functions: LeaveClanChatRoom

GameConnectedClanChatMsg_t

Called when a chat message has been received in a Steam group chat that we are in.

NameTypeDescription
m_steamIDClanChatCSteamIDThe Steam ID of the chat that the message was received in.
m_steamIDUserCSteamIDThe Steam ID of the user that sent the message.
m_iMessageIDintThe index of the message to get the actual data from with GetClanChatMessage.

Associated Functions: JoinClanChatRoom

GameConnectedFriendChatMsg_t

Called when chat message has been received from a friend.

NameTypeDescription
m_steamIDUserCSteamIDThe Steam ID of the friend that sent the message.
m_iMessageIDintThe index of the message to get the actual data from with GetFriendMessage.

Associated Functions: SetListenForFriendsMessages

GameLobbyJoinRequested_t

Called when the user tries to join a lobby from their friends list or from an invite. The game client should attempt to connect to specified lobby when this is received. If the game isn't running yet then the game will be automatically launched with the command line parameter +connect_lobby <64-bit lobby Steam ID> instead.

NameTypeDescription
m_steamIDLobbyCSteamIDThe Steam ID of the lobby to connect to.
m_steamIDFriendCSteamIDThe friend they joined through. This will be invalid if not directly via a friend.

NOTE: This callback is made when joining a lobby. If the user is attempting to join a game but not a lobby, then the callback GameRichPresenceJoinRequested_t will be made.

GameOverlayActivated_t

Posted when the Steam Overlay activates or deactivates. The game can use this to pause or resume single player games.

NameTypeDescription
m_bActiveuint81 if it's just been activated, otherwise 0.

GameRichPresenceJoinRequested_t

Called when the user tries to join a game from their friends list or after a user accepts an invite by a friend with InviteUserToGame.

NameTypeDescription
m_steamIDFriendCSteamIDThe friend they joined through. This will be invalid if not directly via a friend.
m_rgchConnectchar[k_cchMaxRichPresenceValueLengthThe value associated with the "connect" Rich Presence key.

Associated Functions: InviteUserToGame

NOTE: This callback is made when joining a game. If the user is attempting to join a lobby, then the callback GameLobbyJoinRequested_t will be made.

GameServerChangeRequested_t

Called when the user tries to join a different game server from their friends list. The game client should attempt to connect to the specified server when this is received.

NameTypeDescription
m_rgchServerchar[64]Server address (e.g. "127.0.0.1:27015", "tf2.valvesoftware.com")
m_rgchPasswordchar[64]Server password, if any.

JoinClanChatRoomCompletionResult_t

Posted when the user has attempted to join a Steam group chat via JoinClanChatRoom

NameTypeDescription
m_steamIDClanChatCSteamIDThe Steam ID of the chat that the user has joined.
m_eChatRoomEnterResponseEChatRoomEnterResponseThe result of the operation.

Associated Functions: JoinClanChatRoom

PersonaStateChange_t

Called whenever a friends' status changes.

NameTypeDescription
m_ulSteamIDuint64Steam ID of the user who changed.
m_nChangeFlagsintA bit-wise union of EPersonaChange values.

Associated Functions: RequestUserInformation

SetPersonaNameResponse_t

Reports the result of an attempt to change the current user's persona name.

NameTypeDescription
m_bSuccessbooltrue if name change completed successfully.
m_bLocalSuccessbooltrue if name change was retained locally. We might not have been able to communicate with Steam.
m_resultEResultThe result of the operation.

Associated Functions: SetPersonaName

Structs

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

FriendGameInfo_t

Information about the game a friend is playing.
Obtainable from: GetFriendGamePlayed.

NameTypeDescription
m_gameIDCGameIDThe game ID that the friend is playing.
m_unGameIPuint32The IP of the server the friend is playing on.
m_usGamePortuint16The port of the server the friend is playing on.
m_usQueryPortuint16The query port of the server the friend is playing on.
m_steamIDLobbyCSteamIDThe Steam ID of the lobby the friend is in.

FriendSessionStateInfo_t

Information about user sessions. (Steam Internal usage only.)

NameTypeDescription
m_uiOnlineSessionInstancesuint32
m_uiPublishedToFriendsSessionInstanceuint8

EquippedProfileItemsChanged_t

Callback for when a user's equipped Steam Community profile items have changed. This can be for the current user or their friends.

NameTypeDescription
m_steamIDCSteamID

EquippedProfileItems_t

CallResult from RequestEquippedProfileItems. Also sent as a Callback.

NameTypeDescription
m_eResultEResult
m_bHasAnimatedAvatarCSteamID
m_bHasAvatarFramebool
m_bHasProfileModifierbool
m_bHasProfileBackgroundbool
m_bHasMiniProfileBackgroundbool

Enums

These are enums which are defined for use with ISteamFriends.

EFriendFlags

Flags for enumerating friends list, or quickly checking the relationship between users.

NameValueDescription
k_EFriendFlagNone0x00None.
k_EFriendFlagBlocked0x01Users that the current user has blocked from contacting.
k_EFriendFlagFriendshipRequested0x02Users that have sent a friend invite to the current user.
k_EFriendFlagImmediate0x04The current user's "regular" friends.
k_EFriendFlagClanMember0x08Users that are in one of the same (small) Steam groups as the current user.
k_EFriendFlagOnGameServer0x10Users that are on the same game server; as set by SetPlayedWith.
k_EFriendFlagRequestingFriendship0x80Users that the current user has sent friend invites to.
k_EFriendFlagRequestingInfo0x100Users that are currently sending additional info about themselves after a call to RequestUserInformation
k_EFriendFlagIgnored0x200Users that the current user has ignored from contacting them.
k_EFriendFlagIgnoredFriend0x400Users that have ignored the current user; but the current user still knows about them.
k_EFriendFlagChatMember0x1000Users in one of the same chats.
k_EFriendFlagAll0xFFFFReturns all friend flags.

EFriendRelationship

Declares the set of relationships that Steam users may have.

NameValueDescription
k_EFriendRelationshipNone0The users have no relationship.
k_EFriendRelationshipBlocked1The user has just clicked Ignore on an friendship invite. This doesn't get stored.
k_EFriendRelationshipRequestRecipient2The user has requested to be friends with the current user.
k_EFriendRelationshipFriend3A "regular" friend.
k_EFriendRelationshipRequestInitiator4The current user has sent a friend invite.
k_EFriendRelationshipIgnored5The current user has explicit blocked this other user from comments/chat/etc. This is stored.
k_EFriendRelationshipIgnoredFriend6The user has ignored the current user.
k_EFriendRelationshipSuggested_DEPRECATED7Deprecated -- Unused.
k_EFriendRelationshipMax8The total number of friend relationships used for looping and verification.

EOverlayToStoreFlag

These values are passed as parameters to the store with ActivateGameOverlayToStore and modify the behavior when the page opens.

NameValueDescription
k_EOverlayToStoreFlag_None0No
k_EOverlayToStoreFlag_AddToCart1Deprecated, now works the same as k_EOverlayToStoreFlag_AddToCartAndShow.
k_EOverlayToStoreFlag_AddToCartAndShow2Add the specified app ID to the users cart and show the store page.

EPersonaChange

used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend

NameValueDescription
k_EPersonaChangeName0x0001
k_EPersonaChangeStatus0x0002
k_EPersonaChangeComeOnline0x0004
k_EPersonaChangeGoneOffline0x0008
k_EPersonaChangeGamePlayed0x0010
k_EPersonaChangeGameServer0x0020
k_EPersonaChangeAvatar0x0040
k_EPersonaChangeJoinedSource0x0080
k_EPersonaChangeLeftSource0x0100
k_EPersonaChangeRelationshipChanged0x0200
k_EPersonaChangeNameFirstSet0x0400
k_EPersonaChangeFacebookInfo0x0800
k_EPersonaChangeNickname0x1000
k_EPersonaChangeSteamLevel0x2000

EPersonaState

List of states a Steam friend can be in.

NameValueDescription
k_EPersonaStateOffline0Friend is not currently logged on.
k_EPersonaStateOnline1Friend is logged on.
k_EPersonaStateBusy2Friend is logged on, but set to "Do not disturb."
k_EPersonaStateAway3Auto-away feature.
k_EPersonaStateSnooze4Auto-away for a long time.
k_EPersonaStateLookingToTrade5Online, trading.
k_EPersonaStateLookingToPlay6Online, wanting to play.
k_EPersonaStateMax7The total number of states. Only used for looping and validation.

EUserRestriction

User restriction flags. These are returned by GetUserRestrictions.

NameValueDescription
k_nUserRestrictionNone0No known chat/content restriction.
k_nUserRestrictionUnknown1We don't know yet, the user is offline.
k_nUserRestrictionAnyChat2User is not allowed to (or can't) send/recv any chat.
k_nUserRestrictionVoiceChat4User is not allowed to (or can't) send/recv voice chat.
k_nUserRestrictionGroupChat8User is not allowed to (or can't) send/recv group chat.
k_nUserRestrictionRating16User is too young according to rating in current region.
k_nUserRestrictionGameInvites32User cannot send or recv game invites, for example if they are on mobile.
k_nUserRestrictionTrading64User cannot participate in trading, for example if they are on a console or mobile.

ECommunityProfileItemType

Steam Community profile item types

NameValueDescription
k_ECommunityProfileItemType_AnimatedAvatar0Animated avatar image (GIF)
k_ECommunityProfileItemType_AvatarFrame1Avatar frame (may or may not be an animated PNG)
k_ECommunityProfileItemType_ProfileModifier2Special profile modifier item, like Seasonal Profile or Artist Profile
k_ECommunityProfileItemType_ProfileBackground3Profile background image or movie
k_ECommunityProfileItemType_MiniProfileBackground4Background image or movie for the hover flyout for a user

ECommunityProfileItemProperty

Properties on a Steam Community profile item. See GetProfileItemPropertyString and GetProfileItemPropertyUint.

NameValueDescription
k_ECommunityProfileItemProperty_ImageSmall0URL to the small or animated version of the image
k_ECommunityProfileItemProperty_ImageLarge1URL to the large or static version of the image
k_ECommunityProfileItemProperty_InternalName2Internal name entered on the partner site (for debugging)
k_ECommunityProfileItemProperty_Title3Localized name of the item
k_ECommunityProfileItemProperty_Description4Localized description of the item
k_ECommunityProfileItemProperty_AppID5AppID of the item (unsigned integer)
k_ECommunityProfileItemProperty_TypeID6Type id of the item, unique to the appid (unsigned integer)
k_ECommunityProfileItemProperty_Class7"Class" or type of item (internal value, unsigned integer)
k_ECommunityProfileItemProperty_MovieWebM8URL to the webm video file
k_ECommunityProfileItemProperty_MovieMP49URL to the mp4 video file
k_ECommunityProfileItemProperty_MovieWebMSmall10URL to the small webm video file
k_ECommunityProfileItemProperty_MovieMP4Small11URL to the small mp4 video file

EActivateGameOverlayToWebPageMode

Game Overlay web page modes

NameValueDescription
k_EActivateGameOverlayToWebPageMode_Default0Browser will open next to all other windows that the user has open in the overlay. The window will remain open, even if the user closes then re-opens the overlay.
k_EActivateGameOverlayToWebPageMode_Modal1Browser will be opened in a special overlay configuration which hides all other windows that the user has open in the overlay. When the user closes the overlay, the browser window will also close. When the user closes the browser window, the overlay will automatically close.

Typedefs

These are typedefs which are defined for use with ISteamFriends.

NameBase typeDescription
FriendsGroupID_tint16Friends group (tags) identifier.

Constants

These are constants which are defined for use with ISteamFriends.

NameTypeValueDescription
k_cchMaxFriendsGroupNameint64The maximum length that a friends group name can be (not including the null-terminator!)
k_cchMaxRichPresenceKeyLengthint64The maximum length that a rich presence key can be.
k_cchMaxRichPresenceKeysint20The maximum amount of rich presence keys that can be set.
k_cchMaxRichPresenceValueLengthint256The maximum length that a rich presence value can be.
k_cchPersonaNameMaxint128Maximum number of UTF-8 bytes in a users persona (display) name.
k_cEnumerateFollowersMaxint50The maximum number of followers that will be returned in a FriendsEnumerateFollowingList_t call result at once.
k_cFriendsGroupLimitint100Deprecated - Unused.
k_cubChatMetadataMaxuint328192Maximum size in bytes that chat room, lobby, or chat/lobby member metadata may have.
k_cwchPersonaNameMaxint32The maximum amount of UTF-16 characters in a users persona (display) name.
k_FriendsGroupID_InvalidFriendsGroupID_t-1Invalid friends group identifier.
STEAMFRIENDS_INTERFACE_VERSIONconst char *"SteamFriends015"

Rich Presence Localization


Localization for rich presence is a list of token names and values provided for each supported language. Token names begin a # and can contain any alphanumeric character and underscores. Token values contain localized text, and may also contain substitutions, which specify portions of the string to be replaced by other rich presence values.

  • The simplest token is plain localized text:
    "#Status_AtMainMenu" "At the Main Menu"
    In the example above, if steam_display is set to #Status_AtMainMenu using SetRichPresence, then "At the Main Menu" will be displayed alongside the player's information in the Steam client.

  • A substitution looks like this:
    "#StatusWithScore" "Score: %score%"
    In this case, if steam_display is set to "#StatusWithScore" using SetRichPresence and "score" is set to "3" using the same API, then "Score: 3" will be displayed alongside the player's information in the Steam client.

  • Substitutions can also trigger additional localization by enclosing a substring with braces. For example:
    "#PlayingHero" "Playing: {#Hero_%hero%}" "#Hero_Tidehunter" "Tidehunter"
    Substitutions on the brace-delimited substring are performed first, then the resultant tag is localized. In this instance, if steam_display is set to "#PlayingHero" and "hero" is set to "Tidehunter", the Steam client will localize "#Hero_Tidehunter" and display "Playing: Tidehunter".

    Note: Rich presence keys used in substitutions may only contain alphanumeric characters, underscores, and colons.

    In the case where a localization token is not found, the system will attempt to fallback to English. If English is also not found, then rich presence will not be displayed in the Steam client. Similarly, if a token specifies a substitution using a rich presence key that is not set, then rich presence will not be displayed in the Steam client.

    The game developer provides the rich presence localization file under the Rich Presence section of the Community tab which can be found through the Edit Steamworks Settings page.

    rpedit.jpg

    For testing, http://www.steamcommunity.com/dev/testrichpresence can be used to display the localized rich presence string for the logged in user, as well as some error information about incomplete or incorrect data. The string will be localized into whatever language has been set for the Steam website.

    Each language can be uploaded individually in files that look like this:

    "lang" { "english" { "tokens" { "#StatusWithoutScore" "{#Status_%gamestatus%}" "#StatusWithScore" "{#Status_%gamestatus%}: %score%" "#Status_AtMainMenu" "At the main menu" "#Status_WaitingForMatch" "Waiting for match" "#Status_Winning" "Winning" "#Status_Losing" "Losing" "#Status_Tied" "Tied" } } }

    Multiple languages can also be included in a single upload. Only languages present in the file are overwritten.
    "lang" { "english" { "tokens" { "#StatusWithoutScore" "{#Status_%gamestatus%}" "#StatusWithScore" "{#Status_%gamestatus%}: %score%" "#Status_AtMainMenu" "At the main menu" "#Status_WaitingForMatch" "Waiting for match" "#Status_Winning" "Winning" "#Status_Losing" "Losing" "#Status_Tied" "Tied" } } "french" { "tokens" { "#Status_AtMainMenu" "Au menu principal" "#Status_WaitingForMatch" "En attente de match" "#Status_Winning" "Gagnant" "#Status_Losing" "Perdant" "#Status_Tied" "Egalité" } } }