⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 verycd.patch

📁 非常难得的eMule(电骡) V0.45b 源码下载 值得研究
💻 PATCH
📖 第 1 页 / 共 2 页
字号:
diff -Nur srchybrid45a/ArchiveRecovery.cpp srchybrid45a_VeryCD/ArchiveRecovery.cpp
--- srchybrid45a/ArchiveRecovery.cpp	2004-12-26 22:05:50.000000000 +0800
+++ srchybrid45a_VeryCD/ArchiveRecovery.cpp	2005-02-07 17:09:58.759264800 +0800
@@ -166,9 +166,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 	return success;
 }
 
@@ -314,9 +316,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 
 	// Tell the user how many files were recovered
 	CString msg;	
@@ -400,9 +404,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 	return retVal;
 }
 
@@ -551,9 +557,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 	return retVal;
 }
 
@@ -613,9 +621,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 
 	return retVal;
 }
@@ -651,9 +661,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 
 	// Tell the user how many files were recovered
 	CString msg;	
@@ -733,9 +745,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 	return false;
 }
 
@@ -843,9 +857,11 @@
 	catch (CFileException* error){
 		error->Delete();
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 	}
+#endif
 	return false;
 }
 
@@ -929,12 +945,20 @@
 	}
 	catch (CFileException* error){
 		error->Delete();
-		try { output->SetLength(offsetStart); } catch (...) {ASSERT(0);}
+#ifndef _DEBUG
+		try
+#endif
+		{ output->SetLength(offsetStart); }
+#ifndef _DEBUG
+		catch (...) {ASSERT(0);}
+#endif
 	}
+#ifndef _DEBUG
 	catch (...){
 		ASSERT(0);
 		try { output->SetLength(offsetStart); } catch (...) {ASSERT(0);}
 	}
+#endif
 }
 
 uint16 CArchiveRecovery::readUInt16(CFile *input)
@@ -958,20 +982,30 @@
 uint16 CArchiveRecovery::calcUInt16(BYTE *input)
 {
 	uint16 retVal = 0;
+#ifndef _DEBUG
 	try
+#endif
 	{
 		retVal = (((uint16)input[1]) << 8) + ((uint16)input[0]);
-	} catch (...) {ASSERT(0);}
+	}
+#ifndef _DEBUG
+	catch (...) {ASSERT(0);}
+#endif
 	return retVal;
 }
 
 uint32 CArchiveRecovery::calcUInt32(BYTE *input)
 {
 	uint32 retVal = 0;
+#ifndef _DEBUG
 	try
+#endif
 	{
 		retVal = (((uint32)input[3]) << 24) + (((uint32)input[2]) << 16) + (((uint32)input[1]) << 8) + ((uint32)input[0]);
-	} catch (...) {ASSERT(0);}
+	}
+#ifndef _DEBUG
+	catch (...) {ASSERT(0);}
+#endif
 	return retVal;
 }
 
diff -Nur srchybrid45a/AsyncSocketEx.cpp srchybrid45a_VeryCD/AsyncSocketEx.cpp
--- srchybrid45a/AsyncSocketEx.cpp	2004-12-26 22:05:52.000000000 +0800
+++ srchybrid45a_VeryCD/AsyncSocketEx.cpp	2005-02-07 17:09:58.759264800 +0800
@@ -424,6 +424,7 @@
 			return DefWindowProc(hWnd, message, wParam, lParam);
 #ifdef USE_CLIENT_TCP_CATCH_ALL_HANDLER
 		}
+#ifndef _DEBUG
 		catch(CException* e){
 			TCHAR szError[1024];
 			e->GetErrorMessage(szError, ARRSIZE(szError));
@@ -441,6 +442,7 @@
 			ASSERT(0);
 		}
 #endif
+#endif
 		return 0;
 	}
 
@@ -655,7 +657,10 @@
 	BOOL bResult = TRUE;
 	m_sGlobalCriticalSection.Lock();
 
-	try{
+#ifndef _DEBUG
+	try
+#endif
+	{
 	    //Get thread specific data
 	    if (m_spAsyncSocketExThreadDataList)
 	    {
@@ -698,11 +703,13 @@
 		    m_spAsyncSocketExThreadDataList->pThreadData=m_pLocalAsyncSocketExThreadData;
 	    }
 	}
+#ifndef _DEBUG
 	catch(...){
 		TRACE("Unknown exception in CAsyncSocketEx::InitAsyncSocketExInstance()\n");
 		ASSERT(0);
 		bResult = FALSE;
 	}
+#endif
 
 	m_sGlobalCriticalSection.Unlock();
 
@@ -718,7 +725,10 @@
 	DWORD id=m_pLocalAsyncSocketExThreadData->nThreadId;
 	m_sGlobalCriticalSection.Lock();
 
-	try{
+#ifndef _DEBUG
+	try
+#endif
+	{
 	    ASSERT(m_spAsyncSocketExThreadDataList);
 	    t_AsyncSocketExThreadDataList *pList=m_spAsyncSocketExThreadDataList;
 	    t_AsyncSocketExThreadDataList *pPrev=0;
@@ -755,10 +765,12 @@
 		    ASSERT(pList);
 	    }
 	}
+#ifndef _DEBUG
 	catch(...){
 		TRACE("Unknown exception in CAsyncSocketEx::FreeAsyncSocketExInstance()\n");
 		ASSERT(0);
 	}
+#endif
 
 	m_sGlobalCriticalSection.Unlock();
 }
diff -Nur srchybrid45a/BaseClient.cpp srchybrid45a_VeryCD/BaseClient.cpp
--- srchybrid45a/BaseClient.cpp	2005-01-24 19:47:52.000000000 +0800
+++ srchybrid45a_VeryCD/BaseClient.cpp	2005-02-07 17:09:58.774889800 +0800
@@ -60,6 +60,8 @@
 #include "shahashset.h"
 #include "Log.h"
 
+#include "IP2Country.h" //EastShare - added by AndCycle, IP to Country
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #undef THIS_FILE
@@ -67,6 +69,46 @@
 #endif
 
 
+//EastShare Start - added by AndCycle, IP to Country
+// Superlexx - client's location
+CString	CUpDownClient::GetCountryName(bool longName) const {
+
+	//display in client detail
+	if(longName && theApp.ip2country->IsIP2Country() == false)	return GetResString(IDS_DISABLED);
+
+	if(theApp.ip2country->IsIP2Country() == false) return _T("");
+
+	if(longName) return m_structUserCountry->LongCountryName;
+
+	CString tempStr;
+
+	switch(thePrefs.GetIP2CountryNameMode()){
+		case IP2CountryName_SHORT:
+// EastShare - Modified by Pretender
+//			tempStr.Format("<%s>",m_structUserCountry->ShortCountryName);
+			tempStr.Format(_T("%s: "),m_structUserCountry->ShortCountryName);
+			return tempStr;
+		case IP2CountryName_MID:
+//			tempStr.Format("<%s>",m_structUserCountry->MidCountryName);
+			tempStr.Format(_T("%s: "),m_structUserCountry->MidCountryName);
+			return tempStr;
+		case IP2CountryName_LONG:
+//			tempStr.Format("<%s>",m_structUserCountry->LongCountryName);
+			tempStr.Format(_T("%s: "),m_structUserCountry->LongCountryName);
+			return tempStr;
+// EastShare - Modified by Pretender
+	}
+	return _T("");
+}
+
+int CUpDownClient::GetCountryFlagIndex() const {
+	return m_structUserCountry->FlagIndex;
+}
+void CUpDownClient::ResetIP2Country(){
+	m_structUserCountry = theApp.ip2country->GetCountryFromIP(m_dwUserIP);
+}
+//EastShare End - added by AndCycle, IP to Country
+
 IMPLEMENT_DYNAMIC(CClientException, CException)
 IMPLEMENT_DYNAMIC(CUpDownClient, CObject)
 
@@ -104,6 +146,8 @@
 
 void CUpDownClient::Init()
 {
+	m_structUserCountry = theApp.ip2country->GetDefaultIP2Country(); //EastShare - added by AndCycle, IP to Country
+
 	credits = 0;
 	m_nSumForAvgUpDataRate = 0;
 	m_bAddNextConnect = false;
@@ -175,6 +219,11 @@
 		int nSockAddrLen = sizeof(sockAddr);
 		socket->GetPeerName((SOCKADDR*)&sockAddr, &nSockAddrLen);
 		SetIP(sockAddr.sin_addr.S_un.S_addr);
+		//EastShare Start - added by AndCycle, IP to Country
+		if(m_nConnectIP != m_dwUserIP){
+			m_structUserCountry = theApp.ip2country->GetCountryFromIP(m_dwUserIP);
+			}
+		//EastShare End - added by AndCycle, IP to Country
 	}
 	else{
 		SetIP(0);
@@ -528,6 +577,14 @@
 	socket->GetPeerName((SOCKADDR*)&sockAddr, &nSockAddrLen);
 	SetIP(sockAddr.sin_addr.S_un.S_addr);
 
+	//EastShare Start - added by AndCycle, IP to Country
+	if(theApp.ip2country->IsIP2Country()){
+		 // Superlexx
+		if (m_structUserCountry == theApp.ip2country->GetDefaultIP2Country()){
+			m_structUserCountry = theApp.ip2country->GetCountryFromIP(m_dwUserIP);
+		}
+	}
+	//EastShare End - added by AndCycle, IP to Country
 	if (thePrefs.AddServersFromClient() && m_dwServerIP && m_nServerPort){
 		CServer* addsrv = new CServer(m_nServerPort, ipstr(m_dwServerIP));
 		addsrv->SetListName(addsrv->GetAddress());
@@ -572,7 +629,7 @@
 	CString strBuffer = m_pszUsername;
 	strBuffer.MakeUpper();
 	strBuffer.Remove(_T(' '));
-	if (strBuffer.Find(_T("EMULE-CLIENT")) != -1 || strBuffer.Find(_T("POWERMULE")) != -1 ){
+	if (strBuffer.Find(_T("EMULE-CLIENT")) != -1 || strBuffer.Find(_T("POWERMULE")) != -1 || strBuffer.Find(_T("EMULE.COM.CN")) != -1 || strBuffer.Find(_T("MIPHONE")) != -1){	//VeryCD 谁不乖?
 		m_bGPLEvildoer = true;  
 	}
 
@@ -2019,7 +2076,10 @@
 	}
 
 	BYTE* pBuffer = NULL;
-	try{
+#ifndef _DEBUG
+	try
+#endif
+	{
 		for (int i = 0; i != nCount; i++){
 			uint32 nImgSize = data.ReadUInt32();
 			if (nImgSize > nSize)
@@ -2034,11 +2094,13 @@
 			}
 		}
 	}
+#ifndef _DEBUG
 	catch(...){
 		if (pBuffer != NULL)
 			delete[] pBuffer;
 		throw;
 	}
+#endif
 	(new PreviewDlg())->SetFile(sfile);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -