📄 updownclient.h
字号:
{
return m_byEmuleVersion;
}
uint8 GetSourceExchangeVersion() const
{
return m_bySourceExchangeVer;
}
CClientCredits* Credits() const
{
return credits;
}
bool IsBanned() const;
const CString& GetClientFilename() const
{
return m_strClientFilename;
}
void SetClientFilename( CString fileName )
{
m_strClientFilename = fileName;
}
uint16 GetUDPPort() const
{
return m_nUDPPort;
}
void SetUDPPort(uint16 nPort)
{
m_nUDPPort = nPort;
}
uint8 GetUDPVersion() const
{
return m_byUDPVer;
}
bool SupportsUDP() const
{
return GetUDPVersion() != 0 && m_nUDPPort != 0;
}
uint16 GetKadPort() const
{
return m_nKadPort;
}
void SetKadPort(uint16 nPort)
{
m_nKadPort = nPort;
}
uint8 GetExtendedRequestsVersion() const
{
return m_byExtendedRequestsVer;
}
void RequestSharedFileList();
void ProcessSharedFileList(char* pachPacket, uint32 nSize, LPCTSTR pszDirectory = NULL);
void ClearHelloProperties();
bool ProcessHelloAnswer(char* pachPacket, uint32 nSize);
bool ProcessHelloPacket(char* pachPacket, uint32 nSize);
void SendHelloAnswer();
virtual bool SendHelloPacket();
void SendMuleInfoPacket(bool bAnswer);
void ProcessMuleInfoPacket(char* pachPacket, uint32 nSize);
void ProcessMuleCommentPacket(char* pachPacket, uint32 nSize);
void ProcessEmuleQueueRank(char* packet, UINT size);
void ProcessEdonkeyQueueRank(char* packet, UINT size);
void CheckQueueRankFlood();
bool Compare(const CUpDownClient* tocomp, bool bIgnoreUserhash = false) const;
void ResetFileStatusInfo();
uint32 GetLastSrcReqTime() const
{
return m_dwLastSourceRequest;
}
void SetLastSrcReqTime()
{
m_dwLastSourceRequest = ::GetTickCount();
}
uint32 GetLastSrcAnswerTime() const
{
return m_dwLastSourceAnswer;
}
void SetLastSrcAnswerTime()
{
m_dwLastSourceAnswer = ::GetTickCount();
}
uint32 GetLastAskedForSources() const
{
return m_dwLastAskedForSources;
}
void SetLastAskedForSources()
{
m_dwLastAskedForSources = ::GetTickCount();
}
bool GetFriendSlot() const;
void SetFriendSlot(bool bNV)
{
m_bFriendSlot = bNV;
}
bool IsFriend() const
{
return m_Friend != NULL;
}
void SetCommentDirty(bool bDirty = true)
{
m_bCommentDirty = bDirty;
}
bool GetSentCancelTransfer() const
{
return m_fSentCancelTransfer;
}
void SetSentCancelTransfer(bool bVal)
{
m_fSentCancelTransfer = bVal;
}
void ProcessPublicIPAnswer(const BYTE* pbyData, UINT uSize);
void SendPublicIPRequest();
// secure ident
void SendPublicKeyPacket();
void SendSignaturePacket();
void ProcessPublicKeyPacket(uchar* pachPacket, uint32 nSize);
void ProcessSignaturePacket(uchar* pachPacket, uint32 nSize);
uint8 GetSecureIdentState() const
{
return m_SecureIdentState;
}
void SendSecIdentStatePacket();
void ProcessSecIdentStatePacket(uchar* pachPacket, uint32 nSize);
uint8 GetInfoPacketsReceived() const
{
return m_byInfopacketsReceived;
}
void InfoPacketsReceived();
// preview
void SendPreviewRequest(const CAbstractFile* pForFile);
void SendPreviewAnswer(const CKnownFile* pForFile, CxImage** imgFrames, uint8 nCount);
void ProcessPreviewReq(char* pachPacket, uint32 nSize);
void ProcessPreviewAnswer(char* pachPacket, uint32 nSize);
bool GetPreviewSupport() const
{
return m_fSupportsPreview && GetViewSharedFilesSupport();
}
bool GetViewSharedFilesSupport() const
{
return m_fNoViewSharedFiles==0;
}
bool SafeSendPacket(Packet* packet);
void CheckForGPLEvilDoer();
//upload
EUploadState GetUploadState() const
{
return (EUploadState)m_nUploadState;
}
void SetUploadState(EUploadState news);
uint32 GetWaitStartTime() const;
void SetWaitStartTime();
void ClearWaitStartTime();
uint32 GetWaitTime() const
{
return m_dwUploadTime - GetWaitStartTime();
}
bool IsDownloading() const
{
return (m_nUploadState == US_UPLOADING);
}
bool HasBlocks() const
{
return !m_BlockRequests_queue.IsEmpty();
}
uint32 GetDatarate() const
{
return m_nUpDatarate;
}
uint32 GetScore(bool sysvalue, bool isdownloading = false, bool onlybasevalue = false) const;
void AddReqBlock(Requested_Block_Struct* reqblock);
void CreateNextBlockPackage();
uint32 GetUpStartTimeDelay() const
{
return ::GetTickCount() - m_dwUploadTime;
}
void SetUpStartTime()
{
m_dwUploadTime = ::GetTickCount();
}
void SendHashsetPacket(char* forfileid);
const uchar* GetUploadFileID() const
{
return requpfileid;
}
void SetUploadFileID(CKnownFile* newreqfile);
uint32 SendBlockData();
void ClearUploadBlockRequests();
void SendRankingInfo();
void SendCommentInfo(/*const*/ CKnownFile *file);
void AddRequestCount(const uchar* fileid);
void UnBan();
void Ban(LPCTSTR pszReason = NULL);
uint32 GetAskedCount() const
{
return m_cAsked;
}
void AddAskedCount()
{
m_cAsked++;
}
void SetAskedCount(uint32 m_cInAsked)
{
m_cAsked = m_cInAsked;
}
void FlushSendBlocks(); // call this when you stop upload, or the socket might be not able to send
uint32 GetLastUpRequest() const
{
return m_dwLastUpRequest;
}
void SetLastUpRequest()
{
m_dwLastUpRequest = ::GetTickCount();
}
uint32 GetSessionUp() const
{
return m_nTransferedUp - m_nCurSessionUp;
}
void ResetSessionUp()
{
m_nCurSessionUp = m_nTransferedUp;
m_addedPayloadQueueSession = 0;
m_nCurQueueSessionPayloadUp = 0;
}
uint32 GetQueueSessionPayloadUp() const
{
return m_nCurQueueSessionPayloadUp;
}
void ProcessExtendedInfo(CSafeMemFile* packet, CKnownFile* tempreqfile);
uint16 GetUpPartCount() const
{
return m_nUpPartCount;
}
void DrawUpStatusBar(CDC* dc, RECT* rect, bool onlygreyrect, bool bFlat) const;
uint32 GetPayloadInBuffer() const
{
return m_addedPayloadQueueSession - GetQueueSessionPayloadUp();
}
bool IsUpPartAvailable(uint16 iPart) const
{
return ( (iPart >= m_nUpPartCount) || (!m_abyUpPartStatus) )? 0:m_abyUpPartStatus[iPart];
}
uint8* GetUpPartStatus() const
{
return m_abyUpPartStatus;
}
float GetCombinedFilePrioAndCredit();
//download
uint32 GetAskedCountDown() const
{
return m_cDownAsked;
}
void AddAskedCountDown()
{
m_cDownAsked++;
}
void SetAskedCountDown(uint32 m_cInDownAsked)
{
m_cDownAsked = m_cInDownAsked;
}
EDownloadState GetDownloadState() const
{
return (EDownloadState)m_nDownloadState;
}
void SetDownloadState(EDownloadState nNewState);
uint32 GetLastAskedTime(const CPartFile* partFile = NULL) const;
void SetLastAskedTime() {
m_fileReaskTimes.SetAt(reqfile, ::GetTickCount()); // ZZ:DownloadManager (one resk timestamp for each file)
}
bool IsPartAvailable(uint16 iPart) const
{
return ( (iPart >= m_nPartCount) || (!m_abyPartStatus) )? 0:m_abyPartStatus[iPart];
}
uint8* GetPartStatus() const
{
return m_abyPartStatus;
}
uint16 GetPartCount() const
{
return m_nPartCount;
}
uint32 GetDownloadDatarate() const
{
return m_nDownDatarate;
}
uint16 GetRemoteQueueRank() const
{
return m_nRemoteQueueRank;
}
void SetRemoteQueueRank(uint16 nr);
bool IsRemoteQueueFull() const
{
return m_bRemoteQueueFull;
}
void SetRemoteQueueFull(bool flag)
{
m_bRemoteQueueFull = flag;
}
void DrawStatusBar(CDC* dc, LPCRECT rect, bool onlygreyrect, bool bFlat) const;
bool AskForDownload();
virtual void SendFileRequest();
void SendStartupLoadReq();
void ProcessFileInfo(CSafeMemFile* data, CPartFile* file);
void ProcessFileStatus(bool bUdpPacket, CSafeMemFile* data, CPartFile* file);
void ProcessHashSet(char* data, uint32 size);
void ProcessAcceptUpload();
bool AddRequestForAnotherFile(CPartFile* file);
void CreateBlockRequests(int iMaxBlocks);
virtual void SendBlockRequests();
virtual bool SendHttpBlockRequests();
virtual void ProcessBlockPacket(char* packet, uint32 size, bool packed = false);
virtual void ProcessHttpBlockPacket(const BYTE* pucData, UINT uSize);
void ClearDownloadBlockRequests();
uint32 CalculateDownloadRate();
UINT GetAvailablePartCount() const;
bool SwapToAnotherFile(LPCTSTR pszReason, bool bIgnoreNoNeeded, bool ignoreSuspensions, bool bRemoveCompletely, CPartFile* toFile = NULL, bool allowSame = true, bool isAboutToAsk = false, bool debug = false); // ZZ:DownloadManager
void DontSwapTo(/*const*/ CPartFile* file);
bool IsSwapSuspended(const CPartFile* file, const bool allowShortReaskTime = false, const bool fileIsNNP = false) /*const*/; // ZZ:DownloadManager
uint32 GetTimeUntilReask() const;
uint32 GetTimeUntilReask(const CPartFile* file) const;
uint32 GetTimeUntilReask(const CPartFile* file, const bool allowShortReaskTime, const bool useGivenNNP = false, const bool givenNNP = false) const;
void UDPReaskACK(uint16 nNewQR);
void UDPReaskFNF();
void UDPReaskForDownload();
bool IsSourceRequestAllowed() const;
bool IsSourceRequestAllowed(CPartFile* partfile, bool sourceExchangeCheck = false) const; // ZZ:DownloadManager
bool IsValidSource() const;
ESourceFrom GetSourceFrom() const
{
return (ESourceFrom)m_nSourceFrom;
}
void SetSourceFrom(ESourceFrom val) {m_nSourceFrom = val;}
// -khaos--+++> Download Sessions Stuff
void SetDownStartTime()
{
m_dwDownStartTime = ::GetTickCount();
}
uint32 GetDownTimeDifference()
{
uint32 myTime = m_dwDownStartTime;
m_dwDownStartTime = 0;
return ::GetTickCount() - myTime;
}
bool GetTransferredDownMini() const
{
return m_bTransferredDownMini;
}
void SetTransferredDownMini()
{
m_bTransferredDownMini = true;
}
void InitTransferredDownMini()
{
m_bTransferredDownMini = false;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -