Skip to content

Commit

Permalink
added:memory cache configure supported
Browse files Browse the repository at this point in the history
  • Loading branch information
xengine-qyt committed Nov 21, 2024
1 parent 881bc04 commit a67c132
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions XEngine_Source/MQCore_ConfigModule/Config_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ typedef struct
XCHAR tszPassLogout[MAX_PATH];
int nTimeout;
}st_XPass;
struct
{
bool bEnable;
int nTimeLast;
int nTimeStart;
}st_XMemory;
struct
{
bool bEnable;
Expand Down
3 changes: 2 additions & 1 deletion XEngine_Source/MQCore_ConfigModule/Config_Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
#define ERROR_MQ_MODULE_CONFIG_JSON_XSQL 0x0020006
#define ERROR_MQ_MODULE_CONFIG_JSON_XPASS 0x0020007
#define ERROR_MQ_MODULE_CONFIG_JSON_XVER 0x0020008
#define ERROR_MQ_MODULE_CONFIG_JSON_XREPORT 0x0020009
#define ERROR_MQ_MODULE_CONFIG_JSON_XREPORT 0x0020009
#define ERROR_MQ_MODULE_CONFIG_JSON_XMEMORY 0x0020010
11 changes: 11 additions & 0 deletions XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG
_tcsxcpy(pSt_ServerConfig->st_XPass.tszPassRegister, st_JsonXPass["tszPassRegister"].asCString());
_tcsxcpy(pSt_ServerConfig->st_XPass.tszPassUNReg, st_JsonXPass["tszPassUNReg"].asCString());

if (st_JsonRoot["XMemory"].empty() || (3 != st_JsonRoot["XMemory"].size()))
{
Config_IsErrorOccur = true;
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XMEMORY;
return false;
}
Json::Value st_JsonXMemory = st_JsonRoot["XMemory"];
pSt_ServerConfig->st_XMemory.bEnable = st_JsonXMemory["bEnable"].asBool();
pSt_ServerConfig->st_XMemory.nTimeLast = st_JsonXMemory["nTimeLast"].asInt();
pSt_ServerConfig->st_XMemory.nTimeStart = st_JsonXMemory["nTimeStart"].asInt();

if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size()))
{
Config_IsErrorOccur = true;
Expand Down

0 comments on commit a67c132

Please sign in to comment.