From 75285cb24055c60b6ab6384d34bd86a285722988 Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Fri, 4 Mar 2022 13:47:09 +0800 Subject: [PATCH 1/5] delete:git configure --- .gitignore | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5d947ca..0000000 --- a/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# Build and Release Folders -bin-debug/ -bin-release/ -[Oo]bj/ -[Bb]in/ - -# Other files and folders -.settings/ - -# Executables -*.swf -*.air -*.ipa -*.apk - -# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` -# should NOT be excluded as they contain compiler settings and other important -# information for Eclipse / Flash Builder. -- Gitee From c279a9e9b6608bb3f09420ddec3b6843d40b8bac Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Mon, 14 Mar 2022 09:35:45 +0800 Subject: [PATCH 2/5] added:ipaddr information parse for apihelp --- .../APIHelp_Api/APIHelp_Api.cpp | 60 +++++++++++++++++++ .../APIHelp_Api/APIHelp_Api.h | 1 + .../StorageModule_APIHelp/APIHelp_Define.h | 26 +++++++- .../StorageModule_APIHelp/APIHelp_Error.h | 3 +- .../StorageModule_APIHelp.def | 3 +- XEngine_Source/StorageModule_APIHelp/pch.cpp | 4 ++ 6 files changed, 94 insertions(+), 3 deletions(-) diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp index 39f3fc2..22ee768 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp @@ -222,5 +222,65 @@ BOOL CAPIHelp_Api::APIHelp_Api_VerHash(LPCTSTR lpszFileHash, TCHAR** pptszListHd APIHelp_dwErrorCode = ERROR_STORAGE_MODULE_APIHELP_NOTMATCH; return FALSE; } + return TRUE; +} +/******************************************************************** +函数名称:APIHelp_Api_GetIPInfo +函数功能:获取IP信息 + 参数.一:lpszMsgBuffer + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要操作的缓冲区 + 参数.二:nMsgLen + In/Out:In + 类型:整数型 + 可空:N + 意思:输入要操作的大小 + 参数.三:pSt_IPAddrInfo + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出获取到的IP信息 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CAPIHelp_Api::APIHelp_Api_GetIPInfo(LPCTSTR lpszMsgBuffer, int nMsgLen, XENGINE_IPADDRINFO* pSt_IPAddrInfo) +{ + APIHelp_IsErrorOccur = FALSE; + + Json::Value st_JsonRoot; + JSONCPP_STRING st_JsonError; + Json::CharReaderBuilder st_JsonBuilder; + //解析 + std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); + if (!pSt_JsonReader->parse(lpszMsgBuffer, lpszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) + { + APIHelp_IsErrorOccur = TRUE; + APIHelp_dwErrorCode = ERROR_STORAGE_MODULE_APIHELP_PARSE; + return FALSE; + } + //是否获取成功 + if (0 != st_JsonRoot["code"].asInt()) + { + APIHelp_IsErrorOccur = TRUE; + APIHelp_dwErrorCode = ERROR_STORAGE_MODULE_APIHELP_CODE; + return FALSE; + } + Json::Value st_JsonObject = st_JsonRoot["data"]; + + _tcscpy(pSt_IPAddrInfo->tszIPStart, st_JsonObject["tszIPStart"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPEnd, st_JsonObject["tszIPEnd"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPAddress, st_JsonObject["tszIPAddress"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPAddr, st_JsonObject["tszIPAddr"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPCity, st_JsonObject["tszIPCity"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPCountry, st_JsonObject["tszIPCountry"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPCounty, st_JsonObject["tszIPCounty"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPProvince, st_JsonObject["tszIPProvince"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPISP, st_JsonObject["tszIPISP"].asCString()); + _tcscpy(pSt_IPAddrInfo->tszIPTime, st_JsonObject["tszIPTime"].asCString()); + return TRUE; } \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.h b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.h index fcc62bb..93609c5 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.h +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.h @@ -21,6 +21,7 @@ public: BOOL APIHelp_Api_ProxyAuth(TCHAR* ptszUser, TCHAR* ptszPass, TCHAR** pptszListHdr, int nHdrCount); BOOL APIHelp_Api_RangeFile(int* pInt_SPos, int* pInt_EPos, __int64x* pInt_Count, TCHAR** pptszListHdr, int nHdrCount); BOOL APIHelp_Api_VerHash(LPCTSTR lpszFileHash, TCHAR** pptszListHdr, int nHdrCount); + BOOL APIHelp_Api_GetIPInfo(LPCTSTR lpszMsgBuffer, int nMsgLen, XENGINE_IPADDRINFO* pSt_IPAddrInfo); protected: private: }; \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Define.h b/XEngine_Source/StorageModule_APIHelp/APIHelp_Define.h index fcf6900..ffed44d 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Define.h +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Define.h @@ -236,4 +236,28 @@ extern "C" BOOL APIHelp_Api_RangeFile(int* pInt_SPos, int* pInt_EPos, __int64x* 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL APIHelp_Api_VerHash(LPCTSTR lpszFileHash, TCHAR** pptszListHdr, int nHdrCount); \ No newline at end of file +extern "C" BOOL APIHelp_Api_VerHash(LPCTSTR lpszFileHash, TCHAR** pptszListHdr, int nHdrCount); +/******************************************************************** +函数名称:APIHelp_Api_GetIPInfo +函数功能:获取IP信息 + 参数.一:lpszMsgBuffer + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要操作的缓冲区 + 参数.二:nMsgLen + In/Out:In + 类型:整数型 + 可空:N + 意思:输入要操作的大小 + 参数.三:pSt_IPAddrInfo + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出获取到的IP信息 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL APIHelp_Api_GetIPInfo(LPCTSTR lpszMsgBuffer, int nMsgLen, XENGINE_IPADDRINFO* pSt_IPAddrInfo); \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Error.h b/XEngine_Source/StorageModule_APIHelp/APIHelp_Error.h index 59f3959..72cff60 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Error.h +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Error.h @@ -19,4 +19,5 @@ #define ERROR_STORAGE_MODULE_APIHELP_PARSELEN 0x0030013 //解析长度失败 #define ERROR_STORAGE_MODULE_APIHELP_NOTHASH 0x0030014 //没有HASH值 #define ERROR_STORAGE_MODULE_APIHELP_NOTMATCH 0x0030015 //HASH不匹配 -#define ERROR_STORAGE_MODULE_APIHELP_SIZE 0x0030016 //目录大小已经满了 \ No newline at end of file +#define ERROR_STORAGE_MODULE_APIHELP_SIZE 0x0030016 //目录大小已经满了 +#define ERROR_STORAGE_MODULE_APIHELP_CODE 0x0030017 //服务器返回失败 \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.def b/XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.def index 9f98967..7bbae8d 100644 --- a/XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.def +++ b/XEngine_Source/StorageModule_APIHelp/StorageModule_APIHelp.def @@ -11,4 +11,5 @@ EXPORTS APIHelp_Api_ProxyAuth APIHelp_Api_RangeFile - APIHelp_Api_VerHash \ No newline at end of file + APIHelp_Api_VerHash + APIHelp_Api_GetIPInfo \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/pch.cpp b/XEngine_Source/StorageModule_APIHelp/pch.cpp index 69853fe..f8c7bce 100644 --- a/XEngine_Source/StorageModule_APIHelp/pch.cpp +++ b/XEngine_Source/StorageModule_APIHelp/pch.cpp @@ -65,4 +65,8 @@ extern "C" BOOL APIHelp_Api_RangeFile(int* pInt_SPos, int* pInt_EPos, __int64x * extern "C" BOOL APIHelp_Api_VerHash(LPCTSTR lpszFileHash, TCHAR * *pptszListHdr, int nHdrCount) { return m_APIHelp.APIHelp_Api_VerHash(lpszFileHash, pptszListHdr, nHdrCount); +} +extern "C" BOOL APIHelp_Api_GetIPInfo(LPCTSTR lpszMsgBuffer, int nMsgLen, XENGINE_IPADDRINFO * pSt_IPAddrInfo) +{ + return m_APIHelp.APIHelp_Api_GetIPInfo(lpszMsgBuffer, nMsgLen, pSt_IPAddrInfo); } \ No newline at end of file -- Gitee From a9e6946998827266f2e4b09529a1c5efc64fba8e Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Mon, 14 Mar 2022 09:38:36 +0800 Subject: [PATCH 3/5] modify:how to get ip address information --- .../Protocol_Packet/Protocol_P2XPPacket.cpp | 2 +- .../Protocol_Packet/Protocol_P2XPPacket.h | 2 +- .../StorageProtocol_Define.h | 2 +- XEngine_Source/StorageModule_Protocol/pch.cpp | 2 +- .../XEngine_StorageApp/StorageApp_P2XPNet.cpp | 9 ++++++++- .../XStorage_P2XPPeer/P2XPPeer_Define.h | 2 +- .../XStorage_P2XPPeer/pch.h | 2 -- XEngine_Source/XStorage_Protocol.h | 19 ++++++++++++++++++- 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.cpp b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.cpp index 728f10a..2bb4618 100644 --- a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.cpp +++ b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.cpp @@ -298,7 +298,7 @@ BOOL CProtocol_P2XPPacket::Protocol_P2XPPacket_WLan(XENGINE_PROTOCOLHDR* pSt_Pro 意思:是否成功 备注: *********************************************************************/ -BOOL CProtocol_P2XPPacket::Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, APIHELP_IPADDRINFO* pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_MsgLen) +BOOL CProtocol_P2XPPacket::Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, XENGINE_IPADDRINFO* pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_MsgLen) { Protocol_IsErrorOccur = FALSE; diff --git a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.h b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.h index 0f22417..c9c43cd 100644 --- a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.h +++ b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_P2XPPacket.h @@ -25,7 +25,7 @@ public: BOOL Protocol_P2XPPacket_Common(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, int nCode = 0, LPCTSTR lpszMsgBuffer = NULL); BOOL Protocol_P2XPPacket_Lan(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL*** pppSt_ListClients, int nListCount, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); BOOL Protocol_P2XPPacket_WLan(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, list* pStl_ListClients, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); - BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, APIHELP_IPADDRINFO* pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); + BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, XENGINE_IPADDRINFO* pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); BOOL Protocol_P2XPPacket_Connect(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, XENGINE_P2XPIO_PROTOCOL* pSt_IOProtocol, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); BOOL Protocol_P2XPPacket_QueryFile(TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszFileName = NULL, LPCTSTR lpszFileHash = NULL); protected: diff --git a/XEngine_Source/StorageModule_Protocol/StorageProtocol_Define.h b/XEngine_Source/StorageModule_Protocol/StorageProtocol_Define.h index dd8284b..85fb191 100644 --- a/XEngine_Source/StorageModule_Protocol/StorageProtocol_Define.h +++ b/XEngine_Source/StorageModule_Protocol/StorageProtocol_Define.h @@ -387,7 +387,7 @@ extern "C" BOOL Protocol_P2XPPacket_WLan(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, l 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR * pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, APIHELP_IPADDRINFO * pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_Len); +extern "C" BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR * pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL* pSt_PeerInfo, XENGINE_IPADDRINFO * pSt_AddrInfo, TCHAR* ptszMsgBuffer, int* pInt_Len); /******************************************************************** 函数名称:Protocol_P2XPPacket_Connect 函数功能:请求连接打包函数 diff --git a/XEngine_Source/StorageModule_Protocol/pch.cpp b/XEngine_Source/StorageModule_Protocol/pch.cpp index f5056eb..0a860c8 100644 --- a/XEngine_Source/StorageModule_Protocol/pch.cpp +++ b/XEngine_Source/StorageModule_Protocol/pch.cpp @@ -81,7 +81,7 @@ extern "C" BOOL Protocol_P2XPPacket_WLan(XENGINE_PROTOCOLHDR * pSt_ProtocolHdr, { return m_P2XPPacket.Protocol_P2XPPacket_WLan(pSt_ProtocolHdr, pStl_ListClients, ptszMsgBuffer, pInt_MsgLen); } -extern "C" BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR * pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL * pSt_PeerInfo, APIHELP_IPADDRINFO * pSt_AddrInfo, TCHAR * ptszMsgBuffer, int* pInt_Len) +extern "C" BOOL Protocol_P2XPPacket_User(XENGINE_PROTOCOLHDR * pSt_ProtocolHdr, XENGINE_P2XPPEER_PROTOCOL * pSt_PeerInfo, XENGINE_IPADDRINFO * pSt_AddrInfo, TCHAR * ptszMsgBuffer, int* pInt_Len) { return m_P2XPPacket.Protocol_P2XPPacket_User(pSt_ProtocolHdr, pSt_PeerInfo, pSt_AddrInfo, ptszMsgBuffer, pInt_Len); } diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_P2XPNet.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_P2XPNet.cpp index 86b68e6..3956d98 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_P2XPNet.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_P2XPNet.cpp @@ -63,7 +63,14 @@ BOOL XEngine_Task_TCPP2xp(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCTSTR lpszClie return FALSE; } //获取外网IP所在位置 - APIHelp_NetWork_GetIPInfo(st_ClientPeer.st_PeerAddr.tszPublicAddr, &st_ClientPeer.st_IPAddrInfo); + int nBLen = 0; + TCHAR* ptszBody; + TCHAR tszUrlBuffer[MAX_PATH]; + memset(tszUrlBuffer, '\0', MAX_PATH); + + _stprintf(tszUrlBuffer, _T("http://app.xyry.org:5501/api?function=ipquery¶ms1=%s¶ms2=0"), st_ClientPeer.st_PeerAddr.tszPublicAddr); + APIHelp_HttpRequest_Get(tszUrlBuffer, &ptszBody, &nBLen); + APIHelp_Api_GetIPInfo(ptszBody, nBLen, &st_ClientPeer.st_IPAddrInfo); st_ClientPeer.st_PeerTimer.dwUserTime = time(NULL); st_ClientPeer.st_PeerTimer.dwKeepAlive = time(NULL); st_ClientPeer.bIsLogin = TRUE; diff --git a/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/P2XPPeer_Define.h b/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/P2XPPeer_Define.h index 6793edd..a7f0f2d 100644 --- a/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/P2XPPeer_Define.h +++ b/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/P2XPPeer_Define.h @@ -26,7 +26,7 @@ typedef struct tag_NetEngine_P2XPPeer_Info { XENGINE_P2XPPEER_PROTOCOL st_PeerAddr; //P2P通信的时候使用的地址(客户方使用) P2XP_TIMER_INFOMATION st_PeerTimer; //节点时间信息 - APIHELP_IPADDRINFO st_IPAddrInfo; //IP地址信息 + XENGINE_IPADDRINFO st_IPAddrInfo; //IP地址信息 BOOL bIsLogin; }XENGINE_P2XP_PEERINFO,*LPNETENGINE_P2XP_PEERINFO; ////////////////////////////////////////////////////////////////////////// diff --git a/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/pch.h b/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/pch.h index 098fe1e..0c5d0c2 100644 --- a/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/pch.h +++ b/XEngine_Source/XEngine_StorageComponents/XStorage_P2XPPeer/pch.h @@ -28,8 +28,6 @@ using namespace std; #include #include #include -#include -#include #include "../../XStorage_Protocol.h" #include "P2XPPeer_Define.h" #include "P2XPPeer_Error.h" diff --git a/XEngine_Source/XStorage_Protocol.h b/XEngine_Source/XStorage_Protocol.h index 1634238..2910cec 100644 --- a/XEngine_Source/XStorage_Protocol.h +++ b/XEngine_Source/XStorage_Protocol.h @@ -30,6 +30,8 @@ ////////////////////////////////////////////////////////////////////////// // 协议结构体 ////////////////////////////////////////////////////////////////////////// +#pragma pack(push) +#pragma pack(1) //文件传输头文件,可用于P2XP文件传输和组包管理模块文件传输 typedef struct tag_XEngine_Protocol_File { @@ -58,4 +60,19 @@ typedef struct tag_XEngine_P2XPIO_Protocol CHAR tszConnectAddr[32]; //连接的IP地址 int nDestPort; //要连接的端口 BOOL bIsTcp; //连接类型TCP,否则为UDP -}XENGINE_P2XPIO_PROTOCOL, * LPXENGINE_P2XPIO_PROTOCOL; \ No newline at end of file +}XENGINE_P2XPIO_PROTOCOL, * LPXENGINE_P2XPIO_PROTOCOL; +//IP地址信息 +typedef struct +{ + TCHAR tszIPStart[128]; + TCHAR tszIPEnd[128]; + TCHAR tszIPAddr[128]; //IP地址 + TCHAR tszIPCountry[128]; //国家/地区 + TCHAR tszIPProvince[128]; //省/自治区 + TCHAR tszIPCity[128]; //市 + TCHAR tszIPCounty[128]; //县 + TCHAR tszIPAddress[128]; //详细地址 + TCHAR tszIPISP[128]; //运营商 + TCHAR tszIPTime[128]; //数据库日期 +}XENGINE_IPADDRINFO; +#pragma pack(pop) \ No newline at end of file -- Gitee From 0b4ea630686057a6f6e22534d68765018959aab6 Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Mon, 14 Mar 2022 10:48:37 +0800 Subject: [PATCH 4/5] fixed:linux build error --- .../APIHelp_Distributed/APIHelp_Distributed.cpp | 16 ++++++++-------- .../Session_Stroage/Session_DLStroage.cpp | 4 ++-- .../Session_Stroage/Session_UPStroage.cpp | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp b/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp index 8919aaa..db31b5d 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp @@ -85,7 +85,7 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_RandomAddr(list* pStl_Lis { nRandomFront = 0; } - int i = 0; + unsigned int i = 0; for (auto stl_ListIterator = pStl_ListAddr->begin(); stl_ListIterator != pStl_ListAddr->end(); stl_ListIterator++, i++) { if (nRandomFront == i) @@ -102,7 +102,7 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_RandomAddr(list* pStl_Lis { nRandomBack = 0; } - int i = 0; + unsigned int i = 0; for (auto stl_ListIterator = pStl_ListAddr->rbegin(); stl_ListIterator != pStl_ListAddr->rend(); stl_ListIterator++, i++) { if (nRandomBack == i) @@ -290,8 +290,8 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_UPStorage(LPCTSTR lpszMsgBuffer, SystemApi_File_EnumFile(pSt_StorageBucket->tszFilePath, &ppListFile, &nListCount, NULL, NULL, TRUE, 1); for (int j = 0; j < nListCount; j++) { - struct __stat64 st_FStat; - _stat64(ppListFile[j], &st_FStat); + struct _tstat64 st_FStat; + _tstat64(ppListFile[j], &st_FStat); nDirCount += st_FStat.st_size; } BaseLib_OperatorMemory_Free((XPPPMEM)&ppListFile, nListCount); @@ -334,8 +334,8 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_UPStorage(LPCTSTR lpszMsgBuffer, SystemApi_File_EnumFile(stl_ListIterator->tszFilePath, &ppListFile, &nListCount, NULL, NULL, TRUE, 1); for (int j = 0; j < nListCount; j++) { - struct __stat64 st_FStat; - _stat64(ppListFile[j], &st_FStat); + struct _tstat64 st_FStat; + _tstat64(ppListFile[j], &st_FStat); nDirCount += st_FStat.st_size; } BaseLib_OperatorMemory_Free((XPPPMEM)&ppListFile, nListCount); @@ -382,7 +382,7 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_UPStorage(LPCTSTR lpszMsgBuffer, { nUPFront = 0; } - int i = 0; + unsigned int i = 0; for (auto stl_ListIterator = stl_BuckSelect.begin(); stl_ListIterator != stl_BuckSelect.end(); stl_ListIterator++, i++) { if (nUPFront == i) @@ -399,7 +399,7 @@ BOOL CAPIHelp_Distributed::APIHelp_Distributed_UPStorage(LPCTSTR lpszMsgBuffer, { nUPBack = 0; } - int i = 0; + unsigned int i = 0; for (auto stl_ListIterator = stl_BuckSelect.rbegin(); stl_ListIterator != stl_BuckSelect.rend(); stl_ListIterator++, i++) { if (nUPBack == i) diff --git a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp index 54bce5a..d432926 100644 --- a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp @@ -129,10 +129,10 @@ BOOL CSession_DLStroage::Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTST st_Locker.unlock_shared(); SESSION_STORAGEINFO st_Client; - struct __stat64 st_FStat; + struct _tstat64 st_FStat; memset(&st_Client, '\0', sizeof(SESSION_STORAGEINFO)); - int nRet = _stat64(lpszFileDir, &st_FStat); + int nRet = _tstat64(lpszFileDir, &st_FStat); if (-1 == nRet) { Session_IsErrorOccur = TRUE; diff --git a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp index cb232ba..983768c 100644 --- a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp @@ -372,9 +372,9 @@ BOOL CSession_UPStroage::Session_UPStroage_Delete(LPCTSTR lpszClientAddr) } if (0 == stl_MapIterator->second.st_StorageInfo.ullFSize) { - struct __stat64 st_FStat; - memset(&st_FStat, '\0', sizeof(struct __stat64)); - _stat64(stl_MapIterator->second.st_StorageInfo.tszFileDir, &st_FStat); + struct _tstat64 st_FStat; + memset(&st_FStat, '\0', sizeof(struct _tstat64)); + _tstat64(stl_MapIterator->second.st_StorageInfo.tszFileDir, &st_FStat); stl_MapIterator->second.st_StorageInfo.ullFSize = st_FStat.st_size; } //大小是否足够 @@ -412,9 +412,9 @@ BOOL CSession_UPStroage::Session_UPStroage_Close(LPCTSTR lpszClientAddr) { fclose(stl_MapIterator->second.st_StorageInfo.pSt_File); } - struct __stat64 st_FStat; - memset(&st_FStat, '\0', sizeof(struct __stat64)); - _stat64(stl_MapIterator->second.st_StorageInfo.tszFileDir, &st_FStat); + struct _tstat64 st_FStat; + memset(&st_FStat, '\0', sizeof(struct _tstat64)); + _tstat64(stl_MapIterator->second.st_StorageInfo.tszFileDir, &st_FStat); stl_MapIterator->second.st_StorageInfo.ullFSize = st_FStat.st_size; } st_Locker.unlock(); -- Gitee From 2f52198522bcab3776a261921442d132f6188d79 Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Mon, 14 Mar 2022 10:50:59 +0800 Subject: [PATCH 5/5] update:readme and configure --- README.en.md | 5 ----- README.md | 5 ----- XEngine_Release/XEngine_Config/XEngine_Config.json | 1 + 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/README.en.md b/README.en.md index 1ab1f18..44005f5 100644 --- a/README.en.md +++ b/README.en.md @@ -95,11 +95,6 @@ Port:HTTP Center Port 5100,Download 5101,UPLoad 5102,P2P 5103 3. Submit the code 4. New Pull Request -## Clean up statement -the software will not generate any files to other directories in your system. -the software will not modify any of your system configuration. -the software can achieve complete cleanup by directly delete the directory. - ## Follow us If you think this software is helpful to you, please give us a START diff --git a/README.md b/README.md index 67be8e4..32a1c9f 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,6 @@ P2P广域网文件查找与下载支持 3. 提交代码 4. 新建 Pull Request -## 绿色声明 -此软件不会产生任何文件到你的系统的其他目录中. -此软件不会修改你的任何系统配置. -此软件可通过直接删除主目录而达到完全清理目的. - ## 关注我们 如果你觉得这个软件对你有帮助,请你给我们一个START吧 diff --git a/XEngine_Release/XEngine_Config/XEngine_Config.json b/XEngine_Release/XEngine_Config/XEngine_Config.json index 397470a..4b2e8dd 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -75,6 +75,7 @@ }, "XVer":{ "StorageVersion":[ + "3.5.1.1001 Build20220314", "3.5.0.1001 Build20220228", "3.4.1.1001 Build20220126", "3.4.0.1001 Build20220121", -- Gitee