diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/linuxbuild.yml new file mode 100644 index 0000000000000000000000000000000000000000..2974703cd1fc80c14638c0f552cb0a41e47b926d --- /dev/null +++ b/.github/workflows/linuxbuild.yml @@ -0,0 +1,67 @@ +name: ubuntu build workflows + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + #- os: ubuntu-24.04 + runs-on: ${{ matrix.os }} + + steps: + # 检出您的主仓库代码 + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + # 检出依赖的xengine仓库到指定的xengine目录 + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + run: | + git submodule init + git submodule update + + - name: install library + run: sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev + + # 设置依赖库的环境变量 + - name: Set up Dependency Environment Variables + run: | + cd libxengine + chmod 777 * + sudo ./XEngine_LINEnv.sh -i 3 + cd .. + #编译 + - name: make + run: | + cd XEngine_Source + make + make FLAGS=InstallAll + make FLAGS=CleanAll + + make RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + cd .. + - name: test + run: | + cd XEngine_Release + ./XEngine_APIServiceApp -t \ No newline at end of file diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml new file mode 100644 index 0000000000000000000000000000000000000000..ca9e8d25f2ce3c8f4cf56bb176a6d676a733d7b9 --- /dev/null +++ b/.github/workflows/macbuild.yml @@ -0,0 +1,70 @@ +name: macos build workflows + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + include: + - os: macos-13 + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + # 检出依赖的xengine仓库到指定的xengine目录 + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + run: | + git submodule init + git submodule update + + - name: brew install + run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + - name: install library + run: | + brew install lua opencv qrencode + brew list opencv + brew info opencv + + # 设置依赖库的环境变量 + - name: Set up Dependency Environment Variables + run: | + cd libxengine + chmod 777 * + ./XEngine_LINEnv.sh -i 3 + cd .. + #编译 + - name: make debug + run: | + cd XEngine_Source + make PLATFORM=mac + make PLATFORM=mac FLAGS=InstallAll + make PLATFORM=mac FLAGS=CleanAll + - name: make release + run: | + cd XEngine_Source + make PLATFORM=mac RELEASE=1 + make PLATFORM=mac FLAGS=InstallAll + make PLATFORM=mac FLAGS=CleanAll + - name: test + run: | + cd XEngine_Release + ./XEngine_APIServiceApp -t diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index ba707c37527c13eb6bb1e3a62c0177801d8b3ff8..3e501e3c39af1b8ad6b6e252be16836b9838b849 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -1,50 +1,102 @@ -name: C++ Build with Dependencies +name: windows build workflows -#on: [push] # 触发条件,推送和拉取请求时, on: - workflow_dispatch: # 添加这行来启用手动触发 + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] permissions: - contents: write + contents: read jobs: build: strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false matrix: - configuration: [Release] - platform: [x86] + configuration: [Debug ,Release] + platform: [x86 ,x64] runs-on: windows-latest # 最新的 Windows 环境 steps: # 检出您的主仓库代码 - name: Checkout main repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + ref: 'develop' # 检出依赖的xengine仓库到指定的xengine目录 - name: Checkout dependency repository (xengine) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - repository: libxengine/xengine - path: xengine + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + run: | + git submodule init + git submodule update + shell: pwsh - - name: Checkout dependency repository (vcpkg) - uses: actions/checkout@v3 + - name: vcpkg dependency repository + uses: actions/checkout@v4 with: - repository: https://github.com/microsoft/vcpkg.git - path: vcpkg + repository: microsoft/vcpkg + path: vcpkg + + - name: vcpkg install (x86) + if: matrix.platform == 'x86' + run: | + cd vcpkg + ./bootstrap-vcpkg.bat + ./vcpkg.exe install lua:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows + ./vcpkg.exe integrate install + shell: pwsh + - name: vcpkg install (x64) + if: matrix.platform == 'x64' + run: | + cd vcpkg + ./bootstrap-vcpkg.bat + ./vcpkg.exe install lua:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows + ./vcpkg.exe integrate install + shell: pwsh # 设置依赖库的环境变量 - name: Set up Dependency Environment Variables run: | - echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append shell: pwsh + - name: Set code page + run: chcp 65001 # 配置 MSBuild 的路径,准备构建 VC++ 项目 - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 #编译 - name: Build Solution - run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} \ No newline at end of file + run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:AdditionalOptions="/utf-8" + #测试 + - name: Conditional Step for x86 Release + if: matrix.configuration == 'Release' && matrix.platform == 'x86' + run: | + cp -r XEngine_Source/Release/*.dll XEngine_Release/ + cp -r XEngine_Source/Release/*.exe XEngine_Release/ + cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/ + cd XEngine_Release + ./VSCopy_x86.bat + ./XEngine_HttpApp.exe -t + shell: pwsh + - name: Conditional Step for x86 Debug + if: matrix.configuration == 'Debug' && matrix.platform == 'x86' + run: | + cp -r XEngine_Source/Debug/*.dll XEngine_Release/ + cp -r XEngine_Source/Debug/*.exe XEngine_Release/ + cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/ + cd XEngine_Release + ./VSCopy_x86.bat + ./XEngine_HttpApp.exe -t + shell: pwsh diff --git a/CHANGELOG b/CHANGELOG index a865e5182f0964ba8aa3c03fcccb2250fc8de910..1b2b52acc77dc6eb76f6a3897e10ca1dbe6c1c8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,33 @@ +XEngine_APIService V3.7.0.1001 + +增加:windows的coredump支持 +增加:工作流支持 +增加:启动测试参数支持 +更新:匹配XEngine V8.40版本 +更新:子模块 +修改:modify:XENGIEN_APISERVICE_BUFFER_SIZE 替换为 XENGINE_MEMORY_SIZE_MAX +修改:生成顺序调整 +修改:p2p刻度爱你管理支持禁用了 +修正:mac和linux系统下构建错误 +修正:头文件缺失 +修正:后台服务http下载状态处理错误 +修正:机器信息日志打印错误 +修正:禁用插件没有作用的问题 + +added:windows core dump generator support +added:workflows support +added:start test support +update:match xengine v8.40 +update:sub module +modify:XENGIEN_APISERVICE_BUFFER_SIZE instead XENGINE_MEMORY_SIZE_MAX +modify:generation sequence +modify:p2p client management support disable +fixed:build error on mac and linux +fixed:header file lost +fixed:http download status process failed for back service +fixed:log print info incorrect for machine info +fixed:does not work when disable plugin +====================================================================================== XEngine_APIService V3.6.0.1001 增加:mac地址供应商查询 diff --git a/README.en.md b/README.en.md index 9f872ea7352331bf12cde8ebb8e1dd3fac38f879..26252321b83117dc1585cc87bfdf453e1c732141 100644 --- a/README.en.md +++ b/README.en.md @@ -60,11 +60,11 @@ Support privatization deployment, free, safe, open source, controllable #### XEngine Evn you must install XEngine,need V8.x or above,install XEngine can be refer to xengine Readme docment -GITEE:https://gitee.com/xyry/libxengine -GITHUB:https://github.com/libxengine/xengine +GITEE:https://gitee.com/libxengine/libxengine +GITHUB:https://github.com/libxengine/libxengine ##### fast to deployment -git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git +git clone https://gitee.com/libxengine/libxengine.git or git clone https://github.com/libxengine/libxengine.git window Exection XEngine_WINEnv.bat Linux Exection:sudo ./XEngine_LINEnv.sh -i 3 Macos Exection:./XEngine_LINEnv.sh -i 3 diff --git a/README.md b/README.md index 29732721d9ecad886d62137133b61a2d2f16259f..678f34d4d5301899a1c85fd2b8b74179785dc417 100644 --- a/README.md +++ b/README.md @@ -59,11 +59,11 @@ c c++ interface api service #### XEngine环境 必须安装XEngine,版本需要V8.x或者以上版本,安装XEngine可以参考其Readme文档 -GITEE:https://gitee.com/xyry/libxengine -GITHUB:https://github.com/libxengine/xengine +GITEE:https://gitee.com/libxengine/libxengine +GITHUB:https://github.com/libxengine/libxengine ###### 快速部署 -git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git +git clone https://gitee.com/libxengine/libxengine.git 或者 git clone https://github.com/libxengine/libxengine.git window执行XEngine_WINEnv.bat 脚本. Linux执行:sudo ./XEngine_LINEnv.sh -i 3 macos执行:./XEngine_LINEnv.sh -i 3 @@ -76,6 +76,10 @@ macos执行:./XEngine_LINEnv.sh -i 3 由于依赖的子模块,在你checkout仓库后,在仓库目录下执行下面的命令拉取子模块 git submodule init git submodule update +如果github访问失败,你也可以clone该项目,在主目录下使用命令: +git clone https://gitee.com/xengine/XEngine_OPenSource.git XEngine_Source/XEngine_Depend +git clone https://gitee.com/xengine/XEngine_IPMacData.git XEngine_Source/XEngine_DBDepend/XEngine_IPMacData +git clone https://gitee.com/xengine/XEngine_PhoneData.git XEngine_Source/XEngine_DBDepend/XEngine_PhoneData #### Windows 需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows lua:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows diff --git a/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp b/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp index c32e8535dc3a6894bdfbd40319cef8880b507360..ddd9d6cd583b4b997f6c757e29442eef6e8c1f60 100644 --- a/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp +++ b/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp @@ -44,7 +44,9 @@ int test_insert() Json::Value st_JsonRoot; Json::StreamWriterBuilder st_JsonBuilder; + st_JsonRoot["tszServiceName"] = "XEngine_TestApp"; st_JsonRoot["tszMachineName"] = tszOSName; + st_JsonRoot["tszMachineUser"] = "user"; st_JsonRoot["tszMachineCode"] = st_SDKSerial.tszSystemSerial; st_JsonRoot["tszMachineSystem"] = tszComputerName; @@ -65,7 +67,7 @@ int test_list() { int nLen = 0; int nCode = 0; - LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=machine¶ms1=2"); + LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=machine¶ms1=3"); XCHAR* ptszMsgBuffer = NULL; if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, NULL, &nCode, &ptszMsgBuffer, &nLen)) @@ -84,11 +86,12 @@ int test_delete() int nCode = 0; LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=machine¶ms1=1"); - SYSTEMAPI_SERIAL_INFOMATION st_SDKSerial = {}; - SystemApi_HardWare_GetSerial(&st_SDKSerial); + XCHAR tszComputerName[128] = {}; + SystemApi_System_GetSysName(NULL, tszComputerName); Json::Value st_JsonRoot; - st_JsonRoot["tszMachineCode"] = st_SDKSerial.tszSystemSerial; + st_JsonRoot["tszServiceName"] = "XEngine_TestApp"; + st_JsonRoot["tszMachineSystem"] = tszComputerName; XCHAR* ptszMsgBuffer = NULL; if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen)) diff --git a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json index 5d9097f4a43cca739714420c345b17d3ff4a7e50..3198aa8826d361f6e7c5eb1ddf37a21210b3e1fe 100644 --- a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json @@ -1,5 +1,6 @@ { "XVer":[ + "3.7.0.1001 Build20240927", "3.6.0.1001 Build20240705", "3.5.0.1001 Build20240510", "3.4.0.1001 Build20240411", diff --git a/XEngine_Release/XEngine_Coredump/.gitignore b/XEngine_Release/XEngine_Coredump/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/XEngine_Release/XEngine_DBFile/macaddr.xdb b/XEngine_Release/XEngine_DBFile/macaddr.xdb index f32058d45c7602817a9d2d33584d2acfc0e1f2a4..3d7a2173e9d55bb23ee8a3a7ceffa7947ec5d826 100644 Binary files a/XEngine_Release/XEngine_DBFile/macaddr.xdb and b/XEngine_Release/XEngine_DBFile/macaddr.xdb differ diff --git a/XEngine_Source/Makefile b/XEngine_Source/Makefile index 456169d2b3c76aaa92c5ee61f60ecd06ba34b4de..25544f7649c817f5671fbee7b1d31f9e0d74fb2b 100644 --- a/XEngine_Source/Makefile +++ b/XEngine_Source/Makefile @@ -25,6 +25,12 @@ APIMODULE_IPMAC_PATH = ./XEngine_DBDepend/XEngine_IPMacData/XEngine_Source/XEngi APP_HTTP_PATH = ./XEngine_ServiceApp/XEngine_HttpApp +ifeq ($(PLATFORM),linux) + FILEEXT = so +else ifeq ($(PLATFORM),mac) + FILEEXT = dylib +endif + XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \ libXEngine_ModuleConfigure.so libXEngine_ModuleDatabase.so libXEngine_ModuleProtocol.so libXEngine_ModuleSystem.so libXEngine_ModuleHelp.so libXEngine_ModulePlugin.so \ libModulePlugin_Zodiac.so libModulePlugin_Password.so libModulePlugin_Timezone.so libModulePlugin_BMIndex.so libModulePlugin_Meter.so \ @@ -60,26 +66,26 @@ libModulePlugin_Meter.so: libjsoncpp.so: ifeq ($(FLAGS), InstallAll) - cp $(THIRDPART_MODULE_JSONCPP)/libjsoncpp.so ../XEngine_Release/ + cp $(THIRDPART_MODULE_JSONCPP)/libjsoncpp.$(FILEEXT) ../XEngine_Release/ else make -C $(THIRDPART_MODULE_JSONCPP) PLATFORM=$(PLATFORM) $(FLAGS) endif libXEngine_InfoReport.so: ifeq ($(FLAGS), InstallAll) - cp $(THIRDPART_MODULE_REPORT)/libXEngine_InfoReport.so ../XEngine_Release/ + cp $(THIRDPART_MODULE_REPORT)/libXEngine_InfoReport.$(FILEEXT) ../XEngine_Release/ else make -C $(THIRDPART_MODULE_REPORT) PLATFORM=$(PLATFORM) $(FLAGS) endif libXEngine_APIModulePhone.so: ifeq ($(FLAGS), InstallAll) - cp $(APIMODULE_PHONE_PATH)/libXEngine_APIModulePhone.so ../XEngine_Release/ + cp $(APIMODULE_PHONE_PATH)/libXEngine_APIModulePhone.$(FILEEXT) ../XEngine_Release/ else make -C $(APIMODULE_PHONE_PATH) PLATFORM=$(PLATFORM) $(FLAGS) endif libXEngine_APIModuleIPMac.so: ifeq ($(FLAGS), InstallAll) - cp $(APIMODULE_IPMAC_PATH)/libXEngine_APIModuleIPMac.so ../XEngine_Release/ + cp $(APIMODULE_IPMAC_PATH)/libXEngine_APIModuleIPMac.$(FILEEXT) ../XEngine_Release/ else make -C $(APIMODULE_IPMAC_PATH) PLATFORM=$(PLATFORM) $(FLAGS) endif diff --git a/XEngine_Source/VSCopy-Debug.bat b/XEngine_Source/VSCopy_Debug.bat similarity index 100% rename from XEngine_Source/VSCopy-Debug.bat rename to XEngine_Source/VSCopy_Debug.bat diff --git a/XEngine_Source/VSCopy-x64.bat b/XEngine_Source/VSCopy_x64.bat similarity index 100% rename from XEngine_Source/VSCopy-x64.bat rename to XEngine_Source/VSCopy_x64.bat diff --git a/XEngine_Source/VSCopy-x86.bat b/XEngine_Source/VSCopy_x86.bat similarity index 100% rename from XEngine_Source/VSCopy-x86.bat rename to XEngine_Source/VSCopy_x86.bat diff --git a/XEngine_Source/XEngine.sln b/XEngine_Source/XEngine.sln index 1e5ddbd30fab4b56a22a8f08b65d6fb5c8021d68..5bc5b27fa36688cc473919336ed58b8a3d33f15a 100644 --- a/XEngine_Source/XEngine.sln +++ b/XEngine_Source/XEngine.sln @@ -25,12 +25,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_HttpApp", "XEngine_ {6C935BE1-77E3-4719-A7A6-C76ABAFEE010} = {6C935BE1-77E3-4719-A7A6-C76ABAFEE010} {6D0FCB40-D544-4AB2-A239-2FEBC4B98F6D} = {6D0FCB40-D544-4AB2-A239-2FEBC4B98F6D} {6F111577-DAF8-4294-B516-0077C22D7613} = {6F111577-DAF8-4294-B516-0077C22D7613} - {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} {92F971AB-CAC9-4D9B-A9CA-AFD9CA17E505} = {92F971AB-CAC9-4D9B-A9CA-AFD9CA17E505} + {A13B72E7-FC40-4A27-81C3-26DF3C8F4C0A} = {A13B72E7-FC40-4A27-81C3-26DF3C8F4C0A} {BBC4B2B4-1143-45DF-8890-47CE26A61D0E} = {BBC4B2B4-1143-45DF-8890-47CE26A61D0E} {CB443280-E283-44CD-B956-52C404A51DB6} = {CB443280-E283-44CD-B956-52C404A51DB6} + {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} + {FFAC032D-4F8C-4C70-AF36-D79685A6961F} = {FFAC032D-4F8C-4C70-AF36-D79685A6961F} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_ModuleDatabase", "XEngine_ModuleDatabase\XEngine_ModuleDatabase.vcxproj", "{140AD4A9-4918-4345-B352-507C345AEBE0}" diff --git a/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData b/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData index 7b501e530987c5b9517e7885cb396b9dcb962d17..6e49d4d9ce6cf9d0534c6c7c94edd62854f5f949 160000 --- a/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData +++ b/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData @@ -1 +1 @@ -Subproject commit 7b501e530987c5b9517e7885cb396b9dcb962d17 +Subproject commit 6e49d4d9ce6cf9d0534c6c7c94edd62854f5f949 diff --git a/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData b/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData index f17167b09d446c5fdc45d23b27194011de558967..dd22d7298801812e61d9ce679f08df21f75611f6 160000 --- a/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData +++ b/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData @@ -1 +1 @@ -Subproject commit f17167b09d446c5fdc45d23b27194011de558967 +Subproject commit dd22d7298801812e61d9ce679f08df21f75611f6 diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend index 1af95ee3737450c0b2739f0b4cc37a3f2c9eef10..d1d1ee7952a0a93a1beb183a8dee281d9231ff3d 160000 --- a/XEngine_Source/XEngine_Depend +++ b/XEngine_Source/XEngine_Depend @@ -1 +1 @@ -Subproject commit 1af95ee3737450c0b2739f0b4cc37a3f2c9eef10 +Subproject commit d1d1ee7952a0a93a1beb183a8dee281d9231ff3d diff --git a/XEngine_Source/XEngine_ModuleConfigure/Makefile b/XEngine_Source/XEngine_ModuleConfigure/Makefile index 5cd309eccc64200299734aefd8a3432a7b2bf1dd..0fbfcf1426a2933af3ab8179013bad290974ed49 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/Makefile +++ b/XEngine_Source/XEngine_ModuleConfigure/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleDatabase/Makefile b/XEngine_Source/XEngine_ModuleDatabase/Makefile index a108b3183141b492e3ad660e8717e76874990e03..7c25dcc8fa145e18d71c1023b7d082a21bac3598 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/Makefile +++ b/XEngine_Source/XEngine_ModuleDatabase/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleHelp/Makefile b/XEngine_Source/XEngine_ModuleHelp/Makefile index e668711d720b79c073190a582b354172fa9efe7c..1570e6d7c1adca2a4cf6a161ac5fee0d70648122 100644 --- a/XEngine_Source/XEngine_ModuleHelp/Makefile +++ b/XEngine_Source/XEngine_ModuleHelp/Makefile @@ -6,7 +6,7 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I /usr/include/opencv4 +LOADHDR = -I ./ -I /usr/include/opencv4 -I /usr/local/include/opencv4 -I /usr/local/include/lua LOADSO = LIB = -lXEngine_BaseLib -lXClient_Socket LIBEX = @@ -26,8 +26,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.h b/XEngine_Source/XEngine_ModuleHelp/pch.h index 1d02e0e5609c8ee9339f3f9bec639d0eee4930fc..af6de126f72fa518f4186f6c77e46627601900be 100644 --- a/XEngine_Source/XEngine_ModuleHelp/pch.h +++ b/XEngine_Source/XEngine_ModuleHelp/pch.h @@ -26,7 +26,6 @@ #include #include #if _XENGINE_BUILD_SWITCH_OPENCV == 1 -#include #include #include #include diff --git a/XEngine_Source/XEngine_ModulePlugin/Makefile b/XEngine_Source/XEngine_ModulePlugin/Makefile index d7b3c6fcd6ca482a2882edac4defb2b41e564e5d..532aab631714e7efbabab0d296d1ff67196685f0 100644 --- a/XEngine_Source/XEngine_ModulePlugin/Makefile +++ b/XEngine_Source/XEngine_ModulePlugin/Makefile @@ -6,7 +6,7 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I /usr/include/lua5.4 +LOADHDR = -I ./ -I /usr/include/lua5.4 -I /usr/local/include/lua LOADSO = LIB = -lXEngine_BaseLib LIBEX = @@ -18,8 +18,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleProtocol/Makefile b/XEngine_Source/XEngine_ModuleProtocol/Makefile index 3a15f45205801d0a4f89f3334623b27d632e355a..093904b3c9d44f58f3ffae719f527fb4f1f8db59 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/Makefile +++ b/XEngine_Source/XEngine_ModuleProtocol/Makefile @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -I ../XEngine_Depend/XEngine_Module/jsoncpp LOADSO = -L ../XEngine_Depend/XEngine_Module/jsoncpp -LIB = -lXEngine_BaseLib -lNetHelp_XSocket -ljsoncpp +LIB = -lXEngine_BaseLib -lNetHelp_XSocket -lXEngine_SystemApi -ljsoncpp LIBEX = OBJECTS = ModuleProtocol_Packet.o ModuleProtocol_Parse.o pch.o @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp index e6541f31c91d196fa37c31fb5bd12a68b99c66dd..ea78512d2c061fd6608addf5e3818f064f85c0fc 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp @@ -1151,7 +1151,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_EnumDevice(XCHAR* ptszMsgBuff Json::Value st_JsonObject; st_JsonObject["nDeviceInout"] = (*pppSt_AudioList)[i]->nDeviceInout; st_JsonObject["nDeviceType"] = (*pppSt_AudioList)[i]->nDeviceType; - st_JsonObject["tszName"] = (*pppSt_AudioList)[i]->st_MetaInfo.tszKey; + st_JsonObject["tszName"] = (*pppSt_AudioList)[i]->st_MetaInfo.tszStrKey; st_JsonAudio.append(st_JsonObject); } for (int i = 0; i < nVCount; i++) @@ -1159,7 +1159,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_EnumDevice(XCHAR* ptszMsgBuff Json::Value st_JsonObject; st_JsonObject["nDeviceInout"] = (*pppSt_VideoList)[i]->nDeviceInout; st_JsonObject["nDeviceType"] = (*pppSt_VideoList)[i]->nDeviceType; - st_JsonObject["tszName"] = (*pppSt_VideoList)[i]->st_MetaInfo.tszKey; + st_JsonObject["tszName"] = (*pppSt_VideoList)[i]->st_MetaInfo.tszStrKey; st_JsonVideo.append(st_JsonObject); } st_JsonArray["AArray"] = st_JsonAudio; diff --git a/XEngine_Source/XEngine_ModuleSystem/Makefile b/XEngine_Source/XEngine_ModuleSystem/Makefile index 04ed1d1beb0e8f09b9249918155abb803bdc055e..c53b94d38c6f24c9eac08b3a878939407ee4575f 100644 --- a/XEngine_Source/XEngine_ModuleSystem/Makefile +++ b/XEngine_Source/XEngine_ModuleSystem/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ModuleSystem/pch.h b/XEngine_Source/XEngine_ModuleSystem/pch.h index 362e91aede87ef4d34caadc7b11bc62863397f15..06047e8ea9c14501c8457b7959056405c2eaf12a 100644 --- a/XEngine_Source/XEngine_ModuleSystem/pch.h +++ b/XEngine_Source/XEngine_ModuleSystem/pch.h @@ -14,6 +14,7 @@ #include #else #include +#include #endif #endif //PCH_H #include @@ -25,7 +26,6 @@ #include #include #include -#include #include #include #include "ModuleSystem_Define.h" diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile index ffff591beebf396f7e5afd07f6faea79f416c626..689d5efa8e8f1b6bb76f1f0b1fb3f6a986827450 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Makefile index 309d71aa9286e7fbf7cbba744ed8746ceeda6109..72918d79f128fef97cd6b30364d2a403319903ca 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile index 82c89bb01acedac4d8edb78883563b7f196602d4..d77147294a0670d01c3b3679c4cc0fb226c0db6e 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile index d6369d495c092c7892d4f0e96604150c2bed9828..ea91a889e85181ccf36d6b6f61299670de3b25c8 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Makefile @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile index b224754f03de8e6a718a18f2728af8aaba9d141e..8df05971c980e4833d3f2dcf71a0138649f8d09c 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Makefile @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -I ../../XEngine_Depend/XEngine_Module/jsoncpp LOADSO = -L ../../XEngine_Depend/XEngine_Module/jsoncpp -LIB = -lXEngine_BaseLib -ljsoncpp +LIB = -lXEngine_BaseLib -lXEngine_Algorithm -ljsoncpp LIBEX = OBJECTS = Plugin_Zodiac.o pch.o @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile index 452a81ce3a6638290c849767f266d7eeff4774fa..c71ec2d703d076229eaeaa797c3701294db80c2a 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC -Wformat-overflow=0 +CC = g++ -Wall -std=c++17 -fPIC PLATFORM = linux PLATVER = PLATDIR = @@ -24,8 +24,13 @@ ifeq ($(RELEASE),1) FLAGS = -c DEBUG = else -FLAGS = -c -lc_p -DEBUG = -g -pg + ifeq ($(PLATFORM),mac) + FLAGS = -c + DEBUG = -g + else + FLAGS = -c -lc_p + DEBUG = -g -pg + endif endif ifeq ($(UNICODE),1) @@ -42,6 +47,7 @@ ifeq ($(PLATFORM),linux) PLATVER = -D __UBUNTU__ PLATDIR = XEngine_Linux/Ubuntu endif + CC += -Wformat-overflow=0 FILEEXT = so LIBFLAG = -shared LIBEX = -lpthread -lrt -ldl diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp index 9d2d2e1a2b9359117179a2feb35d29813beba070..3579a2ba9379c0d90c51d4dfb97f78b9caf49c34 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp @@ -48,6 +48,10 @@ bool XEngine_Configure_Parament(int argc, char** argv) st_ServiceConfig.st_XReload.bReload = true; st_ServiceConfig.st_XReload.byCode = _ttxoi(argv[i + 1]); } + else if (0 == _tcsxcmp("-t", argv[i])) + { + bIsTest = true; + } } return true; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp index 917079a269d1ea779253f97c07eff5ed284645a1..718868d1c55931a4aae4d922e038c33de00b46fc 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp @@ -415,7 +415,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST if (2 == nListCount) { XCHAR tszProvincerStr[32] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr,NULL); + BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); HTTPTask_TaskGet_IDRegion(lpszClientAddr, nType, tszProvincerStr, NULL, NULL); } else if (3 == nListCount) diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h index 2c1a22fbb68ab46c392ca94c8d939f36b0c51f78..f1137e4388887dab7482b5f05cd712ab89583b6f 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h @@ -11,8 +11,10 @@ #ifdef _MSC_BUILD #include #include +#include #else #include +#include #include #include #include @@ -46,7 +48,6 @@ using namespace std; #include #include #include -#include #include #include #include @@ -122,9 +123,8 @@ using namespace std; // Purpose: 公用头文件 // History: *********************************************************************/ -#define XENGIEN_APISERVICE_BUFFER_SIZE (1024 * 1024 * 10) - extern bool bIsRun; +extern bool bIsTest; extern XHANDLE xhLog; //HTTP服务器 extern XHANDLE xhHTTPSocket; @@ -204,4 +204,5 @@ extern XENGINE_DEAMONAPPLIST st_DeamonAppConfig; #pragma comment(lib,"XEngine_AVCodec/XEngine_AudioCodec.lib") #pragma comment(lib,"XEngine_AVCodec/XEngine_AVHelp.lib") #pragma comment(lib,"Ws2_32.lib") +#pragma comment(lib,"Dbghelp.lib") #endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp index e68373b107d8ae2fe49bb73686488cd71b1b03d1..d88547398e8044dbad317e66f966371074d58fe1 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp @@ -11,15 +11,16 @@ // History: *********************************************************************/ bool bIsRun = false; +bool bIsTest = false; XHANDLE xhLog = NULL; //HTTP服务器 XHANDLE xhHTTPSocket = NULL; XHANDLE xhRFCSocket = NULL; XHANDLE xhHTTPHeart = NULL; XHANDLE xhHTTPPacket = NULL; -XHANDLE xhHTTPPool = 0; +XHANDLE xhHTTPPool = NULL; //线程 -unique_ptr pSTDThread_Deamon; +unique_ptr pSTDThread_Deamon = NULL; //配置文件 XENGINE_SERVICECONFIG st_ServiceConfig; XENGINE_QRCODECONFIG st_QRCodeConfig; @@ -67,6 +68,32 @@ void ServiceApp_Stop(int signo) #endif exit(0); } +#ifdef _MSC_BUILD +LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) +{ + static int i = 0; + XCHAR tszFileStr[MAX_PATH] = {}; + XCHAR tszTimeStr[128] = {}; + BaseLib_OperatorTime_TimeToStr(tszTimeStr); + _xstprintf(tszFileStr, _X("./XEngine_Coredump/dumpfile_%s_%d.dmp"), tszTimeStr, i++); + + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_FATAL, _X("主程序:软件崩溃,写入dump:%s"), tszFileStr); + + HANDLE hDumpFile = CreateFileA(tszFileStr, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (INVALID_HANDLE_VALUE != hDumpFile) + { + MINIDUMP_EXCEPTION_INFORMATION st_DumpInfo = {}; + st_DumpInfo.ExceptionPointers = pExceptionPointers; + st_DumpInfo.ThreadId = GetCurrentThreadId(); + st_DumpInfo.ClientPointers = TRUE; + + // 写入 dump 文件 + MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &st_DumpInfo, NULL, NULL); + CloseHandle(hDumpFile); + } + return EXCEPTION_EXECUTE_HANDLER; +} +#endif //LINUX守护进程 static int ServiceApp_Deamon() { @@ -103,8 +130,11 @@ int main(int argc, char** argv) #ifdef _MSC_BUILD WSADATA st_WSAData; WSAStartup(MAKEWORD(2, 2), &st_WSAData); + + SetUnhandledExceptionFilter(Coredump_ExceptionFilter); #endif bIsRun = true; + int nRet = -1; HELPCOMPONENTS_XLOG_CONFIGURE st_XLogConfig; THREADPOOL_PARAMENT** ppSt_ListHTTPParam; @@ -194,28 +224,8 @@ int main(int argc, char** argv) #else XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,初始化二维码配置文件:%s 失败,因为QR编译脚本被关闭"), st_ServiceConfig.st_XConfig.tszConfigQRCode); #endif - //初始化插件配置 - if (st_ServiceConfig.st_XPlugin.bEnable) - { - if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLib, &st_PluginLibConfig)) - { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化Lib插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); - goto XENGINE_SERVICEAPP_EXIT; - } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化Lib插件配置文件成功")); - if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLua, &st_PluginLuaConfig)) - { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化Lua插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); - goto XENGINE_SERVICEAPP_EXIT; - } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化Lua插件配置文件成功")); - } - else - { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,插件系统被禁用")); - } //初始化数据库 - if (st_ServiceConfig.st_XSql.bEnable) + if (st_ServiceConfig.st_XSql.bEnable && !bIsTest) { if (!ModuleDatabase_IDCard_Init((DATABASE_MYSQL_CONNECTINFO*)&st_ServiceConfig.st_XSql)) { @@ -347,12 +357,19 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,RFC服务没有被启用")); } //初始化P2P - if (!ModuleHelp_P2PClient_Init(st_ServiceConfig.st_XTime.nP2PTimeOut, HTTPTask_TastPost_P2PCallback)) + if (st_ServiceConfig.st_XTime.nP2PTimeOut > 0) { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动P2P客户端管理器失败,错误:%lX"), ModuleHelp_GetLastError()); - goto XENGINE_SERVICEAPP_EXIT; + if (!ModuleHelp_P2PClient_Init(st_ServiceConfig.st_XTime.nP2PTimeOut, HTTPTask_TastPost_P2PCallback)) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动P2P客户端管理器失败,错误:%lX"), ModuleHelp_GetLastError()); + goto XENGINE_SERVICEAPP_EXIT; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动P2P客户端管理器成功,超时时间设置:%d 秒"), st_ServiceConfig.st_XTime.nP2PTimeOut); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,P2P客户端管理器被设置为禁用")); } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动P2P客户端管理器成功,超时时间设置:%d 秒"), st_ServiceConfig.st_XTime.nP2PTimeOut); //进程守护 if (!ModuleConfigure_Json_DeamonList(st_ServiceConfig.st_XConfig.tszConfigDeamon, &st_DeamonAppConfig)) { @@ -379,15 +396,30 @@ int main(int argc, char** argv) goto XENGINE_SERVICEAPP_EXIT; } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动进程管理线程成功")); - //启动插件 - if (!ModulePlugin_Loader_Init()) - { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化插件系统失败,错误:%lX"), ModulePlugin_GetLastError()); - goto XENGINE_SERVICEAPP_EXIT; - } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化插件系统成功,开始加载插件")); - //加载插件 + + //初始化插件配置 + if (st_ServiceConfig.st_XPlugin.bEnable) { + if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLib, &st_PluginLibConfig)) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化Lib插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); + goto XENGINE_SERVICEAPP_EXIT; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化Lib插件配置文件成功")); + if (!ModuleConfigure_Json_PluginFile(st_ServiceConfig.st_XPlugin.tszPluginLua, &st_PluginLuaConfig)) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化Lua插件配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); + goto XENGINE_SERVICEAPP_EXIT; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化Lua插件配置文件成功")); + //启动插件 + if (!ModulePlugin_Loader_Init()) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化插件系统失败,错误:%lX"), ModulePlugin_GetLastError()); + goto XENGINE_SERVICEAPP_EXIT; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化插件系统成功,开始加载插件")); + //加载插件 list::const_iterator stl_ListIterator = st_PluginLibConfig.pStl_ListPlugin->begin(); for (int i = 1; stl_ListIterator != st_PluginLibConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++) { @@ -407,11 +439,8 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,加载Lib模块插件中,当前第:%d 个加载失败,因为没有启用,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile); } } - } - #if (1 == _XENGINE_BUILD_SWITCH_LUA) - { - list::const_iterator stl_ListIterator = st_PluginLuaConfig.pStl_ListPlugin->begin(); + 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) @@ -430,66 +459,82 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,加载Lua模块插件中,当前第:%d 个加载失败,因为没有启用,方法:%s,路径:%s"), i, stl_ListIterator->tszPluginMethod, stl_ListIterator->tszPluginFile); } } - } #else - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,加载Lua模块插件失败,因为LUA编译被关闭")); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,加载Lua模块插件失败,因为LUA编译被关闭")); #endif - //展示能力 - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,加载的Lib插件:%d 个,Lua插件:%d 个"), st_PluginLibConfig.pStl_ListPlugin->size(), st_PluginLuaConfig.pStl_ListPlugin->size()); - + //展示能力 + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,加载的Lib插件:%d 个,Lua插件:%d 个"), st_PluginLibConfig.pStl_ListPlugin->size(), st_PluginLuaConfig.pStl_ListPlugin->size()); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,插件系统被禁用")); + } + if (st_ServiceConfig.st_XAPIModule.bEnable) { if (!APIModule_IPAddr_Init(st_ServiceConfig.st_XAPIModule.tszDBIPAddr)) { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动IP地址数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBIPAddr, APIIPMac_GetLastError()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动IP地址数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBIPAddr, APIIPMac_GetLastError()); } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动IP地址数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBIPAddr); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动IP地址数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBIPAddr); if (!APIModule_MACInfo_Init(st_ServiceConfig.st_XAPIModule.tszDBMac)) { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动MAC地址数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBMac, APIIPMac_GetLastError()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动MAC地址数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBMac, APIIPMac_GetLastError()); } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动MAC地址数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBMac); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动MAC地址数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBMac); if (!APIModule_PhoneNumber_Init(st_ServiceConfig.st_XAPIModule.tszDBPhone)) { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动电话号码数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBPhone, APIPhone_GetLastError()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动电话号码数据查询服务:%s 失败,错误:%lX"), st_ServiceConfig.st_XAPIModule.tszDBPhone, APIPhone_GetLastError()); } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动电话号码数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBPhone); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动电话号码数据查询服务:%s 成功"), st_ServiceConfig.st_XAPIModule.tszDBPhone); } else { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,数据查询服务没有启用")); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,数据查询服务没有启用")); } //发送信息报告 - if (st_ServiceConfig.st_XReport.bEnable) + if (st_ServiceConfig.st_XReport.bEnable && !bIsTest) { 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); + 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()); + 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_WARN, _X("启动服务中,信息报告给API服务器没有启用")); } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,服务运行中,XEngine版本:%s%s,发行版本次数:%d,当前版本:%s。。。"), BaseLib_OperatorVer_XNumberStr(), BaseLib_OperatorVer_XTypeStr(), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str()); while (true) { + if (bIsTest) + { + nRet = 0; + break; + } std::this_thread::sleep_for(std::chrono::seconds(1)); } XENGINE_SERVICEAPP_EXIT: if (bIsRun) { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("有服务启动失败,服务器退出...")); + if (bIsTest && 0 == nRet) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("服务启动完毕,测试程序退出...")); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("有服务启动失败,服务器退出...")); + } bIsRun = false; //销毁HTTP资源 NetCore_TCPXCore_DestroyEx(xhHTTPSocket); @@ -523,6 +568,5 @@ XENGINE_SERVICEAPP_EXIT: #ifdef _MSC_BUILD WSACleanup(); #endif - getchar(); - return 0; + return nRet; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp index c3d8bb2bfe96503aad305c27c6119c5c72f08ad5..97478c5055d914977c752b6d0205e2b17a0577b0 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp @@ -31,7 +31,7 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nGLen = _tcsxlen(lpszMsgBuffer); BaseLib_OperatorCharset_AnsiToUTF(lpszMsgBuffer, tszUTFBuffer, &nGLen); #else - _tcsxscpy(tszUTFBuffer, lpszMsgBuffer, sizeof(tszUTFBuffer)); + _xstrcpy(tszUTFBuffer, lpszMsgBuffer, sizeof(tszUTFBuffer)); #endif int nRandomNumber = rand(); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp index 51ad3699d1bbe3a164adbe2e64136098f7cc1c0d..a4732370089eb38aff61756fc8557bd683543b37 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp @@ -7,16 +7,16 @@ static XNETHANDLE xhAudio = 0; static XNETHANDLE xhVideo = 0; static XHANDLE xhStream = NULL; -void CALLBACK HTTPTask_TaskPost_CBVideo(uint8_t* punStringY, int nYLen, uint8_t* punStringU, int nULen, uint8_t* punStringV, int nVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam) +void CALLBACK HTTPTask_TaskPost_CBVideo(uint8_t* ptszAVBuffer, int nAVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam) { - if (!XClient_StreamPush_LiveVideo(xhStream, punStringY, nYLen, punStringU, nULen, punStringV, nVLen)) + if (!XClient_StreamPush_LiveVideo(xhStream, ptszAVBuffer, nAVLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("屏幕采集器,推流编码失败,需要关闭推流服务,错误码:%lX"), StreamClient_GetLastError()); } } -void CALLBACK HTTPTask_TaskPost_CBAudio(uint8_t* punStringAudio, int nVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam) +void CALLBACK HTTPTask_TaskPost_CBAudio(uint8_t* ptszAVBuffer, int nAVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam) { - if (!XClient_StreamPush_LiveAudio(xhStream, punStringAudio, nVLen)) + if (!XClient_StreamPush_LiveAudio(xhStream, ptszAVBuffer, nAVLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("音频采集器,推流编码失败,需要关闭推流服务,错误码:%lX"), StreamClient_GetLastError()); } @@ -103,7 +103,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer { break; } - if ((ENUM_XCLIENT_APIHELP_FILE_STATUS_INIT != st_TaskInfo.en_DownStatus) || (ENUM_XCLIENT_APIHELP_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)) + if ((ENUM_XCLIENT_APIHELP_FILE_STATUS_INIT != st_TaskInfo.en_DownStatus) && (ENUM_XCLIENT_APIHELP_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)) { break; } @@ -309,7 +309,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer AVCollect_Audio_GetInfo(xhSound, &st_AVInfo); //音频编码参数 st_AVInfo.st_AudioInfo.enAVCodec = ENUM_XENGINE_AVCODEC_AUDIO_TYPE_AAC; - st_AVInfo.st_AudioInfo.nSampleFmt = ENUM_AVCOLLECT_AUDIO_SAMPLE_FMT_FLTP; + st_AVInfo.st_AudioInfo.nSampleFmt = ENUM_AVCODEC_AUDIO_SAMPLEFMT_FLTP; if (!AudioCodec_Stream_EnInit(&xhAudio, &st_AVInfo.st_AudioInfo)) { st_HDRParam.nHttpCode = 400; @@ -319,7 +319,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer return false; } int nLen = 0; - if (!AudioCodec_Stream_SetResample(xhAudio, &nLen, st_AVInfo.st_AudioInfo.nSampleRate, st_AVInfo.st_AudioInfo.nSampleRate, (ENUM_AVCOLLECT_AUDIOSAMPLEFORMAT)st_AVInfo.st_AudioInfo.nSampleFmt, ENUM_AVCOLLECT_AUDIO_SAMPLE_FMT_FLTP, st_AVInfo.st_AudioInfo.nChannel, st_AVInfo.st_AudioInfo.nChannel)) + if (!AudioCodec_Stream_SetResample(xhAudio, &nLen, st_AVInfo.st_AudioInfo.nSampleRate, st_AVInfo.st_AudioInfo.nSampleRate, (ENUM_AVCODEC_AUDIO_SAMPLEFMT)st_AVInfo.st_AudioInfo.nSampleFmt, ENUM_AVCODEC_AUDIO_SAMPLEFMT_FLTP, st_AVInfo.st_AudioInfo.nChannel, st_AVInfo.st_AudioInfo.nChannel)) { st_HDRParam.nHttpCode = 400; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp index 7a31bc2859971d9cfdfe30d0ad7a85bf82a1078d..cbab93bc7b058ae42699557a7e424f150a013148 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp @@ -20,13 +20,13 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int int nRVLen = 0; XCHAR tszHTTPKey[64]; XCHAR tszHTTPVlu[64]; - XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); - XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGINE_MEMORY_SIZE_MAX); + XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGINE_MEMORY_SIZE_MAX); memset(tszHTTPKey, '\0', sizeof(tszHTTPKey)); memset(tszHTTPVlu, '\0', sizeof(tszHTTPVlu)); - memset(ptszSDBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); - memset(ptszRVBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); + memset(ptszSDBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); + memset(ptszRVBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); BaseLib_OperatorString_GetKeyValue((*ppptszList)[1], "=", tszHTTPKey, tszHTTPVlu); int nOPCode = _ttxoi(tszHTTPVlu); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Machine.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Machine.cpp index 357597c69ed8dba12d57ea256034303b624a6127..726197e06e9426a916eabc43e0aa11b7f79efb5a 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Machine.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Machine.cpp @@ -42,7 +42,7 @@ bool HTTPTask_TastPost_Machine(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in { if (!ModuleDatabase_Machine_Insert(&st_MachineInfo)) { - ModuleProtocol_Packet_Common(tszRVBuffer, &nRVLen, 400, _X("update is failed")); + ModuleProtocol_Packet_Common(tszRVBuffer, &nRVLen, 400, _X("insert is failed")); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的信息收集操作插入失败,错误:%lX"), lpszClientAddr, ModuleDB_GetLastError()); @@ -69,7 +69,7 @@ bool HTTPTask_TastPost_Machine(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in ModuleProtocol_Packet_Common(tszRVBuffer, &nRVLen, 400, _X("query is failed")); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的信息收集操作插入失败,错误:%lX"), lpszClientAddr, ModuleDB_GetLastError()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取机器信息失败,错误:%lX"), lpszClientAddr, ModuleDB_GetLastError()); return false; } int nListCount = 1; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp index 48f57639fcb2eaf3dffd4f63beba706ae9d2e398..1f46882a741a5dbcbaf12b850d4ebd48a2547334 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp @@ -18,12 +18,12 @@ bool HTTPTask_TaskPost_QRCode(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int #else int nSDLen = 0; int nRVLen = 0; - XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); - XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGINE_MEMORY_SIZE_MAX); + XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGINE_MEMORY_SIZE_MAX); XENGINE_QRCODE st_QRCode; - memset(ptszSDBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); - memset(ptszRVBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); + memset(ptszSDBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); + memset(ptszRVBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); memset(&st_QRCode, '\0', sizeof(XENGINE_QRCODE)); //0创建,1解析 if (0 == nType)