📄 verycd.patch
字号:
}
@@ -2230,7 +2292,10 @@
CString str;
if (this != NULL)
{
- try{
+#ifndef _DEBUG
+ try
+#endif
+ {
str.Format(
bFormatIP
? _T("%-15s '%s' (%s,%s/%s)")
@@ -2241,9 +2306,11 @@
DbgGetDownloadState(),
DbgGetUploadState());
}
+#ifndef _DEBUG
catch(...){
str.Format(_T("%08x - Invalid client instance"), this);
}
+#endif
}
return str;
}
diff -Nur srchybrid45a/ClientCredits.cpp srchybrid45a_VeryCD/ClientCredits.cpp
--- srchybrid45a/ClientCredits.cpp 2005-01-13 17:10:34.000000000 +0800
+++ srchybrid45a_VeryCD/ClientCredits.cpp 2005-02-07 17:09:58.790514800 +0800
@@ -422,7 +422,10 @@
CreateKeyPair();
// load key
- try{
+#ifndef _DEBUG
+ try
+#endif
+ {
// load private key
FileSource filesource(CStringA(thePrefs.GetConfigDir() + _T("cryptkey.dat")), true,new Base64Decoder);
m_pSignkey = new RSASSA_PKCS1v15_SHA_Signer(filesource);
@@ -433,6 +436,7 @@
m_nMyPublicKeyLen = asink.TotalPutLength();
asink.MessageEnd();
}
+#ifndef _DEBUG
catch(...)
{
if (m_pSignkey){
@@ -442,11 +446,15 @@
LogError(LOG_STATUSBAR, GetResString(IDS_CRYPT_INITFAILED));
ASSERT(0);
}
+#endif
//Debug_CheckCrypting();
}
bool CClientCreditsList::CreateKeyPair(){
- try{
+#ifndef _DEBUG
+ try
+#endif
+ {
AutoSeededRandomPool rng;
InvertibleRSAFunction privkey;
privkey.Initialize(rng,RSAKEYSIZE);
@@ -458,6 +466,7 @@
if (thePrefs.GetLogSecureIdent())
AddDebugLogLine(false, _T("Created new RSA keypair"));
}
+#ifndef _DEBUG
catch(...)
{
if (thePrefs.GetVerbose())
@@ -465,6 +474,7 @@
ASSERT ( false );
return false;
}
+#endif
return true;
}
@@ -479,7 +489,10 @@
uint8 nResult;
if ( !CryptoAvailable() )
return 0;
- try{
+#ifndef _DEBUG
+ try
+#endif
+ {
SecByteBlock sbbSignature(sigkey->SignatureLength());
AutoSeededRandomPool rng;
@@ -501,11 +514,13 @@
asink.Put(sbbSignature.begin(), sbbSignature.size());
nResult = asink.TotalPutLength();
}
+#ifndef _DEBUG
catch(...)
{
ASSERT ( false );
nResult = 0;
}
+#endif
return nResult;
}
@@ -517,7 +532,10 @@
return false;
}
bool bResult;
- try{
+#ifndef _DEBUG
+ try
+#endif
+ {
StringSource ss_Pubkey((byte*)pTarget->GetSecureIdent(),pTarget->GetSecIDKeyLen(),true,0);
RSASSA_PKCS1v15_SHA_Verifier pubkey(ss_Pubkey);
// 4 additional bytes random data send from this client +5 bytes v2
@@ -556,6 +574,7 @@
bResult = pubkey.VerifyMessage(abyBuffer, m_nMyPublicKeyLen+4+nChIpSize, pachSignature, nInputSize);
}
+#ifndef _DEBUG
catch(...)
{
if (thePrefs.GetVerbose())
@@ -563,6 +582,7 @@
//ASSERT(0);
bResult = false;
}
+#endif
if (!bResult){
if (pTarget->IdentState == IS_IDNEEDED)
pTarget->IdentState = IS_IDFAILED;
diff -Nur srchybrid45a/ClientList.cpp srchybrid45a_VeryCD/ClientList.cpp
--- srchybrid45a/ClientList.cpp 2005-01-17 01:51:32.000000000 +0800
+++ srchybrid45a_VeryCD/ClientList.cpp 2005-02-07 17:09:58.790514800 +0800
@@ -46,6 +46,18 @@
#endif
+//EastShare Start - added by AndCycle, IP to Country
+void CClientList::ResetIP2Country(){
+
+ CUpDownClient *cur_client;
+
+ for(POSITION pos = list.GetHeadPosition(); pos != NULL; list.GetNext(pos)) {
+ cur_client = theApp.clientlist->list.GetAt(pos);
+ cur_client->ResetIP2Country();
+ }
+
+}
+//EastShare End - added by AndCycle, IP to Country
CClientList::CClientList(){
m_dwLastBannCleanUp = 0;
m_dwLastTrackedCleanUp = 0;
diff -Nur srchybrid45a/ClientList.h srchybrid45a_VeryCD/ClientList.h
--- srchybrid45a/ClientList.h 2005-01-04 20:42:30.000000000 +0800
+++ srchybrid45a_VeryCD/ClientList.h 2005-02-07 17:09:58.806139800 +0800
@@ -57,6 +57,10 @@
Connected
};
+//EastShare Start - added by AndCycle, IP to Country
+public:
+ void ResetIP2Country();
+//EastShare End - added by AndCycle, IP to Country
public:
CClientList();
~CClientList();
diff -Nur srchybrid45a/ClientListCtrl.cpp srchybrid45a_VeryCD/ClientListCtrl.cpp
--- srchybrid45a/ClientListCtrl.cpp 2005-01-22 14:59:40.000000000 +0800
+++ srchybrid45a_VeryCD/ClientListCtrl.cpp 2005-02-07 17:09:58.821764800 +0800
@@ -39,6 +39,7 @@
static char THIS_FILE[] = __FILE__;
#endif
+#include "IP2Country.h"//EastShare - added by AndCycle, IP to Country
// CClientListCtrl
@@ -286,9 +287,28 @@
Sbuffer.Format(_T("(%s)"), GetResString(IDS_UNKNOWN));
else
Sbuffer = client->GetUserName();
+
+ //EastShare Start - added by AndCycle, IP to Country
+ CString tempStr;
+ tempStr.Format(_T("%s%s"), client->GetCountryName(), Sbuffer);
+ Sbuffer = tempStr;
+
+ if(theApp.ip2country->ShowCountryFlag()){
+ cur_rec.left+=20;
+ POINT point2= {cur_rec.left,cur_rec.top+1};
+ theApp.ip2country->GetFlagImageList()->DrawIndirect(dc, client->GetCountryFlagIndex(), 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:{
diff -Nur srchybrid45a/ClientUDPSocket.cpp srchybrid45a_VeryCD/ClientUDPSocket.cpp
--- srchybrid45a/ClientUDPSocket.cpp 2004-12-26 22:05:50.000000000 +0800
+++ srchybrid45a_VeryCD/ClientUDPSocket.cpp 2005-02-07 17:09:58.821764800 +0800
@@ -103,15 +103,19 @@
{
unpack[0] = OP_KADEMLIAHEADER;
unpack[1] = buffer[1];
+#ifndef _DEBUG
try
+#endif
{
Kademlia::CKademlia::processPacket(unpack, unpackedsize+2, ntohl(sockAddr.sin_addr.S_un.S_addr), ntohs(sockAddr.sin_port));
}
+#ifndef _DEBUG
catch(...)
{
delete[] unpack;
throw;
}
+#endif
}
else
{
@@ -160,6 +164,7 @@
error->Delete();
strError = _T("Invalid packet received");
}
+#ifndef _DEBUG
catch(CException* error)
{
error->Delete();
@@ -170,6 +175,7 @@
strError = _T("Unknown exception");
ASSERT(0);
}
+#endif
if (thePrefs.GetVerbose() && !strError.IsEmpty())
{
@@ -494,8 +500,21 @@
if (thePrefs.GetUDPPort()) {
ret=CAsyncSocket::Create(thePrefs.GetUDPPort(),SOCK_DGRAM,FD_READ|FD_WRITE);
- if (ret)
- m_port=thePrefs.GetUDPPort();
+ }
+
+ if (ret){
+ if (thePrefs.GetUPnPNat()){
+ MyUPnP::UPNPNAT_MAPPING mapping;
+
+ mapping.internalPort = mapping.externalPort = thePrefs.GetUDPPort();
+ mapping.protocol = MyUPnP::UNAT_UDP;
+ mapping.description = "UDP Port";
+ if (theApp.AddUPnPNatPort(&mapping, thePrefs.GetUPnPNatTryRandom()))
+ thePrefs.SetUPnPUDPExternal(mapping.externalPort);
+ }
+ else{
+ thePrefs.SetUPnPUDPExternal(thePrefs.GetUDPPort());
+ }
}
if (ret)
diff -Nur srchybrid45a/DownloadListCtrl.cpp srchybrid45a_VeryCD/DownloadListCtrl.cpp
--- srchybrid45a/DownloadListCtrl.cpp 2005-01-31 11:55:54.000000000 +0800
+++ srchybrid45a_VeryCD/DownloadListCtrl.cpp 2005-02-07 17:09:58.853014800 +0800
@@ -48,6 +48,7 @@
static char THIS_FILE[] = __FILE__;
#endif
+#include "IP2Country.h"//EastShare - added by AndCycle, IP to Country
// CDownloadListCtrl
@@ -710,10 +711,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(_T("%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;
Files srchybrid45a/emule.aps and srchybrid45a_VeryCD/emule.aps differ
diff -Nur srchybrid45a/emule.cpp srchybrid45a_VeryCD/emule.cpp
--- srchybrid45a/emule.cpp 2005-01-22 01:43:44.000000000 +0800
+++ srchybrid45a_VeryCD/emule.cpp 2005-02-08 12:57:43.586625000 +0800
@@ -76,6 +76,8 @@
static char THIS_FILE[] = __FILE__;
#endif
+#include "IP2Country.h"//EastShare - added by AndCycle, IP to Country
+
///////////////////////////////////////////////////////////////////////////////
// MSLU (Microsoft Layer for Unicode) support - UnicoWS
@@ -211,11 +213,7 @@
// 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);
-#else
- m_strCurVersionLong.Format(_T("%u.%u%c"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE);
-#endif
+ m_strCurVersionLong.Format(_T("%u.%u%c VeryCD Build 0208"), VERSION_MJR, VERSION_MIN, _T('a') + VERSION_UPDATE);
#ifdef _DEBUG
m_strCurVersionLong += _T(" DEBUG");
@@ -444,6 +442,8 @@
uploadBandwidthThrottler = new UploadBandwidthThrottler();
// ZZ:UploadSpeedSense <--
+ ip2country = new CIP2Country(); //EastShare - added by AndCycle, IP to Country
+
clientlist = new CClientList();
friendlist = new CFriendList();
searchlist = new CSearchList();
@@ -1266,7 +1266,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 + -