Main Page | Class List | Directories | File List | Class Members

CXPSession.h

00001 /* START_LICENSE_HEADER
00002 
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005 
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009 
00010 END_LICENSE_HEADER */
00011 #ifndef __CXPSESSION_H__
00012 #define __CXPSESSION_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 
00015 #ifdef __cplusplus
00016 extern "C"
00017 {
00018 #endif
00019 
00020 #ifndef __XPSESSION_H__
00021 
00022 /* Declare some defines for types used internal to XPSession */
00023 #define kXPSessionUnknownID  (-1)
00024 #define kXPSessionBroadcastID (-2)
00025 
00026 /* These are the internal message types for session messages */
00027 #define kXPSessionPacketType_Unreliable     (0)
00028 #define kXPSessionPacketType_Reliable       (1<<0)
00029 #define kXPSessionPacketType_Certain        (1<<1)
00030 
00031 /* Error values */
00032 #define kXPSession_EOK (0)
00033 #define kXPSession_EERROR (-1)
00034 #define kXPSession_ETRANSPORT_CLOSED (-2)
00035 #define kXPSession_ETRANSPORT_ERROR (-3)
00036 
00037 #define kTransportAnyGameChannel (0)
00038 
00039 #endif
00040 
00041 /* The type define for the handle that has to be passed in to each function so that the API knows what session you are trying to access */
00042 typedef struct sCXPSession *hCXPSession;
00043 
00044 /* What follows are 'C' style function wrappers for the C++ class */
00045 
00050 XPSESSIONDLL_API hCXPSession CXPSession_Allocate(void);
00051 
00056 XPSESSIONDLL_API void CXPSession_Free(const hCXPSession handle);
00057 
00063 XPSESSIONDLL_API void CXPSession_Create(const hCXPSession handle,const char *name);
00064 
00071 XPSESSIONDLL_API void CXPSession_CreateWithProtocol(const hCXPSession handle,const char *name,const char *protocols);
00072 
00079 XPSESSIONDLL_API void CXPSession_ExportURL(const hCXPSession handle,char *nameBuffer,const int length);
00080 
00086 XPSESSIONDLL_API void CXPSession_Join(const hCXPSession handle,const char *url);
00087 
00092 XPSESSIONDLL_API void CXPSession_Find(const hCXPSession handle);
00093 
00099 XPSESSIONDLL_API void CXPSession_FindWithProtocols(const hCXPSession handle,const char *protocols);
00100 
00108 XPSESSIONDLL_API int CXPSession_EnumerateFound(const hCXPSession handle,char *nameBuffer,const int length);
00109 
00115 XPSESSIONDLL_API int CXPSession_GetGameChannel(const hCXPSession handle);
00116 
00122 XPSESSIONDLL_API void CXPSession_SetGameChannel(const hCXPSession handle,const int channel);
00123 
00129 XPSESSIONDLL_API int CXPSession_GetSessionID(const hCXPSession handle);
00130 
00136 XPSESSIONDLL_API int CXPSession_IsStable(const hCXPSession handle);
00137 
00144 XPSESSIONDLL_API int CXPSession_GetStatus(const hCXPSession handle);
00145 
00153 XPSESSIONDLL_API void CXPSession_DataSendToSessionUnreliable(const hCXPSession handle,const int sessionid,const char *data,const int length);
00154 
00162 XPSESSIONDLL_API void CXPSession_DataSendToSessionReliable(const hCXPSession handle,const int sessionid,const char *data,const int length);
00163 
00171 XPSESSIONDLL_API void CXPSession_DataSendToSessionCertain(const hCXPSession handle,const int sessionid,const char *data,const int length);
00172 
00182 XPSESSIONDLL_API int CXPSession_DataReceive(const hCXPSession handle,int *const fromsessionid,char *const data,int *const length,unsigned char *const type);
00183 
00189 XPSESSIONDLL_API int CXPSession_IsMaster(const hCXPSession handle);
00190 
00196 XPSESSIONDLL_API int CXPSession_GetJoiner(const hCXPSession handle);
00197 
00203 XPSESSIONDLL_API int CXPSession_GetLeaver(const hCXPSession handle);
00204 
00210 XPSESSIONDLL_API float CXPSession_GetTime(const hCXPSession handle);
00211 
00217 XPSESSIONDLL_API float CXPSession_GetLocalTime(const hCXPSession handle);
00218 
00224 XPSESSIONDLL_API float CXPSession_GetNetworkSendRate(const hCXPSession handle);
00225 
00231 XPSESSIONDLL_API float CXPSession_GetNetworkReceiveRate(const hCXPSession handle);
00232 
00238 XPSESSIONDLL_API int CXPSession_GetNetworkPacketsLost(const hCXPSession handle);
00239 
00248 XPSESSIONDLL_API void CXPSession_Poll(const hCXPSession handle);
00249 
00257 XPSESSIONDLL_API void CXPSession_SetManualPoll(const hCXPSession handle);
00258 
00267 XPSESSIONDLL_API void CXPSession_SetAutomaticPoll(const hCXPSession handle);
00268 
00273 XPSESSIONDLL_API void CXPSession_SetManualPollXPURL(const hCXPSession handle);
00274 
00279 XPSESSIONDLL_API void CXPSession_SetAutomaticPollXPURL(const hCXPSession handle);
00280 
00281 
00288 XPSESSIONDLL_API void CXPSession_SetCanSpider(const hCXPSession handle,const int canSpider);
00289 
00295 XPSESSIONDLL_API int CXPSession_GetCanSpider(const hCXPSession handle);
00296 
00303 XPSESSIONDLL_API void CXPSession_SetCanBecomeMaster(const hCXPSession handle,const int canBeMaster);
00304 
00310 XPSESSIONDLL_API int CXPSession_GetCanBecomeMaster(const hCXPSession handle);
00311 
00317 XPSESSIONDLL_API float CXPSession_GetLatencyToMasterSession(const hCXPSession handle);
00318 
00324 XPSESSIONDLL_API void CXPSession_SetLatencyRecalculationDelay(const hCXPSession handle,const float seconds);
00325 
00331 XPSESSIONDLL_API void CXPSession_SetEncryption(const hCXPSession handle,const int enable);
00332 
00337 XPSESSIONDLL_API int CXPSession_GetEncryption(const hCXPSession handle);
00338 
00344 XPSESSIONDLL_API void CXPSession_Disconnect(const hCXPSession handle,const int sessionID);
00345 
00351 XPSESSIONDLL_API int CXPSession_GetPreConnectStatus(const hCXPSession handle);
00352 
00364 XPSESSIONDLL_API void CXPSession_SetPreConnect(const hCXPSession handle,const int enable);
00365 
00371 XPSESSIONDLL_API int CXPSession_GetPreConnect(const hCXPSession handle);
00372 
00377 XPSESSIONDLL_API void CXPSession_PreConnectHasFinished(const hCXPSession handle);
00378 
00384 XPSESSIONDLL_API void CXPSession_SetAutomaticPacketCompression(const hCXPSession handle,const int enable);
00385 
00391 XPSESSIONDLL_API int CXPSession_GetAutomaticPacketCompression(const hCXPSession handle);
00392 
00400 XPSESSIONDLL_API void CXPSession_GetCompressionStatistics(const hCXPSession handle,int *const before,int *const after,const int reset);
00401 
00409 XPSESSIONDLL_API void CXPSession_GetMergedStatistics(const hCXPSession handle,int *const sent,int *const received,const int reset);
00410 
00416 XPSESSIONDLL_API int CXPSession_GetMasterSessionID(const hCXPSession handle);
00417 
00428 XPSESSIONDLL_API int CXPSession_GetURLFromSessionID(const hCXPSession handle,const int sessionID,char *const url,const int urlLen);
00429 
00436 XPSESSIONDLL_API void CXPSession_SetClientOnly(const hCXPSession handle,const int isClient);
00437 
00443 XPSESSIONDLL_API int CXPSession_GetClientOnly(const hCXPSession handle);
00444 
00455 XPSESSIONDLL_API int CXPSession_GetBandwidthFromSessionID(const hCXPSession handle,const int sessionID,int *const bandwidth,int *const output,int *const input);
00456 
00457 #ifdef __cplusplus
00458 }
00459 #endif
00460 
00461 #endif

Generated on Sun Oct 30 01:12:10 2005 for XPSession by  doxygen 1.4.1