Team Fortress 2 Source Code as on 22/4/2020
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.

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