/inc/cryengine/CryCommon/ICryFriendsManagement.h

https://github.com/samneirinck/awesomium-ce3 · C Header · 203 lines · 52 code · 24 blank · 127 comment · 0 complexity · 83c91dabbb1eebf8c0e28e9bd249a45c MD5 · raw file

  1. #ifndef __ICRYFRIENDSMANAGEMENT_H__
  2. #define __ICRYFRIENDSMANAGEMENT_H__
  3. #pragma once
  4. #include "ICryFriends.h"
  5. // Used to return IsFriend/IsUserBlocked results
  6. struct SFriendManagementInfo
  7. {
  8. CryUserID userID;
  9. bool result;
  10. };
  11. // Used to pass in user to search for
  12. struct SFriendManagementSearchInfo
  13. {
  14. char name[CRYLOBBY_USER_NAME_LENGTH];
  15. };
  16. #define CRYLOBBY_FRIEND_STATUS_STRING_SIZE 256
  17. #define CRYLOBBY_FRIEND_LOCATION_STRING_SIZE 256
  18. enum EFriendManagementStatus
  19. {
  20. eFMS_Unknown,
  21. eFMS_Offline,
  22. eFMS_Online,
  23. eFMS_Playing,
  24. eFMS_Staging,
  25. eFMS_Chatting,
  26. eFMS_Away
  27. };
  28. struct SFriendStatusInfo
  29. {
  30. CryUserID userID;
  31. EFriendManagementStatus status;
  32. char statusString[ CRYLOBBY_FRIEND_STATUS_STRING_SIZE ];
  33. char locationString[ CRYLOBBY_FRIEND_LOCATION_STRING_SIZE ];
  34. };
  35. // CryFriendsManagementCallback
  36. // taskID - Task ID allocated when the function was executed.
  37. // error - Error code - eCLE_Success if the function succeeded or an error that occurred while processing the function.
  38. // pArg - Pointer to application-specified data.
  39. typedef void (*CryFriendsManagementCallback)(CryLobbyTaskID taskID, ECryLobbyError error, void* pCbArg);
  40. // CryFriendsManagementInfoCallback
  41. // taskID - Task ID allocated when the function was executed.
  42. // error - Error code - eCLE_Success if the function succeeded or an error that occurred while processing the function.
  43. // pArg - Pointer to application-specified data.
  44. typedef void (*CryFriendsManagementInfoCallback)(CryLobbyTaskID taskID, ECryLobbyError error, SFriendManagementInfo* pInfo, uint32 numUserIDs, void* pCbArg);
  45. // CryFriendsManagementSearchCallback
  46. // taskID - Task ID allocated when the function was executed.
  47. // error - Error code - eCLE_Success if the function succeeded or an error that occurred while processing the function.
  48. // pArg - Pointer to application-specified data.
  49. typedef void (*CryFriendsManagementSearchCallback)(CryLobbyTaskID taskID, ECryLobbyError error, SFriendInfo* pInfo, uint32 numUserIDs, void* pCbArg);
  50. // CryFriendsManagementStatusCallback
  51. // taskID - Task ID allocated when the function was executed.
  52. // error - Error code - eCLE_Success if the function succeeded or an error that occurred while processing the function.
  53. // pInfo - Array of returned friend status info
  54. // numUserIDs - Number of elements in array
  55. // pArg - Pointer to application-specified data.
  56. typedef void (*CryFriendsManagementStatusCallback)(CryLobbyTaskID taskID, ECryLobbyError error, SFriendStatusInfo* pInfo, uint32 numUserIDs, void* pCbArg);
  57. struct ICryFriendsManagement
  58. {
  59. // FriendsManagementAddFriend
  60. // Sends a friend request to the specified list of users
  61. // user - The pad number of the user sending the friend requests
  62. // pUserIDs - Pointer to an array of user ids to send friend requests to
  63. // numUserIDs - The number of users to send friend requests to
  64. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  65. // cb - Callback function that is called when function completes
  66. // pCbArg - Pointer to application-specified data that is passed to the callback
  67. // return - eCLE_Success if function successfully started or an error code if function failed to start
  68. virtual ECryLobbyError FriendsManagementSendFriendRequest(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  69. // FriendsManagementAcceptFriendRequest
  70. // Accepts friend requests from the specified list of users
  71. // user - The pad number of the user accepting the friend requests
  72. // pUserIDs - Pointer to an array of user ids to accept friend requests from
  73. // numUserIDs - The number of users to accept friend requests from
  74. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  75. // cb - Callback function that is called when function completes
  76. // pCbArg - Pointer to application-specified data that is passed to the callback
  77. // return - eCLE_Success if function successfully started or an error code if function failed to start
  78. virtual ECryLobbyError FriendsManagementAcceptFriendRequest(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  79. // FriendsManagementRejectFriendRequest
  80. // Rejects friend requests from the specified list of users
  81. // user - The pad number of the user rejecting the friend requests
  82. // pUserIDs - Pointer to an array of user ids to reject friend requests from
  83. // numUserIDs - The number of users to reject friend requests from
  84. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  85. // cb - Callback function that is called when function completes
  86. // pCbArg - Pointer to application-specified data that is passed to the callback
  87. // return - eCLE_Success if function successfully started or an error code if function failed to start
  88. virtual ECryLobbyError FriendsManagementRejectFriendRequest(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  89. // FriendsManagementRevokeFriendStatus
  90. // Revokes friendship status from the specified list of users
  91. // user - The pad number of the user revoking friend status
  92. // pUserIDs - Pointer to an array of user ids to revoke friend status from
  93. // numUserIDs - The number of users to revoke friend status from
  94. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  95. // cb - Callback function that is called when function completes
  96. // pCbArg - Pointer to application-specified data that is passed to the callback
  97. // return - eCLE_Success if function successfully started or an error code if function failed to start
  98. virtual ECryLobbyError FriendsManagementRevokeFriendStatus(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  99. // FriendsManagementIsUserFriend
  100. // Determines friendship status of the specified list of users
  101. // user - The pad number of the user determining friend status
  102. // pUserIDs - Pointer to an array of user ids to determine friend status for
  103. // numUserIDs - The number of users to determine friend status for
  104. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  105. // cb - Callback function that is called when function completes
  106. // pCbArg - Pointer to application-specified data that is passed to the callback
  107. // return - eCLE_Success if function successfully started or an error code if function failed to start
  108. virtual ECryLobbyError FriendsManagementIsUserFriend(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementInfoCallback pCb, void* pCbArg) = 0;
  109. // FriendsManagementFindUser
  110. // Attempt to find the users specified
  111. // user - The pad number of the user attempting to find other users
  112. // pUserIDs - Pointer to an array of user ids to attempt to find
  113. // numUserIDs - The number of users to attempt to find
  114. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  115. // cb - Callback function that is called when function completes
  116. // pCbArg - Pointer to application-specified data that is passed to the callback
  117. // return - eCLE_Success if function successfully started or an error code if function failed to start
  118. virtual ECryLobbyError FriendsManagementFindUser(uint32 user, SFriendManagementSearchInfo* pUserName, uint32 maxResults, CryLobbyTaskID* pTaskID, CryFriendsManagementSearchCallback pCb, void* pCbArg) = 0;
  119. // FriendsManagementBlockUser
  120. // Add the specified users to the blocked list
  121. // user - The pad number of the user adding users to their block list
  122. // pUserIDs - Pointer to an array of user ids to block
  123. // numUserIDs - The number of users to block
  124. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  125. // cb - Callback function that is called when function completes
  126. // pCbArg - Pointer to application-specified data that is passed to the callback
  127. // return - eCLE_Success if function successfully started or an error code if function failed to start
  128. virtual ECryLobbyError FriendsManagementBlockUser(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  129. // FriendsManagementUnblockUser
  130. // Remove the specified users from the blocked list
  131. // user - The pad number of the user removing users from their block list
  132. // pUserIDs - Pointer to an array of user ids to unblock
  133. // numUserIDs - The number of users to unblock
  134. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  135. // cb - Callback function that is called when function completes
  136. // pCbArg - Pointer to application-specified data that is passed to the callback
  137. // return - eCLE_Success if function successfully started or an error code if function failed to start
  138. virtual ECryLobbyError FriendsManagementUnblockUser(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  139. // FriendsManagementIsUserBlocked
  140. // Determines if the specified users are in the blocked list
  141. // user - The pad number of the user determining blocked status
  142. // pUserIDs - Pointer to an array of user ids to determine blocked status for
  143. // numUserIDs - The number of users to determine blocked status for
  144. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  145. // cb - Callback function that is called when function completes
  146. // pCbArg - Pointer to application-specified data that is passed to the callback
  147. // return - eCLE_Success if function successfully started or an error code if function failed to start
  148. virtual ECryLobbyError FriendsManagementIsUserBlocked(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementInfoCallback pCb, void* pCbArg) = 0;
  149. // FriendsManagementAcceptInvite
  150. // Accepts the invite from the specified user
  151. // user - The pad number of the user accepting the invite
  152. // pUserID - Pointer to the user id to accept the invite from
  153. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  154. // cb - Callback function that is called when function completes
  155. // pCbArg - Pointer to application-specified data that is passed to the callback
  156. // return - eCLE_Success if function successfully started or an error code if function failed to start
  157. virtual ECryLobbyError FriendsManagementAcceptInvite(uint32 user, CryUserID* pUserID, CryLobbyTaskID* pTaskID, CryFriendsManagementCallback pCb, void* pCbArg) = 0;
  158. // FriendsManagementGetName
  159. // Gets the names of the specified list of user IDs
  160. // user - The pad number of the user requesting names
  161. // pUserIDs - Pointer to an array of user ids to get names for
  162. // numUserIDs - The number of users to get names for
  163. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  164. // cb - Callback function that is called when function completes
  165. // pCbArg - Pointer to application-specified data that is passed to the callback
  166. // return - eCLE_Success if function successfully started or an error code if function failed to start
  167. virtual ECryLobbyError FriendsManagementGetName(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementSearchCallback pCb, void* pCbArg) = 0;
  168. // FriendsManagementGetStatus
  169. // Gets the status of the specified list of user IDs
  170. // user - The pad number of the user requesting names
  171. // pUserIDs - Pointer to an array of user ids to get names for
  172. // numUserIDs - The number of users to get names for
  173. // pTaskID - Pointer to buffer to store the task ID to identify this call in the callback
  174. // cb - Callback function that is called when function completes
  175. // pCbArg - Pointer to application-specified data that is passed to the callback
  176. // return - eCLE_Success if function successfully started or an error code if function failed to start
  177. virtual ECryLobbyError FriendsManagementGetStatus(uint32 user, CryUserID* pUserIDs, uint32 numUserIDs, CryLobbyTaskID* pTaskID, CryFriendsManagementStatusCallback pCb, void* pCbArg) = 0;
  178. };
  179. #endif //__ICRYFRIENDSMANAGEMENT_H__