9#include "../common/gsCommon.h"
10#include "../common/gsRC4.h"
11#include "../common/gsAvailable.h"
12#include "../ghttp/ghttp.h"
13#include "../webservices/AuthService.h"
30#define SC_REPORT_BUFFER_BYTES 65536
33#define SC_SERVICE_MAX_URL_LEN 128
34extern char scServiceURL[SC_SERVICE_MAX_URL_LEN];
38#define SC_AUTHDATA_SIZE 16
39#define SC_SESSION_GUID_SIZE 40
40#define SC_CONNECTION_GUID_SIZE 40
42#define SC_GUID_BINARY_SIZE 16
45#define SC_MAX_NUM_TEAMS 64
48#define SC_OPTIONS_NONE 0
56 SCResult_NO_ERROR = 0,
57 SCResult_NO_AVAILABILITY_CHECK,
58 SCResult_INVALID_PARAMETERS,
59 SCResult_NOT_INITIALIZED,
60 SCResult_CORE_NOT_INITIALIZED,
61 SCResult_OUT_OF_MEMORY,
62 SCResult_CALLBACK_PENDING,
65 SCResult_UNKNOWN_RESPONSE,
66 SCResult_RESPONSE_INVALID,
68 SCResult_REPORT_INCOMPLETE,
69 SCResult_REPORT_INVALID,
70 SCResult_SUBMISSION_FAILED,
72 SCResult_UNKNOWN_ERROR,
84 SCGameResult_DISCONNECT,
95 SCGameStatus_COMPLETE,
106typedef void* SCInterfacePtr;
107typedef void* SCReportPtr;
118typedef char SCHiddenData[64];
131typedef void (*SCCreateSessionCallback)(
const SCInterfacePtr theInterface,
132 GHTTPResult theHttpResult,
135typedef void (*SCSetReportIntentionCallback)(
const SCInterfacePtr theInterface,
136 GHTTPResult theHttpResult,
139typedef void (*SCSubmitReportCallback)(
const SCInterfacePtr theInterface,
140 GHTTPResult theHttpResult,
154SCResult SC_CALL scInitialize(
int theGameId,
155 SCInterfacePtr * theInterfaceOut);
156SCResult SC_CALL scShutdown (SCInterfacePtr theInterface);
157SCResult SC_CALL scThink (SCInterfacePtr theInterface);
159SCResult SC_CALL scCreateSession(SCInterfacePtr theInterface,
161 const GSLoginPrivateData * thePrivateData,
162 SCCreateSessionCallback theCallback,
163 gsi_time theTimeoutMs,
168SCResult SC_CALL scCreateMatchlessSession(SCInterfacePtr theInterface,
170 const GSLoginPrivateData * thePrivateData,
171 SCCreateSessionCallback theCallback,
172 gsi_time theTimeoutMs,
175SCResult SC_CALL scSetReportIntention(
const SCInterfacePtr theInterface,
176 const gsi_u8 theConnectionId[SC_CONNECTION_GUID_SIZE],
177 gsi_bool isAuthoritative,
179 const GSLoginPrivateData * thePrivateData,
180 SCSetReportIntentionCallback theCallback,
181 gsi_time theTimeoutMs,
184SCResult SC_CALL scSubmitReport (
const SCInterfacePtr theInterface,
185 const SCReportPtr theReport,
186 gsi_bool isAuthoritative,
188 const GSLoginPrivateData * thePrivateData,
189 SCSubmitReportCallback theCallback,
190 gsi_time theTimeoutMs,
194SCResult SC_CALL scSetSessionId(
const SCInterfacePtr theInterface,
const gsi_u8 theSessionId[SC_SESSION_GUID_SIZE]);
196const char * scGetSessionId (
const SCInterfacePtr theInterface);
197const char * scGetConnectionId(
const SCInterfacePtr theInterface);
207SCResult SC_CALL scCreateReport(
const SCInterfacePtr theInterface,
208 gsi_u32 theHeaderVersion,
209 gsi_u32 thePlayerCount,
210 gsi_u32 theTeamCount,
211 SCReportPtr * theReportOut);
214SCResult SC_CALL scReportBeginGlobalData(SCReportPtr theReportData);
215SCResult SC_CALL scReportBeginPlayerData(SCReportPtr theReportData);
216SCResult SC_CALL scReportBeginTeamData (SCReportPtr theReportData);
220SCResult SC_CALL scReportBeginNewPlayer(SCReportPtr theReportData);
221SCResult SC_CALL scReportSetPlayerData (SCReportPtr theReport,
222 gsi_u32 thePlayerIndex,
223 const gsi_u8 thePlayerConnectionId[SC_CONNECTION_GUID_SIZE],
224 gsi_u32 thePlayerTeamId,
225 SCGameResult theResult,
226 gsi_u32 theProfileId,
228 const gsi_u8 theAuthData[16]);
231SCResult SC_CALL scReportBeginNewTeam(SCReportPtr theReportData);
232SCResult SC_CALL scReportSetTeamData (SCReportPtr theReport,
234 SCGameResult theResult);
237SCResult SC_CALL scReportEnd(SCReportPtr theReport,
239 SCGameStatus theStatus);
243SCResult SC_CALL scReportSetAsMatchless(SCReportPtr theReport);
247SCResult SC_CALL scReportAddIntValue(SCReportPtr theReportData,
250SCResult SC_CALL scReportAddInt64Value(SCReportPtr theReportData,
253SCResult SC_CALL scReportAddShortValue(SCReportPtr theReportData,
256SCResult SC_CALL scReportAddByteValue(SCReportPtr theReportData,
259SCResult SC_CALL scReportAddFloatValue(SCReportPtr theReportData,
262SCResult SC_CALL scReportAddStringValue(SCReportPtr theReportData,
264 const gsi_char * theValue);
265SCResult SC_CALL scDestroyReport(SCReportPtr theReport);
276 gsi_u8 mKey[GS_CRYPT_RSA_BYTE_SIZE];
278 gsi_bool mInitialized;
281typedef char SCPeerKeyExchangeMsg[GS_CRYPT_RSA_BYTE_SIZE];
285SCResult SC_CALL scPeerCipherCreateKeyExchangeMsg(
const GSLoginCertificate * theRemoteCert,
287 SCPeerKeyExchangeMsg theMsgOut);
289SCResult SC_CALL scPeerCipherParseKeyExchangeMsg (
const GSLoginCertificate * theLocalCert,
290 const GSLoginPrivateData * theCertPrivateData,
291 const SCPeerKeyExchangeMsg theMsg,
295SCResult SC_CALL scPeerCipherEncryptBuffer(
SCPeerCipher * theCipher, gsi_u8 * theData, gsi_u32 theLen);
296SCResult SC_CALL scPeerCipherDecryptBuffer(
SCPeerCipher * theCipher, gsi_u8 * theData, gsi_u32 theLen);
300SCResult SC_CALL scPeerCipherEncryptBufferIV(
SCPeerCipher * theCipher, gsi_u32 theMessageNum, gsi_u8 * theData, gsi_u32 theLen);
301SCResult SC_CALL scPeerCipherDecryptBufferIV(
SCPeerCipher * theCipher, gsi_u32 theMessageNum, gsi_u8 * theData, gsi_u32 theLen);
Definition AuthService.h:87