Skip to content

Commit 514d554

Browse files
committed
session module add file hash field
1 parent 3087fc2 commit 514d554

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

XEngine_Source/StorageModule_Session/Session_Define.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ typedef struct
1717
{
1818
TCHAR tszFileDir[MAX_PATH]; //文件地址
1919
TCHAR tszClientAddr[128]; //操作的用户地址
20+
TCHAR tszFileHash[128]; //文件HASH值
2021
__int64x ullCount; //总大小
2122
__int64x ullRWCount; //读取(写入)总大小
2223
__int64x ullRWLen; //已经读取(写入)的大小
@@ -134,12 +135,17 @@ extern "C" BOOL Session_DLStroage_Destory();
134135
类型:整数型
135136
可空:Y
136137
意思:输入结束位置
138+
参数.七:lpszFileHash
139+
In/Out:In
140+
类型:常量字符指针
141+
可空:Y
142+
意思:文件的HASH值
137143
返回值
138144
类型:逻辑型
139145
意思:是否成功
140146
备注:
141147
*********************************************************************/
142-
extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x * pInt_Count, __int64x * pInt_LeftCount, int nPosStart = 0, int nPostEnd = 0);
148+
extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x * pInt_Count, __int64x * pInt_LeftCount, int nPosStart = 0, int nPostEnd = 0, LPCTSTR lpszFileHash = NULL);
143149
/********************************************************************
144150
函数名称:Session_DLStroage_GetBuffer
145151
函数功能:获得下载器中指定缓冲区

XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,17 @@ BOOL CSession_DLStroage::Session_DLStroage_Destory()
9191
类型:整数型
9292
可空:Y
9393
意思:输入结束位置
94+
参数.七:lpszFileHash
95+
In/Out:In
96+
类型:常量字符指针
97+
可空:Y
98+
意思:文件的HASH值
9499
返回值
95100
类型:逻辑型
96101
意思:是否成功
97102
备注:
98103
*********************************************************************/
99-
BOOL CSession_DLStroage::Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x* pInt_Count, __int64x* pInt_LeftCount, int nPosStart /* = 0 */, int nPostEnd /* = 0 */)
104+
BOOL CSession_DLStroage::Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x* pInt_Count, __int64x* pInt_LeftCount, int nPosStart /* = 0 */, int nPostEnd /* = 0 */, LPCTSTR lpszFileHash /* = NULL */)
100105
{
101106
Session_IsErrorOccur = FALSE;
102107

@@ -134,6 +139,10 @@ BOOL CSession_DLStroage::Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTST
134139
st_Client.ullCount = st_FStat.st_size;
135140
_tcscpy(st_Client.tszFileDir, lpszFileDir);
136141
_tcscpy(st_Client.tszClientAddr, lpszClientAddr);
142+
if (NULL != lpszFileHash)
143+
{
144+
_tcscpy(st_Client.tszFileHash, lpszFileHash);
145+
}
137146
//填充下载信息
138147
st_Client.pSt_File = _tfopen(lpszFileDir, _T("rb"));
139148
if (NULL == st_Client.pSt_File)

XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CSession_DLStroage
1919
public:
2020
BOOL Session_DLStroage_Init(int nTryTime);
2121
BOOL Session_DLStroage_Destory();
22-
BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x* pInt_Count, __int64x* pInt_LeftCount, int nPosStart = 0, int nPostEnd = 0);
22+
BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x* pInt_Count, __int64x* pInt_LeftCount, int nPosStart = 0, int nPostEnd = 0, LPCTSTR lpszFileHash = NULL);
2323
BOOL Session_DLStroage_GetBuffer(LPCTSTR lpszClientAddr, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
2424
BOOL Session_DLStroage_GetInfo(LPCTSTR lpszClientAddr, SESSION_STORAGEINFO* pSt_StorageInfo);
2525
BOOL Session_DLStroage_GetCount(int* pInt_ListCount);

XEngine_Source/StorageModule_Session/pch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ extern "C" BOOL Session_DLStroage_Destory()
5656
{
5757
return m_DLStorage.Session_DLStroage_Destory();
5858
}
59-
extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x * pInt_Count, __int64x * pInt_LeftCount, int nPosStart, int nPostEnd)
59+
extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFileDir, __int64x * pInt_Count, __int64x * pInt_LeftCount, int nPosStart, int nPostEnd, LPCTSTR lpszFileHash)
6060
{
61-
return m_DLStorage.Session_DLStroage_Insert(lpszClientAddr, lpszFileDir, pInt_Count, pInt_LeftCount, nPosStart, nPostEnd);
61+
return m_DLStorage.Session_DLStroage_Insert(lpszClientAddr, lpszFileDir, pInt_Count, pInt_LeftCount, nPosStart, nPostEnd, lpszFileHash);
6262
}
6363
extern "C" BOOL Session_DLStroage_GetBuffer(LPCTSTR lpszClientAddr, TCHAR * ptszMsgBuffer, int* pInt_MsgLen)
6464
{

0 commit comments

Comments
 (0)