diff --git a/.github/workflows/RockyArm64_build.yml b/.github/workflows/RockyArm64_build.yml new file mode 100644 index 0000000000000000000000000000000000000000..43b7db58b0ef5ba25c93ed67e54a639e80ff414f --- /dev/null +++ b/.github/workflows/RockyArm64_build.yml @@ -0,0 +1,78 @@ +name: rocky Arm64 build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-24.04 + env: + IMAGE_NAME: rockylinux/rockylinux:9.5 + + strategy: + fail-fast: false + matrix: + arch: [linux/arm64] + + steps: + # 检出您的主仓库代码 + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build ${{ matrix.arch }} + run: | + docker run --platform ${{ matrix.arch }} --rm \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace ${{ env.IMAGE_NAME }} /bin/sh -c ' + set -e + dnf update -y + dnf install --allowerasing git make g++ wget curl jq unzip -y + + git config --global --add safe.directory /workspace + git submodule init + git submodule update + + 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_9_Arm64.zip + unzip ./XEngine_RockyLinux_9_Arm64.zip -d ./XEngine_RockyLinux_9_Arm64 + cd XEngine_RockyLinux_9_Arm64 + + chmod 777 ./XEngine_LINEnv.sh + ./XEngine_LINEnv.sh -i 0 + + cp -rf ./XEngine_Include /usr/local/include + find ./XEngine_Linux -name "*.so" -exec cp {} /usr/lib64 \; + ldconfig + cd .. + + cd XEngine_Source + make ARCH=Arm64 RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + cd .. + + cd XEngine_Release + ./XEngine_AuthorizeService -t + chown -R $(id -u):$(id -g) . + chmod -R a+r . ' + + - name: Upload folder as artifact with RockyLinux + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-RockyLinux-9-Arm64 + path: XEngine_Release/ + retention-days: 1 diff --git a/.github/workflows/RockyX86_64_build.yml b/.github/workflows/RockyX86_64_build.yml new file mode 100644 index 0000000000000000000000000000000000000000..0110fdfd7832621ebcc41d011e5ac372a745a055 --- /dev/null +++ b/.github/workflows/RockyX86_64_build.yml @@ -0,0 +1,83 @@ +name: rocky x86_64 build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + container: + image: rockylinux/rockylinux:9.5 + + steps: + # 检出您的主仓库代码 + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + # 检出依赖的xengine仓库到指定的xengine目录 + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + uses: actions/checkout@v4 + with: + repository: libxengine/XEngine_OPenSource + path: XEngine_Source/XEngine_Depend + + - name: install system package + run: | + dnf update -y + dnf install gcc g++ make git jq unzip -y + # 设置依赖库的环境变量 + - name: Set up Dependency rocky linux Environment + run: | + cd libxengine + chmod 777 * + ./XEngine_LINEnv.sh -i 0 + - 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_9_x86-64.zip + unzip ./XEngine_RockyLinux_9_x86-64.zip -d ./XEngine_RockyLinux_9_x86-64 + cd XEngine_RockyLinux_9_x86-64 + + cp -rf ./XEngine_Include /usr/local/include + find ./XEngine_Linux -name "*.so" -exec cp {} /usr/lib64 \; + ldconfig + + - 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_AuthorizeService -t + + - name: Upload folder as artifact with RockyLinux + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-RockyLinux-9-x86_64 + path: XEngine_Release/ + retention-days: 1 diff --git a/.github/workflows/UbuntuArm64_build.yml b/.github/workflows/UbuntuArm64_build.yml new file mode 100644 index 0000000000000000000000000000000000000000..6fa5c39cc299d05464822f3b6edc0cf3a4f996ed --- /dev/null +++ b/.github/workflows/UbuntuArm64_build.yml @@ -0,0 +1,74 @@ +name: ubuntu Arm64 build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-24.04 + env: + IMAGE_NAME: ubuntu:24.04 + + strategy: + fail-fast: false + matrix: + arch: [linux/arm64] + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build ${{ matrix.arch }} + run: | + docker run --platform ${{ matrix.arch }} --rm \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace ${{ env.IMAGE_NAME }} /bin/sh -c ' + set -e + apt update -y + apt install git make g++ wget curl jq unzip -y + + git config --global --add safe.directory /workspace + git submodule init + git submodule update + + 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_24.04_Arm64.zip + unzip ./XEngine_UBuntu_24.04_Arm64.zip -d ./XEngine_UBuntu_24.04_Arm64 + cd XEngine_UBuntu_24.04_Arm64 + + chmod 777 ./XEngine_LINEnv.sh + ./XEngine_LINEnv.sh -i 0 + + cp -rf ./XEngine_Include /usr/local/include + find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \; + ldconfig + cd .. + + cd XEngine_Source + make ARCH=Arm64 RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + cd .. + + cd XEngine_Release + ./XEngine_AuthorizeService -t + chown -R $(id -u):$(id -g) . + chmod -R a+r . ' + + - name: Upload folder as artifact with ubuntu Arm64 + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-Ubuntu-24.04-Arm64 + path: XEngine_Release/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/ubuntubuild.yml b/.github/workflows/UbuntuX86_64_build.yml similarity index 93% rename from .github/workflows/ubuntubuild.yml rename to .github/workflows/UbuntuX86_64_build.yml index 65ae3ecf748e595286e2c216691805b8a4c59069..308c77100aa0c5f0dc44c0672c6b5fd948468a51 100644 --- a/.github/workflows/ubuntubuild.yml +++ b/.github/workflows/UbuntuX86_64_build.yml @@ -1,4 +1,4 @@ -name: ubuntu build workflows +name: ubuntu x86_64 build workflows on: push: @@ -81,9 +81,11 @@ jobs: with: name: XEngine_AuthorizeService-x86_64-Ubuntu-22.04 path: XEngine_Release/ + retention-days: 1 - name: Upload folder as artifact with ubuntu24.04 if: matrix.os == 'ubuntu-24.04' uses: actions/upload-artifact@v4 with: - name: XEngine_AuthorizeService-x86_64-Ubuntu-24.04 - path: XEngine_Release/ \ No newline at end of file + name: XEngine_AuthorizeService-Ubuntu-24.04-x86_64 + path: XEngine_Release/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000000000000000000000000000000000..1716d18f798a3ea3bf5f50c3753e0f31e749c49d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,62 @@ +name: CodeQL Advanced + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +jobs: + analyze: + runs-on: ubuntu-24.04 + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: 'develop' + + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + run: | + git submodule init + git submodule update + + - name: Set up Dependency Environment + run: | + cd libxengine + chmod +x ./XEngine_LINEnv.sh + sudo ./XEngine_LINEnv.sh -i 3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: make + run: | + cd XEngine_Source + make + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml index 52f11fa4a21681c2e61d5e584cfaab15a99a5b82..1af2a409389d3c8c2886b95674cd8f34b5f3763a 100644 --- a/.github/workflows/macbuild.yml +++ b/.github/workflows/macbuild.yml @@ -86,9 +86,11 @@ jobs: with: name: XEngine_AuthorizeService-x86_64-Mac path: XEngine_Release/ + retention-days: 1 - name: Upload folder as artifact with mac arm if: matrix.os == 'macos-14' uses: actions/upload-artifact@v4 with: - name: XEngine_AuthorizeService-Arm64-Mac - path: XEngine_Release/ \ No newline at end of file + name: XEngine_AuthorizeService-Mac-Arm64 + path: XEngine_Release/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 6396a77ad728ddaf647dc11e2288a7b828cc45ac..a88d1b89d82131815223598eeb2d369492a7f11f 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: configuration: [Debug ,Release] - platform: [x86 ,x64] + platform: [x86 ,x64 ,ARM64] runs-on: windows-latest # 最新的 Windows 环境 @@ -59,7 +59,21 @@ jobs: 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 up Dependency ARM64 Environment + if: matrix.platform == 'ARM64' + 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_Arm64.zip" + Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_Arm64.zip" + Expand-Archive -Path ./XEngine_Windows_Arm64.zip -DestinationPath ./XEngine_Windows -Force + + echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LibArm64=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh + - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 @@ -85,17 +99,34 @@ jobs: cd XEngine_Release ./VSCopy_x64.bat shell: pwsh + - name: Conditional Step for Arm64 Release + if: matrix.configuration == 'Release' && matrix.platform == 'Arm64' + run: | + cp -r XEngine_Source/ARM64/Release/*.dll XEngine_Release/ + cp -r XEngine_Source/ARM64/Release/*.exe XEngine_Release/ + cp -r XEngine_Source/VSCopy_Arm64.bat XEngine_Release/ + cd XEngine_Release + ./VSCopy_Arm64.bat + shell: pwsh - name: Upload folder as artifact with x86 if: matrix.configuration == 'Release' && matrix.platform == 'x86' uses: actions/upload-artifact@v4 with: - name: XEngine_AuthorizeService-x86_32-Windows + name: XEngine_AuthorizeService-Windows-x86_32 path: XEngine_Release/ - + retention-days: 1 - name: Upload folder as artifact with x64 if: matrix.configuration == 'Release' && matrix.platform == 'x64' uses: actions/upload-artifact@v4 with: - name: XEngine_AuthorizeService-x86_64-Windows - path: XEngine_Release/ \ No newline at end of file + name: XEngine_AuthorizeService-Windows-x86_64 + path: XEngine_Release/ + retention-days: 1 + - name: Upload folder as artifact with Arm64 + if: matrix.configuration == 'Release' && matrix.platform == 'Arm64' + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-Windows-Arm64 + path: XEngine_Release/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc4fe30d432365b677167b3840494a644f1074b5..7ca74d714ba763f6159465e06d9173546ea71535 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,37 @@ jobs: with: fetch-depth: 0 - - name: Download ubuntubuild + - name: Download Ubuntu x86_64 build uses: dawidd6/action-download-artifact@v6 with: - workflow: ubuntubuild.yml + workflow: UbuntuX86_64_build.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download Ubuntu Arm64 build + uses: dawidd6/action-download-artifact@v6 + with: + workflow: UbuntuArm64_build.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download RockyLinux x86_64 build + uses: dawidd6/action-download-artifact@v6 + with: + workflow: RockyX86_64_build.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download RockyLinux Arm64 build + uses: dawidd6/action-download-artifact@v6 + with: + workflow: RockyArm64_build.yml workflow_conclusion: success check_artifacts: false skip_unpack: true diff --git a/CHANGELOG b/CHANGELOG index 8875a7c77d0642ae8b5ffb762c4075975f02b902..18e9296e59cec659dc10ed69cc032b7c2647d068 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,25 @@ +XEngine_Authorize V3.17.0.1001 + +added:option method for http +added:tcp and websocket and http heartbeat and disable and enable support +added:multi login for day supported +added:hardware code login and switch support +added:type print set configure for log +modify:user and code query merge to user functions +update:depend library +improved:parameter parse and more parameter supported +delete:not used time function for help module + +增加:HTTP OPTION方法支持 +增加:tcp websocket,http 心跳支持并且支持启用禁用 +增加:多端登录天数卡支持 +增加:硬件码登录以及开关支持 +增加:日志类型设置支持 +修改:用户名和用户码登录函数合并 +更新:第三方库 +优化:更多启动参数解析支持 +删除:没有使用的帮助模块时间函数 +================================================================ XEngine_Authorize V3.16.0.1001 更新:匹配XEngineV9 diff --git a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp index fd35cbc7b9d54269f37337791d45cffb72c5be73..4270a607ff6bab6404f32aafd9218f5d26f9588d 100644 --- a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp +++ b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp @@ -40,6 +40,7 @@ bool bRun = true; bool bLogin = true; bool bTimeOut = true; bool bEncrypto = false; +bool bHeart = true; XNETHANDLE xhToken = 0; int nDYCode = 0; @@ -53,6 +54,7 @@ __int64x nIDNumber = 511025111111111111; XHTHREAD AuthClient_Thread() { + time_t nTimeStart = time(NULL); while (bRun) { int nMsgLen = 0; @@ -98,6 +100,22 @@ XHTHREAD AuthClient_Thread() printf(_X("不明白的类型\n")); } } + if (bHeart) + { + time_t nTimeEnd = time(NULL); + if ((nTimeEnd - nTimeStart) > 2) + { + XENGINE_PROTOCOLHDR st_ProtocolHdr = {}; + st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER; + st_ProtocolHdr.unOperatorType = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_HEARTBEAT; + st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_HB_SYN; + st_ProtocolHdr.byVersion = 1; + st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL; + + nTimeStart = nTimeEnd; + XClient_TCPSelect_SendMsg(m_Socket, (LPCXSTR)&st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR)); + } + } std::this_thread::sleep_for(std::chrono::milliseconds(10)); } return 0; @@ -514,7 +532,7 @@ int main() AuthClient_GetPass(); AuthClient_GetTime(); - std::this_thread::sleep_for(std::chrono::seconds(10)); + std::this_thread::sleep_for(std::chrono::seconds(100)); AuthClient_Delete(); AuthClient_Try(); diff --git a/XEngine_Apps/Authorize_ClientModule/Authorize_ClientModule.cpp b/XEngine_Apps/Authorize_ClientModule/Authorize_ClientModule.cpp index 8b8f45419cdeb85a0171585c5f46470ad5f5a632..5e7422c8ec312ef8c7aa6e864782c6abf90c639e 100644 --- a/XEngine_Apps/Authorize_ClientModule/Authorize_ClientModule.cpp +++ b/XEngine_Apps/Authorize_ClientModule/Authorize_ClientModule.cpp @@ -21,7 +21,24 @@ using namespace std; //Windows::vs2022 x86 debug 编译即可 //Linux MACOS::g++ -std=c++17 -Wall -g Authorize_ClientModule.cpp -o Authorize_ClientModule.exe -L ../../XEngine_Release/ -lAuthorizeModule_Client -ljsoncpp -Wl,-rpath=../../XEngine_Release -int main() +int TestClient_HardLogin() +{ + if (!AuthClient_Connector_Connect(_X("127.0.0.1"), 5300)) + { + printf("AuthClient_Connector_Connect:%lX\n", AuthClient_GetLastError()); + return -1; + } + if (!AuthClient_Connector_Login("2FDWAD02JD2091", "")) + { + printf("AuthClient_Connector_Login:%lX\n", AuthClient_GetLastError()); + return -1; + } + + AuthClient_Connector_Close(); + return 0; +} + +int TestClient_TryLogin() { //插入查询 LPCXSTR lpszTryInsert = _X("http://127.0.0.1:5302/auth/user/try"); @@ -35,4 +52,10 @@ int main() printf("failed\n"); } return 0; +} +int main() +{ + TestClient_HardLogin(); + TestClient_TryLogin(); + return 0; } \ No newline at end of file diff --git a/XEngine_Docment/Docment_en.docx b/XEngine_Docment/Docment_en.docx index 778d4c407f2542ceeec02e95cafa9a5d1cad31f4..596ffd1714c9c3e6388ee9ee76ab7d68676ab868 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 9cebeca480f435fbb56d4b9a272b5bbc540396f7..5684b3169f334c64a102f2a9ae0d188dd6fa6079 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 b681a84c3204051c12119859cde713135f86e1b3..ce771e892775a3eff141ff75d14d6897a46190b3 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -12,6 +12,12 @@ "nWSThread":2, "nHTTPThread":2 }, + "XTime":{ + "nHeartCheck":3, + "nTCPTime":5, + "nWSTime":5, + "nHTTPTime":5 + }, "XVerification":{ "nTokenTimeout":3600, "nDynamicTimeout":30, @@ -44,7 +50,7 @@ "st_MulitLogin":{ "bSecond":true, "bTime":true, - "bDay":false, + "bDay":true, "bCustom":false } }, @@ -64,7 +70,8 @@ "tszLogFile":"./XEngine_XLog/XEngine_Authorize.log", "MaxSize":1024000, "MaxCount":10, - "LogLeave":32 + "LogLeave":32, + "nLogType":17 }, "XReport":{ "bEnable":true, diff --git a/XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json b/XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json index e74109294530eaa3287e44d4ef2f9af3c1d71f9d..fd166010ece2088ca5c2206290e137e42d3fa466 100644 --- a/XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json @@ -11,5 +11,6 @@ "bSwitchMulti":true, "bSwitchTry":true, "bSwitchBanned":true, - "bSwitchTokenLogin":true + "bSwitchTokenLogin":true, + "bSwitchHCLogin":true } \ No newline at end of file diff --git a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json index d3e31e5872af5aab775d713e1c259eb0412fd249..7244c24fe63729c2feeccca6066d121d7f7544ab 100644 --- a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json @@ -1,5 +1,6 @@ { "XVer":[ + "V3.17.0.1001 Build20250305", "V3.16.0.1001 Build20250113", "V3.15.0.1001 Build20241121", "V3.14.0.1001 Build20240920", diff --git a/XEngine_Release/XEngine_DataBase/SQL_User.db b/XEngine_Release/XEngine_DataBase/SQL_User.db index c16e079d0ce1e4588a5ff55226fa89d9b578d1ec..651450ed9be4ec802b95b71b5fb1e4e3c2b5d558 100644 Binary files a/XEngine_Release/XEngine_DataBase/SQL_User.db and b/XEngine_Release/XEngine_DataBase/SQL_User.db differ diff --git a/XEngine_SQL/mysql.sql b/XEngine_SQL/mysql.sql index 22e774e9d07e3f95916e52e8ab6d4b3444c2cfc9..492ed2b02ef06a08d7358a85aa04f442deed3e0d 100644 --- a/XEngine_SQL/mysql.sql +++ b/XEngine_SQL/mysql.sql @@ -1,17 +1,17 @@ /* - Navicat Premium Data Transfer + Navicat Premium Dump SQL - Source Server : 本地mysql + Source Server : mysql Source Server Type : MySQL - Source Server Version : 50726 - Source Host : localhost:3306 - Source Schema : xengine_authorize + Source Server Version : 80041 (8.0.41-0ubuntu0.24.04.1) + Source Host : 10.0.2.6:3306 + Source Schema : XEngine_Authorize Target Server Type : MySQL - Target Server Version : 50726 + Target Server Version : 80041 (8.0.41-0ubuntu0.24.04.1) File Encoding : 65001 - Date: 04/07/2024 20:51:48 + Date: 26/02/2025 14:14:00 */ SET NAMES utf8mb4; @@ -22,29 +22,28 @@ SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- DROP TABLE IF EXISTS `Authorize_Announcement`; CREATE TABLE `Authorize_Announcement` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `ID` int NOT NULL AUTO_INCREMENT, `tszContext` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, `tszCreateTime` date NULL DEFAULT NULL, PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_Announcement -- ---------------------------- - -- ---------------------------- -- Table structure for Authorize_BannedAddr -- ---------------------------- DROP TABLE IF EXISTS `Authorize_BannedAddr`; CREATE TABLE `Authorize_BannedAddr` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, - `bEnable` tinyint(4) NOT NULL, + `ID` int NOT NULL AUTO_INCREMENT, + `bEnable` tinyint NOT NULL, `tszIPAddr` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `tszLeftTime` datetime NULL DEFAULT NULL, `tszCreateTime` datetime NOT NULL, PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_BannedAddr @@ -55,33 +54,46 @@ CREATE TABLE `Authorize_BannedAddr` ( -- ---------------------------- DROP TABLE IF EXISTS `Authorize_BannedUser`; CREATE TABLE `Authorize_BannedUser` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `ID` int NOT NULL AUTO_INCREMENT, `bEnable` tinyint(1) NOT NULL, `tszUserName` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `tszLeftTime` datetime NULL DEFAULT NULL, `tszCreateTime` datetime NOT NULL, PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_BannedUser -- ---------------------------- +-- ---------------------------- +-- Table structure for Authorize_Login +-- ---------------------------- +DROP TABLE IF EXISTS `Authorize_Login`; +CREATE TABLE `Authorize_Login` ( + `UserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `UserAddr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `UserTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of Authorize_Login +-- ---------------------------- -- ---------------------------- -- Table structure for Authorize_Serial -- ---------------------------- DROP TABLE IF EXISTS `Authorize_Serial`; CREATE TABLE `Authorize_Serial` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `ID` int NOT NULL AUTO_INCREMENT, `UserName` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, `SerialNumber` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, `MaxTime` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, - `CardSerialType` int(11) NULL DEFAULT NULL, + `CardSerialType` int NULL DEFAULT NULL, `bIsUsed` tinyint(1) NULL DEFAULT NULL, `CreateTime` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_Serial @@ -92,14 +104,14 @@ CREATE TABLE `Authorize_Serial` ( -- ---------------------------- DROP TABLE IF EXISTS `Authorize_TempVer`; CREATE TABLE `Authorize_TempVer` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `ID` int NOT NULL AUTO_INCREMENT, `tszVSerial` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `nVMode` int(11) NOT NULL, - `nVTime` int(11) NOT NULL, - `nLTime` int(11) NOT NULL, + `nVMode` int NOT NULL, + `nVTime` int NOT NULL, + `nLTime` int NOT NULL, `CreateTime` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_TempVer @@ -110,41 +122,24 @@ CREATE TABLE `Authorize_TempVer` ( -- ---------------------------- DROP TABLE IF EXISTS `Authorize_User`; CREATE TABLE `Authorize_User` ( - `ID` int(11) NOT NULL AUTO_INCREMENT, + `ID` int NOT NULL AUTO_INCREMENT, `UserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名', `Password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码', `LeftTime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '剩余时间', `EmailAddr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '电子邮件', `HardCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '设备SN', - `CardSerialType` int(11) NOT NULL, - `PhoneNumber` bigint(20) NOT NULL COMMENT '电话号码', - `IDCard` bigint(20) NOT NULL COMMENT '身份证', - `nUserLevel` int(11) NOT NULL COMMENT '用户等级,数字越小越高', + `CardSerialType` int NOT NULL, + `PhoneNumber` bigint NOT NULL COMMENT '电话号码', + `IDCard` bigint NOT NULL COMMENT '身份证', + `nUserLevel` int NOT NULL COMMENT '用户等级,数字越小越高', `UPTime` datetime NULL DEFAULT NULL COMMENT '登录时间', `CreateTime` datetime NOT NULL COMMENT '注册时间', PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of Authorize_User -- ---------------------------- INSERT INTO `Authorize_User` VALUES (1, 'admin', '123123aa', '0', '486179@qq.com', 'DAFD2A2DAD', 1, 13699430000, 511025198881118888, 0, '2022-09-21 15:06:45', '2022-09-21 15:06:45'); --- ---------------------------- --- Table structure for Sqlite_Sequence --- ---------------------------- -DROP TABLE IF EXISTS `Sqlite_Sequence`; -CREATE TABLE `Sqlite_Sequence` ( - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, - `seq` int(11) NULL DEFAULT NULL -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of Sqlite_Sequence --- ---------------------------- -INSERT INTO `Sqlite_Sequence` VALUES ('Authorize_BannedUser', 6); -INSERT INTO `Sqlite_Sequence` VALUES ('Authorize_BannedAddr', 5); -INSERT INTO `Sqlite_Sequence` VALUES ('Authorize_TempVer', 1); -INSERT INTO `Sqlite_Sequence` VALUES ('Authorize_Serial', 10); -INSERT INTO `Sqlite_Sequence` VALUES ('Authorize_User', 5); SET FOREIGN_KEY_CHECKS = 1; diff --git a/XEngine_SQL/main.sql b/XEngine_SQL/sqlite.sql similarity index 79% rename from XEngine_SQL/main.sql rename to XEngine_SQL/sqlite.sql index 3af5b90392a62f1c564687c80cdcdac0c85a1426..d0532cd8c9eed4ff9001dceb773f795e94bebe3b 100644 --- a/XEngine_SQL/main.sql +++ b/XEngine_SQL/sqlite.sql @@ -1,16 +1,16 @@ /* - Navicat Premium Data Transfer + Navicat Premium Dump SQL - Source Server : authorize + Source Server : Authorize Source Server Type : SQLite - Source Server Version : 3035005 (3.35.5) + Source Server Version : 3045000 (3.45.0) Source Schema : main Target Server Type : SQLite - Target Server Version : 3035005 (3.35.5) + Target Server Version : 3045000 (3.45.0) File Encoding : 65001 - Date: 11/05/2024 16:06:07 + Date: 26/02/2025 14:13:16 */ PRAGMA foreign_keys = false; @@ -62,6 +62,20 @@ CREATE TABLE "Authorize_BannedUser" ( -- Records of Authorize_BannedUser -- ---------------------------- +-- ---------------------------- +-- Table structure for Authorize_Login +-- ---------------------------- +DROP TABLE IF EXISTS "Authorize_Login"; +CREATE TABLE "Authorize_Login" ( + "UserName" text NOT NULL, + "UserAddr" text NOT NULL, + "UserTime" text NOT NULL +); + +-- ---------------------------- +-- Records of Authorize_Login +-- ---------------------------- + -- ---------------------------- -- Table structure for Authorize_Serial -- ---------------------------- @@ -133,26 +147,26 @@ CREATE TABLE "sqlite_sequence" ( -- ---------------------------- -- Records of sqlite_sequence -- ---------------------------- -INSERT INTO "sqlite_sequence" VALUES ('Authorize_BannedUser', 6); -INSERT INTO "sqlite_sequence" VALUES ('Authorize_BannedAddr', 5); -INSERT INTO "sqlite_sequence" VALUES ('Authorize_TempVer', 1); -INSERT INTO "sqlite_sequence" VALUES ('Authorize_Serial', 10); -INSERT INTO "sqlite_sequence" VALUES ('Authorize_User', 5); +INSERT INTO "sqlite_sequence" VALUES ('Authorize_BannedUser', 7); +INSERT INTO "sqlite_sequence" VALUES ('Authorize_BannedAddr', 6); +INSERT INTO "sqlite_sequence" VALUES ('Authorize_TempVer', 4); +INSERT INTO "sqlite_sequence" VALUES ('Authorize_Serial', 22); +INSERT INTO "sqlite_sequence" VALUES ('Authorize_User', 20); -- ---------------------------- -- Auto increment value for Authorize_BannedAddr -- ---------------------------- -UPDATE "sqlite_sequence" SET seq = 5 WHERE name = 'Authorize_BannedAddr'; +UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'Authorize_BannedAddr'; -- ---------------------------- -- Auto increment value for Authorize_BannedUser -- ---------------------------- -UPDATE "sqlite_sequence" SET seq = 6 WHERE name = 'Authorize_BannedUser'; +UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'Authorize_BannedUser'; -- ---------------------------- -- Auto increment value for Authorize_Serial -- ---------------------------- -UPDATE "sqlite_sequence" SET seq = 10 WHERE name = 'Authorize_Serial'; +UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'Authorize_Serial'; -- ---------------------------- -- Auto increment value for Authorize_TempVer @@ -162,6 +176,6 @@ UPDATE "sqlite_sequence" SET seq = 1 WHERE name = 'Authorize_TempVer'; -- ---------------------------- -- Auto increment value for Authorize_User -- ---------------------------- -UPDATE "sqlite_sequence" SET seq = 5 WHERE name = 'Authorize_User'; +UPDATE "sqlite_sequence" SET seq = 2 WHERE name = 'Authorize_User'; PRAGMA foreign_keys = true; diff --git a/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj b/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj index b30a87aa3b008625e9285ef204a2be3d2cb3a1a8..eca66d91a8c82bea00032201905ebfd9f261c89c 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj +++ b/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 Unicode + + DynamicLibrary + true + v143 + Unicode + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + $(XEngine_Include);..\AuthorizeModule_CDKey;$(IncludePath) @@ -78,6 +105,10 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + $(XEngine_Include);$(IncludePath) $(XEngine_Lib32);$(LibraryPath) @@ -86,6 +117,10 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -146,6 +181,24 @@ AuthorizeModule_CDKey.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULECDKEY_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_CDKey.def + + Level3 @@ -170,6 +223,30 @@ AuthorizeModule_CDKey.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULECDKEY_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_CDKey.def + + @@ -185,8 +262,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp index 8316ed0fdb2b119d7438b11cdd3d6e025b3e43c3..370a155e2232799756e9e8d2ea0992f6579b9f1b 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp +++ b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp @@ -1089,7 +1089,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_WriteTime(LPCXSTR lpszFileKey, int nCount if (nCount > 0) { int nListCount = 0; - XCHAR** pptszListTime; + XCHAR** pptszListTime = NULL; //读取现有的 Authorize_CDKey_ReadTime(lpszFileKey, &pptszListTime, &nListCount); //是否大于14 >= 10 diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp index a5ad7c1cfcf3d8bec578dacd1bca23bc22d417d3..5835bba3e2b3c2a6012af86a75ce9347d8c877e4 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp @@ -86,6 +86,8 @@ bool CAuthClient_Connector::AuthClient_Connector_Close() pSTDThread->join(); } m_bLogin = false; + m_bAuth = false; + m_bHeart = false; XClient_TCPSelect_Close(m_hSocket); #endif return true; @@ -100,7 +102,7 @@ bool CAuthClient_Connector::AuthClient_Connector_Close() 意思:输出是否验证,如果登录成功但是参数为假.说明没有剩余时间了 返回值 类型:逻辑型 - 意思:是否成功 + 意思:是否登录,如果没有登录将返回假,登录成功才需要判断是否通过验证 备注: *********************************************************************/ bool CAuthClient_Connector::AuthClient_Connector_GetAuth(bool* pbAuth /* = NULL */) @@ -246,6 +248,32 @@ bool CAuthClient_Connector::AuthClient_Connector_Login(LPCXSTR lpszUser, LPCXSTR #endif return true; } +/******************************************************************** +函数名称:AuthClient_Connector_Heart +函数功能:启用禁用客户端心跳 + 参数.一:bEnable + In/Out:In + 类型:逻辑型 + 可空:Y + 意思:是启用还是禁用 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CAuthClient_Connector::AuthClient_Connector_Heart(bool bEnable /* = true */) +{ + AuthClient_IsErrorOccur = false; + + if (!m_bAuth) + { + AuthClient_IsErrorOccur = true; + AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_CLIENT_NOTAUTH; + return false; + } + m_bHeart = bEnable; + return true; +} ////////////////////////////////////////////////////////////////////////// // 保护函数 ////////////////////////////////////////////////////////////////////////// @@ -253,6 +281,8 @@ XHTHREAD CALLBACK CAuthClient_Connector::AuthClient_Connector_Thread(XPVOID lPar { CAuthClient_Connector* pClass_This = (CAuthClient_Connector*)lParam; + time_t nTimeStart = time(NULL); + #if (1 == _XAUTH_BUILD_SWITCH_CLIENT_TCP) while (pClass_This->m_bRun) { @@ -262,7 +292,9 @@ XHTHREAD CALLBACK CAuthClient_Connector::AuthClient_Connector_Thread(XPVOID lPar if (!XClient_TCPSelect_RecvPkt(pClass_This->m_hSocket, &ptszMsgBuffer, &nMsgLen, &st_ProtocolHdr)) { + pClass_This->m_bRun = false; pClass_This->m_bLogin = false; + pClass_This->m_bAuth = false; break; } XCHAR tszMsgBuffer[4096] = {}; @@ -280,6 +312,23 @@ XHTHREAD CALLBACK CAuthClient_Connector::AuthClient_Connector_Thread(XPVOID lPar { pClass_This->m_bAuth = false; } + //心跳支持 + if (pClass_This->m_bHeart) + { + time_t nTimeEnd = time(NULL); + if ((nTimeEnd - nTimeStart) > 2) + { + XENGINE_PROTOCOLHDR st_ProtocolHdr = {}; + st_ProtocolHdr.wHeader = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_HEADER; + st_ProtocolHdr.unOperatorType = ENUM_XENGINE_COMMUNICATION_PROTOCOL_TYPE_HEARTBEAT; + st_ProtocolHdr.unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_HB_SYN; + st_ProtocolHdr.byVersion = 1; + st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL; + + nTimeStart = nTimeEnd; + XClient_TCPSelect_SendMsg(pClass_This->m_hSocket, (LPCXSTR)&st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR)); + } + } std::this_thread::sleep_for(std::chrono::seconds(1)); } #endif diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.h b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.h index 2d0514707c02d5023c659b80eab6b73dd920d783..88f9e3837fa4b63191a230977705a3c57c9fbbb3 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.h +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.h @@ -27,12 +27,14 @@ public: bool AuthClient_Connector_Close(); bool AuthClient_Connector_GetAuth(bool* pbAuth = NULL); bool AuthClient_Connector_Login(LPCXSTR lpszUser, LPCXSTR lpszPass, int nDYCode = 0, XNETHANDLE xhToken = 0); + bool AuthClient_Connector_Heart(bool bEnable = true); protected: static XHTHREAD CALLBACK AuthClient_Connector_Thread(XPVOID lParam); private: bool m_bRun = false; bool m_bLogin = false; bool m_bAuth = false; + bool m_bHeart = false; XSOCKET m_hSocket = 0; XCHAR tszPassStr[128] = {}; private: diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_Define.h b/XEngine_Source/AuthorizeModule_Client/AuthClient_Define.h index 04a3515af1716e226ca084974474c21382351ca9..f67f63fa5e9155e93f2a5f941d7cdbacf1aa8208 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_Define.h +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_Define.h @@ -60,7 +60,7 @@ extern "C" bool AuthClient_Connector_Close(); 意思:输出是否验证,如果登录成功但是参数为假.说明没有剩余时间了 返回值 类型:逻辑型 - 意思:是否成功 + 意思:是否登录,如果没有登录将返回假,登录成功才需要判断是否通过验证 备注: *********************************************************************/ extern "C" bool AuthClient_Connector_GetAuth(bool* pbAuth = NULL); @@ -93,6 +93,20 @@ extern "C" bool AuthClient_Connector_GetAuth(bool* pbAuth = NULL); 备注: *********************************************************************/ extern "C" bool AuthClient_Connector_Login(LPCXSTR lpszUser, LPCXSTR lpszPass, int nDYCode = 0, XNETHANDLE xhToken = 0); +/******************************************************************** +函数名称:AuthClient_Connector_Heart +函数功能:启用禁用客户端心跳 + 参数.一:bEnable + In/Out:In + 类型:逻辑型 + 可空:Y + 意思:是启用还是禁用 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注:服务器开启了心跳,那么客户端也需要开启 +*********************************************************************/ +extern "C" bool AuthClient_Connector_Heart(bool bEnable = true); /************************************************************************/ /* 临时验证函数 */ /************************************************************************/ diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_Error.h b/XEngine_Source/AuthorizeModule_Client/AuthClient_Error.h index 61c2a54bebe42f1b0edb964e82b913d9de603240..9f9c2979f0ed1f48ba704daf1bbad63236599cff 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_Error.h +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_Error.h @@ -21,6 +21,7 @@ #define ERROR_AUTHORIZE_MODULE_CLIENT_RECV 0x0060002 //接受数据失败 #define ERROR_AUTHORIZE_MODULE_CLIENT_LOGIN 0x0060003 //登录失败,请查看错误码 #define ERROR_AUTHORIZE_MODULE_CLIENT_THREAD 0x0060004 //创建线程失败 +#define ERROR_AUTHORIZE_MODULE_CLIENT_NOTAUTH 0x0060005 //没有验证无法启用心跳 /************************************************************************/ /* HTTP验证错误 */ /************************************************************************/ diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp b/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp index f9804fa6c68e6c764811f97996718f4d6fb8668c..a670d58719a4bbfc9651101dcbf887db5c287d59 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp @@ -49,7 +49,6 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC return false; } #if (1 == _XAUTH_BUILD_SWITCH_CLIENT_HTTP) - int nHTTPCode = 0; XCHAR tszJsonStr[MAX_PATH] = {}; Json::Value st_JsonRoot; diff --git a/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.def b/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.def index 405148316214b596e37e793df5ba541f1aa0ba66..44b2beb2f82d96e84e0a27e879f5046b825c2921 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.def +++ b/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.def @@ -7,6 +7,7 @@ EXPORTS AuthClient_Connector_Close AuthClient_Connector_GetAuth AuthClient_Connector_Login + AuthClient_Connector_Heart AuthClient_HTTPVer_TryRequest AuthClient_HTTPVer_GetDCode \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj b/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj index 3d63672b6bf48879dc5dccf4c8ba75f6a7c2b85c..d1255bbcbd13b7cd97b7951873c57d623203c2ba 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj +++ b/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 Unicode + + DynamicLibrary + true + v143 + Unicode + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) @@ -82,10 +109,18 @@ $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -146,6 +181,24 @@ AuthorizeModule_Client.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULECLIENT_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Client.def + + Level3 @@ -170,6 +223,30 @@ AuthorizeModule_Client.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULECLIENT_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Client.def + + @@ -186,7 +263,9 @@ Create Create Create + Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_Client/pch.cpp b/XEngine_Source/AuthorizeModule_Client/pch.cpp index 7cfd6806caad5d62a2db9b5642a1453640e261a2..18899b63ba42ce007aa07ff9aebd0b6c14f795f0 100644 --- a/XEngine_Source/AuthorizeModule_Client/pch.cpp +++ b/XEngine_Source/AuthorizeModule_Client/pch.cpp @@ -47,6 +47,10 @@ extern "C" bool AuthClient_Connector_Login(LPCXSTR lpszUser, LPCXSTR lpszPass, i { return m_Connector.AuthClient_Connector_Login(lpszUser, lpszPass, nDYCode, xhToken); } +extern "C" bool AuthClient_Connector_Heart(bool bEnable) +{ + return m_Connector.AuthClient_Connector_Heart(bEnable); +} /************************************************************************/ /* 临时验证函数 */ /************************************************************************/ diff --git a/XEngine_Source/AuthorizeModule_Client/pch.h b/XEngine_Source/AuthorizeModule_Client/pch.h index 0c2c8c538da1055ac15527e2aea18130de03ab57..90f1f564186ebb708e041ffc06d3f97213276c7b 100644 --- a/XEngine_Source/AuthorizeModule_Client/pch.h +++ b/XEngine_Source/AuthorizeModule_Client/pch.h @@ -55,7 +55,6 @@ using namespace std; extern bool AuthClient_IsErrorOccur; extern XLONG AuthClient_dwErrorCode; - #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") #pragma comment(lib,"XEngine_Core/XEngine_Cryption") @@ -63,15 +62,19 @@ extern XLONG AuthClient_dwErrorCode; #pragma comment(lib,"XEngine_Client/XClient_APIHelp") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi") #ifdef _DEBUG -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Debug/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Debug/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Debug/jsoncpp") #endif #else -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Release/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Release/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Release/jsoncpp") #endif #endif diff --git a/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj b/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj index 8fac7588efc1dc90427096e155a874efad316c50..e41937b517d4c0b67a1cdf07d01ab2061a791fb8 100644 --- a/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj +++ b/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + DynamicLibrary + true + v143 + MultiByte + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + true @@ -85,11 +112,21 @@ $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + true + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + false $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + false + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -151,6 +188,24 @@ AuthorizeModule_Configure.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULECONFIGURE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Configure.def + + Level3 @@ -175,6 +230,30 @@ AuthorizeModule_Configure.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULECONFIGURE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + MultiThreadedDLL + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Configure.def + + @@ -189,7 +268,9 @@ Create Create Create + Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_Configure/Config_Define.h b/XEngine_Source/AuthorizeModule_Configure/Config_Define.h index 1741bde8133dc458ffccb0a836eae7ec9742b672..46bc8935fefef636a09b841ea0d4a08b9227549d 100644 --- a/XEngine_Source/AuthorizeModule_Configure/Config_Define.h +++ b/XEngine_Source/AuthorizeModule_Configure/Config_Define.h @@ -31,6 +31,13 @@ typedef struct int nWSThread; //WEBSOCKET业务线程个数 int nHTTPThread; //HTTP业务线程个数 }st_XMax; + struct + { + int nHeartCheck; //检测次数 + int nTCPTime; //TCP检测时间 + int nWSTime; //WEBSOCKET检测时间 + int nHTTPTime; //HTTP检测时间 + }st_XTime; struct { struct @@ -104,6 +111,7 @@ typedef struct int nMaxSize; //最大大小 int nMaxCount; //备份个数 int nLogLeave; //日志级别 + int nLogType; //日志类型 }st_XLog; struct { @@ -132,6 +140,7 @@ typedef struct bool bSwitchTry; //临时验证 bool bSwitchBanned; //黑名单 bool bSwitchTokenLogin; //TOKEN开关 + bool bSwitchHCLogin; //硬件码登录 }XENGINE_FUNCTIONSWITCH; ////////////////////////////////////////////////////////////////////////// // 导出的函数 diff --git a/XEngine_Source/AuthorizeModule_Configure/Config_Error.h b/XEngine_Source/AuthorizeModule_Configure/Config_Error.h index 7dbec020f43257d5c16dc67f9cccf863d8c6aecb..49404fadfbe64cadca06a80218d0beec85cc9228 100644 --- a/XEngine_Source/AuthorizeModule_Configure/Config_Error.h +++ b/XEngine_Source/AuthorizeModule_Configure/Config_Error.h @@ -19,4 +19,5 @@ #define ERROR_AUTHORIZE_MODULE_CONFIGURE_XSQL 0x0010007 #define ERROR_AUTHORIZE_MODULE_CONFIGURE_XLOG 0x0010008 #define ERROR_AUTHORIZE_MODULE_CONFIGURE_MALLOC 0x0010009 -#define ERROR_AUTHORIZE_MODULE_CONFIGURE_REPORT 0x001000A \ No newline at end of file +#define ERROR_AUTHORIZE_MODULE_CONFIGURE_REPORT 0x0010010 +#define ERROR_AUTHORIZE_MODULE_CONFIGURE_XTIME 0x0010011 \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp b/XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp index f736c2e8bf79fff8ce75721f151cbed2e338b4e7..c30b95ef6617edff2148f142c7559f0c69f64fd6 100644 --- a/XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp +++ b/XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp @@ -100,6 +100,18 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE pSt_ServerConfig->st_XMax.nTCPThread = st_JsonXMax["nTCPThread"].asInt(); pSt_ServerConfig->st_XMax.nWSThread = st_JsonXMax["nWSThread"].asInt(); pSt_ServerConfig->st_XMax.nHTTPThread = st_JsonXMax["nHTTPThread"].asInt(); + //时间配置 + if (st_JsonRoot["XTime"].empty() || (4 != st_JsonRoot["XTime"].size())) + { + Config_IsErrorOccur = true; + Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XTIME; + return false; + } + Json::Value st_JsonXTime = st_JsonRoot["XTime"]; + pSt_ServerConfig->st_XTime.nHeartCheck = st_JsonXTime["nHeartCheck"].asInt(); + pSt_ServerConfig->st_XTime.nTCPTime = st_JsonXTime["nTCPTime"].asInt(); + pSt_ServerConfig->st_XTime.nWSTime = st_JsonXTime["nWSTime"].asInt(); + pSt_ServerConfig->st_XTime.nHTTPTime = st_JsonXTime["nHTTPTime"].asInt(); //验证配置 if (st_JsonRoot["XVerification"].empty() || (9 != st_JsonRoot["XVerification"].size())) { @@ -173,7 +185,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE _tcsxcpy(pSt_ServerConfig->st_XSql.st_MYSQL.tszSQLUser, st_JsonXSql["SQLUser"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XSql.st_MYSQL.tszSQLPass, st_JsonXSql["SQLPass"].asCString()); //日志配置 - if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size())) + if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size())) { Config_IsErrorOccur = true; Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XLOG; @@ -183,6 +195,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt(); pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt(); pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt(); + pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["nLogType"].asInt(); _tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString()); if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size())) @@ -349,5 +362,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_Switch(LPCXSTR lpszConfigFile, pSt_ServerConfig->bSwitchTry = st_JsonRoot["bSwitchTry"].asBool(); pSt_ServerConfig->bSwitchBanned = st_JsonRoot["bSwitchBanned"].asBool(); pSt_ServerConfig->bSwitchTokenLogin = st_JsonRoot["bSwitchTokenLogin"].asBool(); + pSt_ServerConfig->bSwitchHCLogin = st_JsonRoot["bSwitchHCLogin"].asBool(); return true; } \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Configure/pch.h b/XEngine_Source/AuthorizeModule_Configure/pch.h index 002babf906fe5fd488fd2247820f7199dbca360c..7a87791b48e952d6d8d7ca51e3bd3e6afb080db8 100644 --- a/XEngine_Source/AuthorizeModule_Configure/pch.h +++ b/XEngine_Source/AuthorizeModule_Configure/pch.h @@ -40,15 +40,19 @@ extern XLONG Config_dwErrorCode; #ifdef _MSC_BUILD #ifdef _DEBUG -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Debug/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Debug/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Debug/jsoncpp") #endif #else -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Release/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Release/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Release/jsoncpp") #endif #endif diff --git a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.def b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.def index ca0bf350e12e1a706d3ef9766727b37b1ed0d5f8..8ccb2a138ce0cf28259a5e79ba060ada60e59d99 100644 --- a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.def +++ b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.def @@ -13,6 +13,8 @@ EXPORTS DBModule_SQLite_UserLeave DBModule_SQLite_UserSet DBModule_SQLite_UserList + DBModule_SQLite_UserLogin + DBModule_SQLite_QueryLogin DBModule_SQLite_SerialInsert DBModule_SQLite_SerialDelete @@ -47,6 +49,8 @@ EXPORTS DBModule_MySQL_UserLeave DBModule_MySQL_UserSet DBModule_MySQL_UserList + DBModule_MySQL_UserLogin + DBModule_MySQL_QueryLogin DBModule_MySQL_SerialInsert DBModule_MySQL_SerialDelete diff --git a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj index 4c1e6d5d6c39dd460708466113e97d5dd4370ef3..9fc665060352fd1857e4310667fd9122c008623a 100644 --- a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj +++ b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + DynamicLibrary + true + v143 + MultiByte + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + $(XEngine_Include);..\AuthorizeModule_Database;$(IncludePath) @@ -82,10 +109,18 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -146,6 +181,24 @@ AuthorizeModule_Database.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULEDATABASE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Database.def + + Level3 @@ -170,6 +223,30 @@ AuthorizeModule_Database.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULEDATABASE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Database.def + + @@ -185,8 +262,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp index 351cd90cf830070b80b12b41dca94473dfed8b90..f7a7abe3f47c207c8a41b8c15652756b5f2862fb 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp @@ -145,12 +145,17 @@ bool CDBModule_MySQL::DBModule_MySQL_UserRegister(AUTHREG_USERTABLE* pSt_UserInf 类型:数据结构指针 可空:Y 意思:如果为空NULL,那么将只判断此用户是否存在 + 参数.三:bUser + In/Out:Out + 类型:逻辑型 + 可空:Y + 意思:使用用户名查询还是硬件码 返回值 类型:逻辑型 意思:是否查询成功 备注: *********************************************************************/ -bool CDBModule_MySQL::DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo) +bool CDBModule_MySQL::DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo, bool bUser) { SQLPacket_IsErrorOccur = false; //查询 @@ -161,7 +166,14 @@ bool CDBModule_MySQL::DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USE XCHAR tszSQLStatement[1024]; //SQL语句 memset(tszSQLStatement, '\0', 1024); - _xstprintf(tszSQLStatement, _X("select * from `Authorize_User` where UserName = '%s'"), lpszUserName); + if (bUser) + { + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_User` WHERE UserName = '%s'"), lpszUserName); + } + else + { + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_User` WHERE HardCode = '%s'"), lpszUserName); + } if (!DataBase_MySQL_ExecuteQuery(xhData, &xhTable, tszSQLStatement, &nRow, &nColumn)) { SQLPacket_IsErrorOccur = true; @@ -552,6 +564,90 @@ bool CDBModule_MySQL::DBModule_MySQL_UserList(AUTHREG_USERTABLE*** pppSt_UserInf return true; } /******************************************************************** +函数名称:DBModule_MySQL_UserLogin +函数功能:用户登录信息记录 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CDBModule_MySQL::DBModule_MySQL_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + SQLPacket_IsErrorOccur = false; + + XCHAR tszSQLStatement[1024] = {}; + XCHAR tszTimeStr[128] = {}; + BaseLib_Time_TimeToStr(tszTimeStr, NULL, false); + + _xstprintf(tszSQLStatement, _X("INSERT INTO Authorize_Login(UserName, UserAddr, UserTime) values('%s','%s','%s')"), lpszUserName, lpszUserAddr, tszTimeStr); + + if (!DataBase_MySQL_Execute(xhData, tszSQLStatement)) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_ISFAILED; + return false; + } + return true; +} +/******************************************************************** +函数名称:DBModule_MySQL_QueryLogin +函数功能:用户登录记录查询 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CDBModule_MySQL::DBModule_MySQL_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + SQLPacket_IsErrorOccur = false; + + XCHAR tszSQLStatement[1024]; //SQL语句 + char** ppszResult = NULL; + __int64u nRow = 0; + __int64u nColumn = 0; + XNETHANDLE xhTable = 0; + memset(tszSQLStatement, '\0', 1024); + + XCHAR tszTimeStr[128] = {}; + BaseLib_Time_TimeToStr(tszTimeStr, NULL, false); + + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_Login` WHERE UserName = '%s' AND UserTime = '%s' AND UserAddr = '%s'"), lpszUserName, tszTimeStr, lpszUserAddr); + if (!DataBase_MySQL_ExecuteQuery(xhData, &xhTable, tszSQLStatement, &nRow, &nColumn)) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_GETTABLE; + return false; + } + if (nRow <= 0) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_NOTMATCH; + return false; + } + ppszResult = DataBase_MySQL_GetResult(xhData, xhTable); + return true; +} +/******************************************************************** 函数名称:DBModule_MySQL_SerialInsert 函数功能:插入一个序列号到数据库 参数.一:lpszSerialNumber diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.h b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.h index f0957e243be088e5788caaee87abac4e092789fc..1f0986b97a4ed4caf2001201b244aa8c5a3b0778 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.h +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.h @@ -25,11 +25,13 @@ public: public: bool DBModule_MySQL_UserDelete(XENGINE_PROTOCOL_USERINFO* pSt_UserInfo); //删除用户 bool DBModule_MySQL_UserRegister(AUTHREG_USERTABLE* pSt_UserInfo); //用户注册 - bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo = NULL); //用户查询 + bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo = NULL, bool bUser = true); bool DBModule_MySQL_UserPay(LPCXSTR lpszUserName, LPCXSTR lpszSerialName); //充值卡充值 bool DBModule_MySQL_UserLeave(AUTHREG_PROTOCOL_TIME* pSt_TimeProtocol); //用户离开更新表 bool DBModule_MySQL_UserSet(AUTHREG_USERTABLE* pSt_UserTable); //设置用户信息 bool DBModule_MySQL_UserList(AUTHREG_USERTABLE*** pppSt_UserInfo, int* pInt_ListCount, int nPosStart, int nPosEnd); //获取用户列表 + bool DBModule_MySQL_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); + bool DBModule_MySQL_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); public: bool DBModule_MySQL_SerialInsert(LPCXSTR lpszSerialNumber); //插入序列卡 bool DBModule_MySQL_SerialDelete(LPCXSTR lpszSerialNumber); //删除一个序列号 diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp index e3419eedc0156e410ee0e005dbba7a2ea5af617b..80d13c6b5a099fed6e2a249cd9de2b8f80006e94 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp @@ -148,21 +148,35 @@ bool CDBModule_SQLite::DBModule_SQLite_UserRegister(AUTHREG_USERTABLE* pSt_UserI 类型:数据结构指针 可空:Y 意思:如果为空NULL,那么将只判断此用户是否存在 + 参数.三:bUser + In/Out:Out + 类型:逻辑型 + 可空:Y + 意思:使用用户名查询还是硬件码 返回值 类型:逻辑型 意思:是否查询成功 备注: *********************************************************************/ -bool CDBModule_SQLite::DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo /* = NULL */) +bool CDBModule_SQLite::DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo /* = NULL */, bool bUser /* = true */) { SQLPacket_IsErrorOccur = false; + XCHAR tszSQLStatement[1024]; //SQL语句 char** ppszResult = NULL; int nRow = 0; int nColumn = 0; memset(tszSQLStatement, '\0', 1024); - _xstprintf(tszSQLStatement, _X("select * from Authorize_User where UserName = '%s'"), lpszUserName); + if (bUser) + { + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_User` WHERE UserName = '%s'"), lpszUserName); + } + else + { + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_User` WHERE HardCode = '%s'"), lpszUserName); + } + if (!DataBase_SQLite_GetTable(xhData, tszSQLStatement, &ppszResult, &nRow, &nColumn)) { SQLPacket_IsErrorOccur = true; @@ -502,6 +516,88 @@ bool CDBModule_SQLite::DBModule_SQLite_UserList(AUTHREG_USERTABLE*** pppSt_UserI return true; } /******************************************************************** +函数名称:DBModule_SQLite_UserLogin +函数功能:用户登录信息记录 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CDBModule_SQLite::DBModule_SQLite_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + SQLPacket_IsErrorOccur = false; + + XCHAR tszSQLStatement[1024] = {}; + XCHAR tszTimeStr[128] = {}; + BaseLib_Time_TimeToStr(tszTimeStr, NULL, false); + + _xstprintf(tszSQLStatement, _X("INSERT INTO Authorize_Login(UserName, UserAddr, UserTime) values('%s','%s','%s')"), lpszUserName, lpszUserAddr, tszTimeStr); + if (!DataBase_SQLite_Exec(xhData, tszSQLStatement)) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_INSERT; + return false; + } + return true; +} +/******************************************************************** +函数名称:DBModule_SQLite_QueryLogin +函数功能:用户登录记录查询 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +bool CDBModule_SQLite::DBModule_SQLite_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + SQLPacket_IsErrorOccur = false; + + XCHAR tszSQLStatement[1024]; //SQL语句 + char** ppszResult = NULL; + int nRow = 0; + int nColumn = 0; + memset(tszSQLStatement, '\0', 1024); + + XCHAR tszTimeStr[128] = {}; + BaseLib_Time_TimeToStr(tszTimeStr, NULL, false); + + _xstprintf(tszSQLStatement, _X("SELECT * FROM `Authorize_Login` WHERE UserName = '%s' AND UserTime = '%s' AND UserAddr = '%s'"), lpszUserName, tszTimeStr, lpszUserAddr); + if (!DataBase_SQLite_GetTable(xhData, tszSQLStatement, &ppszResult, &nRow, &nColumn)) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_GETTABLE; + return false; + } + if ((0 == nRow) || (0 == nColumn)) + { + SQLPacket_IsErrorOccur = true; + SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_NOTUSER; + return false; + } + DataBase_SQLite_FreeTable(ppszResult); + return true; +} +/******************************************************************** 函数名称:DBModule_SQLite_SerialInsert 函数功能:插入一个序列号到数据库 参数.一:lpszSerialNumber diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.h b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.h index 02580455c1e4e061f9bd7fb459b2df2aef0e0bab..bfc3ee718d3acf8d8533a14580e4e15ccd65e699 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.h +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.h @@ -25,11 +25,13 @@ public: public: bool DBModule_SQLite_UserDelete(XENGINE_PROTOCOL_USERINFO* pSt_UserInfo); //删除用户 bool DBModule_SQLite_UserRegister(AUTHREG_USERTABLE*pSt_UserInfo); //用户注册 - bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo = NULL); //用户查询 + bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo = NULL, bool bUser = true); bool DBModule_SQLite_UserPay(LPCXSTR lpszUserName,LPCXSTR lpszSerialName); //充值卡充值 bool DBModule_SQLite_UserLeave(AUTHREG_PROTOCOL_TIME* pSt_TimeProtocol); //用户离开更新表 bool DBModule_SQLite_UserSet(AUTHREG_USERTABLE* pSt_UserTable); bool DBModule_SQLite_UserList(AUTHREG_USERTABLE*** pppSt_UserInfo, int* pInt_ListCount, int nPosStart, int nPosEnd); + bool DBModule_SQLite_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); + bool DBModule_SQLite_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); public: bool DBModule_SQLite_SerialInsert(LPCXSTR lpszSerialNumber); //插入序列卡 bool DBModule_SQLite_SerialDelete(LPCXSTR lpszSerialNumber); //删除一个序列号 diff --git a/XEngine_Source/AuthorizeModule_Database/Database_Define.h b/XEngine_Source/AuthorizeModule_Database/Database_Define.h index a25c0735f3ae51386d93d83281120547a1270717..b4b8dd08a605ed191cdc8f321be89aebbda8acda 100644 --- a/XEngine_Source/AuthorizeModule_Database/Database_Define.h +++ b/XEngine_Source/AuthorizeModule_Database/Database_Define.h @@ -86,12 +86,17 @@ extern "C" bool DBModule_SQLite_UserRegister(AUTHREG_USERTABLE * pSt_UserInfo); 类型:数据结构指针 可空:Y 意思:如果为空NULL,那么将只判断此用户是否存在 + 参数.三:bUser + In/Out:Out + 类型:逻辑型 + 可空:Y + 意思:使用用户名查询还是硬件码 返回值 类型:逻辑型 意思:是否查询成功 备注: *********************************************************************/ -extern "C" bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName,AUTHREG_USERTABLE *pSt_UserInfo); +extern "C" bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName,AUTHREG_USERTABLE *pSt_UserInfo, bool bUser = true); /******************************************************************** 函数名称:DBModule_SQLite_UserPay 函数功能:用户充值函数 @@ -169,6 +174,44 @@ extern "C" bool DBModule_SQLite_UserSet(AUTHREG_USERTABLE* pSt_UserTable); *********************************************************************/ extern "C" bool DBModule_SQLite_UserList(AUTHREG_USERTABLE*** pppSt_UserInfo, int* pInt_ListCount, int nPosStart, int nPosEnd); /******************************************************************** +函数名称:DBModule_SQLite_UserLogin +函数功能:用户登录信息记录 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool DBModule_SQLite_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); +/******************************************************************** +函数名称:DBModule_SQLite_QueryLogin +函数功能:用户登录记录查询 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool DBModule_SQLite_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); +/******************************************************************** 函数名称:DBModule_SQLite_SerialInsert 函数功能:插入一个序列号到数据库 参数.一:lpszSerialNumber @@ -575,12 +618,17 @@ extern "C" bool DBModule_MySQL_UserRegister(AUTHREG_USERTABLE* pSt_UserInfo); 类型:数据结构指针 可空:Y 意思:如果为空NULL,那么将只判断此用户是否存在 + 参数.三:bUser + In/Out:Out + 类型:逻辑型 + 可空:Y + 意思:使用用户名查询还是硬件码 返回值 类型:逻辑型 意思:是否查询成功 备注: *********************************************************************/ -extern "C" bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo); +extern "C" bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo, bool bUser = true); /******************************************************************** 函数名称:DBModule_MySQL_UserPay 函数功能:用户充值函数 @@ -993,3 +1041,41 @@ extern "C" bool DBModule_MySQL_AnnouncementDelete(AUTHREG_ANNOUNCEMENT* pSt_Anno 备注: *********************************************************************/ extern "C" bool DBModule_MySQL_AnnouncementList(AUTHREG_ANNOUNCEMENT*** ppppSt_Announcement, int* pInt_ListCount); +/******************************************************************** +函数名称:DBModule_MySQL_UserLogin +函数功能:用户登录信息记录 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool DBModule_MySQL_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); +/******************************************************************** +函数名称:DBModule_MySQL_QueryLogin +函数功能:用户登录记录查询 + 参数.一:lpszUserName + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户名 + 参数.二:lpszUserAddr + In/Out:In + 类型:常量字符指针 + 可空:N + 意思:用户IP地址 +返回值 + 类型:逻辑型 + 意思:是否成功 +备注: +*********************************************************************/ +extern "C" bool DBModule_MySQL_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr); \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Database/pch.cpp b/XEngine_Source/AuthorizeModule_Database/pch.cpp index 19cf22c2e6d87ecbb29e6ef9ddd571822b731bac..7fe6db08b8ab287c39cda053baab119b6957a2cf 100644 --- a/XEngine_Source/AuthorizeModule_Database/pch.cpp +++ b/XEngine_Source/AuthorizeModule_Database/pch.cpp @@ -47,9 +47,9 @@ extern "C" bool DBModule_SQLite_UserRegister(AUTHREG_USERTABLE * pSt_UserInfo) { return m_DBSQLite.DBModule_SQLite_UserRegister(pSt_UserInfo); } -extern "C" bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE * pSt_UserInfo) +extern "C" bool DBModule_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE * pSt_UserInfo, bool bUser) { - return m_DBSQLite.DBModule_SQLite_UserQuery(lpszUserName, pSt_UserInfo); + return m_DBSQLite.DBModule_SQLite_UserQuery(lpszUserName, pSt_UserInfo, bUser); } extern "C" bool DBModule_SQLite_UserPay(LPCXSTR lpszUserName, LPCXSTR lpszSerialName) { @@ -67,6 +67,14 @@ extern "C" bool DBModule_SQLite_UserList(AUTHREG_USERTABLE * **pppSt_UserInfo, i { return m_DBSQLite.DBModule_SQLite_UserList(pppSt_UserInfo, pInt_ListCount, nPosStart, nPosEnd); } +extern "C" bool DBModule_SQLite_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + return m_DBSQLite.DBModule_SQLite_UserLogin(lpszUserName, lpszUserAddr); +} +extern "C" bool DBModule_SQLite_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + return m_DBSQLite.DBModule_SQLite_QueryLogin(lpszUserName, lpszUserAddr); +} extern "C" bool DBModule_SQLite_SerialInsert(LPCXSTR lpszSerialNumber) { return m_DBSQLite.DBModule_SQLite_SerialInsert(lpszSerialNumber); @@ -143,7 +151,6 @@ extern "C" bool DBModule_SQLite_AnnouncementList(AUTHREG_ANNOUNCEMENT * **ppppSt { return m_DBSQLite.DBModule_SQLite_AnnouncementList(ppppSt_Announcement, pInt_ListCount); } - /************************************************************************/ /* MYSQL数据库服务导出函数 */ /************************************************************************/ @@ -163,9 +170,9 @@ extern "C" bool DBModule_MySQL_UserRegister(AUTHREG_USERTABLE* pSt_UserInfo) { return m_DBMySQL.DBModule_MySQL_UserRegister(pSt_UserInfo); } -extern "C" bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo) +extern "C" bool DBModule_MySQL_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo, bool bUser) { - return m_DBMySQL.DBModule_MySQL_UserQuery(lpszUserName, pSt_UserInfo); + return m_DBMySQL.DBModule_MySQL_UserQuery(lpszUserName, pSt_UserInfo, bUser); } extern "C" bool DBModule_MySQL_UserPay(LPCXSTR lpszUserName, LPCXSTR lpszSerialName) { @@ -258,4 +265,12 @@ extern "C" bool DBModule_MySQL_AnnouncementDelete(AUTHREG_ANNOUNCEMENT* pSt_Anno extern "C" bool DBModule_MySQL_AnnouncementList(AUTHREG_ANNOUNCEMENT*** ppppSt_Announcement, int* pInt_ListCount) { return m_DBMySQL.DBModule_MySQL_AnnouncementList(ppppSt_Announcement, pInt_ListCount); +} +extern "C" bool DBModule_MySQL_UserLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + return m_DBMySQL.DBModule_MySQL_UserLogin(lpszUserName, lpszUserAddr); +} +extern "C" bool DBModule_MySQL_QueryLogin(LPCXSTR lpszUserName, LPCXSTR lpszUserAddr) +{ + return m_DBMySQL.DBModule_MySQL_QueryLogin(lpszUserName, lpszUserAddr); } \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Database/pch.h b/XEngine_Source/AuthorizeModule_Database/pch.h index ea92281999e3d441bb4a65ad91a4aae865295109..3172cd7513cb48fb6f82791d8ad99f39d9546686 100644 --- a/XEngine_Source/AuthorizeModule_Database/pch.h +++ b/XEngine_Source/AuthorizeModule_Database/pch.h @@ -49,16 +49,20 @@ extern XLONG SQLPacket_dwErrorCode; #ifdef _WINDOWS #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") #pragma comment(lib,"XEngine_HelpComponents/HelpComponents_DataBase.lib") -#ifdef _WIN64 #ifdef _DEBUG +#ifdef _M_X64 #pragma comment(lib,"../x64/Debug/AuthorizeModule_CDKey") -#else -#pragma comment(lib,"../x64/Release/AuthorizeModule_CDKey") -#endif -#else -#ifdef _DEBUG +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Debug/AuthorizeModule_CDKey") +#elif _M_IX86 #pragma comment(lib,"../Debug/AuthorizeModule_CDKey") +#endif #else +#ifdef _M_X64 +#pragma comment(lib,"../x64/Release/AuthorizeModule_CDKey") +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Release/AuthorizeModule_CDKey") +#elif _M_IX86 #pragma comment(lib,"../Release/AuthorizeModule_CDKey") #endif #endif diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h index 339feee421d084fc389fdb31cdfb5aff88d8135e..21c165aa6e5749013121433117f78a513d53fff1 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h @@ -100,20 +100,6 @@ extern "C" bool AuthHelp_DynamicCode_Get(XNETHANDLE xhToken, int nDynamicCode); 备注: *********************************************************************/ extern "C" bool AuthHelp_MultiLogin_GetRange(int nClientDevice, int* pInt_IDType); -/******************************************************************** -函数名称:AuthHelp_MultiLogin_TimeMatch -函数功能:判断登录时间是否匹配当前系统时间 - 参数.一:lpszLoginTime - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要判断的时间 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -extern "C" bool AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime); /************************************************************************/ /* 剪贴板导出定义 */ /************************************************************************/ diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp index fda87a3f15ecdbee562f1f3e434b06f0c4382b48..bd02f06a1e52d72e91c5ca756b853465bc8268a6 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp @@ -106,33 +106,4 @@ bool CAuthHelp_MultiLogin::AuthHelp_MultiLogin_GetRange(int nClientDevice, int* } return true; -} -/******************************************************************** -函数名称:AuthHelp_MultiLogin_TimeMatch -函数功能:判断登录时间是否匹配当前系统时间 - 参数.一:lpszLoginTime - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要判断的时间 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -bool CAuthHelp_MultiLogin::AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime) -{ - Help_IsErrorOccur = true; - - XENGINE_LIBTIME st_TimeLogin = {}; - XENGINE_LIBTIME st_TimeLocal = {}; - BaseLib_Time_GetSysTime(&st_TimeLocal); - BaseLib_Time_StrToTime(lpszLoginTime, &st_TimeLogin); - - bool bRet = false; - if ((st_TimeLogin.wYear == st_TimeLocal.wYear) && (st_TimeLogin.wMonth == st_TimeLocal.wMonth) && (st_TimeLogin.wDay == st_TimeLocal.wDay)) - { - bRet = true; - } - return bRet; } \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.h b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.h index f607c5822c9f3c7440201a9dc2183e009f0efd46..09bc69a102a1509ac249ea150075aac9e3e2071c 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.h +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.h @@ -18,7 +18,6 @@ public: ~CAuthHelp_MultiLogin(); public: bool AuthHelp_MultiLogin_GetRange(int nClientDevice, int* pInt_IDType); - bool AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime); protected: private: }; \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.def b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.def index b87ef2792c819b2bf9eecc9776cc9b3131a8d0d1..6e092501388cd3d34d8e46cd1c2157e8ba19558a 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.def +++ b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.def @@ -9,7 +9,6 @@ EXPORTS AuthHelp_DynamicCode_Get AuthHelp_MultiLogin_GetRange - AuthHelp_MultiLogin_TimeMatch AuthHelp_ClipBoard_Set AuthHelp_ClipBoard_Get diff --git a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj index 0257e30875507d24ba5c463237d3f97dca22a59a..a5d17b026fb996a6cef0b85e47458c028c2bb9dd 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj +++ b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + DynamicLibrary + true + v143 + MultiByte + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + $(XEngine_Include);..\AuthorizeModule_Help;$(IncludePath) @@ -82,10 +109,18 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -146,6 +181,24 @@ AuthorizeModule_Help.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULEHELP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Help.def + + Level3 @@ -170,6 +223,30 @@ AuthorizeModule_Help.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULEHELP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Help.def + + @@ -189,8 +266,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_Help/pch.cpp b/XEngine_Source/AuthorizeModule_Help/pch.cpp index f83797bbb50be2524d072d9a8964162b02e04c4a..892517599193a3c2299bfa83284a8d5b82d0db45 100644 --- a/XEngine_Source/AuthorizeModule_Help/pch.cpp +++ b/XEngine_Source/AuthorizeModule_Help/pch.cpp @@ -60,10 +60,6 @@ extern "C" bool AuthHelp_MultiLogin_GetRange(int nClientDevice, int* pInt_IDType { return m_HelpLogin.AuthHelp_MultiLogin_GetRange(nClientDevice, pInt_IDType); } -extern "C" bool AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime) -{ - return m_HelpLogin.AuthHelp_MultiLogin_TimeMatch(lpszLoginTime); -} /************************************************************************/ /* 剪贴板导出定义 */ /************************************************************************/ diff --git a/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj b/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj index d8f708b1f6ad3f951ae65dd762994020bfa8b29b..e03923049c37769f740fcdc342a1ed76a46790e4 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj +++ b/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + DynamicLibrary + true + v143 + MultiByte + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + true @@ -85,11 +112,21 @@ $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + true + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + false $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + false + $(XEngine_Include);../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + false @@ -155,6 +192,24 @@ AuthorizeModule_Protocol.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULEPROTOCOL_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Protocol.def + + Level3 @@ -180,6 +235,31 @@ AuthorizeModule_Protocol.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULEPROTOCOL_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + MultiThreadedDLL + 4819 + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Protocol.def + + @@ -193,8 +273,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp index dac1cc372f09e1405c5bd2fed70468f1958b6bf7..891f678464fc917a5370ad4acbe8b7f192cc33fb 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp +++ b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp @@ -663,6 +663,7 @@ bool CProtocol_Packet::Protocol_Packet_HttpSwitch(XCHAR* ptszMsgBuffer, int* pIn st_JsonRoot["bSwitchTry"] = pSt_FunSwitch->bSwitchTry; st_JsonRoot["bSwitchBanned"] = pSt_FunSwitch->bSwitchBanned; st_JsonRoot["bSwitchTokenLogin"] = pSt_FunSwitch->bSwitchTokenLogin; + st_JsonRoot["bSwitchHCLogin"] = pSt_FunSwitch->bSwitchHCLogin; *pInt_MsgLen = st_JsonRoot.toStyledString().length(); memcpy(ptszMsgBuffer, st_JsonRoot.toStyledString().c_str(), *pInt_MsgLen); diff --git a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp index 950540d54aea0c67f5b4db7b85ce73dec45e3926..50cad0f654825e50d6790979209f096655b8acfa 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp +++ b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp @@ -846,6 +846,7 @@ bool CProtocol_Parse::Protocol_Parse_HttpParseSwitch(LPCXSTR lpszMsgBuffer, int pSt_FunSwitch->bSwitchTry = st_JsonObject["bSwitchTry"].asBool(); pSt_FunSwitch->bSwitchBanned = st_JsonObject["bSwitchBanned"].asBool(); pSt_FunSwitch->bSwitchTokenLogin = st_JsonObject["bSwitchTokenLogin"].asBool(); + pSt_FunSwitch->bSwitchHCLogin = st_JsonObject["bSwitchHCLogin"].asBool(); return true; } /******************************************************************** diff --git a/XEngine_Source/AuthorizeModule_Protocol/pch.h b/XEngine_Source/AuthorizeModule_Protocol/pch.h index 625c60b3b6fb173b9b3efb6f390c9be85fd2f6ec..7da04b05875b11df8448c4df0fab6278aa7c57da 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/pch.h +++ b/XEngine_Source/AuthorizeModule_Protocol/pch.h @@ -50,15 +50,19 @@ extern XLONG Protocol_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") #ifdef _DEBUG -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Debug/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Debug/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Debug/jsoncpp") #endif #else -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../x64/Release/jsoncpp") -#else +#elif _M_ARM64 +#pragma comment(lib,"../ARM64/Release/jsoncpp") +#elif _M_IX86 #pragma comment(lib,"../Release/jsoncpp") #endif #endif diff --git a/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj b/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj index 145fa0eb4e8259a81eb61ff084e6f9b00532e4bc..68c2dfa04e9f0d4189486549fb827dc6f4207b7f 100644 --- a/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj +++ b/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + DynamicLibrary + true + v143 + MultiByte + DynamicLibrary false @@ -52,6 +66,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + $(XEngine_Include);..\AuthorizeModule_Session;$(IncludePath) @@ -82,10 +109,18 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -146,6 +181,24 @@ AuthorizeModule_Session.def + + + Level3 + true + _DEBUG;AUTHORIZEMODULESESSION_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + + + Windows + true + false + AuthorizeModule_Session.def + + Level3 @@ -170,6 +223,30 @@ AuthorizeModule_Session.def + + + Level3 + true + true + true + NDEBUG;AUTHORIZEMODULESESSION_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + Use + pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) + + + Windows + true + true + true + false + AuthorizeModule_Session.def + + @@ -183,8 +260,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/VSCopy_Arm64.bat b/XEngine_Source/VSCopy_Arm64.bat new file mode 100644 index 0000000000000000000000000000000000000000..9d58afb0b474cc5791ba2d213f1f59367ca665d7 --- /dev/null +++ b/XEngine_Source/VSCopy_Arm64.bat @@ -0,0 +1,20 @@ +copy /y "%XEngine_LibArm64%\XEngine_BaseLib\XEngine_BaseLib.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" +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_NetHelp\NetHelp_APIHelp.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" + +copy /y "%XEngine_LibArm64%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./" + +copy /y "%XEngine_LibArm64%\XEngine_RfcComponents\RfcComponents_WSProtocol.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_RfcComponents\RfcComponents_HttpProtocol.dll" "./" + +copy /y "%XEngine_LibArm64%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" +copy /y "%XEngine_LibArm64%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/XAuth_Protocol.h b/XEngine_Source/XAuth_Protocol.h index e1a9769098d87f35d3f1bb07baaa556eaf05f5c1..64d2370afbca461a26abb8636ab1f9a5f9a8a16e 100644 --- a/XEngine_Source/XAuth_Protocol.h +++ b/XEngine_Source/XAuth_Protocol.h @@ -159,10 +159,11 @@ typedef struct typedef struct tag_AuthReg_UserTable { XENGINE_PROTOCOL_USERINFO st_UserInfo; + XCHAR tszADDInfo[2048]; //附加信息 XCHAR tszLeftTime[64]; //剩余日期 XCHAR tszHardCode[32]; //硬件码 - ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType; //充值卡类型 - ENUM_PROTOCOLDEVICE_TYPE enDeviceType; //设备类型 + ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType; //充值卡类型 + ENUM_PROTOCOLDEVICE_TYPE enDeviceType; //设备类型 }AUTHREG_USERTABLE, * LPAUTHREG_USERTABLE; //注册序列号表 typedef struct tag_AuthReg_SerialTable diff --git a/XEngine_Source/XEngine.sln b/XEngine_Source/XEngine.sln index 12bb0f97303763311f4d1d5b7341fc4d2316fed3..7b92e0d9cf3b0af60134c942fcc64311635901e2 100644 --- a/XEngine_Source/XEngine.sln +++ b/XEngine_Source/XEngine.sln @@ -79,96 +79,142 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthorizeModule_CDKey", "Au EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|ARM64.Build.0 = Debug|ARM64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|x64.ActiveCfg = Debug|x64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|x64.Build.0 = Debug|x64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|x86.ActiveCfg = Debug|Win32 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Debug|x86.Build.0 = Debug|Win32 + {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|ARM64.ActiveCfg = Release|ARM64 + {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|ARM64.Build.0 = Release|ARM64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|x64.ActiveCfg = Release|x64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|x64.Build.0 = Release|x64 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|x86.ActiveCfg = Release|Win32 {6B926D00-DCD2-49E3-86A9-3230C9872E65}.Release|x86.Build.0 = Release|Win32 + {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|ARM64.Build.0 = Debug|ARM64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|x64.ActiveCfg = Debug|x64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|x64.Build.0 = Debug|x64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|x86.ActiveCfg = Debug|Win32 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Debug|x86.Build.0 = Debug|Win32 + {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|ARM64.ActiveCfg = Release|ARM64 + {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|ARM64.Build.0 = Release|ARM64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|x64.ActiveCfg = Release|x64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|x64.Build.0 = Release|x64 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|x86.ActiveCfg = Release|Win32 {1391B739-713B-4A3A-9233-FEAB92E0566C}.Release|x86.Build.0 = Release|Win32 + {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|ARM64.Build.0 = Debug|ARM64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|x64.ActiveCfg = Debug|x64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|x64.Build.0 = Debug|x64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|x86.ActiveCfg = Debug|Win32 {CB9138DF-789D-459F-AD43-4095B22A487F}.Debug|x86.Build.0 = Debug|Win32 + {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|ARM64.ActiveCfg = Release|ARM64 + {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|ARM64.Build.0 = Release|ARM64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|x64.ActiveCfg = Release|x64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|x64.Build.0 = Release|x64 {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|x86.ActiveCfg = Release|Win32 {CB9138DF-789D-459F-AD43-4095B22A487F}.Release|x86.Build.0 = Release|Win32 + {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|ARM64.Build.0 = Debug|ARM64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|x64.ActiveCfg = Debug|x64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|x64.Build.0 = Debug|x64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|x86.ActiveCfg = Debug|Win32 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Debug|x86.Build.0 = Debug|Win32 + {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|ARM64.ActiveCfg = Release|ARM64 + {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|ARM64.Build.0 = Release|ARM64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|x64.ActiveCfg = Release|x64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|x64.Build.0 = Release|x64 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|x86.ActiveCfg = Release|Win32 {5FA1874A-32F4-4176-9C23-4E22BE183660}.Release|x86.Build.0 = Release|Win32 + {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|ARM64.Build.0 = Debug|ARM64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|x64.ActiveCfg = Debug|x64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|x64.Build.0 = Debug|x64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|x86.ActiveCfg = Debug|Win32 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Debug|x86.Build.0 = Debug|Win32 + {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|ARM64.ActiveCfg = Release|ARM64 + {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|ARM64.Build.0 = Release|ARM64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|x64.ActiveCfg = Release|x64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|x64.Build.0 = Release|x64 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|x86.ActiveCfg = Release|Win32 {A29DFD8D-2818-4BE3-A2DB-07F241B4BFC9}.Release|x86.Build.0 = Release|Win32 + {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|ARM64.Build.0 = Debug|ARM64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|x64.ActiveCfg = Debug|x64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|x64.Build.0 = Debug|x64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|x86.ActiveCfg = Debug|Win32 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Debug|x86.Build.0 = Debug|Win32 + {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|ARM64.ActiveCfg = Release|ARM64 + {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|ARM64.Build.0 = Release|ARM64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|x64.ActiveCfg = Release|x64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|x64.Build.0 = Release|x64 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|x86.ActiveCfg = Release|Win32 {51DCBDC7-50CB-4A44-B10B-FCF90309914D}.Release|x86.Build.0 = Release|Win32 + {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|ARM64.Build.0 = Debug|ARM64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|x64.ActiveCfg = Debug|x64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|x64.Build.0 = Debug|x64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|x86.ActiveCfg = Debug|Win32 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Debug|x86.Build.0 = Debug|Win32 + {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|ARM64.ActiveCfg = Release|ARM64 + {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|ARM64.Build.0 = Release|ARM64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|x64.ActiveCfg = Release|x64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|x64.Build.0 = Release|x64 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|x86.ActiveCfg = Release|Win32 {AB3DB24C-E1B3-41CF-B2F4-6C12E13C2894}.Release|x86.Build.0 = Release|Win32 + {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|ARM64.Build.0 = Debug|ARM64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|x64.ActiveCfg = Debug|x64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|x64.Build.0 = Debug|x64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|x86.ActiveCfg = Debug|Win32 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Debug|x86.Build.0 = Debug|Win32 + {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|ARM64.ActiveCfg = Release|ARM64 + {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|ARM64.Build.0 = Release|ARM64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|x64.ActiveCfg = Release|x64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|x64.Build.0 = Release|x64 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|x86.ActiveCfg = Release|Win32 {DD8CB5F1-980F-48C3-BA2F-3CF534903B14}.Release|x86.Build.0 = Release|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|ARM64.Build.0 = Debug|ARM64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.ActiveCfg = Debug|x64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x64.Build.0 = Debug|x64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.ActiveCfg = Debug|Win32 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Debug|x86.Build.0 = Debug|Win32 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|ARM64.ActiveCfg = Release|ARM64 + {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|ARM64.Build.0 = Release|ARM64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.ActiveCfg = Release|x64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x64.Build.0 = Release|x64 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.ActiveCfg = Release|Win32 {F1736B3F-03A2-4FC7-B045-A12BA8D724FB}.Release|x86.Build.0 = Release|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|ARM64.Build.0 = Debug|ARM64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x64.ActiveCfg = Debug|x64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x64.Build.0 = Debug|x64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x86.ActiveCfg = Debug|Win32 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Debug|x86.Build.0 = Debug|Win32 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|ARM64.ActiveCfg = Release|ARM64 + {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|ARM64.Build.0 = Release|ARM64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x64.ActiveCfg = Release|x64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x64.Build.0 = Release|x64 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x86.ActiveCfg = Release|Win32 {F6520D2C-BB8E-45BB-964B-F5D6A4318A89}.Release|x86.Build.0 = Release|Win32 + {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|ARM64.Build.0 = Debug|ARM64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|x64.ActiveCfg = Debug|x64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|x64.Build.0 = Debug|x64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|x86.ActiveCfg = Debug|Win32 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Debug|x86.Build.0 = Debug|Win32 + {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Release|ARM64.ActiveCfg = Release|ARM64 + {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Release|ARM64.Build.0 = Release|ARM64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Release|x64.ActiveCfg = Release|x64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Release|x64.Build.0 = Release|x64 {02A75BD0-416E-4AEF-BF34-BD85BD86384F}.Release|x86.ActiveCfg = Release|Win32 diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.cpp index eb831a16f50c00218913613f77822743e57e32dc..106c3ee52b1b3a36bc45ce810e70967e41cc30e2 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.cpp @@ -50,6 +50,8 @@ void CDialog_Switch::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_RADIO22, m_RadioBlackClose); DDX_Control(pDX, IDC_RADIO23, m_RadioTokenOPen); DDX_Control(pDX, IDC_RADIO24, m_RadioTokenClose); + DDX_Control(pDX, IDC_RADIO25, m_RadioHCLoginOPen); + DDX_Control(pDX, IDC_RADIO26, m_RadioHCLoginClose); } @@ -257,6 +259,16 @@ void CDialog_Switch::OnBnClickedButton1() m_RadioTokenOPen.SetCheck(BST_UNCHECKED); m_RadioTokenClose.SetCheck(BST_CHECKED); } + if (st_JsonRoot["bSwitchHCLogin"].asBool()) + { + m_RadioHCLoginOPen.SetCheck(BST_CHECKED); + m_RadioHCLoginClose.SetCheck(BST_UNCHECKED); + } + else + { + m_RadioHCLoginOPen.SetCheck(BST_UNCHECKED); + m_RadioHCLoginClose.SetCheck(BST_CHECKED); + } m_BtnSetConfigure.EnableWindow(true); } else @@ -391,6 +403,14 @@ void CDialog_Switch::OnBnClickedButton2() { st_JsonObject["bSwitchTokenLogin"] = false; } + if (BST_CHECKED == m_RadioHCLoginOPen.GetCheck()) + { + st_JsonObject["bSwitchHCLogin"] = true; + } + else + { + st_JsonObject["bSwitchHCLogin"] = false; + } st_JsonRoot["st_SwitchInfo"] = st_JsonObject; st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.h index e8fd2d754c4235d84f680c3621b513de2fe39d8e..46638233ba2a93ecb7428311d8485bd60b116261 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.h @@ -51,4 +51,6 @@ public: CButton m_RadioBlackClose; CButton m_RadioTokenOPen; CButton m_RadioTokenClose; + CButton m_RadioHCLoginOPen; + CButton m_RadioHCLoginClose; }; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.aps b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.aps deleted file mode 100644 index 1dd52e9c7754868d4f2b10e46c09d50822378429..0000000000000000000000000000000000000000 Binary files a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.aps and /dev/null differ diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.rc b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.rc index 57de1d2d3eff2b5bfa037627a57723d4f5247cdd..15f027a72c6e48de12d7b548c38a4e97cb2de48e 100644 Binary files a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.rc and b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngineAuthorizeApp.rc differ diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj index bb38a8e46deb68101ddac237f5888a5430e8e007..9b6343584d3b9a6be4c259fb22f9a5d1d62b7bb6 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj @@ -1,10 +1,18 @@ + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -48,6 +56,13 @@ Unicode Static + + Application + true + v143 + Unicode + Static + Application false @@ -56,6 +71,14 @@ Unicode Static + + Application + false + v143 + true + Unicode + Static + @@ -70,9 +93,15 @@ + + + + + + true @@ -84,6 +113,11 @@ $(XEngine_Include);../../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + true + $(XEngine_Include);../../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + false $(XEngine_Include);../../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) @@ -94,6 +128,11 @@ $(XEngine_Include);../../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + false + $(XEngine_Include);../../XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Use @@ -142,6 +181,30 @@ $(IntDir);%(AdditionalIncludeDirectories) + + + Use + Level3 + false + _WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + pch.h + stdcpp20 + stdc17 + + + Windows + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + Use @@ -201,6 +264,35 @@ $(IntDir);%(AdditionalIncludeDirectories) + + + Use + Level3 + true + true + false + _WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + + + Windows + true + true + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + @@ -233,8 +325,10 @@ Create Create + Create Create Create + Create diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h index bae0cbd3a30b1bd962f7cc4bb47d750e8154cb52..63e464fd21517b59d37b576511f3252677a6d916 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h @@ -49,29 +49,38 @@ extern HWND hConfigWnd; extern bool bCrypto; extern LPCTSTR lpszStuType[2]; +#ifdef _MSC_BUILD +#pragma comment(lib,"Dbghelp.lib") +#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") +#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") #ifdef _DEBUG -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../../x64/Debug/jsoncpp") #pragma comment(lib,"../../x64/Debug/AuthorizeModule_Help") #pragma comment(lib,"../../x64/Debug/AuthorizeModule_CDKey") -#else +#elif _M_ARM64 +#pragma comment(lib,"../../ARM64/Debug/jsoncpp") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Help") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_CDKey") +#elif _M_IX86 #pragma comment(lib,"../../Debug/jsoncpp") #pragma comment(lib,"../../Debug/AuthorizeModule_Help") #pragma comment(lib,"../../Debug/AuthorizeModule_CDKey") #endif #else -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../../x64/Release/jsoncpp") #pragma comment(lib,"../../x64/Release/AuthorizeModule_Help") #pragma comment(lib,"../../x64/Release/AuthorizeModule_CDKey") -#else +#elif _M_ARM64 +#pragma comment(lib,"../../ARM64/Release/jsoncpp") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Help") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_CDKey") +#elif _M_IX86 #pragma comment(lib,"../../Release/jsoncpp") #pragma comment(lib,"../../Release/AuthorizeModule_Help") #pragma comment(lib,"../../Release/AuthorizeModule_CDKey") #endif #endif - -#pragma comment(lib,"Dbghelp.lib") -#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") -#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") -#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") \ No newline at end of file +#endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/resource.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/resource.h index b2d0d3de86e7cc9303f842ebd483fb8d82a3713b..b3be7d630f7048b2920469eeb0784e0f572a21c2 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/resource.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/resource.h @@ -94,6 +94,8 @@ #define IDC_RADIO22 1036 #define IDC_RADIO23 1037 #define IDC_RADIO24 1038 +#define IDC_RADIO25 1039 +#define IDC_RADIO26 1040 // Next default values for new objects // diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Switch.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Switch.cpp index 5f48e3a523d2735e1c0e67ea3e71035ff6f60786..d9eceda70423bb56e04b803e2d66213b90aef33f 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Switch.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Switch.cpp @@ -13,14 +13,14 @@ bool XEngine_AuthorizeHTTP_Switch(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L { Protocol_Packet_HttpSwitch(tszSDBuffer, &nSDLen, &st_FunSwitch); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取功能开关成功,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,多端登录:%d,临时试用:%d,普通Token:%d"), lpszClientAddr, st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchTokenLogin); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求获取功能开关成功,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,多端登录:%d,临时试用:%d,普通Token:%d,硬件码登录:%d"), lpszClientAddr, st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchTokenLogin, st_FunSwitch.bSwitchHCLogin); } else if (0 == _tcsxnicmp(lpszAPISet, lpszAPIName, _tcsxlen(lpszAPISet))) { Protocol_Parse_HttpParseSwitch(lpszMsgBuffer, nMsgLen, &st_FunSwitch); Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求设置功能开关成功,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,多端登录:%d,临时试用:%d,普通Token:%d"), lpszClientAddr, st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchTokenLogin); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求设置功能开关成功,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,多端登录:%d,临时试用:%d,普通Token:%d,硬件码登录:%d"), lpszClientAddr, st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchTokenLogin, st_FunSwitch.bSwitchHCLogin); } return true; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Config.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Config.cpp index e21999921659c1e9c82b18807d0b461e8af6ecf7..7563dd04d632553b29144d46fa6d671171cead45 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Config.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Config.cpp @@ -33,6 +33,26 @@ bool Authorize_Service_Parament(int argc, char** argv) { st_AuthConfig.bDeamon = _ttxoi(argv[++i]); } + else if (0 == _tcsxcmp("-TP", argv[i])) + { + st_AuthConfig.nTCPPort = _ttxoi(argv[++i]); + } + else if (0 == _tcsxcmp("-WP", argv[i])) + { + st_AuthConfig.nWSPort = _ttxoi(argv[++i]); + } + else if (0 == _tcsxcmp("-HP", argv[i])) + { + st_AuthConfig.nHTTPPort = _ttxoi(argv[++i]); + } + else if (0 == _tcsxcmp("-LL", argv[i])) + { + st_AuthConfig.st_XLog.nLogLeave = _ttxoi(argv[++i]); + } + else if (0 == _tcsxcmp("-LT", argv[i])) + { + st_AuthConfig.st_XLog.nLogType = _ttxoi(argv[++i]); + } else if (0 == _tcsxcmp("-t", argv[i])) { bIsTest = true; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h index 4adc215ec0b93d7be576df08e49a4885e332c656..16a61bb0fa5c32a77c821fa131367fc57d6f2412 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h @@ -108,8 +108,20 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #include "AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.h" #ifdef _MSC_BUILD +#pragma comment(lib,"Ws2_32.lib") +#pragma comment(lib,"Dbghelp.lib") +#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Core.lib") +#pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") +#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr.lib") +#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib") +#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Packets.lib") +#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_WSProtocol.lib") +#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpProtocol.lib") #ifdef _DEBUG -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../../x64/Debug/AuthorizeModule_Configure.lib") #pragma comment(lib,"../../x64/Debug/AuthorizeModule_Protocol.lib") #pragma comment(lib,"../../x64/Debug/AuthorizeModule_Session.lib") @@ -117,7 +129,15 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #pragma comment(lib,"../../x64/Debug/AuthorizeModule_Help.lib") #pragma comment(lib,"../../x64/Debug/AuthorizeModule_CDKey.lib") #pragma comment(lib,"../../x64/Debug/XEngine_InfoReport.lib") -#else +#elif _M_ARM64 +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Configure.lib") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Protocol.lib") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Session.lib") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Database.lib") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_Help.lib") +#pragma comment(lib,"../../ARM64/Debug/AuthorizeModule_CDKey.lib") +#pragma comment(lib,"../../ARM64/Debug/XEngine_InfoReport.lib") +#elif _M_IX86 #pragma comment(lib,"../../Debug/AuthorizeModule_Configure.lib") #pragma comment(lib,"../../Debug/AuthorizeModule_Protocol.lib") #pragma comment(lib,"../../Debug/AuthorizeModule_Session.lib") @@ -127,7 +147,7 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #pragma comment(lib,"../../Debug/XEngine_InfoReport.lib") #endif #else -#ifdef _WIN64 +#ifdef _M_X64 #pragma comment(lib,"../../x64/Release/AuthorizeModule_Configure.lib") #pragma comment(lib,"../../x64/Release/AuthorizeModule_Protocol.lib") #pragma comment(lib,"../../x64/Release/AuthorizeModule_Session.lib") @@ -135,7 +155,15 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #pragma comment(lib,"../../x64/Release/AuthorizeModule_Help.lib") #pragma comment(lib,"../../x64/Release/AuthorizeModule_CDKey.lib") #pragma comment(lib,"../../x64/Release/XEngine_InfoReport.lib") -#else +#elif _M_ARM64 +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Configure.lib") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Protocol.lib") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Session.lib") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Database.lib") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_Help.lib") +#pragma comment(lib,"../../ARM64/Release/AuthorizeModule_CDKey.lib") +#pragma comment(lib,"../../ARM64/Release/XEngine_InfoReport.lib") +#elif _M_IX86 #pragma comment(lib,"../../Release/AuthorizeModule_Configure.lib") #pragma comment(lib,"../../Release/AuthorizeModule_Protocol.lib") #pragma comment(lib,"../../Release/AuthorizeModule_Session.lib") @@ -145,16 +173,4 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #pragma comment(lib,"../../Release/XEngine_InfoReport.lib") #endif #endif -#pragma comment(lib,"Ws2_32.lib") -#pragma comment(lib,"Dbghelp.lib") -#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") -#pragma comment(lib,"XEngine_Core/XEngine_Core.lib") -#pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib") -#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") -#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") -#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr.lib") -#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib") -#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Packets.lib") -#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_WSProtocol.lib") -#pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpProtocol.lib") #endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp index 93e1108100b142d174ed6a1191f9ecbae78be65e..f1a9678374413be19dc2fbc84d859d94bcb3a7de 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp @@ -48,12 +48,13 @@ XHTHREAD CALLBACK XEngine_AuthService_HttpThread(XPVOID lParam) return 0; } -bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, RFCCOMPONENTS_HTTP_REQPARAM *pSt_HTTPParament) +bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParament) { int nSDLen = 4096; XCHAR tszSDBuffer[4096]; LPCXSTR lpszMethodPost = _X("POST"); LPCXSTR lpszMethodGet = _X("GET"); + LPCXSTR lpszMethodOPtion = _X("OPTION"); memset(tszSDBuffer, '\0', sizeof(tszSDBuffer)); @@ -64,11 +65,11 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int //是否在黑名单 bool bSuccess = false; - if (0 == st_AuthConfig.st_XSql.nDBType) + if (0 == st_AuthConfig.st_XSql.nDBType) { bSuccess = DBModule_SQLite_BannedExist(&st_Banned); //IP地址是否在黑名单 } - else + else { bSuccess = DBModule_MySQL_BannedExist(&st_Banned);//IP地址是否在黑名单 } @@ -251,7 +252,7 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int memset(tszURLValue, '\0', sizeof(tszURLValue)); BaseLib_String_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); - if (0 == _tcsxnicmp(lpszAPIVerDCode, tszURLValue, _tcsxlen(lpszAPIVerDCode)) || 0 == _tcsxnicmp(lpszAPIVerTime, tszURLValue, _tcsxlen(lpszAPIVerTime)) || + if (0 == _tcsxnicmp(lpszAPIVerDCode, tszURLValue, _tcsxlen(lpszAPIVerDCode)) || 0 == _tcsxnicmp(lpszAPIVerTime, tszURLValue, _tcsxlen(lpszAPIVerTime)) || 0 == _tcsxnicmp(lpszAPIVerNotice, tszURLValue, _tcsxlen(lpszAPIVerNotice))) { XEngine_AuthorizeHTTP_GetTask(lpszClientAddr, pptszList, nListCount); @@ -262,6 +263,12 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int } BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); } + else if (0 == _tcsxnicmp(lpszMethodOPtion, pSt_HTTPParament->tszHttpMethod, _tcsxlen(lpszMethodOPtion))) + { + Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen); + XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,发送的OPTION方法处理成功.此为心跳请求"), lpszClientAddr); + } else { Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen, 405, "method not allow"); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp index feb11b3e582877410b38b0379aa6c62ff834d639..09a7f904b96d237c272a0009aa9b62bb8de8ef89 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp @@ -2,8 +2,8 @@ ////////////////////////////////////////////////////////////////////////// bool CALLBACK XEngine_Client_TCPAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { - HelpComponents_Datas_CreateEx(xhTCPPacket, lpszClientAddr, 0); + SocketOpt_HeartBeat_InsertAddrEx(xhTCPHeart, lpszClientAddr); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("TCP客户端:%s,进入服务器"), lpszClientAddr); return true; } @@ -13,15 +13,21 @@ void CALLBACK XEngine_Client_TCPRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, LP { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,投递数据包失败,大小:%d,错误:%lX"), lpszClientAddr, nMsgLen, Packets_GetLastError()); } + SocketOpt_HeartBeat_ActiveAddrEx(xhTCPHeart, lpszClientAddr); } void CALLBACK XEngine_Client_TCPClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { XEngine_CloseClient(lpszClientAddr, false); } +void CALLBACK XEngine_Client_TCPHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam) +{ + XEngine_CloseClient(lpszClientAddr, true); +} ////////////////////////////////////////////////////////////////////////// bool CALLBACK XEngine_Client_WSAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { RfcComponents_WSPacket_CreateEx(xhWSPacket, lpszClientAddr, 0); + SocketOpt_HeartBeat_InsertAddrEx(xhWSHeart, lpszClientAddr); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WS客户端:%s,进入服务器"), lpszClientAddr); return true; } @@ -47,15 +53,21 @@ void CALLBACK XEngine_Client_WSRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPC RfcComponents_WSPacket_SetLoginEx(xhWSPacket, lpszClientAddr); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WS客户端:%s,握手成功"), lpszClientAddr); } + SocketOpt_HeartBeat_ActiveAddrEx(xhWSHeart, lpszClientAddr); } void CALLBACK XEngine_Client_WSClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { XEngine_CloseClient(lpszClientAddr, false); } +void CALLBACK XEngine_Client_WSHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam) +{ + XEngine_CloseClient(lpszClientAddr, true); +} ////////////////////////////////////////////////////////////////////////// bool CALLBACK XEngine_Client_HttpAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { HttpProtocol_Server_CreateClientEx(xhHttpPacket, lpszClientAddr, 0); + SocketOpt_HeartBeat_InsertAddrEx(xhHTTPHeart, lpszClientAddr); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,进入服务器"), lpszClientAddr); return true; } @@ -65,19 +77,33 @@ void CALLBACK XEngine_Client_HttpRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, L { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,投递数据包失败,大小:%d,错误:%lX"), lpszClientAddr, nMsgLen, Packets_GetLastError()); } + SocketOpt_HeartBeat_ActiveAddrEx(xhHTTPHeart, lpszClientAddr); } void CALLBACK XEngine_Client_HttpClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam) { XEngine_CloseClient(lpszClientAddr, false); } +void CALLBACK XEngine_Client_HttpHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam) +{ + XEngine_CloseClient(lpszClientAddr, true); +} ////////////////////////////////////////////////////////////////////////// bool XEngine_CloseClient(LPCXSTR lpszClientAddr, bool bHeart) { + xstring m_StrLeave; if (bHeart) { NetCore_TCPXCore_CloseForClientEx(xhTCPSocket, lpszClientAddr); NetCore_TCPXCore_CloseForClientEx(xhWSSocket, lpszClientAddr); NetCore_TCPXCore_CloseForClientEx(xhHttpSocket, lpszClientAddr); + m_StrLeave = _X("心跳断开"); + } + else + { + SocketOpt_HeartBeat_DeleteAddrEx(xhTCPHeart, lpszClientAddr); + SocketOpt_HeartBeat_DeleteAddrEx(xhWSHeart, lpszClientAddr); + SocketOpt_HeartBeat_DeleteAddrEx(xhHTTPHeart, lpszClientAddr); + m_StrLeave = _X("正常断开"); } HelpComponents_Datas_DeleteEx(xhTCPPacket, lpszClientAddr); RfcComponents_WSPacket_DeleteEx(xhWSPacket, lpszClientAddr); @@ -109,11 +135,11 @@ bool XEngine_CloseClient(LPCXSTR lpszClientAddr, bool bHeart) } Session_Token_Delete(st_NETClient.xhToken); Session_Authorize_CloseAddr(lpszClientAddr); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,用户名:%s,Token:%llu,离开服务器,在线时长:%d"), lpszClientAddr, st_NETClient.st_UserTable.st_UserInfo.tszUserName, st_NETClient.xhToken, st_AuthTime.nTimeONLine); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,用户名:%s,Token:%llu,离开服务器,在线时长:%d,离开方式:%s"), lpszClientAddr, st_NETClient.st_UserTable.st_UserInfo.tszUserName, st_NETClient.xhToken, st_AuthTime.nTimeONLine, m_StrLeave.c_str()); } else { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,离开服务器"), lpszClientAddr); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,离开服务器,离开方式:%s"), lpszClientAddr, m_StrLeave.c_str()); } return true; } @@ -163,10 +189,12 @@ bool XEngine_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, ptszCodecBuffer = NULL; } NetCore_TCPXCore_SendEx(xhWSSocket, lpszClientAddr, ptszMsgBuffer, nMsgLen); + SocketOpt_HeartBeat_ActiveAddrEx(xhWSHeart, lpszClientAddr); } else if (XENGINE_AUTH_APP_NETTYPE_TCP == nNetType) { NetCore_TCPXCore_SendEx(xhTCPSocket, lpszClientAddr, lpszMsgBuffer, nMsgLen); + SocketOpt_HeartBeat_ActiveAddrEx(xhTCPHeart, lpszClientAddr); } else { @@ -194,6 +222,7 @@ bool XEngine_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, ManagePool_Memory_Free(xhMemPool, ptszCodecBuffer); } NetCore_TCPXCore_SendEx(xhHttpSocket, lpszClientAddr, ptszMsgBuffer, nSDSize); + SocketOpt_HeartBeat_ActiveAddrEx(xhHTTPHeart, lpszClientAddr); } ManagePool_Memory_Free(xhMemPool, ptszMsgBuffer); return true; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.h index 0b87f4ab3211680165de98ee8d48835a59ccbfa1..6a6b3adf3c6a7a4d61c75d9f06f65d2b76eaaa5e 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.h @@ -3,14 +3,17 @@ bool CALLBACK XEngine_Client_TCPAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); void CALLBACK XEngine_Client_TCPRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPCXSTR lpszRecvMsg, int nMsgLen, XPVOID lParam); void CALLBACK XEngine_Client_TCPClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); +void CALLBACK XEngine_Client_TCPHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam); bool CALLBACK XEngine_Client_WSAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); void CALLBACK XEngine_Client_WSRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPCXSTR lpszRecvMsg, int nMsgLen, XPVOID lParam); void CALLBACK XEngine_Client_WSClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); +void CALLBACK XEngine_Client_WSHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam); bool CALLBACK XEngine_Client_HttpAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); void CALLBACK XEngine_Client_HttpRecv(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPCXSTR lpszRecvMsg, int nMsgLen, XPVOID lParam); void CALLBACK XEngine_Client_HttpClose(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam); +void CALLBACK XEngine_Client_HttpHeart(LPCXSTR lpszClientAddr, XSOCKET hSocket, int nStatus, XPVOID lParam); bool XEngine_CloseClient(LPCXSTR lpszClientAddr, bool bHeart); bool XEngine_Client_TaskSend(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nNetType); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp index 1fc5987debf794a8bdad3e91c20e11436c6ad852..03739801cce76f5ae72799e7ce3df1e57415b49f 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp @@ -155,29 +155,62 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n else { bool bSuccess = false; - if (0 == st_AuthConfig.st_XSql.nDBType) + //用户密码登录还是硬件吗登录 + if (_tcsxlen(st_AuthProtocol.tszUserPass) > 0) { - bSuccess = DBModule_SQLite_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable); + //用户密码登录,查询用户名 + if (0 == st_AuthConfig.st_XSql.nDBType) + { + bSuccess = DBModule_SQLite_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable); + } + else + { + bSuccess = DBModule_MySQL_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable); + } + if (!bSuccess) + { + pSt_ProtocolHdr->wReserve = 251; + Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); + XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,用户名:%s,登录失败,用户名不存在"), lpszClientAddr, st_AuthProtocol.tszUserName); + return false; + } + if ((_tcsxlen(st_AuthProtocol.tszUserPass) != _tcsxlen(st_UserTable.st_UserInfo.tszUserPass)) || (0 != _tcsxncmp(st_AuthProtocol.tszUserPass, st_UserTable.st_UserInfo.tszUserPass, _tcsxlen(st_AuthProtocol.tszUserPass)))) + { + pSt_ProtocolHdr->wReserve = 252; + Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); + XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,用户名:%s,登录失败,密码错误"), lpszClientAddr, st_AuthProtocol.tszUserName); + return false; + } } else { - bSuccess = DBModule_MySQL_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable); - } - if (!bSuccess) - { - pSt_ProtocolHdr->wReserve = 251; - Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); - XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,用户名:%s,登录失败,用户名不存在"), lpszClientAddr, st_AuthProtocol.tszUserName); - return false; - } - if ((_tcsxlen(st_AuthProtocol.tszUserPass) != _tcsxlen(st_UserTable.st_UserInfo.tszUserPass)) || (0 != _tcsxncmp(st_AuthProtocol.tszUserPass, st_UserTable.st_UserInfo.tszUserPass, _tcsxlen(st_AuthProtocol.tszUserPass)))) - { - pSt_ProtocolHdr->wReserve = 252; - Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); - XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,用户名:%s,登录失败,密码错误"), lpszClientAddr, st_AuthProtocol.tszUserName); - return false; + if (!st_FunSwitch.bSwitchHCLogin) + { + pSt_ProtocolHdr->wReserve = 251; + Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); + XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,硬件码:%s,登录失败,服务端关闭此功能"), lpszClientAddr, st_AuthProtocol.tszUserName); + return false; + } + //查询硬件吗 + if (0 == st_AuthConfig.st_XSql.nDBType) + { + bSuccess = DBModule_SQLite_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable, false); + } + else + { + bSuccess = DBModule_MySQL_UserQuery(st_AuthProtocol.tszUserName, &st_UserTable, false); + } + if ((_tcsxlen(st_AuthProtocol.tszUserName) != _tcsxlen(st_UserTable.tszHardCode)) || (0 != _tcsxncmp(st_AuthProtocol.tszUserName, st_UserTable.tszHardCode, _tcsxlen(st_AuthProtocol.tszUserName)))) + { + pSt_ProtocolHdr->wReserve = 252; + Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); + XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,硬件码:%s,登录失败,硬件码错误"), lpszClientAddr, st_AuthProtocol.tszUserName); + return false; + } } } //是否已经登录 @@ -305,9 +338,23 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n } else if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == st_UserTable.enSerialType) { - if (!AuthHelp_MultiLogin_TimeMatch(st_UserTable.st_UserInfo.tszLoginTime)) + bool bSuccess = false; + XCHAR tszIPAddr[128] = {}; + + _tcsxcpy(tszIPAddr, lpszClientAddr); + APIAddr_IPAddr_SegAddr(tszIPAddr); + if (0 == st_AuthConfig.st_XSql.nDBType) { - //如果不匹配 + bSuccess = DBModule_SQLite_QueryLogin(st_UserTable.st_UserInfo.tszUserName, tszIPAddr); + } + else + { + bSuccess = DBModule_MySQL_QueryLogin(st_UserTable.st_UserInfo.tszUserName, tszIPAddr); + } + //是否存在 + if (!bSuccess) + { + //不存在.减去一天 __int64x nTime = _ttxoll(st_UserTable.tszLeftTime) - 1; _xstprintf(st_UserTable.tszLeftTime, _X("%lld"), nTime); BaseLib_Time_TimeToStr(st_UserTable.st_UserInfo.tszLoginTime); @@ -339,7 +386,19 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n { Session_Token_Insert(pSt_ProtocolHdr->xhToken, &st_UserTable); } + //记录每次登陆 + XCHAR tszIPAddr[128] = {}; + _tcsxcpy(tszIPAddr, lpszClientAddr); + APIAddr_IPAddr_SegAddr(tszIPAddr); + if (0 == st_AuthConfig.st_XSql.nDBType) + { + DBModule_SQLite_UserLogin(st_UserTable.st_UserInfo.tszUserName, tszIPAddr); + } + else + { + DBModule_MySQL_UserLogin(st_UserTable.st_UserInfo.tszUserName, tszIPAddr); + } pSt_ProtocolHdr->wReserve = 0; Protocol_Packet_HDRComm(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, nNetType); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, nNetType); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp index b2dff857de5493ac969ab4ed1d950df0596d95c3..7f2f96b0c4638682b552bb80be6fd071e79c8f24 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp @@ -155,7 +155,7 @@ int main(int argc, char** argv) st_XLogConfig.XLog_MaxSize = st_AuthConfig.st_XLog.nMaxSize; _tcsxcpy(st_XLogConfig.tszFileName, st_AuthConfig.st_XLog.tszLogFile); - xhLog = HelpComponents_XLog_Init(HELPCOMPONENTS_XLOG_OUTTYPE_FILE | HELPCOMPONENTS_XLOG_OUTTYPE_STD, &st_XLogConfig); + xhLog = HelpComponents_XLog_Init(st_AuthConfig.st_XLog.nLogType, &st_XLogConfig); if (NULL == xhLog) { printf("启动服务器失败,启动日志失败,错误:%lX", XLog_GetLastError()); @@ -242,6 +242,20 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhTCPSocket, XEngine_Client_TCPAccept, XEngine_Client_TCPRecv, XEngine_Client_TCPClose); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化TCP验证网络事件成功")); + if (st_AuthConfig.st_XTime.nTCPTime > 0) + { + xhTCPHeart = SocketOpt_HeartBeat_InitEx(st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nTCPTime, XEngine_Client_TCPHeart); + if (NULL == xhTCPHeart) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化TCP验证心跳服务失败,错误:%lX"), NetCore_GetLastError()); + goto XENGINE_EXITAPP; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化TCP验证心跳服务成功,检测次数:%d,检测时间:%d"), st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nTCPTime); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,检测到TCP心跳服务没有启用")); + } BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListTCPThread, st_AuthConfig.st_XMax.nTCPThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_AuthConfig.st_XMax.nTCPThread; i++) @@ -275,6 +289,21 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhWSSocket, XEngine_Client_WSAccept, XEngine_Client_WSRecv, XEngine_Client_WSClose); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化WEBSOCKET验证网络事件成功")); + if (st_AuthConfig.st_XTime.nWSTime > 0) + { + xhWSHeart = SocketOpt_HeartBeat_InitEx(st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nWSTime, XEngine_Client_WSHeart); + if (NULL == xhWSHeart) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化WEBSOCKET验证心跳服务失败,错误:%lX"), NetCore_GetLastError()); + goto XENGINE_EXITAPP; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化WEBSOCKET验证心跳服务成功,检测次数:%d,检测时间:%d"), st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nWSTime); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,检测到WEBSOCKET心跳服务没有启用")); + } + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListWSThread, st_AuthConfig.st_XMax.nWSThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_AuthConfig.st_XMax.nWSThread; i++) { @@ -307,6 +336,21 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhHttpSocket, XEngine_Client_HttpAccept, XEngine_Client_HttpRecv, XEngine_Client_HttpClose); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化HTTP管理网络事件成功")); + if (st_AuthConfig.st_XTime.nHTTPTime > 0) + { + xhHTTPHeart = SocketOpt_HeartBeat_InitEx(st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nHTTPTime, XEngine_Client_HttpHeart); + if (NULL == xhHTTPHeart) + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化HTTP心跳服务失败,错误:%lX"), NetCore_GetLastError()); + goto XENGINE_EXITAPP; + } + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化HTTP心跳服务成功,检测次数:%d,检测时间:%d"), st_AuthConfig.st_XTime.nHeartCheck, st_AuthConfig.st_XTime.nHTTPTime); + } + else + { + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,检测到HTTP心跳服务没有启用")); + } + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListHttpThread, st_AuthConfig.st_XMax.nHTTPThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_AuthConfig.st_XMax.nHTTPThread; i++) { @@ -351,7 +395,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("启动服务中,功能开关选项,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,动态验证:%d,多端登录:%d,临时试用:%d,黑名单功能:%d,普通TOKEN:%d"), st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchDCode, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchBanned, st_FunSwitch.bSwitchTokenLogin); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,功能开关选项,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,动态验证:%d,多端登录:%d,临时试用:%d,黑名单功能:%d,普通TOKEN:%d,硬件码登录:%d"), st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchDCode, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchBanned, st_FunSwitch.bSwitchTokenLogin, st_FunSwitch.bSwitchHCLogin); pSt_File = _xtfopen(st_AuthConfig.st_XVerification.st_XCDKey.tszKeyFile, _X("rb")); if (NULL == pSt_File) diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj index fa6569347b03f0828f510ad724d98102a1b27109..ea5d3b0bf155faad2901d236258215e2e24be95a 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj @@ -1,10 +1,18 @@  + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -45,6 +53,12 @@ v143 MultiByte + + Application + true + v143 + MultiByte + Application false @@ -52,6 +66,13 @@ true Unicode + + Application + false + v143 + true + Unicode + @@ -66,9 +87,15 @@ + + + + + + true @@ -85,11 +112,21 @@ $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + true + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + false $(XEngine_Include);$(IncludePath) $(XEngine_Lib64);$(LibraryPath) + + false + $(XEngine_Include);$(IncludePath) + $(XEngine_LibArm64);$(LibraryPath) + Level3 @@ -139,6 +176,20 @@ true + + + Level3 + false + _DEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + stdcpp20 + stdc17 + + + Console + true + + Level3 @@ -159,6 +210,26 @@ true + + + Level3 + true + true + false + NDEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + + + Console + true + true + true + + diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend index bcf8d946890a2f2fb39eec16e64a634a8ece52c7..fda9f7d9140cc6a32eecb499e2acb67e8e1c7e6f 160000 --- a/XEngine_Source/XEngine_Depend +++ b/XEngine_Source/XEngine_Depend @@ -1 +1 @@ -Subproject commit bcf8d946890a2f2fb39eec16e64a634a8ece52c7 +Subproject commit fda9f7d9140cc6a32eecb499e2acb67e8e1c7e6f