00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GE_CSNETMGR_H
00023 #define GE_CSNETMGR_H
00024
00025 #include "BaseType.h"
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00031
00032
00033
00034
00035
00036
00037
00038 typedef struct geCSNetMgr geCSNetMgr;
00039
00040 typedef uint32 geCSNetMgr_NetID;
00041 #define MAX_CLIENT_NAME 256
00042
00043
00044 typedef enum
00045 {
00046 NET_MSG_NONE,
00047 NET_MSG_USER,
00048 NET_MSG_CREATE_CLIENT,
00049 NET_MSG_DESTROY_CLIENT,
00050 NET_MSG_HOST,
00051 NET_MSG_SESSIONLOST,
00052 NET_MSG_SERVER_ID,
00053 } geCSNetMgr_NetMsgType;
00054
00055 typedef struct
00056 {
00057 char Name[MAX_CLIENT_NAME];
00058 geCSNetMgr_NetID Id;
00059 } geCSNetMgr_NetClient;
00060
00061
00062 #ifdef _INC_WINDOWS
00063
00064
00065 typedef struct geCSNetMgr_NetSession
00066 {
00067 char SessionName[200];
00068 GUID Guid;
00069 #pragma message("define a geGUID?.. wouldn't need a windows dependency here...")
00070 } geCSNetMgr_NetSession;
00071
00072 GENESISAPI geBoolean GENESISCC geCSNetMgr_FindSession(geCSNetMgr *M, const char *IPAdress, geCSNetMgr_NetSession **SessionList, int32 *SessionNum );
00073 GENESISAPI geBoolean GENESISCC geCSNetMgr_JoinSession(geCSNetMgr *M, const char *Name, const geCSNetMgr_NetSession* Session);
00074 #endif
00075
00076 GENESISAPI geCSNetMgr * GENESISCC geCSNetMgr_Create(void);
00077 GENESISAPI void GENESISCC geCSNetMgr_Destroy(geCSNetMgr **ppM);
00078 GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetServerID(geCSNetMgr *M);
00079 GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetOurID(geCSNetMgr *M);
00080 GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetAllPlayerID(geCSNetMgr *M);
00081 GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveFromServer(geCSNetMgr *M, geCSNetMgr_NetMsgType *Type, int32 *Size, uint8 **Data);
00082 GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveFromClient(geCSNetMgr *M, geCSNetMgr_NetMsgType *Type, geCSNetMgr_NetID *IdClient, int32 *Size, uint8 **Data);
00083 GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveSystemMessage(geCSNetMgr *M, geCSNetMgr_NetID IdFor, geCSNetMgr_NetMsgType *Type, geCSNetMgr_NetClient *Client);
00084 GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveAllMessages(geCSNetMgr *M, geCSNetMgr_NetID *IdFrom, geCSNetMgr_NetID *IdTo, geCSNetMgr_NetMsgType *Type, int32 *Size, uint8 **Data);
00085 GENESISAPI geBoolean GENESISCC geCSNetMgr_WeAreTheServer(geCSNetMgr *M);
00086 GENESISAPI geBoolean GENESISCC geCSNetMgr_StartSession(geCSNetMgr *M, const char *SessionName, const char *PlayerName );
00087 GENESISAPI geBoolean GENESISCC geCSNetMgr_StopSession(geCSNetMgr *M);
00088 GENESISAPI geBoolean GENESISCC geCSNetMgr_SendToServer(geCSNetMgr *M, geBoolean Guaranteed, uint8 *Data, int32 DataSize);
00089 GENESISAPI geBoolean GENESISCC geCSNetMgr_SendToClient(geCSNetMgr *M, geCSNetMgr_NetID To, geBoolean Guaranteed, uint8 *Data, int32 DataSize);
00090
00091
00092
00093 #ifdef __cplusplus
00094 }
00095 #endif
00096
00097 #endif