Main Page | Modules | File List | File Members

RegServerLib.h

00001 /***SDOC************************************************************************
00002  *                                UbiSoft Network Development
00003  *                                ---------------------------
00004  *
00005  * FILE........: RegServerLib.h
00006  * CREATION....: Sept 2001
00007  * AUTHOR......: Guillaume Plante
00008  *
00009  * DESCRIPTION.: Interface class to login fonctionality
00010  *
00011  *******************************************************************************
00012  *                                         FILE HISTORY
00013  *******************************************************************************
00014  *
00015  * DATE........:
00016  * AUTHOR......:
00017  * DESCRIPTION.:
00018  *
00019  ***********************************************************************EDOC***/
00020 
00021 #ifndef __CLIENTLIB_H__
00022 #define __CLIENTLIB_H__
00023 
00024 #include "define.h"
00025 
00026 class clDataList;
00027 class clDataBin;
00028 class clSRPGSClient;
00029 class CRegServerConnection;
00030 class clParentGroups;
00031 
00032 class CRegisterServer
00033 {
00034         public:
00035 
00036         CRegisterServer();
00037         virtual ~CRegisterServer();
00038 
00039         // RegServer public functions
00040         public:
00041         GSvoid RegServer_Engine();
00042         GSbool RegServerSend_RouterConnect( const GSchar* szAddress, GSint lPort );
00043         GSbool RegServerSend_RouterDisconnect();
00044         GSbool RegServerSend_LoginRouter( const GSchar* szAlias,
00045                         const GSchar* szPassword, const GSchar* szVersion );
00046         GSbool RegServerSend_RequestParentGroupOnLobby( const GSchar* szGameName );
00047 
00048         GSbool RegServerSend_RegisterServerOnLobby(
00049                         GSuint uiLobbyID,
00050                         GSint iParentID,
00051                         const GSchar* szRoomName,
00052                         const GSchar* szGameName,
00053                         GSushort uwRoomType,
00054                         GSuint uiMaxPlayer,
00055                         GSuint uiMaxSpectator,
00056                         const GSchar* szPassword,
00057                         const GSvoid* pstGroupInfo,
00058                         GSint iGroupInfoSize,                   
00059                         const GSvoid* pstAltGroupInfo,
00060                         GSint iAltGroupInfoSize,                        
00061                         const GSvoid* pstGameData,
00062                         GSint iGameDataSize,
00063                         GSushort usGamePort,
00064                         const GSchar* szGameVersion,
00065                         const GSchar* szGSVersion,
00066                         GSbool bScoreSubmission,
00067                         GSbool bDedicatedServer );
00068 
00069 
00071         // Lobby Server
00073         GSbool RegServerSend_LobbyServerConnection( const GSchar* szAddress, GSushort usPort,
00074                         GSushort usLocalPort = 0, GSuint uiStillAliveDelay = 25, GSuint uiDisconnectionDelay = 120 );
00075         GSbool RegServerSend_LobbyServerClose();
00076         GSbool RegServerSend_LobbyServerLogin( const GSchar* szAlias,GSint iGroupID );
00077         GSbool RegServerSend_LobbyServerMemberJoin( const GSchar* szMember );
00078         GSbool RegServerSend_LobbyServerMemberLeave( const GSchar* szMember );
00079         GSbool RegServerSend_UpdateGroupSettings(
00080                         GSint iGroupID,
00081                         GSbyte bOpen,
00082                         GSbyte bScoreSubmission,
00083                         GSbyte bDedicatedServer,
00084                         GSint iMaxPlayers,
00085                         GSint iMaxSpectator,
00086                         const GSchar* szPassword,
00087                         const GSvoid* pucGroupInfo,
00088                         GSint iGroupInfoSize,
00089                         const GSvoid* pucAltGroupInfo,
00090                         GSint iAltGroupInfoSize,
00091                         const GSvoid* pucGameData,
00092                         GSint iGameDataSize,
00093                         GSushort usGamePort );
00094         
00095         GSbool RegServerSend_MatchStart( GSuint uiMode = 0 );
00096         GSbool RegServerSend_MatchFinish( );
00097 
00098         //**************************************************
00099         //virtual Function used for the CallBack
00100         //**************************************************
00101         virtual GSvoid RegServerRcv_LoginRouterResult( GSubyte ucType, GSint lReason,
00102                         const GSchar* szIPAddress ) = 0;
00103         virtual GSvoid RegServerRcv_RouterDisconnection() = 0;
00104         virtual GSvoid RegServerRcv_RegisterServerResult( GSubyte pucType,
00105                         GSint plReason,
00106                         GSint iGroupID,
00107                         const GSchar* szAddress,
00108                         GSushort usPort,
00109                         const GSchar* szSessionName ) = 0;
00110         virtual GSvoid RegServerRcv_RequestParentGroupResult( GSubyte ucType,
00111                         GSint lReason, GSint iServerID,GSint iGroupID, const GSchar* szGroupName,
00112                         GSuint uiNbPlayers, GSuint uiMaxPlayers ) = 0;
00113         virtual GSvoid RegServerRcv_LobbyServerLoginResults( GSubyte ucType,
00114                         GSint iReason, GSint iLobbyServerID, GSint iGroupID ) = 0;
00115         virtual GSvoid RegServerRcv_LobbyServerUpdateGroupSettingsResults(
00116                         GSubyte ucType, GSint iReason, GSint iGroupID ) = 0;
00117         virtual GSvoid RegServerRcv_LobbyServerDisconnection() = 0;
00118         virtual GSvoid RegServerRcv_LobbyServerMemberNew( const GSchar* szMember,
00119                         GSbool bSpectator,
00120                 const GSchar* szIPAddress, const GSchar* szAltIPAddress,
00121                         const GSvoid* pPlayerInfo, GSuint uiPlayerInfoSize,
00122                         GSushort usPlayerStatus ) = 0;
00123         virtual GSvoid RegServerRcv_LobbyServerMatchStartReply( GSubyte ucType,
00124                         GSint iReason, GSint iGroupID ) = 0;
00125         virtual GSvoid RegServerRcv_LobbyServerMemberLeft(const GSchar* szMember ) = 0;
00126         virtual GSvoid RegServerRcv_LobbyServerMatchFinishReply( GSubyte ucType,
00127                         GSint iReason, GSint iGroupID ) = 0;
00128         virtual GSvoid RegServerRcv_LobbyServerGroupConfigUpdate(
00129                         GSuint uiGroupConfig, GSint iGroupID ) = 0;
00130         virtual GSvoid RegServerRcv_LobbyServerMemberUpdateStatus(
00131                         const GSchar* szPlayer, GSushort usPlayerStatus ) = 0;
00132         virtual GSvoid RegServerRcv_LobbyServerNewGroup (GSushort usRoomType,
00133                 const GSchar* szRoomName,
00134                 GSint iGroupID,
00135                 GSint iLobbyServerID,
00136                 GSint iParentGroupID,
00137                 GSint uiGroupConfig,
00138                 GSshort sGroupLevel,
00139                 const GSchar* szMaster,
00140                 const GSchar* szAllowedGames,
00141                 const GSchar* szGame,
00142                 const GSvoid* pGroupInfo,
00143                 GSuint GroupInfoSize,
00144                 GSuint uiMatchEventID,
00145                 GSuint uiMaxPlayers,
00146                 GSuint uiNbPlayers,
00147                 GSuint uiMaxSpectators,
00148                 GSuint uiNbSpectators,
00149                 const GSchar* szGameVersion,
00150                 const GSchar* szGSGameVersion,
00151                 const GSchar* szIPAddress,
00152                 const GSchar* szAltIPAddress ) = 0;
00153         virtual GSvoid RegServerRcv_LobbyServerMemberUpdateInfo(
00154                         const GSchar* szMember, const GSvoid* pPlayerInfo,
00155                         GSuint uiPlayerInfoSize ) = 0;
00156 
00157         private:
00158 
00159         GSvoid RegServer_UnInitRouterConnection();
00160         GSvoid RegServer_UnInitLobbyServerConnection();
00161         GSvoid CheckDisconnection();
00162 
00163         GSbool RegServerRcv_LoginRouterResult( GSushort SFType,clDataList* pDataList);
00164         GSbool RegServerRcv_RegisterServerResult( GSushort usFSType,
00165                         clDataList* pDataList );
00166         GSbool RegServerRcv_RequestParentGroupResult( GSushort SFType,
00167                         clDataList* pDataList );
00168 
00169         GSbool CheckLobbyServerConnection();
00170         GSbool ManageLobbyServerConnection();
00171         GSvoid CheckTheLobbyMessages();
00172         GSvoid ReadLobbySeverAnswer( GSubyte ucType, clDataList* pDataList );
00173         GSvoid RegServerRcv_LobbyServerLoginResults( GSuchar ucType,
00174                         clDataList* pDataMessage );
00175         GSvoid RegServerRcv_LobbyServerUpdateGroupSettingsResults( GSuchar ucType,
00176                         clDataList* pDataMessage );
00177         GSvoid RegServerRcv_LobbyServerNewMembers( clDataList* pDataMessage );
00178         GSvoid RegServerRcv_LobbyServerMatchStartReply( GSuchar ucType,
00179                         clDataList* pDataMessage );
00180         GSvoid RegServerRcv_LobbyServerMemberLeft( clDataList* pDataList );
00181         GSvoid RegServerRcv_LobbyServerMatchFinishReply( GSuchar ucType,
00182                         clDataList* pDataMessage );
00183         GSvoid RegServerRcv_LobbyServerGroupConfigUpdate( clDataList* pDataMessage );
00184         GSvoid RegServerRcv_LobbyServerMemberUpdateStatus( clDataList* pDataMessage );
00185         GSvoid RegServerRcv_LobbyServerNewGroup ( clDataList* pDataMessage );
00186         GSvoid RegServerRcv_LobbyServerMemberUpdateInfo(  clDataList* pDataMessage );
00187 
00188 
00189         clParentGroups *m_pParentGroups;
00190 
00191         GSchar m_szPlayerAlias[NICKNAMELENGTH];
00192         GSchar m_szAddress[IPADDRESSLENGTH];
00193         GSbool m_bServerRegistered;
00194 
00195         GSbool m_bLobbyConnected;
00196         GSbool m_bRouterConnected;
00197 
00198         GSchar m_szLocalIP[IPADDRESSLENGTH];
00199         CRegServerConnection* m_RouterConnection;
00200         clSRPGSClient* m_pSRPGSClient;
00201         GSint m_iLobbyServerID;
00202         GSint m_iGroupID;
00203 
00204 };
00205 
00206 #endif //__CLIENTLIB_H__

Ubi.com GameService SDK - ©UbiSoft Entertainment 2002
GameService development team