diff --git a/CHANGELOG b/CHANGELOG index 86ef0f4ae80bf6a62c4c3276a39b846042a888b7..4833fff75cadf16d8b69525bf26f16d42479941f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,27 @@ +XEngine_APIService V2.3.0.1001 + +添加:服务器能力查询接口函数 +添加:bmi模块 +添加:时区插件 +更新:支持XENGINE V7.38版本了 +修改:支持MACOS系统了 +修改:插件支持负载内容参数了 +修改:现在打印xengine版本了 +修正:程序退出时候崩溃 +修正:构建错误 +删除:libopencc的linux模块,需要自己安装 + +added:server option supported +added:bmi module +added:timezone plugin module +update:match xengine v7.38 +modify:support macos now +modify:plugin support payload parament +modify:printf xengine version now +fixed:app exist crashed. +fixed:build error +delete:libopencc for linux module,install byself +====================================================================================== XEngine_APIService V2.2.0.1001 添加:为p2p处理增加post方法 diff --git a/README.en.md b/README.en.md index 019997a396c84e1c6820dcacc82c64fc0c95c37e..acca38c63fc66e2bd8766f743cab7d943da9d2cc 100644 --- a/README.en.md +++ b/README.en.md @@ -13,6 +13,10 @@ You can use this code to implement your own information query service, which sup The purpose of development and implementation based on libXEngine is a cross-platform network storage service and support plugin module +#### Why choose us + +Support privatization deployment, free, safe, open source, controllable + ## Software feature 1. support json and string stream methods to return the content of the query 2. support ip address location information query(IPV4 and IPV6) @@ -21,10 +25,10 @@ and support plugin module 5. Weather forecast (planned) 6. Lunar calendar conversion (planning) 7. News headlines (planned) -8. Standard height and weight (planned) +8. Standard height and weight 9. Zodiac Constellation 10. Password generator -11. World Time Zones (planned) +11. World Time Zones 12. Oil price inquiry (planned) 13. Administrative zip code (planned) 14. Bank card verification @@ -39,20 +43,30 @@ and support plugin module ## install -#### Requirements -support system above windows 7sp1 and linux(ubuntu20.04,centos8) -XEngine need V7.30 or above +#### XEngine Evn +you must install XEngine,need V7.38 or above,install XEngine can be refer to xengine Readme docment +GITEE:https://gitee.com/xyry/libxengine +GITHUB:https://github.com/libxengine/xengine -#### Windows -use vs open and complie -You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself +##### fast to deployment +git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git +window Exection XEngine_WINEnv.bat +Linux Exection:sudo ./XEngine_LINEnv.sh -i 3 +Macos Exection:./XEngine_LINEnv.sh -i 3 -##### XEngine -download xengine through git.read xengine project readme file to configure your env +#### Windows +use vs open and compile,suport windows 7sp1 and above +Just Run it #### Linux -Linux use Makefile to complie -supproted ubuntu x64 or centos x64 +install opencc,ubuntu:sudo apt install libopencc-dev,centos:compile by self +use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64 +Run it on the terminal + +#### Macos +install opencc:brew install opencc +use makefile compile,mac 12 and above +Run it on the terminal ##### complie execute command in XEngine_Source path @@ -79,8 +93,10 @@ make FLAGS=CleanAll clear You can refer to the project under XEngine_PluginModule to write the plugin The written plugin needs to be configured via JSON to be enabled -## now task +## Test Server +Address:app.xyry.org,Port:5501 +## now task ## other problems You can refer to the document under the docment directory. It contains API protocol and service description. diff --git a/README.md b/README.md index b85e417343b6beb48111545480f976b348912547..7790798ddcb1e7f7d0f208ef6d666d24aadb820f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ c c++ interface api service 基于libXEngine开发并实现的一套简洁高性能跨平台接口服务 并且支持模块插件 +#### 为什么选择我们 +支持私有化部署,免费,安全.开源,可控 + + ## 软件特性 1. 支持JSON和字符串流方式返回查询的内容 2. 支持IP地址位置信息查询(IPV4和IPV6) @@ -21,10 +25,10 @@ c c++ interface api service 5. 天气预报(计划中) 6. 农历公历转换(计划中) 7. 新闻头条(计划中) -8. 标准身高体重(计划中) +8. 标准身高体重 9. 生肖星座 10. 密码生成器 -11. 世界时区(计划中) +11. 世界时区 12. 油价查询(计划中) 13. 行政邮编(计划中) 14. 银行卡验证 @@ -39,20 +43,30 @@ c c++ interface api service ## 安装教程 -#### 版本需求 -支持WINDOWS 7SP1和LINUX(UBUNT20.04,CENTOS8)以上系统 -XEngine版本需要V7.30或者以上版本 +#### XEngine环境 +必须安装XEngine,版本需要V7.38或者以上版本,安装XEngine可以参考其Readme文档 +GITEE:https://gitee.com/xyry/libxengine +GITHUB:https://github.com/libxengine/xengine -#### Windows -使用VS打开并且编译 -你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录 +###### 快速部署 +git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git +window执行XEngine_WINEnv.bat 脚本. +Linux执行:sudo ./XEngine_LINEnv.sh -i 3 +macos执行:./XEngine_LINEnv.sh -i 3 -##### XEngine环境 -XEngine通过GIT下载,参考XEngine项目的readme配置环境 +#### Windows +使用VS打开并且编译,支持WINDOWS 7SP1以上系统 +直接运行即可 #### Linux -Linux使用Makefile编译 -UBUNTU20.04 x64或者CENTOS8 x64均可 +安装opencc,ubuntu:sudo apt install libopencc-dev,centos:需要自己编译 +Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64 +在控制台运行 + +#### Macos +安装opencc,执行命令:brew install opencc +使用makefile编译,控制台运行,需要mac 12以及以上版本 +在控制台运行 ##### 编译命令 在XEngine_Source目录下执行命令 @@ -86,6 +100,7 @@ make FLAGS=CleanAll 清理编译 ## 测试服务器 地址:app.xyry.org,端口:5501 + #### 测试接口示例 更多内容请参考文档 手机信息查询 diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f8752374efbb050a01fe8efea4c0effc1034cfec --- /dev/null +++ b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp @@ -0,0 +1,71 @@ +#ifdef _MSC_BUILD +#include +#include +#pragma comment(lib,"Ws2_32") +#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp") +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//需要优先配置XEngine +//WINDOWS支持VS2022 x64 debug 编译调试 +//linux::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp +//macos::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp + +int main() +{ +#ifdef _MSC_BUILD + WSADATA st_WSAData; + WSAStartup(MAKEWORD(2, 2), &st_WSAData); +#endif + int nLen = 0; + TCHAR* ptszMsgBuffer = NULL; + LPCTSTR lpszPassUrl = _T("http://127.0.0.1:5501/api?function=pass¶ms1=1¶ms2=4"); + if (!APIHelp_HttpRequest_Get(lpszPassUrl, &ptszMsgBuffer, &nLen)) + { + printf("发送投递失败!\n"); + return 0; + } + printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); + BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + + LPCTSTR lpszZodiacUrl = _T("http://127.0.0.1:5501/api?function=zodiac¶ms1=19880121"); + if (!APIHelp_HttpRequest_Get(lpszZodiacUrl, &ptszMsgBuffer, &nLen)) + { + printf("发送投递失败!\n"); + return 0; + } + printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); + BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + + LPCTSTR lpszTimeUrl = _T("http://127.0.0.1:5501/api?function=timezone¶ms1=1¶ms2=1-20"); + if (!APIHelp_HttpRequest_Get(lpszTimeUrl, &ptszMsgBuffer, &nLen)) + { + printf("发送投递失败!\n"); + return 0; + } + printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); + BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + + LPCTSTR lpszBmiUrl = _T("http://127.0.0.1:5501/api?function=bmindex¶ms1=1.78¶ms2=62"); + if (!APIHelp_HttpRequest_Get(lpszBmiUrl, &ptszMsgBuffer, &nLen)) + { + printf("发送投递失败!\n"); + return 0; + } + printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); + BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); +#ifdef _MSC_BUILD + WSACleanup(); +#endif + return 0; +} \ No newline at end of file diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..14ed6260337c40814cce8bcc55a36f30bc1596d8 --- /dev/null +++ b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj @@ -0,0 +1,139 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {81b29f95-d383-437f-ad34-11e1f3b6eae5} + APPClientPluginExample + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + MultiByte + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(XEngine_Include);$(IncludePath) + $(XEngine_Lib64);$(LibraryPath) + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..ce1662e7830386a78f08251ec91535a372436456 --- /dev/null +++ b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp b/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp index 772a292991834060be93c2e2567599f03a1599ae..dad86d425c182213aa29baf5c12accdf30fa637b 100644 --- a/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp +++ b/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp @@ -18,8 +18,8 @@ //需要优先配置XEngine //WINDOWS支持VS2022 x64 debug 编译调试 -//linux使用下面的命令编译 -//g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp +//linux::g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp +//macos::g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp int main() { diff --git a/XEngine_APPClient/XEngine_APPClient.sln b/XEngine_APPClient/XEngine_APPClient.sln index 2a351ea3f53dbe00de883d3e2b6353404d0bdaa9..5a8b62eccc8eaeda6ce063f9d8922dd570aca27c 100644 --- a/XEngine_APPClient/XEngine_APPClient.sln +++ b/XEngine_APPClient/XEngine_APPClient.sln @@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_TranslationExampl EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_P2PExample", "APPClient_P2PExample\APPClient_P2PExample.vcxproj", "{D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_PluginExample", "APPClient_PluginExample\APPClient_PluginExample.vcxproj", "{81B29F95-D383-437F-AD34-11E1F3B6EAE5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -81,6 +83,14 @@ Global {D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x64.Build.0 = Release|x64 {D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x86.ActiveCfg = Release|Win32 {D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x86.Build.0 = Release|Win32 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x64.ActiveCfg = Debug|x64 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x64.Build.0 = Debug|x64 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x86.ActiveCfg = Debug|Win32 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x86.Build.0 = Debug|Win32 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x64.ActiveCfg = Release|x64 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x64.Build.0 = Release|x64 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x86.ActiveCfg = Release|Win32 + {81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/XEngine_Docment/Docment_en.docx b/XEngine_Docment/Docment_en.docx index 9df27402a71b203c6ee70fd1284a7f9f9d7540d4..6defddc0f15c565094791d9aa176781ee9b37ca4 100644 Binary files a/XEngine_Docment/Docment_en.docx and b/XEngine_Docment/Docment_en.docx differ diff --git a/XEngine_Docment/Docment_zh.docx b/XEngine_Docment/Docment_zh.docx index 2cecdb6653267210511b78731fd4e5f7104177cd..530ec53d19b9a339f8e37afdc1f8367c9129faa1 100644 Binary files a/XEngine_Docment/Docment_zh.docx and b/XEngine_Docment/Docment_zh.docx differ diff --git a/XEngine_Release/XEngine_Config/XEngine_Config.json b/XEngine_Release/XEngine_Config/XEngine_Config.json index 831e3045b8d00c9ed1d34261e877e45358eaf1ec..c21a33159ca40f0ad7135cf9de2741370498fa35 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -31,6 +31,7 @@ "tszPluginFile":"./XEngine_Config/XEngine_PluginConfig.json" }, "XVer":[ + "2.3.0.1001 Build20220723", "2.2.0.1001 Build20220701", "2.1.0.1001 Build20220429", "1.1.0.1001 Build20220402", diff --git a/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json b/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json new file mode 100644 index 0000000000000000000000000000000000000000..e153a3466a5e74835d579f94be7b11c1ad8cf630 --- /dev/null +++ b/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json @@ -0,0 +1,70 @@ +{ + "OPTionBase": [{ + "OPTionEnable": true, + "OPTionMethod": "ip", + "OPTionNote": "IP地址信息查询", + "OPTionExample": "http://%s/api?function=ip¶ms1=1.29.164.255¶ms2=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "id", + "OPTionNote": "身份证信息查询", + "OPTionExample": "http://%s/api?function=id¶ms1=511025191101018792¶ms2=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "phone", + "OPTionNote": "电话号码查询", + "OPTionExample": "http://%s/api?function=phone¶ms1=13699428888¶ms2=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "bank", + "OPTionNote": "银行卡验证", + "OPTionExample": "http://%s/api?function=bank¶ms1=6214000000¶ms2=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "language", + "OPTionNote": "语言转换", + "OPTionExample": "http://%s/api?function=language¶ms1=繁体到简体¶ms2=0¶ms3=1" + }, + { + "OPTionEnable": true, + "OPTionMethod": "translation", + "OPTionNote": "翻译", + "OPTionExample": "http://%s/api?function=translation¶ms1=中国¶ms2=0¶ms3=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "p2p", + "OPTionNote": "p2p网络", + "OPTionExample": "参考文档" + } + ], + "OPTionPlugin": [{ + "OPTionEnable": true, + "OPTionMethod": "zodiac", + "OPTionNote": "生肖星座", + "OPTionExample": "http://%s/api?function=zodiac¶ms1=19880121" + }, + { + "OPTionEnable": true, + "OPTionMethod": "pass", + "OPTionNote": "密码", + "OPTionExample": "http://%s/api?function=pass¶ms1=1¶ms2=4" + }, + { + "OPTionEnable": true, + "OPTionMethod": "timezone", + "OPTionNote": "时区转换", + "OPTionExample": "http://%s/api?function=timezone¶ms1=0" + }, + { + "OPTionEnable": true, + "OPTionMethod": "bmindex", + "OPTionNote": "体脂标准", + "OPTionExample": "http://%s/api?function=bmindex¶ms1=高(米))¶m2=体重(千克)" + } + ] +} \ No newline at end of file diff --git a/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json b/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json index 76b0d9e8a7c7906e76f94fda80711cfd36983384..9bbd729ce61642fd258824293ab20b80f18a9365 100644 --- a/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json @@ -9,6 +9,16 @@ "PluginEnable":true, "PluginMethod":"pass", "PluginFile":"./XEngine_Plugin/ModulePlugin_Password.dll" + }, + { + "PluginEnable":true, + "PluginMethod":"timezone", + "PluginFile":"./XEngine_Plugin/ModulePlugin_Timezone.dll" + }, + { + "PluginEnable":true, + "PluginMethod":"bmindex", + "PluginFile":"./XEngine_Plugin/ModulePlugin_BMIndex.dll" } ] } \ No newline at end of file diff --git a/XEngine_Source/Makefile b/XEngine_Source/Makefile index 31dd96426b2654e5b195400a6c7c03964306c9a3..c4c2e3da9bf32f4dde4e9403d09549817f5f9fd5 100644 --- a/XEngine_Source/Makefile +++ b/XEngine_Source/Makefile @@ -14,20 +14,20 @@ MODULE_PLUGIN_PATH = ./XEngine_ModulePlugin PLUGIN_MODULE_ZODIAC = ./XEngine_PluginModule/ModulePlugin_Zodiac PLUGIN_MODULE_PASSWORD = ./XEngine_PluginModule/ModulePlugin_Password +PLUGIN_MODULE_TIMEZONE = ./XEngine_PluginModule/ModulePlugin_Timezone +PLUGIN_MODULE_BMINDEX = ./XEngine_PluginModule/ModulePlugin_BMIndex APP_CENTER_PATH = ./XEngine_ServiceApp/XEngine_CenterApp APP_HTTP_PATH = ./XEngine_ServiceApp/XEngine_HttpApp -XENGINE_MODULES = libjsoncpp.so libopencc.so \ +XENGINE_MODULES = libjsoncpp.so \ libXEngine_ModuleConfigure.so libXEngine_ModuleDatabase.so libXEngine_ModuleProtocol.so libXEngine_ModuleHelp.so libXEngine_ModulePlugin.so \ - libModulePlugin_Zodiac.so libModulePlugin_Password.so \ - XEngine_HttpApp.exe + libModulePlugin_Zodiac.so libModulePlugin_Password.so libModulePlugin_Timezone.so libModulePlugin_BMIndex.so\ + XEngine_HttpApp.exe .PHONY:MakeAll MakeAll:$(XENGINE_MODULES) -libopencc.so: - cp -rf ./XEngine_ThirdPart/opencc/ubuntu/libopencc.so ../XEngine_Release/libopencc.so libjsoncpp.so: make -C $(THIRDPART_MODULE_JSONCPP) $(FLAGS) @@ -46,6 +46,10 @@ libModulePlugin_Zodiac.so: make -C $(PLUGIN_MODULE_ZODIAC) $(FLAGS) libModulePlugin_Password.so: make -C $(PLUGIN_MODULE_PASSWORD) $(FLAGS) +libModulePlugin_Timezone.so: + make -C $(PLUGIN_MODULE_TIMEZONE) $(FLAGS) +libModulePlugin_BMIndex.so: + make -C $(PLUGIN_MODULE_BMINDEX) $(FLAGS) XEngine_HttpApp.exe: make -C $(APP_HTTP_PATH) $(FLAGS) diff --git a/XEngine_Source/XEngine.sln b/XEngine_Source/XEngine.sln index ea8017f5654eacb77dba732dea9e36323f2152a2..6b98d278377a1d1031bdf52502f7d6932eae2177 100644 --- a/XEngine_Source/XEngine.sln +++ b/XEngine_Source/XEngine.sln @@ -32,6 +32,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Zodiac", "XEng EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Password", "XEngine_PluginModule\ModulePlugin_Password\ModulePlugin_Password.vcxproj", "{201B6D13-82A7-49E9-9736-D6B3BFE05B30}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Timezone", "XEngine_PluginModule\ModulePlugin_Timezone\ModulePlugin_Timezone.vcxproj", "{37B8E91F-EC52-41F0-B21D-441D4270C05F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_BMIndex", "XEngine_PluginModule\ModulePlugin_BMIndex\ModulePlugin_BMIndex.vcxproj", "{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -112,6 +116,22 @@ Global {201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x64.Build.0 = Release|x64 {201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x86.ActiveCfg = Release|Win32 {201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x86.Build.0 = Release|Win32 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x64.ActiveCfg = Debug|x64 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x64.Build.0 = Debug|x64 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x86.ActiveCfg = Debug|Win32 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x86.Build.0 = Debug|Win32 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x64.ActiveCfg = Release|x64 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x64.Build.0 = Release|x64 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x86.ActiveCfg = Release|Win32 + {37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x86.Build.0 = Release|Win32 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x64.ActiveCfg = Debug|x64 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x64.Build.0 = Debug|x64 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x86.ActiveCfg = Debug|Win32 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x86.Build.0 = Debug|Win32 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x64.ActiveCfg = Release|x64 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x64.Build.0 = Release|x64 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x86.ActiveCfg = Release|Win32 + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -121,6 +141,8 @@ Global {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {1F64BA84-8754-4FD3-87F8-9102F124EBC1} {32BB166A-3D3D-45EF-8BED-2E0471274159} = {D0473C03-9464-4C44-818A-AE212680CD05} {201B6D13-82A7-49E9-9736-D6B3BFE05B30} = {D0473C03-9464-4C44-818A-AE212680CD05} + {37B8E91F-EC52-41F0-B21D-441D4270C05F} = {D0473C03-9464-4C44-818A-AE212680CD05} + {BBC4B2B4-1143-45DF-8890-47CE26A61D0E} = {D0473C03-9464-4C44-818A-AE212680CD05} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9B202F91-A601-429E-BB0F-880DDEE096FE} diff --git a/XEngine_Source/XEngine_ModuleConfigure/Makefile b/XEngine_Source/XEngine_ModuleConfigure/Makefile index 7bca8c178490640166f26598b9cf35db8cb561e2..fe8e7368e400f640bc8c18d08ac48f195c791df9 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/Makefile +++ b/XEngine_Source/XEngine_ModuleConfigure/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ -I ../XEngine_ThirdPart/jsoncpp LOADBIN = -L ../XEngine_ThirdPart/jsoncpp LIB = -ljsoncpp -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags -LIBINCLUDE = ModuleConfigure_Json.o pch.o +LIBINCLUDE = ModuleConfigure_Json.o ModuleConfigure_File.o pch.o + +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,22 +35,24 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleConfigure.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleConfigure.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) ModuleConfigure_Json.o:./ModuleConfigure_Json/ModuleConfigure_Json.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleConfigure_Json/ModuleConfigure_Json.cpp - +ModuleConfigure_File.o:./ModuleConfigure_File/ModuleConfigure_File.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleConfigure_File/ModuleConfigure_File.cpp + pch.o:./pch.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp InstallAll:InstallSo -InstallSo:./libXEngine_ModuleConfigure.so - cp ./libXEngine_ModuleConfigure.so ../../XEngine_Release/libXEngine_ModuleConfigure.so +InstallSo:./libXEngine_ModuleConfigure.$(SHAREDLL) + cp ./libXEngine_ModuleConfigure.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleConfigure.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so + rm *.$(SHAREDLL) diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h index 29bb4d858791aa2ef7b5f89ba6709f3b1af2cc06..0aac0a050a7d2be2e39eec70b13329d4f4475a11 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h @@ -86,6 +86,19 @@ typedef struct list* pStl_ListPlugin; }XENGINE_PLUGINCONFIG; ////////////////////////////////////////////////////////////////////////// +typedef struct +{ + BOOL bEnable; + TCHAR tszOPMethod[MAX_PATH]; + TCHAR tszOPNote[MAX_PATH]; + TCHAR tszOPExample[MAX_PATH]; +}XENGINE_OPTIONINFO; +typedef struct +{ + list stl_ListBase; + list stl_ListPlug; +}XENGINE_OPTIONLIST; +////////////////////////////////////////////////////////////////////////// // 导出函数定义 ////////////////////////////////////////////////////////////////////////// extern "C" DWORD ModuleConfigure_GetLastError(int* pInt_ErrorCode = NULL); @@ -148,4 +161,26 @@ extern "C" BOOL ModuleConfigure_Json_OPenccFile(LPCTSTR lpszConfigFile, XENGINE_ 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG* pSt_PluginConfig); \ No newline at end of file +extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG* pSt_PluginConfig); +/************************************************************************/ +/* 其他内容读取 */ +/************************************************************************/ +/******************************************************************** +函数名称:ModuleConfigure_File_OPtion +函数功能:服务器可用方法查询配置文件 + 参数.一:lpszConfigFile + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要读取的配置文件 + 参数.二:pSt_OPtionList + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出信息列表 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList); \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h index fd8762e63408dd5775348aff51d057d7a413a81e..84b427161c7bcbcec48809295ef836457c46da35 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h @@ -19,4 +19,10 @@ #define ERROR_MODULE_CONFIGURE_JSON_XDB 0xA0007 //数据库配置错误 #define ERROR_MODULE_CONFIGURE_JSON_XPLUGIN 0xA0008 //插件配置错误 #define ERROR_MODULE_CONFIGURE_JSON_XVER 0xA0009 //版本配置文件读取错误 -#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA000A //申请内存失败 \ No newline at end of file +#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA000A //申请内存失败 +////////////////////////////////////////////////////////////////////////// +#define ERROR_MODULE_CONFIGURE_FILE_PARAMENT 0xA1001 //参数错误 +#define ERROR_MODULE_CONFIGURE_FILE_OPENFILE 0xA1002 //打开文件失败 +#define ERROR_MODULE_CONFIGURE_FILE_PARSE 0xA1003 //解析错误 +#define ERROR_MODULE_CONFIGURE_FILE_BASE 0xA1004 //基础信息不存在 +#define ERROR_MODULE_CONFIGURE_JSON_PLUGIN 0xA1005 //插件信息不存在 \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bae803325da5e44d68a4c593e39a9ed95ebdfa5f --- /dev/null +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp @@ -0,0 +1,124 @@ +#include "pch.h" +#include "ModuleConfigure_File.h" +/******************************************************************** +// Created: 2022/07/21 17:07:28 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File\ModuleConfigure_File.cpp +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File +// File Base: ModuleConfigure_File +// File Ext: cpp +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 文件信息读写 +// History: +*********************************************************************/ +CModuleConfigure_File::CModuleConfigure_File() +{ + +} +CModuleConfigure_File::~CModuleConfigure_File() +{ + +} +////////////////////////////////////////////////////////////////////////// +// 公用函数 +////////////////////////////////////////////////////////////////////////// +/******************************************************************** +函数名称:ModuleConfigure_File_OPtion +函数功能:服务器可用方法查询配置文件 + 参数.一:lpszConfigFile + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要读取的配置文件 + 参数.二:pSt_OPtionList + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出信息列表 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CModuleConfigure_File::ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList) +{ + Config_IsErrorOccur = FALSE; + + if ((NULL == lpszConfigFile) || (NULL == pSt_OPtionList)) + { + Config_IsErrorOccur = TRUE; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_PARAMENT; + return FALSE; + } + Json::Value st_JsonRoot; + JSONCPP_STRING st_JsonError; + Json::CharReaderBuilder st_JsonBuilder; + //读取配置文件所有内容到缓冲区 + FILE* pSt_File = _tfopen(lpszConfigFile, _T("rb")); + if (NULL == pSt_File) + { + Config_IsErrorOccur = TRUE; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_OPENFILE; + return FALSE; + } + size_t nCount = 0; + TCHAR tszMsgBuffer[4096]; + while (1) + { + size_t nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File); + if (nRet <= 0) + { + break; + } + nCount += nRet; + } + fclose(pSt_File); + //开始解析配置文件 + std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); + if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError)) + { + Config_IsErrorOccur = TRUE; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_PARSE; + return FALSE; + } + + if (st_JsonRoot["OPTionBase"].empty()) + { + Config_IsErrorOccur = TRUE; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_BASE; + return FALSE; + } + if (st_JsonRoot["OPTionPlugin"].empty()) + { + Config_IsErrorOccur = TRUE; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PLUGIN; + return FALSE; + } + Json::Value st_JsonBase = st_JsonRoot["OPTionBase"]; + for (unsigned int i = 0; i < st_JsonBase.size(); i++) + { + XENGINE_OPTIONINFO st_OPTionInfo; + memset(&st_OPTionInfo, '\0', sizeof(XENGINE_OPTIONINFO)); + + st_OPTionInfo.bEnable = st_JsonBase[i]["OPTionEnable"].asBool(); + _tcscpy(st_OPTionInfo.tszOPMethod, st_JsonBase[i]["OPTionMethod"].asCString()); + _tcscpy(st_OPTionInfo.tszOPNote, st_JsonBase[i]["OPTionNote"].asCString()); + _tcscpy(st_OPTionInfo.tszOPExample, st_JsonBase[i]["OPTionExample"].asCString()); + + pSt_OPtionList->stl_ListBase.push_back(st_OPTionInfo); + } + Json::Value st_JsonPlug = st_JsonRoot["OPTionPlugin"]; + for (unsigned int i = 0; i < st_JsonPlug.size(); i++) + { + XENGINE_OPTIONINFO st_OPTionInfo; + memset(&st_OPTionInfo, '\0', sizeof(XENGINE_OPTIONINFO)); + + st_OPTionInfo.bEnable = st_JsonPlug[i]["OPTionEnable"].asBool(); + _tcscpy(st_OPTionInfo.tszOPMethod, st_JsonPlug[i]["OPTionMethod"].asCString()); + _tcscpy(st_OPTionInfo.tszOPNote, st_JsonPlug[i]["OPTionNote"].asCString()); + _tcscpy(st_OPTionInfo.tszOPExample, st_JsonPlug[i]["OPTionExample"].asCString()); + + pSt_OPtionList->stl_ListPlug.push_back(st_OPTionInfo); + } + return TRUE; +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.h new file mode 100644 index 0000000000000000000000000000000000000000..2a47d529e3b9f2548172cac1958c305d01fa6586 --- /dev/null +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.h @@ -0,0 +1,23 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/21 17:07:01 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File\ModuleConfigure_File.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File +// File Base: ModuleConfigure_File +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 文件信息读写 +// History: +*********************************************************************/ + +class CModuleConfigure_File +{ +public: + CModuleConfigure_File(); + ~CModuleConfigure_File(); +public: + BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList); +protected: +private: +}; \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def index 892d206c25b7ec4e966b7e9fd638ac718f38a81e..557f8c254dc308b5ae777de3e8c9297e89ebb328 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def @@ -5,4 +5,6 @@ EXPORTS ModuleConfigure_Json_File ModuleConfigure_Json_OPenccFile - ModuleConfigure_Json_PluginFile \ No newline at end of file + ModuleConfigure_Json_PluginFile + + ModuleConfigure_File_OPtion \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj index 6d632fab0c5ff68cb28399781a80e77797d8a930..bc55d212b34c130d5dfeeb192b31fb063ca6bdaf 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj @@ -169,6 +169,7 @@ + @@ -176,6 +177,7 @@ + Create diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj.filters b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj.filters index a8d85e7d07a8c6741f9666e2a63ffbe98e2a20bb..cf21d2c1ff1a84989717248f7d75c03fd225c068 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj.filters +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj.filters @@ -19,6 +19,12 @@ {865425d8-f7eb-4fb9-bcd1-8bb631209b4e} + + {6976af83-32b2-4404-a20e-2f619e57daad} + + + {6b6efe12-6349-4581-a649-d81c086fb267} + @@ -36,6 +42,9 @@ 头文件 + + 头文件\ModuleConfigure_File + @@ -47,6 +56,9 @@ 源文件\ModuleConfigure_Json + + 源文件\ModuleConfigure_File + diff --git a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp index a411594c2e809c0d38b58cb84bc42748c08d0805..9bad8c21efc7c59f4d83dbed7f4989326fd5c3f2 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "ModuleConfigure_Json/ModuleConfigure_Json.h" +#include "ModuleConfigure_File/ModuleConfigure_File.h" /******************************************************************** // Created: 2021/12/02 16:20:26 // File Name: D:\XEngine_ServiceApp\XEngine_Source\XEngine_ModuleConfigure\pch.cpp @@ -15,6 +16,7 @@ BOOL Config_IsErrorOccur = FALSE; DWORD Config_dwErrorCode = 0; ////////////////////////////////////////////////////////////////////// CModuleConfigure_Json m_ConfigJson; +CModuleConfigure_File m_ConfigFile; ////////////////////////////////////////////////////////////////////// // 导出函数定义 ////////////////////////////////////////////////////////////////////// @@ -40,4 +42,11 @@ extern "C" BOOL ModuleConfigure_Json_OPenccFile(LPCTSTR lpszConfigFile, XENGINE_ extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG * pSt_PluginConfig) { return m_ConfigJson.ModuleConfigure_Json_PluginFile(lpszConfigFile, pSt_PluginConfig); +} +/************************************************************************/ +/* 其他内容读取 */ +/************************************************************************/ +extern "C" BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST * pSt_OPtionList) +{ + return m_ConfigFile.ModuleConfigure_File_OPtion(lpszConfigFile, pSt_OPtionList); } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleDatabase/Makefile b/XEngine_Source/XEngine_ModuleDatabase/Makefile index 78cc135af161b08702e3b6db572b0910e07cf8c0..91276a98d5f473ced7694cbec00b9455bb3b0b9f 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/Makefile +++ b/XEngine_Source/XEngine_ModuleDatabase/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ -LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents -LIB = -lHelpComponents_DataBase -LIBEX = -static-libgcc -lrt -ldl -lpthread +LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents +LIB = -lXEngine_BaseLib -lHelpComponents_DataBase +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags LIBINCLUDE = ModuleDatabase_IDCard.o ModuleDatabase_IPInfo.o ModuleDatabase_Phone.o ModuleDatabase_Bank.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleDatabase.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleDatabase.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) ModuleDatabase_IDCard.o:./ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp @@ -40,12 +51,12 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libXEngine_ModuleDatabase.so - cp ./libXEngine_ModuleDatabase.so ../../XEngine_Release/libXEngine_ModuleDatabase.so +InstallSo:./libXEngine_ModuleDatabase.$(SHAREDLL) + cp ./libXEngine_ModuleDatabase.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleDatabase.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleHelp/Makefile b/XEngine_Source/XEngine_ModuleHelp/Makefile index 93b5d4a0bf9122c28198a873143a67ec45120283..00a1638f0a7da7058ea2f068d49408be5a70f018 100644 --- a/XEngine_Source/XEngine_ModuleHelp/Makefile +++ b/XEngine_Source/XEngine_ModuleHelp/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 -INCLUDE = -I ./ -I ../XEngine_ThirdPart/opencc/include -LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../XEngine_ThirdPart/opencc/ubuntu +INCLUDE = -I ./ +LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib LIB = -lXEngine_BaseLib -lopencc -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags LIBINCLUDE = ModuleHelp_IDCard.o ModuleHelp_Language.o ModuleHelp_P2PClient.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleHelp.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleHelp.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) ModuleHelp_IDCard.o:./ModuleHelp_IDCard/ModuleHelp_IDCard.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleHelp_IDCard/ModuleHelp_IDCard.cpp @@ -38,12 +49,12 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libXEngine_ModuleHelp.so - cp ./libXEngine_ModuleHelp.so ../../XEngine_Release/libXEngine_ModuleHelp.so +InstallSo:./libXEngine_ModuleHelp.$(SHAREDLL) + cp ./libXEngine_ModuleHelp.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleHelp.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModulePlugin/Makefile b/XEngine_Source/XEngine_ModulePlugin/Makefile index 2175c6718760b637f980ccf97ffc6ced357791e4..ab3244b91a09bf09114750cc73f2bd60ae9b644b 100644 --- a/XEngine_Source/XEngine_ModulePlugin/Makefile +++ b/XEngine_Source/XEngine_ModulePlugin/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib LIB = -lXEngine_BaseLib -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags LIBINCLUDE = ModulePlugin_Core.o ModulePlugin_Loader.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModulePlugin.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModulePlugin.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) ModulePlugin_Core.o:./ModulePlugin_Core/ModulePlugin_Core.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModulePlugin_Core/ModulePlugin_Core.cpp @@ -36,12 +47,12 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libXEngine_ModulePlugin.so - cp ./libXEngine_ModulePlugin.so ../../XEngine_Release/libXEngine_ModulePlugin.so +InstallSo:./libXEngine_ModulePlugin.$(SHAREDLL) + cp ./libXEngine_ModulePlugin.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModulePlugin.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp index a3657b6fb118b892ebc65be39ea914ea8305edb9..cccf2a65abfee892a3f46faebae807e7abfa403b 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp @@ -115,12 +115,22 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR l 类型:整数型指针 可空:N 意思:输出内容大小 + 参数.七:lpszMsgBufer + In/Out:Out + 类型:常量字符指针 + 可空:Y + 意思:输入负载内容 + 参数.八:nMsgLen + In/Out:Out + 类型:整数型指针 + 可空:Y + 意思:输入负载大小 返回值 类型:逻辑型 意思:是否成功 备注: *********************************************************************/ -BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen) +BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer /* = NULL */, int nMsgLen /* = 0 */) { ModulePlugin_IsErrorOccur = FALSE; @@ -134,7 +144,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pp st_csStl.unlock_shared(); return FALSE; } - if (!stl_MapIterator->second.fpCall_PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen)) + if (!stl_MapIterator->second.fpCall_PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBufer, nMsgLen)) { ModulePlugin_IsErrorOccur = TRUE; ModulePlugin_dwErrorCode = stl_MapIterator->second.fpCall_PluginCore_GetLastError(); diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h index 93bdd50a594af02e0f7ba043d2e0bce17acf9dc6..2b93d4050f1386336f90ceb12d513ba6a095d010 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h @@ -12,7 +12,7 @@ *********************************************************************/ typedef BOOL(*FPCall_PluginCore_Init)(LPVOID lParam); typedef BOOL(*FPCall_PluginCore_UnInit)(); -typedef BOOL(*FPCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); +typedef BOOL(*FPCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen); typedef DWORD(*FPCall_PluginCore_GetLastError)(); typedef struct @@ -22,7 +22,7 @@ typedef struct BOOL(*fpCall_PluginCore_Init)(LPVOID lParam); BOOL(*fpCall_PluginCore_UnInit)(); - BOOL(*fpCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); + BOOL(*fpCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen); DWORD(*fpCall_PluginCore_GetLastError)(); }PLUGINCORE_FRAMEWORK, * LPPLUGINCORE_FRAMEWORK; @@ -34,7 +34,7 @@ public: public: BOOL ModulePlugin_Core_Init(); BOOL ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam = NULL); - BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); + BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0); BOOL ModulePlugin_Core_Destroy(); protected: BOOL ModulePlugin_Core_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam = NULL); diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h index 60de35eac22a543ee2cad0f21f3eecb12aec81d4..dd17d8c02232d1616f0d76b1a5538186c886adb0 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h @@ -83,12 +83,22 @@ extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhNet, LPCSTR lpszPluginFil 类型:整数型指针 可空:N 意思:输出内容大小 + 参数.七:lpszMsgBufer + In/Out:Out + 类型:常量字符指针 + 可空:Y + 意思:输入负载内容 + 参数.八:nMsgLen + In/Out:Out + 类型:整数型指针 + 可空:Y + 意思:输入负载大小 返回值 类型:逻辑型 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen); +extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0); /******************************************************************** 函数名称:ModulePlugin_Core_Destroy 函数功能:销毁插件核心并且清理资源 diff --git a/XEngine_Source/XEngine_ModulePlugin/pch.cpp b/XEngine_Source/XEngine_ModulePlugin/pch.cpp index 461fef1bc44e4e4dd6a23093472988135fda200d..1cf35b93fe82c62ea1fd0051f182d4d431b38217 100644 --- a/XEngine_Source/XEngine_ModulePlugin/pch.cpp +++ b/XEngine_Source/XEngine_ModulePlugin/pch.cpp @@ -39,7 +39,7 @@ extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhModule, LPCTSTR lpszPlugi { return m_PluginCore.ModulePlugin_Core_Push(pxhModule, lpszPluginFile, lParam); } -extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen) +extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen) { return m_PluginCore.ModulePlugin_Core_Exec(xhModule, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen); } diff --git a/XEngine_Source/XEngine_ModuleProtocol/Makefile b/XEngine_Source/XEngine_ModuleProtocol/Makefile index ac684ade0d12102f0d7ff4f178b83d1dfad23bbf..8b430f6fccb5ccde0740a4ff16a6c37b5efd23fb 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/Makefile +++ b/XEngine_Source/XEngine_ModuleProtocol/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ -I ../XEngine_ThirdPart/jsoncpp -LOADBIN = -L ../XEngine_ThirdPart/jsoncpp -LIB = -ljsoncpp -LIBEX = -static-libgcc -lrt -ldl -lpthread +LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../XEngine_ThirdPart/jsoncpp +LIB = -lXEngine_BaseLib -ljsoncpp +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags LIBINCLUDE = ModuleProtocol_Packet.o ModuleProtocol_Parse.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleProtocol.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleProtocol.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) ModuleProtocol_Packet.o:./ModuleProtocol_Packet/ModuleProtocol_Packet.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleProtocol_Packet/ModuleProtocol_Packet.cpp @@ -36,12 +47,12 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libXEngine_ModuleProtocol.so - cp ./libXEngine_ModuleProtocol.so ../../XEngine_Release/libXEngine_ModuleProtocol.so +InstallSo:./libXEngine_ModuleProtocol.$(SHAREDLL) + cp ./libXEngine_ModuleProtocol.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleProtocol.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h new file mode 100644 index 0000000000000000000000000000000000000000..f3077a6f3d3b3af32d488941bfc5e8638f03009c --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h @@ -0,0 +1,51 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 09:57:09 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Define.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: Timezone_Define +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 时区工具导出定义 +// History: +*********************************************************************/ +////////////////////////////////////////////////////////////////////////// +// 导出函数定义 +////////////////////////////////////////////////////////////////////////// +extern "C" DWORD PluginCore_GetLastError(); +/********************************************************************************* +* 导出函数定义 * +*********************************************************************************/ +/******************************************************************** +函数名称:PluginCore_Init +函数功能:初始化插件模块 + 参数.一:lParam + In/Out:In/Out + 类型:无类型指针 + 可空:N + 意思:自定义参数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL); +/******************************************************************** +函数名称:PluginCore_UnInit +函数功能:卸载插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_UnInit(); +/******************************************************************** +函数名称:PluginCore_Call +函数功能:调用插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0); \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Error.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Error.h new file mode 100644 index 0000000000000000000000000000000000000000..d93367b85f91372bac1b4339c84d33a8af587fab --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Error.h @@ -0,0 +1,16 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 16:40:17 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\BMIndex_Error.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex +// File Base: BMIndex_Error +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: BMI错误导出 +// History: +*********************************************************************/ +////////////////////////////////////////////////////////////////////////// +// 错误定义 +////////////////////////////////////////////////////////////////////////// +#define ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_BMINDEX_PARAMENT 0x14001 //参数错误 \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..232f7655613b60751f6980ff4496428b243a77f6 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile @@ -0,0 +1,55 @@ +CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so +RELEASE = 0 +UNICODE = 0 +INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp +LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp +LIB = -lXEngine_BaseLib -ljsoncpp +LIBEX = -ldl -lpthread +LOADSO = -Wl,-rpath=../,--disable-new-dtags +LIBINCLUDE = Plugin_BMIndex.o pch.o + +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + +ifeq ($(RELEASE),1) +FLAGS = -c -O2 +DEBUG = +else +FLAGS = -c +DEBUG = -g +endif + +ifeq ($(UNICODE),1) +UNICODE = -D _UNICODE +else +UNICODE = +endif + + +all:$(LIBINCLUDE) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_BMIndex.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + +Plugin_BMIndex.o:./Plugin_BMIndex/Plugin_BMIndex.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_BMIndex/Plugin_BMIndex.cpp + +pch.o:./pch.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp + + +InstallAll:InstallSo +InstallSo:./libModulePlugin_BMIndex.$(SHAREDLL) + cp ./libModulePlugin_BMIndex.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_BMIndex.$(SHAREDLL) + +CleanAll:CleanObj CleanMk +CleanObj: + rm *.o +CleanMk: + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.def b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.def new file mode 100644 index 0000000000000000000000000000000000000000..78dedee2f85146d24ce86f934777197f8ada61dd --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.def @@ -0,0 +1,8 @@ +LIBRARY + +EXPORTS + PluginCore_GetLastError + + PluginCore_Init + PluginCore_UnInit + PluginCore_Call \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..132e6acb24f3307ceb2297349a238381112c377f --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {bbc4b2b4-1143-45df-8890-47ce26a61d0e} + ModulePluginBMIndex + 10.0 + + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration)\XEngine_Plugin\ + ../../XEngine_ThirdPart/jsoncpp;$(XEngine_Include);$(IncludePath) + $(XEngine_Lib32);$(LibraryPath) + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib32);$(LibraryPath) + $(SolutionDir)$(Configuration)\XEngine_Plugin\ + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib64);$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\ + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib64);$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\ + + + + Level3 + true + WIN32;_DEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + ModulePlugin_BMIndex.def + + + + + Level3 + true + true + true + WIN32;NDEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + ModulePlugin_BMIndex.def + + + + + Level3 + true + _DEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + ModulePlugin_BMIndex.def + + + + + Level3 + true + true + true + NDEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + ModulePlugin_BMIndex.def + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.filters b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..12e408c0d27308701bffe94fdc8b1d876fea4041 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {df393b17-7b0b-4454-ad60-2f43a0449401} + + + {ef4df45c-5063-4625-b55b-aa7c907920b6} + + + + + 头文件 + + + 头文件 + + + 头文件\Plugin_BMIndex + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件\Plugin_BMIndex + + + + + 源文件 + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.user b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9b67548742339394323d6f4ee0b103f186a8260d --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp @@ -0,0 +1,139 @@ +#include "pch.h" +#include "Plugin_BMIndex.h" +/******************************************************************** +// Created: 2022/07/20 16:37:26 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex\Plugin_BMIndex.cpp +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex +// File Base: Plugin_BMIndex +// File Ext: cpp +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 标准身高体重 +// History: +*********************************************************************/ +CPlugin_BMIndex::CPlugin_BMIndex() +{ +} +CPlugin_BMIndex::~CPlugin_BMIndex() +{ +} +////////////////////////////////////////////////////////////////////////// +// 公有函数 +////////////////////////////////////////////////////////////////////////// +/******************************************************************** +函数名称:PluginCore_Init +函数功能:初始化插件模块 + 参数.一:lParam + In/Out:In/Out + 类型:无类型指针 + 可空:N + 意思:自定义参数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_BMIndex::PluginCore_Init(LPVOID lParam) +{ + BMIndex_IsErrorOccur = FALSE; + + return TRUE; +} +/******************************************************************** +函数名称:PluginCore_UnInit +函数功能:卸载插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_BMIndex::PluginCore_UnInit() +{ + BMIndex_IsErrorOccur = FALSE; + + return TRUE; +} +/******************************************************************** +函数名称:PluginCore_Call +函数功能:调用插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_BMIndex::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) +{ + BMIndex_IsErrorOccur = FALSE; + + if ((NULL == pInt_HTTPCode) || (NULL == ptszMsgBuffer) || (NULL == pInt_MsgLen)) + { + BMIndex_IsErrorOccur = TRUE; + BMIndex_dwErrorCode = ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_BMINDEX_PARAMENT; + return FALSE; + } + TCHAR tszKeyName[128]; + TCHAR tszParamHigh[128]; + TCHAR tszParamWeight[128]; + + memset(tszKeyName, '\0', sizeof(tszKeyName)); + memset(tszParamHigh, '\0', sizeof(tszParamHigh)); + memset(tszParamWeight, '\0', sizeof(tszParamWeight)); + + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamHigh); + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamWeight); + Plugin_Timezone_BMIndex(tszParamHigh, tszParamWeight, ptszMsgBuffer, pInt_MsgLen); + *pInt_HTTPCode = 200; + + return TRUE; +} +////////////////////////////////////////////////////////////////////////// +// 保护函数 +////////////////////////////////////////////////////////////////////////// +BOOL CPlugin_BMIndex::Plugin_Timezone_BMIndex(LPCTSTR lpszHigh, LPCTSTR lpszWeight, TCHAR* ptszMsgBufer, int* pInt_Len) +{ + BMIndex_IsErrorOccur = FALSE; + + Json::Value st_JsonRoot; + Json::Value st_JsonObject; + Json::StreamWriterBuilder st_JsonBuilder; + + double dlHigh = _ttof(lpszHigh); + double dlWeight = _ttof(lpszWeight); + double dlValue = dlWeight / (dlHigh * dlHigh); + if (dlValue < 18.5) + { + st_JsonObject["Result"] = "偏瘦"; + } + else if ((dlValue >= 18.5) && (dlValue <= 23.9)) + { + st_JsonObject["Result"] = "正常"; + } + else if ((dlValue >= 24) && (dlValue <= 27.9)) + { + st_JsonObject["Result"] = "超重"; + } + else if ((dlValue >= 28) && (dlValue < 30)) + { + st_JsonObject["Result"] = "肥胖"; + } + else if ((dlValue >= 30) && (dlValue < 40)) + { + st_JsonObject["Result"] = "重度肥胖"; + } + else if (dlValue >= 40) + { + st_JsonObject["Result"] = "极重度肥胖"; + } + st_JsonObject["flValue"] = dlValue; + st_JsonObject["flWeight"] = dlWeight; + st_JsonObject["flHigh"] = dlHigh; + + st_JsonRoot["data"] = st_JsonObject; + st_JsonRoot["code"] = 0; + st_JsonRoot["msg"] = "success"; + st_JsonBuilder["emitUTF8"] = true; + + *pInt_Len = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); + memcpy(ptszMsgBufer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_Len); + return TRUE; +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.h new file mode 100644 index 0000000000000000000000000000000000000000..9ffb474326a1d4b620531e7ed57e01dd9240e223 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.h @@ -0,0 +1,26 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 16:36:59 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex\Plugin_BMIndex.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex +// File Base: Plugin_BMIndex +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 标准身高体重 +// History: +*********************************************************************/ + +class CPlugin_BMIndex +{ +public: + CPlugin_BMIndex(); + ~CPlugin_BMIndex(); +public: + BOOL PluginCore_Init(LPVOID lParam); + BOOL PluginCore_UnInit(); + BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen); +protected: + BOOL Plugin_Timezone_BMIndex(LPCTSTR lpszHigh, LPCTSTR lpszWeight, TCHAR* ptszMsgBufer, int* pInt_Len); +private: +}; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/dllmain.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/dllmain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..daed8c8f7ac50ca1466016a0529648d18125a7e7 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : 定义 DLL 应用程序的入口点。 +#include "pch.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/framework.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/framework.h new file mode 100644 index 0000000000000000000000000000000000000000..80cbbc9b06a9b0141f92ee19eceaed71328caff4 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 +// Windows 头文件 +#include diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1e5d0a0331a2e21446e5c5cc0985ab740621fb69 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp @@ -0,0 +1,39 @@ +#include "pch.h" +#include "Plugin_BMIndex/Plugin_BMIndex.h" +/******************************************************************** +// Created: 2022/07/20 19:18:15 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\pch.cpp +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex +// File Base: pch +// File Ext: cpp +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 导出实现 +// History: +*********************************************************************/ +BOOL BMIndex_IsErrorOccur = FALSE; +DWORD BMIndex_dwErrorCode = 0; +////////////////////////////////////////////////////////////////////////// +CPlugin_BMIndex m_PluginBMIndex; +////////////////////////////////////////////////////////////////////////// +// 导出函数定义 +////////////////////////////////////////////////////////////////////////// +extern "C" DWORD PluginCore_GetLastError() +{ + return BMIndex_dwErrorCode; +} +/********************************************************************************* +* 导出函数定义 * +*********************************************************************************/ +extern "C" BOOL PluginCore_Init(LPVOID lParam) +{ + return m_PluginBMIndex.PluginCore_Init(lParam); +} +extern "C" BOOL PluginCore_UnInit() +{ + return m_PluginBMIndex.PluginCore_UnInit(); +} +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) +{ + return m_PluginBMIndex.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen); +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.h new file mode 100644 index 0000000000000000000000000000000000000000..44ce4344b593fda78909c718dfddd89133a66c43 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.h @@ -0,0 +1,59 @@ +// pch.h: 这是预编译标头文件。 +// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 +// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 +// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 +// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 + +#ifndef PCH_H +#define PCH_H + +#ifdef _MSC_BUILD +// 添加要在此处预编译的标头 +#include "framework.h" +#include +#endif // _MSC_BUILD +#endif //PCH_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "BMIndex_Define.h" +#include "BMIndex_Error.h" +using namespace std; +/******************************************************************** +// Created: 2022/07/20 10:23:48 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: pch +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 公用头文件 +// History: +*********************************************************************/ +extern BOOL BMIndex_IsErrorOccur; +extern DWORD BMIndex_dwErrorCode; + + +#ifdef _MSC_BUILD +#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") +#ifdef _DEBUG +#ifdef _WIN64 +#pragma comment(lib,"../../x64/Debug/jsoncpp") +#else +#pragma comment(lib,"../../Debug/jsoncpp") +#endif +#else +#ifdef _WIN64 +#pragma comment(lib,"../../x64/Release/jsoncpp") +#else +#pragma comment(lib,"../../Release/jsoncpp") +#endif +#endif +#endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile index f6fcfc9b92f6f326b00908f4d358012105c7729f..e5501821f177d73c08e09ce5f342ad9c4013f334 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp LIB = -lXEngine_BaseLib -ljsoncpp -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=../,--disable-new-dtags LIBINCLUDE = Plugin_Password.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Password.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Password.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) Plugin_Password.o:./Plugin_Password/Plugin_Password.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Password/Plugin_Password.cpp @@ -34,11 +45,11 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libModulePlugin_Password.so - cp ./libModulePlugin_Password.so ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Password.so +InstallSo:./libModulePlugin_Password.$(SHAREDLL) + cp ./libModulePlugin_Password.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Password.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h index 1b6b20064a047230cf1eb73aa8f10871b56ee4fa..999915f4d2e1b280f239c8171da8960940d3807d 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h @@ -48,4 +48,4 @@ extern "C" BOOL PluginCore_UnInit(); 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen); \ No newline at end of file +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0); \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp index 6832685728bfd6153e24ec2dbc3cd7d05528205c..c2f8353afe3216b5c2adacc6abd85d29dac1ba38 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp @@ -61,7 +61,7 @@ BOOL CPlugin_Password::PluginCore_UnInit() 意思:是否成功 备注: *********************************************************************/ -BOOL CPlugin_Password::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen) +BOOL CPlugin_Password::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) { Pass_IsErrorOccur = FALSE; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.h index ad98ad1e6d3b8c852e88a76c2a7d66803cbf94b6..775bc75e3ef01c7d2584c48d8a1fbc3ac409bd23 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.h +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.h @@ -19,7 +19,7 @@ public: public: BOOL PluginCore_Init(LPVOID lParam); BOOL PluginCore_UnInit(); - BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); + BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen); protected: BOOL Plugin_Password_Creator(LPCTSTR lpszPassType, LPCTSTR lpszLength, TCHAR* ptszPassStr); private: diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp index abc57012f3ccfc41f4e61dfbe8de83f94f11fc8e..d830cf1a4efa48132e8f76a9dd63a3b21bf8c299 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp @@ -33,7 +33,7 @@ extern "C" BOOL PluginCore_UnInit() { return m_PluginPass.PluginCore_UnInit(); } -extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen) +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) { - return m_PluginPass.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen); + return m_PluginPass.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen); } \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d6baa1af5080d492dc8a2d13f848fa2d19276351 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile @@ -0,0 +1,55 @@ +CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so +RELEASE = 0 +UNICODE = 0 +INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp +LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp +LIB = -lXEngine_BaseLib -ljsoncpp +LIBEX = -ldl -lpthread +LOADSO = -Wl,-rpath=../,--disable-new-dtags +LIBINCLUDE = Plugin_Timezone.o pch.o + +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + +ifeq ($(RELEASE),1) +FLAGS = -c -O2 +DEBUG = +else +FLAGS = -c +DEBUG = -g +endif + +ifeq ($(UNICODE),1) +UNICODE = -D _UNICODE +else +UNICODE = +endif + + +all:$(LIBINCLUDE) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Timezone.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + +Plugin_Timezone.o:./Plugin_Timezone/Plugin_Timezone.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Timezone/Plugin_Timezone.cpp + +pch.o:./pch.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp + + +InstallAll:InstallSo +InstallSo:./libModulePlugin_Timezone.$(SHAREDLL) + cp ./libModulePlugin_Timezone.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Timezone.$(SHAREDLL) + +CleanAll:CleanObj CleanMk +CleanObj: + rm *.o +CleanMk: + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.def b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.def new file mode 100644 index 0000000000000000000000000000000000000000..78dedee2f85146d24ce86f934777197f8ada61dd --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.def @@ -0,0 +1,8 @@ +LIBRARY + +EXPORTS + PluginCore_GetLastError + + PluginCore_Init + PluginCore_UnInit + PluginCore_Call \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..1af844b4014258b42d345a31d52dc6f1980aeafb --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {37b8e91f-ec52-41f0-b21d-441d4270c05f} + ModulePluginTimezone + 10.0 + + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + DynamicLibrary + true + v143 + MultiByte + + + DynamicLibrary + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib32);$(LibraryPath) + $(SolutionDir)$(Configuration)\XEngine_Plugin\ + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib32);$(LibraryPath) + $(SolutionDir)$(Configuration)\XEngine_Plugin\ + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib64);$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\ + + + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Lib64);$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\ + + + + Level3 + true + WIN32;_DEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + ModulePlugin_Timezone.def + + + + + Level3 + true + true + true + WIN32;NDEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + ModulePlugin_Timezone.def + + + + + Level3 + true + _DEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + ModulePlugin_Timezone.def + + + + + Level3 + true + true + true + NDEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + ModulePlugin_Timezone.def + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.filters b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..199b67ce03e524f9c516685df2e7c762db31cfd5 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {efd32df2-4d9e-4e1b-ab1a-6fbe715aaae7} + + + {2fc8c575-9c66-4d13-bd9d-ca41b3391e13} + + + + + 头文件 + + + 头文件 + + + 头文件\Plugin_Timezone + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件\Plugin_Timezone + + + + + 源文件 + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.user b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9d35ad628e9bb7044ffe1a576cc12550532735ba --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp @@ -0,0 +1,666 @@ +#include "pch.h" +#include "Plugin_Timezone.h" +/******************************************************************** +// Created: 2022/07/20 09:56:34 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone\Plugin_Timezone.cpp +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone +// File Base: Plugin_Timezone +// File Ext: cpp +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 时区工具库 +// History: +*********************************************************************/ +CPlugin_Timezone::CPlugin_Timezone() +{ +} +CPlugin_Timezone::~CPlugin_Timezone() +{ +} +////////////////////////////////////////////////////////////////////////// +// 公有函数 +////////////////////////////////////////////////////////////////////////// +/******************************************************************** +函数名称:PluginCore_Init +函数功能:初始化插件模块 + 参数.一:lParam + In/Out:In/Out + 类型:无类型指针 + 可空:N + 意思:自定义参数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_Timezone::PluginCore_Init(LPVOID lParam) +{ + Timezone_IsErrorOccur = FALSE; + + MODULEPLUGIN_TIMEZONE st_TimeZone; + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + + st_TimeZone.st_TimeZone.wHour = -12; + _tcscpy(st_TimeZone.tszTimeCountry, _T("国际日期变更线,西边")); + stl_MapTimezone.insert(make_pair(_T("IDLE"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -11; + _tcscpy(st_TimeZone.tszTimeCountry, _T("阿拉斯加诺姆时间")); + stl_MapTimezone.insert(make_pair(_T("NT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中阿拉斯加时间")); + stl_MapTimezone.insert(make_pair(_T("CAT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("夏威夷标准时间")); + stl_MapTimezone.insert(make_pair(_T("HST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("夏威夷-阿拉斯加标准时间")); + stl_MapTimezone.insert(make_pair(_T("AHST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -9; + st_TimeZone.st_TimeZone.wMinute = -30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("马克萨斯群岛时间")); + stl_MapTimezone.insert(make_pair(_T("MART"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -9; + _tcscpy(st_TimeZone.tszTimeCountry, _T("夏威夷/阿拉斯加夏时制")); + stl_MapTimezone.insert(make_pair(_T("HDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -9; + _tcscpy(st_TimeZone.tszTimeCountry, _T("阿拉斯加标准时间")); + stl_MapTimezone.insert(make_pair(_T("AKST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("育空地区标准时")); + stl_MapTimezone.insert(make_pair(_T("YST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("太平洋标准时间")); + stl_MapTimezone.insert(make_pair(_T("PST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("阿拉斯加白昼时间")); + stl_MapTimezone.insert(make_pair(_T("AKDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -7; + _tcscpy(st_TimeZone.tszTimeCountry, _T("太平洋夏时制")); + stl_MapTimezone.insert(make_pair(_T("PDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -7; + _tcscpy(st_TimeZone.tszTimeCountry, _T("山地标准时间")); + stl_MapTimezone.insert(make_pair(_T("MST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -6; + _tcscpy(st_TimeZone.tszTimeCountry, _T("山地夏时制")); + stl_MapTimezone.insert(make_pair(_T("MDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -6; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中部标准时间")); + stl_MapTimezone.insert(make_pair(_T("CST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("东部标准时间")); + stl_MapTimezone.insert(make_pair(_T("EST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中部夏时制")); + stl_MapTimezone.insert(make_pair(_T("CDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("大西洋阿雷格里港 标准时间")); + stl_MapTimezone.insert(make_pair(_T("ACT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("东部夏时制")); + stl_MapTimezone.insert(make_pair(_T("EDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("大西洋阿雷格里港夏令时")); + stl_MapTimezone.insert(make_pair(_T("ACST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("大西洋标准时间(加拿大)")); + stl_MapTimezone.insert(make_pair(_T("AST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -3; + st_TimeZone.st_TimeZone.wMinute = -30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("纽芬兰(Newfoundland)标准时间")); + stl_MapTimezone.insert(make_pair(_T("NST"), st_TimeZone)); + stl_MapTimezone.insert(make_pair(_T("NFT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("巴西利亚时间")); + stl_MapTimezone.insert(make_pair(_T("BRT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("大西洋夏时制")); + stl_MapTimezone.insert(make_pair(_T("ADT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -2; + st_TimeZone.st_TimeZone.wMinute = -30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("纽芬兰夏时制")); + stl_MapTimezone.insert(make_pair(_T("NDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("巴西利亚夏令时")); + stl_MapTimezone.insert(make_pair(_T("BRST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("巴西费尔南多·迪诺罗尼亚岛时间")); + stl_MapTimezone.insert(make_pair(_T("FNT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("巴西费尔南多·迪诺罗尼亚岛 夏令时")); + stl_MapTimezone.insert(make_pair(_T("FNST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = -1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("西非时间")); + stl_MapTimezone.insert(make_pair(_T("WAT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + _tcscpy(st_TimeZone.tszTimeCountry, _T("西欧")); + stl_MapTimezone.insert(make_pair(_T("WET"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + _tcscpy(st_TimeZone.tszTimeCountry, _T("和 UTC 相同")); + stl_MapTimezone.insert(make_pair(_T("ZULU"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + _tcscpy(st_TimeZone.tszTimeCountry, _T("校准的全球时间")); + stl_MapTimezone.insert(make_pair(_T("UTC"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + _tcscpy(st_TimeZone.tszTimeCountry, _T("全球时间")); + stl_MapTimezone.insert(make_pair(_T("UT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + _tcscpy(st_TimeZone.tszTimeCountry, _T("格林尼治标准时间")); + stl_MapTimezone.insert(make_pair(_T("GMT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("西欧光照利用时间")); + stl_MapTimezone.insert(make_pair(_T("WETDST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("瑞典冬时制")); + stl_MapTimezone.insert(make_pair(_T("SWT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("挪威标准时间")); + stl_MapTimezone.insert(make_pair(_T("NOR"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧时间")); + stl_MapTimezone.insert(make_pair(_T("MET"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("法国夏时制")); + stl_MapTimezone.insert(make_pair(_T("FST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("丹麦正规时间")); + stl_MapTimezone.insert(make_pair(_T("DNT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧时间")); + stl_MapTimezone.insert(make_pair(_T("CET"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 1; + _tcscpy(st_TimeZone.tszTimeCountry, _T("英国夏时制")); + stl_MapTimezone.insert(make_pair(_T("BST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("瑞典夏时制")); + stl_MapTimezone.insert(make_pair(_T("SST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧白昼时间")); + stl_MapTimezone.insert(make_pair(_T("METDST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧夏时制")); + stl_MapTimezone.insert(make_pair(_T("MEST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("以色列标准时间")); + stl_MapTimezone.insert(make_pair(_T("IST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("法国冬时制")); + stl_MapTimezone.insert(make_pair(_T("FWT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("东欧")); + stl_MapTimezone.insert(make_pair(_T("EET"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧夏时制")); + stl_MapTimezone.insert(make_pair(_T("CETDST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中欧夏令时")); + stl_MapTimezone.insert(make_pair(_T("CEST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 2; + _tcscpy(st_TimeZone.tszTimeCountry, _T("英国双重标准时间")); + stl_MapTimezone.insert(make_pair(_T("BDST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("希腊地中海时间")); + stl_MapTimezone.insert(make_pair(_T("HMT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("东欧夏时制")); + stl_MapTimezone.insert(make_pair(_T("EETDST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("巴格达时间")); + stl_MapTimezone.insert(make_pair(_T("BT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 3; + _tcscpy(st_TimeZone.tszTimeCountry, _T("科摩罗时间")); + stl_MapTimezone.insert(make_pair(_T("EAT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 3; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("伊朗时间")); + stl_MapTimezone.insert(make_pair(_T("IRT"), st_TimeZone)); + stl_MapTimezone.insert(make_pair(_T("IT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("塞舌尔马埃岛时间")); + stl_MapTimezone.insert(make_pair(_T("SCT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("法属留尼汪岛时间")); + stl_MapTimezone.insert(make_pair(_T("RET"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("毛里求斯时间")); + stl_MapTimezone.insert(make_pair(_T("MUT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 4; + _tcscpy(st_TimeZone.tszTimeCountry, _T("马达加斯加塔那那利佛时间")); + stl_MapTimezone.insert(make_pair(_T("EAST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 4; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("阿富汗时间")); + stl_MapTimezone.insert(make_pair(_T("AFT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("法属凯尔盖朗岛时间")); + stl_MapTimezone.insert(make_pair(_T("TFT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("马尔代夫时间")); + stl_MapTimezone.insert(make_pair(_T("MVT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 5; + _tcscpy(st_TimeZone.tszTimeCountry, _T("英属印度洋领地时间")); + stl_MapTimezone.insert(make_pair(_T("IOT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 6; + _tcscpy(st_TimeZone.tszTimeCountry, _T("哈萨克斯坦阿拉木图")); + stl_MapTimezone.insert(make_pair(_T("ALMT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 6; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("缅甸时间")); + stl_MapTimezone.insert(make_pair(_T("MMT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 7; + _tcscpy(st_TimeZone.tszTimeCountry, _T("澳大利亚圣诞岛时间")); + stl_MapTimezone.insert(make_pair(_T("CXT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 7; + _tcscpy(st_TimeZone.tszTimeCountry, _T("阿拉木图")); + stl_MapTimezone.insert(make_pair(_T("ALMST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 7; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("爪哇时间")); + stl_MapTimezone.insert(make_pair(_T("JT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("西澳大利亚标准时间")); + stl_MapTimezone.insert(make_pair(_T("WST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中国北京时间")); + stl_MapTimezone.insert(make_pair(_T("CCT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 8; + _tcscpy(st_TimeZone.tszTimeCountry, _T("澳大利亚西部标准时间")); + stl_MapTimezone.insert(make_pair(_T("AWST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 9; + _tcscpy(st_TimeZone.tszTimeCountry, _T("韩国朝鲜标准时间")); + stl_MapTimezone.insert(make_pair(_T("KST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 9; + _tcscpy(st_TimeZone.tszTimeCountry, _T("日本标准时间")); + stl_MapTimezone.insert(make_pair(_T("JST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 9; + _tcscpy(st_TimeZone.tszTimeCountry, _T("马绍尔群岛瓜加林岛时间")); + stl_MapTimezone.insert(make_pair(_T("MHT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 9; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中澳大利亚标准时间")); + stl_MapTimezone.insert(make_pair(_T("CAST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 9; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("南澳大利亚标准时间")); + stl_MapTimezone.insert(make_pair(_T("SAST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("澳大利亚墨尔本")); + stl_MapTimezone.insert(make_pair(_T("LIGT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("关岛标准时间")); + stl_MapTimezone.insert(make_pair(_T("GST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("东澳大利亚标准时间")); + stl_MapTimezone.insert(make_pair(_T("EAST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + _tcscpy(st_TimeZone.tszTimeCountry, _T("澳大利亚东部标准时间")); + stl_MapTimezone.insert(make_pair(_T("AEST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("南澳大利亚夏时制")); + stl_MapTimezone.insert(make_pair(_T("SADT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中澳大利亚夏时制")); + stl_MapTimezone.insert(make_pair(_T("CADT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 10; + st_TimeZone.st_TimeZone.wMinute = 30; + _tcscpy(st_TimeZone.tszTimeCountry, _T("中澳大利亚标准夏时制")); + stl_MapTimezone.insert(make_pair(_T("ACSST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 11; + _tcscpy(st_TimeZone.tszTimeCountry, _T("澳大利亚东部标准夏时制")); + stl_MapTimezone.insert(make_pair(_T("AESST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 12; + _tcscpy(st_TimeZone.tszTimeCountry, _T("新西兰标准时间")); + stl_MapTimezone.insert(make_pair(_T("NZST"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 12; + _tcscpy(st_TimeZone.tszTimeCountry, _T("新西兰时间")); + stl_MapTimezone.insert(make_pair(_T("NZT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 12; + _tcscpy(st_TimeZone.tszTimeCountry, _T("国际日期变更线,东边")); + stl_MapTimezone.insert(make_pair(_T("IDLW"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 13; + _tcscpy(st_TimeZone.tszTimeCountry, _T("新西兰夏时制")); + stl_MapTimezone.insert(make_pair(_T("NZDT"), st_TimeZone)); + + memset(&st_TimeZone, '\0', sizeof(MODULEPLUGIN_TIMEZONE)); + st_TimeZone.st_TimeZone.wHour = 14; + _tcscpy(st_TimeZone.tszTimeCountry, _T("基里巴斯线岛时间")); + stl_MapTimezone.insert(make_pair(_T("KLT"), st_TimeZone)); + return TRUE; +} +/******************************************************************** +函数名称:PluginCore_UnInit +函数功能:卸载插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_Timezone::PluginCore_UnInit() +{ + Timezone_IsErrorOccur = FALSE; + + stl_MapTimezone.clear(); + return TRUE; +} +/******************************************************************** +函数名称:PluginCore_Call +函数功能:调用插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +BOOL CPlugin_Timezone::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) +{ + Timezone_IsErrorOccur = FALSE; + + if ((NULL == pInt_HTTPCode) || (NULL == ptszMsgBuffer) || (NULL == pInt_MsgLen)) + { + Timezone_IsErrorOccur = TRUE; + Timezone_dwErrorCode = ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_TIMEZONE_PARAMENT; + return FALSE; + } + TCHAR tszKeyName[128]; + TCHAR tszParamType[128]; + TCHAR tszParamCvt[128]; + TCHAR tszParamTime[128]; + + memset(tszKeyName, '\0', sizeof(tszKeyName)); + memset(tszParamType, '\0', sizeof(tszParamType)); + memset(tszParamCvt, '\0', sizeof(tszParamCvt)); + memset(tszParamTime, '\0', sizeof(tszParamTime)); + + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); + if (0 == _ttoi(tszParamType)) + { + //如果是统计 + Plugin_Timezone_Count(ptszMsgBuffer, pInt_MsgLen); + } + else if (1 == _ttoi(tszParamType)) + { + //如果是列举 + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); + Plugin_Timezone_List(tszParamCvt, ptszMsgBuffer, pInt_MsgLen); + } + else if (2 == _ttoi(tszParamType)) + { + //如果是转换 + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); + BaseLib_OperatorString_GetKeyValue((*pppHDRList)[3], "=", tszKeyName, tszParamTime); + if (!Plugin_Timezone_Convert(tszParamCvt, tszParamTime, ptszMsgBuffer, pInt_MsgLen)) + { + *pInt_HTTPCode = 404; + return FALSE; + } + } + *pInt_HTTPCode = 200; + + return TRUE; +} +////////////////////////////////////////////////////////////////////////// +// 保护函数 +////////////////////////////////////////////////////////////////////////// +BOOL CPlugin_Timezone::Plugin_Timezone_Count(TCHAR* ptszMsgBufer, int* pInt_Len) +{ + Timezone_IsErrorOccur = FALSE; + + Json::Value st_JsonRoot; + Json::Value st_JsonObject; + Json::StreamWriterBuilder st_JsonBuilder; + + st_JsonObject["Count"] = stl_MapTimezone.size(); + st_JsonRoot["data"] = st_JsonObject; + st_JsonRoot["code"] = 0; + st_JsonRoot["msg"] = "success"; + st_JsonBuilder["emitUTF8"] = true; + + *pInt_Len = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); + memcpy(ptszMsgBufer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_Len); + return TRUE; +} +BOOL CPlugin_Timezone::Plugin_Timezone_List(LPCTSTR lpszConvert, TCHAR* ptszMsgBufer, int* pInt_Len) +{ + Timezone_IsErrorOccur = FALSE; + + int nPosStart = 0; + int nPosEnd = 0; + Json::Value st_JsonRoot; + Json::Value st_JsonObject; + Json::StreamWriterBuilder st_JsonBuilder; + + _stscanf(lpszConvert, _T("%d-%d"), &nPosStart, &nPosEnd); + + unordered_map::const_iterator stl_MapIterator = stl_MapTimezone.cbegin(); + for (int i = 0; stl_MapIterator != stl_MapTimezone.cend(); stl_MapIterator++, i++) + { + if ((nPosEnd >= i) && (nPosStart <= i)) + { + Json::Value st_JsonArray; + st_JsonArray["tszTimeZone"] = stl_MapIterator->first.c_str(); + st_JsonArray["tszTimeCountry"] = stl_MapIterator->second.tszTimeCountry; + st_JsonObject.append(st_JsonArray); + } + } + st_JsonRoot["Array"] = st_JsonObject; + st_JsonRoot["Count"] = nPosEnd - nPosStart; + st_JsonRoot["nPosStat"] = nPosStart; + st_JsonRoot["nPosEnd"] = nPosEnd; + st_JsonRoot["code"] = 0; + st_JsonRoot["msg"] = "success"; + st_JsonBuilder["emitUTF8"] = true; + + *pInt_Len = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); + memcpy(ptszMsgBufer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_Len); + return TRUE; +} +BOOL CPlugin_Timezone::Plugin_Timezone_Convert(LPCTSTR lpszConvert, LPCTSTR lpszTimeStr, TCHAR* ptszMsgBufer, int* pInt_Len) +{ + Timezone_IsErrorOccur = FALSE; + + Json::Value st_JsonRoot; + Json::Value st_JsonObject; + Json::StreamWriterBuilder st_JsonBuilder; + + unordered_map::const_iterator stl_MapIterator = stl_MapTimezone.find(lpszConvert); + if (stl_MapIterator == stl_MapTimezone.end()) + { + return FALSE; + } + TCHAR tszTimeStr[64]; + XENGINE_LIBTIMER st_TimeStart; + XENGINE_LIBTIMER st_TimeEnd; + + memset(tszTimeStr, '\0', sizeof(tszTimeStr)); + memset(&st_TimeStart, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_TimeEnd, '\0', sizeof(XENGINE_LIBTIMER)); + + st_TimeEnd = stl_MapIterator->second.st_TimeZone; + + _stscanf(lpszTimeStr, _T("%04d-%02d-%02d_%02d:%02d:%02d"), &st_TimeStart.wYear, &st_TimeStart.wMonth, &st_TimeStart.wDay, &st_TimeStart.wHour, &st_TimeStart.wMinute, &st_TimeStart.wSecond); + BaseLib_OperatorTimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); + _stprintf(tszTimeStr, _T("%04d-%02d-%02d %02d:%02d:%02d"), st_TimeEnd.wYear, st_TimeEnd.wMonth, st_TimeEnd.wDay, st_TimeEnd.wHour, st_TimeEnd.wMinute, st_TimeEnd.wSecond); + + st_JsonObject["tszTimeStr"] = tszTimeStr; + st_JsonObject["tszTimeZone"] = stl_MapIterator->first.c_str(); + st_JsonObject["tszTimeCountry"] = stl_MapIterator->second.tszTimeCountry; + st_JsonRoot["data"] = st_JsonObject; + st_JsonRoot["code"] = 0; + st_JsonRoot["msg"] = "success"; + st_JsonBuilder["emitUTF8"] = true; + + *pInt_Len = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); + memcpy(ptszMsgBufer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_Len); + return TRUE; +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.h new file mode 100644 index 0000000000000000000000000000000000000000..1aac345412a2addf7a8fb281a9bc6377a02423d4 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.h @@ -0,0 +1,35 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 09:56:02 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone\Plugin_Timezone.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone +// File Base: Plugin_Timezone +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 时区工具库 +// History: +*********************************************************************/ +typedef struct +{ + XENGINE_LIBTIMER st_TimeZone; + TCHAR tszTimeCountry[MAX_PATH]; +}MODULEPLUGIN_TIMEZONE; + + +class CPlugin_Timezone +{ +public: + CPlugin_Timezone(); + ~CPlugin_Timezone(); +public: + BOOL PluginCore_Init(LPVOID lParam); + BOOL PluginCore_UnInit(); + BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen); +protected: + BOOL Plugin_Timezone_Count(TCHAR* ptszMsgBufer, int* pInt_Len); + BOOL Plugin_Timezone_List(LPCTSTR lpszConvert, TCHAR* ptszMsgBufer, int* pInt_Len); + BOOL Plugin_Timezone_Convert(LPCTSTR lpszConvert, LPCTSTR lpszTimeStr, TCHAR* ptszMsgBufer, int* pInt_Len); +private: + unordered_map stl_MapTimezone; +}; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h new file mode 100644 index 0000000000000000000000000000000000000000..f3077a6f3d3b3af32d488941bfc5e8638f03009c --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h @@ -0,0 +1,51 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 09:57:09 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Define.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: Timezone_Define +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 时区工具导出定义 +// History: +*********************************************************************/ +////////////////////////////////////////////////////////////////////////// +// 导出函数定义 +////////////////////////////////////////////////////////////////////////// +extern "C" DWORD PluginCore_GetLastError(); +/********************************************************************************* +* 导出函数定义 * +*********************************************************************************/ +/******************************************************************** +函数名称:PluginCore_Init +函数功能:初始化插件模块 + 参数.一:lParam + In/Out:In/Out + 类型:无类型指针 + 可空:N + 意思:自定义参数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL); +/******************************************************************** +函数名称:PluginCore_UnInit +函数功能:卸载插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_UnInit(); +/******************************************************************** +函数名称:PluginCore_Call +函数功能:调用插件 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0); \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Error.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Error.h new file mode 100644 index 0000000000000000000000000000000000000000..c016cba4080f78b89674d2f55145d95063668eda --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Error.h @@ -0,0 +1,16 @@ +#pragma once +/******************************************************************** +// Created: 2022/07/20 09:57:23 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Error.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: Timezone_Error +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 时区错误 +// History: +*********************************************************************/ +////////////////////////////////////////////////////////////////////////// +// 错误定义 +////////////////////////////////////////////////////////////////////////// +#define ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_TIMEZONE_PARAMENT 0x13001 //参数错误 \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/dllmain.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/dllmain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..daed8c8f7ac50ca1466016a0529648d18125a7e7 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : 定义 DLL 应用程序的入口点。 +#include "pch.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/framework.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/framework.h new file mode 100644 index 0000000000000000000000000000000000000000..80cbbc9b06a9b0141f92ee19eceaed71328caff4 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 +// Windows 头文件 +#include diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7b86a46e51dc996026de47d87f4741c3534cd84b --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp @@ -0,0 +1,39 @@ +#include "pch.h" +#include "Plugin_Timezone/Plugin_Timezone.h" +/******************************************************************** +// Created: 2022/07/20 11:44:22 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.cpp +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: pch +// File Ext: cpp +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 导出实现 +// History: +*********************************************************************/ +BOOL Timezone_IsErrorOccur = FALSE; +DWORD Timezone_dwErrorCode = 0; +////////////////////////////////////////////////////////////////////////// +CPlugin_Timezone m_PluginTimes; +////////////////////////////////////////////////////////////////////////// +// 导出函数定义 +////////////////////////////////////////////////////////////////////////// +extern "C" DWORD PluginCore_GetLastError() +{ + return Timezone_dwErrorCode; +} +/********************************************************************************* +* 导出函数定义 * +*********************************************************************************/ +extern "C" BOOL PluginCore_Init(LPVOID lParam) +{ + return m_PluginTimes.PluginCore_Init(lParam); +} +extern "C" BOOL PluginCore_UnInit() +{ + return m_PluginTimes.PluginCore_UnInit(); +} +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) +{ + return m_PluginTimes.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen); +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.h new file mode 100644 index 0000000000000000000000000000000000000000..f4618ee19bdcefd825aef75c64921862ef9e6b88 --- /dev/null +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.h @@ -0,0 +1,59 @@ +// pch.h: 这是预编译标头文件。 +// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 +// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 +// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 +// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 + +#ifndef PCH_H +#define PCH_H + +#ifdef _MSC_BUILD +// 添加要在此处预编译的标头 +#include "framework.h" +#include +#endif // _MSC_BUILD +#endif //PCH_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Timezone_Define.h" +#include "Timezone_Error.h" +using namespace std; +/******************************************************************** +// Created: 2022/07/20 10:23:48 +// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.h +// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone +// File Base: pch +// File Ext: h +// Project: XEngine(网络通信引擎) +// Author: qyt +// Purpose: 公用头文件 +// History: +*********************************************************************/ +extern BOOL Timezone_IsErrorOccur; +extern DWORD Timezone_dwErrorCode; + + +#ifdef _MSC_BUILD +#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") +#ifdef _DEBUG +#ifdef _WIN64 +#pragma comment(lib,"../../x64/Debug/jsoncpp") +#else +#pragma comment(lib,"../../Debug/jsoncpp") +#endif +#else +#ifdef _WIN64 +#pragma comment(lib,"../../x64/Release/jsoncpp") +#else +#pragma comment(lib,"../../Release/jsoncpp") +#endif +#endif +#endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile index 5c14e50e1e1389a1199d5a0f14a3eb7763da4dd3..08580dc71de086247d32657f5d6d7d38509bf206 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile @@ -1,19 +1,30 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp LIB = -lXEngine_BaseLib -lXEngine_Algorithm -ljsoncpp -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=../,--disable-new-dtags LIBINCLUDE = Plugin_Zodiac.o pch.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Zodiac.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Zodiac.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) Plugin_Zodiac.o:./Plugin_Zodiac/Plugin_Zodiac.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Zodiac/Plugin_Zodiac.cpp @@ -34,11 +45,11 @@ pch.o:./pch.cpp InstallAll:InstallSo -InstallSo:./libModulePlugin_Zodiac.so - cp ./libModulePlugin_Zodiac.so ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Zodiac.so +InstallSo:./libModulePlugin_Zodiac.$(SHAREDLL) + cp ./libModulePlugin_Zodiac.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Zodiac.$(SHAREDLL) CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so \ No newline at end of file + rm *.$(SHAREDLL) \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h index 07d46736a0317b228884a695e3102e046a0bf53c..dfde76c3b88a24b2c82b3b44d149cedb8ab1c32f 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h @@ -48,4 +48,4 @@ extern "C" BOOL PluginCore_UnInit(); 意思:是否成功 备注: *********************************************************************/ -extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen); \ No newline at end of file +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0); \ No newline at end of file diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp index 60325d076428c6781b246d4283ecedf85ec092d3..9f8311174c475d40790711db7c185e525967a43e 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp @@ -73,7 +73,7 @@ BOOL CPlugin_Zodiac::PluginCore_UnInit() 意思:是否成功 备注: *********************************************************************/ -BOOL CPlugin_Zodiac::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen) +BOOL CPlugin_Zodiac::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) { Zodiac_IsErrorOccur = FALSE; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.h index 7f4fefe7719a7081a6956796b9b319763b9e54c2..207703e90613e04b5deff33f15903e2a2d8d95b9 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.h +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.h @@ -19,7 +19,7 @@ public: public: BOOL PluginCore_Init(LPVOID lParam); BOOL PluginCore_UnInit(); - BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen); + BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen); protected: BOOL Plugin_Zodiac_Chinese(LPCTSTR lpszDate, TCHAR* ptszCZodiac); BOOL Plugin_Zodiac_English(LPCTSTR lpszDate, TCHAR* ptszEZodiac); diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp index e4812df662411f509e58941c2df304a7b2ea0f26..8d046c5485879859e21b7a5f994cc2efca144d70 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp @@ -33,7 +33,7 @@ extern "C" BOOL PluginCore_UnInit() { return m_PluginZodiac.PluginCore_UnInit(); } -extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen) +extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen) { - return m_PluginZodiac.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen); + return m_PluginZodiac.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen); } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile index b06de8a9a4ad8cb91a14b104345853b46089e17e..3afb6575f267fb38132d7e336be3d32531984fbc 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile @@ -3,21 +3,25 @@ RELEASE = 0 UNICODE = 0 LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -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_ModuleConfigure -L ../../XEngine_ModuleDatabase -L ../../XEngine_ModuleProtocol -L ../../XEngine_ModuleHelp -L ../../XEngine_ModulePlugin \ - -L ../../XEngine_ThirdPart/jsoncpp -L ../../XEngine_ThirdPart/opencc/ubuntu + -L ../../XEngine_ThirdPart/jsoncpp LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lHelpComponents_XLog -lRfcComponents_HttpServer -lNetHelp_APIHelp \ -lXEngine_ModuleConfigure -lXEngine_ModuleDatabase -lXEngine_ModuleProtocol -lXEngine_ModuleHelp -lXEngine_ModulePlugin \ - -ljsoncpp -lopencc -LIBEX = -static-libgcc -ldl -lrt -lpthread + -ljsoncpp +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath=./,--disable-new-dtags LIBINCLUDE = XEngine_Configure.o XEngine_Network.o XEngine_HTTPTask.o XEngine_PluginTask.o XEngine_HttpApp.o \ - HTTPTask_IPInfo.o HTTPTask_IDCard.o HTTPTask_Phone.o HTTPTask_Bank.o HTTPTask_Language.o HTTPTask_Translation.o HTTPTask_P2PClient.o + HTTPTask_IPInfo.o HTTPTask_IDCard.o HTTPTask_Phone.o HTTPTask_Bank.o HTTPTask_Language.o HTTPTask_Translation.o HTTPTask_P2PClient.o HTTPTask_OPtions.o + +ifeq ($(shell uname),Darwin) + LOADSO = +endif ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -52,6 +56,8 @@ HTTPTask_Translation.o:./XEngine_HTTPTask/HTTPTask_Translation.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_Translation.cpp HTTPTask_P2PClient.o:./XEngine_HTTPTask/HTTPTask_P2PClient.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_P2PClient.cpp +HTTPTask_OPtions.o:./XEngine_HTTPTask/HTTPTask_OPtions.cpp + $(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_OPtions.cpp XEngine_HttpApp.o:./XEngine_HttpApp.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HttpApp.cpp diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp index e30435034e13cfe73fa97302fc9cd376cbbf4b64..9143a9d3ecaab88a10d9086410e888fc49f4dbd3 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp @@ -13,11 +13,17 @@ BOOL XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pSt_Configure) { LPCTSTR lpszConfigFile = _T("./XEngine_Config/XEngine_Config.json"); + LPCTSTR lpszOPtionFile = _T("./XEngine_Config/XEngine_OPtionConfig.json"); if (!ModuleConfigure_Json_File(lpszConfigFile, pSt_Configure)) { printf("解析配置文件失败,ModuleConfigure_Json_File:%lX\n", ModuleConfigure_GetLastError()); return FALSE; + } + if (!ModuleConfigure_File_OPtion(lpszOPtionFile, &st_OPtionList)) + { + printf("解析配置文件失败,ModuleConfigure_File_OPtion:%lX\n", ModuleConfigure_GetLastError()); + return FALSE; } for (int i = 0; i < argc; i++) diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp index 48a9e3717ff339e1724c300d42977f502af17a73..25993c7259c22f3188b6275ff56d04c83ab753d9 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp @@ -89,6 +89,7 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR LPCTSTR lpszFuncName = _T("api"); LPCTSTR lpszParamFuncKey = _T("function"); LPCTSTR lpszParamName = _T("params1"); + LPCTSTR lpszParamOPtions = _T("options"); LPCTSTR lpszParamIPAddr = _T("ip"); LPCTSTR lpszParamIDCard = _T("id"); LPCTSTR lpszParamPhone = _T("phone"); @@ -148,9 +149,14 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR } else if (0 == _tcsnicmp(lpszMethodGet, pSt_HTTPParam->tszHttpMethod, _tcslen(lpszMethodGet))) { - //是不是ip查询 - if (0 == _tcsnicmp(lpszParamIPAddr, tszValue, _tcslen(lpszParamIPAddr))) + if (0 == _tcsnicmp(lpszParamOPtions, tszValue, _tcslen(lpszParamOPtions))) { + //HTTP能力查询 + XEngine_HTTPTask_OPTions(lpszClientAddr); + } + else if (0 == _tcsnicmp(lpszParamIPAddr, tszValue, _tcslen(lpszParamIPAddr))) + { + //是不是ip查询 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb7cddb4579b901060cc8b8169ce1d830fccb146 --- /dev/null +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.cpp @@ -0,0 +1,37 @@ +#include "../XEngine_Hdr.h" + + +BOOL XEngine_HTTPTask_OPTions(LPCTSTR lpszClientAddr) +{ + int nMsgLen = 4096; + int nPktLen = 4096; + TCHAR tszMsgBuffer[4096]; + TCHAR tszPktBuffer[4096]; + RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 + + memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); + memset(tszPktBuffer, '\0', sizeof(tszPktBuffer)); + memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); + + st_HDRParam.nHttpCode = 200; //HTTP CODE码 + st_HDRParam.bIsClose = TRUE; //收到回复后就关闭 + //解析能力配置 + XENGINE_OPTIONLIST st_OPtionList; + LPCTSTR lpszOPFile = _T("./XEngine_Config/XEngine_OPtionConfig.json"); + FILE* pSt_File = _tfopen(lpszOPFile, _T("rb")); + if (NULL == pSt_File) + { + st_HDRParam.nHttpCode = 404; + RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); + XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,查询服务器能力失败,没有找到配置文件"), lpszClientAddr); + return FALSE; + } + nPktLen = fread(tszPktBuffer, 1, nPktLen, pSt_File); + fclose(pSt_File); + //打包发送 + RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); + XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,查询服务器能力成功"), lpszClientAddr); + return TRUE; +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.h new file mode 100644 index 0000000000000000000000000000000000000000..e6188d8779c7a796e7460a3580461f9de31f7b8a --- /dev/null +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_OPtions.h @@ -0,0 +1,3 @@ +#pragma once + +BOOL XEngine_HTTPTask_OPTions(LPCTSTR lpszClientAddr); \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h index 8d838f682e4dd6b66000cb198dc90d4ff1253f35..121b5ae23e446b4f77fb66c25d82fb337270b4c0 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h @@ -63,6 +63,7 @@ using namespace std; #include "XEngine_HTTPTask/HTTPTask_Language.h" #include "XEngine_HTTPTask/HTTPTask_Translation.h" #include "XEngine_HTTPTask/HTTPTask_P2PClient.h" +#include "XEngine_HTTPTask/HTTPTask_OPtions.h" /******************************************************************** // Created: 2022/01/20 14:42:06 // File Name: D:\XEngine_ServiceApp\XEngine_Source\XEngine_ServiceApp\XEngine_HttpApp\XEngine_Hdr.h @@ -77,14 +78,15 @@ using namespace std; extern BOOL bIsRun; extern XLOG xhLog; //HTTP服务器 -extern XNETHANDLE xhHTTPSocket; -extern XNETHANDLE xhHTTPHeart; -extern XNETHANDLE xhHTTPPool; +extern XHANDLE xhHTTPSocket; +extern XHANDLE xhHTTPHeart; extern XHANDLE xhHTTPPacket; +extern XNETHANDLE xhHTTPPool; //配置文件 extern XENGINE_SERVICECONFIG st_ServiceConfig; extern XENGINE_OPENCCCONFIG st_OPenccConfig; extern XENGINE_PLUGINCONFIG st_PluginConfig; +extern XENGINE_OPTIONLIST st_OPtionList; //连接库 #ifdef _WINDOWS #ifdef _WIN64 diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp index 8b25c75342f3205ef17bf1e6032fe71d0a30e9ba..7aaded20deb4e72bd84afef595117da151a78deb 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp @@ -13,14 +13,15 @@ BOOL bIsRun = FALSE; XLOG xhLog = NULL; //HTTP服务器 -XNETHANDLE xhHTTPSocket = 0; -XNETHANDLE xhHTTPHeart = 0; -XNETHANDLE xhHTTPPool = 0; +XHANDLE xhHTTPSocket = NULL; +XHANDLE xhHTTPHeart = NULL; XHANDLE xhHTTPPacket = NULL; +XNETHANDLE xhHTTPPool = 0; //配置文件 XENGINE_SERVICECONFIG st_ServiceConfig; XENGINE_OPENCCCONFIG st_OPenccConfig; XENGINE_PLUGINCONFIG st_PluginConfig; +XENGINE_OPTIONLIST st_OPtionList; void ServiceApp_Stop(int signo) { @@ -39,10 +40,10 @@ void ServiceApp_Stop(int signo) ModuleDatabase_Phone_Destory(); ModuleDatabase_Bank_Destory(); //销毁其他 + ModulePlugin_Core_Destroy(); ModuleHelp_P2PClient_Destory(); //销毁日志资源 HelpComponents_XLog_Destroy(xhLog); - ModulePlugin_Core_Destroy(); } #ifdef _WINDOWS WSACleanup(); @@ -187,19 +188,21 @@ int main(int argc, char** argv) //启动心跳 if (st_ServiceConfig.st_XTime.nHTTPTimeOut > 0) { - if (!SocketOpt_HeartBeat_InitEx(&xhHTTPHeart, st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck, Network_Callback_HTTPHeart)) + xhHTTPHeart = SocketOpt_HeartBeat_InitEx(st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck, Network_Callback_HTTPHeart); + if (NULL == xhHTTPHeart) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化HTTP心跳服务失败,错误:%lX"), NetCore_GetLastError()); goto XENGINE_SERVICEAPP_EXIT; } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化HTTP心跳服务成功,句柄:%llu,时间:%d,次数:%d"), xhHTTPHeart, st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化HTTP心跳服务成功,时间:%d,次数:%d"), st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck); } else { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("启动服务中,HTTP心跳服务被设置为不启用")); } //网络 - if (!NetCore_TCPXCore_StartEx(&xhHTTPSocket, st_ServiceConfig.nHttpPort, st_ServiceConfig.st_XMax.nMaxClient, st_ServiceConfig.st_XMax.nIOThread)) + xhHTTPSocket = NetCore_TCPXCore_StartEx(st_ServiceConfig.nHttpPort, st_ServiceConfig.st_XMax.nMaxClient, st_ServiceConfig.st_XMax.nIOThread); + if (NULL == xhHTTPSocket) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,启动HTTP网络服务器失败,错误:%lX"), NetCore_GetLastError()); goto XENGINE_SERVICEAPP_EXIT; @@ -242,9 +245,8 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化插件系统失败,错误:%lX"), ModulePlugin_GetLastError()); goto XENGINE_SERVICEAPP_EXIT; } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化插件系统成功")); //加载插件 - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,开始加载插件,总共:%d 插件"), st_PluginConfig.pStl_ListPlugin->size()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化插件系统成功,开始加载插件")); { list::const_iterator stl_ListIterator = st_PluginConfig.pStl_ListPlugin->begin(); for (int i = 1; stl_ListIterator != st_PluginConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++) @@ -266,9 +268,11 @@ int main(int argc, char** argv) } } } + //展示能力 + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,加载的基本查询服务总:%d 个,插件:%d 个"), st_OPtionList.stl_ListBase.size(), st_OPtionList.stl_ListPlug.size()); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("所有服务成功启动,服务运行中,发行版本次数:%d,当前版本:%s。。。"), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str()); - while (bIsRun) + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("所有服务成功启动,服务运行中,XEngine版本:%s,发行版本次数:%d,当前版本:%s。。。"), BaseLib_OperatorVer_XGetStr(), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str()); + while (TRUE) { std::this_thread::sleep_for(std::chrono::seconds(1)); } @@ -289,10 +293,10 @@ XENGINE_SERVICEAPP_EXIT: ModuleDatabase_Phone_Destory(); ModuleDatabase_Bank_Destory(); //销毁其他 + ModulePlugin_Core_Destroy(); ModuleHelp_P2PClient_Destory(); //销毁日志资源 HelpComponents_XLog_Destroy(xhLog); - ModulePlugin_Core_Destroy(); } #ifdef _WINDOWS WSACleanup(); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj index d73a5636f4278f1dbb363cd579106cbd54763228..aaec63a62de9af7c8f94081144538d303e02103d 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj @@ -160,6 +160,7 @@ + @@ -174,6 +175,7 @@ + diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters index 3cfc9236ccd338e9151471e88d75d2773017eb9d..139a15ca4f8ad5cbaba291ec1dd43a005402c50d 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters @@ -57,6 +57,9 @@ 源文件\XEngine_HTTPTask + + 源文件\XEngine_HTTPTask + @@ -95,5 +98,8 @@ 头文件\XEngine_HTTPTask + + 头文件\XEngine_HTTPTask + \ No newline at end of file diff --git a/XEngine_Source/XEngine_ThirdPart/jsoncpp/Makefile b/XEngine_Source/XEngine_ThirdPart/jsoncpp/Makefile index 30dbd85ab2df273f2653cfe72e063176644ad6a8..4611006188f7ccdafb5a938e3945c45a1fd2affa 100644 --- a/XEngine_Source/XEngine_ThirdPart/jsoncpp/Makefile +++ b/XEngine_Source/XEngine_ThirdPart/jsoncpp/Makefile @@ -1,20 +1,31 @@ CC = g++ -Wall -std=c++17 -fPIC +SHAREFLAG = -shared +SHAREDLL = so RELEASE = 0 UNICODE = 0 INCLUDE = -I ./ FILECENTOS = /etc/redhat-release LOADBIN = LIB = -LIBEX = -static-libgcc -lrt -ldl -lpthread +LIBEX = -ldl -lpthread LOADSO = -Wl,-rpath= LIBINCLUDE = json_reader.o json_value.o json_writer.o +ifeq ($(shell uname),Darwin) + SHAREDLL = dylib + SHAREFLAG = -dynamiclib + LOADSO = +else + SHAREDLL = so + SHAREFLAG = -shared +endif + ifeq ($(RELEASE),1) FLAGS = -c -O2 DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg +FLAGS = -c +DEBUG = -g endif ifeq ($(UNICODE),1) @@ -24,7 +35,7 @@ UNICODE = endif all:$(LIBINCLUDE) - $(CC) $(DEBUG) $(LIBINCLUDE) -o libjsoncpp.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) + $(CC) $(DEBUG) $(LIBINCLUDE) -o libjsoncpp.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO) json_reader.o:json_reader.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) json_reader.cpp @@ -34,8 +45,8 @@ json_writer.o:json_writer.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) json_writer.cpp InstallAll:InstallSo -InstallSo:./libjsoncpp.so - cp ./libjsoncpp.so ../../../XEngine_Release/libjsoncpp.so +InstallSo:./libjsoncpp.$(SHAREDLL) + cp ./libjsoncpp.$(SHAREDLL) ../../../XEngine_Release/libjsoncpp.$(SHAREDLL) @@ -43,4 +54,4 @@ CleanAll:CleanObj CleanMk CleanObj: rm *.o CleanMk: - rm *.so + rm *.$(SHAREDLL) diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/ubuntu/libopencc.so b/XEngine_Source/XEngine_ThirdPart/opencc/ubuntu/libopencc.so deleted file mode 100644 index c294133fb0e9972e6d3f0f8bb760a441f2b37718..0000000000000000000000000000000000000000 Binary files a/XEngine_Source/XEngine_ThirdPart/opencc/ubuntu/libopencc.so and /dev/null differ