This site is for P2P development and test software ONLY!

Fakerank

Replace the sendrankinginfo() with this:

void CUpDownClient::SendRankingInfo(){
if (!ExtProtocolAvailable())
return;
UINT nRank = theApp.uploadqueue->GetWaitingPosition(this);

if (!nRank){
nRank = 500;
}
if (m_nOldFakeRank && !theApp.uploadqueue->GetWaitingPosition(this)){
int diffQR = rand()%10+1;
nRank = m_nOldFakeRank - diffQR;
//nRank = m_nOldFakeRank;
ModLog(true, _T("[FakeRank]Send Fakerank tu User '%s': Rank '%i', Previous Rank '%i'"), this->GetUserName(), nRank, m_nOldFakeRank);
m_nOldFakeRank = nRank;
}
else{
m_nOldFakeRank = 500;
}

if (theApp.uploadqueue->GetWaitingPosition(this)){
nRank = theApp.uploadqueue->GetWaitingPosition(this);
if (!nRank)
return;
}
Packet* packet = new Packet(OP_QUEUERANKING,12,OP_EMULEPROT);
PokeUInt16(packet->pBuffer+0, (uint16)nRank);
memset(packet->pBuffer+2, 0, 10);
if (thePrefs.GetDebugClientTCPLevel() > 0)
DebugSend("OP__QueueRank", this);
theStats.AddUpDataOverheadFileRequest(packet->size);
socket->SendPacket(packet,true,true);
}


This sends the fakerank only to users not in queue to change delte thise lines:

if (theApp.uploadqueue->GetWaitingPosition(this)){
nRank = theApp.uploadqueue->GetWaitingPosition(this);
if (!nRank)
return;
}

0 comments:

发表评论