1 //====== Copyright (C) 1996-2008, Valve Corporation, All rights reserved. =====
2 //
3 // Purpose: interface to both friends list data and general information about users
4 //
5 //=============================================================================
6 
7 #ifndef ISTEAMFRIENDS_H
8 #define ISTEAMFRIENDS_H
9 #ifdef _WIN32
10 #pragma once
11 #endif
12 
13 #include "isteamclient.h"
14 #include "steamclientpublic.h"
15 
16 
17 //-----------------------------------------------------------------------------
18 // Purpose: set of relationships to other users
19 //-----------------------------------------------------------------------------
20 enum EFriendRelationship
21 {
22 	k_EFriendRelationshipNone = 0,
23 	k_EFriendRelationshipBlocked = 1,			// this doesn't get stored; the user has just done an Ignore on an friendship invite
24 	k_EFriendRelationshipRequestRecipient = 2,
25 	k_EFriendRelationshipFriend = 3,
26 	k_EFriendRelationshipRequestInitiator = 4,
27 	k_EFriendRelationshipIgnored = 5,			// this is stored; the user has explicit blocked this other user from comments/chat/etc
28 	k_EFriendRelationshipIgnoredFriend = 6,
29 	k_EFriendRelationshipSuggested_DEPRECATED = 7,		// was used by the original implementation of the facebook linking feature, but now unused.
30 
31 	// keep this updated
32 	k_EFriendRelationshipMax = 8,
33 };
34 
35 // maximum length of friend group name (not including terminating nul!)
36 const int k_cchMaxFriendsGroupName = 64;
37 
38 // maximum number of groups a single user is allowed
39 const int k_cFriendsGroupLimit = 100;
40 
41 // friends group identifier type
42 typedef int16 FriendsGroupID_t;
43 
44 // invalid friends group identifier constant
45 const FriendsGroupID_t k_FriendsGroupID_Invalid = -1;
46 
47 const int k_cEnumerateFollowersMax = 50;
48 
49 
50 //-----------------------------------------------------------------------------
51 // Purpose: list of states a friend can be in
52 //-----------------------------------------------------------------------------
53 enum EPersonaState
54 {
55 	k_EPersonaStateOffline = 0,			// friend is not currently logged on
56 	k_EPersonaStateOnline = 1,			// friend is logged on
57 	k_EPersonaStateBusy = 2,			// user is on, but busy
58 	k_EPersonaStateAway = 3,			// auto-away feature
59 	k_EPersonaStateSnooze = 4,			// auto-away for a long time
60 	k_EPersonaStateLookingToTrade = 5,	// Online, trading
61 	k_EPersonaStateLookingToPlay = 6,	// Online, wanting to play
62 	k_EPersonaStateMax,
63 };
64 
65 
66 //-----------------------------------------------------------------------------
67 // Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
68 //-----------------------------------------------------------------------------
69 enum EFriendFlags
70 {
71 	k_EFriendFlagNone			= 0x00,
72 	k_EFriendFlagBlocked		= 0x01,
73 	k_EFriendFlagFriendshipRequested	= 0x02,
74 	k_EFriendFlagImmediate		= 0x04,			// "regular" friend
75 	k_EFriendFlagClanMember		= 0x08,
76 	k_EFriendFlagOnGameServer	= 0x10,
77 	// k_EFriendFlagHasPlayedWith	= 0x20,	// not currently used
78 	// k_EFriendFlagFriendOfFriend	= 0x40, // not currently used
79 	k_EFriendFlagRequestingFriendship = 0x80,
80 	k_EFriendFlagRequestingInfo = 0x100,
81 	k_EFriendFlagIgnored		= 0x200,
82 	k_EFriendFlagIgnoredFriend	= 0x400,
83 	// k_EFriendFlagSuggested		= 0x800,	// not used
84 	k_EFriendFlagChatMember		= 0x1000,
85 	k_EFriendFlagAll			= 0xFFFF,
86 };
87 
88 
89 // friend game played information
90 #if defined( VALVE_CALLBACK_PACK_SMALL )
91 #pragma pack( push, 4 )
92 #elif defined( VALVE_CALLBACK_PACK_LARGE )
93 #pragma pack( push, 8 )
94 #else
95 #error isteamclient.h must be included
96 #endif
97 struct FriendGameInfo_t
98 {
99 	CGameID m_gameID;
100 	uint32 m_unGameIP;
101 	uint16 m_usGamePort;
102 	uint16 m_usQueryPort;
103 	CSteamID m_steamIDLobby;
104 };
105 #pragma pack( pop )
106 
107 // maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
108 // The UTF-8 version has to be very generous to accomodate characters that get large when encoded
109 // in UTF-8.
110 enum
111 {
112 	k_cchPersonaNameMax = 128,
113 	k_cwchPersonaNameMax = 32,
114 };
115 
116 //-----------------------------------------------------------------------------
117 // Purpose: user restriction flags
118 //-----------------------------------------------------------------------------
119 enum EUserRestriction
120 {
121 	k_nUserRestrictionNone		= 0,	// no known chat/content restriction
122 	k_nUserRestrictionUnknown	= 1,	// we don't know yet (user offline)
123 	k_nUserRestrictionAnyChat	= 2,	// user is not allowed to (or can't) send/recv any chat
124 	k_nUserRestrictionVoiceChat	= 4,	// user is not allowed to (or can't) send/recv voice chat
125 	k_nUserRestrictionGroupChat	= 8,	// user is not allowed to (or can't) send/recv group chat
126 	k_nUserRestrictionRating	= 16,	// user is too young according to rating in current region
127 	k_nUserRestrictionGameInvites	= 32,	// user cannot send or recv game invites (e.g. mobile)
128 	k_nUserRestrictionTrading	= 64,	// user cannot participate in trading (console, mobile)
129 };
130 
131 //-----------------------------------------------------------------------------
132 // Purpose: information about user sessions
133 //-----------------------------------------------------------------------------
134 struct FriendSessionStateInfo_t
135 {
136 	uint32 m_uiOnlineSessionInstances;
137 	uint8 m_uiPublishedToFriendsSessionInstance;
138 };
139 
140 
141 
142 // size limit on chat room or member metadata
143 const uint32 k_cubChatMetadataMax = 8192;
144 
145 // size limits on Rich Presence data
146 enum { k_cchMaxRichPresenceKeys = 20 };
147 enum { k_cchMaxRichPresenceKeyLength = 64 };
148 enum { k_cchMaxRichPresenceValueLength = 256 };
149 
150 // These values are passed as parameters to the store
151 enum EOverlayToStoreFlag
152 {
153 	k_EOverlayToStoreFlag_None = 0,
154 	k_EOverlayToStoreFlag_AddToCart = 1,
155 	k_EOverlayToStoreFlag_AddToCartAndShow = 2,
156 };
157 
158 //-----------------------------------------------------------------------------
159 // Purpose: interface to accessing information about individual users,
160 //			that can be a friend, in a group, on a game server or in a lobby with the local user
161 //-----------------------------------------------------------------------------
162 class ISteamFriends
163 {
164 public:
165 	// returns the local players name - guaranteed to not be NULL.
166 	// this is the same name as on the users community profile page
167 	// this is stored in UTF-8 format
168 	// like all the other interface functions that return a char *, it's important that this pointer is not saved
169 	// off; it will eventually be free'd or re-allocated
170 	virtual const char *GetPersonaName() = 0;
171 
172 	// Sets the player name, stores it on the server and publishes the changes to all friends who are online.
173 	// Changes take place locally immediately, and a PersonaStateChange_t is posted, presuming success.
174 	//
175 	// The final results are available through the return value SteamAPICall_t, using SetPersonaNameResponse_t.
176 	//
177 	// If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted
178 	// to change the name back, in addition to the SetPersonaNameResponse_t callback.
179 	CALL_RESULT( SetPersonaNameResponse_t )
180 	virtual SteamAPICall_t SetPersonaName( const char *pchPersonaName ) = 0;
181 
182 	// gets the status of the current user
183 	virtual EPersonaState GetPersonaState() = 0;
184 
185 	// friend iteration
186 	// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
187 	// then GetFriendByIndex() can then be used to return the id's of each of those users
188 	virtual int GetFriendCount( int iFriendFlags ) = 0;
189 
190 	// returns the steamID of a user
191 	// iFriend is a index of range [0, GetFriendCount())
192 	// iFriendsFlags must be the same value as used in GetFriendCount()
193 	// the returned CSteamID can then be used by all the functions below to access details about the user
194 	virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
195 
196 	// returns a relationship to a user
197 	virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
198 
199 	// returns the current status of the specified user
200 	// 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
201 	virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
202 
203 	// returns the name another user - guaranteed to not be NULL.
204 	// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
205 	// 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
206 	//
207 	virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
208 
209 	// returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details
210 	virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0;
211 	// accesses old friends names - returns an empty string when their are no more items in the history
212 	virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
213 	// friends steam level
214 	virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0;
215 
216 	// Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player.
217 	virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0;
218 
219 	// friend grouping (tag) apis
220 	// returns the number of friends groups
221 	virtual int GetFriendsGroupCount() = 0;
222 	// returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid)
223 	virtual FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) = 0;
224 	// returns the name for the given friends group (NULL in the case of invalid friends group IDs)
225 	virtual const char *GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) = 0;
226 	// returns the number of members in a given friends group
227 	virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0;
228 	// gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid
229 	virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0;
230 
231 	// returns true if the specified user meets any of the criteria specified in iFriendFlags
232 	// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
233 	virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
234 
235 	// clan (group) iteration and access functions
236 	virtual int GetClanCount() = 0;
237 	virtual CSteamID GetClanByIndex( int iClan ) = 0;
238 	virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
239 	virtual const char *GetClanTag( CSteamID steamIDClan ) = 0;
240 	// returns the most recent information we have about what's happening in a clan
241 	virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0;
242 	// 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
243 	virtual SteamAPICall_t DownloadClanActivityCounts( ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0;
244 
245 	// iterators for getting users in a chat room, lobby, game server or clan
246 	// note that large clans that cannot be iterated by the local user
247 	// note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby
248 	// steamIDSource can be the steamID of a group, game server, lobby or chat room
249 	virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
250 	virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
251 
252 	// returns true if the local user can see that steamIDUser is a member or in steamIDSource
253 	virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
254 
255 	// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
256 	virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
257 
258 	// activates the game overlay, with an optional dialog to open
259 	// valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements"
260 	virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
261 
262 	// activates game overlay to a specific place
263 	// valid options are
264 	//		"steamid" - opens the overlay web browser to the specified user or groups profile
265 	//		"chat" - opens a chat window to the specified user, or joins the group chat
266 	//		"jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API
267 	//		"stats" - opens the overlay web browser to the specified user's stats
268 	//		"achievements" - opens the overlay web browser to the specified user's achievements
269 	//		"friendadd" - opens the overlay in minimal mode prompting the user to add the target user as a friend
270 	//		"friendremove" - opens the overlay in minimal mode prompting the user to remove the target friend
271 	//		"friendrequestaccept" - opens the overlay in minimal mode prompting the user to accept an incoming friend invite
272 	//		"friendrequestignore" - opens the overlay in minimal mode prompting the user to ignore an incoming friend invite
273 	virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
274 
275 	// activates game overlay web browser directly to the specified URL
276 	// full address with protocol type is required, e.g. http://www.steamgames.com/
277 	virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0;
278 
279 	// activates game overlay to store page for app
280 	virtual void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag ) = 0;
281 
282 	// Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is
283 	// in game
284 	virtual void SetPlayedWith( CSteamID steamIDUserPlayedWith ) = 0;
285 
286 	// activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby.
287 	virtual void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby ) = 0;
288 
289 	// gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
290 	virtual int GetSmallFriendAvatar( CSteamID steamIDFriend ) = 0;
291 
292 	// gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
293 	virtual int GetMediumFriendAvatar( CSteamID steamIDFriend ) = 0;
294 
295 	// gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
296 	// returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again
297 	virtual int GetLargeFriendAvatar( CSteamID steamIDFriend ) = 0;
298 
299 	// requests information about a user - persona name & avatar
300 	// if bRequireNameOnly is set, then the avatar of a user isn't downloaded
301 	// - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them
302 	// if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved
303 	// if returns false, it means that we already have all the details about that user, and functions can be called immediately
304 	virtual bool RequestUserInformation( CSteamID steamIDUser, bool bRequireNameOnly ) = 0;
305 
306 	// requests information about a clan officer list
307 	// when complete, data is returned in ClanOfficerListResponse_t call result
308 	// this makes available the calls below
309 	// you can only ask about clans that a user is a member of
310 	// note that this won't download avatars automatically; if you get an officer,
311 	// and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar
312 	CALL_RESULT( ClanOfficerListResponse_t )
313 	virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0;
314 
315 	// iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed
316 
317 	// returns the steamID of the clan owner
318 	virtual CSteamID GetClanOwner( CSteamID steamIDClan ) = 0;
319 	// returns the number of officers in a clan (including the owner)
320 	virtual int GetClanOfficerCount( CSteamID steamIDClan ) = 0;
321 	// returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount)
322 	virtual CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer ) = 0;
323 	// if current user is chat restricted, he can't send or receive any text/voice chat messages.
324 	// the user can't see custom avatars. But the user can be online and send/recv game invites.
325 	// a chat restricted user can't add friends or join any groups.
326 	virtual uint32 GetUserRestrictions() = 0;
327 
328 	// Rich Presence data is automatically shared between friends who are in the same game
329 	// Each user has a set of Key/Value pairs
330 	// Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength
331 	// There are two magic keys:
332 	//		"status"  - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list
333 	//		"connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game
334 	// GetFriendRichPresence() returns an empty string "" if no value is set
335 	// SetRichPresence() to a NULL or an empty string deletes the key
336 	// You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()
337 	// and GetFriendRichPresenceKeyByIndex() (typically only used for debugging)
338 	virtual bool SetRichPresence( const char *pchKey, const char *pchValue ) = 0;
339 	virtual void ClearRichPresence() = 0;
340 	virtual const char *GetFriendRichPresence( CSteamID steamIDFriend, const char *pchKey ) = 0;
341 	virtual int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend ) = 0;
342 	virtual const char *GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int iKey ) = 0;
343 	// Requests rich presence for a specific user.
344 	virtual void RequestFriendRichPresence( CSteamID steamIDFriend ) = 0;
345 
346 	// rich invite support
347 	// if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game
348 	// if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string
349 	// invites can only be sent to friends
350 	virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0;
351 
352 	// recently-played-with friends iteration
353 	// this iterates the entire list of users recently played with, across games
354 	// GetFriendCoplayTime() returns as a unix time
355 	virtual int GetCoplayFriendCount() = 0;
356 	virtual CSteamID GetCoplayFriend( int iCoplayFriend ) = 0;
357 	virtual int GetFriendCoplayTime( CSteamID steamIDFriend ) = 0;
358 	virtual AppId_t GetFriendCoplayGame( CSteamID steamIDFriend ) = 0;
359 
360 	// chat interface for games
361 	// this allows in-game access to group (clan) chats from in the game
362 	// 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
363 	// use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat
364 	CALL_RESULT( JoinClanChatRoomCompletionResult_t )
365 	virtual SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan ) = 0;
366 	virtual bool LeaveClanChatRoom( CSteamID steamIDClan ) = 0;
367 	virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0;
368 	virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0;
369 	virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0;
370 	virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, OUT_STRUCT() CSteamID *psteamidChatter ) = 0;
371 	virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0;
372 
373 	// interact with the Steam (game overlay / desktop)
374 	virtual bool IsClanChatWindowOpenInSteam( CSteamID steamIDClanChat ) = 0;
375 	virtual bool OpenClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0;
376 	virtual bool CloseClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0;
377 
378 	// peer-to-peer chat interception
379 	// this is so you can show P2P chats inline in the game
380 	virtual bool SetListenForFriendsMessages( bool bInterceptEnabled ) = 0;
381 	virtual bool ReplyToFriendMessage( CSteamID steamIDFriend, const char *pchMsgToSend ) = 0;
382 	virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
383 
384 	// following apis
385 	CALL_RESULT( FriendsGetFollowerCount_t )
386 	virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0;
387 	CALL_RESULT( FriendsIsFollowing_t )
388 	virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0;
389 	CALL_RESULT( FriendsEnumerateFollowingList_t )
390 	virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0;
391 
392 	virtual bool IsClanPublic( CSteamID steamIDClan ) = 0;
393 	virtual bool IsClanOfficialGameGroup( CSteamID steamIDClan ) = 0;
394 };
395 
396 #define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends015"
397 
398 // callbacks
399 #if defined( VALVE_CALLBACK_PACK_SMALL )
400 #pragma pack( push, 4 )
401 #elif defined( VALVE_CALLBACK_PACK_LARGE )
402 #pragma pack( push, 8 )
403 #else
404 #error isteamclient.h must be included
405 #endif
406 
407 //-----------------------------------------------------------------------------
408 // Purpose: called when a friends' status changes
409 //-----------------------------------------------------------------------------
410 struct PersonaStateChange_t
411 {
412 	enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
413 
414 	uint64 m_ulSteamID;		// steamID of the friend who changed
415 	int m_nChangeFlags;		// what's changed
416 };
417 
418 
419 // used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
420 // 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
421 enum EPersonaChange
422 {
423 	k_EPersonaChangeName		= 0x0001,
424 	k_EPersonaChangeStatus		= 0x0002,
425 	k_EPersonaChangeComeOnline	= 0x0004,
426 	k_EPersonaChangeGoneOffline	= 0x0008,
427 	k_EPersonaChangeGamePlayed	= 0x0010,
428 	k_EPersonaChangeGameServer	= 0x0020,
429 	k_EPersonaChangeAvatar		= 0x0040,
430 	k_EPersonaChangeJoinedSource= 0x0080,
431 	k_EPersonaChangeLeftSource	= 0x0100,
432 	k_EPersonaChangeRelationshipChanged = 0x0200,
433 	k_EPersonaChangeNameFirstSet = 0x0400,
434 	k_EPersonaChangeFacebookInfo = 0x0800,
435 	k_EPersonaChangeNickname =	0x1000,
436 	k_EPersonaChangeSteamLevel = 0x2000,
437 };
438 
439 
440 //-----------------------------------------------------------------------------
441 // Purpose: posted when game overlay activates or deactivates
442 //			the game can use this to be pause or resume single player games
443 //-----------------------------------------------------------------------------
444 struct GameOverlayActivated_t
445 {
446 	enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
447 	uint8 m_bActive;	// true if it's just been activated, false otherwise
448 };
449 
450 
451 //-----------------------------------------------------------------------------
452 // Purpose: called when the user tries to join a different game server from their friends list
453 //			game client should attempt to connect to specified server when this is received
454 //-----------------------------------------------------------------------------
455 struct GameServerChangeRequested_t
456 {
457 	enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
458 	char m_rgchServer[64];		// server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
459 	char m_rgchPassword[64];	// server password, if any
460 };
461 
462 
463 //-----------------------------------------------------------------------------
464 // Purpose: called when the user tries to join a lobby from their friends list
465 //			game client should attempt to connect to specified lobby when this is received
466 //-----------------------------------------------------------------------------
467 struct GameLobbyJoinRequested_t
468 {
469 	enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
470 	CSteamID m_steamIDLobby;
471 
472 	// The friend they did the join via (will be invalid if not directly via a friend)
473 	//
474 	// On PS3, the friend will be invalid if this was triggered by a PSN invite via the XMB, but
475 	// the account type will be console user so you can tell at least that this was from a PSN friend
476 	// rather than a Steam friend.
477 	CSteamID m_steamIDFriend;
478 };
479 
480 
481 //-----------------------------------------------------------------------------
482 // Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call
483 //			if the image wasn't already available
484 //-----------------------------------------------------------------------------
485 struct AvatarImageLoaded_t
486 {
487 	enum { k_iCallback = k_iSteamFriendsCallbacks + 34 };
488 	CSteamID m_steamID; // steamid the avatar has been loaded for
489 	int m_iImage; // the image index of the now loaded image
490 	int m_iWide; // width of the loaded image
491 	int m_iTall; // height of the loaded image
492 };
493 
494 
495 //-----------------------------------------------------------------------------
496 // Purpose: marks the return of a request officer list call
497 //-----------------------------------------------------------------------------
498 struct ClanOfficerListResponse_t
499 {
500 	enum { k_iCallback = k_iSteamFriendsCallbacks + 35 };
501 	CSteamID m_steamIDClan;
502 	int m_cOfficers;
503 	uint8 m_bSuccess;
504 };
505 
506 
507 //-----------------------------------------------------------------------------
508 // Purpose: callback indicating updated data about friends rich presence information
509 //-----------------------------------------------------------------------------
510 struct FriendRichPresenceUpdate_t
511 {
512 	enum { k_iCallback = k_iSteamFriendsCallbacks + 36 };
513 	CSteamID m_steamIDFriend;	// friend who's rich presence has changed
514 	AppId_t m_nAppID;			// the appID of the game (should always be the current game)
515 };
516 
517 
518 //-----------------------------------------------------------------------------
519 // Purpose: called when the user tries to join a game from their friends list
520 //			rich presence will have been set with the "connect" key which is set here
521 //-----------------------------------------------------------------------------
522 struct GameRichPresenceJoinRequested_t
523 {
524 	enum { k_iCallback = k_iSteamFriendsCallbacks + 37 };
525 	CSteamID m_steamIDFriend;		// the friend they did the join via (will be invalid if not directly via a friend)
526 	char m_rgchConnect[k_cchMaxRichPresenceValueLength];
527 };
528 
529 
530 //-----------------------------------------------------------------------------
531 // Purpose: a chat message has been received for a clan chat the game has joined
532 //-----------------------------------------------------------------------------
533 struct GameConnectedClanChatMsg_t
534 {
535 	enum { k_iCallback = k_iSteamFriendsCallbacks + 38 };
536 	CSteamID m_steamIDClanChat;
537 	CSteamID m_steamIDUser;
538 	int m_iMessageID;
539 };
540 
541 
542 //-----------------------------------------------------------------------------
543 // Purpose: a user has joined a clan chat
544 //-----------------------------------------------------------------------------
545 struct GameConnectedChatJoin_t
546 {
547 	enum { k_iCallback = k_iSteamFriendsCallbacks + 39 };
548 	CSteamID m_steamIDClanChat;
549 	CSteamID m_steamIDUser;
550 };
551 
552 
553 //-----------------------------------------------------------------------------
554 // Purpose: a user has left the chat we're in
555 //-----------------------------------------------------------------------------
556 struct GameConnectedChatLeave_t
557 {
558 	enum { k_iCallback = k_iSteamFriendsCallbacks + 40 };
559 	CSteamID m_steamIDClanChat;
560 	CSteamID m_steamIDUser;
561 	bool m_bKicked;		// true if admin kicked
562 	bool m_bDropped;	// true if Steam connection dropped
563 };
564 
565 
566 //-----------------------------------------------------------------------------
567 // Purpose: a DownloadClanActivityCounts() call has finished
568 //-----------------------------------------------------------------------------
569 struct DownloadClanActivityCountsResult_t
570 {
571 	enum { k_iCallback = k_iSteamFriendsCallbacks + 41 };
572 	bool m_bSuccess;
573 };
574 
575 
576 //-----------------------------------------------------------------------------
577 // Purpose: a JoinClanChatRoom() call has finished
578 //-----------------------------------------------------------------------------
579 struct JoinClanChatRoomCompletionResult_t
580 {
581 	enum { k_iCallback = k_iSteamFriendsCallbacks + 42 };
582 	CSteamID m_steamIDClanChat;
583 	EChatRoomEnterResponse m_eChatRoomEnterResponse;
584 };
585 
586 //-----------------------------------------------------------------------------
587 // Purpose: a chat message has been received from a user
588 //-----------------------------------------------------------------------------
589 struct GameConnectedFriendChatMsg_t
590 {
591 	enum { k_iCallback = k_iSteamFriendsCallbacks + 43 };
592 	CSteamID m_steamIDUser;
593 	int m_iMessageID;
594 };
595 
596 
597 struct FriendsGetFollowerCount_t
598 {
599 	enum { k_iCallback = k_iSteamFriendsCallbacks + 44 };
600 	EResult m_eResult;
601 	CSteamID m_steamID;
602 	int m_nCount;
603 };
604 
605 
606 struct FriendsIsFollowing_t
607 {
608 	enum { k_iCallback = k_iSteamFriendsCallbacks + 45 };
609 	EResult m_eResult;
610 	CSteamID m_steamID;
611 	bool m_bIsFollowing;
612 };
613 
614 
615 struct FriendsEnumerateFollowingList_t
616 {
617 	enum { k_iCallback = k_iSteamFriendsCallbacks + 46 };
618 	EResult m_eResult;
619 	CSteamID m_rgSteamID[ k_cEnumerateFollowersMax ];
620 	int32 m_nResultsReturned;
621 	int32 m_nTotalResultCount;
622 };
623 
624 //-----------------------------------------------------------------------------
625 // Purpose: reports the result of an attempt to change the user's persona name
626 //-----------------------------------------------------------------------------
627 struct SetPersonaNameResponse_t
628 {
629 	enum { k_iCallback = k_iSteamFriendsCallbacks + 47 };
630 
631 	bool m_bSuccess; // true if name change succeeded completely.
632 	bool m_bLocalSuccess; // true if name change was retained locally.  (We might not have been able to communicate with Steam)
633 	EResult m_result; // detailed result code
634 };
635 
636 
637 #pragma pack( pop )
638 
639 #endif // ISTEAMFRIENDS_H
640