Skip to content

Commit 0952cd8

Browse files
authored
Merge pull request #8 from libxengine/develop
V2.6.0.1001 Merge
2 parents 5526749 + 059e568 commit 0952cd8

File tree

100 files changed

+1137
-2752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1137
-2752
lines changed

CHANGELOG

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
XEngine_APIService V2.6.0.1001
2+
3+
添加:lua插件支持
4+
添加:加载器的lua插件支持
5+
修改:插件模块输出目录
6+
修改:lib代码插件名称修改
7+
修改:opencc库修改为vcpkg安装了
8+
修改:PluginCore_UnInit的返回值为void
9+
修改:输出插件统计
10+
修复:不需要的插件加载器错误
11+
修复:执行插件失败没有提示的问题
12+
删除:选项配置plugin字段
13+
14+
added:lua plugin support
15+
added:lua plugin core and lug loader supported
16+
modify:plugin module print dir
17+
modify:lib code name changed
18+
modify:opencc library changed vcpkg to install
19+
modify:PluginCore_UnInit bool to void for plugin
20+
modify:printf plugin count
21+
fixed:does not need errorcode for plugin loader
22+
fixed:plugin failed to execution without tips.
23+
delete:plugin of option configure
24+
======================================================================================
125
XEngine_APIService V2.5.0.1001
226

327
添加:zipcode查询功能

README.en.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This service mainly uses HTTP/V1.1 to implement various interface services
1111
This is a general information query service that does not contain any language attributes
1212
You can use this code to implement your own information query service, which supports querying any information
1313
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
14-
and support plugin module
14+
and support plugin system,dll(so,dylib)module or lua script
1515

1616
#### Why choose us
1717

@@ -42,6 +42,7 @@ Support privatization deployment, free, safe, open source, controllable
4242
22. Distributed lock
4343
23. short url creator
4444
24. local system time
45+
25. math Calculation
4546

4647
## install
4748

@@ -57,6 +58,7 @@ Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
5758
Macos Exection:./XEngine_LINEnv.sh -i 3
5859

5960
#### Windows
61+
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
6062
use vs open and compile,suport windows 7sp1 and above
6163
Just Run it
6264

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ c c++ interface api service
1111
这是一个不包含任何语言属性的通用信息查询服务.
1212
你可以使用此代码实现自己的信息查询服务,支持查询任何信息
1313
基于libXEngine开发并实现的一套简洁高性能跨平台接口服务
14-
并且支持模块插件
14+
并且支持插件系统,dll(so,dylib)模块或者lua脚本
1515

1616
#### 为什么选择我们
1717
支持私有化部署,免费,安全.开源,可控
@@ -42,6 +42,7 @@ c c++ interface api service
4242
22. 分布式锁API
4343
23. 短连接生成
4444
24. 本地标准时间
45+
25. 数学计算
4546

4647
## 安装教程
4748

@@ -57,17 +58,18 @@ Linux执行:sudo ./XEngine_LINEnv.sh -i 3
5758
macos执行:./XEngine_LINEnv.sh -i 3
5859

5960
#### Windows
61+
需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua lua:x64-windows opencc opencc:x64-windows
6062
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
6163
直接运行即可
6264

6365
#### Linux
64-
安装opencc,ubuntu:sudo apt install libopencc-dev
66+
安装opencc,ubuntu:sudo apt install liblua5.3-dev libopencc-dev
6567
centos:需要自己编译
6668
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
6769
在控制台运行
6870

6971
#### Macos
70-
安装opencc,执行命令:brew install opencc
72+
安装opencc,执行命令:brew install lua opencc
7173
使用makefile编译,控制台运行,需要mac 12以及以上版本
7274
在控制台运行
7375

XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.cpp renamed to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
//需要优先配置XEngine
2020
//WINDOWS支持VS2022 x64 debug 编译调试
21-
//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
22-
//macos::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
21+
//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
22+
//macos::g++ -std=c++17 -Wall -g APPClient_LibPluginExample.cpp -o APPClient_LibPluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
2323

2424
int main()
2525
{

XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj renamed to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<PropertyGroup Label="Globals">
2222
<VCProjectVersion>16.0</VCProjectVersion>
2323
<Keyword>Win32Proj</Keyword>
24-
<ProjectGuid>{81b29f95-d383-437f-ad34-11e1f3b6eae5}</ProjectGuid>
25-
<RootNamespace>APPClientPluginExample</RootNamespace>
24+
<ProjectGuid>{0464ea5f-1e86-40bf-b692-394cf9f5cc67}</ProjectGuid>
25+
<RootNamespace>APPClientLibPluginExample</RootNamespace>
2626
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -131,7 +131,7 @@
131131
</Link>
132132
</ItemDefinitionGroup>
133133
<ItemGroup>
134-
<ClCompile Include="APPClient_PluginExample.cpp" />
134+
<ClCompile Include="APPClient_LibPluginExample.cpp" />
135135
</ItemGroup>
136136
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
137137
<ImportGroup Label="ExtensionTargets">

XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.filters renamed to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</Filter>
1616
</ItemGroup>
1717
<ItemGroup>
18-
<ClCompile Include="APPClient_PluginExample.cpp">
18+
<ClCompile Include="APPClient_LibPluginExample.cpp">
1919
<Filter>源文件</Filter>
2020
</ClCompile>
2121
</ItemGroup>

XEngine_APPClient/APPClient_PluginExample/APPClient_PluginExample.vcxproj.user renamed to XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.vcxproj.user

File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#ifdef _MSC_BUILD
2+
#include <Windows.h>
3+
#include <tchar.h>
4+
#pragma comment(lib,"Ws2_32")
5+
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
6+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
7+
#endif
8+
#include <stdio.h>
9+
#include <stdlib.h>
10+
#include <string.h>
11+
#include <inttypes.h>
12+
#include <XEngine_Include/XEngine_CommHdr.h>
13+
#include <XEngine_Include/XEngine_ProtocolHdr.h>
14+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
15+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16+
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
17+
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
18+
19+
//需要优先配置XEngine
20+
//WINDOWS支持VS2022 x64 debug 编译调试
21+
//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
22+
//macos::g++ -std=c++17 -Wall -g APPClient_LuaPluginExample.cpp -o APPClient_LuaPluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
23+
24+
int main()
25+
{
26+
#ifdef _MSC_BUILD
27+
WSADATA st_WSAData;
28+
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
29+
#endif
30+
int nLen = 0;
31+
TCHAR* ptszMsgBuffer = NULL;
32+
LPCTSTR lpszPassUrl = _T("http://127.0.0.1:5501/api?function=cal&params1=1&params2=2&type=0");
33+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszPassUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
34+
{
35+
printf("发送投递失败!\n");
36+
return 0;
37+
}
38+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
39+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
40+
41+
getchar();
42+
#ifdef _MSC_BUILD
43+
WSACleanup();
44+
#endif
45+
return 0;
46+
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{4309bf33-c0d7-40c5-ae52-637bfcd5eca8}</ProjectGuid>
25+
<RootNamespace>APPClientLuaPluginExample</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>MultiByte</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
74+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
76+
</PropertyGroup>
77+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78+
<ClCompile>
79+
<WarningLevel>Level3</WarningLevel>
80+
<SDLCheck>true</SDLCheck>
81+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
82+
<ConformanceMode>true</ConformanceMode>
83+
</ClCompile>
84+
<Link>
85+
<SubSystem>Console</SubSystem>
86+
<GenerateDebugInformation>true</GenerateDebugInformation>
87+
</Link>
88+
</ItemDefinitionGroup>
89+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
90+
<ClCompile>
91+
<WarningLevel>Level3</WarningLevel>
92+
<FunctionLevelLinking>true</FunctionLevelLinking>
93+
<IntrinsicFunctions>true</IntrinsicFunctions>
94+
<SDLCheck>true</SDLCheck>
95+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
<ConformanceMode>true</ConformanceMode>
97+
</ClCompile>
98+
<Link>
99+
<SubSystem>Console</SubSystem>
100+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
101+
<OptimizeReferences>true</OptimizeReferences>
102+
<GenerateDebugInformation>true</GenerateDebugInformation>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106+
<ClCompile>
107+
<WarningLevel>Level3</WarningLevel>
108+
<SDLCheck>true</SDLCheck>
109+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<ConformanceMode>true</ConformanceMode>
111+
</ClCompile>
112+
<Link>
113+
<SubSystem>Console</SubSystem>
114+
<GenerateDebugInformation>true</GenerateDebugInformation>
115+
</Link>
116+
</ItemDefinitionGroup>
117+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
118+
<ClCompile>
119+
<WarningLevel>Level3</WarningLevel>
120+
<FunctionLevelLinking>true</FunctionLevelLinking>
121+
<IntrinsicFunctions>true</IntrinsicFunctions>
122+
<SDLCheck>true</SDLCheck>
123+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124+
<ConformanceMode>true</ConformanceMode>
125+
</ClCompile>
126+
<Link>
127+
<SubSystem>Console</SubSystem>
128+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
129+
<OptimizeReferences>true</OptimizeReferences>
130+
<GenerateDebugInformation>true</GenerateDebugInformation>
131+
</Link>
132+
</ItemDefinitionGroup>
133+
<ItemGroup>
134+
<ClCompile Include="APPClient_LuaPluginExample.cpp" />
135+
</ItemGroup>
136+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
137+
<ImportGroup Label="ExtensionTargets">
138+
</ImportGroup>
139+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="APPClient_LuaPluginExample.cpp">
19+
<Filter>源文件</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>

0 commit comments

Comments
 (0)