// cMLDonkeyStatus.h: interface for the cMLDonkeyStatus class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CMLDONKEYSTATUS_H__28F03C26_5868_433A_9DB1_BE337A975133__INCLUDED_)
#define AFX_CMLDONKEYSTATUS_H__28F03C26_5868_433A_9DB1_BE337A975133__INCLUDED_

#define OPCODES_FROM_CORE_COREPROTOCOL				0
#define	OPCODES_FROM_CORE_OPTIONSINFO				1
#define	OPCODES_FROM_CORE_DEFINESEARCHES			3
#define OPCODES_FROM_CORE_NETWORKINFO				20
#define OPCODES_FROM_CORE_USERINFO					21
#define OPCODES_FROM_CORE_ROOMINFO					31
#define OPCODES_FROM_CORE_ROOMINFO2					22

#define OPCODES_FROM_CORE_SERVERSTATE				13

   

#define OPCODES_FROM_CORE_SERVERINFO				26

#define	OPCODES_FROM_CORE_CONSOLEMESSAGE			19
#define	OPCODES_FROM_CORE_CLIENTSTATS				49

#define	OPCODES_FROM_CORE_DOWNLOADINGFILES			53

#define	OPCODES_FROM_CORE_ADDSECTIONOPTION			36
#define	OPCODES_FROM_CORE_ADDPLUGINOPTION			38



#define OPCODES_TO_CORE_GETCONNECTEDSERVERS		44
#define OPCODES_TO_CORE_GETDOWNLOADINGFILES		45
#define OPCODES_TO_CORE_GUIPROTOCOLVERSION		0

#define OPCODES_TO_CORE_SENDPASSWD	0x34


class cMLDonkeyStatus  
{
public:
	cMLDonkeyStatus();
	virtual ~cMLDonkeyStatus();

	void Analyse(Word8 *buf,Word32 size);
	Word32 m_NextContentSize;

	void BufferSeek(Word32 nbskip);

	int m_iProtocolVersion;

	void AddNetworkInfo();
	void AddDownloadingFiles();
	void AddServerInfo();

    class cStreamData  m_cInputStream;

	vector<cNetworkInfo> m_lstNetwordInfo;

	int	PrepareMessage2Core(int msg,Word8 *buf,int sizemax);

//	int m_iNbFilesDownloading;
//    int m_iNbFilesDownloaded;

	string MessageCore;

	int m_iNbOption;
	vector<string> m_lstOption;


	int m_iNbDownloadingFiles;
	vector<cFileInfo>	m_lstDownloadingFiles;

	cLstServerInfo	m_lstServersInfo;


	int m_StatusOfNextRead;

	UWord64   TotalUploaded;
	UWord64   TotalDownloaded;  
	UWord64   TotalShared;  
	UWord32   NumberOfSharedFiles;  
	UWord32   TcpUploadRate;  
	UWord32   TcpDownloadRate;  
	UWord32   UdpUploadRate;  
	UWord32   UdpDownloadRate;  
	UWord32   NumberOfCurrentDownloads;
	UWord32   NumberOfDownloadsFinished;  

};


#endif // !defined(AFX_CMLDONKEYSTATUS_H__28F03C26_5868_433A_9DB1_BE337A975133__INCLUDED_)
