Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

CSNetMgr.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  CSNetMgr.h                                                                         */
00003 /*                                                                                      */
00004 /*  Author: John Pollard/Brian Adelberg                                                 */
00005 /*  Description: Client/Server network code                                             */
00006 /*                                                                                      */
00007 /*  The contents of this file are subject to the Genesis3D Public License               */
00008 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00009 /*  compliance with the License. You may obtain a copy of the License at                */
00010 /*  http://www.genesis3d.com                                                            */
00011 /*                                                                                      */
00012 /*  Software distributed under the License is distributed on an "AS IS"                 */
00013 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00014 /*  the License for the specific language governing rights and limitations              */
00015 /*  under the License.                                                                  */
00016 /*                                                                                      */
00017 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00018 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00019 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
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 //      Structure defines
00034 //================================================================================
00035 
00036 // GENESIS_PUBLIC_APIS
00037 
00038 typedef struct          geCSNetMgr      geCSNetMgr;
00039 
00040 typedef uint32                          geCSNetMgr_NetID;
00041 #define MAX_CLIENT_NAME         256
00042 
00043 // Types for messages received from GE_ReceiveSystemMessage
00044 typedef enum 
00045 {
00046         NET_MSG_NONE,                                   // No msg
00047         NET_MSG_USER,                                   // User message
00048         NET_MSG_CREATE_CLIENT,                  // A new client has joined in
00049         NET_MSG_DESTROY_CLIENT,                 // An existing client has left
00050         NET_MSG_HOST,                                   // We are the server now
00051         NET_MSG_SESSIONLOST,                    // Connection was lost
00052         NET_MSG_SERVER_ID,                              // Internal, for hand shaking process
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         // Windows.h must be included previously for this api to be exposed.
00064 
00065         typedef struct geCSNetMgr_NetSession
00066         {
00067                 char            SessionName[200];                                       // Description of Service provider
00068                 GUID            Guid;                                                           // Service Provider 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 // GENESIS_PRIVATE_APIS
00093 #ifdef __cplusplus
00094 }
00095 #endif
00096 
00097 #endif

Generated on Tue Sep 30 12:35:27 2003 for GTestAndEngine by doxygen 1.3.2