1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifndef __SCWEBSERVICES_H__
#define __SCWEBSERVICES_H__
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#include "../common/gsSoap.h"
#include "../common/gsXML.h"
#include "../ghttp/ghttpPost.h"
#include "sci.h"
#include "sciReport.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Web service result codes (must match definitions in StatsReceiver)
typedef enum
{
SCWsResult_NO_ERROR = 0,
SCWsResult_REPORT_INVALID,
SCWsResult_SINGLE_ATTACHMENT_EXPECTED
} SCWsResult;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
typedef struct
{
SCInterfacePtr mInterface;
SCCreateSessionCallback mCreateSessionCallback;
SCSetReportIntentionCallback mSetReportIntentionCallback;
SCSubmitReportCallback mSubmitReportDataCallback;
gsi_bool mSetReportIntentionPending;
gsi_bool mCreateSessionPending;
gsi_bool mSubmitReportPending;
void * mSetReportIntentionUserData;
void * mCreateSessionUserData;
void * mSubmitReportUserData;
gsi_u8* mSubmitReportData;
gsi_u32 mSubmitReportLength;
gsi_bool mInit;
} SCWebServices;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SCResult sciWsInit (SCWebServices* theWebServices,
SCInterfacePtr theInterface);
void sciWsDestroy(SCWebServices* theWebServices);
void sciWsThink (SCWebServices* theWebServices);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SCResult sciWsCreateSession (SCWebServices * theWebServices,
gsi_u32 theGameId,
const GSLoginCertificate * theCertificate,
const GSLoginPrivateData * thePrivateData,
SCCreateSessionCallback theCallback,
gsi_time theTimeoutMs,
void * theUserData);
SCResult sciWsCreateMatchlessSession(SCWebServices * theWebServices,
gsi_u32 theGameId,
const GSLoginCertificate * theCertificate,
const GSLoginPrivateData * thePrivateData,
SCCreateSessionCallback theCallback,
gsi_time theTimeoutMs,
void * theUserData);
void sciWsCreateSessionCallback(GHTTPResult theHttpResult,
GSXmlStreamWriter theRequestData,
GSXmlStreamReader theResponseData,
void* theUserData);
SCResult sciWsSetReportIntention (SCWebServices* theWebServices,
gsi_u32 theGameId,
const char * theSessionId,
const char * theConnectionId,
gsi_bool isAuthoritative,
const GSLoginCertificate * theCertificate,
const GSLoginPrivateData * thePrivateData,
SCSetReportIntentionCallback theCallback,
gsi_time theTimeoutMs,
void * theUserData);
void sciWsSetReportIntentionCallback(GHTTPResult theHttpResult,
GSXmlStreamWriter theRequestData,
GSXmlStreamReader theResponseData,
void* theUserData);
SCResult sciWsSubmitReport (SCWebServices* theWebServices,
gsi_u32 theGameId,
const char * theSessionId,
const char * theConnectionId,
const SCIReport* theReport,
gsi_bool isAuthoritative,
const GSLoginCertificate * theCertificate,
const GSLoginPrivateData * thePrivateData,
SCSubmitReportCallback theCallback,
gsi_time theTimeoutMs,
void * theUserData);
void sciWsSubmitReportCallback(GHTTPResult theHttpResult,
GSXmlStreamWriter theRequestData,
GSXmlStreamReader theResponseData,
void* theUserData);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#endif // __SCWEBSERVICES_H__
|