Skip to content

Commit 84951c4

Browse files
committed
modify:The configuration for enabling P2P is set up as a separate project.
1 parent fea876b commit 84951c4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ typedef struct tag_XEngine_ServerConfig
8989
}st_XLimit;
9090
struct
9191
{
92+
bool bEnable;
9293
int nTime;
9394
int nSDPort;
9495
int nRVPort;

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,15 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVERCONFIG
189189
pSt_ServerConfig->st_XLimit.nMaxUPConnect = st_JsonXLimit["nMaxUPConnect"].asInt();
190190
pSt_ServerConfig->st_XLimit.nMaxDNConnect = st_JsonXLimit["nMaxDNConnect"].asInt();
191191

192-
if (st_JsonRoot["XP2xp"].empty() || (3 != st_JsonRoot["XP2xp"].size()))
192+
if (st_JsonRoot["XP2xp"].empty() || (4 != st_JsonRoot["XP2xp"].size()))
193193
{
194194
Config_IsErrorOccur = true;
195195
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_P2XP;
196196
return false;
197197
}
198198
Json::Value st_JsonP2xp = st_JsonRoot["XP2xp"];
199+
200+
pSt_ServerConfig->st_P2xp.bEnable = st_JsonP2xp["bEnable"].asBool();
199201
pSt_ServerConfig->st_P2xp.nTime = st_JsonP2xp["nTime"].asInt();
200202
pSt_ServerConfig->st_P2xp.nSDPort = st_JsonP2xp["nSDPort"].asInt();
201203
pSt_ServerConfig->st_P2xp.nRVPort = st_JsonP2xp["nRVPort"].asInt();

XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ int main(int argc, char** argv)
394394
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动HTTP业务任务处理线程池成功,线程池个数:%d"), st_ServiceCfg.st_XMax.nCenterThread);
395395
}
396396
//只有使用了数据库,才启用P2P
397-
if (st_ServiceCfg.st_XSql.bEnable)
397+
if (st_ServiceCfg.st_P2xp.bEnable)
398398
{
399399
if (!NetCore_BroadCast_Create(&hBroadSocket, st_ServiceCfg.st_P2xp.nRVPort))
400400
{

0 commit comments

Comments
 (0)