diff --git a/.github/workflows/issue-translator.yml b/.github/workflows/issue-translator.yml new file mode 100644 index 0000000000000000000000000000000000000000..d9fdac8f597701b4b32e0b5fbd1031f395459ddd --- /dev/null +++ b/.github/workflows/issue-translator.yml @@ -0,0 +1,15 @@ +name: Issue Translator +on: + issue_comment: + types: [created] + issues: + types: [opened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: usthe/issues-translate-action@v2.7 + with: + IS_MODIFY_TITLE: false + CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. \ No newline at end of file diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml index ca9e8d25f2ce3c8f4cf56bb176a6d676a733d7b9..860d1e84b05a564dfa6552f74bb3f7b76c50b4b8 100644 --- a/.github/workflows/macbuild.yml +++ b/.github/workflows/macbuild.yml @@ -3,8 +3,10 @@ name: macos build workflows on: push: branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' permissions: contents: read @@ -15,6 +17,7 @@ jobs: matrix: include: - os: macos-13 + - os: macos-14 runs-on: ${{ matrix.os }} steps: @@ -34,24 +37,35 @@ jobs: 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 + - name: Set up Dependency x86_64 Environment + if: matrix.os == 'macos-13' run: | cd libxengine chmod 777 * ./XEngine_LINEnv.sh -i 3 - cd .. - #编译 + - name: Set up Dependency Arm64 Environment + if: matrix.os == 'macos-14' + run: | + cd libxengine + chmod 777 * + ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(git ls-remote --tags --sort="v:refname" https://github.com/libxengine/libxengine.git | awk '{print $2}' | sed 's/refs\/tags\///' | tail -n 1) + + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip + unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64 + cd XEngine_Mac_Arm64 + + sudo mkdir -p /usr/local/include + sudo mkdir -p /usr/local/lib + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \; + - name: make debug run: | cd XEngine_Source @@ -68,3 +82,16 @@ jobs: run: | cd XEngine_Release ./XEngine_APIServiceApp -t + + - name: Upload folder as artifact with mac x64 + if: matrix.os == 'macos-13' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-x86_64-Mac + path: XEngine_Release/ + - name: Upload folder as artifact with mac arm + if: matrix.os == 'macos-14' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-Arm64-Mac + path: XEngine_Release/ \ No newline at end of file diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 3e501e3c39af1b8ad6b6e252be16836b9838b849..cd5c4688715626b5b237add3317296c1074aacb6 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -3,8 +3,10 @@ name: windows build workflows on: push: branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' permissions: contents: read @@ -19,7 +21,8 @@ jobs: platform: [x86 ,x64] runs-on: windows-latest # 最新的 Windows 环境 - + env: + ACTIONS_STEP_DEBUG: true steps: # 检出您的主仓库代码 - name: Checkout main repository code @@ -63,22 +66,35 @@ jobs: ./vcpkg.exe integrate install shell: pwsh - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency x86_64 Environment + if: matrix.platform == 'x64' run: | 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 + echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh + - name: Set up Dependency x86_32 Environment + if: matrix.platform == 'x86' + run: | + $response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"} + $latest_tag = $response.tag_name + Write-Host "Latest Tag: $latest_tag" + + $url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip" + Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip" + Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force + + echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | 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@v2 + #编译 - name: Build Solution - run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:AdditionalOptions="/utf-8" + run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + #测试 - name: Conditional Step for x86 Release if: matrix.configuration == 'Release' && matrix.platform == 'x86' @@ -89,14 +105,26 @@ jobs: 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' + - name: Conditional Step for x64 Release + if: matrix.configuration == 'Release' && matrix.platform == 'x64' 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/ + cp -r XEngine_Source/x64/Release/*.dll XEngine_Release/ + cp -r XEngine_Source/x64/Release/*.exe XEngine_Release/ + cp -r XEngine_Source/VSCopy_x64.bat XEngine_Release/ cd XEngine_Release - ./VSCopy_x86.bat - ./XEngine_HttpApp.exe -t + ./VSCopy_x64.bat shell: pwsh + + - name: Upload folder as artifact with x86 + if: matrix.configuration == 'Release' && matrix.platform == 'x64' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-x86_32-Windows + path: XEngine_Release/ + + - name: Upload folder as artifact with x64 + if: matrix.configuration == 'Release' && matrix.platform == 'x64' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-x86_64-Windows + path: XEngine_Release/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000000000000000000000000000000000..408025fa84d4bb3151bbac563b49ccf86a3fa72d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,89 @@ +name: release packet + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # 检出代码并包含标签 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download ubuntubuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: ubuntubuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download macbuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: macbuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download msbuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: msbuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + + - name: Display structure of downloaded files + run: ls -al ./XRelease/ + + - name: Get current version and increment X + id: versioning + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "Latest tag: $latest_tag" + # 提取 X 的值并递增 + major=$(echo $latest_tag | cut -d '.' -f 1) + minor=$(echo $latest_tag | cut -d '.' -f 2) + patch=$(echo $latest_tag | cut -d '.' -f 3) + build=$(echo $latest_tag | cut -d '.' -f 4) + + new_minor=$((minor + 1)) + new_version="$major.$new_minor.$patch.$build" + echo "New version: $new_version" + echo "new_tag=$new_version" >> $GITHUB_OUTPUT + echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT + + - name: Create and push new tag + run: | + git tag ${{ steps.versioning.outputs.new_tag }} + git push origin ${{ steps.versioning.outputs.new_tag }} + + - name: Generate release notes + run: | + logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an" --no-merges) + release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/') + echo "$release_notes" + echo "$release_notes" > release_notes.txt + + - name: Release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + draft: false + prerelease: false + tag_name: ${{ steps.versioning.outputs.new_tag }} + name: XEngine_APIService ${{ steps.versioning.outputs.new_tag }} + body_path: release_notes.txt + files: ./XRelease/*.zip diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/ubuntubuild.yml similarity index 46% rename from .github/workflows/linuxbuild.yml rename to .github/workflows/ubuntubuild.yml index 2974703cd1fc80c14638c0f552cb0a41e47b926d..4b5fd4e33461b97b5c548652f14f954effeeaa9b 100644 --- a/.github/workflows/linuxbuild.yml +++ b/.github/workflows/ubuntubuild.yml @@ -3,8 +3,10 @@ name: ubuntu build workflows on: push: branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' permissions: contents: read @@ -17,7 +19,7 @@ jobs: matrix: include: - os: ubuntu-22.04 - #- os: ubuntu-24.04 + - os: ubuntu-24.04 runs-on: ${{ matrix.os }} steps: @@ -40,15 +42,33 @@ jobs: git submodule update - name: install library - run: sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev + run: | + sudo apt update -y + sudo apt upgrade -y + sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev libleptonica-dev libtesseract-dev -y # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency ubuntu24.04 Environment + if: matrix.os == 'ubuntu-24.04' run: | cd libxengine chmod 777 * sudo ./XEngine_LINEnv.sh -i 3 - cd .. + - name: Set up Dependency ubuntu22.04 Environment + if: matrix.os == 'ubuntu-22.04' + run: | + cd libxengine + chmod 777 * + sudo ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name) + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip + unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64 + cd XEngine_UBuntu_22.04_x86-64 + + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \; + sudo ldconfig #编译 - name: make run: | @@ -64,4 +84,17 @@ jobs: - name: test run: | cd XEngine_Release - ./XEngine_APIServiceApp -t \ No newline at end of file + ./XEngine_APIServiceApp -t + + - name: Upload folder as artifact with ubuntu22.04 + if: matrix.os == 'ubuntu-22.04' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-x86_64-Ubuntu-22.04 + path: XEngine_Release/ + - name: Upload folder as artifact with ubuntu24.04 + if: matrix.os == 'ubuntu-24.04' + uses: actions/upload-artifact@v4 + with: + name: XEngine_APIServiceApp-x86_64-Ubuntu-24.04 + path: XEngine_Release/ \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index 1b2b52acc77dc6eb76f6a3897e10ca1dbe6c1c8a..1768e83096230cd44d8c20d5d19bd0b6ae131ab8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,15 @@ +XEngine_APIService V3.8.0.1001 + +增加:OCR图片文本支持 +增加:OCR识别开关 +更新:匹配XENGINE V9版本 +修改:更多的ci发布支持 + +added:get image text support +added:enable support for image text +update:match xengine v9.x +modify:more ci release supports +====================================================================================== XEngine_APIService V3.7.0.1001 增加:windows的coredump支持 diff --git a/README.en.md b/README.en.md index 26252321b83117dc1585cc87bfdf453e1c732141..78b85a81ff0af7f1955471c45d8f322cb2480f10 100644 --- a/README.en.md +++ b/README.en.md @@ -15,8 +15,10 @@ The purpose of development and implementation based on libXEngine is a cross-pla and support plugin system,dll(so,dylib)module or lua script #### Why choose us - -Support privatization deployment, free, safe, open source, controllable +Support privatization deployment, free, safe, open source, controllable +Dozens of information queries are completely free and open source, while similar products are all charged for API counting. +Supports third-party interface data caching. It can save you the cost of other query information. +It allows you to save 90% of information service costs in a year. ## Software feature 1. permission verication @@ -55,11 +57,12 @@ Support privatization deployment, free, safe, open source, controllable 34. STUN NAT Protocol 35. NTP Time Sync Protocol 36. mac address vendor query +37. ORC Get TEXT With image ## install #### XEngine Evn -you must install XEngine,need V8.x or above,install XEngine can be refer to xengine Readme docment +you must install XEngine,need V9.x or above,install XEngine can be refer to xengine Readme docment GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -86,7 +89,7 @@ git submodule update #### Linux ubuntu:sudo apt install sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev centos:compile by self -use makefile compile,UBUNTU22.04 x64 or RockyLinux 9 x64 +use makefile compile,UBUNTU24.04 x64 or RockyLinux 9 x64 Run it on the terminal #### Macos @@ -129,20 +132,17 @@ information report You can refer to the project under XEngine_PluginModule to write the plugin The written plugin needs to be configured via JSON to be enabled -## Test Server -Address:app.xyry.org,Port:5501 - ## now task ## other problems You can refer to the document under the docment directory. It contains API protocol and service description. ## Test Service -Address:app.xyry.org,Port:5501 +Address:app.libxengine.com,Port:5501 #### example For more information please refer to the documentation id information query -api:http://app.xyry.org:5501/api?function=id¶ms1=511025198800000000 +api:http://app.libxengine.com:5501/api?function=id¶ms1=511025198800000000 ```json { "code":0, @@ -162,7 +162,7 @@ api:http://app.xyry.org:5501/api?function=id¶ms1=511025198800000000 } ``` bank card ver -api:http://app.xyry.org:5501/api?function=bank¶ms1=6214832830000000 +api:http://app.libxengine.com:5501/api?function=bank¶ms1=6214832830000000 ```json { "code":0, @@ -190,7 +190,7 @@ api:http://127.0.0.1:5501/api?function=translation&msg=中文翻译成英文&src } ``` Distributed Lock -Api:http://app.xyry.org:5501/api?function=lock¶ms1=1000154321¶ms2=1 +Api:http://app.libxengine.com:5501/api?function=lock¶ms1=1000154321¶ms2=1 ```json { "code":0, @@ -201,14 +201,14 @@ Api:http://app.xyry.org:5501/api?function=lock¶ms1=1000154321¶ms2=1 } ``` ZIPCode -Api:http://app.xyry.org:5501/api?function=zipcode¶ms1=0 +Api:http://app.libxengine.com:5501/api?function=zipcode¶ms1=0 ```json { "nZipCode":100010 } ``` Log -Api:http://app.xyry.org:5501/api?function=log¶ms1=1 +Api:http://app.libxengine.com:5501/api?function=log¶ms1=1 ```json { "tszTableName":"xengine", @@ -222,7 +222,7 @@ Api:http://app.xyry.org:5501/api?function=log¶ms1=1 } ``` Oil Query -API:http://app.xyry.org:5501/api?function=oil&addr=四川 +API:http://app.libxengine.com:5501/api?function=oil&addr=四川 ```json { "code": 0, diff --git a/README.md b/README.md index 678f34d4d5301899a1c85fd2b8b74179785dc417..56d119a1532e9fd724f806edd0992807ce966356 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,14 @@ c c++ interface api service 基于libXEngine开发并实现的一套简洁高性能跨平台接口服务 并且支持插件系统,dll(so,dylib)模块或者lua脚本 +## 注意 +编译发布版本将只在github上面发布. + #### 为什么选择我们 -支持私有化部署,免费,安全.开源,可控 +支持私有化部署,免费,安全.开源,可控 +几十种信息查询完全免费开源,而同类型产品全是收费API计数收费 +支持三方接口数据缓存.可以节约你的其他查询信息费用 +可以让你一年节约90%信息服务费用. ## 软件特性 1. 权限验证 @@ -54,11 +60,12 @@ c c++ interface api service 34. STUN NAT协议 35. NTP时间同步协议 36. 支持MAC地址厂商查询 +37. ORC图像文本提取 ## 安装教程 #### XEngine环境 -必须安装XEngine,版本需要V8.x或者以上版本,安装XEngine可以参考其Readme文档 +必须安装XEngine,版本需要V9.x或者以上版本,安装XEngine可以参考其Readme文档 GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -89,7 +96,7 @@ git clone https://gitee.com/xengine/XEngine_PhoneData.git XEngine_Source/XEngine #### Linux ubuntu:sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev centos:需要自己编译 -Linux使用Makefile编译,UBUNTU22.04 x64或者RockyLinux 9 x64 +Linux使用Makefile编译,UBUNTU24.04 x64或者RockyLinux 9 x64 在控制台运行 #### Macos @@ -142,12 +149,12 @@ make FLAGS=CleanAll 清理编译 你也可以观看视频教程来了解我们的代码框架情况:https://www.bilibili.com/video/BV13z421d7W8 ## 测试服务器 -地址:app.xyry.org,端口:5501 +地址:app.libxengine.com,端口:5501 #### 测试接口示例 更多内容请参考文档 身份证查询 -接口:http://app.xyry.org:5501/api?function=id¶ms1=511025198800000000 +接口:http://app.libxengine.com:5501/api?function=id¶ms1=511025198800000000 ```json { "code":0, @@ -167,7 +174,7 @@ make FLAGS=CleanAll 清理编译 } ``` 银行卡验证 -接口:http://app.xyry.org:5501/api?function=bank¶ms1=6214832830000000 +接口:http://app.libxengine.com:5501/api?function=bank¶ms1=6214832830000000 ```json { "code":0, @@ -195,7 +202,7 @@ make FLAGS=CleanAll 清理编译 } ``` 分布式锁 -接口:http://app.xyry.org:5501/api?function=lock¶ms1=1000154321¶ms2=1 +接口:http://app.libxengine.com:5501/api?function=lock¶ms1=1000154321¶ms2=1 ```json { "code":0, @@ -206,14 +213,14 @@ make FLAGS=CleanAll 清理编译 } ``` 行政邮编 -接口:http://app.xyry.org:5501/api?function=zipcode¶ms1=0 +接口:http://app.libxengine.com:5501/api?function=zipcode¶ms1=0 ```json { "nZipCode":100010 } ``` 日志操作 -接口:http://app.xyry.org:5501/api?function=log¶ms1=1 +接口:http://app.libxengine.com:5501/api?function=log¶ms1=1 ```json { "tszTableName":"xengine", @@ -227,7 +234,7 @@ make FLAGS=CleanAll 清理编译 } ``` 油价查询 -接口:http://app.xyry.org:5501/api?function=oil&addr=四川 +接口:http://app.libxengine.com:5501/api?function=oil&addr=四川 ```json { "code": 0, diff --git a/XEngine_APPClient/APPClient_BackExample/APPClient_BackExample.cpp b/XEngine_APPClient/APPClient_BackExample/APPClient_BackExample.cpp index 3e388d662e2493958b15ada5df4a717234499153..228e4f9c5b1c31eb74d688a2a92ed6ce5f1f54d0 100644 --- a/XEngine_APPClient/APPClient_BackExample/APPClient_BackExample.cpp +++ b/XEngine_APPClient/APPClient_BackExample/APPClient_BackExample.cpp @@ -40,7 +40,7 @@ int test_query() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp b/XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp index 3914bc4850dea491a4fd13eee485d9a49614ad7b..04ce86602525b8055359ea82f0e6b74c356b1509 100644 --- a/XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp +++ b/XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp @@ -37,7 +37,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_DTestExample/APPClient_DTestExample.cpp b/XEngine_APPClient/APPClient_DTestExample/APPClient_DTestExample.cpp index 65f27e545197dcfcd2f17bfe814db87afcbd43aa..6bc359230d22b2fc458f11b1d1b3223dd2d39a7d 100644 --- a/XEngine_APPClient/APPClient_DTestExample/APPClient_DTestExample.cpp +++ b/XEngine_APPClient/APPClient_DTestExample/APPClient_DTestExample.cpp @@ -37,7 +37,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_DeamonExample/APPClient_DeamonExample.cpp b/XEngine_APPClient/APPClient_DeamonExample/APPClient_DeamonExample.cpp index 88e83dc929707826cf569592e69deccec53d3a39..2cd417d60519ffaeb1b3041e89df2957d50ffa4d 100644 --- a/XEngine_APPClient/APPClient_DeamonExample/APPClient_DeamonExample.cpp +++ b/XEngine_APPClient/APPClient_DeamonExample/APPClient_DeamonExample.cpp @@ -43,7 +43,7 @@ int test_insert() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp b/XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp index f51ad930a8c6812289e44f8f30ce4fffbad114c9..b1c0c633ab1927db463eaca12e0881a42414ad9e 100644 --- a/XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp +++ b/XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp @@ -38,13 +38,13 @@ int main() } #ifdef _MSC_BUILD XCHAR tszGBKBuffer[1024] = {}; - BaseLib_OperatorCharset_UTFToAnsi(ptszMsgBuffer, tszGBKBuffer, &nLen); + BaseLib_Charset_UTFToAnsi(ptszMsgBuffer, tszGBKBuffer, &nLen); printf("接受到数据,大小:%d,内容:%s\n", nLen, tszGBKBuffer); #else printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp b/XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp index 0c6146a6a571c25ff1c4558366d4df7cc9fc6318..39e96b0a27403d0c68c7bff72f7f8c2730552e0c 100644 --- a/XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp +++ b/XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp @@ -39,9 +39,9 @@ int main() XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - BaseLib_OperatorCharset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen); + BaseLib_Charset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen); printf("接受到数据,大小:%d,内容:%s\n", nLen, tszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_ImageExample/APPClient_ImageExample.cpp b/XEngine_APPClient/APPClient_ImageExample/APPClient_ImageExample.cpp index 9a794e2574a7a914c7c17a45664033167dbfdcb9..787b714694f4eaf0ba32a3625fcc90cd1c0048fd 100644 --- a/XEngine_APPClient/APPClient_ImageExample/APPClient_ImageExample.cpp +++ b/XEngine_APPClient/APPClient_ImageExample/APPClient_ImageExample.cpp @@ -49,7 +49,7 @@ bool APPClient_ImageExample_GetAttr(LPCXSTR lpszMsgBuffer, int nMsgLen, int* pIn printf("json parse failed\n"); return false; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); Json::Value st_JsonBase = st_JsonRoot["st_BaseInfo"]; *pInt_Width = st_JsonBase["nWidth"].asInt(); @@ -85,7 +85,7 @@ int test_imgzoom() XCHAR tszAPIUrl[MAX_PATH] = {}; XCHAR tszFileExt[64] = {}; - BaseLib_OperatorString_GetFileAndPath(pptszListFile[i], NULL, NULL, NULL, tszFileExt); + BaseLib_String_GetFileAndPath(pptszListFile[i], NULL, NULL, NULL, tszFileExt); _xstprintf(tszAPIUrl, _X("http://127.0.0.1:5501/api?function=image&type=1&ext=%s&width=%d&height=%d"), tszFileExt, nWidth / 2, nHeight / 2); XCHAR* ptszMsgBuffer = NULL; @@ -100,7 +100,7 @@ int test_imgzoom() fwrite(ptszMsgBuffer, 1, nRet, pSt_File); fclose(pSt_File); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; } diff --git a/XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp b/XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp index 6f0124495a0acc8fd7dfc634862d93f26a44e163..dc35640561429ec1c7727e29d3be1cde8e69778a 100644 --- a/XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp +++ b/XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp @@ -37,7 +37,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp index 32a33cfcf846ceada89d7650c0a889d278174601..6b36951af4364e5d962c4a1462348ffebea69fb6 100644 --- a/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp +++ b/XEngine_APPClient/APPClient_LibPluginExample/APPClient_LibPluginExample.cpp @@ -35,7 +35,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); LPCXSTR lpszZodiacUrl = _X("http://127.0.0.1:5501/api?function=zodiac¶ms1=19880121"); if (!APIClient_Http_Request(_X("GET"), lpszZodiacUrl, NULL, NULL, &ptszMsgBuffer, &nLen)) @@ -44,7 +44,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); LPCXSTR lpszTimeUrl = _X("http://127.0.0.1:5501/api?function=timezone¶ms1=1¶ms2=1-20"); if (!APIClient_Http_Request(_X("GET"), lpszTimeUrl, NULL, NULL, &ptszMsgBuffer, &nLen)) @@ -53,7 +53,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); LPCXSTR lpszBmiUrl = _X("http://127.0.0.1:5501/api?function=bmindex¶ms1=1.78¶ms2=62"); if (!APIClient_Http_Request(_X("GET"), lpszBmiUrl, NULL, NULL, &ptszMsgBuffer, &nLen)) @@ -62,7 +62,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); #endif diff --git a/XEngine_APPClient/APPClient_LockExample/APPClient_LockExample.cpp b/XEngine_APPClient/APPClient_LockExample/APPClient_LockExample.cpp index 0e8f80d7058a292283def6c0e4e9b0a682315dcd..c6440331913d39f7059407a35ad58c446ffa5c13 100644 --- a/XEngine_APPClient/APPClient_LockExample/APPClient_LockExample.cpp +++ b/XEngine_APPClient/APPClient_LockExample/APPClient_LockExample.cpp @@ -36,7 +36,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); //打开读锁 LPCXSTR lpszReadUrl = _X("http://127.0.0.1:5501/api?function=lock¶ms1=1000106561¶ms2=3"); if (!APIClient_Http_Request(_X("GET"), lpszReadUrl, NULL, NULL, &ptszBuffer, &nLen)) @@ -45,7 +45,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); //打开写锁 LPCXSTR lpszWriteUrl = _X("http://127.0.0.1:5501/api?function=lock¶ms1=1000106561¶ms2=5"); if (!APIClient_Http_Request(_X("GET"), lpszWriteUrl, NULL, NULL, &ptszBuffer, &nLen)) @@ -54,7 +54,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); //释放读锁 LPCXSTR lpszUNReadUrl = _X("http://127.0.0.1:5501/api?function=lock¶ms1=1000106561¶ms2=4"); if (!APIClient_Http_Request(_X("GET"), lpszUNReadUrl, NULL, NULL, &ptszBuffer, &nLen)) @@ -63,7 +63,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); //打开解锁 if (!APIClient_Http_Request(_X("GET"), lpszWriteUrl, NULL, NULL, &ptszBuffer, &nLen)) { @@ -71,7 +71,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); //关闭 LPCXSTR lpszCloseUrl = _X("http://127.0.0.1:5501/api?function=lock¶ms1=1000106561¶ms2=2"); if (!APIClient_Http_Request(_X("GET"), lpszCloseUrl, NULL, NULL, &ptszBuffer, &nLen)) @@ -80,7 +80,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBuffer); #ifdef _MSC_BUILD WSACleanup(); #endif diff --git a/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp index f770506b0d6cee4c30c0637e38db1e3488ef3294..1e44cb18978fd78bf80a8bd4f8fe7155d8ecbf7f 100644 --- a/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp +++ b/XEngine_APPClient/APPClient_LuaPluginExample/APPClient_LuaPluginExample.cpp @@ -35,7 +35,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); getchar(); #ifdef _MSC_BUILD diff --git a/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp b/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp index ddd9d6cd583b4b997f6c757e29442eef6e8c1f60..3f9b45c86d42740bef09bc00f07be98716a060e0 100644 --- a/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp +++ b/XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp @@ -59,7 +59,7 @@ int test_insert() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -76,7 +76,7 @@ int test_list() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -100,7 +100,7 @@ int test_delete() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_OilQuery/APPClient_OilQuery.cpp b/XEngine_APPClient/APPClient_OilQuery/APPClient_OilQuery.cpp index c3e11e7abeb7e1907bbee6841c75946be73e5df7..a90dd6b03fc96e09a731d311dc6fda4124550a6f 100644 --- a/XEngine_APPClient/APPClient_OilQuery/APPClient_OilQuery.cpp +++ b/XEngine_APPClient/APPClient_OilQuery/APPClient_OilQuery.cpp @@ -38,7 +38,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_P2PExample/APPClient_P2PExample.cpp b/XEngine_APPClient/APPClient_P2PExample/APPClient_P2PExample.cpp index f9ba215c626a2fea7d8dbce9a882311a46c6f182..554e0bd3e87f117358c55a801fd885d1342fb594 100644 --- a/XEngine_APPClient/APPClient_P2PExample/APPClient_P2PExample.cpp +++ b/XEngine_APPClient/APPClient_P2PExample/APPClient_P2PExample.cpp @@ -46,7 +46,7 @@ BOOL APIHelp_NetWork_GetIPNet(XCHAR* ptszIPAddr) return FALSE; } memcpy(ptszIPAddr, ptszBody, nBLen - 1); - BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszBody); + BaseLib_Memory_FreeCStyle((VOID**)&ptszBody); return TRUE; } int APPClient_P2XPLogin() @@ -72,7 +72,7 @@ int APPClient_P2XPLogin() } //得到IP地址 strcpy(tszPrivateAddr, ppSt_APICard[0]->tszIPAddr); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_APICard, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_APICard, nListCount); st_JsonRoot["tszUserName"] = lpszUserName; st_JsonRoot["tszPrivateAddr"] = tszPrivateAddr; @@ -88,7 +88,7 @@ int APPClient_P2XPLogin() return -1; } printf("APPClient_P2XPLogin,&nMsgLen:%d,%s\n", nMsgLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -109,7 +109,7 @@ int APPClient_P2XPList() return -1; } printf("APPClient_P2XPList,&nMsgLen:%d,%s\n", nMsgLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -126,7 +126,7 @@ int APPClient_P2XPWan() return -1; } printf("APPClient_P2XPWan,&nMsgLen:%d,%s\n", nMsgLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -147,7 +147,7 @@ int APPClient_P2XPLogout() return -1; } printf("APPClient_P2XPLogout,&nMsgLen:%d,%s\n", nMsgLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_PhoneExample/APPClient_PhoneExample.cpp b/XEngine_APPClient/APPClient_PhoneExample/APPClient_PhoneExample.cpp index c74fbfe5ade5053069f0eb3903af86626898d3e3..005fc58b66eb2dfe7f2fed7ed2148a0cdab7cf47 100644 --- a/XEngine_APPClient/APPClient_PhoneExample/APPClient_PhoneExample.cpp +++ b/XEngine_APPClient/APPClient_PhoneExample/APPClient_PhoneExample.cpp @@ -37,7 +37,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_QRExample/APPClient_QRExample.cpp b/XEngine_APPClient/APPClient_QRExample/APPClient_QRExample.cpp index 649aed34329e9c481a75d1975a78f44eef7a71cb..d9987447e7191a62996ba8328db0aa92816f7569 100644 --- a/XEngine_APPClient/APPClient_QRExample/APPClient_QRExample.cpp +++ b/XEngine_APPClient/APPClient_QRExample/APPClient_QRExample.cpp @@ -49,7 +49,7 @@ int test_create() fclose(pSt_File); } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -73,7 +73,7 @@ int test_parse() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nRet, ptszBodyBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); } return 0; } diff --git a/XEngine_APPClient/APPClient_SLinkExample/APPClient_SLinkExample.cpp b/XEngine_APPClient/APPClient_SLinkExample/APPClient_SLinkExample.cpp index 29e047fecd6e8f97c3bf7dc73b41b20806367671..3187d07795c6621d2be240bc388b1366f24283c9 100644 --- a/XEngine_APPClient/APPClient_SLinkExample/APPClient_SLinkExample.cpp +++ b/XEngine_APPClient/APPClient_SLinkExample/APPClient_SLinkExample.cpp @@ -44,7 +44,7 @@ int test_create() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } int test_get() @@ -62,7 +62,7 @@ int test_get() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } int test_List() @@ -78,7 +78,7 @@ int test_List() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } int test_delete() @@ -96,7 +96,7 @@ int test_delete() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_SocketExample/APPClient_SocketExample.cpp b/XEngine_APPClient/APPClient_SocketExample/APPClient_SocketExample.cpp index 23b876fe2023023dfce19cb374870dd7a3996796..ea25df7c8566616c10efc350668b316b5a65bb1e 100644 --- a/XEngine_APPClient/APPClient_SocketExample/APPClient_SocketExample.cpp +++ b/XEngine_APPClient/APPClient_SocketExample/APPClient_SocketExample.cpp @@ -65,7 +65,7 @@ int test_create() { xhToken = st_JsonObject["xhToken"].asInt64(); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } int test_delete() @@ -85,7 +85,7 @@ int test_delete() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp b/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp index 6e3a86b5aee1e89d74aea6ba958fa76e61d2582e..4ea5f67450f5af1c306d25ae6e6a1a025da11f34 100644 --- a/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp +++ b/XEngine_APPClient/APPClient_TranslationExample/APPClient_TranslationExample.cpp @@ -36,7 +36,7 @@ int main() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp b/XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp index 46912fdf4b09f2db6ecc0d70cf6fe0ad8982bbeb..dbb17f24718feaf3b1f628a59791fa1ebebbb9bc 100644 --- a/XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp +++ b/XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp @@ -45,7 +45,7 @@ int test_insert() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -65,7 +65,7 @@ int test_query() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -82,7 +82,7 @@ int test_List() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -102,7 +102,7 @@ int test_delete() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_XLogExample/APPClient_XLogExample.cpp b/XEngine_APPClient/APPClient_XLogExample/APPClient_XLogExample.cpp index 355ca2e645d503df3fb0e83398fdd9da2d74f57f..beaa61b01fd06e02c7d400eba2fdcc9efe9c21e9 100644 --- a/XEngine_APPClient/APPClient_XLogExample/APPClient_XLogExample.cpp +++ b/XEngine_APPClient/APPClient_XLogExample/APPClient_XLogExample.cpp @@ -40,7 +40,7 @@ int test_create() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -72,7 +72,7 @@ int test_insert() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -94,7 +94,7 @@ int test_query() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -113,7 +113,7 @@ int test_list() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -133,7 +133,7 @@ int test_delete() return 0; } printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } diff --git a/XEngine_APPClient/APPClient_ZIPCodeExample/APPClient_ZIPCodeExample.cpp b/XEngine_APPClient/APPClient_ZIPCodeExample/APPClient_ZIPCodeExample.cpp index 7e7987c7224b9a8b3e43ca2aa140fd75b8c5f01f..cf1588ed736c87ced76118982c5d83a984c9bc13 100644 --- a/XEngine_APPClient/APPClient_ZIPCodeExample/APPClient_ZIPCodeExample.cpp +++ b/XEngine_APPClient/APPClient_ZIPCodeExample/APPClient_ZIPCodeExample.cpp @@ -45,12 +45,12 @@ int main() return 0; } #ifdef _MSC_BUILD - BaseLib_OperatorCharset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen); + BaseLib_Charset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen); printf("接受到数据,大小:%d,内容:%s\n", nLen, tszMsgBuffer); #else printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_Docment/Docment_en.docx b/XEngine_Docment/Docment_en.docx index 75e92e03486ffebabb7b0bc7452d7fab8e7017d5..1011bf837b82bf516d95469e9b8676737c06c89f 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 1cb180e86c1f3efc41d235317305b458a5cfc4e0..9b89f4f20dabc5b3fc57f32d217d8244766d040f 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 a4d044d82c17e466042a505f158ceedfb2605936..c5754d322d97cfee65a89a66e43184ab4d24ccff 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -25,10 +25,10 @@ }, "XSql":{ "bEnable":true, - "SQLAddr":"10.0.3.154", + "SQLAddr":"10.0.2.6", "SQLPort":3306, "SQLUser":"root", - "SQLPass":"123123" + "SQLPass":"123123aa" }, "XApi":{ "tszWeatherUrl":"https://restapi.amap.com/v3/weather/weatherInfo?city=%s&key=3239fc302d6480ce49973f4d1c59e5d8", @@ -50,6 +50,11 @@ "tszConfigHTTPMime":"./XEngine_Config/HttpMime.types", "tszConfigHTTPCode":"./XEngine_Config/HttpCode.types" }, + "XImageText":{ + "bEnable":false, + "tszImagePath":"./XEngine_Config/tessdata", + "tszImageLanguage":"chi_sim+eng" + }, "XShortLink":{ "tszHostUrl":"url.xyry.org", "nHTTPCode":301 diff --git a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json index 3198aa8826d361f6e7c5eb1ddf37a21210b3e1fe..282944b6f0013629ae4090b13b03caa5e1337e36 100644 --- a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json @@ -1,5 +1,6 @@ { "XVer":[ + "3.8.0.1001 Build20241230", "3.7.0.1001 Build20240927", "3.6.0.1001 Build20240705", "3.5.0.1001 Build20240510", diff --git a/XEngine_Release/XEngine_Coredump/.gitignore b/XEngine_Release/XEngine_Coredump/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/XEngine_Release/XEngine_Coredump/keepfile b/XEngine_Release/XEngine_Coredump/keepfile new file mode 100644 index 0000000000000000000000000000000000000000..34d1f899db0b5c21ea0e4edb07497ae84570da18 --- /dev/null +++ b/XEngine_Release/XEngine_Coredump/keepfile @@ -0,0 +1 @@ +keepfile \ No newline at end of file diff --git a/XEngine_Release/XEngine_LibPlugin/.gitignore b/XEngine_Release/XEngine_LibPlugin/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/XEngine_Release/XEngine_LibPlugin/keepfile b/XEngine_Release/XEngine_LibPlugin/keepfile new file mode 100644 index 0000000000000000000000000000000000000000..34d1f899db0b5c21ea0e4edb07497ae84570da18 --- /dev/null +++ b/XEngine_Release/XEngine_LibPlugin/keepfile @@ -0,0 +1 @@ +keepfile \ No newline at end of file diff --git a/XEngine_Release/XEngine_Log/.gitignore b/XEngine_Release/XEngine_Log/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/XEngine_Release/XEngine_Log/keepfile b/XEngine_Release/XEngine_Log/keepfile new file mode 100644 index 0000000000000000000000000000000000000000..34d1f899db0b5c21ea0e4edb07497ae84570da18 --- /dev/null +++ b/XEngine_Release/XEngine_Log/keepfile @@ -0,0 +1 @@ +keepfile \ No newline at end of file diff --git a/XEngine_Source/VSCopy_Debug.bat b/XEngine_Source/VSCopy_Debug.bat index 98b7e53be9b1afd2bde1e7c726dc1e3850c17f4d..6418e1afe17cd19cbdb7d345948080733e083d30 100644 --- a/XEngine_Source/VSCopy_Debug.bat +++ b/XEngine_Source/VSCopy_Debug.bat @@ -3,13 +3,15 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseSafe.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Algorithm.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Core.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./" -copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\Cryption.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Stream.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Socket.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_XSocket.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIAddr.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_DataBase.dll" "./" diff --git a/XEngine_Source/VSCopy_x64.bat b/XEngine_Source/VSCopy_x64.bat index c9fab9319c679409953d2f765c96fc9a5d6d682b..013bd93a611af39064378370866ce33697ce7790 100644 --- a/XEngine_Source/VSCopy_x64.bat +++ b/XEngine_Source/VSCopy_x64.bat @@ -3,13 +3,15 @@ copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Stream.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" diff --git a/XEngine_Source/VSCopy_x86.bat b/XEngine_Source/VSCopy_x86.bat index c44cb9cdc00d6ce36e4c711ddab77780831c1b0f..5434dcc3e4fc66c1dc1c2604002d0566796bbab4 100644 --- a/XEngine_Source/VSCopy_x86.bat +++ b/XEngine_Source/VSCopy_x86.bat @@ -3,13 +3,15 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Stream.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./" copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" diff --git a/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData b/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData index 6e49d4d9ce6cf9d0534c6c7c94edd62854f5f949..f06fc84a8c20e77e7a947ca8dd7eeca059416725 160000 --- a/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData +++ b/XEngine_Source/XEngine_DBDepend/XEngine_IPMacData @@ -1 +1 @@ -Subproject commit 6e49d4d9ce6cf9d0534c6c7c94edd62854f5f949 +Subproject commit f06fc84a8c20e77e7a947ca8dd7eeca059416725 diff --git a/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData b/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData index dd22d7298801812e61d9ce679f08df21f75611f6..f3353b8a2d2ef711be97e1730a88ef8cd11ec06e 160000 --- a/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData +++ b/XEngine_Source/XEngine_DBDepend/XEngine_PhoneData @@ -1 +1 @@ -Subproject commit dd22d7298801812e61d9ce679f08df21f75611f6 +Subproject commit f3353b8a2d2ef711be97e1730a88ef8cd11ec06e diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend index d1d1ee7952a0a93a1beb183a8dee281d9231ff3d..60eac0753192a4a66fc90b561d8fde4e5282e2d9 160000 --- a/XEngine_Source/XEngine_Depend +++ b/XEngine_Source/XEngine_Depend @@ -1 +1 @@ -Subproject commit d1d1ee7952a0a93a1beb183a8dee281d9231ff3d +Subproject commit 60eac0753192a4a66fc90b561d8fde4e5282e2d9 diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h index e70b6cb461074605ac831778dc75741151270abd..408443943792117749c81cc48815eb885390ef8f 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h @@ -80,6 +80,12 @@ typedef struct XCHAR tszHostUrl[MAX_PATH]; //主机地址 int nHTTPCode; //转发模式,301 永久,302 临时 }st_XShortLink; + struct + { + bool bEnable; //是否启用 + XCHAR tszImagePath[MAX_PATH]; //图片文字识别配置 + XCHAR tszImageLanguage[MAX_PATH]; //语言支持 + }st_XImageText; struct { bool bReload; //配置重载 diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h index b3f1c0c199a362b0da5b5f54a862bdee52ee7e91..d9b585e600d6d100dc232be76411f5992e91e0e8 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Error.h @@ -19,12 +19,13 @@ #define ERROR_MODULE_CONFIGURE_JSON_XDB 0xA0007 //数据库配置错误 #define ERROR_MODULE_CONFIGURE_JSON_XPLUGIN 0xA0008 //插件配置错误 #define ERROR_MODULE_CONFIGURE_JSON_XVER 0xA0009 //版本配置文件读取错误 -#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA000A //申请内存失败 -#define ERROR_MODULE_CONFIGURE_JSON_XAPI 0xA000B //API配置失败 -#define ERROR_MODULE_CONFIGURE_JSON_XCONFIG 0xA000C //配置文件配置加载失败 -#define ERROR_MODULE_CONFIGURE_JSON_XSLINK 0xA000D //短连接配置错误 -#define ERROR_MODULE_CONFIGURE_JSON_XVERICATION 0xA000E //验证配置错误 -#define ERROR_MODULE_CONFIGURE_JSON_XREPORT 0xA000F //报告配置错误 +#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA0010 //申请内存失败 +#define ERROR_MODULE_CONFIGURE_JSON_XAPI 0xA0011 //API配置失败 +#define ERROR_MODULE_CONFIGURE_JSON_XCONFIG 0xA0012 //配置文件配置加载失败 +#define ERROR_MODULE_CONFIGURE_JSON_XSLINK 0xA0013 //短连接配置错误 +#define ERROR_MODULE_CONFIGURE_JSON_XVERICATION 0xA0014 //验证配置错误 +#define ERROR_MODULE_CONFIGURE_JSON_XREPORT 0xA0015 //报告配置错误 +#define ERROR_MODULE_CONFIGURE_JSON_XIMAGETEXT 0xA0016 //图像文字识别配置错误 ////////////////////////////////////////////////////////////////////////// #define ERROR_MODULE_CONFIGURE_FILE_PARAMENT 0xA1001 //参数错误 #define ERROR_MODULE_CONFIGURE_FILE_OPENFILE 0xA1002 //打开文件失败 diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp index 9435d627c8ccc6a607a94078a6b77561627634a7..6fd1fa6ce5e6669cb6d590a16cc47bc85c14ffe6 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp @@ -186,6 +186,17 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE _tcsxcpy(pSt_ServerConfig->st_XShortLink.tszHostUrl, st_JsonXShort["tszHostUrl"].asCString()); pSt_ServerConfig->st_XShortLink.nHTTPCode = st_JsonXShort["nHTTPCode"].asInt(); + if (st_JsonRoot["XImageText"].empty() || (3 != st_JsonRoot["XImageText"].size())) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XIMAGETEXT; + return false; + } + Json::Value st_JsonXImageText = st_JsonRoot["XImageText"]; + pSt_ServerConfig->st_XImageText.bEnable = st_JsonXImageText["bEnable"].asBool(); + _tcsxcpy(pSt_ServerConfig->st_XImageText.tszImagePath, st_JsonXImageText["tszImagePath"].asCString()); + _tcsxcpy(pSt_ServerConfig->st_XImageText.tszImageLanguage, st_JsonXImageText["tszImageLanguage"].asCString()); + if (st_JsonRoot["XVerification"].empty() || (3 != st_JsonRoot["XVerification"].size())) { Config_IsErrorOccur = true; diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp index 8410224951463cbfb2118a5f042f59716a7051ae..78cdf06db27eca40e3032abb9c26e7bc7147810f 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp @@ -139,7 +139,7 @@ bool CModuleDatabase_IDCard::ModuleDatabase_IDCard_QueryByAddr(XENGINE_IDREGION* #ifdef _MSC_BUILD XCHAR tszUTFBuffer[1024] = {}; int nULen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFBuffer, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) @@ -167,7 +167,7 @@ bool CModuleDatabase_IDCard::ModuleDatabase_IDCard_QueryByAddr(XENGINE_IDREGION* #ifdef _MSC_BUILD XCHAR tszUTFBuffer[1024] = {}; int nULen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFBuffer, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) @@ -196,7 +196,7 @@ bool CModuleDatabase_IDCard::ModuleDatabase_IDCard_QueryByAddr(XENGINE_IDREGION* #ifdef _MSC_BUILD XCHAR tszUTFBuffer[1024] = {}; int nULen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFBuffer, &nULen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFBuffer, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_Machine/ModuleDatabase_Machine.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_Machine/ModuleDatabase_Machine.cpp index f3e9b413982382dbfd909babf4040e1fe05c2c54..248ded4181d22f5521dde1db748566bfe62de5a9 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_Machine/ModuleDatabase_Machine.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_Machine/ModuleDatabase_Machine.cpp @@ -99,7 +99,7 @@ bool CModuleDatabase_Machine::ModuleDatabase_Machine_Insert(XENGINE_MACHINEINFO* #ifdef _MSC_BUILD XCHAR tszUTFStr[4096] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFStr)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) @@ -315,7 +315,7 @@ bool CModuleDatabase_Machine::ModuleDatabase_Machine_List(XENGINE_MACHINEINFO*** return false; } *pInt_ListCount = (int)nllLine; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_MachineInfo, *pInt_ListCount, sizeof(XENGINE_MACHINEINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_MachineInfo, *pInt_ListCount, sizeof(XENGINE_MACHINEINFO)); for (__int64u i = 0; i < nllLine; i++) { XCHAR** pptszResult = DataBase_MySQL_GetResult(xhDBSQL, xhTable); diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_OilInfo/ModuleDatabase_OilInfo.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_OilInfo/ModuleDatabase_OilInfo.cpp index 8d7333208d943ed7818c34451ce104c012c50ced..b4c2ee8b2691efea094fe553dd82723ff89a9cb4 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_OilInfo/ModuleDatabase_OilInfo.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_OilInfo/ModuleDatabase_OilInfo.cpp @@ -104,7 +104,7 @@ bool CModuleDatabase_OilInfo::ModuleDatabase_OilInfo_Query(XENGINE_OILINFO* pSt_ #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFStr, &nllLine, &nllRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nllLine, &nllRow)) @@ -195,7 +195,7 @@ bool CModuleDatabase_OilInfo::ModuleDatabase_OilInfo_UPDate(XENGINE_OILINFO* pSt #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFStr)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ShortLink/ModuleDatabase_ShortLink.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ShortLink/ModuleDatabase_ShortLink.cpp index f4f5b67152c96a3aa8041f16d9610f81f466573d..9a75e4dc6af8cd8defbe5ad7d4156e1a1b52b85d 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ShortLink/ModuleDatabase_ShortLink.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ShortLink/ModuleDatabase_ShortLink.cpp @@ -267,7 +267,7 @@ bool CModuleDatabase_ShortLink::ModuleDatabase_ShortLink_List(XENGINE_SHORTLINK* return false; } *pInt_ListCount = (int)nllLine; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_SLinkInfo, *pInt_ListCount, sizeof(XENGINE_SHORTLINK)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_SLinkInfo, *pInt_ListCount, sizeof(XENGINE_SHORTLINK)); for (__int64u i = 0; i < nllLine; i++) { diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_WordFilter/ModuleDatabase_WordFilter.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_WordFilter/ModuleDatabase_WordFilter.cpp index 6c13d65e225633e18f67d468142005dbc85924d7..047f10cbebf6354fbd4f751a77d51c94dadc64a6 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_WordFilter/ModuleDatabase_WordFilter.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_WordFilter/ModuleDatabase_WordFilter.cpp @@ -103,7 +103,7 @@ bool CModuleDatabase_WordFilter::ModuleDatabase_WordFilter_Query(XENGINE_WORDFIL #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFStr, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) @@ -158,7 +158,7 @@ bool CModuleDatabase_WordFilter::ModuleDatabase_WordFilter_Insert(XENGINE_WORDFI #ifdef _MSC_BUILD int nRet = _tcsxlen(tszSQLStatement); XCHAR tszUTFStr[1024] = {}; - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nRet); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nRet); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFStr)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) @@ -200,7 +200,7 @@ bool CModuleDatabase_WordFilter::ModuleDatabase_WordFilter_Delete(XENGINE_WORDFI #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFStr)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) @@ -256,7 +256,7 @@ bool CModuleDatabase_WordFilter::ModuleDatabase_WordFilter_List(XENGINE_WORDFILT return false; } *pInt_ListCount = (int)nLine; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_WordFilter, *pInt_ListCount, sizeof(XENGINE_WORDFILTER)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_WordFilter, *pInt_ListCount, sizeof(XENGINE_WORDFILTER)); for (__int64u i = 0; i < nLine; i++) { diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_XLog/ModuleDatabase_XLog.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_XLog/ModuleDatabase_XLog.cpp index 19bbea00cc2b19987366bdc65db0789a33c164c5..39fd24762392c70e038121a262fb9035b76546ec 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_XLog/ModuleDatabase_XLog.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_XLog/ModuleDatabase_XLog.cpp @@ -109,7 +109,7 @@ bool CModuleDatabase_XLog::ModuleDatabase_XLog_Create(LPCXSTR lpszTableName) #ifdef _MSC_BUILD int nUTFLen = 0; XCHAR tszUTFQuery[4096] = {}; - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFQuery, &nUTFLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFQuery, &nUTFLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFQuery)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) @@ -152,7 +152,7 @@ bool CModuleDatabase_XLog::ModuleDatabase_XLog_Insert(XENGINE_XLOGINFO* pSt_XLog #ifdef _MSC_BUILD XCHAR tszUTFStr[10240] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFStr)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLStatement)) @@ -220,7 +220,7 @@ bool CModuleDatabase_XLog::ModuleDatabase_XLog_Query(XENGINE_XLOGINFO*** pppSt_X #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFStr, &nllLine, &nllRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nllLine, &nllRow)) @@ -237,7 +237,7 @@ bool CModuleDatabase_XLog::ModuleDatabase_XLog_Query(XENGINE_XLOGINFO*** pppSt_X return false; } *pInt_ListCount = (int)nllLine; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_XLogInfo, (int)nllLine, sizeof(XENGINE_XLOGINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_XLogInfo, (int)nllLine, sizeof(XENGINE_XLOGINFO)); for (__int64u i = 0; i < nllLine; i++) { XCHAR** pptszResult = DataBase_MySQL_GetResult(xhDBSQL, xhTable); @@ -350,7 +350,7 @@ bool CModuleDatabase_XLog::ModuleDatabase_XLog_Show(XCHAR*** ppptszList, int* pI return false; } *pInt_ListCount = (int)nllLine; - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszList, (int)nllLine, MAX_PATH); + BaseLib_Memory_Malloc((XPPPMEM)ppptszList, (int)nllLine, MAX_PATH); for (__int64u i = 0; i < nllLine; i++) { XCHAR** pptszResult = DataBase_MySQL_GetResult(xhDBSQL, xhTable); diff --git a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ZIPCode/ModuleDatabase_ZIPCode.cpp b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ZIPCode/ModuleDatabase_ZIPCode.cpp index cc832b1e66bf0ac197b589400de72e78dac6738f..6ee9a9c283bf0eab661123f05a113ea819898b10 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ZIPCode/ModuleDatabase_ZIPCode.cpp +++ b/XEngine_Source/XEngine_ModuleDatabase/ModuleDatabase_ZIPCode/ModuleDatabase_ZIPCode.cpp @@ -192,7 +192,7 @@ bool CModuleDatabase_ZIPCode::ModuleDatabase_ZIPCode_QueryName(XENGINE_ZIPINFO* #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszUTFStr, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) @@ -326,7 +326,7 @@ bool CModuleDatabase_ZIPCode::ModuleDatabase_ZIPCode_QueryParentByName(LPCXSTR l #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; int nSLen = _tcsxlen(tszSQLStatement); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); + BaseLib_Charset_AnsiToUTF(tszSQLStatement, tszUTFStr, &nSLen); if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) #else if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nLine, &nRow)) diff --git a/XEngine_Source/XEngine_ModuleDatabase/XEngine_ModuleDatabase.vcxproj b/XEngine_Source/XEngine_ModuleDatabase/XEngine_ModuleDatabase.vcxproj index b084fa6777147e93ec27650512f53f4a69446f19..ccce48d7bef09c576844deb1e8acae669ccc5079 100644 --- a/XEngine_Source/XEngine_ModuleDatabase/XEngine_ModuleDatabase.vcxproj +++ b/XEngine_Source/XEngine_ModuleDatabase/XEngine_ModuleDatabase.vcxproj @@ -82,7 +82,7 @@ true - $(XEngine_Include);$(IncludePath) + $(XEngine_Include);..\XEngine_ModuleDatabase;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) diff --git a/XEngine_Source/XEngine_ModuleHelp/Makefile b/XEngine_Source/XEngine_ModuleHelp/Makefile index 1570e6d7c1adca2a4cf6a161ac5fee0d70648122..0af0dce5db0d6d62a9b6ad4a8d1d92155692bbe1 100644 --- a/XEngine_Source/XEngine_ModuleHelp/Makefile +++ b/XEngine_Source/XEngine_ModuleHelp/Makefile @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -I /usr/include/opencv4 -I /usr/local/include/opencv4 -I /usr/local/include/lua LOADSO = -LIB = -lXEngine_BaseLib -lXClient_Socket +LIB = -lXEngine_BaseLib -lXClient_Socket -lNetHelp_APIAddr LIBEX = OBJECTS = ModuleHelp_IDCard.o ModuleHelp_Language.o ModuleHelp_P2PClient.o ModuleHelp_Locker.o ModuleHelp_QRCode.o ModuleHelp_SocketTest.o ModuleHelp_ImageGet.o ModuleHelp_ImageSet.o pch.o @@ -19,7 +19,7 @@ ifeq ($(MACRO_QR_SUPPORT),1) LIB += -lqrencode endif ifeq ($(MACRO_OPENCV_SUPPORT),1) - LIB += -llzma -lpng16 -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -ltiff -lopencv_wechat_qrcode + LIB += -llzma -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lopencv_wechat_qrcode -ltesseract -lleptonica endif ifeq ($(RELEASE),1) @@ -58,6 +58,8 @@ else ifeq ($(PLATFORM),mac) PLATVER = -D __MACOS__ PLATDIR = XEngine_Mac FILEEXT = dylib + LOADHDR += -I /opt/homebrew/opt/leptonica/include -I /opt/homebrew/opt/opencv/include/opencv4 -I /opt/homebrew/opt/tesseract/include -I /opt/homebrew/opt/qrencode/include + LOADSO += -L /opt/homebrew/opt/leptonica/lib -L /opt/homebrew/opt/opencv/lib -L /opt/homebrew/opt/tesseract/lib -L /opt/homebrew/opt/qrencode/lib LIBFLAG = -dynamiclib LIBEX = -lpthread -ldl LOADBIN = -Wl,-rpath,@loader_path/./ diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h index 3cd37d4932e48dad4596fa04a0a5b17a199cf3fc..730994e081ac89118bd05d07cf27daad06dd6a44 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h @@ -477,7 +477,7 @@ extern "C" bool ModuleHelp_P2PClient_Add(XENGINE_P2XP_PEERINFO * pSt_PeerInfo); 返回值 类型:逻辑型 意思:是否成功 -备注:参数二需要调用基础库的BaseLib_OperatorMemory_Free函数进行内存释放 +备注:参数二需要调用基础库的BaseLib_Memory_Free函数进行内存释放 *********************************************************************/ extern "C" bool ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCOL * pSt_P2PProtocol, XENGINE_P2XPPEER_PROTOCOL * **pppSt_P2XPClient, int* pInt_ListCount); /******************************************************************** @@ -501,7 +501,7 @@ extern "C" bool ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCOL * pSt_P2PP 返回值 类型:逻辑型 意思:是否成功 -备注:参数二需要调用基础库的BaseLib_OperatorMemory_Free函数进行内存释放 +备注:参数二需要调用基础库的BaseLib_Memory_Free函数进行内存释放 *********************************************************************/ extern "C" bool ModuleHelp_P2PClient_GetLList(LPCXSTR lpszPubAddr, XCHAR * **pppszP2XPClient, int* pInt_ListCount); /******************************************************************** @@ -956,6 +956,63 @@ extern "C" bool ModuleHelp_SocketTest_StopDatas(XNETHANDLE xhToken); *********************************************************************/ extern "C" bool ModuleHelp_ImageGet_Attr(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_IMGBASEATTR* pSt_BaseInfo = NULL, XENGINE_IMGEXTATTR* pSt_ExtAttr = NULL); /******************************************************************** +函数名称:ModuleHelp_ImageGet_TextInit +函数功能:初始化图像文字转换 + 参数.一:lpszPath + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入文本语言数据路径 + 参数.二:lpszLanguage + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入加载的语言数据.通过+连接 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool ModuleHelp_ImageGet_TextInit(LPCXSTR lpszPath, LPCXSTR lpszLanguage); +/******************************************************************** +函数名称:ModuleHelp_ImageGet_TextGet +函数功能:获取图像文本内容 + 参数.一:lpszMsgBuffer + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入图像内存 + 参数.二:nMsgLen + In/Out:In + 类型:整数型 + 可空:N + 意思:输入图像大小 + 参数.三:ppptszListStr + In/Out:Out + 类型:三级指针 + 可空:N + 意思:输出获取到的内容列表 + 参数.四:pInt_ListCount + In/Out:Out + 类型:整数型指针 + 可空:Y + 意思:输出列表个数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool ModuleHelp_ImageGet_TextGet(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR*** ppptszListStr, int* pInt_ListCount); +/******************************************************************** +函数名称:ModuleHelp_ImageGet_TextDestory +函数功能:销毁文本提取功能 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool ModuleHelp_ImageGet_TextDestory(); +/******************************************************************** 函数名称:ModuleHelp_ImageSet_Resolution 函数功能:分辨率调整 参数.一:lpszSrcFile diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Error.h b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Error.h index 6bdd937bc6bd3c7a5d91bc4f92129db2f958ec02..4b75530a2282a3a159fab1dc3b1bd1ad22525424 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Error.h +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Error.h @@ -65,4 +65,8 @@ #define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_OPEN 0xD6002 //打开文件失败 #define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_WRITE 0xD6003 //写入数据失败 #define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_MALLOC 0xD6004 //申请内存失败 -#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT 0xD6005 //功能没有启用无法继续 \ No newline at end of file +#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT 0xD6005 //功能没有启用无法继续 +#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_CRAETE 0xD6006 //创建句柄失败 +#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_INIT 0xD6007 //初始化失败 +#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_READ 0xD6008 //读取数据失败 +#define ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_GET 0xD6009 //获取数据失败 \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.cpp index c8b49ea112f34eb66a5b9891e756e23494743320..535f97ec5ed92d5f02afb4ef49ecc0c0443edf2e 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.cpp @@ -87,6 +87,171 @@ bool CModuleHelp_ImageGet::ModuleHelp_ImageGet_Attr(LPCXSTR lpszMsgBuffer, int n ModuleHelp_IsErrorOccur = true; ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT; return false; +#endif + return true; +} +/******************************************************************** +函数名称:ModuleHelp_ImageGet_TextInit +函数功能:初始化图像文字转换 + 参数.一:lpszPath + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入文本语言数据路径 + 参数.二:lpszLanguage + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入加载的语言数据.通过+连接 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CModuleHelp_ImageGet::ModuleHelp_ImageGet_TextInit(LPCXSTR lpszPath, LPCXSTR lpszLanguage) +{ + ModuleHelp_IsErrorOccur = false; + + if ((NULL == lpszPath) || (NULL == lpszLanguage)) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_PARAMRT; + return false; + } +#if _XENGINE_BUILD_SWITCH_OPENCV == 1 + // 初始化 Tesseract API + pSt_APITesseract = TessBaseAPICreate(); + if (NULL == pSt_APITesseract) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_CRAETE; + return false; + } + if (0 != TessBaseAPIInit3(pSt_APITesseract, lpszPath, lpszLanguage)) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_INIT; + TessBaseAPIDelete(pSt_APITesseract); + return false; + } +#else + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT; + return false; +#endif + return true; +} +/******************************************************************** +函数名称:ModuleHelp_ImageGet_TextGet +函数功能:获取图像文本内容 + 参数.一:lpszMsgBuffer + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:输入图像内存 + 参数.二:nMsgLen + In/Out:In + 类型:整数型 + 可空:N + 意思:输入图像大小 + 参数.三:ppptszListStr + In/Out:Out + 类型:三级指针 + 可空:N + 意思:输出获取到的内容列表 + 参数.四:pInt_ListCount + In/Out:Out + 类型:整数型指针 + 可空:Y + 意思:输出列表个数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CModuleHelp_ImageGet::ModuleHelp_ImageGet_TextGet(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR*** ppptszListStr, int* pInt_ListCount) +{ + ModuleHelp_IsErrorOccur = false; + + if (NULL == lpszMsgBuffer) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_PARAMRT; + return false; + } +#if _XENGINE_BUILD_SWITCH_OPENCV == 1 + // 加载图片 + Pix* pSt_PIXImage = pixReadMem((const l_uint8*)lpszMsgBuffer, nMsgLen); + if (NULL == pSt_PIXImage) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_READ; + return false; + } + // 设置图像到 Tesseract + TessBaseAPISetImage2(pSt_APITesseract, pSt_PIXImage); + + list stl_ListStr; + // 执行 OCR + char* ptszOStr = TessBaseAPIGetUTF8Text(pSt_APITesseract); + if (NULL == ptszOStr) + { + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_GET; + return false; + } + XCHAR tszUTFBuffer[8192] = {}; + _tcsxcpy(tszUTFBuffer, ptszOStr); + TessDeleteText(ptszOStr); + + XCHAR* ptszTmpStr = NULL; + XCHAR* ptszTokStr = _tcsxtok_s(tszUTFBuffer, _X("\n"), &ptszTmpStr); + while (NULL != ptszTokStr) + { + stl_ListStr.push_back(ptszTokStr); + ptszTokStr = _tcsxtok_s(NULL, _X("\n"), &ptszTmpStr); + } + + *pInt_ListCount = stl_ListStr.size(); + BaseLib_Memory_Malloc((XPPPMEM)ppptszListStr, *pInt_ListCount, MAX_PATH); + + auto stl_ListIterator = stl_ListStr.begin(); + for (int i = 0; stl_ListIterator != stl_ListStr.end(); i++, stl_ListIterator++) + { +#ifdef _MSC_BUILD + XCHAR tszGBKBuffer[2048] = {}; + _tcsxcpy((*ppptszListStr)[i], BaseLib_Charset_UTFToAnsi(stl_ListIterator->c_str(), tszGBKBuffer)); +#else + _tcsxcpy((*ppptszListStr)[i], stl_ListIterator->c_str()); +#endif + } + // 释放资源 + pixDestroy(&pSt_PIXImage); +#else + ModuleHelp_IsErrorOccur = true; + ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT; + return false; +#endif + return true; +} +/******************************************************************** +函数名称:ModuleHelp_ImageGet_TextDestory +函数功能:销毁文本提取功能 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CModuleHelp_ImageGet::ModuleHelp_ImageGet_TextDestory() +{ + ModuleHelp_IsErrorOccur = false; + +#if _XENGINE_BUILD_SWITCH_OPENCV == 1 + TessBaseAPIDelete(pSt_APITesseract); +#else +ModuleHelp_IsErrorOccur = true; +ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_IAMGE_NOTSUPPORT; +return false; #endif return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.h b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.h index d5f85ad63a733b2ebb791f2c421c53fc859e21d5..a1b19bba2c0f0e54f7897b03a34f571087b40935 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.h +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Image/ModuleHelp_ImageGet.h @@ -18,6 +18,13 @@ public: ~CModuleHelp_ImageGet(); public: bool ModuleHelp_ImageGet_Attr(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_IMGBASEATTR* pSt_BaseInfo = NULL, XENGINE_IMGEXTATTR* pSt_ExtAttr = NULL); +public: + bool ModuleHelp_ImageGet_TextInit(LPCXSTR lpszPath, LPCXSTR lpszLanguage); + bool ModuleHelp_ImageGet_TextGet(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR*** ppptszListStr, int* pInt_ListCount); + bool ModuleHelp_ImageGet_TextDestory(); protected: private: +#if _XENGINE_BUILD_SWITCH_OPENCV == 1 + TessBaseAPI* pSt_APITesseract = NULL; +#endif }; \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Locker/ModuleHelp_Locker.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Locker/ModuleHelp_Locker.cpp index 60e8a5ad66e4fff1af31708b5ed72a7a3400b795..aa2c7fe89487da95d863e6e8e4f6fddce44f9a04 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Locker/ModuleHelp_Locker.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Locker/ModuleHelp_Locker.cpp @@ -53,7 +53,7 @@ bool CModuleHelp_Locker::ModuleHelp_Locker_Create(XNETHANDLE* pxhToken) } pSt_LockInfo->enLockStatus = ENUM_MODULEHELP_LOCKSTATUS_NOTUSED; - BaseLib_OperatorHandle_Create(pxhToken); + BaseLib_Handle_Create(pxhToken); st_Locker.lock(); stl_MapLocker.insert(make_pair(*pxhToken, pSt_LockInfo)); diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_P2PClient/ModuleHelp_P2PClient.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_P2PClient/ModuleHelp_P2PClient.cpp index d358431438d25d8f21452e5bf758a2965e2d4cbb..4aadafba356b99ad116a9e7895aef1c18a4eaa90 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_P2PClient/ModuleHelp_P2PClient.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_P2PClient/ModuleHelp_P2PClient.cpp @@ -108,12 +108,12 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_Add(XENGINE_P2XP_PEERINFO* pSt_ unordered_map stl_MapPrivate; stl_MapPrivate.insert(make_pair(pSt_PeerInfo->st_PeerAddr.tszPrivateAddr, *pSt_PeerInfo)); //获取私有网络的路由地址 - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; XCHAR tszPrivateAddr[64]; memset(tszPrivateAddr, '\0', sizeof(tszPrivateAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); - if (!BaseLib_OperatorIPAddr_IsIPV4Addr(pSt_PeerInfo->st_PeerAddr.tszPrivateAddr, &st_LibAddr)) + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); + if (!APIAddr_IPAddr_IsIPV4Addr(pSt_PeerInfo->st_PeerAddr.tszPrivateAddr, &st_LibAddr)) { //没有内网地址不加入. ModuleHelp_IsErrorOccur = true; @@ -130,13 +130,13 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_Add(XENGINE_P2XP_PEERINFO* pSt_ else { //找到了这个公网的地址 - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; XCHAR tszPrivateAddr[64]; memset(tszPrivateAddr, '\0', sizeof(tszPrivateAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); //获取私有网络的路由地址 - if (!BaseLib_OperatorIPAddr_IsIPV4Addr(pSt_PeerInfo->st_PeerAddr.tszPrivateAddr, &st_LibAddr)) + if (!APIAddr_IPAddr_IsIPV4Addr(pSt_PeerInfo->st_PeerAddr.tszPrivateAddr, &st_LibAddr)) { //没有内网地址不加入. ModuleHelp_IsErrorOccur = true; @@ -189,7 +189,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_Add(XENGINE_P2XP_PEERINFO* pSt_ 返回值 类型:逻辑型 意思:是否成功 -备注:参数二需要调用基础库的BaseLib_OperatorMemory_Free函数进行内存释放 +备注:参数二需要调用基础库的BaseLib_Memory_Free函数进行内存释放 *********************************************************************/ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCOL* pSt_P2PProtocol, XENGINE_P2XPPEER_PROTOCOL*** pppSt_P2XPClient, int* pInt_ListCount) { @@ -211,13 +211,13 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCO st_Locker.unlock_shared(); return false; } - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; XCHAR tszPrivateAddr[64]; memset(tszPrivateAddr, '\0', sizeof(tszPrivateAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); //如果输入的是192.168.1.1 IP,就我们自己分割,否则认为输入的是 192.168.1 - if (BaseLib_OperatorIPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr)) + if (APIAddr_IPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr)) { _xstprintf(tszPrivateAddr, _X("%d.%d.%d"), st_LibAddr.nIPAddr1, st_LibAddr.nIPAddr2, st_LibAddr.nIPAddr3); unordered_map >::const_iterator stl_MapPriIterator = stl_MapPubIterator->second.find(tszPrivateAddr); @@ -235,7 +235,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCO st_Locker.unlock_shared(); return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_P2XPClient, stl_MapPriIterator->second.size(), sizeof(XENGINE_P2XPPEER_PROTOCOL)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_P2XPClient, stl_MapPriIterator->second.size(), sizeof(XENGINE_P2XPPEER_PROTOCOL)); unordered_map::const_iterator stl_MapConnIterator = stl_MapPriIterator->second.begin(); for (int i = 0; stl_MapConnIterator != stl_MapPriIterator->second.end(); stl_MapConnIterator++, i++) { @@ -260,7 +260,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCO st_Locker.unlock_shared(); return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_P2XPClient, stl_MapPriIterator->second.size(), sizeof(XENGINE_P2XPPEER_PROTOCOL)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_P2XPClient, stl_MapPriIterator->second.size(), sizeof(XENGINE_P2XPPEER_PROTOCOL)); unordered_map::const_iterator stl_MapConnIterator = stl_MapPriIterator->second.begin(); for (int i = 0; stl_MapConnIterator != stl_MapPriIterator->second.end(); stl_MapConnIterator++, i++) { @@ -292,7 +292,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLan(XENGINE_P2XPPEER_PROTOCO 返回值 类型:逻辑型 意思:是否成功 -备注:参数二需要调用基础库的BaseLib_OperatorMemory_Free函数进行内存释放 +备注:参数二需要调用基础库的BaseLib_Memory_Free函数进行内存释放 *********************************************************************/ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLList(LPCXSTR lpszPubAddr, XCHAR*** pppszP2XPClient, int* pInt_ListCount) { @@ -313,7 +313,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetLList(LPCXSTR lpszPubAddr, X st_Locker.unlock_shared(); return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppszP2XPClient, stl_MapPubIterator->second.size(), 128); + BaseLib_Memory_Malloc((XPPPMEM)pppszP2XPClient, stl_MapPubIterator->second.size(), 128); unordered_map >::const_iterator stl_MapPriIterator = stl_MapPubIterator->second.begin(); for (int i = 0; stl_MapPriIterator != stl_MapPubIterator->second.end(); stl_MapPriIterator++, i++) { @@ -357,7 +357,7 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_GetWList(XCHAR*** pppszP2XPClie ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_P2P_NOTFOUND; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppszP2XPClient, stl_MapClients.size(), 128); + BaseLib_Memory_Malloc((XPPPMEM)pppszP2XPClient, stl_MapClients.size(), 128); st_Locker.lock_shared(); unordered_map > >::const_iterator stl_MapIterator = stl_MapClients.begin(); @@ -389,12 +389,12 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_Delete(XENGINE_P2XPPEER_PROTOCO unordered_map > >::iterator stl_MapPubIteartor = stl_MapClients.find(pSt_P2PProtocol->tszPublicAddr); if (stl_MapPubIteartor != stl_MapClients.end()) { - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; XCHAR tszPrivateAddr[64]; memset(tszPrivateAddr, '\0', sizeof(tszPrivateAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); - if (BaseLib_OperatorIPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr)) + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); + if (APIAddr_IPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr)) { _xstprintf(tszPrivateAddr, _X("%d.%d.%d"), st_LibAddr.nIPAddr1, st_LibAddr.nIPAddr2, st_LibAddr.nIPAddr3); //查找私有路由地址 @@ -474,13 +474,13 @@ bool CModuleHelp_P2PClient::ModuleHelp_P2PClient_Heart(XENGINE_P2XPPEER_PROTOCOL return false; } //转换地址 - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; XCHAR tszPrivateAddr[64]; memset(tszPrivateAddr, '\0', sizeof(tszPrivateAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); //获取私有网络的路由地址 - BaseLib_OperatorIPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr); + APIAddr_IPAddr_IsIPV4Addr(pSt_P2PProtocol->tszPrivateAddr, &st_LibAddr); _xstprintf(tszPrivateAddr, _X("%d.%d.%d"), st_LibAddr.nIPAddr1, st_LibAddr.nIPAddr2, st_LibAddr.nIPAddr3); unordered_map >::iterator stl_MapPriIterator = stl_MapPubIterator->second.find(tszPrivateAddr); diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_SocketTest/ModuleHelp_SocketTest.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_SocketTest/ModuleHelp_SocketTest.cpp index b25e0ce66513e4b4d33ce62982ddb418cf1a8ae8..aa7aa51e59c1322a92ca366c0a5efc917f69fe9e 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_SocketTest/ModuleHelp_SocketTest.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_SocketTest/ModuleHelp_SocketTest.cpp @@ -70,7 +70,7 @@ bool CModuleHelp_SocketTest::ModuleHelp_SocketTest_StartConnect(XNETHANDLE* pxhT pSt_ConnSocket->bIsRun = true; pSt_ConnSocket->lParam = lParam; pSt_ConnSocket->lpCall_ReConnect = fpCall_ReConnect; - BaseLib_OperatorHandle_Create(&pSt_ConnSocket->xhToken); + BaseLib_Handle_Create(&pSt_ConnSocket->xhToken); memcpy(&pSt_ConnSocket->st_SocketConn, pSt_ReConnect, sizeof(MODULEHELP_SOCKETTEST_RECONNECT)); //创建线程 pSt_ConnSocket->pSTDThread = make_shared(ModuleHelp_SocketTest_ThreadConn, pSt_ConnSocket); @@ -208,7 +208,7 @@ bool CModuleHelp_SocketTest::ModuleHelp_SocketTest_StartDatas(XNETHANDLE* pxhTok pSt_DataSocket->bIsTCP = bTCP; pSt_DataSocket->lParam = lParam; pSt_DataSocket->lpCall_TestDatas = fpCall_DataTest; - BaseLib_OperatorHandle_Create(&pSt_DataSocket->xhToken); + BaseLib_Handle_Create(&pSt_DataSocket->xhToken); memcpy(&pSt_DataSocket->st_SocketData, pSt_SocketDatas, sizeof(MODULEHELP_SOCKETTEST_DATAS)); //创建客户端 if (pSt_DataSocket->bIsTCP) diff --git a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def index 03a2402f4dbc71f5aec6f323974c210b65a2b9ca..20cfafefff3c581f250d54e77e370ebb72149c9f 100644 --- a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def +++ b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def @@ -39,6 +39,9 @@ EXPORTS ModuleHelp_SocketTest_StopDatas ModuleHelp_ImageGet_Attr + ModuleHelp_ImageGet_TextInit + ModuleHelp_ImageGet_TextGet + ModuleHelp_ImageGet_TextDestory ModuleHelp_ImageSet_Resolution ModuleHelp_ImageSet_Flip ModuleHelp_ImageSet_ColorCvt diff --git a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj index 3545aa0e55e57ab07df0c8b3c6373724408bb0ae..abd7751de6a2fabed137bee71e2e8a81cf6007c0 100644 --- a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj +++ b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj @@ -72,24 +72,27 @@ true - $(XEngine_Include);$(IncludePath) + $(XEngine_Include);$(vcpkgroot)\installed\x86-windows\include\opencv4;..\XEngine_ModuleHelp;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) false - $(XEngine_Include);../XEngine_ThirdPart/opencc/include;$(IncludePath) + $(XEngine_Include);$(vcpkgroot)\installed\x86-windows\include\opencv4;$(IncludePath) $(XEngine_Lib32);$(LibraryPath) true - $(XEngine_Include);../XEngine_ThirdPart/opencc/include;$(IncludePath) + $(XEngine_Include);..\XEngine_ModuleHelp;$(vcpkgroot)\installed\x64-windows\include\opencv4;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) false - $(XEngine_Include);../XEngine_ThirdPart/opencc/include;$(IncludePath) + $(XEngine_Include);$(vcpkgroot)\installed\x64-windows\include\opencv4;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + false + Level3 diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.cpp b/XEngine_Source/XEngine_ModuleHelp/pch.cpp index db02eb97cf3575a61db446547df40918842327f2..7f13afa50fc53b89cf518b78f8015c833856d508 100644 --- a/XEngine_Source/XEngine_ModuleHelp/pch.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/pch.cpp @@ -181,6 +181,18 @@ extern "C" bool ModuleHelp_ImageGet_Attr(LPCXSTR lpszMsgBuffer, int nMsgLen, XEN { return m_ImageGet.ModuleHelp_ImageGet_Attr(lpszMsgBuffer, nMsgLen, pSt_BaseInfo, pSt_ExtAttr); } +extern "C" bool ModuleHelp_ImageGet_TextInit(LPCXSTR lpszPath, LPCXSTR lpszLanguage) +{ + return m_ImageGet.ModuleHelp_ImageGet_TextInit(lpszPath, lpszLanguage); +} +extern "C" bool ModuleHelp_ImageGet_TextGet(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR*** ppptszListStr, int* pInt_ListCount) +{ + return m_ImageGet.ModuleHelp_ImageGet_TextGet(lpszMsgBuffer, nMsgLen, ppptszListStr, pInt_ListCount); +} +extern "C" bool ModuleHelp_ImageGet_TextDestory() +{ + return m_ImageGet.ModuleHelp_ImageGet_TextDestory(); +} extern "C" bool ModuleHelp_ImageSet_Resolution(LPCXSTR lpszSrcBuffer, int nSLen, LPCXSTR lpszExtFile, XCHAR * ptszDstBuffer, int* pInt_DLen, int nWidth, int nHeight) { return m_ImageSet.ModuleHelp_ImageSet_Resolution(lpszSrcBuffer, nSLen, lpszExtFile, ptszDstBuffer, pInt_DLen, nWidth, nHeight); diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.h b/XEngine_Source/XEngine_ModuleHelp/pch.h index af6de126f72fa518f4186f6c77e46627601900be..c90076ffba50f9d8ab6290ceaed8c2973f6b8b0d 100644 --- a/XEngine_Source/XEngine_ModuleHelp/pch.h +++ b/XEngine_Source/XEngine_ModuleHelp/pch.h @@ -26,9 +26,21 @@ #include #include #if _XENGINE_BUILD_SWITCH_OPENCV == 1 +#ifdef _MSC_BUILD +#include +#include +#include +#else +#include +#include +#include #include #include #include +#include +#endif +#include +#include #include #endif using namespace std; @@ -39,6 +51,8 @@ using namespace std; #include #include #include +#include +#include #include "../XEngine_UserProtocol.h" #include "ModuleHelp_Define.h" #include "ModuleHelp_Error.h" @@ -59,6 +73,7 @@ extern XLONG ModuleHelp_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") #pragma comment(lib,"XEngine_Client/XClient_Socket") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr") #else #if __linux__ && !__ANDROID__ #pragma GCC diagnostic ignored "-Wclass-memaccess" diff --git a/XEngine_Source/XEngine_ModulePlugin/Makefile b/XEngine_Source/XEngine_ModulePlugin/Makefile index 532aab631714e7efbabab0d296d1ff67196685f0..cba68255fa82400c44f3675a97ba0d745e902750 100644 --- a/XEngine_Source/XEngine_ModulePlugin/Makefile +++ b/XEngine_Source/XEngine_ModulePlugin/Makefile @@ -54,6 +54,10 @@ else ifeq ($(PLATFORM),mac) PLATDIR = XEngine_Mac FILEEXT = dylib LIBFLAG = -dynamiclib + + LOADHDR += -I /opt/homebrew/opt/lua/include/lua + LOADSO += -L /opt/homebrew/opt/lua/lib + ifeq ($(MACRO_LUA_SUPPORT),1) LIB += -llua endif diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp index 2920199620526bb833ddfaf861ded38155063658..f0cffcc0487d6352623e4d88b165d4e4312e074e 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LibCore/ModulePlugin_LibCore.cpp @@ -70,7 +70,7 @@ bool CModulePlugin_LibCore::ModulePlugin_LibCore_Push(XNETHANDLE* pxhModule, LPC { ModulePlugin_IsErrorOccur = false; - if (!BaseLib_OperatorHandle_Create(pxhModule)) + if (!BaseLib_Handle_Create(pxhModule)) { ModulePlugin_IsErrorOccur = true; ModulePlugin_dwErrorCode = BaseLib_GetLastError(); diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp index 6f43e4924f644b1da0ff35402af69ac7d349df42..c2b559967d2eb59e6890dc1f4c91cb7b9702c761 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp @@ -60,7 +60,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Push(XNETHANDLE* pxhModule, LPC { ModulePlugin_IsErrorOccur = false; - if (!BaseLib_OperatorHandle_Create(pxhModule)) + if (!BaseLib_Handle_Create(pxhModule)) { ModulePlugin_IsErrorOccur = true; ModulePlugin_dwErrorCode = BaseLib_GetLastError(); diff --git a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj index f08d5e33b29cfd7651313949d06faa7e3fec396a..c89bdd76466549771c44985d8c550dac74e6db8d 100644 --- a/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj +++ b/XEngine_Source/XEngine_ModulePlugin/XEngine_ModulePlugin.vcxproj @@ -82,7 +82,7 @@ true - $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath) + $(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;..\XEngine_ModulePlugin;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) diff --git a/XEngine_Source/XEngine_ModuleProtocol/Makefile b/XEngine_Source/XEngine_ModuleProtocol/Makefile index 093904b3c9d44f58f3ffae719f527fb4f1f8db59..117800626d320edd8f3fb75efb6333b557b9ccc1 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 -lXEngine_SystemApi -ljsoncpp +LIB = -lXEngine_BaseLib -lNetHelp_XSocket -lXEngine_SystemApi -lNetHelp_APIAddr -ljsoncpp LIBEX = OBJECTS = ModuleProtocol_Packet.o ModuleProtocol_Parse.o pch.o diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h index 1594466b1603532eed968e40c351bdc14d63d362..b90400ff9296194dfebe4de779f2caa7c0349b48 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h @@ -627,6 +627,35 @@ extern "C" bool ModuleProtocol_Packet_WordFilterList(XCHAR* ptszMsgBuffer, int* *********************************************************************/ extern "C" bool ModuleProtocol_Packet_ImageAttr(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_IMGBASEATTR* pSt_BaseInfo, XENGINE_IMGEXTATTR* pSt_ExtAttr); /******************************************************************** +函数名称:ModuleProtocol_Packet_ImageText +函数功能:图片文本识别打包 + 参数.一:ptszMsgBuffer + In/Out:Out + 类型:字符指针 + 可空:N + 意思:输出打包的数据信息 + 参数.二:pInt_MsgLen + In/Out:Out + 类型:整数型指针 + 可空:N + 意思:输出打包大小 + 参数.三:pppListStr + In/Out:In + 类型:三级指针 + 可空:N + 意思:输入要打包的文本列表 + 参数.四:nListCount + In/Out:In + 类型:三级指针 + 可空:N + 意思:输入要列表个数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool ModuleProtocol_Packet_ImageText(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** pppListStr, int nListCount); +/******************************************************************** 函数名称:ModuleProtocol_Packet_EnumDevice 函数功能:打包枚举的设备信息 参数.一:ptszMsgBuffer diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp index ea78512d2c061fd6608addf5e3818f064f85c0fc..7d628f2bd0f5ad7ba18f9b3ae3097561b05e5e54 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp @@ -1093,6 +1093,65 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_ImageAttr(XCHAR* ptszMsgBuffe return true; } /******************************************************************** +函数名称:ModuleProtocol_Packet_ImageText +函数功能:图片文本识别打包 + 参数.一:ptszMsgBuffer + In/Out:Out + 类型:字符指针 + 可空:N + 意思:输出打包的数据信息 + 参数.二:pInt_MsgLen + In/Out:Out + 类型:整数型指针 + 可空:N + 意思:输出打包大小 + 参数.三:pppListStr + In/Out:In + 类型:三级指针 + 可空:N + 意思:输入要打包的文本列表 + 参数.四:nListCount + In/Out:In + 类型:三级指针 + 可空:N + 意思:输入要列表个数 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CModuleProtocol_Packet::ModuleProtocol_Packet_ImageText(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** pppListStr, int nListCount) +{ + ModuleProtocol_IsErrorOccur = false; + + if ((NULL == ptszMsgBuffer) || (NULL == pInt_MsgLen)) + { + ModuleProtocol_IsErrorOccur = true; + ModuleProtocol_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PROTOCOL_PACKET_PARAMENT; + return false; + } + Json::Value st_JsonRoot; + Json::Value st_JsonArray; + Json::StreamWriterBuilder st_JsonBuilder; + + for (int i = 0; i < nListCount; i++) + { + Json::Value st_JsonObject; + st_JsonObject["TextStr"] = (*pppListStr)[i]; + st_JsonArray.append(st_JsonObject); + } + st_JsonRoot["Count"] = nListCount; + st_JsonRoot["data"] = st_JsonArray; + st_JsonRoot["code"] = 0; + st_JsonRoot["msg"] = "success"; + st_JsonBuilder["emitUTF8"] = true; + + *pInt_MsgLen = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); + memcpy(ptszMsgBuffer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_MsgLen); + + return true; +} +/******************************************************************** 函数名称:ModuleProtocol_Packet_EnumDevice 函数功能:打包枚举的设备信息 参数.一:ptszMsgBuffer @@ -1287,7 +1346,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_HardWare(XCHAR* ptszHWInfo, i ModuleProtocol_dwErrorCode = SystemApi_GetLastError(); return false; } - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszRootName, nDiskNumber); + BaseLib_Memory_Free((XPPPMEM)&pptszRootName, nDiskNumber); XCHAR tszDriveStr[MAX_PATH]; memset(tszDriveStr, '\0', MAX_PATH); @@ -1342,15 +1401,15 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_HardWare(XCHAR* ptszHWInfo, i st_JsonDisk["DiskTotal"] = (Json::UInt64)st_DiskInfo.dwDiskTotal; st_JsonDisk["DiskName"] = tszDriveStr; - st_JsonCpu["CpuNumber"] = st_CPUInfo.nCpuNumber; - st_JsonCpu["CpuSpeed"] = st_CPUInfo.nCpuSpeed; - st_JsonCpu["CpuName"] = st_CPUInfo.tszCpuName; + st_JsonCpu["CpuNumber"] = st_CPUInfo.nCPUNumber; + st_JsonCpu["CpuSpeed"] = st_CPUInfo.nCPUSpeed; + st_JsonCpu["CpuName"] = st_CPUInfo.tszCPUName; st_JsonMemory["MemoryFree"] = (Json::UInt64)st_MemoryInfo.dwMemory_Free; st_JsonMemory["MemoryTotal"] = (Json::UInt64)st_MemoryInfo.dwMemory_Total; st_JsonSerial["DiskSerial"] = st_SDKSerial.tszDiskSerial; - st_JsonSerial["CpuSerial"] = st_SDKSerial.tszCpuSerial; + st_JsonSerial["CpuSerial"] = st_SDKSerial.tszCPUSerial; st_JsonSerial["BoardSerial"] = st_SDKSerial.tszBoardSerial; st_JsonSerial["SystemSerial"] = st_SDKSerial.tszSystemSerial; @@ -1367,7 +1426,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_HardWare(XCHAR* ptszHWInfo, i st_JsonIPAddr["tszMacAddr"] = ppSt_ListIFInfo[i]->tszMacAddr; st_JsonNetCard.append(st_JsonIPAddr); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListIFInfo, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListIFInfo, nListCount); st_JsonRoot["Disk"] = st_JsonDisk; st_JsonRoot["Cpu"] = st_JsonCpu; @@ -1705,7 +1764,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_IPAddr(XCHAR* ptszMSGBuffer, st_JsonBuilder["emitUTF8"] = true; *pInt_MSGLen = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); - BaseLib_OperatorCharset_AnsiToUTF(Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), ptszMSGBuffer, pInt_MSGLen); + BaseLib_Charset_AnsiToUTF(Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), ptszMSGBuffer, pInt_MSGLen); return true; } /******************************************************************** @@ -1854,14 +1913,14 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_P2PWLan(XCHAR* ptszMsgBuffer, for (auto stl_ListIterator = pStl_ListClients->begin(); stl_ListIterator != pStl_ListClients->end(); stl_ListIterator++) { XCHAR tszClientAddr[128]; - XENGINE_LIBADDR st_LibAddr; + APIADDR_IPADDR st_LibAddr; P2XPPROTOCOL_LANPACKET st_LANPacket; memset(tszClientAddr, '\0', sizeof(tszClientAddr)); - memset(&st_LibAddr, '\0', sizeof(XENGINE_LIBADDR)); + memset(&st_LibAddr, '\0', sizeof(APIADDR_IPADDR)); memset(&st_LANPacket, '\0', sizeof(P2XPPROTOCOL_LANPACKET)); //分割 - BaseLib_OperatorIPAddr_IsIPV4Addr(stl_ListIterator->tszPrivateAddr, &st_LibAddr); + APIAddr_IPAddr_IsIPV4Addr(stl_ListIterator->tszPrivateAddr, &st_LibAddr); _xstprintf(tszClientAddr, _X("%d.%d.%d"), st_LibAddr.nIPAddr1, st_LibAddr.nIPAddr2, st_LibAddr.nIPAddr3); //赋值 _tcsxcpy(st_LANPacket.tszUsername, stl_ListIterator->tszUserName); diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.h b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.h index 4648633e70728b90df224b4378a8b757464c118b..fbbd1b8f9edd5c63fb7ad31c73039b4244faf26f 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.h +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.h @@ -39,6 +39,7 @@ public: bool ModuleProtocol_Packet_WordFilter(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_WORDFILTER* pSt_WordFilter); bool ModuleProtocol_Packet_WordFilterList(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_WORDFILTER*** pppSt_WordFilter, int nListCount); bool ModuleProtocol_Packet_ImageAttr(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_IMGBASEATTR* pSt_BaseInfo, XENGINE_IMGEXTATTR* pSt_ExtAttr); + bool ModuleProtocol_Packet_ImageText(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** pppListStr, int nListCount); bool ModuleProtocol_Packet_EnumDevice(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AVHELP_DEVICEINFO*** pppSt_AudioList, AVHELP_DEVICEINFO*** pppSt_VideoList, int nACount, int nVCount); bool ModuleProtocol_Packet_ListFile(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** pppszFileList, int nListCount); bool ModuleProtocol_Packet_HardWare(XCHAR* ptszHWInfo, int* pInt_Len); diff --git a/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.def b/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.def index 67bb233d2bb317d3d33009319ad3d355d3a3bb22..acc4d276a7dc20afb8b7be537e4aaae69f5db23a 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.def +++ b/XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.def @@ -20,6 +20,7 @@ EXPORTS ModuleProtocol_Packet_WordFilter ModuleProtocol_Packet_WordFilterList ModuleProtocol_Packet_ImageAttr + ModuleProtocol_Packet_ImageText ModuleProtocol_Packet_EnumDevice ModuleProtocol_Packet_ListFile ModuleProtocol_Packet_HardWare diff --git a/XEngine_Source/XEngine_ModuleProtocol/pch.cpp b/XEngine_Source/XEngine_ModuleProtocol/pch.cpp index 51e480b1118f9ede6a5fc82c7e29f4e5a566eeae..e4b3536f5e4ecb1875c7935d54c6a81f2bf49545 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/pch.cpp +++ b/XEngine_Source/XEngine_ModuleProtocol/pch.cpp @@ -99,6 +99,10 @@ extern "C" bool ModuleProtocol_Packet_ImageAttr(XCHAR * ptszMsgBuffer, int* pInt { return m_ProtocolPacket.ModuleProtocol_Packet_ImageAttr(ptszMsgBuffer, pInt_MsgLen, pSt_BaseInfo, pSt_ExtAttr); } +extern "C" bool ModuleProtocol_Packet_ImageText(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** pppListStr, int nListCount) +{ + return m_ProtocolPacket.ModuleProtocol_Packet_ImageText(ptszMsgBuffer, pInt_MsgLen, pppListStr, nListCount); +} extern "C" bool ModuleProtocol_Packet_EnumDevice(XCHAR * ptszMsgBuffer, int* pInt_MsgLen, AVHELP_DEVICEINFO * **pppSt_AudioList, AVHELP_DEVICEINFO * **pppSt_VideoList, int nACount, int nVCount) { return m_ProtocolPacket.ModuleProtocol_Packet_EnumDevice(ptszMsgBuffer, pInt_MsgLen, pppSt_AudioList, pppSt_VideoList, nACount, nVCount); diff --git a/XEngine_Source/XEngine_ModuleProtocol/pch.h b/XEngine_Source/XEngine_ModuleProtocol/pch.h index 9db03cf01802fc13a5ad0ceb262f36078caa8996..9766353a75ec27b3c43e3763bb92ea2ffcd7edbe 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/pch.h +++ b/XEngine_Source/XEngine_ModuleProtocol/pch.h @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include #include @@ -58,6 +60,7 @@ extern XLONG ModuleProtocol_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") #pragma comment(lib,"XEngine_NetHelp/NetHelp_XSocket") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi") #ifdef _DEBUG #ifdef _WIN64 diff --git a/XEngine_Source/XEngine_ModuleSystem/ModuleSystem_API/ModuleSystem_API.cpp b/XEngine_Source/XEngine_ModuleSystem/ModuleSystem_API/ModuleSystem_API.cpp index c4ea5a9e007cdef5a9597866c0d9e7332ca5cf59..b19e91af6e457d7c2e006fe613388243545ed3cd 100644 --- a/XEngine_Source/XEngine_ModuleSystem/ModuleSystem_API/ModuleSystem_API.cpp +++ b/XEngine_Source/XEngine_ModuleSystem/ModuleSystem_API/ModuleSystem_API.cpp @@ -93,7 +93,7 @@ bool CModuleSystem_API::ModuleSystem_API_AutoStart(bool bIsAuto /* = true */) return false; } _tcsxcat(tszAFile, _X("\\XEngine_DeamonApp.lnk")); - BaseLib_OperatorCharset_AnsiToUnicode(tszAFile, tszUFile); + BaseLib_Charset_AnsiToUnicode(tszAFile, tszUFile); hResult = pSt_IFile->Save(tszUFile, TRUE); if (FAILED(hResult)) diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp index 53826306ece1454a98a46a638fff4daac023ab14..accc630da53960af54b5c61efdaf46b3dd9477d6 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_BMIndex/Plugin_BMIndex/Plugin_BMIndex.cpp @@ -77,8 +77,8 @@ bool CPlugin_BMIndex::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* memset(tszParamHigh, '\0', sizeof(tszParamHigh)); memset(tszParamWeight, '\0', sizeof(tszParamWeight)); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamHigh); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamWeight); + BaseLib_String_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamHigh); + BaseLib_String_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamWeight); Plugin_Timezone_BMIndex(tszParamHigh, tszParamWeight, ptszMsgBuffer, pInt_MsgLen); *pInt_HTTPCode = 200; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp index c652dee737551dc267a2fa4a83ad5183dd84aaa8..d1de5b8d74e4a0a120032392705782038783198c 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Meter/Plugin_Meter/Plugin_Meter.cpp @@ -84,9 +84,9 @@ bool CPlugin_Meter::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* pI memset(tszParamValue, '\0', sizeof(tszParamValue)); //http://192.168.1.8:5501/api?function=meter&type=0&source=0&value=10 - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamSource); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[3], "=", tszKeyName, tszParamValue); + BaseLib_String_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); + BaseLib_String_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamSource); + BaseLib_String_GetKeyValue((*pppHDRList)[3], "=", tszKeyName, tszParamValue); if (0 == _ttxoi(tszParamType)) { diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp index ca43367ca469083e2bc327fa02875b85c506c2c7..41c95317cc438cab9e821d52e3a3ce0e4125d0cf 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Password/Plugin_Password/Plugin_Password.cpp @@ -82,8 +82,8 @@ bool CPlugin_Password::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* memset(tszParamLength, '\0', sizeof(tszParamLength)); memset(tszPassword, '\0', sizeof(tszPassword)); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamLength); + BaseLib_String_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); + BaseLib_String_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamLength); Plugin_Password_Creator(tszParamType, tszParamLength, tszPassword); st_JsonObject["tszParamType"] = tszParamType; @@ -113,7 +113,7 @@ bool CPlugin_Password::Plugin_Password_Creator(LPCXSTR lpszPassType, LPCXSTR lps memset(tszPassBuffer, '\0', MAX_PATH); if (0 == nType) { - BaseLib_OperatorHandle_CreateStr(tszPassBuffer, nLen); + BaseLib_Handle_CreateStr(tszPassBuffer, nLen); } else if (1 == nType) { diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp index 7a5506668667af6e7bdaec3313e20dfa90f77c12..35a6ed19d83a3205f30c922d36f196f89f9105b0 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Timezone/Plugin_Timezone/Plugin_Timezone.cpp @@ -541,7 +541,7 @@ bool CPlugin_Timezone::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* memset(tszParamCvt, '\0', sizeof(tszParamCvt)); memset(tszParamTime, '\0', sizeof(tszParamTime)); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); + BaseLib_String_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamType); if (0 == _ttxoi(tszParamType)) { //如果是统计 @@ -550,14 +550,14 @@ bool CPlugin_Timezone::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* else if (1 == _ttxoi(tszParamType)) { //如果是列举 - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); + BaseLib_String_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); Plugin_Timezone_List(tszParamCvt, ptszMsgBuffer, pInt_MsgLen); } else if (2 == _ttxoi(tszParamType)) { //如果是转换 - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[3], "=", tszKeyName, tszParamTime); + BaseLib_String_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamCvt); + BaseLib_String_GetKeyValue((*pppHDRList)[3], "=", tszKeyName, tszParamTime); if (!Plugin_Timezone_Convert(tszParamCvt, tszParamTime, ptszMsgBuffer, pInt_MsgLen)) { *pInt_HTTPCode = 404; @@ -648,7 +648,7 @@ bool CPlugin_Timezone::Plugin_Timezone_Convert(LPCXSTR lpszConvert, LPCXSTR lpsz st_TimeEnd = stl_MapIterator->second.st_TimeZone; _stxscanf(lpszTimeStr, _X("%04d-%02d-%02d_%02d:%02d:%02d"), &st_TimeStart.wYear, &st_TimeStart.wMonth, &st_TimeStart.wDay, &st_TimeStart.wHour, &st_TimeStart.wMinute, &st_TimeStart.wSecond); - BaseLib_OperatorTimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); + BaseLib_TimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); _xstprintf(tszTimeStr, _X("%04d-%02d-%02d %02d:%02d:%02d"), st_TimeEnd.wYear, st_TimeEnd.wMonth, st_TimeEnd.wDay, st_TimeEnd.wHour, st_TimeEnd.wMinute, st_TimeEnd.wSecond); st_JsonObject["tszTimeStr"] = tszTimeStr; diff --git a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp index b6294d372b22b35ca020b1102342d7143287b844..a9b9ab57a3325a8a85417f8db36ce49799147cbd 100644 --- a/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp +++ b/XEngine_Source/XEngine_PluginModule/ModulePlugin_Zodiac/Plugin_Zodiac/Plugin_Zodiac.cpp @@ -94,7 +94,7 @@ bool CPlugin_Zodiac::PluginCore_Call(XCHAR*** pppHDRList, int nListCount, int* p memset(tszChineseZodiac, '\0', sizeof(tszChineseZodiac)); memset(tszEnglishZodiac, '\0', sizeof(tszEnglishZodiac)); - BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszValueName); + BaseLib_String_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszValueName); Plugin_Zodiac_Chinese(tszValueName, tszChineseZodiac); Plugin_Zodiac_English(tszValueName, tszEnglishZodiac); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile index c71ec2d703d076229eaeaa797c3701294db80c2a..85dbe2903def2df39669de22f37317f9f4ef81d4 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile @@ -10,7 +10,7 @@ LOADHDR = -I ./ LOADSO = -L ../../XEngine_ModuleConfigure -L ../../XEngine_ModuleDatabase -L ../../XEngine_ModuleProtocol -L ../../XEngine_ModuleSystem -L ../../XEngine_ModuleHelp -L ../../XEngine_ModulePlugin \ -L ../../XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Depend/XEngine_Module/XEngine_InfoReport \ -L ../../XEngine_DBDepend/XEngine_IPMacData/XEngine_Source/XEngine_APIModuleIPMac -L ../../XEngine_DBDepend/XEngine_PhoneData/Source/C/XEngine_APIModulePhone -LIB = -lXEngine_BaseSafe -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lXClient_Stream -lXClient_APIHelp -lHelpComponents_XLog -lRfcComponents_HttpProtocol -lRfcComponents_NatProtocol -lRfcComponents_NTPProtocol -lXEngine_ProcFile -lXEngine_SystemApi -lXEngine_AVHelp -lXEngine_VideoCodec -lXEngine_AudioCodec -lXEngine_AVCollect \ +LIB = -lXEngine_BaseSafe -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_Cryption -lXClient_Stream -lXClient_APIHelp -lNetHelp_APIAddr -lHelpComponents_XLog -lRfcComponents_HttpProtocol -lRfcComponents_NatProtocol -lRfcComponents_NTPProtocol -lXEngine_ProcFile -lXEngine_SystemApi -lXEngine_AVHelp -lXEngine_VideoCodec -lXEngine_AudioCodec -lXEngine_AVCollect \ -lXEngine_ModuleConfigure -lXEngine_ModuleDatabase -lXEngine_ModuleProtocol -lXEngine_ModuleSystem -lXEngine_ModuleHelp -lXEngine_ModulePlugin \ -ljsoncpp -lXEngine_InfoReport \ -lXEngine_APIModuleIPMac -lXEngine_APIModulePhone diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp index 3579a2ba9379c0d90c51d4dfb97f78b9caf49c34..1948a8f23c39e48390edbd53f5122591371d6e3d 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp @@ -41,12 +41,12 @@ bool XEngine_Configure_Parament(int argc, char** argv) } else if (0 == _tcsxcmp("-d", argv[i])) { - st_ServiceConfig.bDeamon = _ttxoi(argv[i + 1]); + st_ServiceConfig.bDeamon = _ttxoi(argv[++i]); } else if (0 == _tcsxcmp("-r", argv[i])) { st_ServiceConfig.st_XReload.bReload = true; - st_ServiceConfig.st_XReload.byCode = _ttxoi(argv[i + 1]); + st_ServiceConfig.st_XReload.byCode = _ttxoi(argv[++i]); } else if (0 == _tcsxcmp("-t", argv[i])) { diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp index 718868d1c55931a4aae4d922e038c33de00b46fc..652266d2e0da34ffa95b7f8eac4c4c5a881cbfef 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp @@ -46,12 +46,12 @@ XHTHREAD CALLBACK HTTPTask_TastPost_Thread(XPVOID lParam) //在另外一个函数里面处理数据 HTTPTask_TastPost_Handle(&st_HTTPReqparam, ppSst_ListAddr[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &pptszListHdr, nHDRCount); //释放内存 - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszListHdr, nHDRCount); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_Free((XPPPMEM)&pptszListHdr, nHDRCount); } } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSst_ListAddr, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSst_ListAddr, nListCount); } return 0; } @@ -77,10 +77,10 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszUrlBuffer[MAX_PATH] = {}; XCHAR tszGBKBuffer[MAX_PATH] = {}; - OPenSsl_Codec_UrlDeCodec(pSt_HTTPParam->tszHttpUri, _tcsxlen(pSt_HTTPParam->tszHttpUri), tszUrlBuffer); + Cryption_Codec_UrlDeCodec(pSt_HTTPParam->tszHttpUri, _tcsxlen(pSt_HTTPParam->tszHttpUri), tszUrlBuffer); #ifdef _MSC_BUILD int nCLen = _tcsxlen(tszUrlBuffer); - BaseLib_OperatorCharset_UTFToAnsi(tszUrlBuffer, tszGBKBuffer, &nCLen); + BaseLib_Charset_UTFToAnsi(tszUrlBuffer, tszGBKBuffer, &nCLen); #else _tcsxcpy(tszGBKBuffer, pSt_HTTPParam->tszHttpUri); #endif @@ -96,7 +96,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -139,18 +139,18 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } //获得函数名 - BaseLib_OperatorString_GetKeyValue(pptszList[0], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[0], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamFuncKey, tszKey, _tcsxlen(lpszParamFuncKey))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -168,13 +168,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //是不是P2P memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -185,13 +185,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //邮政信息:http://app.xyry.org:5501/api?function=zipcode¶ms1=0 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -202,13 +202,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //日志信息:http://app.xyry.org:5501/api?function=log¶ms1=0 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -219,13 +219,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //二维码生成:http://app.xyry.org:5501/api?function=qrcode¶ms1=0 或者 1 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -236,13 +236,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //网络测试:http://app.xyry.org:5501/api?function=socket¶ms1=0 或者 1 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -253,13 +253,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //数据测试:http://app.xyry.org:5501/api?function=dtest¶ms1=0 或者 1 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -271,7 +271,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszType[64]; memset(tszType, '\0', sizeof(tszType)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszType); HTTPTask_TaskPost_ShortLink(lpszClientAddr, lpszRVBuffer, nRVLen, _ttxoi(tszType)); } else if (0 == _tcsxnicmp(lpszParamWordFilter, tszValue, _tcsxlen(lpszParamWordFilter))) @@ -280,7 +280,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszType[64]; memset(tszType, '\0', sizeof(tszType)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszType); HTTPTask_TastPost_WordFilter(lpszClientAddr, lpszRVBuffer, nRVLen, _ttxoi(tszType)); } else if (0 == _tcsxnicmp(lpszParamBack, tszValue, _tcsxlen(lpszParamBack))) @@ -289,7 +289,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszType[64]; memset(tszType, '\0', sizeof(tszType)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszType); HTTPTask_TaskPost_BackService(lpszClientAddr, lpszRVBuffer, nRVLen, _ttxoi(tszType)); } else if (0 == _tcsxnicmp(lpszParamImage, tszValue, _tcsxlen(lpszParamImage))) @@ -308,7 +308,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszType[64]; memset(tszType, '\0', sizeof(tszType)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszType); HTTPTask_TastPost_Machine(lpszClientAddr, lpszRVBuffer, nRVLen, _ttxoi(tszType)); } else @@ -325,7 +325,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST { //是不是配置重载 memset(tszKey, '\0', sizeof(tszKey)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); HTTPTask_TaskGet_Reload(lpszClientAddr, tszValue); } else if (0 == _tcsxnicmp(lpszParamIDCard, tszValue, _tcsxlen(lpszParamIDCard))) @@ -333,13 +333,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //是不是身份证查询 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -350,13 +350,13 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //是不是银行卡信息 memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) { st_HDRParam.nHttpCode = 404; HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, tszGBKBuffer); return false; } @@ -369,9 +369,9 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszSrcBuffer[64] = {}; XCHAR tszDstBuffer[64] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszMSGBuffer); - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszSrcBuffer); - BaseLib_OperatorString_GetKeyValue(pptszList[3], "=", tszKey, tszDstBuffer); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszMSGBuffer); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszSrcBuffer); + BaseLib_String_GetKeyValue(pptszList[3], "=", tszKey, tszDstBuffer); HTTPTask_TaskGet_Translation(lpszClientAddr, tszMSGBuffer, tszSrcBuffer, tszDstBuffer); } else if (0 == _tcsxnicmp(lpszParamLocker, tszValue, _tcsxlen(lpszParamLocker))) @@ -384,8 +384,8 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST memset(tszLockToken, '\0', sizeof(tszLockToken)); memset(tszLockType, '\0', sizeof(tszLockType)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszLockToken); - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszLockType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszLockToken); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszLockType); HTTPTask_TaskGet_Locker(lpszClientAddr, _ttxoll(tszLockToken), (ENUM_XENGINE_APISERVICE_LOCKER_TYPE)_ttxoi(tszLockType)); } else if (0 == _tcsxnicmp(lpszParamWeather, tszValue, _tcsxlen(lpszParamWeather))) @@ -393,7 +393,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //天气:http://127.0.0.1:5501/api?function=weather¶ms1=110101 XCHAR tszIDAddr[128] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszIDAddr); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszIDAddr); HTTPTask_TaskGet_WeatherInfo(lpszClientAddr, tszIDAddr); } else if (0 == _tcsxnicmp(lpszParamRegion, tszValue, _tcsxlen(lpszParamRegion))) @@ -402,12 +402,12 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST int nType = 0; memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); nType = _ttxoi(tszValue); if (0 == nType) { memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszValue); HTTPTask_TaskGet_IDRegion(lpszClientAddr, nType, tszValue, NULL, NULL); } else @@ -415,15 +415,15 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST if (2 == nListCount) { XCHAR tszProvincerStr[32] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); HTTPTask_TaskGet_IDRegion(lpszClientAddr, nType, tszProvincerStr, NULL, NULL); } else if (3 == nListCount) { XCHAR tszProvincerStr[32] = {}; XCHAR tszCityStr[32] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); - BaseLib_OperatorString_GetKeyValue(pptszList[3], "=", tszKey, tszCityStr); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); + BaseLib_String_GetKeyValue(pptszList[3], "=", tszKey, tszCityStr); HTTPTask_TaskGet_IDRegion(lpszClientAddr, nType, tszProvincerStr, tszCityStr, NULL); } @@ -432,9 +432,9 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST XCHAR tszProvincerStr[32] = {}; XCHAR tszCityStr[32] = {}; XCHAR tszCountyStr[32] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); - BaseLib_OperatorString_GetKeyValue(pptszList[3], "=", tszKey, tszCityStr); - BaseLib_OperatorString_GetKeyValue(pptszList[4], "=", tszKey, tszCountyStr); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszKey, tszProvincerStr); + BaseLib_String_GetKeyValue(pptszList[3], "=", tszKey, tszCityStr); + BaseLib_String_GetKeyValue(pptszList[4], "=", tszKey, tszCountyStr); HTTPTask_TaskGet_IDRegion(lpszClientAddr, nType, tszProvincerStr, tszCityStr, tszCountyStr); } @@ -445,7 +445,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //油价:http://127.0.0.1:5501/api?function=oil¶m=地区 memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszValue); HTTPTask_TaskGet_Oil(lpszClientAddr, tszValue); } else if ((0 == _tcsxnicmp(lpszParamPhone, tszValue, _tcsxlen(lpszParamPhone))) || (0 == _tcsxnicmp(lpszParamIPAddr, tszValue, _tcsxlen(lpszParamIPAddr))) || (0 == _tcsxnicmp(lpszParamMacInfo, tszValue, _tcsxlen(lpszParamMacInfo)))) @@ -455,7 +455,7 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //mac:http://127.0.0.1:5501/api?function=mac¶m=00:00:0C memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszMsgBuffer); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszKey, tszMsgBuffer); HTTPTask_TaskGet_APIModule(lpszClientAddr, tszValue, tszMsgBuffer); } else @@ -470,6 +470,6 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("HTTP客户端:%s,协议错误"), lpszClientAddr); } - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h index f1137e4388887dab7482b5f05cd712ab89583b6f..4d1484540628ae5fb59dc0fb7123b04666ba5180 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h @@ -32,12 +32,14 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include #include #include +#include +#include #include #include #include @@ -191,9 +193,10 @@ extern XENGINE_DEAMONAPPLIST st_DeamonAppConfig; #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseSafe.lib") #pragma comment(lib,"XEngine_Core/XEngine_Core.lib") #pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") #pragma comment(lib,"XEngine_Client/XClient_Stream.lib") #pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr") #pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib") #pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpProtocol.lib") #pragma comment(lib,"XEngine_RfcComponents/RfcComponents_NatProtocol.lib") diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp index d88547398e8044dbad317e66f966371074d58fe1..c7d6c00d865f75d4d0045976570ac6943b7931cb 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp @@ -55,6 +55,7 @@ void ServiceApp_Stop(int signo) APIModule_PhoneNumber_UnInit(); ModulePlugin_Loader_Destory(); ModuleHelp_P2PClient_Destory(); + ModuleHelp_ImageGet_TextDestory(); //销毁日志资源 HelpComponents_XLog_Destroy(xhLog); //销毁线程 @@ -74,7 +75,7 @@ LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) static int i = 0; XCHAR tszFileStr[MAX_PATH] = {}; XCHAR tszTimeStr[128] = {}; - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + BaseLib_Time_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); @@ -132,6 +133,7 @@ int main(int argc, char** argv) WSAStartup(MAKEWORD(2, 2), &st_WSAData); SetUnhandledExceptionFilter(Coredump_ExceptionFilter); + SetConsoleOutputCP(CP_UTF8); #endif bIsRun = true; int nRet = -1; @@ -224,6 +226,19 @@ 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_XImageText.bEnable) + { + if (!ModuleHelp_ImageGet_TextInit(st_ServiceConfig.st_XImageText.tszImagePath, st_ServiceConfig.st_XImageText.tszImageLanguage)) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化图像文字识别失败,错误:%lX"), ModuleHelp_GetLastError()); + goto XENGINE_SERVICEAPP_EXIT; + } + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,初始化图像文字识别被禁用")); + } //初始化数据库 if (st_ServiceConfig.st_XSql.bEnable && !bIsTest) { @@ -317,7 +332,7 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhHTTPSocket, Network_Callback_HTTPLogin, Network_Callback_HTTPRecv, Network_Callback_HTTPLeave); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册HTTP网络事件成功")); //HTTP任务池 - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListHTTPParam, st_ServiceConfig.st_XMax.nHTTPThread, sizeof(THREADPOOL_PARAMENT)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListHTTPParam, st_ServiceConfig.st_XMax.nHTTPThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_ServiceConfig.st_XMax.nHTTPThread; i++) { int* pInt_Pos = new int; @@ -513,7 +528,7 @@ int main(int argc, char** argv) 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()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,服务运行中,XEngine版本:%s%s,发行版本次数:%d,当前版本:%s。。。"), BaseLib_Version_XNumberStr(), BaseLib_Version_XTypeStr(), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str()); while (true) { if (bIsTest) @@ -557,6 +572,7 @@ XENGINE_SERVICEAPP_EXIT: APIModule_PhoneNumber_UnInit(); ModulePlugin_Loader_Destory(); ModuleHelp_P2PClient_Destory(); + ModuleHelp_ImageGet_TextDestory(); //销毁日志资源 HelpComponents_XLog_Destroy(xhLog); //销毁线程 diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Bank.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Bank.cpp index 1e7d7186b9c84690813765a11039d85248e8a87f..405854155d137b853eafd5931966b69c9aa00f03 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Bank.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Bank.cpp @@ -37,13 +37,13 @@ bool HTTPTask_TaskGet_BankInfo(LPCXSTR lpszClientAddr, LPCXSTR lpszBankNumber) if (!ModuleProtocol_Parse_Bank(ptszBodyBuffer, nBLen, &st_BankInfo)) { ModuleProtocol_Packet_BankQuery(tszPktBuffer, &nPktLen, NULL, 1001, _X("banknumber is corrent")); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的银行卡号码错误:%s"), lpszClientAddr, lpszBankNumber); return false; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); //查询对应名称 if (!ModuleDatabase_Bank_Query(&st_BankInfo)) { diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_IDRegion.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_IDRegion.cpp index 5d93f81e07370991b231ca5843af1bcc71b1e9fe..c828a5ae7c5d43976e5cf2a5068edc0172bd83c2 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_IDRegion.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_IDRegion.cpp @@ -43,7 +43,7 @@ bool HTTPTask_TaskGet_IDRegion(LPCXSTR lpszClientAddr, int nType, LPCXSTR lpszPr #ifdef _MSC_BUILD XCHAR tszUTFBuffer[1024] = {}; int nULen = _tcsxlen(tszPktBuffer); - BaseLib_OperatorCharset_AnsiToUTF(tszPktBuffer, tszUTFBuffer, &nULen); + BaseLib_Charset_AnsiToUTF(tszPktBuffer, tszUTFBuffer, &nULen); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszUTFBuffer, nULen); #else HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); 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 97478c5055d914977c752b6d0205e2b17a0577b0..617ce2cfbda64a9ed29bab65ed253feb8a367521 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 @@ -29,7 +29,7 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, #ifdef _MSC_BUILD int nGLen = _tcsxlen(lpszMsgBuffer); - BaseLib_OperatorCharset_AnsiToUTF(lpszMsgBuffer, tszUTFBuffer, &nGLen); + BaseLib_Charset_AnsiToUTF(lpszMsgBuffer, tszUTFBuffer, &nGLen); #else _xstrcpy(tszUTFBuffer, lpszMsgBuffer, sizeof(tszUTFBuffer)); #endif @@ -37,7 +37,7 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nRandomNumber = rand(); int nLen = _xstprintf(tszSignStr, _X("%s%s%d%s"), st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPID, tszUTFBuffer, nRandomNumber, st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPKey); - OPenSsl_Api_Digest(tszSignStr, (XBYTE*)tszMD5Codec, &nLen); + Cryption_Api_Digest(tszSignStr, (XBYTE*)tszMD5Codec, &nLen); for (int i = 0; i < 16; i++) { XCHAR tszTmpStr[4] = {}; @@ -60,14 +60,14 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的翻译失败,原始字符串:%s,错误数据:%s"), lpszClientAddr, lpszMsgBuffer, ptszBodyBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); return false; } //打包发送 ModuleProtocol_Packet_LanguageQuery(tszPktBuffer, &nPktLen, &st_LanguageInfo); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求语言翻译成功,原始语言:%s,目标语言:%s"), lpszClientAddr, st_LanguageInfo.tszFromStr, st_LanguageInfo.tszToStr); return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Weather.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Weather.cpp index 27d04570817203749829b9ec1315a71ac6630c19..e66511c18c0383e41064fee5695d8eab83456523 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Weather.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Weather.cpp @@ -24,11 +24,11 @@ bool HTTPTask_TaskGet_WeatherInfo(LPCXSTR lpszClientAddr, LPCXSTR lpszAddrCode) XCHAR tszGBKStr[1024] = {}; #ifdef _MSC_BUILD - BaseLib_OperatorCharset_UTFToAnsi(ptszBodyBuffer, tszGBKStr, &nBLen); + BaseLib_Charset_UTFToAnsi(ptszBodyBuffer, tszGBKStr, &nBLen); #else _tcsxcpy(tszGBKStr, ptszBodyBuffer); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszBodyBuffer); //解析JSON信息 if (!ModuleProtocol_Parse_Weather(tszGBKStr, nBLen, &st_WeatherInfo)) { @@ -42,7 +42,7 @@ bool HTTPTask_TaskGet_WeatherInfo(LPCXSTR lpszClientAddr, LPCXSTR lpszAddrCode) ModuleProtocol_Packet_Weather(tszPktBuffer, &nPktLen, &st_WeatherInfo); #ifdef _MSC_BUILD XCHAR tszUTFStr[1024] = {}; - BaseLib_OperatorCharset_AnsiToUTF(tszPktBuffer, tszUTFStr, &nPktLen); + BaseLib_Charset_AnsiToUTF(tszPktBuffer, tszUTFStr, &nPktLen); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszUTFStr, nPktLen); #else HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); 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 a4732370089eb38aff61756fc8557bd683543b37..e49d4c240c67ddfb64196cb3d4869a21e3535f3c 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 @@ -185,7 +185,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer ModuleProtocol_Packet_ListFile(ptszRVBuffer, &nRVLen, &ppszFileList, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam, ptszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszFileList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppszFileList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s:获取文件列表成功,回复个数:%d"), lpszClientAddr, nListCount); } break; @@ -267,8 +267,8 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer AVHelp_Device_EnumDevice(&ppSt_AudioList, &ppSt_VideoList, &nACount, &nVCount); ModuleProtocol_Packet_EnumDevice(ptszRVBuffer, &nRVLen, &ppSt_AudioList, &ppSt_VideoList, nACount, nVCount); - BaseLib_OperatorMemory_Free((void***)&ppSt_AudioList, nACount); - BaseLib_OperatorMemory_Free((void***)&ppSt_VideoList, nVCount); + BaseLib_Memory_Free((void***)&ppSt_AudioList, nACount); + BaseLib_Memory_Free((void***)&ppSt_VideoList, nVCount); } HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam, ptszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); 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 cbab93bc7b058ae42699557a7e424f150a013148..91920f038ba82a4e2cb45adb6cb44d610d589455 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 @@ -28,10 +28,30 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int memset(ptszSDBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); memset(ptszRVBuffer, '\0', XENGINE_MEMORY_SIZE_MAX); - BaseLib_OperatorString_GetKeyValue((*ppptszList)[1], "=", tszHTTPKey, tszHTTPVlu); + BaseLib_String_GetKeyValue((*ppptszList)[1], "=", tszHTTPKey, tszHTTPVlu); int nOPCode = _ttxoi(tszHTTPVlu); //0获取,1设置 - if (0 == nOPCode) + if (0 == nOPCode && st_ServiceConfig.st_XImageText.bEnable) + { + XCHAR** pptszListStr; + int nListCount = 0; + if (ModuleHelp_ImageGet_TextGet(lpszMsgBuffer, nMsgLen, &pptszListStr, &nListCount)) + { + ModuleProtocol_Packet_ImageText(ptszRVBuffer, &nRVLen, &pptszListStr, nListCount); + HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam, ptszRVBuffer, nRVLen); + XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); + BaseLib_Memory_Free((XPPPMEM)&pptszListStr, nListCount); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取识别图片文字成功,获取个数:%d"), lpszClientAddr, nListCount); + } + else + { + st_HDRParam.nHttpCode = 501; + HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam); + XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求获取识别图片文字失败,错误:%lX"), lpszClientAddr, ModuleHelp_GetLastError()); + } + } + else if (1 == nOPCode) { XENGINE_IMGBASEATTR st_BaseInfo; XENGINE_IMGEXTATTR st_ExtAttr; @@ -66,14 +86,14 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int memset(tszHTTPVlu, '\0', sizeof(tszHTTPVlu)); - BaseLib_OperatorString_GetKeyValue((*ppptszList)[2], "=", tszHTTPKey, tszHTTPVlu); + BaseLib_String_GetKeyValue((*ppptszList)[2], "=", tszHTTPKey, tszHTTPVlu); _xstprintf(tszFileExt, _X(".%s"), tszHTTPVlu); - BaseLib_OperatorString_GetKeyValue((*ppptszList)[3], "=", tszHTTPKey, tszHTTPVlu); + BaseLib_String_GetKeyValue((*ppptszList)[3], "=", tszHTTPKey, tszHTTPVlu); int nWidth = _ttxoi(tszHTTPVlu); - if (1 == nOPCode) + if (2 == nOPCode) { - BaseLib_OperatorString_GetKeyValue((*ppptszList)[4], "=", tszHTTPKey, tszHTTPVlu); + BaseLib_String_GetKeyValue((*ppptszList)[4], "=", tszHTTPKey, tszHTTPVlu); int nHeight = _ttxoi(tszHTTPVlu); if (ModuleHelp_ImageSet_Resolution(lpszMsgBuffer, nMsgLen, tszFileExt, ptszRVBuffer, &nRVLen, nWidth, nHeight)) @@ -91,7 +111,7 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int } } - else if (2 == nOPCode) + else if (3 == nOPCode) { if (ModuleHelp_ImageSet_ColorCvt(lpszMsgBuffer, nMsgLen, tszFileExt, ptszRVBuffer, &nRVLen, (ENUM_XENGINE_IMAGE_COLOR_INFO)nWidth)) { @@ -107,7 +127,7 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求设置图像颜色空间转换失败,错误:%lX"), lpszClientAddr, ModuleHelp_GetLastError()); } } - else if (3 == nOPCode) + else if (4 == nOPCode) { if (ModuleHelp_ImageSet_Flip(lpszMsgBuffer, nMsgLen, tszFileExt, ptszRVBuffer, &nRVLen, nWidth)) { @@ -123,7 +143,7 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求设置图像翻转失败,错误:%lX"), lpszClientAddr, ModuleHelp_GetLastError()); } } - else if (4 == nOPCode) + else if (5 == nOPCode) { if (ModuleHelp_ImageSet_Ligth(lpszMsgBuffer, nMsgLen, tszFileExt, ptszRVBuffer, &nRVLen, nWidth)) { @@ -139,7 +159,7 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求设置图像亮度失败,错误:%lX"), lpszClientAddr, ModuleHelp_GetLastError()); } } - else if (5 == nOPCode) + else if (6 == nOPCode) { if (ModuleHelp_ImageSet_Level(lpszMsgBuffer, nMsgLen, tszFileExt, ptszRVBuffer, &nRVLen, nWidth)) { 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 726197e06e9426a916eabc43e0aa11b7f79efb5a..d96efbc15304ea71e38f6409a915f33bd8e5a8d8 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 @@ -74,13 +74,13 @@ bool HTTPTask_TastPost_Machine(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in } int nListCount = 1; XENGINE_MACHINEINFO** ppSt_MachineInfo; - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_MachineInfo, nListCount, sizeof(XENGINE_MACHINEINFO)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_MachineInfo, nListCount, sizeof(XENGINE_MACHINEINFO)); (*ppSt_MachineInfo)[0] = st_MachineInfo; ModuleProtocol_Packet_Machine(tszRVBuffer, &nRVLen, &ppSt_MachineInfo, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_MachineInfo, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_MachineInfo, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取机器信息成功,机器名称:%s,服务名称:%s"), lpszClientAddr, st_MachineInfo.tszMachineSystem, st_MachineInfo.tszServiceName); } else @@ -91,7 +91,7 @@ bool HTTPTask_TastPost_Machine(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in ModuleProtocol_Packet_Machine(tszRVBuffer, &nRVLen, &ppSt_MachineInfo, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_MachineInfo, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_MachineInfo, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取机器信息列表成功,个数:%d"), lpszClientAddr, nListCount); } return true; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_P2PClient.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_P2PClient.cpp index db7998b4cc8ad723a76fdfb4ce6ac30ec78b1595..214d5077368180a4e3def269fceec1167cf736ae 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_P2PClient.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_P2PClient.cpp @@ -35,7 +35,7 @@ bool HTTPTask_TastPost_P2PClient(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, if (_tcsxlen(st_ClientPeer.st_PeerAddr.tszPublicAddr) <= 0) { _tcsxcpy(st_ClientPeer.st_PeerAddr.tszPublicAddr, lpszClientAddr); - BaseLib_OperatorIPAddr_SegAddr(st_ClientPeer.st_PeerAddr.tszPublicAddr, NULL); + APIAddr_IPAddr_SegAddr(st_ClientPeer.st_PeerAddr.tszPublicAddr, NULL); } st_ClientPeer.st_PeerTimer.dwUserTime = time(NULL); st_ClientPeer.st_PeerTimer.dwKeepAlive = time(NULL); @@ -102,7 +102,7 @@ bool HTTPTask_TastPost_P2PClient(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, ModuleProtocol_Packet_P2PLan(tszRVBuffer, &nRVLen, &ppSt_ListClients, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClients, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClients, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,P2P请求同步局域网列表成功,公有地址:%s,私有地址:%s"), lpszClientAddr, st_P2PProtocol.tszPublicAddr, st_P2PProtocol.tszPrivateAddr); } else @@ -127,10 +127,10 @@ bool HTTPTask_TastPost_P2PClient(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, { stl_ListClient.push_back(*ppSt_ListClients[j]); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClients, nLanCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClients, nLanCount); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszClientList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppszClientList, nListCount); } ModuleProtocol_Packet_P2PWLan(tszRVBuffer, &nRVLen, &stl_ListClient); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); @@ -148,7 +148,7 @@ bool HTTPTask_TastPost_P2PClient(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, 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,P2P请求公有地址列表成功,地址个数:%d"), lpszClientAddr, nListCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszListAddr, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszListAddr, nListCount); } else if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_P2XP_REQHEART == unOperatorCode) { diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_ShortLink.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_ShortLink.cpp index a7d812a80fe36b712193e78a3f71d96eacca01a2..fda040d409fd4365624f1c3f170cc17bb90ad762 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_ShortLink.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_ShortLink.cpp @@ -12,7 +12,7 @@ bool HTTPTask_TaskPost_SLProxy(LPCXSTR lpszClientAddr, LPCXSTR lpszUriStr, XCHAR memset(tszKey, '\0', sizeof(tszKey)); memset(tszValue, '\0', sizeof(tszValue)); - BaseLib_OperatorString_GetKeyValue((*ppptszHDRList)[i], ": ", tszKey, tszValue); + BaseLib_String_GetKeyValue((*ppptszHDRList)[i], ": ", tszKey, tszValue); if (0 == _tcsxnicmp(st_ServiceConfig.st_XShortLink.tszHostUrl, tszValue, _tcsxlen(st_ServiceConfig.st_XShortLink.tszHostUrl))) { bFound = true; @@ -77,7 +77,7 @@ bool HTTPTask_TaskPost_ShortLink(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, //0生成,1还原,2删除 if (0 == nType) { - BaseLib_OperatorTime_TimeToStr(st_ShortLink.tszCreateTime); + BaseLib_Time_TimeToStr(st_ShortLink.tszCreateTime); if (!HttpProtocol_ServerHelp_ShortLink(st_ShortLink.tszFullUrl, st_ShortLink.tszShotUrl, st_ShortLink.tszKeyUrl, st_ShortLink.nLength, st_ShortLink.tszCvtUrl)) { st_HDRParam.nHttpCode = 400; @@ -138,7 +138,7 @@ bool HTTPTask_TaskPost_ShortLink(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, ModuleProtocol_Packet_ShortLinkList(tszRVBuffer, &nRVLen, &ppSt_SLinkInfo, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_SLinkInfo, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_SLinkInfo, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求操作短连接查询成功,查询个数:%d"), lpszClientAddr, nListCount); } return true; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_WordFilter.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_WordFilter.cpp index 15c6673e0db0685963d10253ce90f9e1e325bb25..33448533901b07e830d02695dcda729736f70987 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_WordFilter.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_WordFilter.cpp @@ -64,7 +64,7 @@ bool HTTPTask_TastPost_WordFilter(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, ModuleProtocol_Packet_WordFilterList(tszRVBuffer, &nRVLen, &ppSt_WordFilter, nListCount); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_WordFilter, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_WordFilter, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求枚举敏感词列表成功,敏感词个数:%d"), lpszClientAddr, nListCount); } return true; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskRfc/RFCTask_Stun.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskRfc/RFCTask_Stun.cpp index 1e0e64a2375c6723659e5a131c687e6b73a00be0..64e279b324c5ba8b4c644b23c307bba9b86df5a8 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskRfc/RFCTask_Stun.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskRfc/RFCTask_Stun.cpp @@ -24,7 +24,7 @@ bool RFCTask_Stun_Parse(LPCXSTR lpszClientAddr, LPCXSTR lpszMSGBuffer, int nMSGL int nNLen = 0; XCHAR tszIPAddr[128] = {}; _tcsxcpy(tszIPAddr, lpszClientAddr); - BaseLib_OperatorIPAddr_SegAddr(tszIPAddr, &nIPPort); + APIAddr_IPAddr_SegAddr(tszIPAddr, &nIPPort); NatProtocol_StunNat_BuildMapAddress(tszRVBuffer, &nXLen, tszIPAddr, nIPPort, true); nRVLen += nXLen;