Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deServer.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deServer.hpp
    00003 ///
    00004 /// @brief
    00005 ///
    00006 /// @author trajar
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Jun 2002
    00023 /// @author trajar
    00024 /// @remarks Creation
    00025 ///
    00026 ///////////////////////////////////////////////////////////////////////////////
    00027
    00028 #ifndef _DESERVER_HPP
    00029 #define _DESERVER_HPP
    00030
    00031 #ifndef     _DENET_HPP
    00032  #include   "deNet.hpp"
    00033 #endif
    00034
    00035 #ifndef     _DENETUSER_HPP
    00036  #include   "deNetUser.hpp"
    00037 #endif
    00038
    00039 #ifndef     _DECONNECTION_HPP
    00040  #include   "deConnection.hpp"
    00041 #endif
    00042
    00043 typedef class DENET_API deServer : public deNetUser
    00044 {
    00045 public:
    00046
    00047     deServer(void);
    00048     virtual ~deServer(void);
    00049
    00050     virtual eNetError   SendToAll( WORD pMsgID, void * pData, DWORD pDataSize, DWORD dwFlags );
    00051     eNetError           AddClient( deConnection * pConn );
    00052     eNetError           RemoveClient( deConnection * pConn );
    00053
    00054     virtual deConnection *  GetConnectionByUser( hNetUser pUser );
    00055
    00056 protected:
    00057
    00058     //-------------------------------------------------------------------------------------
    00059     // Override these methods in your deNetUser classes
    00060     //-------------------------------------------------------------------------------------
    00061     virtual eNetError   OnAcceptConnection( deConnectionRequest * pRequest, deConnection * pConn )  = 0;
    00062
    00063     //-------------------------------------------------------------------------------------
    00064     // Leave these alone, or call in a overidden method
    00065     //-------------------------------------------------------------------------------------
    00066     virtual eNetError   OnInit( int pType, DWORD dwFlags = NULL );
    00067     virtual eNetError   OnDestroy( DWORD dwFlags = NULL );
    00068     virtual eNetError   OnCloseConnection( DWORD dwFlags = NULL );
    00069     virtual eNetError   OnConnectionLost( deConnectionLost * pLost );
    00070     virtual eNetError   OnConnectionRequest( deConnectionRequest * pRequest );
    00071     virtual eNetError   OnConnectionReply( deConnectionReply * pReply );
    00072
    00073     deConnection **     m_aClients;
    00074     DWORD               m_iNumClients;
    00075
    00076 } deServer, *pdeServer;
    00077
    00078 #endif