11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef __CXPSESSION_H__
13 #define __CXPSESSION_H__
20 #ifndef __XPSESSION_H__
23 #define kXPSessionUnknownID (-1)
24 #define kXPSessionBroadcastID (-2)
27 #define kXPSessionPacketType_Unreliable (0)
28 #define kXPSessionPacketType_Reliable (1<<0)
29 #define kXPSessionPacketType_Certain (1<<1)
32 #define kXPSession_EOK (0)
33 #define kXPSession_EERROR (-1)
34 #define kXPSession_ETRANSPORT_CLOSED (-2)
35 #define kXPSession_ETRANSPORT_ERROR (-3)
37 #define kTransportAnyGameChannel (0)
42 typedef struct sCXPSession *hCXPSession;
50 hCXPSession CXPSession_Allocate(
void);
56 void CXPSession_Free(
const hCXPSession handle);
63 void CXPSession_Create(
const hCXPSession handle,
const char *name);
71 void CXPSession_CreateWithProtocol(
const hCXPSession handle,
const char *name,
const char *protocols);
79 void CXPSession_ExportURL(
const hCXPSession handle,
char *nameBuffer,
const int length);
86 void CXPSession_Join(
const hCXPSession handle,
const char *url);
92 void CXPSession_Find(
const hCXPSession handle);
99 void CXPSession_FindWithProtocols(
const hCXPSession handle,
const char *protocols);
108 int CXPSession_EnumerateFound(
const hCXPSession handle,
char *nameBuffer,
const int length);
115 int CXPSession_GetGameChannel(
const hCXPSession handle);
122 void CXPSession_SetGameChannel(
const hCXPSession handle,
const int channel);
129 int CXPSession_GetSessionID(
const hCXPSession handle);
136 int CXPSession_IsStable(
const hCXPSession handle);
144 int CXPSession_GetStatus(
const hCXPSession handle);
153 void CXPSession_DataSendToSessionUnreliable(
const hCXPSession handle,
const int sessionid,
const char *data,
const int length);
162 void CXPSession_DataSendToSessionReliable(
const hCXPSession handle,
const int sessionid,
const char *data,
const int length);
171 void CXPSession_DataSendToSessionCertain(
const hCXPSession handle,
const int sessionid,
const char *data,
const int length);
182 int CXPSession_DataReceive(
const hCXPSession handle,
int *
const fromsessionid,
char *
const data,
int *
const length,
unsigned char *
const type);
189 int CXPSession_IsMaster(
const hCXPSession handle);
196 int CXPSession_GetJoiner(
const hCXPSession handle);
203 int CXPSession_GetLeaver(
const hCXPSession handle);
210 double CXPSession_GetTime(
const hCXPSession handle);
217 double CXPSession_GetLocalTime(
const hCXPSession handle);
224 float CXPSession_GetNetworkSendRate(
const hCXPSession handle);
231 float CXPSession_GetNetworkReceiveRate(
const hCXPSession handle);
238 int CXPSession_GetNetworkPacketsLost(
const hCXPSession handle);
248 void CXPSession_Poll(
const hCXPSession handle);
257 void CXPSession_SetManualPoll(
const hCXPSession handle);
267 void CXPSession_SetAutomaticPoll(
const hCXPSession handle);
273 void CXPSession_SetManualPollXPURL(
const hCXPSession handle);
279 void CXPSession_SetAutomaticPollXPURL(
const hCXPSession handle);
288 void CXPSession_SetCanSpider(
const hCXPSession handle,
const int canSpider);
295 int CXPSession_GetCanSpider(
const hCXPSession handle);
303 void CXPSession_SetCanBecomeMaster(
const hCXPSession handle,
const int canBeMaster);
310 int CXPSession_GetCanBecomeMaster(
const hCXPSession handle);
317 float CXPSession_GetLatencyToMasterSession(
const hCXPSession handle);
324 void CXPSession_SetLatencyRecalculationDelay(
const hCXPSession handle,
const float seconds);
331 void CXPSession_SetEncryption(
const hCXPSession handle,
const int enable);
337 int CXPSession_GetEncryption(
const hCXPSession handle);
344 void CXPSession_Disconnect(
const hCXPSession handle,
const int sessionID);
351 int CXPSession_GetPreConnectStatus(
const hCXPSession handle);
364 void CXPSession_SetPreConnect(
const hCXPSession handle,
const int enable);
371 int CXPSession_GetPreConnect(
const hCXPSession handle);
377 void CXPSession_PreConnectHasFinished(
const hCXPSession handle);
384 void CXPSession_SetAutomaticPacketCompression(
const hCXPSession handle,
const int enable);
391 int CXPSession_GetAutomaticPacketCompression(
const hCXPSession handle);
400 void CXPSession_GetCompressionStatistics(
const hCXPSession handle,
int *
const before,
int *
const after,
const int reset);
409 void CXPSession_GetMergedStatistics(
const hCXPSession handle,
int *
const sent,
int *
const received,
const int reset);
416 int CXPSession_GetMasterSessionID(
const hCXPSession handle);
428 int CXPSession_GetURLFromSessionID(
const hCXPSession handle,
const int sessionID,
char *
const url,
const int urlLen);
436 void CXPSession_SetClientOnly(
const hCXPSession handle,
const int isClient);
443 int CXPSession_GetClientOnly(
const hCXPSession handle);
455 int CXPSession_GetBandwidthFromSessionID(
const hCXPSession handle,
const int sessionID,
int *
const bandwidth,
int *
const output,
int *
const input);