The fix is simple. In eMule 46c, in ServerListCtrl.cpp
ServerListCtrl.cpp said:
#include "IPFilter.h"
and in the vanilla eMule 46c, in void CServerListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *plResult)
void CServerListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, on LRESULT *plResult), said:
if (pnmlvcd->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
const CServer* pServer = (const CServer*)pnmlvcd->nmcd.lItemlParam;
const CServer* pConnectedServer = theApp.serverconnect->GetCurrentServer();
// the server which we are connected to always has a valid numerical IP member assigned,
// therefor we do not need to call CServer::IsEqual (which is little expensive)
//if (pConnectedServer && pConnectedServer->IsEqual(pServer))
if (pConnectedServer && pConnectedServer->GetIP() == pServer->GetIP() && pConnectedServer->GetPort() == pServer->GetPort())
pnmlvcd->clrText = RGB(32,32,255);
else if (pServer->GetFailedCount() >= thePrefs.GetDeadServerRetries() || theApp.ipfilter->IsFiltered(pServer->GetIP()))
pnmlvcd->clrText = RGB(192,192,192);
else if (pServer->GetFailedCount() >= 2)
pnmlvcd->clrText = RGB(128,128,128);
}
{
const CServer* pServer = (const CServer*)pnmlvcd->nmcd.lItemlParam;
const CServer* pConnectedServer = theApp.serverconnect->GetCurrentServer();
// the server which we are connected to always has a valid numerical IP member assigned,
// therefor we do not need to call CServer::IsEqual (which is little expensive)
//if (pConnectedServer && pConnectedServer->IsEqual(pServer))
if (pConnectedServer && pConnectedServer->GetIP() == pServer->GetIP() && pConnectedServer->GetPort() == pServer->GetPort())
pnmlvcd->clrText = RGB(32,32,255);
else if (pServer->GetFailedCount() >= thePrefs.GetDeadServerRetries() || theApp.ipfilter->IsFiltered(pServer->GetIP()))
pnmlvcd->clrText = RGB(192,192,192);
else if (pServer->GetFailedCount() >= 2)
pnmlvcd->clrText = RGB(128,128,128);
}
However, I had recently added IP to Country to my TK4 Mod, copying the code from the eXtreme Mod ,(via Tombstone!). When implementing the above fix I found it would not work as above in the altered ServerListCtrl.cpp code! I believe the additional DrawItem() overrides the reflected message handler OnNMCustomdraw()
If this is the case then the indication of dead servers will be lost in mods using this code? Morph??, eXtreme etc?
To fix this in void CServerListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) (below is based on the eXtreme Mod variant.)
void CServerListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) said:
//RECT cur_rec = lpDrawItemStruct->rcItem; //MORPH - Moved by SiRoB, Don't draw hidden Rect
COLORREF crOldTextColor = dc.SetTextColor(m_crWindowText);
//TK4 Mod
LOGFONT lfFont;
CFont fontCustom;
//Xman our server in blubold
if(theApp.serverconnect->IsConnected()
&& (cur_srv = theApp.serverconnect->GetCurrentServer()) != NULL
&& cur_srv->GetPort() == server->GetPort()
//&& cur_srv->GetConnPort() == server->GetConnPort()//Morph - added by AndCycle, aux Ports, by lugdunummaster
&& _tcsicmp(cur_srv->GetAddress(), server->GetAddress()) == 0)
{ //it's our server
GetFont()->GetLogFont(&lfFont);
lfFont.lfWeight = FW_BOLD;
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(0,0,192));
}//Xman end
else //TK4 Mod grey out Filtered servers or Dead servers
if(server->GetFailedCount() >= thePrefs.GetDeadServerRetries() || theApp.ipfilter->IsFiltered(server->GetIP()))
{
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(192,192,192));
} else if(server->GetFailedCount() >= 2)
{ //unreliable servers
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(128,128,128));
}
int iOldBkMode;
COLORREF crOldTextColor = dc.SetTextColor(m_crWindowText);
//TK4 Mod
LOGFONT lfFont;
CFont fontCustom;
//Xman our server in blubold
if(theApp.serverconnect->IsConnected()
&& (cur_srv = theApp.serverconnect->GetCurrentServer()) != NULL
&& cur_srv->GetPort() == server->GetPort()
//&& cur_srv->GetConnPort() == server->GetConnPort()//Morph - added by AndCycle, aux Ports, by lugdunummaster
&& _tcsicmp(cur_srv->GetAddress(), server->GetAddress()) == 0)
{ //it's our server
GetFont()->GetLogFont(&lfFont);
lfFont.lfWeight = FW_BOLD;
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(0,0,192));
}//Xman end
else //TK4 Mod grey out Filtered servers or Dead servers
if(server->GetFailedCount() >= thePrefs.GetDeadServerRetries() || theApp.ipfilter->IsFiltered(server->GetIP()))
{
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(192,192,192));
} else if(server->GetFailedCount() >= 2)
{ //unreliable servers
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(128,128,128));
}
int iOldBkMode;
[EDIT] BTW in the above case I think OnNMCustomdraw() is redundant and can safely be removed!
Thanks for reading!
This post has been edited by BlueSonicBoy: 20 December 2005 - 10:09 PM










Sign In
Register



