- Code: Alles auswählen
// Spike2 - ServerAnalyzer - START
bool CServerConnect::IsPossibleFakeServer(const CServer* pServer) const
{
// The criterions on which the analyzing procedure is based are taken from
// [url=http://forum.emule-project.net/index.php?showtopic=100907&st=40&p=747659&#entry747659]http://forum.emule-project.net/index.php?showtopic=100907&st=40&p=747659&#entry747659[/url]
// Servers with no name are highly suspicious...
if (pServer->GetListName().IsEmpty())
{
return true;
}
// Servers with no description aren't really trustworthier...
if (pServer->GetDescription().IsEmpty())
{
return true;
}
//Let's check the files/user ratio. Normally the files divided through the users should give back
//a value not higher than 300 (meaning the average number of files shared per user on this server).
//A too low value is suspicious, too !
INT ratio;
ratio = (pServer->GetFiles() / pServer->GetUsers());
if ((ratio < 50) || (ratio > 300))
{
return true;
}
//No or just few LowID-Users on server is a sign for servers giving fake-highIDs...
if (pServer->GetLowIDUsers() < 500)
{
return true;
}
//Does the server accept files ?
if ((pServer->GetHardFiles() == 0) || (pServer->GetSoftFiles() == 0))
{
return true;
}
//A state-of-the-art-server should support Large files...otherwise it's using an old version of
//the server-software.
if (!pServer->SupportsLargeFilesTCP() && !pServer->SupportsLargeFilesUDP())
{
return true;
}
return false;
}
// Spike2 - ServerAnalyzer - END
Obwohl das Ding mit Heuristik nix am Hut hat und sehr simpel gestrickt ist, hat das Teil in erster Tests doch wirklich recht zuverlässig Fake-Server als solche erkannt (und die "Guten" in Frieden gelassen)....
Jetzt die Frage: Wie implementieren ? Welche Folgen resultieren aus einem erkannten Fake-Server ? SharedFileList nicht senden und sofortiger Disconnect ? In der Liste markieren oder gleich entfernen ?
Also - können / wollen wir aus diesem Anfang etwas machen ?