diff --git a/.github/workflows/Alma_build.yml b/.github/workflows/Alma_build.yml new file mode 100644 index 0000000..67d8f22 --- /dev/null +++ b/.github/workflows/Alma_build.yml @@ -0,0 +1,95 @@ +name: alma build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +permissions: + contents: read + +jobs: + build: + runs-on: ${{ matrix.runner }} + container: + image: almalinux:${{ matrix.version }} + options: --platform ${{ matrix.platform }} + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + artifact: x86-64 + version: 9 + - arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + artifact: x86-64 + version: 10 + - arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + artifact: Arm64 + version: 9 + - arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + artifact: Arm64 + version: 10 + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + uses: actions/checkout@v4 + with: + repository: libxengine/XEngine_OPenSource + path: XEngine_Source/XEngine_DependLibrary + + - name: Set TERM variable + run: echo "TERM=xterm" >> $GITHUB_ENV + + - name: install system package + run: | + dnf update -y + dnf install gcc g++ make git jq unzip wget -y + + - name: install xengine library + run: | + 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_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }}.zip + unzip ./XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }}.zip -d ./XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }} + cd XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }} + + chmod 777 * + ./XEngine_LINEnv.sh -i 3 + + - name: make + run: | + cd XEngine_Source + make RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + cd .. + - name: test + run: | + cd XEngine_Release + ./XEngine_MQServiceApp -t + + - name: Upload folder as artifact + uses: actions/upload-artifact@v4 + with: + name: XEngine_MQServiceApp-AlmaLinux_${{ matrix.version }}_${{ matrix.artifact }} + path: XEngine_Release/ \ No newline at end of file diff --git a/.github/workflows/Centos_build.yml b/.github/workflows/Centos_build.yml new file mode 100644 index 0000000..d68d0ff --- /dev/null +++ b/.github/workflows/Centos_build.yml @@ -0,0 +1,102 @@ +name: centos build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +permissions: + contents: read + +jobs: + build: + runs-on: ${{ matrix.runner }} + container: + image: quay.io/centos/centos:${{ matrix.stream }} + options: --platform ${{ matrix.platform }} + strategy: + matrix: + include: + - arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + artifact: x86-64 + version: 9 + stream: stream9 + - arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + artifact: x86-64 + version: 10 + stream: stream10 + - arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + artifact: Arm64 + version: 9 + stream: stream9 + - arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + artifact: Arm64 + version: 10 + stream: stream10 + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + uses: actions/checkout@v4 + with: + repository: libxengine/XEngine_OPenSource + path: XEngine_Source/XEngine_DependLibrary + + - name: install system package + run: | + dnf update -y + dnf install gcc g++ make git jq unzip wget -y + + - name: Set TERM variable + run: echo "TERM=xterm" >> $GITHUB_ENV + + - name: install xengine library + run: | + 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_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }}.zip + unzip ./XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }}.zip -d ./XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }} + cd XEngine_RockyLinux_${{ matrix.version }}_${{ matrix.artifact }} + + chmod 777 * + ./XEngine_LINEnv.sh -i 3 + - name: make + run: | + cd XEngine_Source + make + make FLAGS=InstallAll + make FLAGS=CleanAll + + make RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + - name: test + run: | + cd XEngine_Release + ./XEngine_MQServiceApp -t + + - name: Upload folder as artifact with CentOS + uses: actions/upload-artifact@v4 + with: + name: XEngine_MQServiceApp-CentOS_${{ matrix.version }}_${{ matrix.artifact }} + path: XEngine_Release/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/Rocky_build.yml b/.github/workflows/Rocky_build.yml index c78dfb6..12ebcfc 100644 --- a/.github/workflows/Rocky_build.yml +++ b/.github/workflows/Rocky_build.yml @@ -94,9 +94,9 @@ jobs: cd XEngine_Release ./XEngine_MQServiceApp -t - - name: Upload folder as artifact with RockyLinux + - name: Upload folder as artifact with CentOS uses: actions/upload-artifact@v4 with: - name: XEngine_MQServiceApp-RockyLinux_${{ matrix.version }}_${{ matrix.artifact }} + name: XEngine_MQServiceApp-CentOS_${{ matrix.version }}_${{ matrix.artifact }} path: XEngine_Release/ retention-days: 1 diff --git a/.github/workflows/debian_build.yml b/.github/workflows/debian_build.yml index 3b48baa..70a6da1 100644 --- a/.github/workflows/debian_build.yml +++ b/.github/workflows/debian_build.yml @@ -16,7 +16,7 @@ jobs: build: runs-on: ${{ matrix.runner }} container: - image: debian:bookworm + image: debian:${{ matrix.name }} options: --platform ${{ matrix.platform }} strategy: matrix: @@ -25,6 +25,14 @@ jobs: runner: ubuntu-24.04 platform: linux/amd64 artifact: x86-64 + name: bookworm + version: 12 + - arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + artifact: x86-64 + name: trixie + version: 13 steps: - name: Checkout main repository code @@ -53,9 +61,9 @@ jobs: - name: install xengine library run: | 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_Debian_12_${{ matrix.artifact }}.zip - unzip ./XEngine_Debian_12_${{ matrix.artifact }}.zip -d ./XEngine_Debian_12_${{ matrix.artifact }} - cd XEngine_Debian_12_${{ matrix.artifact }} + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Debian_${{ matrix.version }}_${{ matrix.artifact }}.zip + unzip ./XEngine_Debian_${{ matrix.version }}_${{ matrix.artifact }}.zip -d ./XEngine_Debian_${{ matrix.version }}_${{ matrix.artifact }} + cd XEngine_Debian_${{ matrix.version }}_${{ matrix.artifact }} chmod 777 * ./XEngine_LINEnv.sh -i 3 @@ -63,10 +71,6 @@ jobs: - name: make run: | cd XEngine_Source - make - make FLAGS=InstallAll - make FLAGS=CleanAll - make RELEASE=1 make FLAGS=InstallAll make FLAGS=CleanAll @@ -79,6 +83,6 @@ jobs: - name: Upload folder as artifact uses: actions/upload-artifact@v4 with: - name: XEngine_MQServiceApp-Debian_12_x86-64 + name: XEngine_MQServiceApp-Debian_${{ matrix.version }}_x86-64 path: XEngine_Release/ retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml index df0d78e..b975c7c 100644 --- a/.github/workflows/macbuild.yml +++ b/.github/workflows/macbuild.yml @@ -14,8 +14,8 @@ jobs: strategy: matrix: include: - - os: macos-13 - - os: macos-14 + - os: macos-15-intel + - os: macos-15 runs-on: ${{ matrix.os }} steps: @@ -42,13 +42,13 @@ jobs: run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - name: Set up Dependency x86_64 Environment - if: matrix.os == 'macos-13' + if: matrix.os == 'macos-15-intel' run: | cd libxengine chmod 777 * ./XEngine_LINEnv.sh -i 3 - name: Set up Dependency Arm64 Environment - if: matrix.os == 'macos-14' + if: matrix.os == 'macos-15' run: | 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 @@ -76,14 +76,14 @@ jobs: ./XEngine_MQServiceApp -t - name: Upload folder as artifact with mac x64 - if: matrix.os == 'macos-13' + if: matrix.os == 'macos-15-intel' uses: actions/upload-artifact@v4 with: name: XEngine_MQServiceApp-Mac_x86_64 path: XEngine_Release/ retention-days: 1 - name: Upload folder as artifact with mac arm - if: matrix.os == 'macos-14' + if: matrix.os == 'macos-15' uses: actions/upload-artifact@v4 with: name: XEngine_MQServiceApp-Mac_Arm64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cda358..dfd1818 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,24 @@ jobs: skip_unpack: true if_no_artifact_found: fail path: ./XRelease/ + - name: Download CentOS + uses: dawidd6/action-download-artifact@v6 + with: + workflow: Centos_build.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download Alma + uses: dawidd6/action-download-artifact@v6 + with: + workflow: Alma_build.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: diff --git a/CHANGELOG b/CHANGELOG index 33c6da4..a340d7c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,21 @@ +XEngine_MQService V3.18.0.1001 + +ci:增加CentOS和Alma以及debian13系统支持 +ci:更新mac系统版本 +修改:启动参数不区分大小写了 +修改:用户数据缓冲区大小问题 +更新:匹配最新协议模块 +更新:依赖库 +修正:某些时候读取配置文件内存问题 + +ci:add centos alma linux and debian 13 system support +ci:update mac system version +modify:does not case sensitive for start parameter +modify:user data memory size +update:match last version source module protocol +update:depend library +fixed:read configure memory leak +====================================================================================== XEngine_MQService V3.17.0.1001 增加:rocky linux 10 支持 diff --git a/XEngine_Apps/MQCore_TCPApp/MQCore_TCPApp.cpp b/XEngine_Apps/MQCore_TCPApp/MQCore_TCPApp.cpp index a200676..238db5a 100644 --- a/XEngine_Apps/MQCore_TCPApp/MQCore_TCPApp.cpp +++ b/XEngine_Apps/MQCore_TCPApp/MQCore_TCPApp.cpp @@ -41,7 +41,7 @@ void MQ_Authorize() st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER; st_ProtocolHdr.unOperatorType = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_AUTH; - st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG; + st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGIN; st_ProtocolHdr.byVersion = 1; st_ProtocolHdr.byIsReply = true; //获得处理返回结果 st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL; diff --git a/XEngine_Apps/MQCore_WSApp/MQCore_WSApp.cpp b/XEngine_Apps/MQCore_WSApp/MQCore_WSApp.cpp index 0b36765..29d9bd8 100644 --- a/XEngine_Apps/MQCore_WSApp/MQCore_WSApp.cpp +++ b/XEngine_Apps/MQCore_WSApp/MQCore_WSApp.cpp @@ -76,7 +76,7 @@ void MQ_Authorize() Json::Value st_JsonRoot; Json::Value st_JsonAuth; st_JsonRoot["unOperatorType"] = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_AUTH; - st_JsonRoot["unOperatorCode"] = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG; + st_JsonRoot["unOperatorCode"] = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGIN; st_JsonRoot["byVersion"] = ENUM_XENGINE_PROTOCOLHDR_PAYLOAD_TYPE_JSON; st_JsonAuth["tszUserName"] = "123123aa"; diff --git a/XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp b/XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp index ce25227..34bcad8 100644 --- a/XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp +++ b/XEngine_Source/MQCore_ConfigModule/Config_Json/Config_Json.cpp @@ -43,7 +43,7 @@ bool CConfig_Json::Config_Json_File(LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARAMENT; return false; } - XCHAR tszMsgBuffer[4096] = {}; + XCHAR tszMsgBuffer[8196] = {}; size_t nSize = fread(tszMsgBuffer, 1, sizeof(tszMsgBuffer), pSt_File); fclose(pSt_File); @@ -191,21 +191,12 @@ bool CConfig_Json::Config_Json_VersionFile(LPCXSTR lpszConfigFile, XENGINE_SERVE Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARAMENT; return false; } - int nCount = 0; - XCHAR tszMsgBuffer[4096]; - while (1) - { - int nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File); - if (nRet <= 0) - { - break; - } - nCount += nRet; - } + XCHAR tszMsgBuffer[XPATH_8MAX] = {}; + int nRet = fread(tszMsgBuffer, 1, XPATH_8MAX, pSt_File); fclose(pSt_File); std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); - if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError)) + if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nRet, &st_JsonRoot, &st_JsonError)) { Config_IsErrorOccur = true; Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARSE; @@ -248,21 +239,12 @@ bool CConfig_Json::Config_Json_DBFile(LPCXSTR lpszConfigFile, MESSAGEQUEUE_DBCON Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARAMENT; return false; } - int nCount = 0; - XCHAR tszMsgBuffer[4096]; - while (1) - { - int nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File); - if (nRet <= 0) - { - break; - } - nCount += nRet; - } + XCHAR tszMsgBuffer[XPATH_8MAX] = {}; + int nRet = fread(tszMsgBuffer, 1, XPATH_8MAX, pSt_File); fclose(pSt_File); std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); - if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError)) + if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nRet, &st_JsonRoot, &st_JsonError)) { Config_IsErrorOccur = true; Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARSE; diff --git a/XEngine_Source/MQCore_DBModule/DBModule_Define.h b/XEngine_Source/MQCore_DBModule/DBModule_Define.h index 5515bab..2cab276 100644 --- a/XEngine_Source/MQCore_DBModule/DBModule_Define.h +++ b/XEngine_Source/MQCore_DBModule/DBModule_Define.h @@ -39,8 +39,8 @@ typedef struct //用户消息 typedef struct { - XCHAR tszUserName[XPATH_MAX]; //用户名 - XCHAR tszKeyName[XPATH_MAX]; //绑定的KEY + XCHAR tszUserName[XPATH_MIN]; //用户名 + XCHAR tszKeyName[XPATH_MIN]; //绑定的KEY XCHAR tszUPTime[64]; //最后更新时间 XCHAR tszCreateTime[64]; //创建的时间 __int64x nKeySerial; //包序列号 diff --git a/XEngine_Source/MQCore_ProtocolModule/ProtocolModule_Packet/ProtocolModule_Packet.cpp b/XEngine_Source/MQCore_ProtocolModule/ProtocolModule_Packet/ProtocolModule_Packet.cpp index b5ea1a5..a63e3e9 100644 --- a/XEngine_Source/MQCore_ProtocolModule/ProtocolModule_Packet/ProtocolModule_Packet.cpp +++ b/XEngine_Source/MQCore_ProtocolModule/ProtocolModule_Packet/ProtocolModule_Packet.cpp @@ -932,7 +932,7 @@ bool CProtocolModule_Packet::ProtocolModule_Packet_MQTTCommon(XENGINE_PROTOCOLHD int nRVLen = 0; XCHAR tszRVBuffer[1024] = {}; - if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSERLOG == pSt_ProtocolHdr->unOperatorCode) + if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REPLOGIN == pSt_ProtocolHdr->unOperatorCode) { if (0 == pSt_ProtocolHdr->wReserve) { diff --git a/XEngine_Source/VSCopy_Arm64.bat b/XEngine_Source/VSCopy_Arm64.bat index 01a6cc6..5d67e05 100644 --- a/XEngine_Source/VSCopy_Arm64.bat +++ b/XEngine_Source/VSCopy_Arm64.bat @@ -5,9 +5,11 @@ copy /y "%XEngine_LibArm64%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_LibArm64%\XEngine_Core\XEngine_ManagePool.dll" "./" copy /y "%XEngine_LibArm64%\XEngine_Core\XEngine_Cryption.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_Client\XClient_Socket.dll" "./" + copy /y "%XEngine_LibArm64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_LibArm64%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" -copy /y "%XEngine_LibArm64%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_LibArm64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_LibArm64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/VSCopy_Debug.bat b/XEngine_Source/VSCopy_Debug.bat index 1f5aeea..e1a630e 100644 --- a/XEngine_Source/VSCopy_Debug.bat +++ b/XEngine_Source/VSCopy_Debug.bat @@ -5,9 +5,11 @@ 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_Cryption.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Socket.dll" "./" + copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemConfig.dll" "./" -copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/VSCopy_x64.bat b/XEngine_Source/VSCopy_x64.bat index fad27b5..0186097 100644 --- a/XEngine_Source/VSCopy_x64.bat +++ b/XEngine_Source/VSCopy_x64.bat @@ -5,9 +5,11 @@ 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_Cryption.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./" + copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/VSCopy_x86.bat b/XEngine_Source/VSCopy_x86.bat index 24115df..2cb7651 100644 --- a/XEngine_Source/VSCopy_x86.bat +++ b/XEngine_Source/VSCopy_x86.bat @@ -5,9 +5,11 @@ 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_Cryption.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./" + copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./" diff --git a/XEngine_Source/XEngine_DependLibrary b/XEngine_Source/XEngine_DependLibrary index 6a2fd03..24bde9d 160000 --- a/XEngine_Source/XEngine_DependLibrary +++ b/XEngine_Source/XEngine_DependLibrary @@ -1 +1 @@ -Subproject commit 6a2fd030257062f98b2a2751e9d5b6559901a53e +Subproject commit 24bde9d212cd48b822ad8aab90956033972ee46b diff --git a/XEngine_Source/XEngine_MQServiceApp.sln b/XEngine_Source/XEngine_MQServiceApp.sln index f6b6988..3e25035 100644 --- a/XEngine_Source/XEngine_MQServiceApp.sln +++ b/XEngine_Source/XEngine_MQServiceApp.sln @@ -54,10 +54,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_InfoReport", "XEngi EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_Token", "XEngine_DependLibrary\XEngine_Module\XEngine_Token\XEngine_Token.vcxproj", "{E17E889F-D826-413F-854E-DBA6000B4DA7}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_Verification", "XEngine_DependLibrary\XEngine_Module\XEngine_Verification\XEngine_Verification.vcxproj", "{A8E43EC0-698A-4807-8A61-B2BE5FAB7256}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XEngine_MSGNotify", "XEngine_DependLibrary\XEngine_Module\XEngine_MSGNotify\XEngine_MSGNotify.vcxproj", "{E1087BA3-1074-4C6A-B770-A53B7BA1F4EA}" + ProjectSection(ProjectDependencies) = postProject + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {F1736B3F-03A2-4FC7-B045-A12BA8D724FB} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/XEngine_Source/XEngine_MQServiceApp/MQService_Config.cpp b/XEngine_Source/XEngine_MQServiceApp/MQService_Config.cpp index ea5be9d..876383a 100644 --- a/XEngine_Source/XEngine_MQServiceApp/MQService_Config.cpp +++ b/XEngine_Source/XEngine_MQServiceApp/MQService_Config.cpp @@ -18,56 +18,56 @@ bool MQ_Service_Parament(int argc, char** argv, XENGINE_SERVERCONFIG* pSt_Startl for (int i = 0;i < argc;i++) { - if (0 == _tcsxicmp("-h",argv[i])) + if (0 == _tcsxcmp("-h",argv[i])) { MQ_Service_ParamentHelp(); return false; } - else if (0 == _tcsxicmp("-v",argv[i])) + else if (0 == _tcsxcmp("-v",argv[i])) { printf("Version:%s\n", st_ServiceCfg.st_XVer.pStl_ListStorage->front().c_str()); return false; } - else if (0 == _tcsxicmp("-tp",argv[i])) + else if (0 == _tcsxcmp("-tp",argv[i])) { pSt_StartlParam->nTCPPort = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-hp",argv[i])) + else if (0 == _tcsxcmp("-hp",argv[i])) { pSt_StartlParam->nHttpPort = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-wp", argv[i])) + else if (0 == _tcsxcmp("-wp", argv[i])) { pSt_StartlParam->nWSPort = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-mp", argv[i])) + else if (0 == _tcsxcmp("-mp", argv[i])) { pSt_StartlParam->nMQTTPort = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-d",argv[i])) + else if (0 == _tcsxcmp("-d",argv[i])) { pSt_StartlParam->bDeamon = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-t", argv[i])) + else if (0 == _tcsxcmp("-t", argv[i])) { bIsTest = true; } - else if (0 == _tcsxicmp("-lt", argv[i])) + else if (0 == _tcsxcmp("-lt", argv[i])) { pSt_StartlParam->st_XLog.nLogType = _ttxoi(argv[++i]); } - else if (0 == _tcsxicmp("-l", argv[i])) + else if (0 == _tcsxcmp("-l", argv[i])) { LPCXSTR lpszLogLevel = argv[++i]; - if (0 == _tcsxicmp("debug", lpszLogLevel)) + if (0 == _tcsxcmp("debug", lpszLogLevel)) { pSt_StartlParam->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DETAIL; } - else if (0 == _tcsxicmp("detail", lpszLogLevel)) + else if (0 == _tcsxcmp("detail", lpszLogLevel)) { pSt_StartlParam->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DETAIL; } - else if (0 == _tcsxicmp("info", lpszLogLevel)) + else if (0 == _tcsxcmp("info", lpszLogLevel)) { pSt_StartlParam->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO; } diff --git a/XEngine_Source/XEngine_MQServiceApp/MQService_HTTPTask/MQService_HTTPPost.cpp b/XEngine_Source/XEngine_MQServiceApp/MQService_HTTPTask/MQService_HTTPPost.cpp index 240bc34..7e75528 100644 --- a/XEngine_Source/XEngine_MQServiceApp/MQService_HTTPTask/MQService_HTTPPost.cpp +++ b/XEngine_Source/XEngine_MQServiceApp/MQService_HTTPTask/MQService_HTTPPost.cpp @@ -15,8 +15,6 @@ bool MessageQueue_HttpTask_Post(LPCXSTR lpszClientAddr, LPCXSTR lpszFuncName, LP int nSDLen = 0; XNETHANDLE xhToken = 0; XCHAR tszSDBuffer[1024] = {}; - XCHAR tszKeyStr[XPATH_MAX] = {}; - XCHAR tszVluStr[XPATH_MAX] = {}; LPCXSTR lpszAPIRegister = _X("register"); LPCXSTR lpszAPIGetUser = _X("getuser"); LPCXSTR lpszAPIGetTopic = _X("gettopic"); @@ -59,7 +57,7 @@ bool MessageQueue_HttpTask_Post(LPCXSTR lpszClientAddr, LPCXSTR lpszFuncName, LP memset(&st_HTTPParament, '\0', sizeof(XCLIENT_APIHTTP)); st_HTTPParament.nTimeConnect = 2; - ProtocolModule_Packet_PassUser(&st_UserInfo, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERREG); + ProtocolModule_Packet_PassUser(&st_UserInfo, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQREGISTER); APIClient_Http_Request(_X("POST"), st_ServiceCfg.st_XPass.tszPassRegister, tszSDBuffer, &nHTTPCode, NULL, NULL, NULL, NULL, &st_HTTPParament); if (200 != nHTTPCode) { @@ -188,7 +186,7 @@ bool MessageQueue_HttpTask_Post(LPCXSTR lpszClientAddr, LPCXSTR lpszFuncName, LP st_HTTPParament.nTimeConnect = 2; - ProtocolModule_Packet_PassUser(&st_UserInfo, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERDEL); + ProtocolModule_Packet_PassUser(&st_UserInfo, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQDELETE); APIClient_Http_Request(_X("POST"), st_ServiceCfg.st_XPass.tszPassUNReg, tszSDBuffer, &nHTTPCode, NULL, NULL, NULL, NULL, &st_HTTPParament); if (200 != nHTTPCode) { diff --git a/XEngine_Source/XEngine_MQServiceApp/MQService_MQTTTask.cpp b/XEngine_Source/XEngine_MQServiceApp/MQService_MQTTTask.cpp index ee1e8fa..332eb72 100644 --- a/XEngine_Source/XEngine_MQServiceApp/MQService_MQTTTask.cpp +++ b/XEngine_Source/XEngine_MQServiceApp/MQService_MQTTTask.cpp @@ -93,7 +93,7 @@ bool MQService_MQTT_Handle(LPCXSTR lpszClientAddr, MQTTPROTOCOL_FIXEDHEADER* pSt XENGINE_PROTOCOL_USERAUTH st_ProtocolAuth = {}; st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER; st_ProtocolHdr.unOperatorType = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_AUTH; - st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG; + st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGIN; st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_USERAUTH); st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL; diff --git a/XEngine_Source/XEngine_MQServiceApp/MQService_Net.cpp b/XEngine_Source/XEngine_MQServiceApp/MQService_Net.cpp index 65ec8c2..d792521 100644 --- a/XEngine_Source/XEngine_MQServiceApp/MQService_Net.cpp +++ b/XEngine_Source/XEngine_MQServiceApp/MQService_Net.cpp @@ -149,7 +149,7 @@ void XEngine_MQXService_Close(LPCXSTR lpszClientAddr, int nIPProto, bool bHeart) st_HTTPParament.nTimeConnect = 2; - ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSEROUT); + ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGOUT); APIClient_Http_Request(_X("POST"), st_ServiceCfg.st_XPass.tszPassLogout, tszSDBuffer, &nHTTPCode, NULL, NULL, NULL, NULL, &st_HTTPParament); if (200 == nHTTPCode) { diff --git a/XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp b/XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp index 6349207..01a29e2 100644 --- a/XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp +++ b/XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp @@ -79,7 +79,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC } else if (ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_AUTH == pSt_ProtocolHdr->unOperatorType) { - if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG == pSt_ProtocolHdr->unOperatorCode) + if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGIN == pSt_ProtocolHdr->unOperatorCode) { XENGINE_PROTOCOL_USERINFO st_UserInfo; XENGINE_PROTOCOL_USERAUTH st_ProtocolAuth; @@ -88,7 +88,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC memset(&st_ProtocolAuth, '\0', sizeof(XENGINE_PROTOCOL_USERAUTH)); memcpy(&st_ProtocolAuth, lpszMsgBuffer, sizeof(XENGINE_PROTOCOL_USERAUTH)); - pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSERLOG; + pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REPLOGIN; if (SessionModule_Client_GetAddr(st_ProtocolAuth.tszUserName)) { @@ -111,7 +111,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC memset(&st_HTTPParament, '\0', sizeof(XCLIENT_APIHTTP)); st_HTTPParament.nTimeConnect = 2; - ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG); + ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REPLOGIN); APIClient_Http_Request(_X("POST"), st_ServiceCfg.st_XPass.tszPassLogin, tszSDBuffer, &nHTTPCode, &ptszSDBuffer, &nSDLen, NULL, NULL, &st_HTTPParament); if (200 != nHTTPCode) { @@ -151,7 +151,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("%s客户端:%s,请求验证成功,用户名:%s,密码:%s"), lpszClientType, lpszClientAddr, st_ProtocolAuth.tszUserName, st_ProtocolAuth.tszUserPass); } - else if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSEROUT == pSt_ProtocolHdr->unOperatorCode) + else if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGOUT == pSt_ProtocolHdr->unOperatorCode) { XCHAR tszUserName[XPATH_MAX] = {}; XENGINE_PROTOCOL_USERINFO st_ProtocolInfo = {}; @@ -178,7 +178,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC _tcsxcpy(st_ProtocolAuth.tszUserPass, st_ProtocolInfo.tszUserPass); st_HTTPParament.nTimeConnect = 2; - ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSEROUT); + ProtocolModule_Packet_PassAuth(&st_ProtocolAuth, tszSDBuffer, &nSDLen, XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REPLOGOUT); APIClient_Http_Request(_X("POST"), st_ServiceCfg.st_XPass.tszPassLogout, tszSDBuffer, &nHTTPCode, NULL, NULL, NULL, NULL, &st_HTTPParament); if (200 == nHTTPCode) { diff --git a/XEngine_Source/XQueue_ProtocolHdr.h b/XEngine_Source/XQueue_ProtocolHdr.h index 04f80ef..6cbf109 100644 --- a/XEngine_Source/XQueue_ProtocolHdr.h +++ b/XEngine_Source/XQueue_ProtocolHdr.h @@ -42,15 +42,6 @@ #define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPTOPICBIND 0x7107 //回复 #define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQTOPICUNBIND 0x7108 //请求主题解绑操作 #define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPTOPICUNBIND 0x7109 //回复 -//用户协议 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERLOG 0x7020 //用户登录 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSERLOG 0x7021 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERREG 0x7022 //用户注册 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSERREG 0x7023 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSERDEL 0x7024 //用户删除 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSERDEL 0x7025 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQUSEROUT 0x7026 //用户注销 -#define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPUSEROUT 0x7027 //Only TCP and WEBSOCKET #define XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_MSGNOTIFY 0x70A0 //消息通知 ///////////////////////////////////////////////////////////////////////////