Skip to content

Commit 325eb7a

Browse files
committed
modify:Method of get IP address information
1 parent bb4c10e commit 325eb7a

File tree

7 files changed

+6
-26
lines changed

7 files changed

+6
-26
lines changed

XEngine_Source/VSCopy_Debug.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseLib.dll" "./"
22
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Algorithm.dll" "./"
33
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Core.dll" "./"
44
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./"
5-
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_NetXApi.dll" "./"
65
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./"
76

87
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./"

XEngine_Source/VSCopy_x64.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ copy /y "%XEngine_Library%\x64\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
22
copy /y "%XEngine_Library%\x64\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
33
copy /y "%XEngine_Library%\x64\XEngine_Core\XEngine_Core.dll" "./"
44
copy /y "%XEngine_Library%\x64\XEngine_Core\XEngine_ManagePool.dll" "./"
5-
copy /y "%XEngine_Library%\x64\XEngine_Core\XEngine_NetXApi.dll" "./"
65
copy /y "%XEngine_Library%\x64\XEngine_Core\XEngine_OPenSsl.dll" "./"
76

87
copy /y "%XEngine_Library%\x64\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

XEngine_Source/VSCopy_x86.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ copy /y "%XEngine_Library%\x86\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
22
copy /y "%XEngine_Library%\x86\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
33
copy /y "%XEngine_Library%\x86\XEngine_Core\XEngine_Core.dll" "./"
44
copy /y "%XEngine_Library%\x86\XEngine_Core\XEngine_ManagePool.dll" "./"
5-
copy /y "%XEngine_Library%\x86\XEngine_Core\XEngine_NetXApi.dll" "./"
65
copy /y "%XEngine_Library%\x86\XEngine_Core\XEngine_OPenSsl.dll" "./"
76

87
copy /y "%XEngine_Library%\x86\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

XEngine_Source/XEngine_StorageApp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CC = g++ -Wall
22
RELEASE = 0
33
UNICODE = 0
44
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents -L /usr/local/lib/XEngine_Release/XEngine_RfcComponents -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../XEngine_StorageComponents/XStorage_SQLPacket -L ../XEngine_StorageComponents/XStorage_P2XPPeer -L ../StorageModule_Config -L ../StorageModule_Session -L ../StorageModule_APIHelp -L ../StorageModule_Protocol -L ../XEngine_ThirdPart/jsoncpp
5-
LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_NetXApi -lXEngine_OPenSsl -lXEngine_ProcFile -lXEngine_SystemApi -lHelpComponents_XLog -lHelpComponents_Packets -lRfcComponents_HttpServer -lNetHelp_APIHelp -lXStorage_SQLPacket -lXStorage_P2XPPeer -lStorageModule_Config -lStorageModule_Session -lStorageModule_APIHelp -lStorageModule_Protocol -ljsoncpp
5+
LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lXEngine_ProcFile -lXEngine_SystemApi -lHelpComponents_XLog -lHelpComponents_Packets -lRfcComponents_HttpServer -lNetHelp_APIHelp -lXStorage_SQLPacket -lXStorage_P2XPPeer -lStorageModule_Config -lStorageModule_Session -lStorageModule_APIHelp -lStorageModule_Protocol -ljsoncpp
66
LIBEX = -static-libgcc -ldl -lrt -lpthread
77
LOADSO = -Wl,-rpath=./,--disable-new-dtags
88
LIBINCLUDE = StorageApp_Config.o StorageApp_Download.o StorageApp_Network.o StorageApp_Center.o StorageApp_UPLoader.o StorageApp_P2XPNet.o Storage_TaskPass.o Storage_TaskManage.o Storage_TaskP2p.o XEngine_StorageApp.o

XEngine_Source/XEngine_StorageApp/StorageApp_Hdr.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ using namespace std;
3232
#include <XEngine_Include/XEngine_Core/ManagePool_Error.h>
3333
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
3434
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
35-
#include <XEngine_Include/XEngine_Core/NetXApi_Define.h>
36-
#include <XEngine_Include/XEngine_Core/NetXApi_Error.h>
3735
#include <XEngine_Include/XEngine_HelpComponents/XLog_Define.h>
3836
#include <XEngine_Include/XEngine_HelpComponents/XLog_Error.h>
3937
#include <XEngine_Include/XEngine_HelpComponents/DataBase_Define.h>
@@ -121,7 +119,6 @@ extern XENGINE_LBCONFIG st_LoadbalanceCfg;
121119
#pragma comment(lib,"XEngine_Core/XEngine_Core.lib")
122120
#pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib")
123121
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib")
124-
#pragma comment(lib,"XEngine_Core/XEngine_NetXApi.lib")
125122
#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib")
126123
#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Packets.lib")
127124
#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpServer.lib")

XEngine_Source/XEngine_StorageApp/StorageApp_P2XPNet.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,13 @@ BOOL XEngine_Task_TCPP2xp(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCTSTR lpszClie
6363
return FALSE;
6464
}
6565
//获取外网IP所在位置
66-
#ifdef _WINDOWS
67-
TCHAR tszLocation[128];
68-
TCHAR tszISPInfo[128];
66+
APIHELP_IPADDRINFO st_IPInfo;
67+
memset(&st_IPInfo, '\0', sizeof(APIHELP_IPADDRINFO));
6968

70-
memset(tszLocation, '\0', sizeof(tszLocation));
71-
memset(tszISPInfo, '\0', sizeof(tszISPInfo));
69+
APIHelp_NetWork_GetIPInfo(st_ClientPeer.st_PeerAddr.tszPublicAddr, &st_IPInfo);
7270

73-
NetXApi_Address_IPtoAddr(st_ClientPeer.st_PeerAddr.tszPublicAddr, tszLocation, tszISPInfo);
74-
int nLen = _tcslen(tszISPInfo);
75-
BaseLib_OperatorString_UTFToAnsi(tszLocation, st_ClientPeer.st_PeerAddr.tszUserLocation, &nLen);
76-
BaseLib_OperatorString_UTFToAnsi(tszISPInfo, st_ClientPeer.st_PeerAddr.tszUserISP, &nLen);
77-
#else
78-
NetXApi_Address_IPtoAddr(st_ClientPeer.st_PeerAddr.tszPublicAddr, st_ClientPeer.st_PeerAddr.tszUserLocation, st_ClientPeer.st_PeerAddr.tszUserISP);
79-
#endif
71+
_tcscpy(st_ClientPeer.st_PeerAddr.tszUserLocation, st_IPInfo.tszIPProvince);
72+
_tcscpy(st_ClientPeer.st_PeerAddr.tszUserISP, st_IPInfo.tszIPISP);
8073
st_ClientPeer.st_PeerTimer.dwUserTime = time(NULL);
8174
st_ClientPeer.st_PeerTimer.dwKeepAlive = time(NULL);
8275
st_ClientPeer.bIsLogin = TRUE;

XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,6 @@ int main(int argc, char** argv)
189189
}
190190
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,创建流量限速对象模式成功"));
191191

192-
if (!NetXApi_Address_OpenQQWry(st_ServiceCfg.st_P2xp.tszQQWryFile))
193-
{
194-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化IP地址数据库失败,错误:%lX"), NetXApi_GetLastError());
195-
goto XENGINE_EXITAPP;
196-
}
197-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化IP地址数据库成功"));
198-
199192
if (st_ServiceCfg.st_XTime.bHBTime)
200193
{
201194
if (!SocketOpt_HeartBeat_InitEx(&xhHBDownload, st_ServiceCfg.st_XTime.nStorageTimeOut, st_ServiceCfg.st_XTime.nTimeCheck, XEngine_Callback_HBDownload))

0 commit comments

Comments
 (0)