///////////////////////////////////////////////////////////////////////////////
/// @file deSlaveServer.hpp
///
/// @brief 
///
/// @author trajar
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Jun 2002
/// @author trajar
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

#ifndef _DESLAVESERVER_HPP
#define _DESLAVESERVER_HPP

#ifndef		_DENET_HPP
 #include	"deNet.hpp"
#endif

#ifndef		_DESERVER_HPP
 #include	"deServer.hpp"
#endif

class deNetResource;
#include	<VECTOR>
typedef	std::vector<deNetResource*> aResources;

typedef class DENET_API deSlaveServer : public deServer
{
public:

	struct	SlaveInfo
	{
		bool	m_bConnectDirectToServer;
	};

	deSlaveServer(void);
	virtual ~deSlaveServer(void);

	eNetError			AttachToMaster( deNetAddress * pAddress, DWORD pFlags = NULL );
	
	const SlaveInfo *	GetSlaveInfo(void)		{ return &m_SlaveInfo; }

	virtual deConnection *	GetConnectionByUser( hNetUser pUser );

protected:

	//-------------------------------------------------------------------------------------
	// Leave these alone, or call in a overidden method
	//-------------------------------------------------------------------------------------
	virtual eNetError	OnInit( int pType, DWORD dwFlags = NULL );
	virtual eNetError	OnDestroy( DWORD dwFlags = NULL );
			
private:

	deConnection *	m_MasterServer;
	aResources		m_aResources;
	SlaveInfo		m_SlaveInfo;
	
} deSlaveServer, *pdeSlaveServer;

#endif