///////////////////////////////////////////////////////////////////////////////
/// @file deNetMsg.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		_DENETMSG_HPP
#define		_DENETMSG_HPP

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

class dePacket;

class DENET_API deNetMsg
{
public:

	deNetMsg(void);
	deNetMsg( dePacket * pPacket );
	virtual ~deNetMsg(void);

	enum eMsgID
	{
		MSG_INVALID_ID			= (WORD)(-1),
		// low level gets handled by deConnection object
		MSG_LOW_LEVEL			= 0,
		MSG_HANDSHAKE,
		MSG_DISCONNECT,
		MSG_PING,
		// high level gets handled by deNetUser object
		MSG_HIGH_LEVEL,
		MSG_SERVER_TIME,
		MSG_CONNECTION_REQUEST,
		MSG_CONNECTION_REPLY,
		MSG_CONNECTION_LOST,
		MSG_CUSTOM,
		MSG_MAX_ID
	};

	eNetError		Init( dePacket * pPacket );
	hNetUser		GetSender(void)			const		{ return m_Sender; }
	hNetUser		GetRecip(void)			const		{ return m_Recip; }
	WORD			GetMsgID(void)			const		{ return m_iMsgID; }
	DWORD			GetDataSize(void)		const		{ return m_DataSize; }
	void *			GetData(void)			const		{ return m_Data; }

private:

	hNetUser	m_Sender;
	hNetUser	m_Recip;
	WORD		m_iMsgID;
	DWORD		m_DataSize;
	BYTE *		m_Data;

public:

	deNetMsg& operator = ( const deNetMsg& r );
};

#endif