Skip to content

Commit a67c132

Browse files
committed
added:memory cache configure supported
1 parent 881bc04 commit a67c132

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

XEngine_Source/MQCore_ConfigModule/Config_Define.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ typedef struct
5555
XCHAR tszPassLogout[MAX_PATH];
5656
int nTimeout;
5757
}st_XPass;
58+
struct
59+
{
60+
bool bEnable;
61+
int nTimeLast;
62+
int nTimeStart;
63+
}st_XMemory;
5864
struct
5965
{
6066
bool bEnable;

XEngine_Source/MQCore_ConfigModule/Config_Error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
#define ERROR_MQ_MODULE_CONFIG_JSON_XSQL 0x0020006
2222
#define ERROR_MQ_MODULE_CONFIG_JSON_XPASS 0x0020007
2323
#define ERROR_MQ_MODULE_CONFIG_JSON_XVER 0x0020008
24-
#define ERROR_MQ_MODULE_CONFIG_JSON_XREPORT 0x0020009
24+
#define ERROR_MQ_MODULE_CONFIG_JSON_XREPORT 0x0020009
25+
#define ERROR_MQ_MODULE_CONFIG_JSON_XMEMORY 0x0020010

XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG
123123
_tcsxcpy(pSt_ServerConfig->st_XPass.tszPassRegister, st_JsonXPass["tszPassRegister"].asCString());
124124
_tcsxcpy(pSt_ServerConfig->st_XPass.tszPassUNReg, st_JsonXPass["tszPassUNReg"].asCString());
125125

126+
if (st_JsonRoot["XMemory"].empty() || (3 != st_JsonRoot["XMemory"].size()))
127+
{
128+
Config_IsErrorOccur = true;
129+
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XMEMORY;
130+
return false;
131+
}
132+
Json::Value st_JsonXMemory = st_JsonRoot["XMemory"];
133+
pSt_ServerConfig->st_XMemory.bEnable = st_JsonXMemory["bEnable"].asBool();
134+
pSt_ServerConfig->st_XMemory.nTimeLast = st_JsonXMemory["nTimeLast"].asInt();
135+
pSt_ServerConfig->st_XMemory.nTimeStart = st_JsonXMemory["nTimeStart"].asInt();
136+
126137
if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size()))
127138
{
128139
Config_IsErrorOccur = true;

0 commit comments

Comments
 (0)