diff --git a/CHANGELOG b/CHANGELOG
index c00d7549bad0f6b104713ca32736a233a7da150b..bcc6b156f04c149d62d62d3f6d8250a61a4a5e9e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,27 @@
+XEngine_APIService V2.6.0.1001
+
+添加:lua插件支持
+添加:加载器的lua插件支持
+修改:插件模块输出目录
+修改:lib代码插件名称修改
+修改:opencc库修改为vcpkg安装了
+修改:PluginCore_UnInit的返回值为void
+修改:输出插件统计
+修复:不需要的插件加载器错误
+修复:执行插件失败没有提示的问题
+删除:选项配置plugin字段
+
+added:lua plugin support
+added:lua plugin core and lug loader supported
+modify:plugin module print dir
+modify:lib code name changed
+modify:opencc library changed vcpkg to install
+modify:PluginCore_UnInit bool to void for plugin
+modify:printf plugin count
+fixed:does not need errorcode for plugin loader
+fixed:plugin failed to execution without tips.
+delete:plugin of option configure
+======================================================================================
XEngine_APIService V2.5.0.1001
添加:zipcode查询功能
diff --git a/README.en.md b/README.en.md
index cf91ef7009d28a6c4a144abc463ba0acd8fe761d..2ed969c3a220642c1c449571df9f06aca0767aa0 100644
--- a/README.en.md
+++ b/README.en.md
@@ -11,7 +11,7 @@ This service mainly uses HTTP/V1.1 to implement various interface services
This is a general information query service that does not contain any language attributes
You can use this code to implement your own information query service, which supports querying any information
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
-and support plugin module
+and support plugin system,dll(so,dylib)module or lua script
#### Why choose us
@@ -42,6 +42,7 @@ Support privatization deployment, free, safe, open source, controllable
22. Distributed lock
23. short url creator
24. local system time
+25. math Calculation
## install
@@ -57,6 +58,7 @@ Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
Macos Exection:./XEngine_LINEnv.sh -i 3
#### Windows
+need to vcpkg configure third-part env.refer vcpkg install guide.after installed and execution:vcpkg.exe install lua lua:x64-windows opencc opencc:x64-windows
use vs open and compile,suport windows 7sp1 and above
Just Run it
diff --git a/README.md b/README.md
index 494f94003f549f5fb194bdad715dc218c0e04286..cf85829e05594f1834bcbf7d70fd5c1d1d8e37cf 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ c c++ interface api service
这是一个不包含任何语言属性的通用信息查询服务.
你可以使用此代码实现自己的信息查询服务,支持查询任何信息
基于libXEngine开发并实现的一套简洁高性能跨平台接口服务
-并且支持模块插件
+并且支持插件系统,dll(so,dylib)模块或者lua脚本
#### 为什么选择我们
支持私有化部署,免费,安全.开源,可控
@@ -42,6 +42,7 @@ c c++ interface api service
22. 分布式锁API
23. 短连接生成
24. 本地标准时间
+25. 数学计算
## 安装教程
@@ -57,17 +58,18 @@ Linux执行:sudo ./XEngine_LINEnv.sh -i 3
macos执行:./XEngine_LINEnv.sh -i 3
#### Windows
+需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua lua:x64-windows opencc opencc:x64-windows
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
直接运行即可
#### Linux
-安装opencc,ubuntu:sudo apt install libopencc-dev
+安装opencc,ubuntu:sudo apt install liblua5.3-dev libopencc-dev
centos:需要自己编译
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
在控制台运行
#### Macos
-安装opencc,执行命令:brew install opencc
+安装opencc,执行命令:brew install lua opencc
使用makefile编译,控制台运行,需要mac 12以及以上版本
在控制台运行
diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp
similarity index 86%
rename from XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp
rename to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp
index d8553c6dc5bae3a0421064b04911535d9bbe4701..c41cf4f2a000264fdf3be23ea8b4ee43440db84c 100644
--- a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp
+++ b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp
@@ -18,8 +18,8 @@
//需要优先配置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
+//linux::g++ -std=c++17 -Wall -g APPClient_LibPluginExample.cpp -o APPClient_LibPluginExample.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_LibPluginExample.cpp -o APPClient_LibPluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
int main()
{
diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj
similarity index 97%
rename from XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj
rename to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj
index 14ed6260337c40814cce8bcc55a36f30bc1596d8..895aa6ef0393323e6f501bc2e5ea41e572a020a3 100644
--- a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj
+++ b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj
@@ -21,8 +21,8 @@
16.0
Win32Proj
- {81b29f95-d383-437f-ad34-11e1f3b6eae5}
- APPClientPluginExample
+ {0464ea5f-1e86-40bf-b692-394cf9f5cc67}
+ APPClientLibPluginExample
10.0
@@ -131,7 +131,7 @@
-
+
diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.filters
similarity index 94%
rename from XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters
rename to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.filters
index ce1662e7830386a78f08251ec91535a372436456..912ee103e0457b2a1f16568562b16201781b50a8 100644
--- a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters
+++ b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.filters
@@ -15,7 +15,7 @@
-
+
源文件
diff --git a/XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.user
similarity index 100%
rename from XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user
rename to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.user
diff --git a/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c6a7817e61e9478ec54dc8bb53fff0073bbb43fc
--- /dev/null
+++ b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp
@@ -0,0 +1,46 @@
+#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_LuaPluginExample.cpp -o APPClient_LuaPluginExample.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_LuaPluginExample.cpp -o APPClient_LuaPluginExample.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=cal¶ms1=1¶ms2=2&type=0");
+ if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszPassUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
+ {
+ printf("发送投递失败!\n");
+ return 0;
+ }
+ printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
+ BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
+
+ getchar();
+#ifdef _MSC_BUILD
+ WSACleanup();
+#endif
+ return 0;
+}
\ No newline at end of file
diff --git a/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj
new file mode 100644
index 0000000000000000000000000000000000000000..8e9f21ee6ff9855e721fad1722af7f2d83db5578
--- /dev/null
+++ b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj
@@ -0,0 +1,139 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ Win32Proj
+ {4309bf33-c0d7-40c5-ae52-637bfcd5eca8}
+ APPClientLuaPluginExample
+ 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_LuaPluginExample/APPClient_LuaPluginExample.vcxproj.filters b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj.filters
new file mode 100644
index 0000000000000000000000000000000000000000..84b789719abfa15d4f3715b2525f1cef71ccdd86
--- /dev/null
+++ b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.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_LuaPluginExample/APPClient_LuaPluginExample.vcxproj.user b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj.user
new file mode 100644
index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822
--- /dev/null
+++ b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/XEngine_APPClient/XEngine_APPClient.sln b/XEngine_APPClient/XEngine_APPClient.sln
index cede1431da0e749f371a5403e6bfa7606b790b5e..b0b234c60498c16bc7dd45fdb99265633571dcf4 100644
--- a/XEngine_APPClient/XEngine_APPClient.sln
+++ b/XEngine_APPClient/XEngine_APPClient.sln
@@ -17,14 +17,16 @@ 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
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_CDKeyExample", "APPClient_CDKeyExample\APPClient_CDKeyExample.vcxproj", "{155B430D-7CDA-488C-B3AE-333D179D1943}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_LockExample", "APPClient_LockExample\APPClient_LockExample.vcxproj", "{6EC0E212-E8DF-4DD2-8DA5-2BCFD18405F9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_ZIPCodeExample", "APPClient_ZIPCodeExample\APPClient_ZIPCodeExample.vcxproj", "{4D665697-A449-490F-8CE6-CED6752EE128}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_LuaPluginExample", "APPClient_LuaPluginExample\APPClient_LuaPluginExample.vcxproj", "{4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_LibPluginExample", "APPClient_LibPluginExample\APPClient_LibPluginExample.vcxproj", "{0464EA5F-1E86-40BF-B692-394CF9F5CC67}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -89,14 +91,6 @@ 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
{155B430D-7CDA-488C-B3AE-333D179D1943}.Debug|x64.ActiveCfg = Debug|x64
{155B430D-7CDA-488C-B3AE-333D179D1943}.Debug|x64.Build.0 = Debug|x64
{155B430D-7CDA-488C-B3AE-333D179D1943}.Debug|x86.ActiveCfg = Debug|Win32
@@ -121,6 +115,22 @@ Global
{4D665697-A449-490F-8CE6-CED6752EE128}.Release|x64.Build.0 = Release|x64
{4D665697-A449-490F-8CE6-CED6752EE128}.Release|x86.ActiveCfg = Release|Win32
{4D665697-A449-490F-8CE6-CED6752EE128}.Release|x86.Build.0 = Release|Win32
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Debug|x64.ActiveCfg = Debug|x64
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Debug|x64.Build.0 = Debug|x64
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Debug|x86.ActiveCfg = Debug|Win32
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Debug|x86.Build.0 = Debug|Win32
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Release|x64.ActiveCfg = Release|x64
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Release|x64.Build.0 = Release|x64
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Release|x86.ActiveCfg = Release|Win32
+ {4309BF33-C0D7-40C5-AE52-637BFCD5ECA8}.Release|x86.Build.0 = Release|Win32
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Debug|x64.ActiveCfg = Debug|x64
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Debug|x64.Build.0 = Debug|x64
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Debug|x86.ActiveCfg = Debug|Win32
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Debug|x86.Build.0 = Debug|Win32
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Release|x64.ActiveCfg = Release|x64
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Release|x64.Build.0 = Release|x64
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.Release|x86.ActiveCfg = Release|Win32
+ {0464EA5F-1E86-40BF-B692-394CF9F5CC67}.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 6e134209e717d021dfc5b9c5e365b703c9b12b82..0627986ab1a85678108ba4d2f0d93e4728cab11c 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 254e9d75cbb971055fd8a7b2e22a47d663e65e24..b1390fcc3eb167745b8f61947020d76598996965 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 7e7ef28ff15be72948ed2c12e9ea9afc4baf39cc..5199f3a91a5c5107576f1cfaa79a181076747344 100644
--- a/XEngine_Release/XEngine_Config/XEngine_Config.json
+++ b/XEngine_Release/XEngine_Config/XEngine_Config.json
@@ -29,9 +29,11 @@
},
"XPlugin":{
"bEnable":true,
- "tszPluginFile":"./XEngine_Config/XEngine_PluginConfig.json"
+ "tszPluginLib":"./XEngine_Config/XEngine_PluginLib.json",
+ "tszPluginLua":"./XEngine_Config/XEngine_PluginLua.json"
},
"XVer":[
+ "2.6.0.1001 Build20221212",
"2.5.0.1001 Build20221102",
"2.4.0.1001 Build20220902",
"2.3.0.1001 Build20220723",
diff --git a/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json b/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json
index ae1273ed077f7fb2ac02c113fbcab34a4a051013..1366c5f8c64b53ffc15c9282b3cf6f8ccb6ecd88 100644
--- a/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json
+++ b/XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json
@@ -59,36 +59,5 @@
"OPTionNote": "行政邮编信息",
"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=体重(千克)"
- },
- {
- "OPTionEnable": true,
- "OPTionMethod": "meter",
- "OPTionNote": "计量转换",
- "OPTionExample": "http://%s/api?function=meter&type=0&source=1&value=100"
- }
]
}
\ No newline at end of file
diff --git a/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json b/XEngine_Release/XEngine_Config/XEngine_PluginLib.json
similarity index 57%
rename from XEngine_Release/XEngine_Config/XEngine_PluginConfig.json
rename to XEngine_Release/XEngine_Config/XEngine_PluginLib.json
index eb7d57927b06bf11fcfcfbd9ccac9c2f54b81339..5bc54eccf7a06c2c267f01ba29cea6e99c15dabe 100644
--- a/XEngine_Release/XEngine_Config/XEngine_PluginConfig.json
+++ b/XEngine_Release/XEngine_Config/XEngine_PluginLib.json
@@ -3,27 +3,27 @@
{
"PluginEnable":true,
"PluginMethod":"zodiac",
- "PluginFile":"./XEngine_Plugin/libModulePlugin_Zodiac"
+ "PluginFile":"./XEngine_LibPlugin/libModulePlugin_Zodiac"
},
{
"PluginEnable":true,
"PluginMethod":"pass",
- "PluginFile":"./XEngine_Plugin/libModulePlugin_Password"
+ "PluginFile":"./XEngine_LibPlugin/libModulePlugin_Password"
},
{
"PluginEnable":true,
"PluginMethod":"timezone",
- "PluginFile":"./XEngine_Plugin/libModulePlugin_Timezone"
+ "PluginFile":"./XEngine_LibPlugin/libModulePlugin_Timezone"
},
{
"PluginEnable":true,
"PluginMethod":"bmindex",
- "PluginFile":"./XEngine_Plugin/libModulePlugin_BMIndex"
+ "PluginFile":"./XEngine_LibPlugin/libModulePlugin_BMIndex"
},
{
"PluginEnable":true,
"PluginMethod":"meter",
- "PluginFile":"./XEngine_Plugin/libModulePlugin_Meter"
+ "PluginFile":"./XEngine_LibPlugin/libModulePlugin_Meter"
}
]
}
\ No newline at end of file
diff --git a/XEngine_Release/XEngine_Config/XEngine_PluginLua.json b/XEngine_Release/XEngine_Config/XEngine_PluginLua.json
new file mode 100644
index 0000000000000000000000000000000000000000..c79df6cba00a023ce6f52b9883675b1ee2bb51b0
--- /dev/null
+++ b/XEngine_Release/XEngine_Config/XEngine_PluginLua.json
@@ -0,0 +1,9 @@
+{
+ "PluginArray":[
+ {
+ "PluginEnable":true,
+ "PluginMethod":"cal",
+ "PluginFile":"./XEngine_LuaPlugin/ModulePlugin_Calculation.lua"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/XEngine_Release/XEngine_Plugin/.gitignore b/XEngine_Release/XEngine_LibPlugin/.gitignore
similarity index 100%
rename from XEngine_Release/XEngine_Plugin/.gitignore
rename to XEngine_Release/XEngine_LibPlugin/.gitignore
diff --git a/XEngine_Release/XEngine_LuaPlugin/ModulePlugin_Calculation.lua b/XEngine_Release/XEngine_LuaPlugin/ModulePlugin_Calculation.lua
new file mode 100644
index 0000000000000000000000000000000000000000..f3f8bacd14cddffc29bb876e8d76a8ef501c55be
--- /dev/null
+++ b/XEngine_Release/XEngine_LuaPlugin/ModulePlugin_Calculation.lua
@@ -0,0 +1,54 @@
+function PluginCore_Init()
+ return true
+end
+
+function PluginCore_UnInit()
+end
+
+
+function PluginCore_URLSqlit(str,reps)
+ local resultStrList = {}
+ string.gsub(str,'[^'..reps..']+',function (w)
+ table.insert(resultStrList,w)
+ end)
+ return resultStrList
+end
+
+
+function PluginCore_Call(lpszStrUrl, nListCount, lpszMsgBuffer, nMsgLen)
+ if nListCount < 3 then
+ PInt_HTTPCode = 200
+ PtszMsgBuffer = "{\"code\":1001,\"msg\":\"request parament is incorrent\"}"
+ PInt_MsgLen = #PtszMsgBuffer
+ return true
+ end
+
+ local nValue = 0
+ local HDRArray = PluginCore_URLSqlit(lpszStrUrl,'&')
+ local HDRObjectValue1 = PluginCore_URLSqlit(HDRArray[1],'=')
+ local HDRObjectValue2 = PluginCore_URLSqlit(HDRArray[2],'=')
+ local HDRObjectType = PluginCore_URLSqlit(HDRArray[3],'=')
+
+ if '0' == HDRObjectType[2] then
+ nValue = HDRObjectValue1[2] + HDRObjectValue2[2]
+ elseif '1' == HDRObjectType[2] then
+ nValue = HDRObjectValue1[2] - HDRObjectValue2[2]
+ elseif '2' == HDRObjectType[2] then
+ nValue = HDRObjectValue1[2] * HDRObjectValue2[2]
+ elseif '3' == HDRObjectType[2] then
+ nValue = HDRObjectValue1[2] / HDRObjectValue2[2]
+ else
+ PInt_HTTPCode = 200
+ PtszMsgBuffer = "{\"code\":1002,\"msg\":\"type does not support\"}"
+ PInt_MsgLen = #PtszMsgBuffer
+ return true
+ end
+
+ PInt_HTTPCode = 200
+ PtszMsgBuffer = "{\"code\":0,\"msg\":\"success\",\"data\":{\"nType\":" .. HDRObjectType[2] .. ",\"nValue1\":" .. HDRObjectValue1[2] .. ",\"nValue2\":" .. HDRObjectValue2[2] .. ",\"nCal\":" .. nValue .. "}}"
+ PInt_MsgLen = #PtszMsgBuffer
+
+ return true
+end
+
+-- PluginCore_Call("param1=1¶m2=2¶m3=0",3,"hello",5)
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
index dbcca665c0ad55b4911b8a4654d5e9a3e93f5dc7..a5fdc5ba1d374053a504b888250c0c1c7e83fbde 100644
--- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
+++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
@@ -50,7 +50,8 @@ typedef struct
struct
{
BOOL bEnable; //是否启用
- TCHAR tszPluginFile[MAX_PATH]; //配置文件地址
+ TCHAR tszPluginLib[MAX_PATH]; //配置文件地址
+ TCHAR tszPluginLua[MAX_PATH]; //配置文件地址
}st_XPlugin;
struct
{
@@ -97,7 +98,6 @@ typedef struct
typedef struct
{
list stl_ListBase;
- list stl_ListPlug;
}XENGINE_OPTIONLIST;
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp
index bae803325da5e44d68a4c593e39a9ed95ebdfa5f..5038774cdcf18601052e83772f23d3b12774d096 100644
--- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp
+++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_File/ModuleConfigure_File.cpp
@@ -88,12 +88,6 @@ BOOL CModuleConfigure_File::ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile,
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++)
{
@@ -107,18 +101,5 @@ BOOL CModuleConfigure_File::ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile,
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_Json/ModuleConfigure_Json.cpp b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp
index 7d9cee15faf232e76805e5d35b871ec192482634..49d6a314e92dd5cb7a7e8eef4427dfb968f73b9d 100644
--- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp
+++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp
@@ -134,7 +134,7 @@ BOOL CModuleConfigure_Json::ModuleConfigure_Json_File(LPCTSTR lpszConfigFile, XE
_tcscpy(pSt_ServerConfig->st_XApi.tszBankUrl, st_JsonXApi["tszBankUrl"].asCString());
_tcscpy(pSt_ServerConfig->st_XApi.tszTranslationUrl, st_JsonXApi["tszTranslationUrl"].asCString());
- if (st_JsonRoot["XPlugin"].empty() || (2 != st_JsonRoot["XPlugin"].size()))
+ if (st_JsonRoot["XPlugin"].empty() || (3 != st_JsonRoot["XPlugin"].size()))
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XPLUGIN;
@@ -142,7 +142,8 @@ BOOL CModuleConfigure_Json::ModuleConfigure_Json_File(LPCTSTR lpszConfigFile, XE
}
Json::Value st_JsonXPlugin = st_JsonRoot["XPlugin"];
pSt_ServerConfig->st_XPlugin.bEnable = st_JsonXPlugin["bEnable"].asBool();
- _tcscpy(pSt_ServerConfig->st_XPlugin.tszPluginFile, st_JsonXPlugin["tszPluginFile"].asCString());
+ _tcscpy(pSt_ServerConfig->st_XPlugin.tszPluginLib, st_JsonXPlugin["tszPluginLib"].asCString());
+ _tcscpy(pSt_ServerConfig->st_XPlugin.tszPluginLua, st_JsonXPlugin["tszPluginLua"].asCString());
if (st_JsonRoot["XVer"].empty())
{
@@ -315,13 +316,18 @@ BOOL CModuleConfigure_Json::ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFi
st_PluginInfo.bEnable = st_JsonArray[i]["PluginEnable"].asBool();
_tcscpy(st_PluginInfo.tszPluginFile, st_JsonArray[i]["PluginFile"].asCString());
+
+ if (NULL == _tcsstr(st_PluginInfo.tszPluginFile,_T(".")))
+ {
#ifdef _MSC_BUILD
- _tcscat(st_PluginInfo.tszPluginFile, ".dll");
+ _tcscat(st_PluginInfo.tszPluginFile, ".dll");
#elif __linux__
- _tcscat(st_PluginInfo.tszPluginFile, ".so");
+ _tcscat(st_PluginInfo.tszPluginFile, ".so");
#else
- _tcscat(st_PluginInfo.tszPluginFile, ".dylib");
+ _tcscat(st_PluginInfo.tszPluginFile, ".dylib");
#endif
+ }
+
_tcscpy(st_PluginInfo.tszPluginMethod, st_JsonArray[i]["PluginMethod"].asCString());
pSt_PluginConfig->pStl_ListPlugin->push_back(st_PluginInfo);
}
diff --git a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj
index 3d2c8e2b41bd9183799a14f4b5beed952683ce2f..0a0d106beed4e42aa14fb70b607651f483e78d61 100644
--- a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj
+++ b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj
@@ -72,7 +72,7 @@
true
- $(XEngine_Include);../XEngine_ThirdPart/opencc/include;$(IncludePath)
+ $(XEngine_Include);$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.h b/XEngine_Source/XEngine_ModuleHelp/pch.h
index 1485981426bdcbf7863bca374e726adb3193815a..cf8824c90a3adfd9cc3600fe2a03b86dfb594bca 100644
--- a/XEngine_Source/XEngine_ModuleHelp/pch.h
+++ b/XEngine_Source/XEngine_ModuleHelp/pch.h
@@ -46,9 +46,4 @@ extern DWORD ModuleHelp_dwErrorCode;
#ifdef _MSC_BUILD
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
-#ifdef _WIN64
-#pragma comment(lib,"../XEngine_ThirdPart/opencc/libx64/opencc")
-#else
-#pragma comment(lib,"../XEngine_ThirdPart/opencc/libx86/opencc")
-#endif
#endif
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h
index dd17d8c02232d1616f0d76b1a5538186c886adb0..2e9f9cfe234bdc250bbcd5f0faf55d79fdb8eba7 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Define.h
@@ -15,19 +15,19 @@
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD ModulePlugin_GetLastError(int* pInt_SysError = NULL);
/*********************************************************************************
-* 插件框架导出函数定义 *
+* LIB库插件框架导出函数定义 *
*********************************************************************************/
/********************************************************************
-函数名称:ModulePlugin_Core_Init
+函数名称:ModulePlugin_LibCore_Init
函数功能:初始化插件核心系统
返回值
类型:逻辑型
意思:是否成功初始化
备注:
*********************************************************************/
-extern "C" BOOL ModulePlugin_Core_Init();
+extern "C" BOOL ModulePlugin_LibCore_Init();
/********************************************************************
-函数名称:ModulePlugin_Core_Push
+函数名称:ModulePlugin_LibCore_Push
函数功能:添加一个标准的插件到插件框架中
参数.一:pxhModule
In/Out:Out
@@ -49,9 +49,9 @@ extern "C" BOOL ModulePlugin_Core_Init();
意思:是否成功添加
备注:
*********************************************************************/
-extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhNet, LPCSTR lpszPluginFile, LPVOID lParam = NULL);
+extern "C" BOOL ModulePlugin_LibCore_Push(XNETHANDLE * pxhNet, LPCSTR lpszPluginFile, LPVOID lParam = NULL);
/********************************************************************
-函数名称:ModulePlugin_Core_Exec
+函数名称:ModulePlugin_LibCore_Exec
函数功能:执行一次
参数.一:xhModule
In/Out:In
@@ -98,16 +98,110 @@ extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhNet, LPCSTR lpszPluginFil
意思:是否成功
备注:
*********************************************************************/
-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);
+extern "C" BOOL ModulePlugin_LibCore_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
/********************************************************************
-函数名称:ModulePlugin_Core_Destroy
+函数名称:ModulePlugin_LibCore_Destroy
函数功能:销毁插件核心并且清理资源
返回值
类型:逻辑型
意思:是否成功销毁
备注:
*********************************************************************/
-extern "C" BOOL ModulePlugin_Core_Destroy();
+extern "C" BOOL ModulePlugin_LibCore_Destroy();
+/*********************************************************************************
+* LUA插件框架导出函数定义 *
+*********************************************************************************/
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Init
+函数功能:初始化LUA插件核心系统
+返回值
+ 类型:逻辑型
+ 意思:是否成功初始化
+备注:
+*********************************************************************/
+extern "C" BOOL ModulePlugin_LuaCore_Init();
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Push
+函数功能:添加一个标准的插件到插件框架中
+ 参数.一:pxhModule
+ In/Out:Out
+ 类型:模块句柄
+ 可空:N
+ 意思:导出一个加载成功的模块句柄
+ 参数.二:lpszPluginFile
+ In/Out:In
+ 类型:常量字符指针
+ 可空:N
+ 意思:插件模块路径
+ 参数.三:lParam
+ In/Out:In/Out
+ 类型:无类型指针
+ 可空:Y
+ 意思:自定义输入输出参数
+返回值
+ 类型:逻辑型
+ 意思:是否成功添加
+备注:
+*********************************************************************/
+extern "C" BOOL ModulePlugin_LuaCore_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Exec
+函数功能:执行一次
+ 参数.一:xhModule
+ In/Out:In
+ 类型:句柄
+ 可空:N
+ 意思:输入模块句柄
+ 参数.二:pppHDRList
+ In/Out:In
+ 类型:三级指针
+ 可空:N
+ 意思:HTTP请求的URL参数列表
+ 参数.三:nListCount
+ In/Out:In
+ 类型:整数型
+ 可空:N
+ 意思:输入列表个数
+ 参数.四:pInt_HTTPCode
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出返回的HTTPCODE值
+ 参数.五:ptszMsgBuffer
+ In/Out:Out
+ 类型:字符指针
+ 可空:N
+ 意思:输出负载的内容
+ 参数.六:pInt_MsgLen
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出内容大小
+ 参数.七:lpszMsgBufer
+ In/Out:Out
+ 类型:常量字符指针
+ 可空:Y
+ 意思:输入负载内容
+ 参数.八:nMsgLen
+ In/Out:Out
+ 类型:整数型指针
+ 可空:Y
+ 意思:输入负载大小
+返回值
+ 类型:逻辑型
+ 意思:是否成功
+备注:
+*********************************************************************/
+extern "C" BOOL ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Destroy
+函数功能:销毁插件核心并且清理资源
+返回值
+ 类型:逻辑型
+ 意思:是否成功销毁
+备注:
+*********************************************************************/
+extern "C" BOOL ModulePlugin_LuaCore_Destroy();
/*********************************************************************************
* 加载器导出函数定义 *
*********************************************************************************/
@@ -124,12 +218,17 @@ extern "C" BOOL ModulePlugin_Core_Destroy();
类型:常量字符指针
可空:N
意思:插件路径
+ 参数.三:nType
+ In/Out:In
+ 类型:整数型
+ 可空:Y
+ 意思:0为lib,1为lua
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
-extern "C" BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName);
+extern "C" BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName, int nType = 0);
/********************************************************************
函数名称:ModulePlugin_Loader_Find
函数功能:查找方法是否注册
@@ -138,12 +237,17 @@ extern "C" BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lps
类型:常量字符指针
可空:N
意思:输入要执行的方法
+ 参数.二:pInt_Type
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出获取到的模块类型
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
-extern "C" BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName);
+extern "C" BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName, int* pInt_Type);
/********************************************************************
函数名称:ModulePlugin_Loader_Exec
函数功能:执行一次插件
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Error.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Error.h
index 9e329092b0145e6bf3dc03cb0a2617e874eae60b..c24e97dc0a09461ffa628a67cf58a3771eab9995 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Error.h
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Error.h
@@ -22,4 +22,5 @@
#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_INIT 0xE1007 //初始化内部模块失败
#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_NOTFOUND 0xE1008 //没有找到句柄
#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_ISINITED 0xE1009 //已经初始化了,不需要再次初始化
-#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION 0xE100A //插件执行失败
\ No newline at end of file
+#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION 0xE100A //插件执行失败
+#define ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_MALLOC 0xE100B //申请内存失败
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp
similarity index 89%
rename from XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp
rename to XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp
index cccf2a65abfee892a3f46faebae807e7abfa403b..912458c2a8a173e53a203d6cd63d57907b11d2fa 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.cpp
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp
@@ -1,35 +1,35 @@
#include "pch.h"
-#include "ModulePlugin_Core.h"
+#include "ModulePlugin_LibCore.h"
/********************************************************************
-// Created: 2022/04/20 16:14:03
-// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_Core\ModulePlugin_Core.cpp
-// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_Core
-// File Base: ModulePlugin_Core
+// Created: 2022/11/30 16:16:54
+// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LibCore\ModulePlugin_LibCore.cpp
+// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LibCore
+// File Base: ModulePlugin_LibCore
// File Ext: cpp
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 插件核心架构实现
// History:
*********************************************************************/
-CModulePlugin_Core::CModulePlugin_Core()
+CModulePlugin_LibCore::CModulePlugin_LibCore()
{
bIsInit = FALSE;
}
-CModulePlugin_Core::~CModulePlugin_Core()
+CModulePlugin_LibCore::~CModulePlugin_LibCore()
{
}
//////////////////////////////////////////////////////////////////////////
// 公有函数
//////////////////////////////////////////////////////////////////////////
/********************************************************************
-函数名称:ModulePlugin_Core_Init
+函数名称:ModulePlugin_LibCore_Init
函数功能:初始化插件核心系统
返回值
类型:逻辑型
意思:是否成功初始化
备注:
*********************************************************************/
-BOOL CModulePlugin_Core::ModulePlugin_Core_Init()
+BOOL CModulePlugin_LibCore::ModulePlugin_LibCore_Init()
{
ModulePlugin_IsErrorOccur = FALSE;
//判断是否初始化
@@ -44,7 +44,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Init()
return TRUE;
}
/********************************************************************
-函数名称:ModulePlugin_Core_Push
+函数名称:ModulePlugin_LibCore_Push
函数功能:添加一个标准的插件到插件框架中
参数.一:pxhModule
In/Out:Out
@@ -66,7 +66,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Init()
意思:是否成功添加
备注:
*********************************************************************/
-BOOL CModulePlugin_Core::ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
+BOOL CModulePlugin_LibCore::ModulePlugin_LibCore_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
{
ModulePlugin_IsErrorOccur = FALSE;
@@ -76,14 +76,14 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR l
ModulePlugin_dwErrorCode = BaseLib_GetLastError();
return FALSE;
}
- if (!ModulePlugin_Core_Add(*pxhModule, lpszPluginFile, lParam))
+ if (!ModulePlugin_LibCore_Add(*pxhModule, lpszPluginFile, lParam))
{
return FALSE;
}
return TRUE;
}
/********************************************************************
-函数名称:ModulePlugin_Core_Exec
+函数名称:ModulePlugin_LibCore_Exec
函数功能:执行一次
参数.一:xhModule
In/Out:In
@@ -130,7 +130,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR l
意思:是否成功
备注:
*********************************************************************/
-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 */)
+BOOL CModulePlugin_LibCore::ModulePlugin_LibCore_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer /* = NULL */, int nMsgLen /* = 0 */)
{
ModulePlugin_IsErrorOccur = FALSE;
@@ -156,14 +156,14 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pp
return TRUE;
}
/********************************************************************
-函数名称:ModulePlugin_Core_Destroy
+函数名称:ModulePlugin_LibCore_Destroy
函数功能:销毁插件核心并且清理资源
返回值
类型:逻辑型
意思:是否成功销毁
备注:
*********************************************************************/
-BOOL CModulePlugin_Core::ModulePlugin_Core_Destroy()
+BOOL CModulePlugin_LibCore::ModulePlugin_LibCore_Destroy()
{
ModulePlugin_IsErrorOccur = FALSE;
@@ -193,7 +193,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Destroy()
// 保护函数
//////////////////////////////////////////////////////////////////////////
/********************************************************************
-函数名称:ModulePlugin_Core_Add
+函数名称:ModulePlugin_LibCore_Add
函数功能:添加一个指定模块到插件核心系统当中
参数.一:xhNet
In/Out:In
@@ -215,7 +215,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Destroy()
意思:是否成功执行
备注:
*********************************************************************/
-BOOL CModulePlugin_Core::ModulePlugin_Core_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam)
+BOOL CModulePlugin_LibCore::ModulePlugin_LibCore_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam)
{
ModulePlugin_IsErrorOccur = FALSE;
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.h
similarity index 60%
rename from XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h
rename to XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.h
index 2b93d4050f1386336f90ceb12d513ba6a095d010..1899c60923f6747e06daeb64bbb1cb6010b6c1f3 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Core/ModulePlugin_Core.h
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.h
@@ -1,9 +1,9 @@
#pragma once
/********************************************************************
-// Created: 2022/04/20 16:13:41
-// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_Core\ModulePlugin_Core.h
-// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_Core
-// File Base: ModulePlugin_Core
+// Created: 2022/11/30 16:16:35
+// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LibCore\ModulePlugin_LibCore.h
+// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LibCore
+// File Base: ModulePlugin_LibCore
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
@@ -11,7 +11,7 @@
// History:
*********************************************************************/
typedef BOOL(*FPCall_PluginCore_Init)(LPVOID lParam);
-typedef BOOL(*FPCall_PluginCore_UnInit)();
+typedef void(*FPCall_PluginCore_UnInit)();
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)();
@@ -21,23 +21,23 @@ typedef struct
TCHAR tszModuleFile[MAX_PATH];
BOOL(*fpCall_PluginCore_Init)(LPVOID lParam);
- BOOL(*fpCall_PluginCore_UnInit)();
+ void(*fpCall_PluginCore_UnInit)();
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;
-class CModulePlugin_Core
+class CModulePlugin_LibCore
{
public:
- CModulePlugin_Core();
- ~CModulePlugin_Core();
+ CModulePlugin_LibCore();
+ ~CModulePlugin_LibCore();
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, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
- BOOL ModulePlugin_Core_Destroy();
+ BOOL ModulePlugin_LibCore_Init();
+ BOOL ModulePlugin_LibCore_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
+ BOOL ModulePlugin_LibCore_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
+ BOOL ModulePlugin_LibCore_Destroy();
protected:
- BOOL ModulePlugin_Core_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
+ BOOL ModulePlugin_LibCore_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
private:
BOOL bIsInit;
private:
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.cpp
index bb32ae28df79f60d96213ceaeab9ea9bcbae4d56..bb5888ead698a1010114016cfc5bc970f3c6110b 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.cpp
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.cpp
@@ -33,12 +33,17 @@ CModulePlugin_Loader::~CModulePlugin_Loader()
类型:常量字符指针
可空:N
意思:插件路径
+ 参数.三:nType
+ In/Out:In
+ 类型:整数型
+ 可空:Y
+ 意思:0为lib,1为lua
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
-BOOL CModulePlugin_Loader::ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName)
+BOOL CModulePlugin_Loader::ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName, int nType /* = 0 */)
{
ModulePlugin_IsErrorOccur = FALSE;
@@ -51,14 +56,25 @@ BOOL CModulePlugin_Loader::ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod,
PLUGINCORE_LOADER st_PluginLoader;
memset(&st_PluginLoader, '\0', sizeof(PLUGINCORE_LOADER));
+ st_PluginLoader.nType = nType;
_tcscpy(st_PluginLoader.tszModuleFile, lpszModuleName);
_tcscpy(st_PluginLoader.tszModuleMethod, lpszModuleMethod);
- if (!ModulePlugin_Core_Push(&st_PluginLoader.xhToken, lpszModuleName))
+ if (0 == nType)
{
- return FALSE;
+ if (!ModulePlugin_LibCore_Push(&st_PluginLoader.xhToken, lpszModuleName))
+ {
+ return FALSE;
+ }
}
-
+ else
+ {
+ if (!ModulePlugin_LuaCore_Push(&st_PluginLoader.xhToken, lpszModuleName))
+ {
+ return FALSE;
+ }
+ }
+
st_Locker.lock();
stl_MapLoader.insert(make_pair(lpszModuleMethod, st_PluginLoader));
st_Locker.unlock();
@@ -72,12 +88,17 @@ BOOL CModulePlugin_Loader::ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod,
类型:常量字符指针
可空:N
意思:输入要执行的方法
+ 参数.二:pInt_Type
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出获取到的模块类型
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
-BOOL CModulePlugin_Loader::ModulePlugin_Loader_Find(LPCTSTR lpszMethodName)
+BOOL CModulePlugin_Loader::ModulePlugin_Loader_Find(LPCTSTR lpszMethodName, int* pInt_Type)
{
ModulePlugin_IsErrorOccur = FALSE;
@@ -96,6 +117,10 @@ BOOL CModulePlugin_Loader::ModulePlugin_Loader_Find(LPCTSTR lpszMethodName)
st_Locker.unlock_shared();
return FALSE;
}
+ if (NULL != pInt_Type)
+ {
+ *pInt_Type = stl_MapIterator->second.nType;
+ }
st_Locker.unlock_shared();
return TRUE;
}
@@ -156,12 +181,22 @@ BOOL CModulePlugin_Loader::ModulePlugin_Loader_Exec(LPCTSTR lpszMethodName, TCHA
st_Locker.unlock_shared();
return FALSE;
}
- if (!ModulePlugin_Core_Exec(stl_MapIterator->second.xhToken, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen))
+
+ if (0 == stl_MapIterator->second.nType)
{
- ModulePlugin_IsErrorOccur = TRUE;
- ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION;
- st_Locker.unlock_shared();
- return FALSE;
+ if (!ModulePlugin_LibCore_Exec(stl_MapIterator->second.xhToken, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen))
+ {
+ st_Locker.unlock_shared();
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!ModulePlugin_LuaCore_Exec(stl_MapIterator->second.xhToken, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen))
+ {
+ st_Locker.unlock_shared();
+ return FALSE;
+ }
}
st_Locker.unlock_shared();
return TRUE;
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.h
index e5941614e316b2cecf08a466c53c12f4c93ed6f6..623c1dfd3ac9dd05630acec7243c4b36cdee8251 100644
--- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.h
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_Loader/ModulePlugin_Loader.h
@@ -15,6 +15,7 @@ typedef struct
TCHAR tszModuleFile[MAX_PATH];
TCHAR tszModuleMethod[MAX_PATH];
XNETHANDLE xhToken;
+ int nType;
}PLUGINCORE_LOADER, * LPPLUGINCORE_LOADER;
class CModulePlugin_Loader
@@ -23,8 +24,8 @@ public:
CModulePlugin_Loader();
~CModulePlugin_Loader();
public:
- BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName);
- BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName);
+ BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName, int nType = 0);
+ BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName, int* pInt_Type);
BOOL ModulePlugin_Loader_Exec(LPCTSTR lpszMethodName, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
BOOL ModulePlugin_Loader_Destory();
protected:
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..58f455f514b7556bd75bad0cbf701f5bf65bdaa6
--- /dev/null
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp
@@ -0,0 +1,313 @@
+#include "pch.h"
+#include "ModulePlugin_LuaCore.h"
+/********************************************************************
+// Created: 2022/11/30 16:18:24
+// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LuaCore\ModulePlugin_LuaCore.cpp
+// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LuaCore
+// File Base: ModulePlugin_LuaCore
+// File Ext: cpp
+// Project: XEngine(网络通信引擎)
+// Author: qyt
+// Purpose: LUA脚本你插件
+// History:
+*********************************************************************/
+CModulePlugin_LuaCore::CModulePlugin_LuaCore()
+{
+ bIsInit = FALSE;
+}
+CModulePlugin_LuaCore::~CModulePlugin_LuaCore()
+{
+}
+//////////////////////////////////////////////////////////////////////////
+// 公有函数
+//////////////////////////////////////////////////////////////////////////
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Init
+函数功能:初始化插件核心系统
+返回值
+ 类型:逻辑型
+ 意思:是否成功初始化
+备注:
+*********************************************************************/
+BOOL CModulePlugin_LuaCore::ModulePlugin_LuaCore_Init()
+{
+ ModulePlugin_IsErrorOccur = FALSE;
+ //判断是否初始化
+ if (bIsInit)
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_ISINITED;
+ return FALSE;
+ }
+ //启动线程
+ bIsInit = TRUE;
+ return TRUE;
+}
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Push
+函数功能:添加一个标准的插件到插件框架中
+ 参数.一:pxhModule
+ In/Out:Out
+ 类型:模块句柄
+ 可空:N
+ 意思:导出一个加载成功的模块句柄
+ 参数.二:lpszPluginFile
+ In/Out:In
+ 类型:常量字符指针
+ 可空:N
+ 意思:插件模块路径
+ 参数.三:lParam
+ In/Out:In/Out
+ 类型:无类型指针
+ 可空:Y
+ 意思:自定义输入输出参数
+返回值
+ 类型:逻辑型
+ 意思:是否成功添加
+备注:
+*********************************************************************/
+BOOL CModulePlugin_LuaCore::ModulePlugin_LuaCore_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
+{
+ ModulePlugin_IsErrorOccur = FALSE;
+
+ if (!BaseLib_OperatorHandle_Create(pxhModule))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = BaseLib_GetLastError();
+ return FALSE;
+ }
+ if (!ModulePlugin_LuaCore_Add(*pxhModule, lpszPluginFile, lParam))
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Exec
+函数功能:执行一次
+ 参数.一:xhModule
+ In/Out:In
+ 类型:句柄
+ 可空:N
+ 意思:输入模块句柄
+ 参数.二:pppHDRList
+ In/Out:In
+ 类型:三级指针
+ 可空:N
+ 意思:HTTP请求的URL参数列表
+ 参数.三:nListCount
+ In/Out:In
+ 类型:整数型
+ 可空:N
+ 意思:输入列表个数
+ 参数.四:pInt_HTTPCode
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出返回的HTTPCODE值
+ 参数.五:ptszMsgBuffer
+ In/Out:Out
+ 类型:字符指针
+ 可空:N
+ 意思:输出负载的内容
+ 参数.六:pInt_MsgLen
+ In/Out:Out
+ 类型:整数型指针
+ 可空:N
+ 意思:输出内容大小
+ 参数.七:lpszMsgBufer
+ In/Out:Out
+ 类型:常量字符指针
+ 可空:Y
+ 意思:输入负载内容
+ 参数.八:nMsgLen
+ In/Out:Out
+ 类型:整数型指针
+ 可空:Y
+ 意思:输入负载大小
+返回值
+ 类型:逻辑型
+ 意思:是否成功
+备注:
+*********************************************************************/
+BOOL CModulePlugin_LuaCore::ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer /* = NULL */, int nMsgLen /* = 0 */)
+{
+ ModulePlugin_IsErrorOccur = FALSE;
+
+ st_csStl.lock_shared();
+ //执行指定插件函数
+ unordered_map::const_iterator stl_MapIterator = stl_MapFrameWork.find(xhModule);
+ if (stl_MapIterator == stl_MapFrameWork.end())
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_NOTFOUND;
+ st_csStl.unlock_shared();
+ return FALSE;
+ }
+ if (0 == lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PluginCore_Call"))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_FPCALL;
+ st_csStl.unlock_shared();
+ return FALSE;
+ }
+ TCHAR tszURLParam[MAX_PATH];
+ memset(tszURLParam, '\0', MAX_PATH);
+
+ for (int i = 1; i < nListCount; i++)
+ {
+ if (i > 1)
+ {
+ _tcscat(tszURLParam, "&");
+ }
+ _tcscat(tszURLParam, (*pppHDRList)[i]);
+ }
+ lua_pushstring(stl_MapIterator->second.pSt_LuaState, tszURLParam);
+ lua_pushinteger(stl_MapIterator->second.pSt_LuaState, nListCount - 1);
+ lua_pushstring(stl_MapIterator->second.pSt_LuaState, lpszMsgBufer);
+ lua_pushinteger(stl_MapIterator->second.pSt_LuaState, nMsgLen);
+ if (LUA_OK != lua_pcall(stl_MapIterator->second.pSt_LuaState, 4, 1, 0))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION;
+ st_csStl.unlock_shared();
+ return FALSE;
+ }
+ lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PInt_HTTPCode");
+ *pInt_HTTPCode = (int)lua_tonumber(stl_MapIterator->second.pSt_LuaState, -1);
+ lua_pop(stl_MapIterator->second.pSt_LuaState, -1);
+
+ lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PtszMsgBuffer");
+ _tcscpy(ptszMsgBuffer, lua_tostring(stl_MapIterator->second.pSt_LuaState, -1));
+ lua_pop(stl_MapIterator->second.pSt_LuaState, -1);
+
+ lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PInt_MsgLen");
+ *pInt_MsgLen = (int)lua_tonumber(stl_MapIterator->second.pSt_LuaState, -1);
+ lua_pop(stl_MapIterator->second.pSt_LuaState, -1);
+
+ st_csStl.unlock_shared();
+
+ return TRUE;
+}
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Destroy
+函数功能:销毁插件核心并且清理资源
+返回值
+ 类型:逻辑型
+ 意思:是否成功销毁
+备注:
+*********************************************************************/
+BOOL CModulePlugin_LuaCore::ModulePlugin_LuaCore_Destroy()
+{
+ ModulePlugin_IsErrorOccur = FALSE;
+
+ //判断是否初始化
+ if (!bIsInit)
+ {
+ return TRUE;
+ }
+ bIsInit = FALSE;
+ //清理STL元素空间
+ st_csStl.lock();
+ unordered_map::iterator stl_MapIterator = stl_MapFrameWork.begin();
+ for (; stl_MapIterator != stl_MapFrameWork.end(); stl_MapIterator++)
+ {
+ lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PluginCore_UnInit");
+ lua_pcall(stl_MapIterator->second.pSt_LuaState, 0, 0, 0);
+
+ lua_close(stl_MapIterator->second.pSt_LuaState);
+ }
+ stl_MapFrameWork.clear();
+ st_csStl.unlock();
+
+ return TRUE;
+}
+//////////////////////////////////////////////////////////////////////////
+// 保护函数
+//////////////////////////////////////////////////////////////////////////
+/********************************************************************
+函数名称:ModulePlugin_LuaCore_Add
+函数功能:添加一个指定模块到插件核心系统当中
+ 参数.一:xhNet
+ In/Out:In
+ 类型:模块句柄
+ 可空:N
+ 意思:输入一个新的模块句柄
+ 参数.二:lpszPluginFile
+ In/Out:In
+ 类型:常量字符指针
+ 可空:N
+ 意思:插件模块路径
+ 参数.三:lParam
+ In/Out:In/Out
+ 类型:无类型指针
+ 可空:Y
+ 意思:自定义输入输出参数
+返回值
+ 类型:逻辑型
+ 意思:是否成功执行
+备注:
+*********************************************************************/
+BOOL CModulePlugin_LuaCore::ModulePlugin_LuaCore_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam)
+{
+ ModulePlugin_IsErrorOccur = FALSE;
+
+ if (NULL == lpszPluginFile)
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_PARAMENT;
+ return FALSE;
+ }
+ PLUGINCORE_LUAFRAMEWORK st_LuaCore;
+ memset(&st_LuaCore, '\0', sizeof(PLUGINCORE_LUAFRAMEWORK));
+
+ st_LuaCore.pSt_LuaState = luaL_newstate();
+ _tcscpy(st_LuaCore.tszModuleFile, lpszPluginFile);
+
+ if (NULL == st_LuaCore.pSt_LuaState)
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_MALLOC;
+ return FALSE;
+ }
+ luaL_openlibs(st_LuaCore.pSt_LuaState);
+
+ if (LUA_OK != luaL_loadfile(st_LuaCore.pSt_LuaState, lpszPluginFile))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_OPENDL;
+ return FALSE;
+ }
+ if (LUA_OK != lua_pcall(st_LuaCore.pSt_LuaState, 0, 0, 0))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION;
+ return FALSE;
+ }
+
+ if (0 == lua_getglobal(st_LuaCore.pSt_LuaState, "PluginCore_Init"))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_FPINIT;
+ return FALSE;
+ }
+
+ if (LUA_OK != lua_pcall(st_LuaCore.pSt_LuaState, 0, 1, 0))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION;
+ return FALSE;
+ }
+ if (!lua_toboolean(st_LuaCore.pSt_LuaState, -1))
+ {
+ ModulePlugin_IsErrorOccur = TRUE;
+ ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_EXECTION;
+ return FALSE;
+ }
+ lua_pop(st_LuaCore.pSt_LuaState, -1);
+
+ st_csStl.lock();
+ stl_MapFrameWork.insert(make_pair(xhNet, st_LuaCore));
+ st_csStl.unlock();
+ return TRUE;
+}
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h
new file mode 100644
index 0000000000000000000000000000000000000000..94ae0e45aa2e1e76dfba26a765909adc0daae4de
--- /dev/null
+++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h
@@ -0,0 +1,37 @@
+#pragma once
+/********************************************************************
+// Created: 2022/11/30 16:18:00
+// File Name: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LuaCore\ModulePlugin_LuaCore.h
+// File Path: D:\XEngine_APIService\XEngine_Source\XEngine_ModulePlugin\ModulePlugin_LuaCore
+// File Base: ModulePlugin_LuaCore
+// File Ext: h
+// Project: XEngine(网络通信引擎)
+// Author: qyt
+// Purpose: LUA脚本你插件
+// History:
+*********************************************************************/
+typedef struct
+{
+ TCHAR tszModuleFile[MAX_PATH];
+ lua_State* pSt_LuaState;
+}PLUGINCORE_LUAFRAMEWORK;
+
+class CModulePlugin_LuaCore
+{
+public:
+ CModulePlugin_LuaCore();
+ ~CModulePlugin_LuaCore();
+public:
+ BOOL ModulePlugin_LuaCore_Init();
+ BOOL ModulePlugin_LuaCore_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
+ BOOL ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
+ BOOL ModulePlugin_LuaCore_Destroy();
+protected:
+ BOOL ModulePlugin_LuaCore_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
+private:
+ BOOL bIsInit;
+private:
+ shared_mutex st_csStl;
+private:
+ unordered_map stl_MapFrameWork;
+};
diff --git a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.def b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.def
index 64749e8b4e1fbad6cd06c34218a7f1fcb855183e..55b4d1369066f1e5ae581b00deb667ebfa50a23e 100644
--- a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.def
+++ b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.def
@@ -3,10 +3,15 @@
EXPORTS
ModulePlugin_GetLastError
- ModulePlugin_Core_Init
- ModulePlugin_Core_Push
- ModulePlugin_Core_Exec
- ModulePlugin_Core_Destroy
+ ModulePlugin_LibCore_Init
+ ModulePlugin_LibCore_Push
+ ModulePlugin_LibCore_Exec
+ ModulePlugin_LibCore_Destroy
+
+ ModulePlugin_LuaCore_Init
+ ModulePlugin_LuaCore_Push
+ ModulePlugin_LuaCore_Exec
+ ModulePlugin_LuaCore_Destroy
ModulePlugin_Loader_Insert
ModulePlugin_Loader_Find
diff --git a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj
index b1545773f98102e850ce8168cafa8bc74ef78a8c..f16c7d864b08a05fb49c1b5969a2cfd641a993bc 100644
--- a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj
+++ b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj
@@ -164,16 +164,18 @@
-
+
+
-
+
+
Create
Create
diff --git a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj.filters b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj.filters
index f39eb69c48c8bd4d1421f5b98438d9284468181c..85756ef38e4b3bd87ccec2600acd27c8ed004b14 100644
--- a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj.filters
+++ b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj.filters
@@ -13,18 +13,24 @@
{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
-
- {716c1e27-8905-4321-a369-67cf7462cb08}
-
-
- {c455a41d-68d1-42be-a090-0df10d4de4ed}
-
{5fd6b4af-2a78-499a-ab04-ab8643823743}
{c2bcf30b-a119-4ab5-85e5-2c16ca255b9a}
+
+ {716c1e27-8905-4321-a369-67cf7462cb08}
+
+
+ {c455a41d-68d1-42be-a090-0df10d4de4ed}
+
+
+ {41da9b84-643e-4284-9018-62fae573d971}
+
+
+ {8a2f82d7-3a16-438f-8533-84d44cee2ff2}
+
@@ -33,9 +39,6 @@
头文件
-
- 头文件\ModulePlugin_Core
-
头文件
@@ -45,6 +48,12 @@
头文件\ModulePlugin_Loader
+
+ 头文件\ModulePlugin_LibCore
+
+
+ 头文件\ModulePlugin_LuaCore
+
@@ -53,12 +62,15 @@
源文件
-
- 源文件\ModulePlugin_Core
-
源文件\ModulePlugin_Loader
+
+ 源文件\ModulePlugin_LibCore
+
+
+ 源文件\ModulePlugin_LuaCore
+
diff --git a/XEngine_Source/XEngine_ModulePlugin/pch.cpp b/XEngine_Source/XEngine_ModulePlugin/pch.cpp
index 1cf35b93fe82c62ea1fd0051f182d4d431b38217..807b91a6ec4731b6e31b47c18d3c67fb266bbc07 100644
--- a/XEngine_Source/XEngine_ModulePlugin/pch.cpp
+++ b/XEngine_Source/XEngine_ModulePlugin/pch.cpp
@@ -1,5 +1,6 @@
#include "pch.h"
-#include "ModulePlugin_Core/ModulePlugin_Core.h"
+#include "ModulePlugin_LibCore/ModulePlugin_LibCore.h"
+#include "ModulePlugin_LuaCore/ModulePlugin_LuaCore.h"
#include "ModulePlugin_Loader/ModulePlugin_Loader.h"
/********************************************************************
// Created: 2022/04/20 16:39:27
@@ -15,7 +16,8 @@
BOOL ModulePlugin_IsErrorOccur = FALSE;
DWORD ModulePlugin_dwErrorCode = 0;
//////////////////////////////////////////////////////////////////////////
-CModulePlugin_Core m_PluginCore;
+CModulePlugin_LibCore m_PluginLib;
+CModulePlugin_LuaCore m_PluginLua;
CModulePlugin_Loader m_PluginLoader;
//////////////////////////////////////////////////////////////////////////
// 导出函数实现
@@ -31,32 +33,51 @@ extern "C" DWORD ModulePlugin_GetLastError(int* pInt_SysError)
/*********************************************************************************
* 插件框架导出函数定义 *
*********************************************************************************/
-extern "C" BOOL ModulePlugin_Core_Init()
+extern "C" BOOL ModulePlugin_LibCore_Init()
{
- return m_PluginCore.ModulePlugin_Core_Init();
+ return m_PluginLib.ModulePlugin_LibCore_Init();
}
-extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
+extern "C" BOOL ModulePlugin_LibCore_Push(XNETHANDLE * pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
{
- return m_PluginCore.ModulePlugin_Core_Push(pxhModule, lpszPluginFile, lParam);
+ return m_PluginLib.ModulePlugin_LibCore_Push(pxhModule, lpszPluginFile, lParam);
}
-extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen)
+extern "C" BOOL ModulePlugin_LibCore_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);
+ return m_PluginLib.ModulePlugin_LibCore_Exec(xhModule, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen);
}
-extern "C" BOOL ModulePlugin_Core_Destroy()
+extern "C" BOOL ModulePlugin_LibCore_Destroy()
{
- return m_PluginCore.ModulePlugin_Core_Destroy();
+ return m_PluginLib.ModulePlugin_LibCore_Destroy();
+}
+/*********************************************************************************
+* LUA插件框架导出函数定义 *
+*********************************************************************************/
+extern "C" BOOL ModulePlugin_LuaCore_Init()
+{
+ return m_PluginLua.ModulePlugin_LuaCore_Init();
+}
+extern "C" BOOL ModulePlugin_LuaCore_Push(XNETHANDLE * pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam)
+{
+ return m_PluginLua.ModulePlugin_LuaCore_Push(pxhModule, lpszPluginFile, lParam);
+}
+extern "C" BOOL ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen)
+{
+ return m_PluginLua.ModulePlugin_LuaCore_Exec(xhModule, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBufer, nMsgLen);
+}
+extern "C" BOOL ModulePlugin_LuaCore_Destroy()
+{
+ return m_PluginLua.ModulePlugin_LuaCore_Destroy();
}
/*********************************************************************************
* 加载器导出函数定义 *
*********************************************************************************/
-extern "C" BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName)
+extern "C" BOOL ModulePlugin_Loader_Insert(LPCTSTR lpszModuleMethod, LPCTSTR lpszModuleName, int nType)
{
- return m_PluginLoader.ModulePlugin_Loader_Insert(lpszModuleMethod, lpszModuleName);
+ return m_PluginLoader.ModulePlugin_Loader_Insert(lpszModuleMethod, lpszModuleName, nType);
}
-extern "C" BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName)
+extern "C" BOOL ModulePlugin_Loader_Find(LPCTSTR lpszMethodName, int* pInt_Type)
{
- return m_PluginLoader.ModulePlugin_Loader_Find(lpszMethodName);
+ return m_PluginLoader.ModulePlugin_Loader_Find(lpszMethodName, pInt_Type);
}
extern "C" BOOL ModulePlugin_Loader_Exec(LPCTSTR lpszMethodName, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen)
{
diff --git a/XEngine_Source/XEngine_ModulePlugin/pch.h b/XEngine_Source/XEngine_ModulePlugin/pch.h
index 76a4324365f37b4d515b08eded6b220f89ffc630..54fdf777702559ec4d0f9ca12caedc9b9ceae6d6 100644
--- a/XEngine_Source/XEngine_ModulePlugin/pch.h
+++ b/XEngine_Source/XEngine_ModulePlugin/pch.h
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h
index f3077a6f3d3b3af32d488941bfc5e8638f03009c..df53fddf7f2247b3eedcd4ba1a8aab9dcc539851 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/BMIndex_Define.h
@@ -35,11 +35,11 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-extern "C" BOOL PluginCore_UnInit();
+extern "C" void PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj
index 2a566f2581271107a9776997e95b1bbd9eaf761d..4fa9af35e835f18f86b169784c8b6d9b0feb51ee 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/ModulePlugin_BMIndex.vcxproj
@@ -72,29 +72,29 @@
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
../../XEngine_ThirdPart/jsoncpp;$(XEngine_Include);$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(Configuration)\XEngine_Plugin\
+ $(Configuration)\XEngine_LibPlugin\
$(ProjectName)
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
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
index 9b67548742339394323d6f4ee0b103f186a8260d..4c3d75a4cdee4e19c3b24ecc153341033cc3b594 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp
@@ -43,15 +43,13 @@ BOOL CPlugin_BMIndex::PluginCore_Init(LPVOID lParam)
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-BOOL CPlugin_BMIndex::PluginCore_UnInit()
+void CPlugin_BMIndex::PluginCore_UnInit()
{
BMIndex_IsErrorOccur = FALSE;
-
- return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
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
index 9ffb474326a1d4b620531e7ed57e01dd9240e223..65e481bfa5008c78d54dd69d17d2430296f87d29 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.h
@@ -18,7 +18,7 @@ public:
~CPlugin_BMIndex();
public:
BOOL PluginCore_Init(LPVOID lParam);
- BOOL PluginCore_UnInit();
+ void 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);
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp
index 1e5d0a0331a2e21446e5c5cc0985ab740621fb69..f5bb721c00411c0ec216cfdbde41f363443bc638 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/pch.cpp
@@ -29,9 +29,9 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginBMIndex.PluginCore_Init(lParam);
}
-extern "C" BOOL PluginCore_UnInit()
+extern "C" void PluginCore_UnInit()
{
- return m_PluginBMIndex.PluginCore_UnInit();
+ 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)
{
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/ModulePlugin_Meter.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/ModulePlugin_Meter.vcxproj
index 7fb4df7ee42a2e4848bc3834b17c4a6cb931a922..37c1c1eae6a829948efcd23fde4267cf4d453673 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/ModulePlugin_Meter.vcxproj
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/ModulePlugin_Meter.vcxproj
@@ -72,26 +72,26 @@
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/PluginMeter_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/PluginMeter_Define.h
index 9de207476aaf690612db7867da8ebfceecacd94b..a17f727190561401ff742e57979f56124f6421ea 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/PluginMeter_Define.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/PluginMeter_Define.h
@@ -88,11 +88,11 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-extern "C" BOOL PluginCore_UnInit();
+extern "C" void PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp
index ad2c8dc77d54c424953fd003b94a6f52e08890d4..ea78d02ff28199e4233b0b733a157576327a6893 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp
@@ -43,15 +43,13 @@ BOOL CPlugin_Meter::PluginCore_Init(LPVOID lParam)
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-BOOL CPlugin_Meter::PluginCore_UnInit()
+void CPlugin_Meter::PluginCore_UnInit()
{
Meter_IsErrorOccur = FALSE;
-
- return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.h
index f26954095492747ca2101e67dee70b6a33ebc1d8..9e7b043dfcb31fd03ece3c43c2dc5f6542b336c8 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.h
@@ -18,7 +18,7 @@ public:
~CPlugin_Meter();
public:
BOOL PluginCore_Init(LPVOID lParam);
- BOOL PluginCore_UnInit();
+ void PluginCore_UnInit();
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen);
protected:
BOOL Plugin_Meter_LengthConvert(int nSource, __int64x nValue, Json::Value *pSt_JsonObject);
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/pch.cpp
index fd0ce7ce94ac4e1df3a8c0b35fba538129ef6f3c..924816150a97dfb6046122a5fd450fb9315a08c8 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/pch.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/pch.cpp
@@ -29,9 +29,9 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginMeter.PluginCore_Init(lParam);
}
-extern "C" BOOL PluginCore_UnInit()
+extern "C" void PluginCore_UnInit()
{
- return m_PluginMeter.PluginCore_UnInit();
+ m_PluginMeter.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/ModulePlugin_Password.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/ModulePlugin_Password.vcxproj
index 8e4412ac0f746d914b6c8aa223fb9a59c0cbe21f..c6920277191eee364fc08ed499c6e029d22fedbb 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/ModulePlugin_Password.vcxproj
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/ModulePlugin_Password.vcxproj
@@ -73,31 +73,31 @@
true
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(Configuration)\XEngine_Plugin\
+ $(Configuration)\XEngine_LibPlugin\
false
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
true
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
false
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h
index 999915f4d2e1b280f239c8171da8960940d3807d..acbc83bc7aab76a5b74f7a6d39c022ccfd4707ab 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/PluginPass_Define.h
@@ -35,11 +35,11 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-extern "C" BOOL PluginCore_UnInit();
+extern "C" void PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
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 83a168a07770f0fd42e8eab3d306f17a9dc4d437..e92a222335ddcd15b057c7c371a02f94b267aa9f 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
@@ -43,15 +43,13 @@ BOOL CPlugin_Password::PluginCore_Init(LPVOID lParam)
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-BOOL CPlugin_Password::PluginCore_UnInit()
+void CPlugin_Password::PluginCore_UnInit()
{
Pass_IsErrorOccur = FALSE;
-
- return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
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 775bc75e3ef01c7d2584c48d8a1fbc3ac409bd23..e335ff5f279bd6eef6bf59df67101ad1ae34ce65 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
@@ -18,7 +18,7 @@ public:
~CPlugin_Password();
public:
BOOL PluginCore_Init(LPVOID lParam);
- BOOL PluginCore_UnInit();
+ void PluginCore_UnInit();
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);
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp
index d830cf1a4efa48132e8f76a9dd63a3b21bf8c299..4bcb196cf4141ff05689bfb7885f290d31f46c21 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/pch.cpp
@@ -29,9 +29,9 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginPass.PluginCore_Init(lParam);
}
-extern "C" BOOL PluginCore_UnInit()
+extern "C" void PluginCore_UnInit()
{
- return m_PluginPass.PluginCore_UnInit();
+ m_PluginPass.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj
index 07ca3e78d61b81346d9e643daadee4ecb4ba83af..462fea3b3c8639d06ea191a599ba2e3ef91e2fa9 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/ModulePlugin_Timezone.vcxproj
@@ -74,26 +74,26 @@
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
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
index 9d35ad628e9bb7044ffe1a576cc12550532735ba..105e12f473882d238327602ca8c3f180e68edb57 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp
@@ -503,16 +503,15 @@ BOOL CPlugin_Timezone::PluginCore_Init(LPVOID lParam)
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-BOOL CPlugin_Timezone::PluginCore_UnInit()
+void CPlugin_Timezone::PluginCore_UnInit()
{
Timezone_IsErrorOccur = FALSE;
stl_MapTimezone.clear();
- return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
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
index 1aac345412a2addf7a8fb281a9bc6377a02423d4..d5ef3ff41ecf8eed56141e34c4c33e30276f7e52 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.h
@@ -24,7 +24,7 @@ public:
~CPlugin_Timezone();
public:
BOOL PluginCore_Init(LPVOID lParam);
- BOOL PluginCore_UnInit();
+ void 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);
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h
index f3077a6f3d3b3af32d488941bfc5e8638f03009c..df53fddf7f2247b3eedcd4ba1a8aab9dcc539851 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Timezone_Define.h
@@ -35,11 +35,11 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-extern "C" BOOL PluginCore_UnInit();
+extern "C" void PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp
index 7b86a46e51dc996026de47d87f4741c3534cd84b..e7dbfaa36656b4210b3ea2e20b7e7a986c85434f 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/pch.cpp
@@ -29,9 +29,9 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginTimes.PluginCore_Init(lParam);
}
-extern "C" BOOL PluginCore_UnInit()
+extern "C" void PluginCore_UnInit()
{
- return m_PluginTimes.PluginCore_UnInit();
+ 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)
{
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/ModulePlugin_Zodiac.vcxproj b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/ModulePlugin_Zodiac.vcxproj
index 4fc65cfe314748eb9705bcae34102ed8e95ed7dd..8d82c5a8b109e58bee7ea0641a6e34572f85923e 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/ModulePlugin_Zodiac.vcxproj
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/ModulePlugin_Zodiac.vcxproj
@@ -73,8 +73,8 @@
true
- $(Configuration)\XEngine_Plugin\
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
+ $(Configuration)\XEngine_LibPlugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
@@ -82,22 +82,22 @@
false
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib32);$(LibraryPath)
- $(SolutionDir)$(Configuration)\XEngine_Plugin\
- $(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Configuration)\XEngine_LibPlugin\
+ $(Configuration)\XEngine_LibPlugin\
true
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
false
$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)
$(XEngine_Lib64);$(LibraryPath)
- $(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\
- $(Platform)\$(Configuration)\XEngine_Plugin\
+ $(SolutionDir)$(Platform)\$(Configuration)\XEngine_LibPlugin\
+ $(Platform)\$(Configuration)\XEngine_LibPlugin\
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h
index dfde76c3b88a24b2c82b3b44d149cedb8ab1c32f..1a1cae95378dd970276da67ee03e1c0fa534717d 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/PluginZodiac_Define.h
@@ -35,11 +35,11 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-extern "C" BOOL PluginCore_UnInit();
+extern "C" void PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
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 9f8311174c475d40790711db7c185e525967a43e..2e2994a09da6cc8f88c6b641388e88e1cfc55da6 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
@@ -55,15 +55,13 @@ BOOL CPlugin_Zodiac::PluginCore_Init(LPVOID lParam)
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
- 类型:逻辑型
- 意思:是否成功
+ 类型:无
+ 意思:
备注:
*********************************************************************/
-BOOL CPlugin_Zodiac::PluginCore_UnInit()
+void CPlugin_Zodiac::PluginCore_UnInit()
{
Zodiac_IsErrorOccur = FALSE;
-
- return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
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 207703e90613e04b5deff33f15903e2a2d8d95b9..e5491f67f76aa87fdcff1929b158c59b319080aa 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
@@ -18,7 +18,7 @@ public:
~CPlugin_Zodiac();
public:
BOOL PluginCore_Init(LPVOID lParam);
- BOOL PluginCore_UnInit();
+ void PluginCore_UnInit();
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);
diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp
index 8d046c5485879859e21b7a5f994cc2efca144d70..5dad93d133cdd04ef39980da9e58d309fc04ad3a 100644
--- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp
+++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/pch.cpp
@@ -29,9 +29,9 @@ extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginZodiac.PluginCore_Init(lParam);
}
-extern "C" BOOL PluginCore_UnInit()
+extern "C" void PluginCore_UnInit()
{
- return m_PluginZodiac.PluginCore_UnInit();
+ m_PluginZodiac.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp
index 083f28dedba8d9e4d6aee7fbd69aa41d362cecda..5b3139b89e0a04321cf512054948538f5215019c 100644
--- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp
+++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp
@@ -39,15 +39,13 @@ XHTHREAD CALLBACK XEngine_HTTPTask_Thread(LPVOID lParam)
memset(&st_HTTPReqparam, '\0', sizeof(RFCCOMPONENTS_HTTP_REQPARAM));
//得到一个指定客户端的完整数据包
- if (!RfcComponents_HttpServer_GetMemoryEx(xhHTTPPacket, ppSst_ListAddr[i]->tszClientAddr, &ptszMsgBuffer, &nMsgLen, &st_HTTPReqparam))
+ if (RfcComponents_HttpServer_GetMemoryEx(xhHTTPPacket, ppSst_ListAddr[i]->tszClientAddr, &ptszMsgBuffer, &nMsgLen, &st_HTTPReqparam))
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("HTTP客户端:%s,获取数据包失败,错误:%lX"), ppSst_ListAddr[i]->tszClientAddr, HttpServer_GetLastError());
- continue;
+ //在另外一个函数里面处理数据
+ XEngine_HTTPTask_Handle(&st_HTTPReqparam, ppSst_ListAddr[i]->tszClientAddr, ptszMsgBuffer, nMsgLen);
+ //释放内存
+ BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszMsgBuffer);
}
- //在另外一个函数里面处理数据
- XEngine_HTTPTask_Handle(&st_HTTPReqparam, ppSst_ListAddr[i]->tszClientAddr, ptszMsgBuffer, nMsgLen);
- //释放内存
- BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszMsgBuffer);
}
}
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSst_ListAddr, nListCount);
@@ -127,9 +125,10 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR
return FALSE;
}
//首先处理插件
- if (ModulePlugin_Loader_Find(tszValue))
+ int nPluginType = 0;
+ if (ModulePlugin_Loader_Find(tszValue, &nPluginType))
{
- XEngine_PluginTask_Handle(tszValue, lpszClientAddr, lpszRVBuffer, nRVLen, &pptszList, nListCount);
+ XEngine_PluginTask_Handle(tszValue, lpszClientAddr, lpszRVBuffer, nRVLen, &pptszList, nListCount, nPluginType);
return TRUE;
}
if (0 == _tcsnicmp(lpszMethodPost, pSt_HTTPParam->tszHttpMethod, _tcslen(lpszMethodPost)))
diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h
index 76aceadfd8126a5b522e2b464c9e3976f3b3922f..438ecf6a939816019e1c0e52580e6f70ef8ee04b 100644
--- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h
+++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h
@@ -90,7 +90,8 @@ extern XHANDLE xhHTTPPool;
//配置文件
extern XENGINE_SERVICECONFIG st_ServiceConfig;
extern XENGINE_OPENCCCONFIG st_OPenccConfig;
-extern XENGINE_PLUGINCONFIG st_PluginConfig;
+extern XENGINE_PLUGINCONFIG st_PluginLibConfig;
+extern XENGINE_PLUGINCONFIG st_PluginLuaConfig;
extern XENGINE_OPTIONLIST st_OPtionList;
//连接库
#ifdef _WINDOWS
diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp
index b0007f2d6b31bb25fe7d7e646df6202db9083bf3..733c9aa1b67c575e6304b95b61864f2a6d5e71dd 100644
--- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp
+++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp
@@ -20,7 +20,8 @@ XHANDLE xhHTTPPool = 0;
//配置文件
XENGINE_SERVICECONFIG st_ServiceConfig;
XENGINE_OPENCCCONFIG st_OPenccConfig;
-XENGINE_PLUGINCONFIG st_PluginConfig;
+XENGINE_PLUGINCONFIG st_PluginLibConfig;
+XENGINE_PLUGINCONFIG st_PluginLuaConfig;
XENGINE_OPTIONLIST st_OPtionList;
void ServiceApp_Stop(int signo)
@@ -41,7 +42,8 @@ void ServiceApp_Stop(int signo)
ModuleDatabase_Bank_Destory();
ModuleDatabase_ZIPCode_Destory();
//销毁其他
- ModulePlugin_Core_Destroy();
+ ModulePlugin_LibCore_Destroy();
+ ModulePlugin_LuaCore_Destroy();
ModuleHelp_P2PClient_Destory();
//销毁日志资源
HelpComponents_XLog_Destroy(xhLog);
@@ -98,7 +100,8 @@ int main(int argc, char** argv)
memset(&st_XLogConfig, '\0', sizeof(HELPCOMPONENTS_XLOG_CONFIGURE));
memset(&st_ServiceConfig, '\0', sizeof(XENGINE_SERVICECONFIG));
memset(&st_OPenccConfig, '\0', sizeof(XENGINE_OPENCCCONFIG));
- memset(&st_PluginConfig, '\0', sizeof(XENGINE_PLUGINCONFIG));
+ memset(&st_PluginLibConfig, '\0', sizeof(XENGINE_PLUGINCONFIG));
+ memset(&st_PluginLuaConfig, '\0', sizeof(XENGINE_PLUGINCONFIG));
st_XLogConfig.XLog_MaxBackupFile = 10;
st_XLogConfig.XLog_MaxSize = 1024000;
@@ -139,12 +142,18 @@ int main(int argc, char** argv)
//初始化插件配置
if (st_ServiceConfig.st_XPlugin.bEnable)
{
- if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginFile, &st_PluginConfig))
+ if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLib, &st_PluginLibConfig))
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError());
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化Lib插件配置文件失败,错误:%lX"), ModuleConfigure_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("启动服务中,初始化Lib插件配置文件成功"));
+ if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLua, &st_PluginLuaConfig))
+ {
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化Lua插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError());
+ goto XENGINE_SERVICEAPP_EXIT;
+ }
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化Lua插件配置文件成功"));
}
else
{
@@ -249,36 +258,63 @@ int main(int argc, char** argv)
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,启动P2P客户端管理器成功,超时时间设置:%d 秒"), st_ServiceConfig.st_XTime.nP2PTimeOut);
//启动插件
- if (!ModulePlugin_Core_Init())
+ if (!ModulePlugin_LibCore_Init())
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化插件系统失败,错误:%lX"), ModulePlugin_GetLastError());
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化Lib插件系统失败,错误:%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("启动服务中,初始化Lib插件系统成功,开始加载插件"));
+ {
+ list::const_iterator stl_ListIterator = st_PluginLibConfig.pStl_ListPlugin->begin();
+ for (int i = 1; stl_ListIterator != st_PluginLibConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++)
+ {
+ if (stl_ListIterator->bEnable)
+ {
+ if (ModulePlugin_Loader_Insert(stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile, 0))
+ {
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,加载Lib模块插件中,当前第:%d 个加载成功,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
+ }
+ else
+ {
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,加载Lib模块插件中,当前第:%d 个加载失败,方法:%s,路径:%s,错误:%lX"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile, ModulePlugin_GetLastError());
+ }
+ }
+ else
+ {
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("启动服务中,加载Lib模块插件中,当前第:%d 个加载失败,因为没有启用,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
+ }
+ }
+ }
+ if (!ModulePlugin_LuaCore_Init())
+ {
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化Lua插件系统失败,错误:%lX"), ModulePlugin_GetLastError());
+ goto XENGINE_SERVICEAPP_EXIT;
+ }
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化Lua插件系统成功,开始加载插件"));
{
- list::const_iterator stl_ListIterator = st_PluginConfig.pStl_ListPlugin->begin();
- for (int i = 1; stl_ListIterator != st_PluginConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++)
+ list::const_iterator stl_ListIterator = st_PluginLuaConfig.pStl_ListPlugin->begin();
+ for (int i = 1; stl_ListIterator != st_PluginLuaConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++)
{
if (stl_ListIterator->bEnable)
{
- if (ModulePlugin_Loader_Insert(stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile))
+ if (ModulePlugin_Loader_Insert(stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile, 1))
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,加载插件中,当前第:%d 个加载成功,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,加载Lua模块插件中,当前第:%d 个加载成功,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
}
else
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,加载插件中,当前第:%d 个加载失败,方法:%s,路径:%s,错误:%ld"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile, ModulePlugin_GetLastError());
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,加载Lua模块插件中,当前第:%d 个加载失败,方法:%s,路径:%s,错误:%lX"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile, ModulePlugin_GetLastError());
}
}
else
{
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("启动服务中,加载插件中,当前第:%d 个加载失败,因为没有启用,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("启动服务中,加载Lua模块插件中,当前第:%d 个加载失败,因为没有启用,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile);
}
}
}
//展示能力
- 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 个,Lib插件:%d 个,Lua插件:%d 个"), st_OPtionList.stl_ListBase.size(), st_PluginLibConfig.pStl_ListPlugin->size(), st_PluginLuaConfig.pStl_ListPlugin->size());
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)
@@ -303,7 +339,8 @@ XENGINE_SERVICEAPP_EXIT:
ModuleDatabase_Bank_Destory();
ModuleDatabase_ZIPCode_Destory();
//销毁其他
- ModulePlugin_Core_Destroy();
+ ModulePlugin_LibCore_Destroy();
+ ModulePlugin_LuaCore_Destroy();
ModuleHelp_P2PClient_Destory();
//销毁日志资源
HelpComponents_XLog_Destroy(xhLog);
diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.cpp
index ff318f9674f627e8895196c61b1d07f05efd6dc1..9e770d7b2cccdd5b74a32a3f601027619bcbe453 100644
--- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.cpp
+++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.cpp
@@ -10,7 +10,7 @@
// Purpose: HTTP任务处理代码
// History:
*********************************************************************/
-BOOL XEngine_PluginTask_Handle(LPCTSTR lpszMethodName, LPCTSTR lpszClientAddr, LPCTSTR lpszRVBuffer, int nRVLen, TCHAR*** ppptszList, int nListCount)
+BOOL XEngine_PluginTask_Handle(LPCTSTR lpszMethodName, LPCTSTR lpszClientAddr, LPCTSTR lpszRVBuffer, int nRVLen, TCHAR*** ppptszList, int nListCount, int nPluginType)
{
int nMsgLen = 0;
int nPktLen = 0;
@@ -23,11 +23,20 @@ BOOL XEngine_PluginTask_Handle(LPCTSTR lpszMethodName, LPCTSTR lpszClientAddr, L
memset(&st_HDRParament, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM));
st_HDRParament.bIsClose = TRUE;
+ st_HDRParament.nHttpCode = 200;
_tcscpy(st_HDRParament.tszMimeType, "json");
- ModulePlugin_Loader_Exec(lpszMethodName, ppptszList, nListCount, &st_HDRParament.nHttpCode, tszPktBuffer, &nPktLen);
- RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParament, tszPktBuffer, nPktLen);
+ if (ModulePlugin_Loader_Exec(lpszMethodName, ppptszList, nListCount, &st_HDRParament.nHttpCode, tszPktBuffer, &nPktLen))
+ {
+ RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParament, tszPktBuffer, nPktLen);
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,请求的方法:%s,由%s插件模块处理成功"), lpszClientAddr, lpszMethodName, 0 == nPluginType ? "Lib" : "Lua");
+ }
+ else
+ {
+ st_HDRParament.nHttpCode = 400;
+ RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParament);
+ XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,请求的方法:%s,由%s插件模块处理失败,错误:%lX"), lpszClientAddr, lpszMethodName, 0 == nPluginType ? "Lib" : "Lua", ModulePlugin_GetLastError());
+ }
XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen);
- XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,请求的方法:%s,由插件模块处理成功"), lpszClientAddr, lpszMethodName);
return TRUE;
}
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.h
index 9920703cd124a8c66b8111fa554aa98a36cabba3..d7c4cfd3900f6591fe3469db3f4375ae12402265 100644
--- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.h
+++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_PluginTask.h
@@ -11,4 +11,4 @@
// History:
*********************************************************************/
//插件处理函数
-BOOL XEngine_PluginTask_Handle(LPCTSTR lpszMethodName, LPCTSTR lpszClientAddr, LPCTSTR lpszRVBuffer, int nRVLen, TCHAR*** ppptszList, int nListCount);
\ No newline at end of file
+BOOL XEngine_PluginTask_Handle(LPCTSTR lpszMethodName, LPCTSTR lpszClientAddr, LPCTSTR lpszRVBuffer, int nRVLen, TCHAR*** ppptszList, int nListCount, int nPluginType);
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/binx64/opencc.dll b/XEngine_Source/XEngine_ThirdPart/opencc/binx64/opencc.dll
deleted file mode 100644
index 797eaf85212954f77a7d6e507509b59a567ec25b..0000000000000000000000000000000000000000
Binary files a/XEngine_Source/XEngine_ThirdPart/opencc/binx64/opencc.dll and /dev/null differ
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/binx86/opencc.dll b/XEngine_Source/XEngine_ThirdPart/opencc/binx86/opencc.dll
deleted file mode 100644
index 358b47d1e93484170b29cac16f52fcdb60d1c469..0000000000000000000000000000000000000000
Binary files a/XEngine_Source/XEngine_ThirdPart/opencc/binx86/opencc.dll and /dev/null differ
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/BinaryDict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/BinaryDict.hpp
deleted file mode 100644
index 7c23268fea0762d11cdcfbecaff6e9c175ee4af3..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/BinaryDict.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "SerializableDict.hpp"
-
-namespace opencc {
-/**
- * Binary dictionary for faster deserialization
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT BinaryDict : public SerializableDict {
-public:
- BinaryDict(const LexiconPtr& _lexicon) : lexicon(_lexicon) {}
-
- virtual ~BinaryDict() {}
-
- virtual void SerializeToFile(FILE* fp) const;
-
- static BinaryDictPtr NewFromFile(FILE* fp);
-
- const LexiconPtr& GetLexicon() const { return lexicon; }
-
- size_t KeyMaxLength() const;
-
-private:
- LexiconPtr lexicon;
- std::string keyBuffer;
- std::string valueBuffer;
-
- void ConstructBuffer(std::string& keyBuffer, std::vector& keyOffset,
- size_t& keyTotalLength, std::string& valueBuffer,
- std::vector& valueOffset,
- size_t& valueTotalLength) const;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Common.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Common.hpp
deleted file mode 100644
index 067966b55386cafcad2d8d631d0b57319474c383..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Common.hpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-// Microsoft Visual C++ specific
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma warning(disable : 4251 4266 4350 4503 4512 4514 4710 4820)
-#endif
-
-#include
-#include
-#include
-#include
-
-#include "Export.hpp"
-#include "Optional.hpp"
-#include "opencc_config.h"
-
-// Forward decalarations and alias
-namespace opencc {
-class Config;
-class Conversion;
-class ConversionChain;
-class Converter;
-class Dict;
-class DictEntry;
-class DictGroup;
-class Lexicon;
-class MarisaDict;
-class MultiValueDictEntry;
-class NoValueDictEntry;
-class Segmentation;
-class Segments;
-class SerializableDict;
-class SingleValueDictEntry;
-class TextDict;
-typedef std::shared_ptr ConversionPtr;
-typedef std::shared_ptr ConversionChainPtr;
-typedef std::shared_ptr ConverterPtr;
-typedef std::shared_ptr DictPtr;
-typedef std::shared_ptr DictGroupPtr;
-typedef std::shared_ptr LexiconPtr;
-typedef std::shared_ptr MarisaDictPtr;
-typedef std::shared_ptr SegmentationPtr;
-typedef std::shared_ptr SegmentsPtr;
-typedef std::shared_ptr SerializableDictPtr;
-typedef std::shared_ptr TextDictPtr;
-
-#ifdef OPENCC_ENABLE_DARTS
-class BinaryDict;
-class DartsDict;
-typedef std::shared_ptr BinaryDictPtr;
-typedef std::shared_ptr DartsDictPtr;
-#endif
-
-} // namespace opencc
-
-#ifndef PKGDATADIR
-const std::string PACKAGE_DATA_DIRECTORY = "";
-#else // ifndef PKGDATADIR
-const std::string PACKAGE_DATA_DIRECTORY = PKGDATADIR "/";
-#endif // ifndef PKGDATADIR
-
-#ifndef VERSION
-#define VERSION "1.0.*"
-#endif // ifndef VERSION
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Config.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Config.hpp
deleted file mode 100644
index 7a904cee698d57563c3473c5da1d043227f4c61f..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Config.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-
-namespace opencc {
-/**
- * Configuration loader
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Config {
-public:
- Config();
-
- virtual ~Config();
-
- ConverterPtr NewFromString(const std::string& json,
- const std::string& configDirectory);
-
- ConverterPtr NewFromFile(const std::string& fileName);
-
-private:
- void* internal;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Conversion.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Conversion.hpp
deleted file mode 100644
index cf73a254a3f9998d0a6620f4494e6637de89e1d9..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Conversion.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "Segmentation.hpp"
-
-namespace opencc {
-/**
- * Conversion interface
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Conversion {
-public:
- Conversion(DictPtr _dict) : dict(_dict) {}
-
- // Convert single phrase
- std::string Convert(const std::string& phrase) const;
-
- // Convert single phrase
- std::string Convert(const char* phrase) const;
-
- // Convert segmented text
- SegmentsPtr Convert(const SegmentsPtr& input) const;
-
- const DictPtr GetDict() const { return dict; }
-
-private:
- const DictPtr dict;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/ConversionChain.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/ConversionChain.hpp
deleted file mode 100644
index 28853c67cd042a933e5e11217f3ab24d2438a4bc..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/ConversionChain.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-
-#include "Common.hpp"
-#include "Conversion.hpp"
-
-namespace opencc {
-/**
- * Chain of conversions
- * Consists of a list of conversions. Converts input in sequence.
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT ConversionChain {
-public:
- ConversionChain(const std::list _conversions);
-
- SegmentsPtr Convert(const SegmentsPtr& input) const;
-
- const std::list GetConversions() const { return conversions; }
-
-private:
- const std::list conversions;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Converter.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Converter.hpp
deleted file mode 100644
index 9f1f3f9421b56a120179ef3758bcfb463f30a8a6..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Converter.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "Segmentation.hpp"
-
-namespace opencc {
-/**
- * Controller of segmentation and conversion
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Converter {
-public:
- Converter(const std::string& _name, SegmentationPtr _segmentation,
- ConversionChainPtr _conversionChain)
- : name(_name), segmentation(_segmentation),
- conversionChain(_conversionChain) {}
-
- std::string Convert(const std::string& text) const;
-
- size_t Convert(const char* input, char* output) const;
-
- const SegmentationPtr GetSegmentation() const { return segmentation; }
-
- const ConversionChainPtr GetConversionChain() const {
- return conversionChain;
- }
-
-private:
- const std::string name;
- const SegmentationPtr segmentation;
- const ConversionChainPtr conversionChain;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DartsDict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DartsDict.hpp
deleted file mode 100644
index eacc1a8c6f02e2cc31b98fe651c2acf22c6b8ebb..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DartsDict.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "SerializableDict.hpp"
-
-namespace opencc {
-/**
- * Darts dictionary
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT DartsDict : public Dict, public SerializableDict {
-public:
- virtual ~DartsDict();
-
- virtual size_t KeyMaxLength() const;
-
- virtual Optional Match(const char* word, size_t len) const;
-
- virtual Optional MatchPrefix(const char* word,
- size_t len) const;
-
- virtual LexiconPtr GetLexicon() const;
-
- virtual void SerializeToFile(FILE* fp) const;
-
- /**
- * Constructs a DartsDict from another dictionary.
- */
- static DartsDictPtr NewFromDict(const Dict& thatDict);
-
- static DartsDictPtr NewFromFile(FILE* fp);
-
-private:
- DartsDict();
-
- size_t maxLength;
- LexiconPtr lexicon;
-
- class DartsInternal;
- DartsInternal* internal;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Dict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Dict.hpp
deleted file mode 100644
index 1c810346c17ec7b710434890760bd693e17e2956..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Dict.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2020 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "DictEntry.hpp"
-
-namespace opencc {
-/**
- * Abstract class of dictionary
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Dict {
-public:
- /**
- * Matches a word exactly and returns the DictEntry or Optional::Null().
- */
- virtual Optional Match(const char* word,
- size_t len) const = 0;
-
- /**
- * Matches a word exactly and returns the DictEntry or Optional::Null().
- */
- Optional Match(const std::string& word) const {
- return Match(word.c_str(), word.length());
- }
-
- /**
- * Matches the longest matched prefix of a word.
- * For example given a dictionary having "a", "an", "b", "ba", "ban", "bana",
- * the longest prefix of "banana" matched is "bana".
- */
- virtual Optional MatchPrefix(const char* word,
- size_t len) const;
-
- /**
- * Matches the longest matched prefix of a word.
- */
- Optional MatchPrefix(const char* word) const {
- return MatchPrefix(word, KeyMaxLength());
- }
-
- /**
- * Matches the longest matched prefix of a word.
- */
- Optional MatchPrefix(const std::string& word) const {
- return MatchPrefix(word.c_str(), word.length());
- }
-
- /**
- * Returns all matched prefixes of a word, sorted by the length (desc).
- * For example given a dictionary having "a", "an", "b", "ba", "ban", "bana",
- * all the matched prefixes of "banana" are "bana", "ban", "ba", "b".
- */
- virtual std::vector MatchAllPrefixes(const char* word,
- size_t len) const;
-
- /**
- * Returns all matched prefixes of a word, sorted by the length (desc).
- */
- std::vector
- MatchAllPrefixes(const std::string& word) const {
- return MatchAllPrefixes(word.c_str(), word.length());
- }
-
- /**
- * Returns the length of the longest key in the dictionary.
- */
- virtual size_t KeyMaxLength() const = 0;
-
- /**
- * Returns all entries in the dictionary.
- */
- virtual LexiconPtr GetLexicon() const = 0;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictConverter.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictConverter.hpp
deleted file mode 100644
index f911c4feb57affd8106309249a03031f3192ad96..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictConverter.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2017 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-
-namespace opencc {
-/**
- * Converts a dictionary from a format to another.
- * @ingroup opencc_cpp_api
- */
-OPENCC_EXPORT void ConvertDictionary(const std::string& inputFileName,
- const std::string& outputFileName,
- const std::string& formatFrom,
- const std::string& formatTo);
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictEntry.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictEntry.hpp
deleted file mode 100644
index 7b2babda52a4123ccb31ddb9f5f8d285d4772a78..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictEntry.hpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2020 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "Segments.hpp"
-#include "UTF8Util.hpp"
-
-namespace opencc {
-/**
- * Key-values pair entry
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT DictEntry {
-public:
- virtual ~DictEntry() {}
-
- virtual std::string Key() const = 0;
-
- virtual std::vector Values() const = 0;
-
- virtual std::string GetDefault() const = 0;
-
- virtual size_t NumValues() const = 0;
-
- virtual std::string ToString() const = 0;
-
- size_t KeyLength() const { return Key().length(); }
-
- bool operator<(const DictEntry& that) const { return Key() < that.Key(); }
-
- bool operator==(const DictEntry& that) const { return Key() == that.Key(); }
-
- static bool UPtrLessThan(const std::unique_ptr& a,
- const std::unique_ptr& b) {
- return *a < *b;
- }
-};
-
-class OPENCC_EXPORT NoValueDictEntry : public DictEntry {
-public:
- NoValueDictEntry(const std::string& _key) : key(_key) {}
-
- virtual ~NoValueDictEntry() {}
-
- virtual std::string Key() const { return key; }
-
- virtual std::vector Values() const {
- return std::vector();
- }
-
- virtual std::string GetDefault() const { return key; }
-
- virtual size_t NumValues() const { return 0; }
-
- virtual std::string ToString() const { return key; }
-
-private:
- std::string key;
-};
-
-class OPENCC_EXPORT SingleValueDictEntry : public DictEntry {
-public:
- virtual std::string Value() const = 0;
-
- virtual std::vector Values() const {
- return std::vector{Value()};
- }
-
- virtual std::string GetDefault() const { return Value(); }
-
- virtual size_t NumValues() const { return 1; }
-
- virtual std::string ToString() const {
- return std::string(Key()) + "\t" + Value();
- }
-};
-
-class OPENCC_EXPORT StrSingleValueDictEntry : public SingleValueDictEntry {
-public:
- StrSingleValueDictEntry(const std::string& _key, const std::string& _value)
- : key(_key), value(_value) {}
-
- virtual ~StrSingleValueDictEntry() {}
-
- virtual std::string Key() const { return key; }
-
- virtual std::string Value() const { return value; }
-
-private:
- std::string key;
- std::string value;
-};
-
-class OPENCC_EXPORT MultiValueDictEntry : public DictEntry {
-public:
- virtual std::string GetDefault() const {
- if (NumValues() > 0) {
- return Values().at(0);
- } else {
- return Key();
- }
- }
-
- virtual std::string ToString() const;
-};
-
-class OPENCC_EXPORT StrMultiValueDictEntry : public MultiValueDictEntry {
-public:
- StrMultiValueDictEntry(const std::string& _key,
- const std::vector& _values)
- : key(_key), values(_values) {}
-
- virtual ~StrMultiValueDictEntry() {}
-
- virtual std::string Key() const { return key; }
-
- size_t NumValues() const { return values.size(); }
-
- std::vector Values() const { return values; }
-
-private:
- std::string key;
- std::vector values;
-};
-
-class OPENCC_EXPORT DictEntryFactory {
-public:
- static DictEntry* New(const std::string& key) {
- return new NoValueDictEntry(key);
- }
-
- static DictEntry* New(const std::string& key, const std::string& value) {
- return new StrSingleValueDictEntry(key, value);
- }
-
- static DictEntry* New(const std::string& key,
- const std::vector& values) {
- if (values.size() == 0) {
- return New(key);
- } else if (values.size() == 1) {
- return New(key, values.front());
- }
- return new StrMultiValueDictEntry(key, values);
- }
-
- static DictEntry* New(const DictEntry* entry) {
- if (entry->NumValues() == 0) {
- return new NoValueDictEntry(entry->Key());
- } else if (entry->NumValues() == 1) {
- return new StrSingleValueDictEntry(entry->Key(), entry->Values().front());
- } else {
- return new StrMultiValueDictEntry(entry->Key(), entry->Values());
- }
- }
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictGroup.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictGroup.hpp
deleted file mode 100644
index fd51d9133da1b6eac3904009edfd07cdc662e57c..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/DictGroup.hpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-
-#include "Common.hpp"
-#include "Dict.hpp"
-
-namespace opencc {
-/**
- * Group of dictionaries
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT DictGroup : public Dict {
-public:
- DictGroup(const std::list& dicts);
-
- static DictGroupPtr NewFromDict(const Dict& dict);
-
- virtual ~DictGroup();
-
- virtual size_t KeyMaxLength() const;
-
- virtual Optional Match(const char* word, size_t len) const;
-
- virtual Optional MatchPrefix(const char* word,
- size_t len) const;
-
- virtual std::vector MatchAllPrefixes(const char* word,
- size_t len) const;
-
- virtual LexiconPtr GetLexicon() const;
-
- const std::list GetDicts() const { return dicts; }
-
-private:
- const size_t keyMaxLength;
- const std::list dicts;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Exception.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Exception.hpp
deleted file mode 100644
index 7875537f60e042135019536daa6943652e60d901..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Exception.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-#include
-#include
-
-#include "Export.hpp"
-
-#if defined(_MSC_VER) && _MSC_VER < 1900
-// Before Visual Studio 2015 (14.0), C++ 11 "noexcept" qualifier is not
-// supported
-#define noexcept
-#endif // ifdef _MSC_VER
-
-namespace opencc {
-
-class OPENCC_EXPORT Exception {
-public:
- Exception() {}
-
- virtual ~Exception() throw() {}
-
- Exception(const std::string& _message) : message(_message) {}
-
- virtual const char* what() const noexcept { return message.c_str(); }
-
-protected:
- std::string message;
-};
-
-class OPENCC_EXPORT FileNotFound : public Exception {
-public:
- FileNotFound(const std::string& fileName)
- : Exception(fileName + " not found or not accessible.") {}
-};
-
-class OPENCC_EXPORT FileNotWritable : public Exception {
-public:
- FileNotWritable(const std::string& fileName)
- : Exception(fileName + " not writable.") {}
-};
-
-class OPENCC_EXPORT InvalidFormat : public Exception {
-public:
- InvalidFormat(const std::string& message)
- : Exception("Invalid format: " + message) {}
-};
-
-class OPENCC_EXPORT InvalidTextDictionary : public InvalidFormat {
-public:
- InvalidTextDictionary(const std::string& _message, size_t lineNum)
- : InvalidFormat("") {
- std::ostringstream buffer;
- buffer << "Invalid text dictionary at line " << lineNum << ": " << _message;
- message = buffer.str();
- }
-};
-
-class OPENCC_EXPORT InvalidUTF8 : public Exception {
-public:
- InvalidUTF8(const std::string& _message)
- : Exception("Invalid UTF8: " + _message) {}
-};
-
-class OPENCC_EXPORT ShouldNotBeHere : public Exception {
-public:
- ShouldNotBeHere() : Exception("ShouldNotBeHere! This must be a bug.") {}
-};
-
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Export.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Export.hpp
deleted file mode 100644
index 0015e880f3e09f4d79511edfa78dbb1081027e11..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Export.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#if defined(Opencc_BUILT_AS_STATIC) || !defined(_WIN32)
-#define OPENCC_EXPORT
-#define OPENCC_NO_EXPORT
-#else // if defined(Opencc_BUILT_AS_STATIC) || !defined(_WIN32)
-#ifndef OPENCC_EXPORT
-#ifdef libopencc_EXPORTS
-
-/* We are building this library */
-#define OPENCC_EXPORT __declspec(dllexport)
-#else // ifdef libopencc_EXPORTS
-
-/* We are using this library */
-#define OPENCC_EXPORT __declspec(dllimport)
-#endif // ifdef libopencc_EXPORTS
-#endif // ifndef OPENCC_EXPORT
-
-#ifndef OPENCC_NO_EXPORT
-#define OPENCC_NO_EXPORT
-#endif // ifndef OPENCC_NO_EXPORT
-#endif // if defined(Opencc_BUILT_AS_STATIC) || !defined(_WIN32)
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Lexicon.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Lexicon.hpp
deleted file mode 100644
index 688912875ead153c5984cbea80a5efa9cc3b8ad7..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Lexicon.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "DictEntry.hpp"
-
-namespace opencc {
-/**
- * Storage of all entries
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Lexicon {
-public:
- Lexicon() {}
- Lexicon(std::vector> entries_)
- : entries(std::move(entries_)) {}
- Lexicon(const Lexicon&) = delete;
- Lexicon& operator=(const Lexicon&) = delete;
-
- // Lexicon will take the ownership of the entry.
- void Add(DictEntry* entry) { entries.emplace_back(entry); }
-
- void Add(std::unique_ptr entry) {
- entries.push_back(std::move(entry));
- }
-
- void Sort();
-
- // Returns true if the lexicon is sorted by key.
- bool IsSorted();
-
- // Returns true if every key unique (after sorted).
- // When dupkey is set, it is set to the duplicate key.
- bool IsUnique(std::string* dupkey = nullptr);
-
- const DictEntry* At(size_t index) const { return entries.at(index).get(); }
-
- size_t Length() const { return entries.size(); }
-
- std::vector>::const_iterator begin() const {
- return entries.begin();
- }
-
- std::vector>::const_iterator end() const {
- return entries.end();
- }
-
-private:
- std::vector> entries;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MarisaDict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MarisaDict.hpp
deleted file mode 100644
index 6917c23aa885381d803851ccda080c3684c82c12..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MarisaDict.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2020 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "SerializableDict.hpp"
-
-namespace opencc {
-/**
- * Darts dictionary
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT MarisaDict : public Dict, public SerializableDict {
-public:
- virtual ~MarisaDict();
-
- virtual size_t KeyMaxLength() const;
-
- virtual Optional Match(const char* word, size_t len) const;
-
- virtual Optional MatchPrefix(const char* word,
- size_t len) const;
-
- virtual std::vector MatchAllPrefixes(const char* word,
- size_t len) const;
-
- virtual LexiconPtr GetLexicon() const;
-
- virtual void SerializeToFile(FILE* fp) const;
-
- /**
- * Constructs a MarisaDict from another dictionary.
- */
- static MarisaDictPtr NewFromDict(const Dict& thatDict);
-
- static MarisaDictPtr NewFromFile(FILE* fp);
-
-private:
- MarisaDict();
-
- size_t maxLength;
- LexiconPtr lexicon;
-
- class MarisaInternal;
- std::unique_ptr internal;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MaxMatchSegmentation.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MaxMatchSegmentation.hpp
deleted file mode 100644
index 1ecc227e2ed0920af95527a25c15854ca4faa698..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/MaxMatchSegmentation.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "DictGroup.hpp"
-#include "Segmentation.hpp"
-
-namespace opencc {
-/**
- * Implementation of maximal match segmentation
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT MaxMatchSegmentation : public Segmentation {
-public:
- MaxMatchSegmentation(const DictPtr _dict) : dict(_dict) {}
-
- virtual ~MaxMatchSegmentation() {}
-
- virtual SegmentsPtr Segment(const std::string& text) const;
-
- const DictPtr GetDict() const { return dict; }
-
-private:
- const DictPtr dict;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Optional.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Optional.hpp
deleted file mode 100644
index 8a510f43b1c9d637678b68209e74b828e5c59648..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Optional.hpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-namespace opencc {
-/**
- * A class that wraps type T into a nullable type.
- * @ingroup opencc_cpp_api
- */
-template class Optional {
-public:
- /**
- * The constructor of Optional.
- */
- Optional(T actual) : isNull(false), data(actual) {}
-
- /**
- * Returns true if the instance is null.
- */
- bool IsNull() const { return isNull; }
-
- /**
- * Returns the containing data of the instance.
- */
- const T& Get() const { return data; }
-
- /**
- * Constructs a null instance.
- */
- static Optional Null() { return Optional(); }
-
-private:
- Optional() : isNull(true) {}
-
- bool isNull;
- T data;
-};
-
-/**
- * Specialization of Optional for pointers.
- *
- * Reduce a bool.
- */
-template class Optional {
-private:
- Optional() : data(nullptr) {}
-
- typedef T* TPtr;
- TPtr data;
-
-public:
- Optional(TPtr actual) : data(actual) {}
-
- bool IsNull() const { return data == nullptr; }
-
- const TPtr& Get() const { return data; }
-
- static Optional Null() { return Optional(); }
-};
-} // namespace opencc
\ No newline at end of file
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/PhraseExtract.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/PhraseExtract.hpp
deleted file mode 100644
index 75a165deb0f75ae5f5403b2924d2d54037ef637b..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/PhraseExtract.hpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2015 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-#include
-
-#include "Common.hpp"
-#include "UTF8StringSlice.hpp"
-
-namespace opencc {
-
-class OPENCC_EXPORT PhraseExtract {
-public:
- typedef UTF8StringSlice::LengthType LengthType;
-
- typedef UTF8StringSliceBase UTF8StringSlice8Bit;
-
- PhraseExtract();
-
- virtual ~PhraseExtract();
-
- void Extract(const std::string& text) {
- SetFullText(text);
- ExtractSuffixes();
- CalculateFrequency();
- CalculateSuffixEntropy();
- ReleaseSuffixes();
- ExtractPrefixes();
- CalculatePrefixEntropy();
- ReleasePrefixes();
- ExtractWordCandidates();
- CalculateCohesions();
- SelectWords();
- }
-
- void SetFullText(const std::string& fullText) {
- utf8FullText = UTF8StringSlice(fullText.c_str());
- }
-
- void SetFullText(const char* fullText) {
- utf8FullText = UTF8StringSlice(fullText);
- }
-
- void SetFullText(const UTF8StringSlice& fullText) { utf8FullText = fullText; }
-
- void SetWordMinLength(const LengthType _wordMinLength) {
- wordMinLength = _wordMinLength;
- }
-
- void SetWordMaxLength(const LengthType _wordMaxLength) {
- wordMaxLength = _wordMaxLength;
- }
-
- void SetPrefixSetLength(const LengthType _prefixSetLength) {
- prefixSetLength = _prefixSetLength;
- }
-
- void SetSuffixSetLength(const LengthType _suffixSetLength) {
- suffixSetLength = _suffixSetLength;
- }
-
- // PreCalculationFilter is called after frequencies statistics.
- void SetPreCalculationFilter(
- const std::function& filter) {
- preCalculationFilter = filter;
- }
-
- void SetPostCalculationFilter(
- const std::function& filter) {
- postCalculationFilter = filter;
- }
-
- void ReleaseSuffixes() { std::vector().swap(suffixes); }
-
- void ReleasePrefixes() { std::vector().swap(prefixes); }
-
- const std::vector& Words() const { return words; }
-
- const std::vector& WordCandidates() const {
- return wordCandidates;
- }
-
- struct Signals {
- size_t frequency;
- double cohesion;
- double suffixEntropy;
- double prefixEntropy;
- };
-
- const Signals& Signal(const UTF8StringSlice8Bit& wordCandidate) const;
-
- double Cohesion(const UTF8StringSlice8Bit& wordCandidate) const;
-
- double Entropy(const UTF8StringSlice8Bit& wordCandidate) const;
-
- double SuffixEntropy(const UTF8StringSlice8Bit& wordCandidate) const;
-
- double PrefixEntropy(const UTF8StringSlice8Bit& wordCandidate) const;
-
- size_t Frequency(const UTF8StringSlice8Bit& word) const;
-
- double Probability(const UTF8StringSlice8Bit& word) const;
-
- double LogProbability(const UTF8StringSlice8Bit& word) const;
-
- void Reset();
-
- void ExtractSuffixes();
-
- void ExtractPrefixes();
-
- void ExtractWordCandidates();
-
- void CalculateFrequency();
-
- void CalculateCohesions();
-
- void CalculateSuffixEntropy();
-
- void CalculatePrefixEntropy();
-
- void SelectWords();
-
- static bool
- DefaultPreCalculationFilter(const PhraseExtract&,
- const PhraseExtract::UTF8StringSlice8Bit&);
-
- static bool
- DefaultPostCalculationFilter(const PhraseExtract&,
- const PhraseExtract::UTF8StringSlice8Bit&);
-
-private:
- class DictType;
-
- // Pointwise Mutual Information
- double PMI(const UTF8StringSlice8Bit& wordCandidate,
- const UTF8StringSlice8Bit& part1,
- const UTF8StringSlice8Bit& part2) const;
-
- double CalculateCohesion(const UTF8StringSlice8Bit& wordCandidate) const;
-
- double CalculateEntropy(
- const std::unordered_map& choices) const;
-
- LengthType wordMinLength;
- LengthType wordMaxLength;
- LengthType prefixSetLength;
- LengthType suffixSetLength;
- std::function
- preCalculationFilter;
- std::function
- postCalculationFilter;
-
- bool prefixesExtracted;
- bool suffixesExtracted;
- bool frequenciesCalculated;
- bool wordCandidatesExtracted;
- bool cohesionsCalculated;
- bool prefixEntropiesCalculated;
- bool suffixEntropiesCalculated;
- bool wordsSelected;
-
- UTF8StringSlice utf8FullText;
- size_t totalOccurrence;
- double logTotalOccurrence;
- std::vector prefixes;
- std::vector suffixes;
- std::vector wordCandidates;
- std::vector words;
- DictType* signals;
-
- friend class PhraseExtractTest;
-};
-
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segmentation.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segmentation.hpp
deleted file mode 100644
index c260ea6de995560929398df37a5c77aecde1700d..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segmentation.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-
-namespace opencc {
-/**
- * Abstract segmentation
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Segmentation {
-public:
- virtual SegmentsPtr Segment(const std::string& text) const = 0;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segments.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segments.hpp
deleted file mode 100644
index 21c39813c40dce8b641c3d505460ea139aed7be4..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/Segments.hpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-
-#include "Common.hpp"
-
-namespace opencc {
-/**
- * Segmented text
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT Segments {
-public:
- Segments() {}
-
- Segments(std::initializer_list initList) {
- for (const std::string& item : initList) {
- AddSegment(item);
- }
- }
-
- Segments(std::initializer_list initList) {
- for (const std::string& item : initList) {
- AddSegment(item);
- }
- }
-
- void AddSegment(const char* unmanagedString) {
- indexes.push_back(std::make_pair(unmanaged.size(), false));
- unmanaged.push_back(unmanagedString);
- }
-
- void AddSegment(const std::string& str) {
- indexes.push_back(std::make_pair(managed.size(), true));
- managed.push_back(str);
- }
-
- class iterator : public std::iterator {
- public:
- iterator(const Segments* const _segments, size_t _cursor)
- : segments(_segments), cursor(_cursor) {}
-
- iterator& operator++() {
- cursor++;
- return *this;
- }
-
- bool operator==(const iterator& that) const {
- return cursor == that.cursor && segments == that.segments;
- }
-
- bool operator!=(const iterator& that) const {
- return !this->operator==(that);
- }
-
- const char* operator*() const { return segments->At(cursor); }
-
- private:
- const Segments* const segments;
- size_t cursor;
- };
-
- const char* At(size_t cursor) const {
- const auto& index = indexes[cursor];
- if (index.second) {
- return managed[index.first].c_str();
- } else {
- return unmanaged[index.first];
- }
- }
-
- size_t Length() const { return indexes.size(); }
-
- iterator begin() const { return iterator(this, 0); }
-
- iterator end() const { return iterator(this, indexes.size()); }
-
- std::string ToString() const {
- // TODO implement a nested structure to reduce concatenation,
- // like a purely functional differential list
- std::ostringstream buffer;
- for (const char* segment : *this) {
- buffer << segment;
- }
- return buffer.str();
- }
-
-private:
- Segments(const Segments&) {}
-
- std::vector unmanaged;
- std::vector managed;
- // index, managed
- std::vector> indexes;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializableDict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializableDict.hpp
deleted file mode 100644
index 17cea8903d7d66c78499d267af64e76b87e4fa8a..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializableDict.hpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Dict.hpp"
-
-namespace opencc {
-/**
- * Serializable dictionary interface
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT SerializableDict {
-public:
- /**
- * Serializes the dictionary and writes in to a file.
- */
- virtual void SerializeToFile(FILE* fp) const = 0;
-
- /**
- * Serializes the dictionary and writes in to a file.
- */
- virtual void SerializeToFile(const std::string& fileName) const {
- FILE* fp = fopen(fileName.c_str(), "wb");
- if (fp == NULL) {
- throw FileNotWritable(fileName);
- }
- SerializeToFile(fp);
- fclose(fp);
- }
-
- template
- static bool TryLoadFromFile(const std::string& fileName,
- std::shared_ptr* dict) {
- FILE* fp =
-#ifdef _MSC_VER
- // well, the 'GetPlatformString' shall return a 'wstring'
- _wfopen(UTF8Util::GetPlatformString(fileName).c_str(), L"rb")
-#else
- fopen(UTF8Util::GetPlatformString(fileName).c_str(), "rb")
-#endif // _MSC_VER
- ;
-
- if (fp == NULL) {
- return false;
- }
- std::shared_ptr loadedDict = DICT::NewFromFile(fp);
- fclose(fp);
- *dict = loadedDict;
- return true;
- }
-
- template
- static std::shared_ptr NewFromFile(const std::string& fileName) {
- std::shared_ptr dict;
- if (!TryLoadFromFile(fileName, &dict)) {
- throw FileNotFound(fileName);
- }
- return dict;
- }
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializedValues.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializedValues.hpp
deleted file mode 100644
index c17210ba7b743b5b1a81ab7137157391e1118065..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SerializedValues.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2020 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "SerializableDict.hpp"
-
-namespace opencc {
-/**
- * Binary format for dictionary values serialization.
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT SerializedValues : public SerializableDict {
-public:
- SerializedValues(const LexiconPtr& _lexicon) : lexicon(_lexicon) {}
-
- virtual ~SerializedValues() {}
-
- virtual void SerializeToFile(FILE* fp) const;
-
- static std::shared_ptr NewFromFile(FILE* fp);
-
- const LexiconPtr& GetLexicon() const { return lexicon; }
-
- size_t KeyMaxLength() const;
-
-private:
- LexiconPtr lexicon;
-
- void ConstructBuffer(std::string* valueBuffer,
- std::vector* valueBytes,
- uint32_t* valueTotalLength) const;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SimpleConverter.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SimpleConverter.hpp
deleted file mode 100644
index 206edea740f0155a767653b9c8ebf4d64138b5f9..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/SimpleConverter.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Export.hpp"
-#include
-
-#ifndef __OPENCC_SIMPLECONVERTER_HPP_
-#define __OPENCC_SIMPLECONVERTER_HPP_
-
-/**
- * @defgroup opencc_simple_api OpenCC C++ Simple API
- *
- * Simple API in C++ language
- */
-
-namespace opencc {
-/**
- * A high level converter
- * This interface does not require C++11 to compile.
- * @ingroup opencc_simple_api
- */
-class OPENCC_EXPORT SimpleConverter {
-public:
- /**
- * Constructor of SimpleConverter
- * @param configFileName File name of configuration.
- */
- SimpleConverter(const std::string& configFileName);
-
- ~SimpleConverter();
-
- /**
- * Converts a text
- * @param input Text to be converted.
- */
- std::string Convert(const std::string& input) const;
-
- /**
- * Converts a text
- * @param input A C-Style std::string (terminated by '\0') to be converted.
- */
- std::string Convert(const char* input) const;
-
- /**
- * Converts a text
- * @param input A C-Style std::string limited by a given length to be
- * converted.
- * @param length Maximal length in byte of the input std::string.
- */
- std::string Convert(const char* input, size_t length) const;
-
- /**
- * Converts a text and writes to an allocated buffer
- * Please make sure the buffer has sufficent space.
- * @param input A C-Style std::string (terminated by '\0') to be converted.
- * @param output Buffer to write the converted text.
- * @return Length of converted text.
- */
- size_t Convert(const char* input, char* output) const;
-
- /**
- * Converts a text and writes to an allocated buffer
- * Please make sure the buffer has sufficent space.
- * @param input A C-Style std::string limited by a given length to be
- * converted.
- * @param length Maximal length in byte of the input std::string.
- * @param output Buffer to write the converted text.
- * @return Length of converted text.
- */
- size_t Convert(const char* input, size_t length, char* output) const;
-
-private:
- const void* internalData;
-};
-
-} // namespace opencc
-
-#endif
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/TextDict.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/TextDict.hpp
deleted file mode 100644
index f1cb67d92e81069a2e74ecb3938acfbaf1d7a21a..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/TextDict.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2020 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "Common.hpp"
-#include "SerializableDict.hpp"
-
-namespace opencc {
-/**
- * Text dictionary
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT TextDict : public Dict, public SerializableDict {
-public:
- /**
- * Constructor of TextDict.
- * _lexicon must be sorted.
- */
- TextDict(const LexiconPtr& _lexicon);
-
- virtual ~TextDict();
-
- virtual size_t KeyMaxLength() const;
-
- virtual Optional Match(const char* word, size_t len) const;
-
- virtual LexiconPtr GetLexicon() const;
-
- virtual void SerializeToFile(FILE* fp) const;
-
- /**
- * Constructs a TextDict from another dictionary.
- */
- static TextDictPtr NewFromDict(const Dict& dict);
-
- static TextDictPtr NewFromFile(FILE* fp);
-
- static TextDictPtr NewFromSortedFile(FILE* fp);
-
-private:
- const size_t maxLength;
- const LexiconPtr lexicon;
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8StringSlice.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8StringSlice.hpp
deleted file mode 100644
index 0c9dfdc6eccd1486f6146776340128b3e9eaa947..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8StringSlice.hpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2015 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include
-
-#include "Common.hpp"
-#include "UTF8Util.hpp"
-
-namespace opencc {
-
-namespace internal {
-
-inline size_t FNVHash(const char* text, const size_t byteLength,
- const size_t FNV_prime, const size_t FNV_offset_basis) {
- size_t hash = FNV_offset_basis;
- for (const char* pstr = text; pstr < text + byteLength; pstr++) {
- hash ^= *pstr;
- hash *= FNV_prime;
- }
- return hash;
-}
-
-template size_t FNVHash(const char* text, const size_t byteLength);
-
-template <>
-inline size_t FNVHash<4>(const char* text, const size_t byteLength) {
- return FNVHash(text, byteLength, 16777619UL, 2166136261UL);
-}
-
-#if SIZE_MAX == 0xffffffffffffffff
-template <>
-inline size_t FNVHash<8>(const char* text, const size_t byteLength) {
- return FNVHash(text, byteLength, 1099511628211UL, 14695981039346656037UL);
-}
-#endif
-
-} // namespace internal
-
-template class UTF8StringSliceBase {
-public:
- typedef LENGTH_TYPE LengthType;
-
- UTF8StringSliceBase(const char* _str)
- : str(_str), utf8Length(static_cast(UTF8Util::Length(_str))),
- byteLength(static_cast(strlen(_str))) {}
-
- UTF8StringSliceBase(const char* _str, const LengthType _utf8Length)
- : str(_str), utf8Length(_utf8Length) {
- CalculateByteLength();
- }
-
- UTF8StringSliceBase(const char* _str, const LengthType _utf8Length,
- const LengthType _byteLength)
- : str(_str), utf8Length(_utf8Length), byteLength(_byteLength) {
- CalculateByteLength();
- }
-
- LengthType UTF8Length() const { return utf8Length; }
-
- LengthType ByteLength() const { return byteLength; }
-
- UTF8StringSliceBase Left(const LengthType numberOfCharacters) const {
- if (numberOfCharacters == UTF8Length()) {
- return *this;
- } else {
- return UTF8StringSliceBase(str, numberOfCharacters);
- }
- }
-
- UTF8StringSliceBase Right(const LengthType numberOfCharacters) const {
- if (numberOfCharacters == UTF8Length()) {
- return *this;
- } else {
- const char* pstr = str + byteLength;
- for (size_t i = 0; i < numberOfCharacters; i++) {
- pstr = UTF8Util::PrevChar(pstr);
- }
- return UTF8StringSliceBase(pstr, numberOfCharacters);
- }
- }
-
- UTF8StringSliceBase SubString(const LengthType offset,
- const LengthType numberOfCharacters) const {
- if (offset == 0) {
- return Left(numberOfCharacters);
- } else {
- const char* pstr = str;
- for (size_t i = 0; i < offset; i++) {
- pstr = UTF8Util::NextChar(pstr);
- }
- return UTF8StringSliceBase(pstr, numberOfCharacters);
- }
- }
-
- std::string ToString() const { return std::string(str, str + byteLength); }
-
- const char* CString() const { return str; }
-
- LengthType CommonPrefixLength(const UTF8StringSliceBase& that) const {
- if (str == that.str) {
- return (std::min)(utf8Length, that.utf8Length);
- } else {
- const char* pstr1 = str;
- const char* pstr2 = that.str;
- for (size_t length = 0; length < utf8Length && length < that.utf8Length;
- length++) {
- size_t charLen1 = UTF8Util::NextCharLength(pstr1);
- size_t charLen2 = UTF8Util::NextCharLength(pstr2);
- if (charLen1 != charLen2 || strncmp(pstr1, pstr2, charLen1) != 0) {
- return length;
- }
- pstr1 += charLen1;
- pstr2 += charLen2;
- }
- return 0;
- }
- }
-
- void MoveRight() {
- if (utf8Length > 0) {
- const size_t charLen = UTF8Util::NextCharLength(str);
- str += charLen;
- utf8Length--;
- byteLength -= charLen;
- }
- }
-
- void MoveLeft() {
- if (utf8Length > 0) {
- const size_t charLen = UTF8Util::PrevCharLength(str + byteLength);
- utf8Length--;
- byteLength -= charLen;
- }
- }
-
- int ReverseCompare(const UTF8StringSliceBase& that) const {
- const char* pstr1 = str + byteLength;
- const char* pstr2 = that.str + that.byteLength;
- const size_t length = (std::min)(utf8Length, that.utf8Length);
- for (size_t i = 0; i < length; i++) {
- const size_t charLen1 = UTF8Util::PrevCharLength(pstr1);
- const size_t charLen2 = UTF8Util::PrevCharLength(pstr2);
- pstr1 -= charLen1;
- pstr2 -= charLen2;
- const int cmp = strncmp(pstr1, pstr2, (std::min)(charLen1, charLen2));
- if (cmp < 0) {
- return -1;
- } else if (cmp > 0) {
- return 1;
- } else if (charLen1 < charLen2) {
- return -1;
- } else if (charLen1 > charLen2) {
- return 1;
- }
- }
- if (utf8Length < that.utf8Length) {
- return -1;
- } else if (utf8Length > that.utf8Length) {
- return 1;
- } else {
- return 0;
- }
- }
-
- LengthType FindBytePosition(const UTF8StringSliceBase& pattern) const {
- return static_cast(
- ToString().find(pattern.str, 0, pattern.byteLength));
- }
-
- bool operator<(const UTF8StringSliceBase& that) const {
- return Compare(that) < 0;
- }
-
- bool operator>(const UTF8StringSliceBase& that) const {
- return Compare(that) > 0;
- }
-
- bool operator==(const UTF8StringSliceBase& that) const {
- return (str == that.str && utf8Length == that.utf8Length) ||
- Compare(that) == 0;
- }
-
- bool operator!=(const UTF8StringSliceBase& that) const {
- return !this->operator==(that);
- }
-
- class Hasher {
- public:
- size_t operator()(const UTF8StringSliceBase& text) const {
- return internal::FNVHash(text.CString(),
- text.ByteLength());
- }
- };
-
-private:
- inline int Compare(const UTF8StringSliceBase& that) const {
- int cmp = strncmp(str, that.str, (std::min)(byteLength, that.byteLength));
- if (cmp == 0) {
- if (utf8Length < that.utf8Length) {
- cmp = -1;
- } else if (utf8Length > that.utf8Length) {
- cmp = 1;
- } else {
- cmp = 0;
- }
- }
- return cmp;
- }
-
- void CalculateByteLength() {
- const char* pstr = str;
- for (size_t i = 0; i < utf8Length; i++) {
- pstr = UTF8Util::NextChar(pstr);
- }
- byteLength = static_cast(pstr - str);
- }
-
- const char* str;
- LengthType utf8Length;
- LengthType byteLength;
-};
-
-typedef UTF8StringSliceBase UTF8StringSlice;
-
-template
-std::ostream& operator<<(::std::ostream& os,
- const UTF8StringSliceBase& str) {
- return os << str.ToString();
-}
-
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8Util.hpp b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8Util.hpp
deleted file mode 100644
index a04a6fccfe87d4aa67c2e79646c549b09e9b4be5..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/UTF8Util.hpp
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2013 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#ifdef _MSC_VER
-#define NOMINMAX
-#include
-#undef NOMINMAX
-#endif // _MSC_VER
-
-#include
-
-#include "Common.hpp"
-#include "Exception.hpp"
-
-namespace opencc {
-/**
- * UTF8 std::string utilities
- * @ingroup opencc_cpp_api
- */
-class OPENCC_EXPORT UTF8Util {
-public:
- /**
- * Detect UTF8 BOM and skip it.
- */
- static void SkipUtf8Bom(FILE* fp);
-
- /**
- * Returns the length in byte for the next UTF8 character.
- * On error returns 0.
- */
- static size_t NextCharLengthNoException(const char* str) {
- char ch = *str;
- if ((ch & 0xF0) == 0xE0) {
- return 3;
- } else if ((ch & 0x80) == 0x00) {
- return 1;
- } else if ((ch & 0xE0) == 0xC0) {
- return 2;
- } else if ((ch & 0xF8) == 0xF0) {
- return 4;
- } else if ((ch & 0xFC) == 0xF8) {
- return 5;
- } else if ((ch & 0xFE) == 0xFC) {
- return 6;
- }
- return 0;
- }
-
- /**
- * Returns the length in byte for the next UTF8 character.
- */
- static size_t NextCharLength(const char* str) {
- size_t length = NextCharLengthNoException(str);
- if (length == 0) {
- throw InvalidUTF8(str);
- }
- return length;
- }
-
- /**
- * Returns the length in byte for the previous UTF8 character.
- */
- static size_t PrevCharLength(const char* str) {
- {
- const size_t length = NextCharLengthNoException(str - 3);
- if (length == 3) {
- return length;
- }
- }
- {
- const size_t length = NextCharLengthNoException(str - 1);
- if (length == 1) {
- return length;
- }
- }
- {
- const size_t length = NextCharLengthNoException(str - 2);
- if (length == 2) {
- return length;
- }
- }
- for (size_t i = 4; i <= 6; i++) {
- const size_t length = NextCharLengthNoException(str - i);
- if (length == i) {
- return length;
- }
- }
- throw InvalidUTF8(str);
- }
-
- /**
- * Returns the char* pointer over the next UTF8 character.
- */
- static const char* NextChar(const char* str) {
- return str + NextCharLength(str);
- }
-
- /**
- * Move the char* pointer before the previous UTF8 character.
- */
- static const char* PrevChar(const char* str) {
- return str - PrevCharLength(str);
- }
-
- /**
- * Returns the UTF8 length of a valid UTF8 std::string.
- */
- static size_t Length(const char* str) {
- size_t length = 0;
- while (*str != '\0') {
- str = NextChar(str);
- length++;
- }
- return length;
- }
-
- /**
- * Finds a character in the same line.
- * @param str The text to be searched in.
- * @param ch The character to find.
- * @return The pointer that points to the found chacter in str or EOL/EOF.
- */
- static const char* FindNextInline(const char* str, const char ch) {
- while (!IsLineEndingOrFileEnding(*str) && *str != ch) {
- str = NextChar(str);
- }
- return str;
- }
-
- /**
- * Returns ture if the character is a line ending or end of file.
- */
- static bool IsLineEndingOrFileEnding(const char ch) {
- return ch == '\0' || ch == '\n' || ch == '\r';
- }
-
- /**
- * Copies a substring with given length to a new string.
- */
- static std::string FromSubstr(const char* str, size_t length) {
- std::string newStr;
- newStr.resize(length);
- strncpy(const_cast(newStr.c_str()), str, length);
- return newStr;
- }
-
- /**
- * Returns true if the given std::string is longer or as long as the given
- * length.
- */
- static bool NotShorterThan(const char* str, size_t byteLength) {
- while (byteLength > 0) {
- if (*str == '\0') {
- return false;
- }
- byteLength--;
- str++;
- }
- return true;
- }
-
- /**
- * Truncates a std::string with a maximal length in byte.
- * No UTF8 character will be broken.
- */
- static std::string TruncateUTF8(const char* str, size_t maxByteLength) {
- std::string wordTrunc;
- if (NotShorterThan(str, maxByteLength)) {
- size_t len = 0;
- const char* pStr = str;
- for (;;) {
- const size_t charLength = NextCharLength(pStr);
- if (len + charLength > maxByteLength) {
- break;
- }
- pStr += charLength;
- len += charLength;
- }
- wordTrunc = FromSubstr(str, len);
- } else {
- wordTrunc = str;
- }
- return wordTrunc;
- }
-
- /**
- * Replaces all patterns in a std::string in place.
- */
- static void ReplaceAll(std::string& str, const char* from, const char* to) {
- std::string::size_type pos = 0;
- std::string::size_type fromLen = strlen(from);
- std::string::size_type toLen = strlen(to);
- while ((pos = str.find(from, pos)) != std::string::npos) {
- str.replace(pos, fromLen, to);
- pos += toLen;
- }
- }
-
- /**
- * Joins a std::string vector in to a std::string with a separator.
- */
- static std::string Join(const std::vector& strings,
- const std::string& separator) {
- std::ostringstream buffer;
- bool first = true;
- for (const auto& str : strings) {
- if (!first) {
- buffer << separator;
- }
- buffer << str;
- first = false;
- }
- return buffer.str();
- }
-
- /**
- * Joins a std::string vector in to a std::string.
- */
- static std::string Join(const std::vector& strings) {
- std::ostringstream buffer;
- for (const auto& str : strings) {
- buffer << str;
- }
- return buffer.str();
- }
-
- static void GetByteMap(const char* str, const size_t utf8Length,
- std::vector* byteMap) {
- if (byteMap->size() < utf8Length) {
- byteMap->resize(utf8Length);
- }
- const char* pstr = str;
- for (size_t i = 0; i < utf8Length; i++) {
- (*byteMap)[i] = pstr - str;
- pstr = NextChar(pstr);
- }
- }
-
-#ifdef _MSC_VER
- static std::wstring GetPlatformString(const std::string& str) {
- return U8ToU16(str);
- }
-#else
- static std::string GetPlatformString(const std::string& str) { return str; }
-#endif // _MSC_VER
-
-#ifdef _MSC_VER
- static std::string U16ToU8(const std::wstring& wstr) {
- std::string ret;
- int length = static_cast(wstr.length());
- int convcnt = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), length, NULL, 0,
- NULL, NULL);
- if (convcnt > 0) {
- ret.resize(convcnt);
- WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), length, &ret[0], convcnt,
- NULL, NULL);
- }
- return ret;
- }
-
- static std::wstring U8ToU16(const std::string& str) {
- std::wstring ret;
- int length = static_cast(str.length());
- int convcnt = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), length, NULL, 0);
- if (convcnt > 0) {
- ret.resize(convcnt);
- MultiByteToWideChar(CP_UTF8, 0, str.c_str(), length, &ret[0], convcnt);
- }
- return ret;
- }
-#endif // _MSC_VER
-};
-} // namespace opencc
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc.h b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc.h
deleted file mode 100644
index bc3a9e97b509936585ee8a8e960a80459e7ce299..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2010-2014 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __OPENCC_H_
-#define __OPENCC_H_
-
-#ifdef __cplusplus
-
-#include "Export.hpp"
-#include "SimpleConverter.hpp"
-#include
-
-extern "C" {
-#else
-#include
-#endif
-
-#ifndef OPENCC_EXPORT
-#define OPENCC_EXPORT
-#endif
-
-/**
- * @defgroup opencc_c_api OpenCC C API
- *
- * API in C language
- */
-
-/**
- * Filename of default Simplified to Traditional configuration
- *
- * @ingroup opencc_c_api
- */
-#define OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD "s2t.json"
-
-/**
- * Filename of default Traditional to Simplified configuration
- *
- * @ingroup opencc_c_api
- */
-#define OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP "t2s.json"
-
-/**
- * Type of opencc descriptor
- *
- * @ingroup opencc_c_api
- */
-typedef void* opencc_t;
-
-/**
- * Makes an instance of opencc
- *
- * @param configFileName Location of configuration file. If this is set to NULL,
- * OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD will be loaded.
- * @return A description pointer of the newly allocated instance of
- * opencc. On error the return value will be (opencc_t) -1.
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT opencc_t opencc_open(const char* configFileName);
-#ifdef _MSC_VER
-/**
- * Makes an instance of opencc (wide char / Unicode)
- *
- * @param configFileName Location of configuration file. If this is set to NULL,
- * OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD will be loaded.
- * @return A description pointer of the newly allocated instance of
- * opencc. On error the return value will be (opencc_t) -1.
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT opencc_t opencc_open_w(const wchar_t* configFileName);
-#endif /* _MSC_VER */
-
-/**
- * Destroys an instance of opencc
- *
- * @param opencc The description pointer.
- * @return 0 on success or non-zero number on failure.
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT int opencc_close(opencc_t opencc);
-
-/**
- * Converts UTF-8 std::string
- *
- * @param opencc The opencc description pointer.
- * @param input The UTF-8 encoded std::string.
- * @param length The maximum length in byte to convert. If length is (size_t)-1,
- * the whole std::string (terminated by '\0') will be converted.
- * @param output The buffer to store converted text. You MUST make sure this
- * buffer has sufficient space.
- *
- * @return The length of converted std::string or (size_t)-1 on error.
- *
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT size_t opencc_convert_utf8_to_buffer(opencc_t opencc,
- const char* input,
- size_t length, char* output);
-
-/**
- * Converts UTF-8 std::string
- * This function returns an allocated C-Style std::string, which stores
- * the converted std::string.
- * You MUST call opencc_convert_utf8_free() to release allocated memory.
- *
- * @param opencc The opencc description pointer.
- * @param input The UTF-8 encoded std::string.
- * @param length The maximum length in byte to convert. If length is (size_t)-1,
- * the whole std::string (terminated by '\0') will be converted.
- *
- * @return The newly allocated UTF-8 std::string that stores text
- * converted, or NULL on error.
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT char* opencc_convert_utf8(opencc_t opencc, const char* input,
- size_t length);
-
-/**
- * Releases allocated buffer by opencc_convert_utf8
- *
- * @param str Pointer to the allocated std::string buffer by
- * opencc_convert_utf8.
- *
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT void opencc_convert_utf8_free(char* str);
-
-/**
- * Returns the last error message
- *
- * Note that this function is the only one which is NOT thread-safe.
- *
- * @ingroup opencc_c_api
- */
-OPENCC_EXPORT const char* opencc_error(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-/**
- * @defgroup opencc_cpp_api OpenCC C++ Comprehensive API
- *
- * Comprehensive API in C++ language
- */
-
-#endif
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc_config.h b/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc_config.h
deleted file mode 100644
index 711f432c6bcde5a24c7952ae1ff8da3b58835921..0000000000000000000000000000000000000000
--- a/XEngine_Source/XEngine_ThirdPart/opencc/include/opencc/opencc_config.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Open Chinese Convert
- *
- * Copyright 2021 Carbo Kuo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#define OPENCC_ENABLE_DARTS
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/libx64/opencc.lib b/XEngine_Source/XEngine_ThirdPart/opencc/libx64/opencc.lib
deleted file mode 100644
index d064b88e7767be30d0923e66266f6207bc3d1393..0000000000000000000000000000000000000000
Binary files a/XEngine_Source/XEngine_ThirdPart/opencc/libx64/opencc.lib and /dev/null differ
diff --git a/XEngine_Source/XEngine_ThirdPart/opencc/libx86/opencc.lib b/XEngine_Source/XEngine_ThirdPart/opencc/libx86/opencc.lib
deleted file mode 100644
index 5241fd9072e3444cf224f6f44dfeb484baf91b0d..0000000000000000000000000000000000000000
Binary files a/XEngine_Source/XEngine_ThirdPart/opencc/libx86/opencc.lib and /dev/null differ