Skip to content

Commit 34c0e58

Browse files
committed
modify:st_LBConfig to st_LBDistributed for configure module
added:st_LBLocation configure for configure module
1 parent ba6b634 commit 34c0e58

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,14 @@ typedef struct
130130
int nUPLoadMode;
131131
int nDownldMode;
132132
int nStorageMode;
133-
}st_LBConfig;
133+
}st_LBDistributed;
134+
struct
135+
{
136+
int nCenterMode;
137+
int nUPLoadMode;
138+
int nDownldMode;
139+
int nStorageMode;
140+
}st_LBLocation;
134141
struct
135142
{
136143
list<string>* pStl_ListCenter;

XEngine_Source/StorageModule_Config/Config_Error.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_P2XP 0x002000A
2626
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_CERT 0x002000B
2727

28-
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBCONFIG 0x0020010
29-
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LAODBALANCE 0x0020011
28+
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBDISTRIBUTED 0x0020010
29+
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBLOCATION 0x0020011
30+
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LAODBALANCE 0x0020012

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,29 @@ BOOL CConfig_Json::Config_Json_LoadBalance(LPCTSTR lpszConfigFile, XENGINE_LBCON
293293
}
294294
pSt_ServerConfig->bDistributed = st_JsonRoot["bDistributed"].asInt();
295295

296-
if (st_JsonRoot["LBConfig"].empty() || (4 != st_JsonRoot["LBConfig"].size()))
296+
if (st_JsonRoot["LBDistributed"].empty() || (4 != st_JsonRoot["LBDistributed"].size()))
297297
{
298298
Config_IsErrorOccur = TRUE;
299-
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBCONFIG;
299+
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBDISTRIBUTED;
300300
return FALSE;
301301
}
302-
Json::Value st_JsonLBConfig = st_JsonRoot["LBConfig"];
303-
pSt_ServerConfig->st_LBConfig.nCenterMode = st_JsonLBConfig["nCenterMode"].asInt();
304-
pSt_ServerConfig->st_LBConfig.nUPLoadMode = st_JsonLBConfig["nUPLoadMode"].asInt();
305-
pSt_ServerConfig->st_LBConfig.nDownldMode = st_JsonLBConfig["nDownldMode"].asInt();
306-
pSt_ServerConfig->st_LBConfig.nStorageMode = st_JsonLBConfig["nStorageMode"].asInt();
302+
Json::Value st_JsonLBDistributed = st_JsonRoot["LBDistributed"];
303+
pSt_ServerConfig->st_LBDistributed.nCenterMode = st_JsonLBDistributed["nCenterMode"].asInt();
304+
pSt_ServerConfig->st_LBDistributed.nUPLoadMode = st_JsonLBDistributed["nUPLoadMode"].asInt();
305+
pSt_ServerConfig->st_LBDistributed.nDownldMode = st_JsonLBDistributed["nDownldMode"].asInt();
306+
pSt_ServerConfig->st_LBDistributed.nStorageMode = st_JsonLBDistributed["nStorageMode"].asInt();
307+
308+
if (st_JsonRoot["LBLocation"].empty() || (4 != st_JsonRoot["LBLocation"].size()))
309+
{
310+
Config_IsErrorOccur = TRUE;
311+
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBLOCATION;
312+
return FALSE;
313+
}
314+
Json::Value st_JsonLBLocation = st_JsonRoot["LBLocation"];
315+
pSt_ServerConfig->st_LBLocation.nCenterMode = st_JsonLBLocation["nCenterMode"].asInt();
316+
pSt_ServerConfig->st_LBLocation.nUPLoadMode = st_JsonLBLocation["nUPLoadMode"].asInt();
317+
pSt_ServerConfig->st_LBLocation.nDownldMode = st_JsonLBLocation["nDownldMode"].asInt();
318+
pSt_ServerConfig->st_LBLocation.nStorageMode = st_JsonLBLocation["nStorageMode"].asInt();
307319

308320
if (st_JsonRoot["LoadBalance"].empty() || (4 != st_JsonRoot["LoadBalance"].size()))
309321
{

0 commit comments

Comments
 (0)