/Core/Dependencies/GameSpy/sc/sciWebServices.h

https://bitbucket.org/barakianc/nvidia-physx-and-apex-in-gge · C Header · 242 lines · 173 code · 42 blank · 27 comment · 0 complexity · 5b31d0b85791ced69b8f0fdf415cd00a MD5 · raw file

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // File: sciWebServices.h
  3. // SDK: GameSpy ATLAS Competition SDK
  4. //
  5. // Copyright (c) IGN Entertainment, Inc. All rights reserved.
  6. // This software is made available only pursuant to certain license terms offered
  7. // by IGN or its subsidiary GameSpy Industries, Inc. Unlicensed use or use in a
  8. // manner not expressly authorized by IGN or GameSpy is prohibited.
  9. #ifndef __SCWEBSERVICES_H__
  10. #define __SCWEBSERVICES_H__
  11. ///////////////////////////////////////////////////////////////////////////////
  12. ///////////////////////////////////////////////////////////////////////////////
  13. #include "../common/gsSoap.h"
  14. #include "../common/gsXML.h"
  15. #include "../ghttp/ghttpPost.h"
  16. #include "sci.h"
  17. #include "sciReport.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif // __cplusplus
  21. ///////////////////////////////////////////////////////////////////////////////
  22. ///////////////////////////////////////////////////////////////////////////////
  23. // Web service result codes (must match definitions in CompetitionService)
  24. typedef enum
  25. {
  26. // Competition system errors:
  27. SCServiceResult_NO_ERROR = 0,
  28. SCServiceResult_COULD_NOT_START,
  29. SCServiceResult_COULD_NOT_JOIN,
  30. SCServiceResult_COULD_NOT_LEAVE,
  31. // Input validation errors:
  32. SCServiceResult_PROFILE_ID_INVALID,
  33. SCServiceResult_IP_INVALID,
  34. SCServiceResult_ID_INVALID,
  35. SCServiceResult_REPORT_INVALID,
  36. SCServiceResult_AUTH_INVALID,
  37. // System errors:
  38. SCServiceResult_SERVER_ERROR,
  39. SCServiceResult_DATABASE_ERROR,
  40. // More input validation errors:
  41. SCServiceResult_GAMEID_INVALID
  42. } SCServiceResult;
  43. ///////////////////////////////////////////////////////////////////////////////
  44. ///////////////////////////////////////////////////////////////////////////////
  45. typedef struct
  46. {
  47. SCInterfacePtr mInterface;
  48. SCCheckBanListCallback mCheckBanListCallback;
  49. SCCreateSessionCallback mCreateSessionCallback;
  50. SCSetReportIntentionCallback mSetReportIntentionCallback;
  51. SCSubmitReportCallback mSubmitReportDataCallback;
  52. SCGameStatsQueryCallback mGameStatsQueryCallback;
  53. SCPlayerStatsQueryCallback mPlayerStatsQueryCallback;
  54. SCTeamStatsQueryCallback mTeamStatsQueryCallback;
  55. gsi_bool mCheckBanListPending;
  56. gsi_bool mSetReportIntentionPending;
  57. gsi_bool mCreateSessionPending;
  58. gsi_bool mSubmitReportPending;
  59. gsi_bool mGameStatsQueryPending;
  60. gsi_bool mPlayerStatsQueryPending;
  61. gsi_bool mTeamStatsQueryPending;
  62. void * mCheckBanListUserData;
  63. void * mSetReportIntentionUserData;
  64. void * mCreateSessionUserData;
  65. void * mSubmitReportUserData;
  66. void * mGetStatsUserData;
  67. void * mGetLeaderboardUserData;
  68. void * mGetRanksUserData;
  69. void * mGameStatsQueryUserData;
  70. void * mPlayerStatsQueryUserData;
  71. void * mTeamStatsQueryUserData;
  72. gsi_u8* mSubmitReportData;
  73. gsi_u32 mSubmitReportLength;
  74. gsi_bool mInit;
  75. } SCWebServices;
  76. ///////////////////////////////////////////////////////////////////////////////
  77. ///////////////////////////////////////////////////////////////////////////////
  78. SCResult sciWsInit (SCWebServices* webServices,
  79. SCInterfacePtr theInterface);
  80. void sciWsDestroy(SCWebServices* webServices);
  81. void sciWsThink (SCWebServices* webServices);
  82. ///////////////////////////////////////////////////////////////////////////////
  83. ///////////////////////////////////////////////////////////////////////////////
  84. SCResult sciWsCheckBanList (gsi_u32 hostProfileId,
  85. SCPlatform hostPlatform,
  86. SCWebServices * webServices,
  87. gsi_u32 gameId,
  88. const GSLoginCertificate * certificate,
  89. const GSLoginPrivateData * privateData,
  90. SCCheckBanListCallback callback,
  91. gsi_time timeoutMs,
  92. void * userData);
  93. void sciWsCheckBanListCallback(GHTTPResult httpResult,
  94. GSXmlStreamWriter requestData,
  95. GSXmlStreamReader responseData,
  96. void* userData);
  97. SCResult sciWsCreateSession (SCWebServices * webServices,
  98. gsi_u32 gameId,
  99. gsi_u16 platformId,
  100. const GSLoginCertificate * certificate,
  101. const GSLoginPrivateData * privateData,
  102. SCCreateSessionCallback callback,
  103. gsi_time timeoutMs,
  104. void * userData);
  105. SCResult sciWsCreateMatchlessSession(SCWebServices * webServices,
  106. gsi_u32 gameId,
  107. gsi_u16 platformId,
  108. const GSLoginCertificate * certificate,
  109. const GSLoginPrivateData * privateData,
  110. SCCreateSessionCallback callback,
  111. gsi_time timeoutMs,
  112. void * userData);
  113. void sciWsCreateSessionCallback(GHTTPResult httpResult,
  114. GSXmlStreamWriter requestData,
  115. GSXmlStreamReader responseData,
  116. void* userData);
  117. SCResult sciWsSetReportIntention (SCWebServices* webServices,
  118. gsi_u32 gameId,
  119. const char * theSessionId,
  120. const char * theConnectionId,
  121. gsi_bool isAuthoritative,
  122. const GSLoginCertificate * certificate,
  123. const GSLoginPrivateData * privateData,
  124. SCSetReportIntentionCallback callback,
  125. gsi_time timeoutMs,
  126. void * userData);
  127. void sciWsSetReportIntentionCallback(GHTTPResult httpResult,
  128. GSXmlStreamWriter requestData,
  129. GSXmlStreamReader responseData,
  130. void* userData);
  131. SCResult sciWsSubmitReport (SCWebServices* webServices,
  132. gsi_u32 gameId,
  133. const char * theSessionId,
  134. const char * theConnectionId,
  135. const SCIReport* theReport,
  136. gsi_bool isAuthoritative,
  137. const GSLoginCertificate * certificate,
  138. const GSLoginPrivateData * privateData,
  139. SCSubmitReportCallback callback,
  140. gsi_time timeoutMs,
  141. void * userData);
  142. void sciWsSubmitReportCallback(GHTTPResult httpResult,
  143. GSXmlStreamWriter requestData,
  144. GSXmlStreamReader responseData,
  145. void* userData);
  146. SCResult sciWsSerializeStatsQuery(GSXmlStreamWriter writer,
  147. char *queryType,
  148. gsi_u32 gameId,
  149. const GSLoginCertificate * certificate,
  150. const GSLoginPrivateData * privateData,
  151. int ruleSetVersion,
  152. const char *queryId,
  153. const SCQueryParameterListPtr queryParameters);
  154. void sciWsGameStatsQueryCallback(GHTTPResult httpResult,
  155. GSXmlStreamWriter requestData,
  156. GSXmlStreamReader responseData,
  157. void* userData);
  158. void sciWsPlayerStatsQueryCallback(GHTTPResult httpResult,
  159. GSXmlStreamWriter requestData,
  160. GSXmlStreamReader responseData,
  161. void* userData);
  162. void sciWsTeamStatsQueryCallback(GHTTPResult httpResult,
  163. GSXmlStreamWriter requestData,
  164. GSXmlStreamReader responseData,
  165. void* userData);
  166. SCResult sciWsRunGameStatsQuery(SCWebServices* webServices,
  167. gsi_u32 gameId,
  168. const GSLoginCertificate * certificate,
  169. const GSLoginPrivateData * privateData,
  170. int ruleSetVersion,
  171. const char *queryId,
  172. const SCQueryParameterListPtr queryParameters,
  173. SCGameStatsQueryCallback callback,
  174. void *userData);
  175. SCResult sciWsRunPlayerStatsQuery(SCWebServices* webServices,
  176. gsi_u32 gameId,
  177. const GSLoginCertificate * certificate,
  178. const GSLoginPrivateData * privateData,
  179. int ruleSetVersion,
  180. const char *queryId,
  181. const SCQueryParameterListPtr queryParameters,
  182. SCPlayerStatsQueryCallback callback,
  183. void *userData);
  184. SCResult sciWsRunTeamStatsQuery(SCWebServices* webServices,
  185. gsi_u32 gameId,
  186. const GSLoginCertificate * certificate,
  187. const GSLoginPrivateData * privateData,
  188. int ruleSetVersion,
  189. const char *queryId,
  190. const SCQueryParameterListPtr queryParameters,
  191. SCTeamStatsQueryCallback callback,
  192. void *userData);
  193. ///////////////////////////////////////////////////////////////////////////////
  194. ///////////////////////////////////////////////////////////////////////////////
  195. #ifdef __cplusplus
  196. } // extern "C"
  197. #endif // __cplusplus
  198. ///////////////////////////////////////////////////////////////////////////////
  199. ///////////////////////////////////////////////////////////////////////////////
  200. #endif // __SCWEBSERVICES_H__