Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
Steamworks.SteamFriends Class Reference

Static Public Member Functions

static void ActivateGameOverlay (string pchDialog)
 
static void ActivateGameOverlayInviteDialog (CSteamID steamIDLobby)
 
static void ActivateGameOverlayToStore (AppId_t nAppID, EOverlayToStoreFlag eFlag)
 
static void ActivateGameOverlayToUser (string pchDialog, CSteamID steamID)
 
static void ActivateGameOverlayToWebPage (string pchURL)
 
static void ClearRichPresence ()
 
static bool CloseClanChatWindowInSteam (CSteamID steamIDClanChat)
 
static SteamAPICall_t DownloadClanActivityCounts (CSteamID[] psteamIDClans, int cClansToRequest)
 
static SteamAPICall_t EnumerateFollowingList (uint unStartIndex)
 
static CSteamID GetChatMemberByIndex (CSteamID steamIDClan, int iUser)
 
static bool GetClanActivityCounts (CSteamID steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting)
 
static CSteamID GetClanByIndex (int iClan)
 
static int GetClanChatMemberCount (CSteamID steamIDClan)
 
static int GetClanChatMessage (CSteamID steamIDClanChat, int iMessage, out string prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter)
 
static int GetClanCount ()
 
static string GetClanName (CSteamID steamIDClan)
 
static CSteamID GetClanOfficerByIndex (CSteamID steamIDClan, int iOfficer)
 
static int GetClanOfficerCount (CSteamID steamIDClan)
 
static CSteamID GetClanOwner (CSteamID steamIDClan)
 
static string GetClanTag (CSteamID steamIDClan)
 
static CSteamID GetCoplayFriend (int iCoplayFriend)
 
static int GetCoplayFriendCount ()
 
static SteamAPICall_t GetFollowerCount (CSteamID steamID)
 
static CSteamID GetFriendByIndex (int iFriend, EFriendFlags iFriendFlags)
 
static AppId_t GetFriendCoplayGame (CSteamID steamIDFriend)
 
static int GetFriendCoplayTime (CSteamID steamIDFriend)
 
static int GetFriendCount (EFriendFlags iFriendFlags)
 
static int GetFriendCountFromSource (CSteamID steamIDSource)
 
static CSteamID GetFriendFromSourceByIndex (CSteamID steamIDSource, int iFriend)
 
static bool GetFriendGamePlayed (CSteamID steamIDFriend, out FriendGameInfo_t pFriendGameInfo)
 
static int GetFriendMessage (CSteamID steamIDFriend, int iMessageID, out string pvData, int cubData, out EChatEntryType peChatEntryType)
 
static string GetFriendPersonaName (CSteamID steamIDFriend)
 
static string GetFriendPersonaNameHistory (CSteamID steamIDFriend, int iPersonaName)
 
static EPersonaState GetFriendPersonaState (CSteamID steamIDFriend)
 
static EFriendRelationship GetFriendRelationship (CSteamID steamIDFriend)
 
static string GetFriendRichPresence (CSteamID steamIDFriend, string pchKey)
 
static string GetFriendRichPresenceKeyByIndex (CSteamID steamIDFriend, int iKey)
 
static int GetFriendRichPresenceKeyCount (CSteamID steamIDFriend)
 
static int GetFriendsGroupCount ()
 
static FriendsGroupID_t GetFriendsGroupIDByIndex (int iFG)
 
static int GetFriendsGroupMembersCount (FriendsGroupID_t friendsGroupID)
 
static void GetFriendsGroupMembersList (FriendsGroupID_t friendsGroupID, CSteamID[] pOutSteamIDMembers, int nMembersCount)
 
static string GetFriendsGroupName (FriendsGroupID_t friendsGroupID)
 
static int GetFriendSteamLevel (CSteamID steamIDFriend)
 
static int GetLargeFriendAvatar (CSteamID steamIDFriend)
 
static int GetMediumFriendAvatar (CSteamID steamIDFriend)
 
static string GetPersonaName ()
 
static EPersonaState GetPersonaState ()
 
static string GetPlayerNickname (CSteamID steamIDPlayer)
 
static int GetSmallFriendAvatar (CSteamID steamIDFriend)
 
static uint GetUserRestrictions ()
 
static bool HasFriend (CSteamID steamIDFriend, EFriendFlags iFriendFlags)
 
static bool InviteUserToGame (CSteamID steamIDFriend, string pchConnectString)
 
static bool IsClanChatAdmin (CSteamID steamIDClanChat, CSteamID steamIDUser)
 
static bool IsClanChatWindowOpenInSteam (CSteamID steamIDClanChat)
 
static SteamAPICall_t IsFollowing (CSteamID steamID)
 
static bool IsUserInSource (CSteamID steamIDUser, CSteamID steamIDSource)
 
static SteamAPICall_t JoinClanChatRoom (CSteamID steamIDClan)
 
static bool LeaveClanChatRoom (CSteamID steamIDClan)
 
static bool OpenClanChatWindowInSteam (CSteamID steamIDClanChat)
 
static bool ReplyToFriendMessage (CSteamID steamIDFriend, string pchMsgToSend)
 
static SteamAPICall_t RequestClanOfficerList (CSteamID steamIDClan)
 
static void RequestFriendRichPresence (CSteamID steamIDFriend)
 
static bool RequestUserInformation (CSteamID steamIDUser, bool bRequireNameOnly)
 
static bool SendClanChatMessage (CSteamID steamIDClanChat, string pchText)
 
static void SetInGameVoiceSpeaking (CSteamID steamIDUser, bool bSpeaking)
 
static bool SetListenForFriendsMessages (bool bInterceptEnabled)
 
static SteamAPICall_t SetPersonaName (string pchPersonaName)
 
static void SetPlayedWith (CSteamID steamIDUserPlayedWith)
 
static bool SetRichPresence (string pchKey, string pchValue)
 

Member Function Documentation

static void Steamworks.SteamFriends.ActivateGameOverlay ( string  pchDialog)
inlinestatic

activates the game overlay, with an optional dialog to open

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

static void Steamworks.SteamFriends.ActivateGameOverlayInviteDialog ( CSteamID  steamIDLobby)
inlinestatic

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

static void Steamworks.SteamFriends.ActivateGameOverlayToStore ( AppId_t  nAppID,
EOverlayToStoreFlag  eFlag 
)
inlinestatic

activates game overlay to store page for app

static void Steamworks.SteamFriends.ActivateGameOverlayToUser ( string  pchDialog,
CSteamID  steamID 
)
inlinestatic

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

static void Steamworks.SteamFriends.ActivateGameOverlayToWebPage ( string  pchURL)
inlinestatic

activates game overlay web browser directly to the specified URL

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

static void Steamworks.SteamFriends.ClearRichPresence ( )
inlinestatic
static bool Steamworks.SteamFriends.CloseClanChatWindowInSteam ( CSteamID  steamIDClanChat)
inlinestatic
static SteamAPICall_t Steamworks.SteamFriends.DownloadClanActivityCounts ( CSteamID[]  psteamIDClans,
int  cClansToRequest 
)
inlinestatic

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

static SteamAPICall_t Steamworks.SteamFriends.EnumerateFollowingList ( uint  unStartIndex)
inlinestatic
static CSteamID Steamworks.SteamFriends.GetChatMemberByIndex ( CSteamID  steamIDClan,
int  iUser 
)
inlinestatic
static bool Steamworks.SteamFriends.GetClanActivityCounts ( CSteamID  steamIDClan,
out int  pnOnline,
out int  pnInGame,
out int  pnChatting 
)
inlinestatic

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

static CSteamID Steamworks.SteamFriends.GetClanByIndex ( int  iClan)
inlinestatic
static int Steamworks.SteamFriends.GetClanChatMemberCount ( CSteamID  steamIDClan)
inlinestatic
static int Steamworks.SteamFriends.GetClanChatMessage ( CSteamID  steamIDClanChat,
int  iMessage,
out string  prgchText,
int  cchTextMax,
out EChatEntryType  peChatEntryType,
out CSteamID  psteamidChatter 
)
inlinestatic
static int Steamworks.SteamFriends.GetClanCount ( )
inlinestatic

clan (group) iteration and access functions

static string Steamworks.SteamFriends.GetClanName ( CSteamID  steamIDClan)
inlinestatic
static CSteamID Steamworks.SteamFriends.GetClanOfficerByIndex ( CSteamID  steamIDClan,
int  iOfficer 
)
inlinestatic

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

static int Steamworks.SteamFriends.GetClanOfficerCount ( CSteamID  steamIDClan)
inlinestatic

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

static CSteamID Steamworks.SteamFriends.GetClanOwner ( CSteamID  steamIDClan)
inlinestatic

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

returns the steamID of the clan owner

static string Steamworks.SteamFriends.GetClanTag ( CSteamID  steamIDClan)
inlinestatic
static CSteamID Steamworks.SteamFriends.GetCoplayFriend ( int  iCoplayFriend)
inlinestatic
static int Steamworks.SteamFriends.GetCoplayFriendCount ( )
inlinestatic

recently-played-with friends iteration

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

GetFriendCoplayTime() returns as a unix time

static SteamAPICall_t Steamworks.SteamFriends.GetFollowerCount ( CSteamID  steamID)
inlinestatic

following apis

static CSteamID Steamworks.SteamFriends.GetFriendByIndex ( int  iFriend,
EFriendFlags  iFriendFlags 
)
inlinestatic

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

static AppId_t Steamworks.SteamFriends.GetFriendCoplayGame ( CSteamID  steamIDFriend)
inlinestatic
static int Steamworks.SteamFriends.GetFriendCoplayTime ( CSteamID  steamIDFriend)
inlinestatic
static int Steamworks.SteamFriends.GetFriendCount ( EFriendFlags  iFriendFlags)
inlinestatic

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

static int Steamworks.SteamFriends.GetFriendCountFromSource ( CSteamID  steamIDSource)
inlinestatic

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

static CSteamID Steamworks.SteamFriends.GetFriendFromSourceByIndex ( CSteamID  steamIDSource,
int  iFriend 
)
inlinestatic
static bool Steamworks.SteamFriends.GetFriendGamePlayed ( CSteamID  steamIDFriend,
out FriendGameInfo_t  pFriendGameInfo 
)
inlinestatic

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

static int Steamworks.SteamFriends.GetFriendMessage ( CSteamID  steamIDFriend,
int  iMessageID,
out string  pvData,
int  cubData,
out EChatEntryType  peChatEntryType 
)
inlinestatic
static string Steamworks.SteamFriends.GetFriendPersonaName ( CSteamID  steamIDFriend)
inlinestatic

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

static string Steamworks.SteamFriends.GetFriendPersonaNameHistory ( CSteamID  steamIDFriend,
int  iPersonaName 
)
inlinestatic

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

static EPersonaState Steamworks.SteamFriends.GetFriendPersonaState ( CSteamID  steamIDFriend)
inlinestatic

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

static EFriendRelationship Steamworks.SteamFriends.GetFriendRelationship ( CSteamID  steamIDFriend)
inlinestatic

returns a relationship to a user

static string Steamworks.SteamFriends.GetFriendRichPresence ( CSteamID  steamIDFriend,
string  pchKey 
)
inlinestatic
static string Steamworks.SteamFriends.GetFriendRichPresenceKeyByIndex ( CSteamID  steamIDFriend,
int  iKey 
)
inlinestatic
static int Steamworks.SteamFriends.GetFriendRichPresenceKeyCount ( CSteamID  steamIDFriend)
inlinestatic
static int Steamworks.SteamFriends.GetFriendsGroupCount ( )
inlinestatic

friend grouping (tag) apis

returns the number of friends groups

static FriendsGroupID_t Steamworks.SteamFriends.GetFriendsGroupIDByIndex ( int  iFG)
inlinestatic

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

static int Steamworks.SteamFriends.GetFriendsGroupMembersCount ( FriendsGroupID_t  friendsGroupID)
inlinestatic

returns the number of members in a given friends group

static void Steamworks.SteamFriends.GetFriendsGroupMembersList ( FriendsGroupID_t  friendsGroupID,
CSteamID[]  pOutSteamIDMembers,
int  nMembersCount 
)
inlinestatic

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

static string Steamworks.SteamFriends.GetFriendsGroupName ( FriendsGroupID_t  friendsGroupID)
inlinestatic

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

static int Steamworks.SteamFriends.GetFriendSteamLevel ( CSteamID  steamIDFriend)
inlinestatic

friends steam level

static int Steamworks.SteamFriends.GetLargeFriendAvatar ( CSteamID  steamIDFriend)
inlinestatic

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

static int Steamworks.SteamFriends.GetMediumFriendAvatar ( CSteamID  steamIDFriend)
inlinestatic

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

static string Steamworks.SteamFriends.GetPersonaName ( )
inlinestatic

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

static EPersonaState Steamworks.SteamFriends.GetPersonaState ( )
inlinestatic

gets the status of the current user

static string Steamworks.SteamFriends.GetPlayerNickname ( CSteamID  steamIDPlayer)
inlinestatic

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

static int Steamworks.SteamFriends.GetSmallFriendAvatar ( CSteamID  steamIDFriend)
inlinestatic

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

static uint Steamworks.SteamFriends.GetUserRestrictions ( )
inlinestatic

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.

static bool Steamworks.SteamFriends.HasFriend ( CSteamID  steamIDFriend,
EFriendFlags  iFriendFlags 
)
inlinestatic

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

static bool Steamworks.SteamFriends.InviteUserToGame ( CSteamID  steamIDFriend,
string  pchConnectString 
)
inlinestatic

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

static bool Steamworks.SteamFriends.IsClanChatAdmin ( CSteamID  steamIDClanChat,
CSteamID  steamIDUser 
)
inlinestatic
static bool Steamworks.SteamFriends.IsClanChatWindowOpenInSteam ( CSteamID  steamIDClanChat)
inlinestatic

interact with the Steam (game overlay / desktop)

static SteamAPICall_t Steamworks.SteamFriends.IsFollowing ( CSteamID  steamID)
inlinestatic
static bool Steamworks.SteamFriends.IsUserInSource ( CSteamID  steamIDUser,
CSteamID  steamIDSource 
)
inlinestatic

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

static SteamAPICall_t Steamworks.SteamFriends.JoinClanChatRoom ( CSteamID  steamIDClan)
inlinestatic

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

static bool Steamworks.SteamFriends.LeaveClanChatRoom ( CSteamID  steamIDClan)
inlinestatic
static bool Steamworks.SteamFriends.OpenClanChatWindowInSteam ( CSteamID  steamIDClanChat)
inlinestatic
static bool Steamworks.SteamFriends.ReplyToFriendMessage ( CSteamID  steamIDFriend,
string  pchMsgToSend 
)
inlinestatic
static SteamAPICall_t Steamworks.SteamFriends.RequestClanOfficerList ( CSteamID  steamIDClan)
inlinestatic

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

static void Steamworks.SteamFriends.RequestFriendRichPresence ( CSteamID  steamIDFriend)
inlinestatic

Requests rich presence for a specific user.

static bool Steamworks.SteamFriends.RequestUserInformation ( CSteamID  steamIDUser,
bool  bRequireNameOnly 
)
inlinestatic

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

static bool Steamworks.SteamFriends.SendClanChatMessage ( CSteamID  steamIDClanChat,
string  pchText 
)
inlinestatic
static void Steamworks.SteamFriends.SetInGameVoiceSpeaking ( CSteamID  steamIDUser,
bool  bSpeaking 
)
inlinestatic

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

static bool Steamworks.SteamFriends.SetListenForFriendsMessages ( bool  bInterceptEnabled)
inlinestatic

peer-to-peer chat interception

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

static SteamAPICall_t Steamworks.SteamFriends.SetPersonaName ( string  pchPersonaName)
inlinestatic

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.

static void Steamworks.SteamFriends.SetPlayedWith ( CSteamID  steamIDUserPlayedWith)
inlinestatic

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

in game

static bool Steamworks.SteamFriends.SetRichPresence ( string  pchKey,
string  pchValue 
)
inlinestatic

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)


The documentation for this class was generated from the following file: