diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000000000000000000000000000000000..dd84ea7824f11be1eeda22377549cbc1aec7f980 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000000000000000000000000000000000..bbcbbe7d61558adde3cbfd0c7a63a67c27ed6d30 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..1cc19745580726e61fcd1fbffbc1582904a552e0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "XEngine_Source/XEngine_Depend"] + path = XEngine_Source/XEngine_Depend + url = https://github.com/libxengine/XEngine_OPenSource.git diff --git a/CHANGELOG b/CHANGELOG index 150530292e354592dd6baf025524f824f6c1b6af..98ed8306a914beb4cb0c37d577fee8680937a93e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,17 @@ +XEngine_ProxyServer V1.8.0.1001 + +增加:信息报告支持 +修改:使用git的submodule替换了jsoncpp模块 +修改:分离了版本列表配置从主配置中 +修改:信号量现在有日志提示了 +修正:日志配置没有效果的问题 + +added:info report supported +modify:jsoncpp use sub module instead +modify:detach version list from main configure file +modify:single have log tips +fixed:log configure is not work +====================================================================================== XEngine_ProxyServer V1.7.1.1001 更新:匹配XEngine V8.25 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..751bf62d5216f1c5509e4a0e48a8436b8b480f14 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +486179@qq.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/README.en.md b/README.en.md index e03c67555a8fa82ed4f9e0d1dd47f546b6802cf1..df732360914687e7304a8f614a88685b724630cd 100644 --- a/README.en.md +++ b/README.en.md @@ -34,6 +34,11 @@ window Exection XEngine_WINEnv.bat Linux Exection:sudo ./XEngine_LINEnv.sh -i 3 Macos Exection:./XEngine_LINEnv.sh -i 3 +#### sub module +Due to the dependent sub-modules, after you checkout the warehouse, execute the following command in the warehouse directory to pull the sub-modules +git submodule init +git submodule update + #### Windows use vs open and compile,suport windows 7sp1 and above Just Run it,use XEngine_AuthorizeApp diff --git a/README.md b/README.md index 7f2fa583ccd9b16dd464eda1cb68b284ac6cbb7a..f5d7833a3cdd81557d51eb29e7dc7e6019e8e216 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ window执行XEngine_WINEnv.bat 脚本. Linux执行:sudo ./XEngine_LINEnv.sh -i 3 macos执行:./XEngine_LINEnv.sh -i 3 +#### sub module +由于依赖的子模块,在你checkout仓库后,在仓库目录下执行下面的命令拉取子模块 +git submodule init +git submodule update + #### Windows 使用VS打开并且编译,支持WINDOWS 7SP1以上系统 直接运行即可,使用XEngine_AuthorizeApp diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..9e4e456f4a96a1e91da9fab3b28f1617216bcfcc --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,12 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| >= 1.x | :white_check_mark: | +| <= 0.x | :x: | + +## Reporting a Vulnerability + +www.xyry.org or 486179@qq.com \ No newline at end of file diff --git a/XEngine_Docment/Docment_en.docx b/XEngine_Docment/Docment_en.docx index 85e57bc1a3c1a8c23ecaa396748d3247bb9e4c34..be69862b05b8922a85d98c673a3687e6e3e42c85 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 c4d043b22376c8dc34dd5b0bbf3d38f3f0ad69d6..06614d7f7afe5099396659f295d57201fa1ec119 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 648ea593770788e2dceb1f3ff2269b975900b3ce..3ddf3719dd9d68c7d0e3c5e2b502d8d9d03b7d1e 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -22,17 +22,9 @@ "LogLeave": 32, "tszLogFile": "./XEngine_Log/XEngine_ProxyServiceApp.log" }, - "XVer": [ - "1.7.1.1001 Build20240305", - "1.7.0.1001 Build20240104", - "1.6.0.1001 Build20230817", - "1.5.1.1001 Build20230426", - "1.5.0.1001 Build20230202", - "1.4.0.1001 Build20221111", - "1.3.1.1001 Build20220804", - "1.3.0.1001 Build20220617", - "1.2.0.1001 Build20220413", - "1.1.0.1001 Build20211231", - "1.0.0.1001 Build20211211" - ] + "XReport":{ + "bEnable":true, + "tszAPIUrl":"http://app.xyry.org:5501/api?function=machine", + "tszServiceName":"XEngine_ProxyServer" + } } \ No newline at end of file diff --git a/XEngine_Release/XEngine_Config/XEngine_Version.json b/XEngine_Release/XEngine_Config/XEngine_Version.json new file mode 100644 index 0000000000000000000000000000000000000000..e3df56639401ac6336b268d882121f334f353d82 --- /dev/null +++ b/XEngine_Release/XEngine_Config/XEngine_Version.json @@ -0,0 +1,16 @@ +{ + "XVer": [ + "1.8.0.1001 Build20240522", + "1.7.1.1001 Build20240305", + "1.7.0.1001 Build20240104", + "1.6.0.1001 Build20230817", + "1.5.1.1001 Build20230426", + "1.5.0.1001 Build20230202", + "1.4.0.1001 Build20221111", + "1.3.1.1001 Build20220804", + "1.3.0.1001 Build20220617", + "1.2.0.1001 Build20220413", + "1.1.0.1001 Build20211231", + "1.0.0.1001 Build20211211" + ] +} \ No newline at end of file diff --git a/XEngine_Source/Makefile b/XEngine_Source/Makefile index 83bf2d9597b61d1a34a5a2ca940c98cc8ffe9780..8628ff355f1411760b5acea7a22adbcb41994e7d 100644 --- a/XEngine_Source/Makefile +++ b/XEngine_Source/Makefile @@ -3,20 +3,26 @@ UNICODE = 0 PLATFORM=linux FLAGS= #要编译的模块 -THIRDPART_MODULE_JSONCPP = ./XEngine_ThirdPart/jsoncpp +THIRDPART_MODULE_JSONCPP = ./XEngine_Depend/XEngine_Module/jsoncpp +THIRDPART_MODULE_REPORT = ./XEngine_Depend/XEngine_Module/XEngine_InfoReport + MODULE_CONFIGURE_PATH = ./XEngine_ModuleConfigure MODULE_PROTOCOL_PATH = ./XEngine_ModuleProtocol MODULE_SESSION_PATH = ./XEngine_ModuleSession APP_SERVICE_PATH = ./XEngine_ServiceApp -XENGINE_MODULES = libjsoncpp.so libXEngine_ModuleConfigure.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so XEngine_ServiceApp.exe +XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \ + libXEngine_ModuleConfigure.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so \ + XEngine_ServiceApp.exe .PHONY:MakeAll MakeAll:$(XENGINE_MODULES) libjsoncpp.so: make -C $(THIRDPART_MODULE_JSONCPP) PLATFORM=$(PLATFORM) $(FLAGS) - +libXEngine_InfoReport.so: + make -C $(THIRDPART_MODULE_REPORT) PLATFORM=$(PLATFORM) $(FLAGS) + libXEngine_ModuleConfigure.so: make -C $(MODULE_CONFIGURE_PATH) PLATFORM=$(PLATFORM) $(FLAGS) libXEngine_ModuleProtocol.so: diff --git a/XEngine_Source/VSCopy-Debug.bat b/XEngine_Source/VSCopy-Debug.bat index 29335b80eba86f45a82d12e3032047f2cbcaa5f7..83372517cc2516a5a2f93cdd216eb593aa4c37dd 100644 --- a/XEngine_Source/VSCopy-Debug.bat +++ b/XEngine_Source/VSCopy-Debug.bat @@ -5,6 +5,7 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Socket.dll" "./ +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./ copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/VSCopy-x64.bat b/XEngine_Source/VSCopy-x64.bat index e7a7c1b3f65535fa3529086731667ba2b6c1766e..9a9054683a479b08d5944f826a62dbd3ce230f1c 100644 --- a/XEngine_Source/VSCopy-x64.bat +++ b/XEngine_Source/VSCopy-x64.bat @@ -5,6 +5,7 @@ copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/VSCopy-x86.bat b/XEngine_Source/VSCopy-x86.bat index 1a32c99768d3a1ac59c55b60f7587346d6095fc4..122dbee040d9cc7d90f5ad858063d0d1248448ad 100644 --- a/XEngine_Source/VSCopy-x86.bat +++ b/XEngine_Source/VSCopy-x86.bat @@ -5,6 +5,7 @@ copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/XEngine.sln b/XEngine_Source/XEngine.sln index bbf18d247c95bebdd5f0cf77c13b0cd2005fde00..ab863a97bcf8a381c8d23bcbb8c3e32d2d919cb1 100644 --- a/XEngine_Source/XEngine.sln +++ b/XEngine_Source/XEngine.sln @@ -4,21 +4,39 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.1.32328.378 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ServiceApp", "XEngine_ServiceApp\XEngine_ServiceApp.vcxproj", "{B94018F9-541B-4BE4-A2A8-AD49DD35357B}" + ProjectSection(ProjectDependencies) = postProject + {237AF017-9AD2-44D8-A6C4-ECDEF7674FF2} = {237AF017-9AD2-44D8-A6C4-ECDEF7674FF2} + {9512A610-7197-4522-9AEF-1486619C99FE} = {9512A610-7197-4522-9AEF-1486619C99FE} + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + {F54F152C-594F-4465-A44E-2DB915B39760} = {F54F152C-594F-4465-A44E-2DB915B39760} + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89} = {F6520D2C-BB8E-45BB-964B-F5D6A4318A89} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ModuleConfigure", "XEngine_ModuleConfigure\XEngine_ModuleConfigure.vcxproj", "{F54F152C-594F-4465-A44E-2DB915B39760}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_UserHdr", "XEngine_UserHdr", "{9E4F2158-9AC1-4C19-A3F7-375A9DBCF856}" ProjectSection(SolutionItems) = preProject XEngine_UserProtocol.h = XEngine_UserProtocol.h EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_ThirdPart", "XEngine_ThirdPart", "{F18FFEA0-27D2-4590-9190-F69F5E3D21D2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsoncpp", "XEngine_ThirdPart\jsoncpp\jsoncpp.vcxproj", "{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ModuleSession", "XEngine_ModuleSession\XEngine_ModuleSession.vcxproj", "{237AF017-9AD2-44D8-A6C4-ECDEF7674FF2}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ModuleProtocol", "XEngine_ModuleProtocol\XEngine_ModuleProtocol.vcxproj", "{9512A610-7197-4522-9AEF-1486619C99FE}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XEngine_Depend", "XEngine_Depend", "{91EFAD20-FF05-4CA9-9472-7CEE32340749}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsoncpp", "XEngine_Depend\XEngine_Module\jsoncpp\jsoncpp.vcxproj", "{F1736B3F-03A2-4FC7-B045-A12BA8D724FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_InfoReport", "XEngine_Depend\XEngine_Module\XEngine_InfoReport\XEngine_InfoReport.vcxproj", "{F6520D2C-BB8E-45BB-964B-F5D6A4318A89}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -44,14 +62,6 @@ Global {F54F152C-594F-4465-A44E-2DB915B39760}.Release|x64.Build.0 = Release|x64 {F54F152C-594F-4465-A44E-2DB915B39760}.Release|x86.ActiveCfg = Release|Win32 {F54F152C-594F-4465-A44E-2DB915B39760}.Release|x86.Build.0 = Release|Win32 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.ActiveCfg = Debug|x64 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.Build.0 = Debug|x64 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.ActiveCfg = Debug|Win32 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.Build.0 = Debug|Win32 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.ActiveCfg = Release|x64 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.Build.0 = Release|x64 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.ActiveCfg = Release|Win32 - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.Build.0 = Release|Win32 {237AF017-9AD2-44D8-A6C4-ECDEF7674FF2}.Debug|x64.ActiveCfg = Debug|x64 {237AF017-9AD2-44D8-A6C4-ECDEF7674FF2}.Debug|x64.Build.0 = Debug|x64 {237AF017-9AD2-44D8-A6C4-ECDEF7674FF2}.Debug|x86.ActiveCfg = Debug|Win32 @@ -68,12 +78,29 @@ Global {9512A610-7197-4522-9AEF-1486619C99FE}.Release|x64.Build.0 = Release|x64 {9512A610-7197-4522-9AEF-1486619C99FE}.Release|x86.ActiveCfg = Release|Win32 {9512A610-7197-4522-9AEF-1486619C99FE}.Release|x86.Build.0 = Release|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.ActiveCfg = Debug|x64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.Build.0 = Debug|x64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.ActiveCfg = Debug|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.Build.0 = Debug|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.ActiveCfg = Release|x64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.Build.0 = Release|x64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.ActiveCfg = Release|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.Build.0 = Release|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x64.ActiveCfg = Debug|x64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x64.Build.0 = Debug|x64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x86.ActiveCfg = Debug|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x86.Build.0 = Debug|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x64.ActiveCfg = Release|x64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x64.Build.0 = Release|x64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x86.ActiveCfg = Release|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F18FFEA0-27D2-4590-9190-F69F5E3D21D2} + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {91EFAD20-FF05-4CA9-9472-7CEE32340749} + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89} = {91EFAD20-FF05-4CA9-9472-7CEE32340749} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9B202F91-A601-429E-BB0F-880DDEE096FE} diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend new file mode 160000 index 0000000000000000000000000000000000000000..1af95ee3737450c0b2739f0b4cc37a3f2c9eef10 --- /dev/null +++ b/XEngine_Source/XEngine_Depend @@ -0,0 +1 @@ +Subproject commit 1af95ee3737450c0b2739f0b4cc37a3f2c9eef10 diff --git a/XEngine_Source/XEngine_ModuleConfigure/Makefile b/XEngine_Source/XEngine_ModuleConfigure/Makefile index ac17d52e38313051909746d44053104f19c3623c..eebcbfd01cc58c260a0f2b23a94f03558a4835a9 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/Makefile +++ b/XEngine_Source/XEngine_ModuleConfigure/Makefile @@ -6,8 +6,8 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I ../XEngine_ThirdPart/jsoncpp -LOADSO = -L ../XEngine_ThirdPart/jsoncpp +LOADHDR = -I ./ -I ../XEngine_Depend/XEngine_Module/jsoncpp +LOADSO = -L ../XEngine_Depend/XEngine_Module/jsoncpp LIB = -ljsoncpp LIBEX = OBJECTS = ModuleConfigure_Json.o pch.o diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h index 35c3014ae20ce5bc271322ddc0abdf33c61e845d..dd7e5d012a0f54651bbde37b5a66662e5951c9e7 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h @@ -41,6 +41,12 @@ typedef struct tag_XEngine_ServiceConfig int nMaxCount; //最大日志个数 int nLogLeave; //日志等级 }st_XLog; + struct + { + bool bEnable; + XCHAR tszAPIUrl[MAX_PATH]; + XCHAR tszServiceName[128]; + }st_XReport; struct { list* pStl_ListVer; @@ -71,4 +77,23 @@ extern "C" XLONG ModuleConfigure_GetLastError(int* pInt_ErrorCode = NULL); 意思:是否成功 备注: *********************************************************************/ -extern "C" bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); \ No newline at end of file +extern "C" bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); +/******************************************************************** +函数名称:ModuleConfigure_Json_Version +函数功能:读取版本配置文件 + 参数.一:lpszConfigFile + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要读取的配置文件 + 参数.二:pSt_ServerConfig + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出配置信息 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool ModuleConfigure_Json_Version(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h index cfaecdccc58e5f4a459ce50110e1e66a7ab67493..92150464cad004dfef378f3344a22a1787861db5 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h @@ -16,4 +16,5 @@ #define ERROR_MODULE_CONFIGURE_JSON_XMAX 0xA0004 //读取XMAX配置失败 #define ERROR_MODULE_CONFIGURE_JSON_XTIME 0xA0005 //读取XTIME配置失败 #define ERROR_MODULE_CONFIGURE_JSON_XLOG 0xA0006 //读取XLOG配置失败 -#define ERROR_MODULE_CONFIGURE_JSON_XVER 0xA0008 //没有版本配置 \ No newline at end of file +#define ERROR_MODULE_CONFIGURE_JSON_XVER 0xA0008 //没有版本配置 +#define ERROR_MODULE_CONFIGURE_JSON_XREPORT 0xA0009 //没有报告配置 \ 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 ca3e4df733d67c01278ebb44ac275b2f0f32527e..76d4f6b0954d2b5e67d3337ea0fe1ee180730dc1 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp @@ -123,6 +123,80 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt(); _tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString()); + if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size())) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XREPORT; + return false; + } + Json::Value st_JsonXReport = st_JsonRoot["XReport"]; + + pSt_ServerConfig->st_XReport.bEnable = st_JsonXReport["bEnable"].asBool(); + _tcsxcpy(pSt_ServerConfig->st_XReport.tszAPIUrl, st_JsonXReport["tszAPIUrl"].asCString()); + _tcsxcpy(pSt_ServerConfig->st_XReport.tszServiceName, st_JsonXReport["tszServiceName"].asCString()); + + return true; +} +/******************************************************************** +函数名称:ModuleConfigure_Json_Version +函数功能:读取版本配置文件 + 参数.一:lpszConfigFile + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入要读取的配置文件 + 参数.二:pSt_ServerConfig + In/Out:Out + 类型:数据结构指针 + 可空:N + 意思:输出配置信息 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CModuleConfigure_Json::ModuleConfigure_Json_Version(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig) +{ + Config_IsErrorOccur = false; + + if ((NULL == lpszConfigFile) || (NULL == pSt_ServerConfig)) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PARAMENT; + return false; + } + Json::Value st_JsonRoot; + JSONCPP_STRING st_JsonError; + Json::CharReaderBuilder st_JsonBuilder; + //读取配置文件所有内容到缓冲区 + FILE* pSt_File = _xtfopen(lpszConfigFile, _X("rb")); + if (NULL == pSt_File) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_OPENFILE; + return false; + } + int nCount = 0; + XCHAR tszMsgBuffer[4096]; + while (1) + { + int nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File); + if (nRet <= 0) + { + break; + } + nCount += nRet; + } + fclose(pSt_File); + //开始解析配置文件 + std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); + if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError)) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PARSE; + return false; + } + if (st_JsonRoot["XVer"].empty()) { Config_IsErrorOccur = true; diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h index e354ecee348c4a2fc948f2f4c8ff2fbd7771702d..f6364233e52b99ba2a922ba34d336caecbe2a7a5 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h @@ -18,6 +18,7 @@ public: ~CModuleConfigure_Json(); public: bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); + bool ModuleConfigure_Json_Version(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); protected: private: }; \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def index 6255e0732a407007cd9b07dd0cd643911336e33c..b94a561920af1c39ba420cf09c0944996e9b42f7 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def @@ -3,4 +3,5 @@ LIBRARY EXPORTS ModuleConfigure_GetLastError - ModuleConfigure_Json_File \ No newline at end of file + ModuleConfigure_Json_File + ModuleConfigure_Json_Version \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj index bb4e5ccdb31054d6bd23f71eb11b02f1602623aa..a9a2b7ec020ccaa51b7b2b29f25c059323cb540e 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj @@ -72,22 +72,22 @@ true - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;..\XEngine_ModuleConfigure;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) false - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) true - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) false - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) diff --git a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp index 51fb55fa337daca639479a7e224c0dcb78717901..45b3f4d87dbab118f5f4257a871a89d52aac0601 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp @@ -33,3 +33,7 @@ extern "C" bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVIC { return m_ConfigJson.ModuleConfigure_Json_File(lpszConfigFile, pSt_ServerConfig); } +extern "C" bool ModuleConfigure_Json_Version(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG * pSt_ServerConfig) +{ + return m_ConfigJson.ModuleConfigure_Json_Version(lpszConfigFile, pSt_ServerConfig); +} \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleProtocol/Makefile b/XEngine_Source/XEngine_ModuleProtocol/Makefile index 443324a2cf4862f15e459d0f212cdbf1b06c585c..d981e548b2a19da650ab036a7ac3382fd3b876d4 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/Makefile +++ b/XEngine_Source/XEngine_ModuleProtocol/Makefile @@ -6,8 +6,8 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I ../XEngine_ThirdPart/jsoncpp -LOADSO = -L ../XEngine_ThirdPart/jsoncpp +LOADHDR = -I ./ -I ../XEngine_Depend/XEngine_Module/jsoncpp +LOADSO = -L ../XEngine_Depend/XEngine_Module/jsoncpp LIB = -ljsoncpp LIBEX = OBJECTS = ModuleProtocol_Packet.o ModuleProtocol_Parse.o pch.o diff --git a/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.vcxproj b/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.vcxproj index be8065e28030b84fa4b8922d4d4b6df5b0397c08..9a4e9be87711cd1236834b3bed705daea75cbeff 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.vcxproj +++ b/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.vcxproj @@ -71,18 +71,18 @@ - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) - $(XEngine_Include);../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) diff --git a/XEngine_Source/XEngine_ServiceApp/Makefile b/XEngine_Source/XEngine_ServiceApp/Makefile index c519b1c26d7811b5f2cbc8db90b47b5d8041b401..2ef467f15858d6bb18af412604d7ab6d1bf8e158 100644 --- a/XEngine_Source/XEngine_ServiceApp/Makefile +++ b/XEngine_Source/XEngine_ServiceApp/Makefile @@ -4,12 +4,12 @@ PLATVER = PLATDIR = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I ../XEngine_ThirdPart/jsoncpp +LOADHDR = -I ./ -I ../XEngine_Depend/XEngine_Module/jsoncpp LOADSO = -L ../XEngine_ModuleConfigure -L ../XEngine_ModuleSession -L ../XEngine_ModuleProtocol \ - -L ../XEngine_ThirdPart/jsoncpp + -L ../XEngine_Depend/XEngine_Module/jsoncpp -L ../XEngine_Depend/XEngine_Module/XEngine_InfoReport LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_OPenSsl -lXEngine_ManagePool -lXClient_Socket -lXClient_APIHelp -lHelpComponents_XLog -lHelpComponents_Packets -lRfcComponents_ProxyProtocol -lNetHelp_APIHelp -lNetHelp_XSocket \ -lXEngine_ModuleConfigure -lXEngine_ModuleSession -lXEngine_ModuleProtocol \ - -ljsoncpp + -ljsoncpp -lXEngine_InfoReport LIBEX = OBJECTS = XEngine_Configure.o XEngine_Network.o XEngine_SocksTask.o XEngine_TunnelTask.o XEngine_ForwardTask.o XEngine_ServiceApp.o diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_Configure.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_Configure.cpp index 8279d834c9fbcbd00295270c5bad7ff30532ef6b..4fe1a1587c268c1c85509fe803719787086b1a1c 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_Configure.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_Configure.cpp @@ -13,12 +13,18 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pSt_Configure) { LPCXSTR lpszConfigFile = _X("./XEngine_Config/XEngine_Config.json"); + LPCXSTR lpszConfigVersion = _X("./XEngine_Config/XEngine_Version.json"); if (!ModuleConfigure_Json_File(lpszConfigFile, pSt_Configure)) { printf("解析配置文件失败,ModuleConfigure_Json_File:%lX\n", ModuleConfigure_GetLastError()); return false; } + if (!ModuleConfigure_Json_Version(lpszConfigVersion, pSt_Configure)) + { + printf("解析配置文件失败,ModuleConfigure_Json_Version:%lX\n", ModuleConfigure_GetLastError()); + return false; + } for (int i = 0; i < argc; i++) { diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h index 8457956a70fabb026b3e70cec424c15877159355..56d3acc63affdcc449a3252b720de443b96fcaaf 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h @@ -46,6 +46,8 @@ using namespace std; #include //加载项目相关头文件 #include "../XEngine_UserProtocol.h" +#include "../XEngine_Depend/XEngine_Module/XEngine_InfoReport/InfoReport_Define.h" +#include "../XEngine_Depend/XEngine_Module/XEngine_InfoReport/InfoReport_Error.h" #include "../XEngine_ModuleConfigure/ModuleConfig_Define.h" #include "../XEngine_ModuleConfigure/ModuleConfig_Error.h" #include "../XEngine_ModuleSession/ModuleSession_Define.h" @@ -107,20 +109,24 @@ typedef struct #ifdef _MSC_BUILD #ifdef _WIN64 #ifdef _DEBUG +#pragma comment(lib,"../x64/Debug/XEngine_InfoReport.lib") #pragma comment(lib,"../x64/Debug/XEngine_ModuleConfigure.lib") #pragma comment(lib,"../x64/Debug/XEngine_ModuleSession.lib") #pragma comment(lib,"../x64/Debug/XEngine_ModuleProtocol.lib") #else +#pragma comment(lib,"../x64/Release/XEngine_InfoReport.lib") #pragma comment(lib,"../x64/Release/XEngine_ModuleConfigure.lib") #pragma comment(lib,"../x64/Release/XEngine_ModuleSession.lib") #pragma comment(lib,"../x64/Release/XEngine_ModuleProtocol.lib") #endif #else #ifdef _DEBUG +#pragma comment(lib,"../Debug/XEngine_InfoReport.lib") #pragma comment(lib,"../Debug/XEngine_ModuleConfigure.lib") #pragma comment(lib,"../Debug/XEngine_ModuleSession.lib") #pragma comment(lib,"../Debug/XEngine_ModuleProtocol.lib") #else +#pragma comment(lib,"../Release/XEngine_InfoReport.lib") #pragma comment(lib,"../Release/XEngine_ModuleConfigure.lib") #pragma comment(lib,"../Release/XEngine_ModuleSession.lib") #pragma comment(lib,"../Release/XEngine_ModuleProtocol.lib") diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp index a286d6cfd7b1330d9b9b6b4b4b860ad7f14c1ce3..a1480452934080b8a2aea2989e783434e1b7b0f8 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp @@ -88,10 +88,6 @@ int main(int argc, char** argv) memset(&st_XLogConfig, '\0', sizeof(HELPCOMPONENTS_XLOG_CONFIGURE)); memset(&st_ServiceConfig, '\0', sizeof(XENGINE_SERVICECONFIG)); - - signal(SIGINT, ServiceApp_Stop); - signal(SIGTERM, ServiceApp_Stop); - signal(SIGABRT, ServiceApp_Stop); //初始化参数 if (!XEngine_Configure_Parament(argc, argv, &st_ServiceConfig)) { @@ -103,10 +99,10 @@ int main(int argc, char** argv) ServiceApp_Deamon(); } //初始日志 - st_XLogConfig.XLog_MaxBackupFile = 10; - st_XLogConfig.XLog_MaxSize = 1024000; + st_XLogConfig.XLog_MaxBackupFile = st_ServiceConfig.st_XLog.nMaxCount; + st_XLogConfig.XLog_MaxSize = st_ServiceConfig.st_XLog.nMaxSize; _tcsxcpy(st_XLogConfig.tszFileName, st_ServiceConfig.st_XLog.tszLogFile); - xhLog = HelpComponents_XLog_Init(HELPCOMPONENTS_XLOG_OUTTYPE_STD | HELPCOMPONENTS_XLOG_OUTTYPE_FILE, &st_XLogConfig); + xhLog = HelpComponents_XLog_Init(st_ServiceConfig.st_XLog.nLogLeave, &st_XLogConfig); if (NULL == xhLog) { printf("启动服务中,启动日志失败,错误:%lX", XLog_GetLastError()); @@ -116,6 +112,10 @@ int main(int argc, char** argv) HelpComponents_XLog_SetLogPriority(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化日志系统成功")); + signal(SIGINT, ServiceApp_Stop); + signal(SIGTERM, ServiceApp_Stop); + signal(SIGABRT, ServiceApp_Stop); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化信号量处理程序成功")); //启动Socks服务相关代码 if (st_ServiceConfig.nSocksPort > 0) { @@ -258,6 +258,24 @@ int main(int argc, char** argv) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,Forward服务没有被启用")); } + //发送信息报告 + if (st_ServiceConfig.st_XReport.bEnable) + { + if (InfoReport_APIMachine_Send(st_ServiceConfig.st_XReport.tszAPIUrl, st_ServiceConfig.st_XReport.tszServiceName)) + { + __int64x nTimeNumber = 0; + InfoReport_APIMachine_GetTime(st_ServiceConfig.st_XReport.tszAPIUrl, st_ServiceConfig.st_XReport.tszServiceName, &nTimeNumber); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动信息报告给API服务器:%s 成功,报告次数:%lld"), st_ServiceConfig.st_XReport.tszAPIUrl, nTimeNumber); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动信息报告给API服务器:%s 失败,错误:%lX"), st_ServiceConfig.st_XReport.tszAPIUrl, InfoReport_GetLastError()); + } + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,信息报告给API服务器没有启用")); + } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,服务运行中,XEngine版本:%s%s,服务版本:%s,发行次数:%d。。。"), BaseLib_OperatorVer_XNumberStr(), BaseLib_OperatorVer_XTypeStr(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str(), st_ServiceConfig.st_XVer.pStl_ListVer->size());