C# Class Steamworks.SteamFriends

Show file Open project: rlabrecque/Steamworks.NET Class Usage Examples

Public Methods

Method Description
ActivateGameOverlay ( string pchDialog ) : void

activates the game overlay, with an optional dialog to open

valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements"

ActivateGameOverlayInviteDialog ( CSteamID steamIDLobby ) : void

activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby.

ActivateGameOverlayToStore ( AppId_t nAppID, EOverlayToStoreFlag eFlag ) : void

activates game overlay to store page for app

ActivateGameOverlayToUser ( string pchDialog, CSteamID steamID ) : void

activates game overlay to a specific place

valid 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 ( string pchURL ) : void

activates game overlay web browser directly to the specified URL

full address with protocol type is required, e.g. http://www.steamgames.com/

ClearRichPresence ( ) : void
CloseClanChatWindowInSteam ( CSteamID steamIDClanChat ) : bool
DownloadClanActivityCounts ( CSteamID psteamIDClans, int cClansToRequest ) : SteamAPICall_t

for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest

EnumerateFollowingList ( uint unStartIndex ) : SteamAPICall_t
GetChatMemberByIndex ( CSteamID steamIDClan, int iUser ) : CSteamID
GetClanActivityCounts ( CSteamID steamIDClan, int &pnOnline, int &pnInGame, int &pnChatting ) : bool

returns the most recent information we have about what's happening in a clan

GetClanByIndex ( int iClan ) : CSteamID
GetClanChatMemberCount ( CSteamID steamIDClan ) : int
GetClanChatMessage ( CSteamID steamIDClanChat, int iMessage, string &prgchText, int cchTextMax, EChatEntryType &peChatEntryType, CSteamID &psteamidChatter ) : int
GetClanCount ( ) : int

clan (group) iteration and access functions

GetClanName ( CSteamID steamIDClan ) : string
GetClanOfficerByIndex ( CSteamID steamIDClan, int iOfficer ) : CSteamID

returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount)

GetClanOfficerCount ( CSteamID steamIDClan ) : int

returns the number of officers in a clan (including the owner)

GetClanOwner ( CSteamID steamIDClan ) : CSteamID

iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed

returns the steamID of the clan owner

GetClanTag ( CSteamID steamIDClan ) : string
GetCoplayFriend ( int iCoplayFriend ) : CSteamID
GetCoplayFriendCount ( ) : int

recently-played-with friends iteration

this iterates the entire list of users recently played with, across games

GetFriendCoplayTime() returns as a unix time

GetFollowerCount ( CSteamID steamID ) : SteamAPICall_t

following apis

GetFriendByIndex ( int iFriend, EFriendFlags iFriendFlags ) : CSteamID

returns the steamID of a user

iFriend is a index of range [0, GetFriendCount())

iFriendsFlags must be the same value as used in GetFriendCount()

the returned CSteamID can then be used by all the functions below to access details about the user

GetFriendCoplayGame ( CSteamID steamIDFriend ) : AppId_t
GetFriendCoplayTime ( CSteamID steamIDFriend ) : int
GetFriendCount ( EFriendFlags iFriendFlags ) : int

friend iteration

takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria

then GetFriendByIndex() can then be used to return the id's of each of those users

GetFriendCountFromSource ( CSteamID steamIDSource ) : int

iterators for getting users in a chat room, lobby, game server or clan

note that large clans that cannot be iterated by the local user

note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby

steamIDSource can be the steamID of a group, game server, lobby or chat room

GetFriendFromSourceByIndex ( CSteamID steamIDSource, int iFriend ) : CSteamID
GetFriendGamePlayed ( CSteamID steamIDFriend, FriendGameInfo_t &pFriendGameInfo ) : bool

returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details

GetFriendMessage ( CSteamID steamIDFriend, int iMessageID, string &pvData, int cubData, EChatEntryType &peChatEntryType ) : int
GetFriendPersonaName ( CSteamID steamIDFriend ) : string

returns the name another user - guaranteed to not be NULL.

same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user

note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously

GetFriendPersonaNameHistory ( CSteamID steamIDFriend, int iPersonaName ) : string

accesses old friends names - returns an empty string when their are no more items in the history

GetFriendPersonaState ( CSteamID steamIDFriend ) : EPersonaState

returns the current status of the specified user

this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user

GetFriendRelationship ( CSteamID steamIDFriend ) : EFriendRelationship

returns a relationship to a user

GetFriendRichPresence ( CSteamID steamIDFriend, string pchKey ) : string
GetFriendRichPresenceKeyByIndex ( CSteamID steamIDFriend, int iKey ) : string
GetFriendRichPresenceKeyCount ( CSteamID steamIDFriend ) : int
GetFriendSteamLevel ( CSteamID steamIDFriend ) : int

friends steam level

GetFriendsGroupCount ( ) : int

friend grouping (tag) apis

returns the number of friends groups

GetFriendsGroupIDByIndex ( int iFG ) : FriendsGroupID_t

returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid)

GetFriendsGroupMembersCount ( FriendsGroupID_t friendsGroupID ) : int

returns the number of members in a given friends group

GetFriendsGroupMembersList ( FriendsGroupID_t friendsGroupID, CSteamID pOutSteamIDMembers, int nMembersCount ) : void

gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid

GetFriendsGroupName ( FriendsGroupID_t friendsGroupID ) : string

returns the name for the given friends group (NULL in the case of invalid friends group IDs)

GetLargeFriendAvatar ( CSteamID steamIDFriend ) : int

gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again

GetMediumFriendAvatar ( CSteamID steamIDFriend ) : int

gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

GetPersonaName ( ) : string

returns the local players name - guaranteed to not be NULL.

this is the same name as on the users community profile page

this is stored in UTF-8 format

like all the other interface functions that return a char *, it's important that this pointer is not saved

off; it will eventually be free'd or re-allocated

GetPersonaState ( ) : EPersonaState

gets the status of the current user

GetPlayerNickname ( CSteamID steamIDPlayer ) : string

Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player.

GetSmallFriendAvatar ( CSteamID steamIDFriend ) : int

gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

GetUserRestrictions ( ) : uint

if current user is chat restricted, he can't send or receive any text/voice chat messages.

the user can't see custom avatars. But the user can be online and send/recv game invites.

a chat restricted user can't add friends or join any groups.

HasFriend ( CSteamID steamIDFriend, EFriendFlags iFriendFlags ) : bool

returns true if the specified user meets any of the criteria specified in iFriendFlags

iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values

InviteUserToGame ( CSteamID steamIDFriend, string pchConnectString ) : bool

rich invite support

if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game

if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string

invites can only be sent to friends

IsClanChatAdmin ( CSteamID steamIDClanChat, CSteamID steamIDUser ) : bool
IsClanChatWindowOpenInSteam ( CSteamID steamIDClanChat ) : bool

interact with the Steam (game overlay / desktop)

IsFollowing ( CSteamID steamID ) : SteamAPICall_t
IsUserInSource ( CSteamID steamIDUser, CSteamID steamIDSource ) : bool

returns true if the local user can see that steamIDUser is a member or in steamIDSource

JoinClanChatRoom ( CSteamID steamIDClan ) : SteamAPICall_t

chat interface for games

this allows in-game access to group (clan) chats from in the game

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

use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat

LeaveClanChatRoom ( CSteamID steamIDClan ) : bool
OpenClanChatWindowInSteam ( CSteamID steamIDClanChat ) : bool
ReplyToFriendMessage ( CSteamID steamIDFriend, string pchMsgToSend ) : bool
RequestClanOfficerList ( CSteamID steamIDClan ) : SteamAPICall_t

requests information about a clan officer list

when complete, data is returned in ClanOfficerListResponse_t call result

this makes available the calls below

you can only ask about clans that a user is a member of

note that this won't download avatars automatically; if you get an officer,

and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar

RequestFriendRichPresence ( CSteamID steamIDFriend ) : void

Requests rich presence for a specific user.

RequestUserInformation ( CSteamID steamIDUser, bool bRequireNameOnly ) : bool

requests information about a user - persona name & avatar

if bRequireNameOnly is set, then the avatar of a user isn't downloaded

- it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them

if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved

if returns false, it means that we already have all the details about that user, and functions can be called immediately

SendClanChatMessage ( CSteamID steamIDClanChat, string pchText ) : bool
SetInGameVoiceSpeaking ( CSteamID steamIDUser, bool bSpeaking ) : void

User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)

SetListenForFriendsMessages ( bool bInterceptEnabled ) : bool

peer-to-peer chat interception

this is so you can show P2P chats inline in the game

SetPersonaName ( string pchPersonaName ) : SteamAPICall_t

Sets the player 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 is posted, presuming success.

The final results are available through the return value SteamAPICall_t, using SetPersonaNameResponse_t.

If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted

to change the name back, in addition to the SetPersonaNameResponse_t callback.

SetPlayedWith ( CSteamID steamIDUserPlayedWith ) : void

Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is

in game

SetRichPresence ( string pchKey, string pchValue ) : bool

Rich Presence data is automatically shared between friends who are in the same game

Each user has a set of Key/Value pairs

Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength

There are two magic keys:

"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

GetFriendRichPresence() returns an empty string "" if no value is set

SetRichPresence() to a NULL or an empty string deletes the key

You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()

and GetFriendRichPresenceKeyByIndex() (typically only used for debugging)

Method Details

ActivateGameOverlay() public static method

activates the game overlay, with an optional dialog to open

valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements"

public static ActivateGameOverlay ( string pchDialog ) : void
pchDialog string
return void

ActivateGameOverlayInviteDialog() public static method

activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby.

public static ActivateGameOverlayInviteDialog ( CSteamID steamIDLobby ) : void
steamIDLobby CSteamID
return void

ActivateGameOverlayToStore() public static method

activates game overlay to store page for app

public static ActivateGameOverlayToStore ( AppId_t nAppID, EOverlayToStoreFlag eFlag ) : void
nAppID AppId_t
eFlag EOverlayToStoreFlag
return void

ActivateGameOverlayToUser() public static method

activates game overlay to a specific place

valid 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

public static ActivateGameOverlayToUser ( string pchDialog, CSteamID steamID ) : void
pchDialog string
steamID CSteamID
return void

ActivateGameOverlayToWebPage() public static method

activates game overlay web browser directly to the specified URL

full address with protocol type is required, e.g. http://www.steamgames.com/

public static ActivateGameOverlayToWebPage ( string pchURL ) : void
pchURL string
return void

ClearRichPresence() public static method

public static ClearRichPresence ( ) : void
return void

CloseClanChatWindowInSteam() public static method

public static CloseClanChatWindowInSteam ( CSteamID steamIDClanChat ) : bool
steamIDClanChat CSteamID
return bool

DownloadClanActivityCounts() public static method

for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest

public static DownloadClanActivityCounts ( CSteamID psteamIDClans, int cClansToRequest ) : SteamAPICall_t
psteamIDClans CSteamID
cClansToRequest int
return SteamAPICall_t

EnumerateFollowingList() public static method

public static EnumerateFollowingList ( uint unStartIndex ) : SteamAPICall_t
unStartIndex uint
return SteamAPICall_t

GetChatMemberByIndex() public static method

public static GetChatMemberByIndex ( CSteamID steamIDClan, int iUser ) : CSteamID
steamIDClan CSteamID
iUser int
return CSteamID

GetClanActivityCounts() public static method

returns the most recent information we have about what's happening in a clan

public static GetClanActivityCounts ( CSteamID steamIDClan, int &pnOnline, int &pnInGame, int &pnChatting ) : bool
steamIDClan CSteamID
pnOnline int
pnInGame int
pnChatting int
return bool

GetClanByIndex() public static method

public static GetClanByIndex ( int iClan ) : CSteamID
iClan int
return CSteamID

GetClanChatMemberCount() public static method

public static GetClanChatMemberCount ( CSteamID steamIDClan ) : int
steamIDClan CSteamID
return int

GetClanChatMessage() public static method

public static GetClanChatMessage ( CSteamID steamIDClanChat, int iMessage, string &prgchText, int cchTextMax, EChatEntryType &peChatEntryType, CSteamID &psteamidChatter ) : int
steamIDClanChat CSteamID
iMessage int
prgchText string
cchTextMax int
peChatEntryType EChatEntryType
psteamidChatter CSteamID
return int

GetClanCount() public static method

clan (group) iteration and access functions

public static GetClanCount ( ) : int
return int

GetClanName() public static method

public static GetClanName ( CSteamID steamIDClan ) : string
steamIDClan CSteamID
return string

GetClanOfficerByIndex() public static method

returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount)

public static GetClanOfficerByIndex ( CSteamID steamIDClan, int iOfficer ) : CSteamID
steamIDClan CSteamID
iOfficer int
return CSteamID

GetClanOfficerCount() public static method

returns the number of officers in a clan (including the owner)

public static GetClanOfficerCount ( CSteamID steamIDClan ) : int
steamIDClan CSteamID
return int

GetClanOwner() public static method

iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed

returns the steamID of the clan owner

public static GetClanOwner ( CSteamID steamIDClan ) : CSteamID
steamIDClan CSteamID
return CSteamID

GetClanTag() public static method

public static GetClanTag ( CSteamID steamIDClan ) : string
steamIDClan CSteamID
return string

GetCoplayFriend() public static method

public static GetCoplayFriend ( int iCoplayFriend ) : CSteamID
iCoplayFriend int
return CSteamID

GetCoplayFriendCount() public static method

recently-played-with friends iteration

this iterates the entire list of users recently played with, across games

GetFriendCoplayTime() returns as a unix time

public static GetCoplayFriendCount ( ) : int
return int

GetFollowerCount() public static method

following apis

public static GetFollowerCount ( CSteamID steamID ) : SteamAPICall_t
steamID CSteamID
return SteamAPICall_t

GetFriendByIndex() public static method

returns the steamID of a user

iFriend is a index of range [0, GetFriendCount())

iFriendsFlags must be the same value as used in GetFriendCount()

the returned CSteamID can then be used by all the functions below to access details about the user

public static GetFriendByIndex ( int iFriend, EFriendFlags iFriendFlags ) : CSteamID
iFriend int
iFriendFlags EFriendFlags
return CSteamID

GetFriendCoplayGame() public static method

public static GetFriendCoplayGame ( CSteamID steamIDFriend ) : AppId_t
steamIDFriend CSteamID
return AppId_t

GetFriendCoplayTime() public static method

public static GetFriendCoplayTime ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetFriendCount() public static method

friend iteration

takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria

then GetFriendByIndex() can then be used to return the id's of each of those users

public static GetFriendCount ( EFriendFlags iFriendFlags ) : int
iFriendFlags EFriendFlags
return int

GetFriendCountFromSource() public static method

iterators for getting users in a chat room, lobby, game server or clan

note that large clans that cannot be iterated by the local user

note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby

steamIDSource can be the steamID of a group, game server, lobby or chat room

public static GetFriendCountFromSource ( CSteamID steamIDSource ) : int
steamIDSource CSteamID
return int

GetFriendFromSourceByIndex() public static method

public static GetFriendFromSourceByIndex ( CSteamID steamIDSource, int iFriend ) : CSteamID
steamIDSource CSteamID
iFriend int
return CSteamID

GetFriendGamePlayed() public static method

returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details

public static GetFriendGamePlayed ( CSteamID steamIDFriend, FriendGameInfo_t &pFriendGameInfo ) : bool
steamIDFriend CSteamID
pFriendGameInfo FriendGameInfo_t
return bool

GetFriendMessage() public static method

public static GetFriendMessage ( CSteamID steamIDFriend, int iMessageID, string &pvData, int cubData, EChatEntryType &peChatEntryType ) : int
steamIDFriend CSteamID
iMessageID int
pvData string
cubData int
peChatEntryType EChatEntryType
return int

GetFriendPersonaName() public static method

returns the name another user - guaranteed to not be NULL.

same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user

note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously

public static GetFriendPersonaName ( CSteamID steamIDFriend ) : string
steamIDFriend CSteamID
return string

GetFriendPersonaNameHistory() public static method

accesses old friends names - returns an empty string when their are no more items in the history

public static GetFriendPersonaNameHistory ( CSteamID steamIDFriend, int iPersonaName ) : string
steamIDFriend CSteamID
iPersonaName int
return string

GetFriendPersonaState() public static method

returns the current status of the specified user

this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user

public static GetFriendPersonaState ( CSteamID steamIDFriend ) : EPersonaState
steamIDFriend CSteamID
return EPersonaState

GetFriendRelationship() public static method

returns a relationship to a user

public static GetFriendRelationship ( CSteamID steamIDFriend ) : EFriendRelationship
steamIDFriend CSteamID
return EFriendRelationship

GetFriendRichPresence() public static method

public static GetFriendRichPresence ( CSteamID steamIDFriend, string pchKey ) : string
steamIDFriend CSteamID
pchKey string
return string

GetFriendRichPresenceKeyByIndex() public static method

public static GetFriendRichPresenceKeyByIndex ( CSteamID steamIDFriend, int iKey ) : string
steamIDFriend CSteamID
iKey int
return string

GetFriendRichPresenceKeyCount() public static method

public static GetFriendRichPresenceKeyCount ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetFriendSteamLevel() public static method

friends steam level

public static GetFriendSteamLevel ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetFriendsGroupCount() public static method

friend grouping (tag) apis

returns the number of friends groups

public static GetFriendsGroupCount ( ) : int
return int

GetFriendsGroupIDByIndex() public static method

returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid)

public static GetFriendsGroupIDByIndex ( int iFG ) : FriendsGroupID_t
iFG int
return FriendsGroupID_t

GetFriendsGroupMembersCount() public static method

returns the number of members in a given friends group

public static GetFriendsGroupMembersCount ( FriendsGroupID_t friendsGroupID ) : int
friendsGroupID FriendsGroupID_t
return int

GetFriendsGroupMembersList() public static method

gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid

public static GetFriendsGroupMembersList ( FriendsGroupID_t friendsGroupID, CSteamID pOutSteamIDMembers, int nMembersCount ) : void
friendsGroupID FriendsGroupID_t
pOutSteamIDMembers CSteamID
nMembersCount int
return void

GetFriendsGroupName() public static method

returns the name for the given friends group (NULL in the case of invalid friends group IDs)

public static GetFriendsGroupName ( FriendsGroupID_t friendsGroupID ) : string
friendsGroupID FriendsGroupID_t
return string

GetLargeFriendAvatar() public static method

gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again

public static GetLargeFriendAvatar ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetMediumFriendAvatar() public static method

gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

public static GetMediumFriendAvatar ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetPersonaName() public static method

returns the local players name - guaranteed to not be NULL.

this is the same name as on the users community profile page

this is stored in UTF-8 format

like all the other interface functions that return a char *, it's important that this pointer is not saved

off; it will eventually be free'd or re-allocated

public static GetPersonaName ( ) : string
return string

GetPersonaState() public static method

gets the status of the current user

public static GetPersonaState ( ) : EPersonaState
return EPersonaState

GetPlayerNickname() public static method

Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player.

public static GetPlayerNickname ( CSteamID steamIDPlayer ) : string
steamIDPlayer CSteamID
return string

GetSmallFriendAvatar() public static method

gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set

public static GetSmallFriendAvatar ( CSteamID steamIDFriend ) : int
steamIDFriend CSteamID
return int

GetUserRestrictions() public static method

if current user is chat restricted, he can't send or receive any text/voice chat messages.

the user can't see custom avatars. But the user can be online and send/recv game invites.

a chat restricted user can't add friends or join any groups.

public static GetUserRestrictions ( ) : uint
return uint

HasFriend() public static method

returns true if the specified user meets any of the criteria specified in iFriendFlags

iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values

public static HasFriend ( CSteamID steamIDFriend, EFriendFlags iFriendFlags ) : bool
steamIDFriend CSteamID
iFriendFlags EFriendFlags
return bool

InviteUserToGame() public static method

rich invite support

if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game

if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string

invites can only be sent to friends

public static InviteUserToGame ( CSteamID steamIDFriend, string pchConnectString ) : bool
steamIDFriend CSteamID
pchConnectString string
return bool

IsClanChatAdmin() public static method

public static IsClanChatAdmin ( CSteamID steamIDClanChat, CSteamID steamIDUser ) : bool
steamIDClanChat CSteamID
steamIDUser CSteamID
return bool

IsClanChatWindowOpenInSteam() public static method

interact with the Steam (game overlay / desktop)

public static IsClanChatWindowOpenInSteam ( CSteamID steamIDClanChat ) : bool
steamIDClanChat CSteamID
return bool

IsFollowing() public static method

public static IsFollowing ( CSteamID steamID ) : SteamAPICall_t
steamID CSteamID
return SteamAPICall_t

IsUserInSource() public static method

returns true if the local user can see that steamIDUser is a member or in steamIDSource

public static IsUserInSource ( CSteamID steamIDUser, CSteamID steamIDSource ) : bool
steamIDUser CSteamID
steamIDSource CSteamID
return bool

JoinClanChatRoom() public static method

chat interface for games

this allows in-game access to group (clan) chats from in the game

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

use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat

public static JoinClanChatRoom ( CSteamID steamIDClan ) : SteamAPICall_t
steamIDClan CSteamID
return SteamAPICall_t

LeaveClanChatRoom() public static method

public static LeaveClanChatRoom ( CSteamID steamIDClan ) : bool
steamIDClan CSteamID
return bool

OpenClanChatWindowInSteam() public static method

public static OpenClanChatWindowInSteam ( CSteamID steamIDClanChat ) : bool
steamIDClanChat CSteamID
return bool

ReplyToFriendMessage() public static method

public static ReplyToFriendMessage ( CSteamID steamIDFriend, string pchMsgToSend ) : bool
steamIDFriend CSteamID
pchMsgToSend string
return bool

RequestClanOfficerList() public static method

requests information about a clan officer list

when complete, data is returned in ClanOfficerListResponse_t call result

this makes available the calls below

you can only ask about clans that a user is a member of

note that this won't download avatars automatically; if you get an officer,

and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar

public static RequestClanOfficerList ( CSteamID steamIDClan ) : SteamAPICall_t
steamIDClan CSteamID
return SteamAPICall_t

RequestFriendRichPresence() public static method

Requests rich presence for a specific user.

public static RequestFriendRichPresence ( CSteamID steamIDFriend ) : void
steamIDFriend CSteamID
return void

RequestUserInformation() public static method

requests information about a user - persona name & avatar

if bRequireNameOnly is set, then the avatar of a user isn't downloaded

- it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them

if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved

if returns false, it means that we already have all the details about that user, and functions can be called immediately

public static RequestUserInformation ( CSteamID steamIDUser, bool bRequireNameOnly ) : bool
steamIDUser CSteamID
bRequireNameOnly bool
return bool

SendClanChatMessage() public static method

public static SendClanChatMessage ( CSteamID steamIDClanChat, string pchText ) : bool
steamIDClanChat CSteamID
pchText string
return bool

SetInGameVoiceSpeaking() public static method

User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)

public static SetInGameVoiceSpeaking ( CSteamID steamIDUser, bool bSpeaking ) : void
steamIDUser CSteamID
bSpeaking bool
return void

SetListenForFriendsMessages() public static method

peer-to-peer chat interception

this is so you can show P2P chats inline in the game

public static SetListenForFriendsMessages ( bool bInterceptEnabled ) : bool
bInterceptEnabled bool
return bool

SetPersonaName() public static method

Sets the player 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 is posted, presuming success.

The final results are available through the return value SteamAPICall_t, using SetPersonaNameResponse_t.

If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted

to change the name back, in addition to the SetPersonaNameResponse_t callback.

public static SetPersonaName ( string pchPersonaName ) : SteamAPICall_t
pchPersonaName string
return SteamAPICall_t

SetPlayedWith() public static method

Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is

in game

public static SetPlayedWith ( CSteamID steamIDUserPlayedWith ) : void
steamIDUserPlayedWith CSteamID
return void

SetRichPresence() public static method

Rich Presence data is automatically shared between friends who are in the same game

Each user has a set of Key/Value pairs

Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength

There are two magic keys:

"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

GetFriendRichPresence() returns an empty string "" if no value is set

SetRichPresence() to a NULL or an empty string deletes the key

You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()

and GetFriendRichPresenceKeyByIndex() (typically only used for debugging)

public static SetRichPresence ( string pchKey, string pchValue ) : bool
pchKey string
pchValue string
return bool