Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

636 lines
29 KiB

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