Official eMule-Board: Enhanced Client Recognition V2 - Official eMule-Board

Jump to content


  • (3 Pages)
  • +
  • 1
  • 2
  • 3

Enhanced Client Recognition V2 Updated & Enhanced :)

#1 User is offline   Famerlor 

  • also known as Spike2
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 685
  • Joined: 16-October 04

Posted 14 September 2009 - 06:35 AM

Since the nowadays ECR has much changed since it's initial code I declared it to be v2 :) It now also includes a small fix by taz in recognizing MLdonkeys and Stulle's CompatClientStats have become a part of the ECR-system.

I posted the whole functions which incorporate the changes for better readability / understandability and for easier merging :)

Here we go:


BaseClient.cpp:

void CUpDownClient::InitClientSoftwareVersion()
{
	if (m_pszUsername == NULL){
		m_clientSoft = SO_UNKNOWN;
		return;
	}

	int iHashType = GetHashType();
	if (m_bEmuleProtocol || iHashType == SO_EMULE){
		LPCTSTR pszSoftware;
		switch(m_byCompatibleClient){
			case SO_CDONKEY:
				m_clientSoft = SO_CDONKEY;
				pszSoftware = _T("cDonkey");
				break;
			case SO_XMULE:
				m_clientSoft = SO_XMULE;
				pszSoftware = _T("xMule");
				break;
			case SO_AMULE:
				m_clientSoft = SO_AMULE;
				pszSoftware = _T("aMule");
				break;
			case SO_SHAREAZA:
// Spike2 - Enhanced Client Recognition v2 - START
// removed "case 40"... this is now integrated here
			case SO_SHAREAZA2:
			case SO_SHAREAZA3:
			case SO_SHAREAZA4:
// Spike2 - Enhanced Client Recognition v2 - END
				m_clientSoft = SO_SHAREAZA;
				pszSoftware = _T("Shareaza");
				break;
			case SO_LPHANT:
				m_clientSoft = SO_LPHANT;
				pszSoftware = _T("lphant");
				break;
			// Spike2 - Enhanced Client Recognition v2 - START
			case SO_EMULEPLUS:
				m_clientSoft = SO_EMULEPLUS;
				pszSoftware = _T("eMule Plus");
				break;
			case SO_HYDRANODE:
				m_clientSoft = SO_HYDRANODE;
				pszSoftware = _T("Hydranode");
				break;
			case SO_TRUSTYFILES:
				m_clientSoft = SO_TRUSTYFILES;
				pszSoftware = _T("TrustyFiles");
				break;
			// Spike2 - Enhanced Client Recognition v2 - END
			default:
				if (m_bIsML || m_byCompatibleClient == SO_MLDONKEY || m_byCompatibleClient == SO_MLDONKEY2 || m_byCompatibleClient == SO_MLDONKEY3){ // Spike2 - Enhanced Client Recognition v2
					m_clientSoft = SO_MLDONKEY;
					pszSoftware = _T("MLdonkey");
				}
				else if ( m_bIsHybrid || m_byCompatibleClient == SO_EDONKEYHYBRID){ // Spike2 - Enhanced Client Recognition v2
					m_clientSoft = SO_EDONKEYHYBRID;
					pszSoftware = _T("eDonkeyHybrid");
				}
				else if (m_byCompatibleClient != 0){
					// Spike2 - Enhanced Client Recognition v2 - START
					// Recognize all eMulePlus - just to be sure !
					// Note that the compare is done case-sensitive to avoid false positives.
					if (StrStr(m_strModVersion,_T("Plus 1")))
					{
						m_clientSoft = SO_EMULEPLUS;
						pszSoftware = _T("eMule Plus");
					}
					else
					{
					// Spike2 - Enhanced Client Recognition v2 - END
					m_clientSoft = SO_XMULE; // means: 'eMule Compatible'
					pszSoftware = _T("eMule Compat");
					} // Spike2 - Enhanced Client Recognition v2
				}
				else{
					m_clientSoft = SO_EMULE;
					pszSoftware = _T("eMule");
				}
		}

		int iLen;
		TCHAR szSoftware[128];
		if (m_byEmuleVersion == 0){
			m_nClientVersion = MAKE_CLIENT_VERSION(0, 0, 0);
			iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s"), pszSoftware);
		}
		else if (m_byEmuleVersion != 0x99){
			UINT nClientMinVersion = (m_byEmuleVersion >> 4)*10 + (m_byEmuleVersion & 0x0f);
			m_nClientVersion = MAKE_CLIENT_VERSION(0, nClientMinVersion, 0);
			iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v0.%u"), pszSoftware, nClientMinVersion);
		}
		else{
			UINT nClientMajVersion = (m_nClientVersion >> 17) & 0x7f;
			UINT nClientMinVersion = (m_nClientVersion >> 10) & 0x7f;
			UINT nClientUpVersion  = (m_nClientVersion >>  7) & 0x07;
			m_nClientVersion = MAKE_CLIENT_VERSION(nClientMajVersion, nClientMinVersion, nClientUpVersion);
			if (m_clientSoft == SO_EMULE)
				iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u%c"), pszSoftware, nClientMajVersion, nClientMinVersion, _T('a') + nClientUpVersion);
			// Spike2 - Enhanced Client Recognition v2 - START
			else if (m_clientSoft == SO_EMULEPLUS) // Spike2 - Fix by BlueSonicBoy - Thanx!
			{
				if(nClientMinVersion == 0)
				{
					if(nClientUpVersion == 0)
						iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u"), pszSoftware, nClientMajVersion);
					else
						iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u%c"), pszSoftware, nClientMajVersion, _T('a') + nClientUpVersion - 1);
				}
				else
				{
					if(nClientUpVersion == 0)
						iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u"), pszSoftware, nClientMajVersion, nClientMinVersion);
					else
						iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u%c"), pszSoftware, nClientMajVersion, nClientMinVersion, _T('a') + nClientUpVersion - 1);
				}
			}
			// Spike2 - Enhanced Client Recognition v2 - END
			else if (m_clientSoft == SO_AMULE || nClientUpVersion != 0)
				iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u.%u"), pszSoftware, nClientMajVersion, nClientMinVersion, nClientUpVersion);
			else if (m_clientSoft == SO_LPHANT)
			{
				if (nClientMinVersion < 10)
				    iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.0%u"), pszSoftware, (nClientMajVersion-1), nClientMinVersion);
				else
					iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u"), pszSoftware, (nClientMajVersion-1), nClientMinVersion);
			}
			else
				iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("%s v%u.%u"), pszSoftware, nClientMajVersion, nClientMinVersion);
		}
		if (iLen > 0){
			memcpy(m_strClientSoftware.GetBuffer(iLen), szSoftware, iLen*sizeof(TCHAR));
			m_strClientSoftware.ReleaseBuffer(iLen);
		}
		return;
	}

	if (m_bIsHybrid || m_byCompatibleClient == SO_EDONKEYHYBRID){ // Spike2 - Enhanced Client Recognition v2
		m_clientSoft = SO_EDONKEYHYBRID;
		// seen:
		// 105010	0.50.10
		// 10501	0.50.1
		// 10405	1.4.5 // Spike2 - Enhanced Client Recognition v2 (this one found by netfinity)
		// 10300	1.3.0
		// 10212	1.2.2 // Spike2 - Enhanced Client Recognition v2
		// 10211	1.2.1 // Spike2 - Enhanced Client Recognition v2
		// 10201	1.2.1
		// 10103	1.1.3
		// 10102	1.1.2
		// 10100	1.1
		// 1051		0.51.0
		// 1002		1.0.2
		// 1000		1.0
		// 501		0.50.1

		UINT nClientMajVersion;
		UINT nClientMinVersion;
		UINT nClientUpVersion;
		if (m_nClientVersion > 100000){
			UINT uMaj = m_nClientVersion/100000;
			nClientMajVersion = uMaj - 1;
			nClientMinVersion = (m_nClientVersion - uMaj*100000) / 100;
			nClientUpVersion = m_nClientVersion % 100;
		}
// Spike2 - Enhanced Client Recognition v2
		else if (m_nClientVersion >= 10100 && m_nClientVersion <= 10409){ // netfinity
			UINT uMaj = m_nClientVersion/10000;
			nClientMajVersion = uMaj;
			nClientMinVersion = (m_nClientVersion - uMaj*10000) / 100;
			nClientUpVersion = m_nClientVersion % 10;
		}
		else if (m_nClientVersion > 10000){
			UINT uMaj = m_nClientVersion/10000;
			nClientMajVersion = uMaj - 1;
			nClientMinVersion = (m_nClientVersion - uMaj*10000) / 10;
			nClientUpVersion = m_nClientVersion % 10;
		}
		else if (m_nClientVersion >= 1000 && m_nClientVersion < 1020){
			UINT uMaj = m_nClientVersion/1000;
			nClientMajVersion = uMaj;
			nClientMinVersion = (m_nClientVersion - uMaj*1000) / 10;
			nClientUpVersion = m_nClientVersion % 10;
		}
		else if (m_nClientVersion > 1000){
			UINT uMaj = m_nClientVersion/1000;
			nClientMajVersion = uMaj - 1;
			nClientMinVersion = m_nClientVersion - uMaj*1000;
			nClientUpVersion = 0;
		}
		else if (m_nClientVersion > 100){
			UINT uMin = m_nClientVersion/10;
			nClientMajVersion = 0;
			nClientMinVersion = uMin;
			nClientUpVersion = m_nClientVersion - uMin*10;
		}
		else{
			nClientMajVersion = 0;
			nClientMinVersion = m_nClientVersion;
			nClientUpVersion = 0;
		}
		m_nClientVersion = MAKE_CLIENT_VERSION(nClientMajVersion, nClientMinVersion, nClientUpVersion);

		int iLen;
		TCHAR szSoftware[128];
		if (nClientUpVersion)
			iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("eDonkeyHybrid v%u.%u.%u"), nClientMajVersion, nClientMinVersion, nClientUpVersion);
		else
			iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("eDonkeyHybrid v%u.%u"), nClientMajVersion, nClientMinVersion);
		if (iLen > 0){
			memcpy(m_strClientSoftware.GetBuffer(iLen), szSoftware, iLen*sizeof(TCHAR));
			m_strClientSoftware.ReleaseBuffer(iLen);
		}
		return;
	}

// Spike2 - Enhanced Client Recognition v2 - START (Thanx to WiZaRd for this one !)
	if (m_bIsML || iHashType == SO_MLDONKEY || iHashType == SO_OLD_MLDONKEY){
// Spike2 - Enhanced Client Recognition v2 - END
		m_clientSoft = SO_MLDONKEY;
		UINT nClientMinVersion = m_nClientVersion;
		m_nClientVersion = MAKE_CLIENT_VERSION(0, nClientMinVersion, 0);
		TCHAR szSoftware[128];
		int iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("MLdonkey v0.%u"), nClientMinVersion);
		if (iLen > 0){
			memcpy(m_strClientSoftware.GetBuffer(iLen), szSoftware, iLen*sizeof(TCHAR));
			m_strClientSoftware.ReleaseBuffer(iLen);
		}
		return;
	}

	if (iHashType == SO_OLDEMULE){
		m_clientSoft = SO_OLDEMULE;
		UINT nClientMinVersion = m_nClientVersion;
		m_nClientVersion = MAKE_CLIENT_VERSION(0, nClientMinVersion, 0);
		TCHAR szSoftware[128];
		int iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("Old eMule v0.%u"), nClientMinVersion);
		if (iLen > 0){
			memcpy(m_strClientSoftware.GetBuffer(iLen), szSoftware, iLen*sizeof(TCHAR));
			m_strClientSoftware.ReleaseBuffer(iLen);
		}
		return;
	}

	m_clientSoft = SO_EDONKEY;
	UINT nClientMinVersion = m_nClientVersion;
	m_nClientVersion = MAKE_CLIENT_VERSION(0, nClientMinVersion, 0);
	TCHAR szSoftware[128];
	int iLen = _sntprintf(szSoftware, ARRSIZE(szSoftware), _T("eDonkey v0.%u"), nClientMinVersion);
	if (iLen > 0){
		memcpy(m_strClientSoftware.GetBuffer(iLen), szSoftware, iLen*sizeof(TCHAR));
		m_strClientSoftware.ReleaseBuffer(iLen);
	}
}

int CUpDownClient::GetHashType() const
{
	if (m_achUserHash[5] == 13 && m_achUserHash[14] == 110)
		return SO_OLDEMULE;
	else if (m_achUserHash[5] == 'M' && m_achUserHash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2 - START
		return SO_OLD_MLDONKEY;
	else if (m_achUserHash[5] == 0x0E && m_achUserHash[14] == 0x6F)
		return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
	else if (m_achUserHash[5] == 14 && m_achUserHash[14] == 111)
		return SO_EMULE;
	else
		return SO_UNKNOWN;
}



ClientList.cpp:

void CClientList::GetStatistics(uint32 &ruTotalClients, int stats[NUM_CLIENTLIST_STATS], 
								CMap<uint32, uint32, uint32, uint32>& clientVersionEDonkey, 
								CMap<uint32, uint32, uint32, uint32>& clientVersionEDonkeyHybrid, 
								CMap<uint32, uint32, uint32, uint32>& clientVersionEMule, 
								CMap<uint32, uint32, uint32, uint32>& clientVersionAMule)
{
	ruTotalClients = list.GetCount();
	memset(stats, 0, sizeof(stats[0]) * NUM_CLIENTLIST_STATS);

	for (POSITION pos = list.GetHeadPosition(); pos != NULL; )
	{
		const CUpDownClient* cur_client = list.GetNext(pos);

		if (cur_client->HasLowID())
			stats[14]++;
		
		switch (cur_client->GetClientSoft())
		{
			case SO_EMULE:
			case SO_OLDEMULE:
				stats[2]++;
				clientVersionEMule[cur_client->GetVersion()]++;
				break;

			case SO_EDONKEYHYBRID : 
				stats[4]++;
				clientVersionEDonkeyHybrid[cur_client->GetVersion()]++;
				break;
			
			case SO_AMULE:
				stats[10]++;
				clientVersionAMule[cur_client->GetVersion()]++;
				break;

			case SO_EDONKEY:
				stats[1]++;
				clientVersionEDonkey[cur_client->GetVersion()]++;
				break;

			case SO_MLDONKEY:
				stats[3]++;
				break;
			
			case SO_SHAREAZA:
				stats[11]++;
				break;

			// all remaining 'eMule Compatible' clients
			// Spike2 - Enhanced Client Recognition v2 - START
			case SO_HYDRANODE:
			case SO_EMULEPLUS:
			case SO_TRUSTYFILES:
			// Spike2 - Enhanced Client Recognition v2 - END
			case SO_CDONKEY:
			case SO_XMULE:
			case SO_LPHANT:
				stats[5]++;
				break;

			default:
				stats[0]++;
				break;
		}
....



New function:

//Spike2 - Enhanced Client Recognition v2 - START
// ==> Compat Client Stats [Stulle] - Stulle
void CClientList::GetCompatClientsStats(CRBMap<CString, uint32> *compatClients)
{
	for (POSITION pos = list.GetHeadPosition(); pos != NULL;) {		
		CUpDownClient* cur_client =	list.GetNext(pos);

		switch (cur_client->GetClientSoft())
		{
			case SO_HYDRANODE:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("Hydranode"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("Hydranode"), count);
			}break;
			case SO_EMULEPLUS:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("eMule Plus"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("eMule Plus"), count);
			}break;
			case SO_TRUSTYFILES:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("TrustyFiles"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("TrustyFiles"), count);
			}break;
			case SO_CDONKEY:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("cDonkey"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("cDonkey"), count);
			}break;
			case SO_XMULE:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("xMule"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("xMule"), count);
			}break;
			case SO_LPHANT:
			{
				uint32 count;

				if (!compatClients->Lookup(_T("lphant"), count))
					count = 1;
				else
					count++;

				compatClients->SetAt(_T("lphant"), count);
			}break;
			default:
				continue;
		}
	}
}
// <== Compat Client Stats [Stulle] - Stulle
//Spike2 - Enhanced Client Recognition v2 - END


ClientList.h:

//Spike2 - Enhanced Client Recognition v2 - START
public:
	void GetCompatClientsStats(CRBMap<CString, uint32> *compatClients); // CompatClientStats by Stulle
//Spike2 - Enhanced Client Recognition v2 - END


ClientStateDefs.h:

enum EClientSoftware{
	SO_EMULE			= 0,	// default
	SO_CDONKEY			= 1,	// ET_COMPATIBLECLIENT
	SO_XMULE			= 2,	// ET_COMPATIBLECLIENT
	SO_AMULE			= 3,	// ET_COMPATIBLECLIENT
	SO_SHAREAZA			= 4,	// ET_COMPATIBLECLIENT
	SO_EMULEPLUS		= 5,	// Spike2 - Enhanced Client Recognition v2
	SO_HYDRANODE		= 6,	// Spike2 - Enhanced Client Recognition v2
	SO_MLDONKEY			= 10,	// ET_COMPATIBLECLIENT
	SO_LPHANT			= 20,	// ET_COMPATIBLECLIENT
	SO_SHAREAZA2		= 28,	// Spike2 - Enhanced Client Recognition v2
	SO_TRUSTYFILES		= 30,	// Spike2 - Enhanced Client Recognition v2
	SO_SHAREAZA3		= 40,   // Spike2 - Enhanced Client Recognition v2
	// other client types which are not identified with ET_COMPATIBLECLIENT
	SO_EDONKEYHYBRID	= 50,
//Spike2 - Enhanced Client Recognition v2 - START
	SO_EDONKEY			= 51,	// from aMule
	SO_MLDONKEY2		= 52,	// from aMule
	SO_OLDEMULE			= 53,	// from aMule
	SO_SHAREAZA4		= 68,	// from aMule
	SO_MLDONKEY3		= 152,	// from aMule
        SO_OLD_MLDONKEY, // Enhancement from WiZaRd - these are the MLdonkeys with M and L in the hash :)
//Spike2 - Enhanced Client Recognition v2 - END
	SO_URL,
	SO_UNKNOWN
};


otherfunctions.cpp:

int GetHashType(const uchar* hash)
{
	if (hash[5] == 13 && hash[14] == 110)
		return SO_OLDEMULE;
 	else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
		return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
	else if (hash[5] == 0x0E && hash[14] == 0x6F) 
		return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
	else if (hash[5] == 14 && hash[14] == 111)
		return SO_EMULE;
	else
		return SO_UNKNOWN;
}

LPCTSTR DbgGetHashTypeString(const uchar* hash)
{
	int iHashType = GetHashType(hash);
	if (iHashType == SO_EMULE)
		return _T("eMule");
	if (iHashType == SO_MLDONKEY)
		return _T("MLdonkey");
// Spike2 - Enhanced Client Recognition v2 - START 
// Thanx to WiZaRd for this one
	else if (iHashType == SO_OLD_MLDONKEY) 
		return _T("Old MLdonkey");
// Spike2 - Enhanced Client Recognition v2 - END
	if (iHashType == SO_OLDEMULE)
		return _T("Old eMule");
	ASSERT( iHashType == SO_UNKNOWN );
	return _T("Unknown");
}


Preferences.cpp:

void CPreferences::Add2SessionTransferData(UINT uClientID, UINT uClientPort, BOOL bFromPF, 
										   BOOL bUpDown, uint32 bytes, bool sentToFriend)
{
	//	This function adds the transferred bytes to the appropriate variables,
	//	as well as to the totals for all clients. - Khaos
	//	PARAMETERS:
	//	uClientID - The identifier for which client software sent or received this data, eg SO_EMULE
	//	uClientPort - The remote port of the client that sent or received this data, eg 4662
	//	bFromPF - Applies only to uploads.  True is from partfile, False is from non-partfile.
	//	bUpDown - True is Up, False is Down
	//	bytes - Number of bytes sent by the client.  Subtract header before calling.

	switch (bUpDown){
		case true:
			//	Upline Data
			switch (uClientID){
				// Update session client breakdown stats for sent bytes...
				case SO_EMULE:
				case SO_OLDEMULE:		sesUpData_EMULE+=bytes;			break;
				case SO_EDONKEYHYBRID:	sesUpData_EDONKEYHYBRID+=bytes;	break;
				case SO_EDONKEY:		sesUpData_EDONKEY+=bytes;		break;
				case SO_MLDONKEY:		sesUpData_MLDONKEY+=bytes;		break;
				case SO_AMULE:			sesUpData_AMULE+=bytes;			break;
				case SO_SHAREAZA:		sesUpData_SHAREAZA+=bytes;		break;
				// Spike2 - Enhanced Client Recognition v2 - START 
				//Fix by Stulle !!
				case SO_HYDRANODE:
				case SO_EMULEPLUS:
				case SO_TRUSTYFILES:
				// Spike2 - Enhanced Client Recognition v2 - END
				case SO_CDONKEY:
				case SO_LPHANT:
				case SO_XMULE:			sesUpData_EMULECOMPAT+=bytes;	break;
			}
....


			// Downline Data
			switch (uClientID){
                // Update session client breakdown stats for received bytes...
				case SO_EMULE:
				case SO_OLDEMULE:		sesDownData_EMULE+=bytes;		break;
				case SO_EDONKEYHYBRID:	sesDownData_EDONKEYHYBRID+=bytes;break;
				case SO_EDONKEY:		sesDownData_EDONKEY+=bytes;		break;
				case SO_MLDONKEY:		sesDownData_MLDONKEY+=bytes;	break;
				case SO_AMULE:			sesDownData_AMULE+=bytes;		break;
				case SO_SHAREAZA:		sesDownData_SHAREAZA+=bytes;	break;
// Spike2 - Enhanced Client Recognition v2 - START
// Fix by Stulle !!
				case SO_HYDRANODE:
				case SO_EMULEPLUS:
				case SO_TRUSTYFILES:
// Spike2 - Enhanced Client Recognition v2 - END
				case SO_CDONKEY:
				case SO_LPHANT:
				case SO_XMULE:			sesDownData_EMULECOMPAT+=bytes;	break;
				case SO_URL:			sesDownData_URL+=bytes;			break;
			}



StatisticsDlg.cpp:

AFTER

				if (verCount < cli_lastCount[3]) 
				{
					for (uint32 i = 0; i < cli_lastCount[3] - verCount; i++) 
					{
						stattree.DeleteItem(cli_versions[cli_lastCount[3] + (MAX_SUB_CLIENT_VERSIONS*3-1) - i]);
						if (cli_lastCount[3] + (MAX_SUB_CLIENT_VERSIONS*3-1) - i == MAX_SUB_CLIENT_VERSIONS/2)
							stattree.DeleteItem(cli_other[3]);
					}
				}
				cli_lastCount[3] = verCount;
			} // End Clients -> Client Software -> aMule Section


ADD

//Spike2 - Enhanced Client Recognition v2 - START
			// ==> Compat Client Stats [Stulle] - Stulle
			CRBMap<CString, uint32> compatClients;
			theApp.clientlist->GetCompatClientsStats(&compatClients);

			POSITION mpos = compatClients.GetHeadPosition();
			if (stattree.ItemHasChildren(clisoft[6])){
				HTREEITEM hChild; 
				hChild = stattree.GetChildItem(clisoft[6]);
				while( hChild != NULL && mpos != NULL )
				{
					CString name;
					uint32 count;
					compatClients.GetNextAssoc(mpos, name, count);
					cbuffer.Format(_T("%s: %i (%1.1f%%)"), name, count, (double)count/myStats[5]*100);
					stattree.SetItemText(hChild, cbuffer);
					hChild = stattree.GetNextSiblingItem( hChild );
				}
				while (hChild != NULL){
					HTREEITEM hTemp = hChild;
					hChild = stattree.GetNextSiblingItem( hChild );
					stattree.DeleteItem(hTemp);
				}
			}
			while (mpos != NULL){
				CString name;
				uint32 count;
				compatClients.GetNextAssoc(mpos, name, count);
				cbuffer.Format(_T("%s: %i (%1.1f%%)"), name, count, (double)count/myStats[5]*100);
				stattree.InsertItem(cbuffer, clisoft[6]);
			}
			// <== Compat Client Stats [Stulle] - Stulle
//Spike2 - Enhanced Client Recognition v2 - END



Please note that there is an optimized variant of Stulle's CompatClientStats-code done by WiZaRd, but I don't have it at hand right now... But of course ECR is fully functional in the way I posted it.



Greetz,

Spike2

This post has been edited by Famerlor: 14 September 2009 - 06:36 AM

Posted Image

You want a light mod with source-dropping, Powershare and WiZaRd's ClientAnalyzer ?
Try Spike2-Mod !

You rather want to stick to official eMule but don't want to miss all the new fixes and optimizations from the mods ?
Try OfFixed-Mod !


This post has been edited 1 time, the last time by God: Tomorrow, 12:74 PM
0

#2 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 14 September 2009 - 07:17 AM

There's a problem in @ otherfunctions.cpp / baseclient.cpp:

int GetHashType(const uchar* hash)
{
        if (hash[5] == 13 && hash[14] == 110)
                return SO_OLDEMULE;
        else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
                return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
        else if (hash[5] == 0x0E && hash[14] == 0x6F)
                return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
        else if (hash[5] == 14 && hash[14] == 111)
                return SO_EMULE;
        else
                return SO_UNKNOWN;
}


should be :

int GetHashType(const uchar* hash)
{
        if (hash[5] == 13 && hash[14] == 110)
                return SO_OLDEMULE;
        else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
        {
                if (hash[5] == 0x0E && hash[14] == 0x6F) 
                       return SO_MLDONKEY;
                else
                       return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
// Spike2 - Enhanced Client Recognition v2 - END
        }
        else if (hash[5] == 14 && hash[14] == 111)
                return SO_EMULE;
        else
                return SO_UNKNOWN;
}

P2P is about sharing, ed2k is my choice !
0

#3 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 14 September 2009 - 07:35 AM

Why taz!? If hash[5]=='M' then it can NEVER be 0x0E! Same goes for hash[14]...
Though! Spike you could simply return SO_MLDONKEY in both cases ;)
0

#4 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 14 September 2009 - 08:40 AM

View PosttHeWiZaRdOfDoS, on 14 September 2009 - 10:35 AM, said:

Why taz!? If hash[5]=='M' then it can NEVER be 0x0E! Same goes for hash[14]...
Though! Spike you could simply return SO_MLDONKEY in both cases ;)


This is original posted code :

        else if (hash[5] == 0x0E && hash[14] == 0x6F)
                return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
        else if (hash[5] == 14 && hash[14] == 111)


This is same condition ...

... but then you're right hash[5] (as well as hash[14]) holds a single value at any given time.
P2P is about sharing, ed2k is my choice !
0

#5 User is offline   SundawnerAvS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 30-April 08

Posted 14 September 2009 - 09:53 AM

Why not ?
// Sundawner --> 
			case SO_MLDONKEY:
 			case SO_MLDONKEY2: 
			case SO_MLDONKEY3: 
				{ 	
	                        m_clientSoft = SO_MLDONKEY; 	
				pszSoftware = _T("MLdonkey");    
                                break; 		
	                        } 	
			case SO_EDONKEYHYBRID:
				{
					m_clientSoft = SO_EDONKEYHYBRID;
					pszSoftware = _T("eDonkeyHybrid");
					break;
				}
			case SO_SHAREAZA_PLUS:
				{
					m_clientSoft = SO_SHAREAZA_PLUS;
					pszSoftware = _T("Shareaza Plus");
					break;
				}
			default:

				if (m_bIsML)
				{
					m_clientSoft = SO_MLDONKEY;
					pszSoftware = _T("MLdonkey");
				}

				else if (m_bIsHybrid)
				{

					m_clientSoft = SO_EDONKEYHYBRID;
					pszSoftware = _T("eDonkeyHybrid");
				}
	

// Sundawner <--

Posted Image
0

#6 User is offline   Famerlor 

  • also known as Spike2
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 685
  • Joined: 16-October 04

Posted 14 September 2009 - 10:11 PM

View PosttHeWiZaRdOfDoS, on 14 September 2009 - 09:35 AM, said:

Why taz!? If hash[5]=='M' then it can NEVER be 0x0E! Same goes for hash[14]...
Though! Spike you could simply return SO_MLDONKEY in both cases ;)

@taz: WiZ is right, the code is correct now in the way it is.
@WiZ: Of course I could return SO_MLDONKEY in both cases, but I left this in for people who want to use OfFixed as base for a mod. For some mod-functions it may become useful to distinguish between old MLdonkeys and newer one. For emulations it is explicitly needed for proper hash-fake, since SO_OLD_MLDONKEY means "ML"-hash-type where SO_MLDONKEY describes the one with the newer "0x0E/0x6F"-hash-type).

@Sundawner: Well, the parts with MLdonkey and eDonkeyHybrid in your code-variant have better readability than mine, so that's a nice & valid change - but I wanted to keep it as much as possible at the original code, and so your variant would mean a more rescribed variant of the code while I just took original lines and added some triggers for the "if" with the ||-operator, so that merging is easier ;)

What is "Shareaza Plus" and what is their client-ID ? Never heard of them... (Original 'raza has ID 4, ID 28 is/were AFAIK some dev-versions and 40 are some modded 'razas....is client ID 68 the 'razaPlus ? (with my snippet still recognized just as "Shareaza").

Please note that SO_SHAREAZA, SO_LPHANT, SO_EMULEPLUS, SO_HYDRANODE and SO_TRUSTYFILES are missing in your snippet. But I'd keep the SO_XMULE support from official eMule for unknown clients ("eMule Compat") and the other eMule-Plus detection is needed for older variants of e+.
Posted Image

You want a light mod with source-dropping, Powershare and WiZaRd's ClientAnalyzer ?
Try Spike2-Mod !

You rather want to stick to official eMule but don't want to miss all the new fixes and optimizations from the mods ?
Try OfFixed-Mod !


This post has been edited 1 time, the last time by God: Tomorrow, 12:74 PM
0

#7 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 15 September 2009 - 05:04 AM

It might be I'm blind, however if not then :

int GetHashType(const uchar* hash)
{
        if (hash[5] == 13 && hash[14] == 110)
                return SO_OLDEMULE;
        else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
                return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
        else if (hash[5] == 0x0E && hash[14] == 0x6F) 
                return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
        else if (hash[5] == 14 && hash[14] == 111)
                return SO_EMULE;
        else
                return SO_UNKNOWN;
}


return SO_EMULE is unreachable code (0x0E == 14 and 0x6F == 111 thus if SO_MLDONKEY is not returned there's no way SO_EMULE will).
P2P is about sharing, ed2k is my choice !
0

#8 User is offline   SundawnerAvS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 30-April 08

Posted 15 September 2009 - 05:18 AM

In Baseclient i use this code:
	if (m_bEmuleProtocol || iHashType == SO_EMULE)
	{
		LPCTSTR pszSoftware;
		switch(m_byCompatibleClient)
		{
			case SO_CDONKEY:
				m_clientSoft = SO_CDONKEY;
				pszSoftware = _T("cDonkey");
				break;
			case SO_XMULE:
				m_clientSoft = SO_XMULE;
				pszSoftware = _T("xMule");
				break;
			case SO_AMULE:
				m_clientSoft = SO_AMULE;
				pszSoftware = _T("aMule");
				break;
			case SO_SHAREAZA:
			// ==> Enhanced Client Recognition [Spike]
			case SO_SHAREAZA2:
			case SO_SHAREAZA3:
			case SO_SHAREAZA4:
			// <== Enhanced Client Recognition [Spike]
				m_clientSoft = SO_SHAREAZA;
				pszSoftware = _T("Shareaza");
				break;
			case SO_LPHANT:
				m_clientSoft = SO_LPHANT;
				pszSoftware = _T("lphant");
				break;
			// ==> Enhanced Client Recognition [Spike]
			case SO_EMULEPLUS:
				m_clientSoft = SO_EMULEPLUS;
				pszSoftware = _T("eMule Plus");
				break;
			case SO_HYDRANODE:
				m_clientSoft = SO_HYDRANODE;
				pszSoftware = _T("Hydranode");
				break;
			case SO_TRUSTYFILES:
				m_clientSoft = SO_TRUSTYFILES;
				pszSoftware = _T("TrustyFiles");
				break;
			// <== Enhanced Client Recognition [Spike]
			// Sundawner -->
			case SO_MLDONKEY:
			case SO_MLDONKEY2:
			case SO_MLDONKEY3:
				{
					m_clientSoft = SO_MLDONKEY;
					pszSoftware = _T("MLdonkey");
                                        break;
				}
			// Sundawner <--
			case SO_EDONKEYHYBRID:
				{
					m_clientSoft = SO_EDONKEYHYBRID;
					pszSoftware = _T("eDonkeyHybrid");
					break;
				}
			case SO_SHAREAZA_PLUS:
				{
					m_clientSoft = SO_SHAREAZA_PLUS;
					pszSoftware = _T("Shareaza Plus");
					break;
				}


			default:

				if (m_bIsML)
				{
					m_clientSoft = SO_MLDONKEY;
					pszSoftware = _T("MLdonkey");
				}

				else if (m_bIsHybrid)
				{

					m_clientSoft = SO_EDONKEYHYBRID;
					pszSoftware = _T("eDonkeyHybrid");
				}
				else if (m_byCompatibleClient != 0)
				{
					if (StrStrI(m_pszUsername,_T("shareaza")))
					{
						m_clientSoft = SO_SHAREAZA;
						pszSoftware = _T("Shareaza");
					}
					else if (StrStr(m_strModVersion,_T("Plus 1")))
					{
						m_clientSoft = SO_EMULEPLUS;
						pszSoftware = _T("eMule Plus");
					}
					else
					{
					m_clientSoft = SO_XMULE; // means: 'eMule Compatible'
					pszSoftware =  _T("eMule/c (%i)%i&i"), m_byCompatibleClient,
					( ( m_byEmuleVersion >> 17 ) & 0x7F ), ( ( m_byEmuleVersion >> 10 ) & 0x7F );
		        	}

				}
				else{
					m_clientSoft = SO_EMULE;
					pszSoftware = _T("eMule");
				}
		}



and Clientstate code
enum EClientSoftware{
	SO_EMULE			= 0,	// default
	SO_CDONKEY			= 1,	// ET_COMPATIBLECLIENT
	SO_XMULE			= 2,	// ET_COMPATIBLECLIENT
	SO_AMULE			= 3,	// ET_COMPATIBLECLIENT
	SO_SHAREAZA			= 4,	// ET_COMPATIBLECLIENT
	// ==> Enhanced Client Recognition [Spike]
	SO_EMULEPLUS			= 5,
	SO_HYDRANODE			= 6,
	// <== Enhanced Client Recognition [Spike]
	SO_MLDONKEY			= 10,	// ET_COMPATIBLECLIENT
	SO_LPHANT			= 20,	// ET_COMPATIBLECLIENT
	// ==> Enhanced Client Recognition [Spike]
	SO_SHAREAZA2			= 28,
	SO_TRUSTYFILES			= 30,
	SO_SHAREAZA3			= 40,
	// <== Enhanced Client Recognition [Spike]
	// other client types which are not identified with ET_COMPATIBLECLIENT
	SO_EDONKEYHYBRID	= 50,
	// ==> Enhanced Client Recognition [Spike] 
	SO_EDONKEY			= 51,
	SO_MLDONKEY2		= 52,
	SO_OLDEMULE			= 53,
        SO_TEST = 54, // Lex: added
        SO_IMP = 60,  // Lex: added
	SO_SHAREAZA4		= 68,
        ET_TEST2 = 74 ,
	SO_MLDONKEY3		= 152,
 	SO_SHAREAZA_PLUS = 203,	// ShareazaPlus with RazaCB core
        SO_VERYCD = 240,
	SO_OLD_MLDONKEY,
	// <== Enhanced Client Recognition [Spike] 
	SO_URL,
	SO_UNKNOWN

Posted Image
0

#9 User is offline   Famerlor 

  • also known as Spike2
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 685
  • Joined: 16-October 04

Posted 15 September 2009 - 07:11 AM

View Posttaz-me, on 15 September 2009 - 07:04 AM, said:

It might be I'm blind, however if not then :

Perhaps...because you obviously either didn't read WiZ' post or you didn't understood it...

int GetHashType(const uchar* hash)
{
        if (hash[5] == 13 && hash[14] == 110)
                return SO_OLDEMULE;
        else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
                return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
        else if (hash[5] == 0x0E && hash[14] == 0x6F) 
                return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
        else if (hash[5] == 14 && hash[14] == 111)
                return SO_EMULE;
        else
                return SO_UNKNOWN;
}

Quote

return SO_EMULE is unreachable code (0x0E == 14 and 0x6F == 111 thus if SO_MLDONKEY is not returned there's no way SO_EMULE will).

NOPE, it is NOT unreachable code and absolutely correct the way it is now !!!

Look at it: If position 5 of the hash holds the value 0x0E AND pos. 14 of the hash holds 0x6F THEN return SO_MLDONKEY.
If pos. 5 of the hash holds value 14 and pos. 14 value 111 instead, then SO_EMULE is returned.

It's not unreachable code, 'cause 0x0E != 14 and 0x6F != 111. Furthermore if it was, VC would return an unreachable code warning and if it was I (using this code) would only have MLdonkeys in my lists !!


And, taz, I don't want to be rude, but this is not the first time you're posting invalid fixes:
In germany a popular comedian named Dieter Nuhr once said "Wenn man keine Ahnung hat, einfach mal die Fresse halten" which translates to "If you have really no clue, then just STFU."
This is not meant to be rude (here it is some kind of ironic phrase), but I would really ask you NOT to make other peoples code look bad by declaring it bugged or invalid in bold red font if it is NOT and you just didn't understood the code.
And yes - I'm really pissed now, because I'd never declare other peoples code bugged in public if I wasn't really sure (and if would then FOR SURE not bold red...)



View PostSundawnerAvS, on 15 September 2009 - 07:18 AM, said:

In Baseclient i use this code:
				else if (m_byCompatibleClient != 0)
				{
					if (StrStrI(m_pszUsername,_T("shareaza")))
					{
						m_clientSoft = SO_SHAREAZA;
						pszSoftware = _T("Shareaza");
					}

This is highly unreliable and was therefore dropped in ECR v2 code by me. The other identification techniques for 'raza should be sufficient.

Quote

        SO_TEST = 54, // Lex: added
        SO_IMP = 60,  // Lex: added
...
        ET_TEST2 = 74 ,
...
 	SO_SHAREAZA_PLUS = 203,	// ShareazaPlus with RazaCB core

What are these ? Never heard of any clients with IDs 54, 60 or 74, that's why I'm asking. And what is Shareaza Plus ?!? Never heard of it either. Could you ellaborate a bit more on these ?


Quote

        SO_VERYCD = 240,

Why are they using a different clientID ? I think they should be returned as SO_EMULE since VeryCD is still just a mod. Perhaps we could return them as SO_EMULE and automatically attach the VeryCD modstring to them (oh, I wished the o-devs would just clearly forbid messing with the clientID / hash identification for eMule mods...).

EDIT: Just saw: There are only very few "VeryCDs" identifying with ID 240, most of them correctly identiy as SO_EMULE. Are you sure these are legit VeryCD-mods and not just some kind of weird re-mod of the original veryCD-mod ?


Greetz --


//Spike2

This post has been edited by Famerlor: 15 September 2009 - 07:15 AM

Posted Image

You want a light mod with source-dropping, Powershare and WiZaRd's ClientAnalyzer ?
Try Spike2-Mod !

You rather want to stick to official eMule but don't want to miss all the new fixes and optimizations from the mods ?
Try OfFixed-Mod !


This post has been edited 1 time, the last time by God: Tomorrow, 12:74 PM
0

#10 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 15 September 2009 - 07:19 AM

View PostFamerlor, on 15 September 2009 - 09:11 AM, said:

Perhaps...because you obviously either didn't read WiZ' post or you didn't understood it...

int GetHashType(const uchar* hash)
{
        if (hash[5] == 13 && hash[14] == 110)
                return SO_OLDEMULE;
        else if (hash[5] == 'M' && hash[14] == 'L')
// Spike2 - Enhanced Client Recognition v2- START
// Thanx to WiZaRd for this one
                return SO_OLD_MLDONKEY; // was: SO_MLDONKEY
        else if (hash[5] == 0x0E && hash[14] == 0x6F) 
                return SO_MLDONKEY;
// Spike2 - Enhanced Client Recognition v2 - END
        else if (hash[5] == 14 && hash[14] == 111)
                return SO_EMULE;
        else
                return SO_UNKNOWN;
}

Quote

return SO_EMULE is unreachable code (0x0E == 14 and 0x6F == 111 thus if SO_MLDONKEY is not returned there's no way SO_EMULE will).

NOPE, it is NOT unreachable code and absolutely correct the way it is now !!!

Look at it: If position 5 of the hash holds the value 0x0E AND pos. 14 of the hash holds 0x6F THEN return SO_MLDONKEY.
If pos. 5 of the hash holds value 14 and pos. 14 value 111 instead, then SO_EMULE is returned.

It's not unreachable code, 'cause 0x0E != 14 and 0x6F != 111. Furthermore if it was, VC would return an unreachable code warning and if it was I (using this code) would only have MLdonkeys in my lists !!

Sorry to correct you, Spike, but taz is right here and that's the reason I removed that code quite some time ago (e.g. in the new TS).
0x0E == 14 and 0x6F == 111 - if you don't believe it, grab an ASCII table or use the windows calculator (run --> calc).
Using your code, you will return SO_MLDONKEY for all clients using the default eMule hash.
The unreachable code will be

Quote

else if (hash[5] == 14 && hash[14] == 111)
return SO_EMULE;

But V$ isn#t smart enough to detect that situation as "unreachable".
0

#11 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 15 September 2009 - 08:40 AM

@Spike2 : I'm truly sorry :cry: if I made you pissed - you're among the ones I consider friends. I was pretty sure about this and already pointed this out in this thread ( http://forum.emule-p...dpost&p=1031577 ) as well as on other threads ...

This was why I tried to soften the message (via pointing my sight as a possible reason for the failure).

(BTW: the same condition check was what got me confused and suggest the faulty code fix - since I neglected the content of the secondary check, which was pure stupidity as pointed out by WiZ).
P2P is about sharing, ed2k is my choice !
0

#12 User is offline   Famerlor 

  • also known as Spike2
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 685
  • Joined: 16-October 04

Posted 15 September 2009 - 08:54 AM

View PosttHeWiZaRdOfDoS, on 15 September 2009 - 09:19 AM, said:

Sorry to correct you, Spike, but taz is right here and that's the reason I removed that code quite some time ago (e.g. in the new TS).
0x0E == 14 and 0x6F == 111 - if you don't believe it, grab an ASCII table or use the windows calculator (run --> calc).
Using your code, you will return SO_MLDONKEY for all clients using the default eMule hash.

I did so quite some time ago and I know that, but for some reason in VS 0x0E is even not exactly the same as 14 (same goes for 0x6F) - the code works, otherwise my queue would be full of MLdonkeys, but the recognizing works the way it does !
Though I can't explain why, the code is working as intended the way it is (and torni was right, he came up with 0x0E and 0x6F)...


View Posttaz-me, on 15 September 2009 - 10:40 AM, said:

@Spike2 : I'm truly sorry :cry: if I made you pissed - you're among the ones I consider friends.

Same goes out for you from my side and I honestly apologize if I was too harsh, but I was a bit unnerved and tired when I wrote it. I was pissed in the situation, but I'm the kind of person which is only VERY seldom pissed longer than 10 minutes *g* But as pointed out above Dieter Nuhr's saying is pure irony and often used in friendly contexts (at least that's the way me and the people I know use it). :flowers: :flowers: Let's just forget it ;)


And your first fix from zBoom was very valid and got implemented in current ECR-system.


Perhaps we can find out together, what's up with that weird 0xsth.-issue ;) ?


Greetz--



//Spike2
Posted Image

You want a light mod with source-dropping, Powershare and WiZaRd's ClientAnalyzer ?
Try Spike2-Mod !

You rather want to stick to official eMule but don't want to miss all the new fixes and optimizations from the mods ?
Try OfFixed-Mod !


This post has been edited 1 time, the last time by God: Tomorrow, 12:74 PM
0

#13 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 553
  • Joined: 22-November 04

Posted 15 September 2009 - 08:58 AM

View PostFamerlor, on 15 September 2009 - 03:11 PM, said:

Quote

        SO_VERYCD = 240,

Why are they using a different clientID ? I think they should be returned as SO_EMULE since VeryCD is still just a mod. Perhaps we could return them as SO_EMULE and automatically attach the VeryCD modstring to them (oh, I wished the o-devs would just clearly forbid messing with the clientID / hash identification for eMule mods...).

EDIT: Just saw: There are only very few "VeryCDs" identifying with ID 240, most of them correctly identiy as SO_EMULE. Are you sure these are legit VeryCD-mods and not just some kind of weird re-mod of the original veryCD-mod ?


These new ID of VeryCDs may belong to their new developed (still in developing, beta stage now though) easyMule2 series which possess multi-platform support. Some people consider it as a mod of aMule but never been confirmed by VeryCD guys.
0

#14 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 15 September 2009 - 09:00 AM

There is no "weird issue", the code still works because of that one:

Quote

if (m_bEmuleProtocol || iHashType == SO_EMULE)

and

Quote

switch(m_byCompatibleClient)

You see, it'll work even if the hashtype is different and after that, we switch by the compatclient flag.
Trace the code and you'll notice that

Quote

if (m_bIsML || iHashType == SO_MLDONKEY || iHashType == SO_OLD_MLDONKEY){

is never reached for SO_EMULE clients or SO_MLDONKEY clients IF they properly identify as SO_EMULE otherwise.
0

#15 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5804
  • Joined: 07-April 04

Posted 15 September 2009 - 09:07 AM

i kinda thought it would be something like that but appareently you were quicker. :)
I am an emule-web.de member and fan!

[Imagine there was a sarcasm meter right here!]

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#16 User is offline   Famerlor 

  • also known as Spike2
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 685
  • Joined: 16-October 04

Posted 15 September 2009 - 09:49 AM

View PostEnig123, on 15 September 2009 - 10:58 AM, said:

Some people consider it as a mod of aMule but never been confirmed by VeryCD guys.

Should be easy to find out, once the source is available.

slightly OT:
But if it's not a really new coded client (which I can't really imagine) it should IMO use the ID of the codebase (eMule or aMule) + Modstring. I don't think that it's senseful to mess with the ClientID... and veryCD wasn't always known for perfect rule compliance so that's eventually just a tactic to hide in order to avoid being banned ;)



About 0x0E:
Sorry taz, it's becoming obvious you were right and the "Dieter Nuhr of the day" goes to me ;)

So torni was either wrong or was testing me or making fun of me :)
Okay, let's kick this code-part. Changed snippet will be posted when I slept a bit *tiiiiiiiiired*


Greetz---


//Spike2

This post has been edited by Famerlor: 15 September 2009 - 09:51 AM

Posted Image

You want a light mod with source-dropping, Powershare and WiZaRd's ClientAnalyzer ?
Try Spike2-Mod !

You rather want to stick to official eMule but don't want to miss all the new fixes and optimizations from the mods ?
Try OfFixed-Mod !


This post has been edited 1 time, the last time by God: Tomorrow, 12:74 PM
0

#17 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5804
  • Joined: 07-April 04

Posted 15 September 2009 - 10:25 AM

OT: the thing is that VCD is at least saying they did it all by themselves and keep their sources closed. this might be a license violation...
I am an emule-web.de member and fan!

[Imagine there was a sarcasm meter right here!]

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#18 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 15 September 2009 - 11:55 AM

I haven't gone through the entire code however if hash type issue is applied as WiZ suggested (i.e. SO_MLDONKEY replaced by SO_OLD_MLDONKEY)

then trivial optimization of removing non relevant checks for hash type SO_MLDONKEY such as

void CUpDownClient::InitClientSoftwareVersion()
{
...
// Spike2 - Enhanced Client Recognition v2 - START (Thanx to WiZaRd for this one !)
        if (m_bIsML || iHashType == SO_MLDONKEY || iHashType == SO_OLD_MLDONKEY){
// Spike2 - Enhanced Client Recognition v2 - END
...
}


should be applied.


minor : "bad Shareaza" should be counted at stats as eMule.
===================================================================================

Off topic (somehow related) : it might be worth checking not to emulate Shareaza if we encounter a leecher of "bad Shareaza" type (on mods which won't ban it ...)

This post has been edited by taz-me: 15 September 2009 - 11:59 AM

P2P is about sharing, ed2k is my choice !
0

#19 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5804
  • Joined: 07-April 04

Posted 15 September 2009 - 01:08 PM

dude, simply removing SO_OLD_MLDONKEY is what wiz suggested and there is no need for any "optimization". you should quit to aim for "optimization" if all you manage is change code readability or spare one tiny check which costs close to no CPU time... nobody in his right mind is going to increase his car surface so it will use 0.001l of fuel less per hundred kilometers.
I am an emule-web.de member and fan!

[Imagine there was a sarcasm meter right here!]

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#20 User is offline   taz-me 

  • I'm taz (a modder)
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 587
  • Joined: 07-December 06

Posted 15 September 2009 - 03:55 PM

View PostStulle, on 15 September 2009 - 04:08 PM, said:

dude, simply removing SO_OLD_MLDONKEY is what wiz suggested


dude just read before responding : WiZ suggested (compared to official code) replacing SO_MLDONKEY with SO_OLD_MLDONKEY in GetHashType ...

Quote

and there is no need for any "optimization". you should quit to aim for "optimization" if all you manage is change code readability or spare one tiny check which costs close to no CPU time... nobody in his right mind is going to increase his car surface so it will use 0.001l of fuel less per hundred kilometers.


... and thus with a function not returning a certain value - there's no point checking for it, besides at least the line I quoted already contains a change compared with official (the additional compare of hash with SO_OLD_MLDONKEY) :

it might (just might) be worth not to add comparing with SO_OLD_MLDONKEY replacing the existing compare of SO_MLDONKEY with SO_OLD_MLDONKEY (for "some reason" it seems to be aligned with the code change within GetHashType).
P2P is about sharing, ed2k is my choice !
0

  • Member Options

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users