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

📄 verycd.patch

📁 电驴的源代码
💻 PATCH
📖 第 1 页 / 共 2 页
字号:
+		cur_client = theApp.clientlist->list.GetAt(pos); 
+		cur_client->ResetIP2Country();
+	}
+
+}
+//EastShare End - added by AndCycle, IP to Country
+
 // ZZ:DownloadManager -->
 void CClientList::ProcessA4AFClients() {
     //if(thePrefs.GetLogA4AF()) AddDebugLogLine(false, _T(">>> Starting A4AF check"));
diff -Nur srchybrid44a/ClientList.h srchybrid44a_VeryCD/ClientList.h
--- srchybrid44a/ClientList.h	2004-08-25 23:54:08.000000000 +0800
+++ srchybrid44a_VeryCD/ClientList.h	2004-09-08 21:24:46.156250000 +0800
@@ -24,6 +24,7 @@
 	class CContact;
 	class CUInt128;
 };
+
 typedef CTypedPtrList<CPtrList, CUpDownClient*> CUpDownClientPtrList;
 
 #define BAN_CLEANUP_TIME	1200000 // 20 min
@@ -121,4 +122,9 @@
 	CUpDownClientPtrList KadList;
 	CCriticalSection m_RequestTCPLock;
 	CUpDownClient* m_pBuddy;
+//EastShare Start - added by AndCycle, IP to Country
+public:
+	void ResetIP2Country();
+//EastShare End - added by AndCycle, IP to Country
+
 };
diff -Nur srchybrid44a/ClientListCtrl.cpp srchybrid44a_VeryCD/ClientListCtrl.cpp
--- srchybrid44a/ClientListCtrl.cpp	2004-08-26 13:58:52.000000000 +0800
+++ srchybrid44a_VeryCD/ClientListCtrl.cpp	2004-09-08 21:42:50.734375000 +0800
@@ -32,6 +32,7 @@
 #include "ChatWnd.h"
 #include "Kademlia/Kademlia/Kademlia.h"
 #include "Kademlia/net/KademliaUDPListener.h"
+#include "IP2Country.h" //EastShare - added by AndCycle, IP to Country
 
 #ifdef _DEBUG
 #undef THIS_FILE
@@ -283,9 +284,30 @@
 						Sbuffer.Format(_T("(%s)"), GetResString(IDS_UNKNOWN));
 					else
 						Sbuffer = client->GetUserName();
+
+					//EastShare Start - added by AndCycle, IP to Country
+					CString tempStr;
+						tempStr.Format("%s%s", client->GetCountryName(), Sbuffer);
+					Sbuffer = tempStr;
+
+					if(theApp.ip2country->ShowCountryFlag()){
+							cur_rec.left+=20;
+							POINT point2= {cur_rec.left,cur_rec.top+1};
+						int index = client->GetCountryFlagIndex();
+						theApp.ip2country->GetFlagImageList()->DrawIndirect(dc, index , point2, CSize(18,16), CPoint(0,0), ILD_NORMAL);
+					}
+					//EastShare End - added by AndCycle, IP to Country
+
 					cur_rec.left +=20;
 					dc->DrawText(Sbuffer,Sbuffer.GetLength(),&cur_rec,DLC_DT_TEXT);
 					cur_rec.left -=20;
+
+					//EastShare Start - added by AndCycle, IP to Country
+					if(theApp.ip2country->ShowCountryFlag()){
+						cur_rec.left-=20;
+					}
+					//EastShare End - added by AndCycle, IP to Country
+
 					break;
 				}
 				case 1:{
@@ -385,12 +407,19 @@
 	ClientMenu.AppendMenu(MF_STRING | ((client && client->IsEd2kClient() && client->GetViewSharedFilesSupport()) ? MF_ENABLED : MF_GRAYED), MP_SHOWLIST, GetResString(IDS_VIEWFILES));
 	if (Kademlia::CKademlia::isRunning() && !Kademlia::CKademlia::isConnected())
 		ClientMenu.AppendMenu(MF_STRING | ((client && client->IsEd2kClient() && client->GetKadPort()!=0) ? MF_ENABLED : MF_GRAYED), MP_BOOT, GetResString(IDS_BOOTSTRAP));
+
+	ClientMenu.AppendMenu(MF_STRING,MP_SHOWMPAGE, GetResString(IDS_SHOWMPAGE));	//VeryCD:从VeryCD网站查看用户资料
+	if (!client || !client->GetUserName() || !strstr(client->GetUserName(), "VeryCD:"))
+		ClientMenu.EnableMenuItem(MP_SHOWMPAGE,MF_GRAYED);
+
 	GetPopupMenuPos(*this, point);
 	ClientMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
 }
 
 BOOL CClientListCtrl::OnCommand(WPARAM wParam,LPARAM lParam )
 {
+	//CUpDownClient* client = (CUpDownClient*)GetItemData(GetSelectionMark());
+	
 	int iSel = GetNextItem(-1, LVIS_SELECTED | LVIS_FOCUSED);
 	if (iSel != -1){
 		CUpDownClient* client = (CUpDownClient*)GetItemData(iSel);
@@ -421,6 +450,24 @@
 				if (client->GetKadPort())
 					Kademlia::CKademlia::bootstrap(ntohl(client->GetIP()), client->GetKadPort());
 				break;
+			case MP_SHOWMPAGE:{
+				char *pdest1;
+				char *pdest2;
+				int result;
+				CString Start;
+
+				pdest1 = strstr( client->GetUserName(), "VeryCD:" );
+				if(strstr( pdest1, "]" ))
+				{
+					pdest2 = strstr( pdest1, "]" );
+					result = (int)(pdest2 - pdest1 - 7);
+					Start = pdest1;
+					Start = Start.Mid(7,result);
+					CString temp = "http://www.VeryCD.com/" + Start;
+					ShellOpenFile(temp);
+				}
+				break;
+			}
 		}
 	}
 	return true;
diff -Nur srchybrid44a/ClientUDPSocket.cpp srchybrid44a_VeryCD/ClientUDPSocket.cpp
--- srchybrid44a/ClientUDPSocket.cpp	2004-08-31 18:54:30.000000000 +0800
+++ srchybrid44a_VeryCD/ClientUDPSocket.cpp	2004-09-08 20:55:54.578125000 +0800
@@ -126,8 +126,10 @@
 				case OP_KADEMLIAHEADER:
 				{
 					theStats.AddDownDataOverheadKad(length);
-					if (length >= 2)
+
+					if (length >= 2) {
 						Kademlia::CKademlia::processPacket(buffer, length, ntohl(sockAddr.sin_addr.S_un.S_addr), ntohs(sockAddr.sin_port));
+					}
 					else
 						throw CString(_T("Packet too short"));
 					break;
@@ -494,9 +496,26 @@
 
 	if (thePrefs.GetUDPPort()) {
 		ret=CAsyncSocket::Create(thePrefs.GetUDPPort(),SOCK_DGRAM,FD_READ|FD_WRITE);
-		if (ret)
+		if (ret) {
 			m_port=thePrefs.GetUDPPort();
+ 			if (thePrefs.GetUPnPNat()){
+				CUPnPNat::UPNPNAT_MAPPING mapping;
+
+				mapping.internalPort = mapping.externalPort = thePrefs.GetUDPPort();
+				mapping.protocol = CUPnPNat::UNAT_UDP;
+				mapping.description = "UDP Port";
+				if (theApp.AddUPnPNatPort(&mapping, thePrefs.GetUPnPNatTryRandom()))
+					thePrefs.SetUPnPUDPExternal(mapping.externalPort);
+			}
+			else{
+				thePrefs.SetUPnPUDPExternal(thePrefs.GetUDPPort());
+			}
+			return true;
+		}
+		else
+			return false;
 	}
+	// VeryCD版
 
 	if (ret)
 		m_port=thePrefs.GetUDPPort();
diff -Nur srchybrid44a/DownloadListCtrl.cpp srchybrid44a_VeryCD/DownloadListCtrl.cpp
--- srchybrid44a/DownloadListCtrl.cpp	2004-09-03 01:38:12.000000000 +0800
+++ srchybrid44a_VeryCD/DownloadListCtrl.cpp	2004-09-08 21:42:50.703125000 +0800
@@ -41,6 +41,7 @@
 #include "Preview.h"
 #include "StringConversion.h"
 #include "AddSourceDlg.h"
+#include "IP2Country.h" //EastShare - added by AndCycle, IP to Country
 
 #ifdef _DEBUG
 #undef THIS_FILE
@@ -679,10 +680,25 @@
 					m_ImageList.Draw(dc, 7, point2, ILD_NORMAL | uOvlImg);
 				cur_rec.left += 20;
 
+				//Morph Start - added by AndCycle, IP to Country
+				if(theApp.ip2country->ShowCountryFlag()){
+					POINT point3= {cur_rec.left,cur_rec.top+1};
+					theApp.ip2country->GetFlagImageList()->DrawIndirect(dc, lpUpDownClient->GetCountryFlagIndex(), point3, CSize(18,16), CPoint(0,0), ILD_NORMAL);
+					cur_rec.left+=20;
+				}
+				//Morph End - added by AndCycle, IP to Country
+
 				if (!lpUpDownClient->GetUserName())
 					buffer = "?";
 				else
 					buffer = lpUpDownClient->GetUserName();
+
+				//EastShare Start - added by AndCycle, IP to Country
+				CString tempStr2;
+				tempStr2.Format("%s%s", lpUpDownClient->GetCountryName(), buffer);
+				buffer = tempStr2;
+				//EastShare End - added by AndCycle, IP to Country
+
 				dc->DrawText(buffer,buffer.GetLength(),&cur_rec, DLC_DT_TEXT);
 			}
 			break;
@@ -1327,6 +1343,10 @@
 				if (A4AFMenu.GetMenuItemCount()>0)
 					ClientMenu.AppendMenu(MF_STRING|MF_POPUP,(UINT_PTR)A4AFMenu.m_hMenu, GetResString(IDS_A4AF));
 			}
+			ClientMenu.AppendMenu(MF_STRING,MP_SHOWMPAGE, GetResString(IDS_SHOWMPAGE));	//VeryCD:从VeryCD网站查看用户资料
+			if (!client || !client->GetUserName() || !strstr(client->GetUserName(), "VeryCD:"))
+				ClientMenu.EnableMenuItem(MP_SHOWMPAGE,MF_GRAYED);
+
 
 			GetPopupMenuPos(*this, point);
 			ClientMenu.TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x, point.y, this);
@@ -1634,6 +1654,24 @@
 						thePreviewApps.RunApp(file, wParam);
 					}
 					break;
+				case MP_SHOWMPAGE:
+					CUpDownClient* client = (CUpDownClient*)GetItemData(iSel);
+					char *pdest1;
+					char *pdest2;
+					int result;
+					CString Start;
+
+					pdest1 = strstr( client->GetUserName(), "VeryCD:" );
+					if(strstr( pdest1, "]" ))
+					{
+						pdest2 = strstr( pdest1, "]" );
+						result = (int)(pdest2 - pdest1 - 7);
+						Start = pdest1;
+						Start = Start.Mid(7,result);
+						CString temp = "http://www.VeryCD.com/" + Start;
+						ShellOpenFile(temp);
+					}
+					break;
 			}
 		}
 		else{
diff -Nur srchybrid44a/DownloadQueue.cpp srchybrid44a_VeryCD/DownloadQueue.cpp
--- srchybrid44a/DownloadQueue.cpp	2004-08-31 19:24:10.000000000 +0800
+++ srchybrid44a_VeryCD/DownloadQueue.cpp	2004-09-08 20:59:31.656250000 +0800
@@ -1620,6 +1620,7 @@
 		CheckAndAddSource(temp, ctemp);
 }
 
+
 void CDownloadQueue::ExportPartMetFilesOverview() const
 {
 	CString strFileListPath = thePrefs.GetAppDir() + _T("downloads.txt");
Files srchybrid44a/emule.aps and srchybrid44a_VeryCD/emule.aps differ
diff -Nur srchybrid44a/emule.cpp srchybrid44a_VeryCD/emule.cpp
--- srchybrid44a/emule.cpp	2004-09-03 13:50:22.000000000 +0800
+++ srchybrid44a_VeryCD/emule.cpp	2004-09-08 21:00:05.406250000 +0800
@@ -78,6 +78,8 @@
 #define new DEBUG_NEW
 #endif
 
+#include "IP2Country.h"//EastShare - added by AndCycle, IP to Country
+
 
 ///////////////////////////////////////////////////////////////////////////////
 // MSLU (Microsoft Layer for Unicode) support - UnicoWS
@@ -214,15 +216,14 @@
 	// create a string version (e.g. "0.30a")
 	ASSERT( VERSION_UPDATE + 'a' <= 'f' );
 #ifdef _DEBUG
-	m_strCurVersionLong.Format(_T("%u.%u%c.%u"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE, VERSION_BUILD);
+	m_strCurVersionLong.Format(_T("%u.%u%c.%u VeryCD(Build0722)"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE, VERSION_BUILD);
 #else
-	m_strCurVersionLong.Format(_T("%u.%u%c"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE);
+	m_strCurVersionLong.Format(_T("%u.%u%c VeryCD(Build0722)"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE);
 #endif
 
 #ifdef _DUMP
 	m_strCurVersionLong += _T(" DEBUG");
 #endif
-
 	// create the protocol version number
 	CString strTmp;
 	strTmp.Format(_T("0x%u"), m_dwProductVersionMS);
@@ -434,6 +435,8 @@
 	mmserver = new CMMServer();
 	scheduler = new CScheduler();
 	m_pPeerCache = new CPeerCacheFinder();
+
+	ip2country = new CIP2Country(); //EastShare - added by AndCycle, IP to Country
 	
 	thePerfLog.Startup();
 	dlg.DoModal();
@@ -1148,7 +1151,7 @@
 			else
 			{
 				// WINBUG???: 'ExtractIcon' does not work well on ICO-files when using the color 
-				// scheme 'Windows-Standard (extragro

⌨️ 快捷键说明

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