Seite 1 von 2

BeitragVerfasst: Mo 14. Apr 2008, 03:45
Author: taz
@CUploadQueue::AddClientToQueue :

Code: Alles auswählen
...
            if (client->credits != NULL && client->credits->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED)
            {
                //client has a valid secure hash, add him remove other one
                if (thePrefs.GetVerbose())
                    AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName(), cur_client->GetUserName(), cur_client->GetUserName());

// By Taz - SUQWT
                // ==> SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
                waitinglist.GetAt(pos2)->ClearWaitStartTime();
                // <== SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
// <------- SUQWT

                RemoveFromWaitingQueue(pos2,true);
                if (!cur_client->socket)
                {
                    if(cur_client->Disconnected(_T("AddClientToQueue - same userhash 1")))
                        delete cur_client;
                }
            }
            else

// By Taz - ClientAnalyzer don't remove both
#ifdef CLIENTANALYZER
            {
                bool removed;
                CString cur_nick = cur_client->GetUserName();

                removed = false;
                if (cur_client->GetAntiLeechData()){
                    if (cur_client->GetAntiLeechData()->GetBadForThisSession(AT_NICKTHIEF) || cur_client->GetAntiLeechData()->GetBadForThisSession(AT_MODTHIEF)){
                    // existing is a nick or mod thief, remove existing one
                        if (thePrefs.GetVerbose())
                            AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName(), cur_nick, cur_nick);

// By Taz - SUQWT
                        // ==> SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
                        waitinglist.GetAt(pos2)->ClearWaitStartTime();
                        // <== SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
// <------- SUQWT

                        RemoveFromWaitingQueue(pos2,true);
                        if (!cur_client->socket)
                        {
                            if(cur_client->Disconnected(_T("AddClientToQueue - same userhash 1")))
                                delete cur_client;
                        }
                        removed = true;
                    }
                }
                if(client->GetAntiLeechData()){
                    if (client->GetAntiLeechData()->GetBadForThisSession(AT_NICKTHIEF) || client->GetAntiLeechData()->GetBadForThisSession(AT_MODTHIEF)){
                    // new client is a nick or mod thief
                        if (thePrefs.GetVerbose())
                            AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName(), cur_nick, client->GetUserName());
                        return;
                    }
                }
                if (removed)
                    return;
            }
#endif
// <------- ClientAnalyzer don't remove both

            {
                // remove both since we do not know who the bad one is
                if (thePrefs.GetVerbose())
                    AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName() ,cur_client->GetUserName(), _T("Both"));

// By Taz - SUQWT
                // ==> SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
                waitinglist.GetAt(pos2)->ClearWaitStartTime();
                // <== SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
// <------- SUQWT

                RemoveFromWaitingQueue(pos2,true);
                if (!cur_client->socket)
                {
                    if(cur_client->Disconnected(_T("AddClientToQueue - same userhash 2")))
                        delete cur_client;
                }
                return;
            }
        }
        else if (client->GetIP() == cur_client->GetIP())
        {
            // same IP, different port, different userhash
            cSameIP++;
        }
    }


BTW: can easily be used with other, then CA, leecher detectors as well

BeitragVerfasst: Mo 14. Apr 2008, 07:15
Author: Spike2
Nice one ! Bild

BeitragVerfasst: Mo 14. Apr 2008, 07:43
Author: WiZaRd
Absolute nonsense!

This does not comply with the principle of the analyzer and I also think it would be illegal to add such a "one-way-ban" to eMule. Better remove it ASAP and re-think the whole thing.

BeitragVerfasst: Mo 14. Apr 2008, 07:49
Author: Spike2
Argl, seems I misunderstood it. I'm too tired probably.

Didn't looked WHERE in the code this has to be and understood it as sth. different.

One-side-bans (and adding a client not to the queue is one) are for the official devs only - for GPL-Evildoer.

BeitragVerfasst: Mo 14. Apr 2008, 07:51
Author: dlarge500
oh no,this is the wrong Way for the CA. Bild

WiZaRd have right,this is nonsense.

BeitragVerfasst: Mo 14. Apr 2008, 07:58
Author: Spike2
Well...wait a moment...

Code: Alles auswählen
                // remove both since we do not know who the bad one is
                if (thePrefs.GetVerbose())
                    AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName() ,cur_client->GetUserName(), _T("Both"));

(...)

                RemoveFromWaitingQueue(pos2,true);
                if (!cur_client->socket)
                {
                    if(cur_client->Disconnected(_T("AddClientToQueue - same userhash 2")))
                        delete cur_client;
                }
                return;

^^^^^^^^^^^^^this IS official code !
So with taz enhancement we do NOT remove both clients, since "we do not know who the bad one is" isn't really valid for mods with AntiNickThief / AntiModThief ! We do (at least we have a really good guess), so we remove only one client where official eMule removes two.
So this fix seems good to me. Or did I get it wrong again ?

BeitragVerfasst: Mo 14. Apr 2008, 11:05
Author: WiZaRd
I had to check the details, too, again... however this code simply does not make any sense... if the same userhash is encountered then it is important to remove both because we dunno which one the good client is... plus the code is not fully correct:
Code: Alles auswählen
[...]
            else
            {

// By Taz - ClientAnalyzer
#ifdef CLIENTANALYZER
                if(client->GetAntiLeechData() && (client->GetAntiLeechData()->GetBadForThisSession(AT_NICKTHIEF) || client->GetAntiLeechData()->GetBadForThisSession(AT_MODTHIEF))
                {
                    // new client is a nick or mod thief
                    if (thePrefs.GetVerbose())
                        AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName(), cur_client->GetUserName(), client->GetUserName());
                    return;
                }
                else if (cur_client->GetAntiLeechData() && (cur_client->GetAntiLeechData()->GetBadForThisSession(AT_NICKTHIEF) || cur_client->GetAntiLeechData()->GetBadForThisSession(AT_MODTHIEF))
                {
                    // other is a nick or mod thief, add new remove other one
                    if (thePrefs.GetVerbose())
                        AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName(), cur_client->GetUserName(), cur_client->GetUserName());

// By Taz - SUQWT
                    // ==> SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
                    waitinglist.GetAt(pos2)->ClearWaitStartTime();
                    // <== SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
// <------- SUQWT

                    RemoveFromWaitingQueue(pos2,true);
                    if (!cur_client->socket && cur_client->Disconnected(_T("AddClientToQueue - same userhash 1"))
                        delete cur_client;
                }
                else
#endif
                {
// <------- ClientAnalyzer
                    // remove both since we do not know who the bad one is
                    if (thePrefs.GetVerbose())
                        AddDebugLogLine(false, GetResString(IDS_SAMEUSERHASH), client->GetUserName() ,cur_client->GetUserName(), _T("Both"));

// By Taz - SUQWT
                    // ==> SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
                    waitinglist.GetAt(pos2)->ClearWaitStartTime();
                    // <== SUQWT [Moonlight/EastShare/ MorphXT] - Stulle
// <------- SUQWT

                    RemoveFromWaitingQueue(pos2,true);
                    if (!cur_client->socket && cur_client->Disconnected(_T("AddClientToQueue - same userhash 2"))
                        delete cur_client;
                    return;
                }
            }
[...]


Please note the last added { } which are important!!!

GreetZ,
WiZ

BeitragVerfasst: Mo 14. Apr 2008, 16:05
Author: Spike2
Yes, you're right of course, we can't really know which one is the good client. But I think if one was already identified as NickThief or ModThief we have a really good guess....

BeitragVerfasst: Mo 14. Apr 2008, 18:36
Author: taz
Obviously WiZ is right about { } - 1'st post fixed.

I'm sorry to have "dropped" a bome and be gone - however I can not browse eMF board from work anymore (blocked as P2P by blue coat sites filtering system).

I do think that at the very worst, code won't do any "real" damage (won't kick in or drop one bad guy instead two) - but on the other hand it offers a real chance for keeping valid clients on queue ...

BeitragVerfasst: Mo 14. Apr 2008, 19:28
Author: WiZaRd
Yes, you're right of course, we can't really know which one is the good client. But I think if one was already identified as NickThief or ModThief we have a really good guess....

Right... but having no such information does not prove the opposite... the system of logic, 1st semester...
If it rains, the grass gets wet... if it doesn't rain...
... then there is nothing we can say about the grass' humidity.