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

Netplay.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  NetPlay.h                                                                           */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description: DirectPlay wrapper                                                     */
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_NETPLAY_H
00023 #define GE_NETPLAY_H
00024 
00025 #include <windows.h>
00026 #include <dplay.h>
00027 
00028 #include "BaseType.h"
00029 
00030 #ifdef  __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 // ************************************************************************************
00035 //      Defines
00036 // ************************************************************************************
00037 #define NETPLAY_OPEN_CREATE             1
00038 #define NETPLAY_OPEN_JOIN               2
00039 
00040 
00041 typedef struct
00042 {
00043         char    Desc[200];                                                              // Description of Service provider
00044         GUID    Guid;                                                                   // Global Service Provider GUID
00045 } SP_DESC;
00046 
00047 // must match stuct AFX_SESSION in cengine.h
00048 typedef struct
00049 {
00050         char    SessionName[200];                                               // Description of Service provider
00051         GUID    Guid;                                                                   // Global Service Provider GUID
00052 } SESSION_DESC;
00053 
00054 extern  SP_DESC                                 GlobalSP;                       // Global info about the sp
00055 extern  SESSION_DESC*                   GlobalSession;          // Global sessions availible
00056 extern  LPGUID                                  glpGuid;
00057                                                                                                         
00058 void DoDPError(HRESULT Hr);
00059 BOOL InitNetPlay(LPGUID lpGuid);
00060 BOOL NetPlayEnumSession(LPSTR IPAdress, SESSION_DESC** SessionList, DWORD* SessionNum);
00061 BOOL NetPlayJoinSession(SESSION_DESC* SessionList);
00062 BOOL NetPlayCreateSession(LPSTR SessionName, DWORD MaxPlayers);
00063 BOOL NetPlayCreatePlayer(LPDPID lppidID, LPTSTR lptszPlayerName, HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, geBoolean ServerPlayer);
00064 BOOL NetPlayDestroyPlayer(DPID pid);
00065 HRESULT NetPlaySend(DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize);
00066 HRESULT NetPlayReceive(LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize);
00067 BOOL DeInitNetPlay(void);
00068 
00069 // HACK!!!! Function is in Engine.cpp (So NetPlay.C can call it...)
00070 BOOL                    AFX_CPrintfC(char *String);
00071 
00072 #ifdef  __cplusplus
00073 }
00074 #endif
00075 
00076 #endif

Generated on Tue Sep 30 12:36:03 2003 for GTestAndEngine by doxygen 1.3.2