diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000000000000000000000000000000000000..279b03f7651f557e241abe5be61dc93b229606c9 --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,35 @@ +name: cpp check workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + - name: Create static_analysis directory + run: mkdir -p static_analysis + + - name: Run Cppcheck + run: | + sudo apt-get install -y cppcheck + cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml + continue-on-error: true + + - name: Upload Cppcheck Results + uses: actions/upload-artifact@v4 + with: + name: cppcheck_results + path: static_analysis/log.xml \ No newline at end of file diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml index a8b90dbc350154115073df5a585b944466630364..52f11fa4a21681c2e61d5e584cfaab15a99a5b82 100644 --- a/.github/workflows/macbuild.yml +++ b/.github/workflows/macbuild.yml @@ -2,13 +2,12 @@ name: macos build workflows on: push: - branches: [ "develop" ] + branches: + - 'develop' paths: - 'XEngine_Source/**' - 'XEngine_Release/**' - -permissions: - contents: read + - '.github/**' jobs: build: @@ -16,6 +15,7 @@ jobs: matrix: include: - os: macos-13 + - os: macos-14 runs-on: ${{ matrix.os }} steps: @@ -30,7 +30,6 @@ jobs: with: repository: libxengine/libxengine path: libxengine - ref: 'master' - name: sub module checkout (opensource) run: | @@ -40,14 +39,30 @@ jobs: - name: brew install run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency x86_64 Environment + if: matrix.os == 'macos-13' run: | cd libxengine chmod 777 * ./XEngine_LINEnv.sh -i 3 - cd .. - #编译 + - name: Set up Dependency Arm64 Environment + if: matrix.os == 'macos-14' + run: | + cd libxengine + chmod 777 * + ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(git ls-remote --tags --sort="v:refname" https://github.com/libxengine/libxengine.git | awk '{print $2}' | sed 's/refs\/tags\///' | tail -n 1) + + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip + unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64 + cd XEngine_Mac_Arm64 + + sudo mkdir -p /usr/local/include + sudo mkdir -p /usr/local/lib + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \; + - name: make debug run: | cd XEngine_Source @@ -65,8 +80,15 @@ jobs: cd XEngine_Release ./XEngine_AuthorizeService -t - - name: Upload folder as artifact with mac + - name: Upload folder as artifact with mac x64 + if: matrix.os == 'macos-13' uses: actions/upload-artifact@v4 with: name: XEngine_AuthorizeService-x86_64-Mac + path: XEngine_Release/ + - name: Upload folder as artifact with mac arm + if: matrix.os == 'macos-14' + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-Arm64-Mac path: XEngine_Release/ \ No newline at end of file diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 5e1f7b55a75e0f2e7e4665dbd14487173c25241d..6396a77ad728ddaf647dc11e2288a7b828cc45ac 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -3,15 +3,15 @@ name: windows build workflows on: push: branches: - - develop + - 'develop' paths: - 'XEngine_Source/**' - 'XEngine_Release/**' + - '.github/**' jobs: build: strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. fail-fast: false matrix: configuration: [Debug ,Release] @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v4 with: repository: libxengine/libxengine - path: xengine + path: libxengine - name: sub module checkout (opensource) run: | @@ -39,21 +39,33 @@ jobs: git submodule update shell: pwsh - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency x86_64 Environment + if: matrix.platform == 'x64' run: | - echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh + - name: Set up Dependency x86_32 Environment + if: matrix.platform == 'x86' + run: | + $response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"} + $latest_tag = $response.tag_name + Write-Host "Latest Tag: $latest_tag" + + $url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip" + Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip" + Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force + + echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append shell: pwsh - # 配置 MSBuild 的路径,准备构建 VC++ 项目 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - #编译 + - name: Build Solution run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} - #测试 + - name: Conditional Step for x86 Release if: matrix.configuration == 'Release' && matrix.platform == 'x86' run: | @@ -73,8 +85,7 @@ jobs: cd XEngine_Release ./VSCopy_x64.bat shell: pwsh - - #将文件夹打包为 artifact + - name: Upload folder as artifact with x86 if: matrix.configuration == 'Release' && matrix.platform == 'x86' uses: actions/upload-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dcf5576e0ca1d9f6bbbd81bb9bceacb746f9d784..cc4fe30d432365b677167b3840494a644f1074b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: with: fetch-depth: 0 - - name: Download linuxbuild + - name: Download ubuntubuild uses: dawidd6/action-download-artifact@v6 with: - workflow: linuxbuild.yml + workflow: ubuntubuild.yml workflow_conclusion: success check_artifacts: false skip_unpack: true diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/ubuntubuild.yml similarity index 51% rename from .github/workflows/linuxbuild.yml rename to .github/workflows/ubuntubuild.yml index 6847e392108acf46cf4f2bc4f8f019903a566134..65ae3ecf748e595286e2c216691805b8a4c59069 100644 --- a/.github/workflows/linuxbuild.yml +++ b/.github/workflows/ubuntubuild.yml @@ -2,12 +2,12 @@ name: ubuntu build workflows on: push: - branches: [ "develop" ] + branches: + - 'develop' paths: - 'XEngine_Source/**' - 'XEngine_Release/**' -permissions: - contents: read + - '.github/**' jobs: build: @@ -17,17 +17,15 @@ jobs: matrix: include: - os: ubuntu-22.04 - #- os: ubuntu-24.04 + - os: ubuntu-24.04 runs-on: ${{ matrix.os }} steps: - # 检出您的主仓库代码 - name: Checkout main repository code uses: actions/checkout@v4 with: ref: 'develop' - # 检出依赖的xengine仓库到指定的xengine目录 - name: Checkout dependency repository (xengine) uses: actions/checkout@v4 with: @@ -39,14 +37,28 @@ jobs: git submodule init git submodule update - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency ubuntu24.04 Environment + if: matrix.os == 'ubuntu-24.04' run: | cd libxengine chmod 777 * sudo ./XEngine_LINEnv.sh -i 3 - cd .. - #编译 + - name: Set up Dependency ubuntu22.04 Environment + if: matrix.os == 'ubuntu-22.04' + run: | + cd libxengine + chmod 777 * + sudo ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name) + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip + unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64 + cd XEngine_UBuntu_22.04_x86-64 + + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \; + sudo ldconfig + - name: make run: | cd XEngine_Source @@ -63,8 +75,15 @@ jobs: cd XEngine_Release ./XEngine_AuthorizeService -t - - name: Upload folder as artifact with ubuntu + - name: Upload folder as artifact with ubuntu22.04 + if: matrix.os == 'ubuntu-22.04' + uses: actions/upload-artifact@v4 + with: + name: XEngine_AuthorizeService-x86_64-Ubuntu-22.04 + path: XEngine_Release/ + - name: Upload folder as artifact with ubuntu24.04 + if: matrix.os == 'ubuntu-24.04' uses: actions/upload-artifact@v4 with: - name: XEngine_AuthorizeService-x86_64-Ubuntu + name: XEngine_AuthorizeService-x86_64-Ubuntu-24.04 path: XEngine_Release/ \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index c9812872d0dfcc1808ed3603ccff242245fec410..8875a7c77d0642ae8b5ffb762c4075975f02b902 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,25 @@ +XEngine_Authorize V3.16.0.1001 + +更新:匹配XEngineV9 +更新:依赖库 +更新:升级编译器到c++20,c17 +修改:windows的构建从ansi修改为unicode版本 +修改:测试启动取消了发送信息报告的功能 +修正:app应用在windows构建问题 +修正:在其他语言系统下乱码问题 +修正:通告乱码问题 +修正:拷贝序列号错误 + +update:match xengine v9.x +update:depend library +update:compiler version to c++20 and c17 +modify:windows build character to unicode from ansi +modify:cancel send info report when test start +fixed:app build on windows +fixed:Displays incorrectly in other language systems +fixed:announcement context Garbled characters +fixed:copy serial number incorrect +================================================================ XEngine_Authorize V3.15.0.1001 增加:密码加密 diff --git a/README.en.md b/README.en.md index 300efd9eaeb3e38249446c2b548896800c269ec2..1c4e905cc162ea1160d8922ca859929dfc1d78ba 100644 --- a/README.en.md +++ b/README.en.md @@ -53,7 +53,7 @@ feature list: ## install #### XEngine Evn -you must install XEngine,need V8.15 or above,install XEngine can be refer to xengine Readme docment +you must install XEngine,need V9.x or above,install XEngine can be refer to xengine Readme docment GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -74,7 +74,7 @@ Just Run it,use XEngine_AuthorizeService XEngine_AuthorizeApp is pc management tools #### Linux -use makefile compile,UBUNTU22.04 x64 or RockyLinux 9 x64 +use makefile compile,UBUNTU22.04 or above Run it on the terminal,use XEngine_AuthorizeService #### Macos diff --git a/README.md b/README.md index f24b22cd3316570705d991ffabfd38abd5023b73..80882e397251afc1050dc18a9816cb0fac76d93f 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ XEngine_Authorize ## 安装教程 #### XEngine环境 -必须安装XEngine,版本需要V8.15或者以上版本,安装XEngine可以参考其Readme文档 +必须安装XEngine,版本需要V9.x或者以上版本,安装XEngine可以参考其Readme文档 GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -83,7 +83,7 @@ git submodule update XEngine_AuthorizeApp为PC端管理工具 #### Linux -Linux使用Makefile编译,UBUNTU22.04 x64或者RockyLinux 9 x64 +Linux使用Makefile编译,UBUNTU22.04或者以上系统 在控制台运行,使用XEngine_AuthorizeService #### Macos diff --git a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp index 5e82d26b9efc92fa849e1916f2188ad2516bbcfd..fd35cbc7b9d54269f37337791d45cffb72c5be73 100644 --- a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp +++ b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp @@ -3,7 +3,7 @@ #include #pragma comment(lib,"Ws2_32.lib") #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_Client/XClient_Socket") #pragma comment(lib,"XEngine_Client/XClient_APIHelp") #ifdef _WIN64 @@ -23,8 +23,8 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include #include @@ -32,7 +32,7 @@ using namespace std; #include "../../XEngine_Source/XAuth_Protocol.h" //Windows::vs2022 x86 debug 编译即可 -//Linux::g++ -std=c++17 -Wall -g Authorize_APPClient.cpp -o Authorize_APPClient.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_OPenSsl -lXClient_Socket -lXEngine_BaseLib -lXClient_APIHelp -lpthread -ljsoncpp -Wl,-rpath=../../XEngine_Release +//Linux::g++ -std=c++17 -Wall -g Authorize_APPClient.cpp -o Authorize_APPClient.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_Cryption -lXClient_Socket -lXEngine_BaseLib -lXClient_APIHelp -lpthread -ljsoncpp -Wl,-rpath=../../XEngine_Release //#define _DYNAMIC_CODE //#define _PASS_ENCRYPT @@ -68,7 +68,7 @@ XHTHREAD AuthClient_Thread() if (nMsgLen > 0 && bEncrypto) { //只有有后续数据的情况才需要解密 - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, lpszPass); } else { @@ -131,19 +131,19 @@ int AuthClient_Register() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_Register:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_Register:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; } @@ -167,18 +167,18 @@ int AuthClient_Pay() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_Pay:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_Pay:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; } @@ -198,7 +198,7 @@ int AuthClient_DynamicCode() { XCHAR tszDEBuffer[2048] = {}; - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); if (!pSt_JsonReader->parse(tszDEBuffer, tszDEBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { return 0; @@ -221,7 +221,7 @@ int AuthClient_DynamicCode() nDYCode = st_JsonRoot["nDynamicCode"].asUInt(); xhToken = st_JsonRoot["xhToken"].asUInt64(); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } @@ -266,7 +266,7 @@ int AuthClient_Login() memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT; - OPenSsl_XCrypto_Encoder((LPCXSTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, lpszPass); + Cryption_XCrypto_Encoder((LPCXSTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, lpszPass); memcpy(tszMsgBuffer, &st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR)); memcpy(tszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR), tszCodecBuffer, st_ProtocolHdr.unPacketSize); @@ -295,7 +295,7 @@ int AuthClient_Login() int AuthClient_Notice() { XCHAR tszURLStr[MAX_PATH] = {}; - _xstprintf(tszURLStr, _T("http://127.0.0.1:5302/api?function=notice&token=%lld"), xhToken); + _xstprintf(tszURLStr, _X("http://127.0.0.1:5302/api?function=notice&token=%lld"), xhToken); int nMsgLen = 0; XCHAR* ptszMsgBuffer = NULL; @@ -310,7 +310,7 @@ int AuthClient_Notice() { XCHAR tszDEBuffer[2048] = {}; - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); if (!pSt_JsonReader->parse(tszDEBuffer, tszDEBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { return 0; @@ -331,7 +331,7 @@ int AuthClient_Notice() Json::Value st_JsonArray = st_JsonRoot["Array"][i]; int nMsgLen = st_JsonArray["tszContext"].asString().length(); - BaseLib_OperatorCharset_UTFToAnsi(st_JsonArray["tszContext"].asCString(), tszMsgBuffer, &nMsgLen); + BaseLib_Charset_UTFToAnsi(st_JsonArray["tszContext"].asCString(), tszMsgBuffer, &nMsgLen); #ifdef _MSC_BUILD printf("AuthClient_Notice:\nID:%lld:%s\n", st_JsonArray["nID"].asInt64(), tszMsgBuffer); @@ -339,7 +339,7 @@ int AuthClient_Notice() printf("AuthClient_Notice:\nID:%ld:%s\n", st_JsonArray["nID"].asInt64(), tszMsgBuffer); #endif } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return 0; } int AuthClient_GetPass() @@ -364,18 +364,18 @@ int AuthClient_GetPass() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_GetPass:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_GetPass:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; @@ -385,7 +385,7 @@ int AuthClient_GetTime() Json::Value st_JsonRoot; Json::Value st_JsonObject; XCHAR tszURLStr[MAX_PATH] = {}; - _xstprintf(tszURLStr, _T("http://127.0.0.1:5302/api?function=time&token=%lld"),xhToken); + _xstprintf(tszURLStr, _X("http://127.0.0.1:5302/api?function=time&token=%lld"),xhToken); st_JsonObject["tszUserName"] = lpszUser; st_JsonObject["tszUserPass"] = lpszPass; @@ -400,18 +400,18 @@ int AuthClient_GetTime() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("GET"), tszURLStr, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_GetTime:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("GET"), tszURLStr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_GetTime:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; @@ -439,18 +439,18 @@ int AuthClient_Delete() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_Delete:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_Delete:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; } @@ -473,18 +473,18 @@ int AuthClient_Try() XCHAR tszDEBuffer[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass); APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass); printf("AuthClient_Try:\n%s\n", tszDEBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); printf("AuthClient_Try:\n%s\n", ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } return 0; } diff --git a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.vcxproj b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.vcxproj index f08ab9d0865e202529a0d34e754a3447434397d1..9511b05b6cd052baee4a8a964548930e62e01605 100644 --- a/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.vcxproj +++ b/XEngine_Apps/Authorize_APPClient/Authorize_APPClient.vcxproj @@ -30,7 +30,7 @@ Application true v143 - MultiByte + Unicode Application @@ -80,8 +80,8 @@ true - $(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath) - $(XEngine_Lib64);$(LibraryPath) + $(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_Lib64);../../XEngine_Source/Debug;$(LibraryPath) false diff --git a/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.cpp b/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.cpp index 6b78a13b606baf988666b20dcbe2d47e66990ed9..548feec9202146f6ee4f381845231427b3e11e2f 100644 --- a/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.cpp +++ b/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.cpp @@ -3,7 +3,7 @@ #include #pragma comment(lib,"Ws2_32") #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi") #ifdef _WIN64 #pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp") @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "../../XEngine_Source/XAuth_Protocol.h" @@ -33,7 +33,7 @@ //需要优先配置XEngine //WINDOWS支持VS2022 x86 debug 编译调试 -//g++ -std=c++17 -Wall -g Authorize_APPLocal.cpp -o Authorize_APPLocal.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_OPenSsl -lXEngine_SystemApi -lAuthorizeModule_CDKey -ljsoncpp -Wl,-rpath=../../XEngine_Release +//g++ -std=c++17 -Wall -g Authorize_APPLocal.cpp -o Authorize_APPLocal.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_Cryption -lXEngine_SystemApi -lAuthorizeModule_CDKey -ljsoncpp -Wl,-rpath=../../XEngine_Release XCHAR tszSerialStr[MAX_PATH] = {}; //1.创建CDKEY.或者由管理员创建. @@ -60,7 +60,7 @@ bool Authorize_APPLocal_Create(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) st_AuthLocal.st_AuthRegInfo.enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_TIME; st_AuthLocal.st_AuthRegInfo.enVModeType = ENUM_AUTHORIZE_MODULE_VERMODE_TYPE_LOCAL; st_AuthLocal.st_AuthRegInfo.nHasTime = 0; - BaseLib_OperatorTime_TimeToStr(st_AuthLocal.st_AuthRegInfo.tszCreateTime); + BaseLib_Time_TimeToStr(st_AuthLocal.st_AuthRegInfo.tszCreateTime); _tcsxcpy(st_AuthLocal.st_AuthRegInfo.tszHardware, st_SDKSerial.tszBoardSerial); _xstprintf(st_AuthLocal.st_AuthRegInfo.tszLeftTime, _X("0")); //0次试用 //序列号信息.可以不写,如果不想启用用户自己注册.或者交给管理员填充 @@ -75,10 +75,10 @@ bool Authorize_APPLocal_Create(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) st_AuthLocal.st_AuthSerial.st_DataLimit.bTimeAdd = false; _tcsxcpy(st_AuthLocal.st_AuthSerial.st_DataLimit.tszDataSerial, pptszSerialList[1]); XCHAR tszTimeStr[128] = {}; - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_GetSysTime(&st_LibTime); + XENGINE_LIBTIME st_LibTime = {}; + BaseLib_Time_GetSysTime(&st_LibTime); st_LibTime.wYear += 1; //一年后过期 - BaseLib_OperatorTime_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); + BaseLib_Time_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); _tcsxcpy(st_AuthLocal.st_AuthSerial.st_DataLimit.tszDataTime, tszTimeStr); @@ -88,7 +88,7 @@ bool Authorize_APPLocal_Create(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) _xstprintf(st_AuthLocal.st_AuthUserInfo.tszUserContact, _X("486179@qq.com")); Authorize_CDKey_WriteMemory(tszDECodecBuffer, &nRet, &st_AuthLocal); - OPenSsl_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); FILE* pSt_File = _xtfopen(lpszKeyFile, _X("wb")); if (NULL == pSt_File) { @@ -116,7 +116,7 @@ bool Authorize_APPLocal_Auth(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd, LPCXSTR lp int nRet = fread(tszENCodecBuffer, 1, sizeof(tszENCodecBuffer), pSt_File); fclose(pSt_File); - OPenSsl_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszPasswd); + Cryption_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszPasswd); //printf("大小:%d,内容:\n%s\n", nRet, tszDECodecBuffer); Authorize_CDKey_ReadMemory(tszDECodecBuffer, nRet, &st_AuthLocal); @@ -129,7 +129,7 @@ bool Authorize_APPLocal_Auth(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd, LPCXSTR lp memset(tszENCodecBuffer, '\0', sizeof(tszENCodecBuffer)); memset(tszDECodecBuffer, '\0', sizeof(tszDECodecBuffer)); Authorize_CDKey_WriteMemory(tszDECodecBuffer, &nRet, &st_AuthLocal); - OPenSsl_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); pSt_File = _xtfopen(lpszKeyFile, _X("wb")); fwrite(tszENCodecBuffer, 1, nRet, pSt_File); fclose(pSt_File); @@ -151,7 +151,7 @@ bool Authorize_APPLocal_Auth(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) int nRet = fread(tszENCodecBuffer, 1, sizeof(tszENCodecBuffer), pSt_File); fclose(pSt_File); - OPenSsl_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszPasswd); + Cryption_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszPasswd); //printf("大小:%d,内容:\n%s\n", nRet, tszDECodecBuffer); Authorize_CDKey_ReadMemory(tszDECodecBuffer, nRet, &st_AuthLocal); if (!Authorize_CDKey_GetLeftTimer(&st_AuthLocal)) @@ -160,7 +160,7 @@ bool Authorize_APPLocal_Auth(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) memset(tszENCodecBuffer, '\0', sizeof(tszENCodecBuffer)); memset(tszDECodecBuffer, '\0', sizeof(tszDECodecBuffer)); Authorize_CDKey_WriteMemory(tszDECodecBuffer, &nRet, &st_AuthLocal); - OPenSsl_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); pSt_File = _xtfopen(lpszKeyFile, _X("wb")); fwrite(tszENCodecBuffer, 1, nRet, pSt_File); fclose(pSt_File); @@ -190,7 +190,7 @@ bool Authorize_APPLocal_Auth(LPCXSTR lpszKeyFile, LPCXSTR lpszPasswd) memset(tszENCodecBuffer, '\0', sizeof(tszENCodecBuffer)); memset(tszDECodecBuffer, '\0', sizeof(tszDECodecBuffer)); Authorize_CDKey_WriteMemory(tszDECodecBuffer, &nRet, &st_AuthLocal); - OPenSsl_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, lpszPasswd); pSt_File = _xtfopen(lpszKeyFile, _X("wb")); fwrite(tszENCodecBuffer, 1, nRet, pSt_File); fclose(pSt_File); diff --git a/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.vcxproj b/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.vcxproj index 4ad74c20f27c60dbee7520a215c922830619dd97..2fbd4f42592163c2d374cd76d3bc4b8eadfe9d52 100644 --- a/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.vcxproj +++ b/XEngine_Apps/Authorize_APPLocal/Authorize_APPLocal.vcxproj @@ -30,7 +30,7 @@ Application true v143 - MultiByte + Unicode Application @@ -75,8 +75,8 @@ $(XEngine_Lib32);../../XEngine_Source/Debug;$(LibraryPath) - $(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath) - $(XEngine_Lib64);$(LibraryPath) + $(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_Lib64);../../XEngine_Source/Debug;$(LibraryPath) @@ -110,7 +110,7 @@ Level3 true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true diff --git a/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.cpp b/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.cpp index f03642be24ee05e8278fc2bb2f91d66da5770c1b..f3dc0b6eb386525e757a100b7781194ec4537831 100644 --- a/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.cpp +++ b/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.cpp @@ -3,8 +3,9 @@ #include #pragma comment(lib,"Ws2_32") #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_Client/XClient_APIHelp") +#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemConfig") #ifdef _WIN64 #pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp") #pragma comment(lib,"../../XEngine_Source/x64/Debug/AuthorizeModule_CDKey") @@ -22,17 +23,19 @@ #include #include #include -#include -#include +#include +#include #include #include +#include +#include #include "../../XEngine_Source/XAuth_Protocol.h" #include "../../XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h" #include "../../XEngine_Source/AuthorizeModule_CDKey/CDKey_Error.h" //需要优先配置XEngine //WINDOWS支持VS2022 x64 debug 编译调试 -//g++ -std=c++17 -Wall -g Authorize_CDKeyNetVer.cpp -o Authorize_CDKeyNetVer.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -lXEngine_BaseLib -L ../../XEngine_Release -lXEngine_OPenSsl -lXClient_APIHelp -lAuthorizeModule_CDKey -ljsoncpp -Wl,-rpath=../../XEngine_Release +//g++ -std=c++17 -Wall -g Authorize_CDKeyNetVer.cpp -o Authorize_CDKeyNetVer.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -lXEngine_BaseLib -L ../../XEngine_Release -lXEngine_Cryption -lXClient_APIHelp -lXEngine_SystemConfig -lAuthorizeModule_CDKey -ljsoncpp -Wl,-rpath=../../XEngine_Release //#define XENGINE_AUTHORIZE_CDKEY_CRYPTO @@ -78,7 +81,7 @@ int main() memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); nLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); if (!APIClient_Http_Request(_X("POST"), lpszCreateUrl, tszCodecBuffer, &nCode, &ptszCreateBuffer, &nLen)) #else if (!APIClient_Http_Request(_X("POST"), lpszCreateUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszCreateBuffer, &nLen)) @@ -94,15 +97,15 @@ int main() //解密 memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); - OPenSsl_XCrypto_Decoder(ptszCreateBuffer, &nLen, tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Decoder(ptszCreateBuffer, &nLen, tszCodecBuffer, lpszPasswd); printf("接受到数据,大小:%d,内容:\n%s\n", nLen, tszCodecBuffer); //你也可以通过授权模块的API函数来读内存,都一回事,这里为了方便直接写了,请求分钟卡,拥有10分钟,也可以写自定义时间格式 - BaseLib_OperatorFile_WriteProfileFromMemory(tszCodecBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); + SystemConfig_File_WriteProfileFromMemory(tszCodecBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); #else - BaseLib_OperatorFile_WriteProfileFromMemory(ptszCreateBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); + SystemConfig_File_WriteProfileFromMemory(ptszCreateBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszCreateBuffer); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszCreateBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszCreateBuffer); //2. 授权CDKEY XCHAR* ptszAuthBuffer = NULL; LPCXSTR lpszAuthUrl = _X("http://127.0.0.1:5302/auth/cdkey/auth"); @@ -110,7 +113,7 @@ int main() //加密 memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); nLen = nLen; - OPenSsl_XCrypto_Encoder(tszMsgBuffer, &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszMsgBuffer, &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); if (!APIClient_Http_Request(_X("POST"), lpszAuthUrl, tszCodecBuffer, &nCode, &ptszAuthBuffer, &nLen)) #else if (!APIClient_Http_Request(_X("POST"), lpszAuthUrl, tszMsgBuffer, &nCode, &ptszAuthBuffer, &nLen)) @@ -123,15 +126,15 @@ int main() //解密 memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); - OPenSsl_XCrypto_Decoder(ptszAuthBuffer, &nLen, tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Decoder(ptszAuthBuffer, &nLen, tszCodecBuffer, lpszPasswd); printf("接受到数据,大小:%d,内容:\n%s\n", nLen, tszCodecBuffer); //你也可以通过授权模块的API函数来读内存,都一回事,这里为了方便直接写了,请求分钟卡,拥有10分钟,也可以写自定义时间格式 - BaseLib_OperatorFile_WriteProfileFromMemory(tszCodecBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); + SystemConfig_File_WriteProfileFromMemory(tszCodecBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); #else printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszAuthBuffer); - BaseLib_OperatorFile_WriteProfileFromMemory(ptszAuthBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); + SystemConfig_File_WriteProfileFromMemory(ptszAuthBuffer, nLen, "AuthReg", "tszLeftTime", "10", tszMsgBuffer, &nLen); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszAuthBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszAuthBuffer); //3. 验证CDKEY XCHAR* ptszVerBuffer = NULL; LPCXSTR lpszVerUrl = _X("http://127.0.0.1:5302/auth/cdkey/ver"); @@ -142,7 +145,7 @@ int main() #ifdef XENGINE_AUTHORIZE_CDKEY_CRYPTO //加密 memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); - OPenSsl_XCrypto_Encoder(tszMsgBuffer, &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Encoder(tszMsgBuffer, &nLen, (XBYTE*)tszCodecBuffer, lpszPasswd); if (!APIClient_Http_Request(_X("POST"), lpszVerUrl, tszCodecBuffer, &nCode, &ptszVerBuffer, &nLen)) #else if (!APIClient_Http_Request(_X("POST"), lpszVerUrl, tszMsgBuffer, &nCode, &ptszVerBuffer, &nLen)) @@ -155,14 +158,14 @@ int main() //解密 memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); - OPenSsl_XCrypto_Decoder(ptszVerBuffer, &nLen, tszCodecBuffer, lpszPasswd); + Cryption_XCrypto_Decoder(ptszVerBuffer, &nLen, tszCodecBuffer, lpszPasswd); printf("接受到数据,大小:%d,内容:\n%s\n", nLen, tszCodecBuffer); Authorize_CDKey_ReadMemory(tszCodecBuffer, nLen, &st_Authorize); #else printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszVerBuffer); Authorize_CDKey_ReadMemory(ptszVerBuffer, nLen, &st_Authorize); #endif - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszVerBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszVerBuffer); //4. 也可以本地验证 if (Authorize_CDKey_GetLeftTimer(&st_Authorize)) diff --git a/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.vcxproj b/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.vcxproj index 293a83664f99d3c5f3f41d347daef0810c26e33f..95fcd568416c0d1ae9c5d323a6de5f97bed66be7 100644 --- a/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.vcxproj +++ b/XEngine_Apps/Authorize_CDKeyNetVer/Authorize_CDKeyNetVer.vcxproj @@ -74,6 +74,10 @@ $(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) $(XEngine_Lib32);../../XEngine_Source/Debug;$(LibraryPath) + + $(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath) + $(XEngine_Lib64);../../XEngine_Source/x64/Debug;$(LibraryPath) + Level3 diff --git a/XEngine_Apps/VSCopy_Client_x64.bat b/XEngine_Apps/VSCopy_Client_x64.bat index f02f947d28899c23b89719dee9b4997c78a4424c..fc40d03a5d440487bbac8687e1aa295fdb77aba1 100644 --- a/XEngine_Apps/VSCopy_Client_x64.bat +++ b/XEngine_Apps/VSCopy_Client_x64.bat @@ -1,8 +1,10 @@ copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseLib.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" \ No newline at end of file diff --git a/XEngine_Apps/VSCopy_Client_x86.bat b/XEngine_Apps/VSCopy_Client_x86.bat index e44d2bfcbf58b9202ea73b26af7cfa44f86b36e7..ae37887bf54e82177fac4108f20e6099fac765f9 100644 --- a/XEngine_Apps/VSCopy_Client_x86.bat +++ b/XEngine_Apps/VSCopy_Client_x86.bat @@ -1,8 +1,10 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseLib.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" \ 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 a421ccfeec891826a83c0d73184d1c39b54d88ef..d3e31e5872af5aab775d713e1c259eb0412fd249 100644 --- a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json @@ -1,5 +1,6 @@ { "XVer":[ + "V3.16.0.1001 Build20250113", "V3.15.0.1001 Build20241121", "V3.14.0.1001 Build20240920", "V3.13.0.1001 Build20240715", diff --git a/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj b/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj index dbcf2a59a575f0332f5e0654220285c551847150..b30a87aa3b008625e9285ef204a2be3d2cb3a1a8 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj +++ b/XEngine_Source/AuthorizeModule_CDKey/AuthorizeModule_CDKey.vcxproj @@ -94,6 +94,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -112,6 +114,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -130,6 +136,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -148,6 +156,10 @@ true Use pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp index 158e5fe82cbfce4273d797c9cee5b03b4d25110e..8316ed0fdb2b119d7438b11cdd3d6e025b3e43c3 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp +++ b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.cpp @@ -50,38 +50,38 @@ bool CAuthorize_CDKey::Authorize_CDKey_WriteKey(LPCXSTR lpszFileKey, XENGINE_AUT return false; } //添加连接信息文本 - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_CONNECT; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey, _X("Connection"), _X("nPort"), pSt_AuthLocal->nPort)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey, _X("Connection"), _X("nPort"), pSt_AuthLocal->nPort)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_CONNECT; return false; } //添加程序名称文本 - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey, _X("AppInfo"), _X("nExecTime"), pSt_AuthLocal->st_AuthAppInfo.nExecTime)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey, _X("AppInfo"), _X("nExecTime"), pSt_AuthLocal->st_AuthAppInfo.nExecTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AppInfo"), _X("bInit"), pSt_AuthLocal->st_AuthAppInfo.bInit)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AppInfo"), _X("bInit"), pSt_AuthLocal->st_AuthAppInfo.bInit)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; @@ -96,129 +96,129 @@ bool CAuthorize_CDKey::Authorize_CDKey_WriteKey(LPCXSTR lpszFileKey, XENGINE_AUT memset(tszTimeStart, '\0', sizeof(tszTimeStart)); memset(tszTimeEnd, '\0', sizeof(tszTimeEnd)); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd); - BaseLib_OperatorTimeSpan_GetForStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, tszTimeEnd, &nUsedTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_Time_TimeToStr(tszTimeEnd); + BaseLib_TimeSpan_GetForStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, tszTimeEnd, &nUsedTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); pSt_AuthLocal->st_AuthRegInfo.nHasTime -= nUsedTime; } //添加注册信息 - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("nHasTime"), pSt_AuthLocal->st_AuthRegInfo.nHasTime)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("nHasTime"), pSt_AuthLocal->st_AuthRegInfo.nHasTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enHWType"), pSt_AuthLocal->st_AuthRegInfo.enHWType)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enHWType"), pSt_AuthLocal->st_AuthRegInfo.enHWType)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enRegType"), pSt_AuthLocal->st_AuthRegInfo.enRegType)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enRegType"), pSt_AuthLocal->st_AuthRegInfo.enRegType)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enSerialType"), pSt_AuthLocal->st_AuthRegInfo.enSerialType)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enSerialType"), pSt_AuthLocal->st_AuthRegInfo.enSerialType)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enVModeType"), pSt_AuthLocal->st_AuthRegInfo.enVModeType)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey,_X("AuthReg"), _X("enVModeType"), pSt_AuthLocal->st_AuthRegInfo.enVModeType)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszCreateTime); - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime)) + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszCreateTime); + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey,_X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } //临时序列号 - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey, _X("AuthSerial"), _X("nTimeCount"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey, _X("AuthSerial"), _X("nTimeCount"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (!BaseLib_OperatorFile_WriteInt64FromFile(lpszFileKey, _X("AuthSerial"), _X("bTimeAdd"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd)) + if (!SystemConfig_File_WriteInt64FromFile(lpszFileKey, _X("AuthSerial"), _X("bTimeAdd"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } //自定义用户信息 - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; return false; } - if (!BaseLib_OperatorFile_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom)) + if (!SystemConfig_File_WriteProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; @@ -255,59 +255,59 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadKey(LPCXSTR lpszFileKey, XENGINE_AUTH return false; } //添加连接信息文本 - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_CONNECT; return false; } - pSt_AuthLocal->nPort = BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("Connection"), _X("nPort")); + pSt_AuthLocal->nPort = SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("Connection"), _X("nPort")); //添加程序名称文本 - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_APPINFO; return false; } - pSt_AuthLocal->st_AuthAppInfo.nExecTime = BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AppInfo"), _X("nExecTime")); - pSt_AuthLocal->st_AuthAppInfo.bInit = BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AppInfo"), _X("bInit")); + pSt_AuthLocal->st_AuthAppInfo.nExecTime = SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AppInfo"), _X("nExecTime")); + pSt_AuthLocal->st_AuthAppInfo.bInit = SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AppInfo"), _X("bInit")); //添加注册信息 - pSt_AuthLocal->st_AuthRegInfo.enHWType = (ENUM_AUTHORIZE_MODULE_HW_TYPE)BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enHWType")); - pSt_AuthLocal->st_AuthRegInfo.enRegType = (ENUM_AUTHORIZE_MODULE_CDKEY_TYPE)BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enRegType")); - pSt_AuthLocal->st_AuthRegInfo.enSerialType = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enSerialType")); - pSt_AuthLocal->st_AuthRegInfo.enVModeType = (ENUM_AUTHORIZE_MODULE_VERMODE_TYPE)BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enVModeType")); - pSt_AuthLocal->st_AuthRegInfo.nHasTime = BaseLib_OperatorFile_ReadInt64FromFile(lpszFileKey, _X("AuthReg"), _X("nHasTime")); - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware) <= 0) + pSt_AuthLocal->st_AuthRegInfo.enHWType = (ENUM_AUTHORIZE_MODULE_HW_TYPE)SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enHWType")); + pSt_AuthLocal->st_AuthRegInfo.enRegType = (ENUM_AUTHORIZE_MODULE_CDKEY_TYPE)SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enRegType")); + pSt_AuthLocal->st_AuthRegInfo.enSerialType = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enSerialType")); + pSt_AuthLocal->st_AuthRegInfo.enVModeType = (ENUM_AUTHORIZE_MODULE_VERMODE_TYPE)SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthReg"), _X("enVModeType")); + pSt_AuthLocal->st_AuthRegInfo.nHasTime = SystemConfig_File_ReadInt64FromFile(lpszFileKey, _X("AuthReg"), _X("nHasTime")); + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime) < 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime) < 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime) < 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime) < 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime) < 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime) < 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; @@ -316,73 +316,73 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadKey(LPCXSTR lpszFileKey, XENGINE_AUTH //设置启动时间 if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { - XENGINE_LIBTIMER st_EndTimer; - XENGINE_LIBTIMER st_StartTime; + XENGINE_LIBTIME st_EndTimer; + XENGINE_LIBTIME st_StartTime; - memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIMER)); - memset(&st_StartTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIME)); + memset(&st_StartTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_GetSysTime(&st_EndTimer); - BaseLib_OperatorTime_StrToTime(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, &st_StartTime); + BaseLib_Time_GetSysTime(&st_EndTimer); + BaseLib_Time_StrToTime(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, &st_StartTime); if ((st_EndTimer.wYear != st_StartTime.wYear) || (st_EndTimer.wMonth != st_StartTime.wMonth) || (st_EndTimer.wDay != st_StartTime.wDay)) { pSt_AuthLocal->st_AuthRegInfo.nHasTime--; } - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); } else if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { memset(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, '\0', sizeof(pSt_AuthLocal->st_AuthRegInfo.tszStartTime)); - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime) < 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime) < 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_AUTHREG; return false; } //临时序列号 - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount = BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthSerial"), _X("nTimeCount")); - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial) <= 0) + pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount = SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthSerial"), _X("nTimeCount")); + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } - pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd = BaseLib_OperatorFile_ReadIntFromFile(lpszFileKey, _X("AuthSerial"), _X("bAddTime")); - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial) <= 0) + pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd = SystemConfig_File_ReadIntFromFile(lpszFileKey, _X("AuthSerial"), _X("bAddTime")); + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_SERIAL; return false; } //用户信息 - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact) <= 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact) <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; return false; } - if (BaseLib_OperatorFile_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom) < 0) + if (SystemConfig_File_ReadProfileFromFile(lpszFileKey, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom) < 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_USER; @@ -425,38 +425,38 @@ bool CAuthorize_CDKey::Authorize_CDKey_WriteMemory(XCHAR* ptszMsgBuffer, int* pI } int nMsgLen = 0; //添加连接信息文本 - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("Connection"), _X("nPort"), pSt_AuthLocal->nPort, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("Connection"), _X("nPort"), pSt_AuthLocal->nPort, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //添加程序名称文本 - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("nExecTime"), pSt_AuthLocal->st_AuthAppInfo.nExecTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("nExecTime"), pSt_AuthLocal->st_AuthAppInfo.nExecTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("bInit"), pSt_AuthLocal->st_AuthAppInfo.bInit, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AppInfo"), _X("bInit"), pSt_AuthLocal->st_AuthAppInfo.bInit, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); @@ -471,129 +471,129 @@ bool CAuthorize_CDKey::Authorize_CDKey_WriteMemory(XCHAR* ptszMsgBuffer, int* pI memset(tszTimeStart, '\0', sizeof(tszTimeStart)); memset(tszTimeEnd, '\0', sizeof(tszTimeEnd)); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd); - BaseLib_OperatorTimeSpan_GetForStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, tszTimeEnd, &nUsedTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_Time_TimeToStr(tszTimeEnd); + BaseLib_TimeSpan_GetForStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, tszTimeEnd, &nUsedTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); pSt_AuthLocal->st_AuthRegInfo.nHasTime -= nUsedTime; } //添加注册信息 - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("nHasTime"), pSt_AuthLocal->st_AuthRegInfo.nHasTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("nHasTime"), pSt_AuthLocal->st_AuthRegInfo.nHasTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enHWType"), pSt_AuthLocal->st_AuthRegInfo.enHWType, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enHWType"), pSt_AuthLocal->st_AuthRegInfo.enHWType, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enRegType"), pSt_AuthLocal->st_AuthRegInfo.enRegType, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enRegType"), pSt_AuthLocal->st_AuthRegInfo.enRegType, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enSerialType"), pSt_AuthLocal->st_AuthRegInfo.enSerialType, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enSerialType"), pSt_AuthLocal->st_AuthRegInfo.enSerialType, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enVModeType"), pSt_AuthLocal->st_AuthRegInfo.enVModeType, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enVModeType"), pSt_AuthLocal->st_AuthRegInfo.enVModeType, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszCreateTime); - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime, ptszMsgBuffer, &nMsgLen)) + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszCreateTime); + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //临时序列号 - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("nTimeCount"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("nTimeCount"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("bAddTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteInt64FromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("bAddTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //用户信息 - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom, ptszMsgBuffer, &nMsgLen)) + if (!SystemConfig_File_WriteProfileFromMemory(ptszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom, ptszMsgBuffer, &nMsgLen)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); @@ -636,65 +636,65 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMs return false; } //添加连接信息文本 - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("Connection"), _X("tszAddr"), pSt_AuthLocal->tszAddr)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("Connection"), _X("nPort"), &pSt_AuthLocal->nPort)) + if (!SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("Connection"), _X("nPort"), &pSt_AuthLocal->nPort)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //添加程序名称文本 - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppName"), pSt_AuthLocal->st_AuthAppInfo.tszAppName)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("tszAppVer"), pSt_AuthLocal->st_AuthAppInfo.tszAppVer)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("bInit"), (int*)&pSt_AuthLocal->st_AuthAppInfo.bInit); - BaseLib_OperatorFile_ReadInt64FromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("nExecTime"), &pSt_AuthLocal->st_AuthAppInfo.nExecTime); + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("bInit"), (int*)&pSt_AuthLocal->st_AuthAppInfo.bInit); + SystemConfig_File_ReadInt64FromMemory(lpszMsgBuffer, nMsgLen, _X("AppInfo"), _X("nExecTime"), &pSt_AuthLocal->st_AuthAppInfo.nExecTime); //添加注册信息 - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enHWType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enHWType); - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enRegType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enRegType); - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enSerialType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enSerialType); - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enVModeType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enVModeType); - BaseLib_OperatorFile_ReadInt64FromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("nHasTime"), &pSt_AuthLocal->st_AuthRegInfo.nHasTime); + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enHWType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enHWType); + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enRegType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enRegType); + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enSerialType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enSerialType); + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("enVModeType"), (int*)&pSt_AuthLocal->st_AuthRegInfo.enVModeType); + SystemConfig_File_ReadInt64FromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("nHasTime"), &pSt_AuthLocal->st_AuthRegInfo.nHasTime); - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszHardware"), pSt_AuthLocal->st_AuthRegInfo.tszHardware)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszCreateTime"), pSt_AuthLocal->st_AuthRegInfo.tszCreateTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszRegisterTime"), pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszLeftTime"), pSt_AuthLocal->st_AuthRegInfo.tszLeftTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszStartTime"), pSt_AuthLocal->st_AuthRegInfo.tszStartTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); @@ -703,78 +703,78 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMs //设置启动时间 if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { - XENGINE_LIBTIMER st_EndTimer; - XENGINE_LIBTIMER st_StartTime; + XENGINE_LIBTIME st_EndTimer; + XENGINE_LIBTIME st_StartTime; - memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIMER)); - memset(&st_StartTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIME)); + memset(&st_StartTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_GetSysTime(&st_EndTimer); - BaseLib_OperatorTime_StrToTime(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, &st_StartTime); + BaseLib_Time_GetSysTime(&st_EndTimer); + BaseLib_Time_StrToTime(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, &st_StartTime); if ((st_EndTimer.wYear != st_StartTime.wYear) || (st_EndTimer.wMonth != st_StartTime.wMonth) || (st_EndTimer.wDay != st_StartTime.wDay)) { pSt_AuthLocal->st_AuthRegInfo.nHasTime--; } - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); } else if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { memset(pSt_AuthLocal->st_AuthRegInfo.tszStartTime, '\0', sizeof(pSt_AuthLocal->st_AuthRegInfo.tszStartTime)); - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthReg"), _X("tszExpiryTime"), pSt_AuthLocal->st_AuthRegInfo.tszExpiryTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //序列号信息 - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszTimeSerial"), pSt_AuthLocal->st_AuthSerial.st_TimeLimit.tszTimeSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("nTimeCount"), &pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount)) + if (!SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("nTimeCount"), &pSt_AuthLocal->st_AuthSerial.st_TimeLimit.nTimeCount)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataSerial"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszDataTime"), pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - BaseLib_OperatorFile_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("bAddTime"), (int*)&pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd); - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial)) + SystemConfig_File_ReadIntFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("bAddTime"), (int*)&pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd); + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthSerial"), _X("tszUNLimitSerial"), pSt_AuthLocal->st_AuthSerial.st_UNLimit.tszUNLimitSerial)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } //用户信息 - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserName"), pSt_AuthLocal->st_AuthUserInfo.tszUserName)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszUserContact"), pSt_AuthLocal->st_AuthUserInfo.tszUserContact)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); return false; } - if (!BaseLib_OperatorFile_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom)) + if (!SystemConfig_File_ReadProfileFromMemory(lpszMsgBuffer, nMsgLen, _X("AuthUser"), _X("tszCustom"), pSt_AuthLocal->st_AuthUserInfo.tszCustom)) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = BaseLib_GetLastError(); @@ -805,7 +805,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMs 意思:是否构造成功 备注:此函数会修改st_AuthRegInfo的时间信息成员,必须重写CDKEY *********************************************************************/ -bool CAuthorize_CDKey::Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer /* = 0 */, XENGINE_LIBTIMER* pSt_DayTimer /* = NULL */) +bool CAuthorize_CDKey::Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer /* = 0 */, XENGINE_LIBTIME* pSt_DayTimer /* = NULL */) { Authorize_IsErrorOccur = false; @@ -867,16 +867,16 @@ bool CAuthorize_CDKey::Authorize_CDKey_UserRegister(XENGINE_AUTHORIZE_LOCAL* pSt bSerial = true; pSt_AuthLocal->st_AuthRegInfo.enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_CUSTOM; pSt_AuthLocal->st_AuthRegInfo.enRegType = ENUM_AUTHORIZE_MODULE_CDKEY_TYPE_OFFICIAL; - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_GetSysTime(&st_LibTime); + XENGINE_LIBTIME st_LibTime = {}; + BaseLib_Time_GetSysTime(&st_LibTime); if (pSt_AuthLocal->st_AuthSerial.st_DataLimit.bTimeAdd) { __int64x nTimeCount = 0; - XENGINE_LIBTIMER st_AddTime = {}; + XENGINE_LIBTIME st_AddTime = {}; - BaseLib_OperatorTimeSpan_GetForStr(pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, pSt_AuthLocal->st_AuthRegInfo.tszCreateTime, &nTimeCount); + BaseLib_TimeSpan_GetForStr(pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, pSt_AuthLocal->st_AuthRegInfo.tszCreateTime, &nTimeCount); st_AddTime.wDay = (int)nTimeCount; - BaseLib_OperatorTimeSpan_CalForStu(&st_LibTime, &st_AddTime); + BaseLib_TimeSpan_CalForStu(&st_LibTime, &st_AddTime); Authorize_CDKey_BuildKeyTime(pSt_AuthLocal, 0, &st_AddTime); } @@ -884,17 +884,17 @@ bool CAuthorize_CDKey::Authorize_CDKey_UserRegister(XENGINE_AUTHORIZE_LOCAL* pSt { __int64x nTimeCount = 0; XCHAR tszTimeStr[128] = {}; - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + XENGINE_LIBTIME st_LibTime = {}; + BaseLib_Time_TimeToStr(tszTimeStr); - BaseLib_OperatorTimeSpan_GetForStr(tszTimeStr, pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, &nTimeCount); + BaseLib_TimeSpan_GetForStr(tszTimeStr, pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, &nTimeCount); if (nTimeCount <= 0) { Authorize_IsErrorOccur = true; Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_TIMEOUT; return false; } - BaseLib_OperatorTime_StrToTime(pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, &st_LibTime); + BaseLib_Time_StrToTime(pSt_AuthLocal->st_AuthSerial.st_DataLimit.tszDataTime, &st_LibTime); Authorize_CDKey_BuildKeyTime(pSt_AuthLocal, 0, &st_LibTime); } } @@ -911,7 +911,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_UserRegister(XENGINE_AUTHORIZE_LOCAL* pSt Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_FAILED; return false; } - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszRegisterTime); return true; } /******************************************************************** @@ -945,15 +945,15 @@ bool CAuthorize_CDKey::Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL* pSt return false; } //验证CDKEY本身情况 - XENGINE_LIBTIMER st_StartTimer; - XENGINE_LIBTIMER st_EndTimer; - XENGINE_LIBTIMER st_SysTimer; + XENGINE_LIBTIME st_StartTimer; + XENGINE_LIBTIME st_EndTimer; + XENGINE_LIBTIME st_SysTimer; - memset(&st_StartTimer, '\0', sizeof(XENGINE_LIBTIMER)); - memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIMER)); - memset(&st_SysTimer, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_StartTimer, '\0', sizeof(XENGINE_LIBTIME)); + memset(&st_EndTimer, '\0', sizeof(XENGINE_LIBTIME)); + memset(&st_SysTimer, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); + BaseLib_Time_TimeToStr(pSt_AuthLocal->st_AuthRegInfo.tszStartTime); //处理注册类型 if (ENUM_AUTHORIZE_MODULE_CDKEY_TYPE_UNLIMIT == pSt_AuthLocal->st_AuthRegInfo.enRegType) { @@ -988,7 +988,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL* pSt else { //其他类型的注册机制 - BaseLib_OperatorTime_GetSysTime(&st_SysTimer); + BaseLib_Time_GetSysTime(&st_SysTimer); //计算超时时间 if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_SECOND == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { @@ -1009,7 +1009,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL* pSt else if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_CUSTOM == pSt_AuthLocal->st_AuthRegInfo.enSerialType) { _stxscanf(pSt_AuthLocal->st_AuthRegInfo.tszLeftTime, _X("%04d-%02d-%02d %02d:%02d:%02d"), &st_EndTimer.wYear, &st_EndTimer.wMonth, &st_EndTimer.wDay, &st_EndTimer.wHour, &st_EndTimer.wMinute, &st_EndTimer.wSecond); - BaseLib_OperatorTimeSpan_GetForStu(&st_SysTimer, &st_EndTimer, &pSt_AuthLocal->st_AuthRegInfo.nHasTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_TimeSpan_GetForStu(&st_SysTimer, &st_EndTimer, &pSt_AuthLocal->st_AuthRegInfo.nHasTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); } else { @@ -1268,7 +1268,7 @@ bool CAuthorize_CDKey::Authorize_CDKey_ReadTime(LPCXSTR lpszFileKey, XCHAR*** pp ptszMsgBuffer = NULL; //导出 *pInt_ListCount = (int)stl_ListTime.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszTimeList, *pInt_ListCount, 64); + BaseLib_Memory_Malloc((XPPPMEM)ppptszTimeList, *pInt_ListCount, 64); list::const_iterator stl_ListIterator = stl_ListTime.begin(); for (int i = 0; stl_ListIterator != stl_ListTime.end(); stl_ListIterator++, i++) { diff --git a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.h b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.h index 987858457396611deccf8fda658897e69931471f..af62493bdc77090d503b3780b83a920f435eb6a7 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.h +++ b/XEngine_Source/AuthorizeModule_CDKey/Authorize_CDKey/Authorize_CDKey.h @@ -22,7 +22,7 @@ public: bool Authorize_CDKey_WriteMemory(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal); bool Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal); public: - bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer = 0, XENGINE_LIBTIMER* pSt_DayTimer = NULL); + bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer = 0, XENGINE_LIBTIME* pSt_DayTimer = NULL); bool Authorize_CDKey_UserRegister(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, LPCXSTR lpszSerialStr); bool Authorize_CDKey_GetLeftTimer(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, LPCXSTR lpszSerialNumber = NULL); bool Authorize_CDKey_WriteTime(LPCXSTR lpszFileKey, int nCount = 0); diff --git a/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.cpp b/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.cpp index 10bce27724735ecd050a3a80cc494f804d912a55..256d976f5234974bd8ddb407447950f976589c2c 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.cpp +++ b/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.cpp @@ -69,7 +69,7 @@ CAuthorize_Serial::~CAuthorize_Serial() 意思:是否生成成功 备注:输入的时间不能超过99999,多天卡现在由用户直接使用pSt_CustomTimer参数指定,不在内部指定了 *********************************************************************/ -bool CAuthorize_Serial::Authorize_Serial_Creator(XCHAR*** ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIMER* pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType /* = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY */) +bool CAuthorize_Serial::Authorize_Serial_Creator(XCHAR*** ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIME* pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType /* = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY */) { Authorize_IsErrorOccur = false; //参数检查 @@ -79,7 +79,7 @@ bool CAuthorize_Serial::Authorize_Serial_Creator(XCHAR*** ppptszSerialNumber, LP Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_PARAMENT; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszSerialNumber, nCardNumber, MAX_PATH); + BaseLib_Memory_Malloc((XPPPMEM)ppptszSerialNumber, nCardNumber, MAX_PATH); srand((unsigned int)time(NULL)); //取随机因子 for (int i = 0; i < nCardNumber; i++) @@ -225,7 +225,7 @@ bool CAuthorize_Serial::Authorize_Serial_Create(XCHAR*** ppptszSerialNumber, LPC Authorize_dwErrorCode = ERROR_AUTHORIZE_MODULE_CDKEY_PARAMENT; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszSerialNumber, nCardNumber, MAX_PATH); + BaseLib_Memory_Malloc((XPPPMEM)ppptszSerialNumber, nCardNumber, MAX_PATH); srand((unsigned int)time(NULL)); //取随机因子 for (int i = 0; i < nCardNumber; i++) @@ -265,7 +265,7 @@ bool CAuthorize_Serial::Authorize_Serial_Create(XCHAR*** ppptszSerialNumber, LPC 意思:是否获取成功 备注: *********************************************************************/ -bool CAuthorize_Serial::Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIMER* pSt_CustomTimer /* = NULL */) +bool CAuthorize_Serial::Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIME* pSt_CustomTimer /* = NULL */) { Authorize_IsErrorOccur = false; @@ -464,7 +464,7 @@ bool CAuthorize_Serial::Authorize_Serial_Random(XCHAR *ptszFillBuffer) { Authorize_IsErrorOccur = false; - BaseLib_OperatorHandle_CreateStr(ptszFillBuffer, 5, 0, 1); + BaseLib_Handle_CreateStr(ptszFillBuffer, 5, 0, 1); return true; } /******************************************************************** @@ -484,7 +484,7 @@ bool CAuthorize_Serial::Authorize_Serial_RandomWord(XCHAR *ptszFillBuffer) { Authorize_IsErrorOccur = false; - BaseLib_OperatorHandle_CreateStr(ptszFillBuffer, 5, 2, 1); + BaseLib_Handle_CreateStr(ptszFillBuffer, 5, 2, 1); return true; } /******************************************************************** @@ -504,6 +504,6 @@ bool CAuthorize_Serial::Authorize_Serial_RandomNumber(XCHAR *ptszFilleBuffer) { Authorize_IsErrorOccur = false; - BaseLib_OperatorHandle_CreateStr(ptszFilleBuffer, 5, 1); + BaseLib_Handle_CreateStr(ptszFilleBuffer, 5, 1); return true; } diff --git a/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.h b/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.h index ee2307c4e11c33303ea7de2662cd27828bace10f..e69642aba36898abd9808ce003f866b7a9b9387d 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.h +++ b/XEngine_Source/AuthorizeModule_CDKey/Authorize_Serial/Authorize_Serial.h @@ -18,9 +18,9 @@ public: CAuthorize_Serial(); ~CAuthorize_Serial(); public: - bool Authorize_Serial_Creator(XCHAR*** ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIMER* pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY); + bool Authorize_Serial_Creator(XCHAR*** ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIME* pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY); bool Authorize_Serial_Create(XCHAR*** ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber); - bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIMER* pSt_CustomTimer = NULL); + bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIME* pSt_CustomTimer = NULL); protected: bool Authorize_Serial_Fill(XCHAR *ptszFillBuffer, int nCardNumer); //填充后面的字段 protected: diff --git a/XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h b/XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h index fff99367f9e5061fb6ee01b4c781ff9caa640b43..c238bfacabe6adfefd765c3e9e38211d8acf310e 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h +++ b/XEngine_Source/AuthorizeModule_CDKey/CDKey_Define.h @@ -56,7 +56,7 @@ extern "C" XLONG Authorize_GetLastError(int *pInt_SysError = NULL); 意思:是否生成成功 备注:输入的时间不能超过99999,多天卡现在由用户直接使用pSt_CustomTimer参数指定,不在内部指定了 *********************************************************************/ -extern "C" bool Authorize_Serial_Creator(XCHAR * **ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIMER * pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY); +extern "C" bool Authorize_Serial_Creator(XCHAR * **ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIME * pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType = ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY); /******************************************************************** 函数名称:Authorize_Serial_Create 函数功能:创建自定义无类型序列号 @@ -109,7 +109,7 @@ extern "C" bool Authorize_Serial_Create(XCHAR*** ppptszSerialNumber, LPCXSTR lps 意思:是否获取成功 备注: *********************************************************************/ -extern "C" bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIMER* pSt_CustomTimer = NULL); +extern "C" bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE* penSerialType, XENGINE_LIBTIME* pSt_CustomTimer = NULL); /************************************************************************/ /* 本地授权导出函数 */ /************************************************************************/ @@ -222,7 +222,7 @@ extern "C" bool Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMsgLen, X 意思:是否构造成功 备注:此函数会修改st_AuthRegInfo的时间信息成员 *********************************************************************/ -extern "C" bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer = 0, XENGINE_LIBTIMER* pSt_DayTimer = NULL); +extern "C" bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL* pSt_AuthLocal, __int64x nDayTimer = 0, XENGINE_LIBTIME* pSt_DayTimer = NULL); /******************************************************************** 函数名称:Authorize_CDKey_UserRegister 函数功能:用户注册CDKEY函数 diff --git a/XEngine_Source/AuthorizeModule_CDKey/Makefile b/XEngine_Source/AuthorizeModule_CDKey/Makefile index d42338a349b7a2d9d7a969423b440704c2f30510..13dae64f27d32d7a0b318dd5518d826df95febae 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/Makefile +++ b/XEngine_Source/AuthorizeModule_CDKey/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = @@ -7,7 +7,7 @@ LIBFLAG = RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -LIB = -lXEngine_BaseLib +LIB = -lXEngine_BaseLib -lXEngine_SystemConfig LIBEX = LOADSO = OBJECTS = Authorize_Serial.o Authorize_CDKey.o pch.o diff --git a/XEngine_Source/AuthorizeModule_CDKey/pch.cpp b/XEngine_Source/AuthorizeModule_CDKey/pch.cpp index eab9eaa581674489318814590b7ea4e4c7018be5..ec70fe902e36c057c2a498927861762ee9a8ed99 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/pch.cpp +++ b/XEngine_Source/AuthorizeModule_CDKey/pch.cpp @@ -31,7 +31,7 @@ extern "C" XLONG Authorize_GetLastError(int* pInt_SysError) /************************************************************************/ /* 卡导出函数 */ /************************************************************************/ -extern "C" bool Authorize_Serial_Creator(XCHAR * **ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIMER * pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType) +extern "C" bool Authorize_Serial_Creator(XCHAR * **ppptszSerialNumber, LPCXSTR lpszUserHeader, int nCardNumber, int nFieldNumber, XENGINE_LIBTIME * pSt_CustomTimer, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType) { return m_Serial.Authorize_Serial_Creator(ppptszSerialNumber, lpszUserHeader, nCardNumber, nFieldNumber, pSt_CustomTimer, enSerialType); } @@ -39,7 +39,7 @@ extern "C" bool Authorize_Serial_Create(XCHAR * **ppptszSerialNumber, LPCXSTR lp { return m_Serial.Authorize_Serial_Create(ppptszSerialNumber, lpszUserHeader, nCardNumber, nFieldNumber); } -extern "C" bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE * penSerialType, XENGINE_LIBTIMER * pSt_CustomTimer) +extern "C" bool Authorize_Serial_GetType(LPCXSTR lpszSerialNumber, ENUM_AUTHORIZE_MODULE_SERIAL_TYPE * penSerialType, XENGINE_LIBTIME * pSt_CustomTimer) { return m_Serial.Authorize_Serial_GetType(lpszSerialNumber, penSerialType, pSt_CustomTimer); } @@ -62,7 +62,7 @@ extern "C" bool Authorize_CDKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMsgLen, X { return m_Local.Authorize_CDKey_ReadMemory(lpszMsgBuffer, nMsgLen, pSt_AuthLocal); } -extern "C" bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL * pSt_AuthLocal, __int64x nDayTimer, XENGINE_LIBTIMER * pSt_DayTimer) +extern "C" bool Authorize_CDKey_BuildKeyTime(XENGINE_AUTHORIZE_LOCAL * pSt_AuthLocal, __int64x nDayTimer, XENGINE_LIBTIME * pSt_DayTimer) { return m_Local.Authorize_CDKey_BuildKeyTime(pSt_AuthLocal, nDayTimer, pSt_DayTimer); } diff --git a/XEngine_Source/AuthorizeModule_CDKey/pch.h b/XEngine_Source/AuthorizeModule_CDKey/pch.h index 0bbefc88b9e8781806423078f243ad23b910822f..22cd7c87c3be3fa3a6f75d77b03df6407b003961 100644 --- a/XEngine_Source/AuthorizeModule_CDKey/pch.h +++ b/XEngine_Source/AuthorizeModule_CDKey/pch.h @@ -29,6 +29,9 @@ using namespace std; #include #include #include +#include +#include +#include "../XAuth_BuildSwitch.h" #include "../XAuth_Protocol.h" #include "CDKey_Define.h" #include "CDKey_Error.h" @@ -50,4 +53,5 @@ typedef std::string xstring; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") +#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemConfig.lib") #endif \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp index 401bdc0ea0ec93e76ce5b01ae61f1e7f2dbf8a8f..a5ad7c1cfcf3d8bec578dacd1bca23bc22d417d3 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_Connector/AuthClient_Connector.cpp @@ -186,7 +186,7 @@ bool CAuthClient_Connector::AuthClient_Connector_Login(LPCXSTR lpszUser, LPCXSTR XCHAR tszCodecBuffer[2048] = {}; st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT; - OPenSsl_XCrypto_Encoder((LPCXSTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, tszPassStr); + Cryption_XCrypto_Encoder((LPCXSTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, tszPassStr); memcpy(tszMsgBuffer, &st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR)); memcpy(tszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR), tszCodecBuffer, st_ProtocolHdr.unPacketSize); @@ -269,7 +269,7 @@ XHTHREAD CALLBACK CAuthClient_Connector::AuthClient_Connector_Thread(XPVOID lPar if (nMsgLen > 0 && _tcsxlen(pClass_This->tszPassStr) > 0) { //只有有后续数据的情况才需要解密 - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, pClass_This->tszPassStr); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, pClass_This->tszPassStr); } else { diff --git a/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp b/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp index 5e8caed9fda6d9a4f82d2164a4f769bdf295bcc0..f9804fa6c68e6c764811f97996718f4d6fb8668c 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp +++ b/XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp @@ -74,10 +74,10 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC XCHAR tszDECodec[2048] = {}; nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENCodec, lpszPass); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENCodec, lpszPass); APIClient_Http_Request(_X("POST"), lpszURLAddr, tszENCodec, &nHTTPCode, &ptszMsgBuffer, &nMsgLen); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDECodec, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDECodec, lpszPass); st_JsonRoot.clear(); st_JsonObject.clear(); //解析回复 @@ -86,7 +86,7 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_PARSE; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } } @@ -101,7 +101,7 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_PARSE; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } } @@ -110,10 +110,10 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_VERFAILED; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #endif return true; } @@ -173,14 +173,14 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_GetDCode(LPCXSTR lpszURLAddr, int* if (NULL != lpszPass) { XCHAR tszDECodec[2048] = {}; - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDECodec, lpszPass); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDECodec, lpszPass); std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (!pSt_JsonReader->parse(tszDECodec, tszDECodec + nMsgLen, &st_JsonRoot, &st_JsonError)) { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_PARSE; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } } @@ -192,7 +192,7 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_GetDCode(LPCXSTR lpszURLAddr, int* { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_PARSE; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } } @@ -201,7 +201,7 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_GetDCode(LPCXSTR lpszURLAddr, int* { AuthClient_IsErrorOccur = true; AuthClient_dwErrorCode = ERROR_AUTHORIZE_MODULE_HTTPVER_VERFAILED; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); return false; } @@ -211,7 +211,7 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_GetDCode(LPCXSTR lpszURLAddr, int* { *pInt_Timeout = st_JsonRoot["nTimeout"].asInt(); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); #endif return true; } \ 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 2f3fe3bbf5939ad96817b51c4a5fb4198ffb8b14..3d63672b6bf48879dc5dccf4c8ba75f6a7c2b85c 100644 --- a/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj +++ b/XEngine_Source/AuthorizeModule_Client/AuthorizeModule_Client.vcxproj @@ -94,6 +94,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -112,6 +114,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -130,6 +136,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -148,6 +156,10 @@ true Use pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Client/Makefile b/XEngine_Source/AuthorizeModule_Client/Makefile index e6e73d7f7c758e85ad3340ad483b7dd1abbc0fc1..d1db73d6c13aceeb73a30146542469e912c01822 100644 --- a/XEngine_Source/AuthorizeModule_Client/Makefile +++ b/XEngine_Source/AuthorizeModule_Client/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -I ../XEngine_Depend/XEngine_Module/jsoncpp LOADSO = -L ../XEngine_Depend/XEngine_Module/jsoncpp -LIB = -ljsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_Socket -lXClient_APIHelp -lXEngine_SystemApi +LIB = -ljsoncpp -lXEngine_BaseLib -lXEngine_Cryption -lXClient_Socket -lXClient_APIHelp -lXEngine_SystemApi LIBEX = OBJECTS = AuthClient_Connector.o AuthClient_HTTPVer.o pch.o diff --git a/XEngine_Source/AuthorizeModule_Client/pch.h b/XEngine_Source/AuthorizeModule_Client/pch.h index 007a30fbf661eb0564184343faf0596d6985e664..0c2c8c538da1055ac15527e2aea18130de03ab57 100644 --- a/XEngine_Source/AuthorizeModule_Client/pch.h +++ b/XEngine_Source/AuthorizeModule_Client/pch.h @@ -13,7 +13,6 @@ #include #endif #endif //PCH_H -#include "../XAuth_BuildSwitch.h" #include #include #include @@ -25,9 +24,10 @@ #include #include #include +#include "../XAuth_BuildSwitch.h" #if (1 == _XAUTH_BUILD_SWITCH_CLIENT_TCP) -#include -#include +#include +#include #include #include #include "../XAuth_Protocol.h" @@ -58,7 +58,7 @@ extern XLONG AuthClient_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_Client/XClient_Socket") #pragma comment(lib,"XEngine_Client/XClient_APIHelp") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi") diff --git a/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj b/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj index 6db1272f6647df7af6c8a01177e2b10adbb48a31..8fac7588efc1dc90427096e155a874efad316c50 100644 --- a/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj +++ b/XEngine_Source/AuthorizeModule_Configure/AuthorizeModule_Configure.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode DynamicLibrary @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -99,6 +99,8 @@ Use pch.h 4819 + stdcpp20 + stdc17 Windows @@ -117,6 +119,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -135,6 +141,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -153,7 +161,10 @@ true Use pch.h - MultiThreaded + MultiThreadedDLL + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Configure/Makefile b/XEngine_Source/AuthorizeModule_Configure/Makefile index 23fc96c0ed486434531dabc5ab6be787a28529c3..f3edf6ef7ab59f603b271e6e8022adca418b0e84 100644 --- a/XEngine_Source/AuthorizeModule_Configure/Makefile +++ b/XEngine_Source/AuthorizeModule_Configure/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = diff --git a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj index b71286a6a38f8f9689a238ae8764f620a1b85a1f..4c1e6d5d6c39dd460708466113e97d5dd4370ef3 100644 --- a/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj +++ b/XEngine_Source/AuthorizeModule_Database/AuthorizeModule_Database.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode DynamicLibrary @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -94,6 +94,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -112,6 +114,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -130,6 +136,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -148,6 +156,10 @@ true Use pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp index 753c65d71e34fe1fd53dd60af0eb338afa7f77ea..351cd90cf830070b80b12b41dca94473dfed8b90 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_MySQL/DBModule_MySQL.cpp @@ -501,7 +501,7 @@ bool CDBModule_MySQL::DBModule_MySQL_UserList(AUTHREG_USERTABLE*** pppSt_UserInf return false; } *pInt_ListCount = (int)nRow; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_UserInfo, (int)nRow, sizeof(AUTHREG_USERTABLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_UserInfo, (int)nRow, sizeof(AUTHREG_USERTABLE)); for (__int64u i = 0; i < nRow; i++) { @@ -578,7 +578,7 @@ bool CDBModule_MySQL::DBModule_MySQL_SerialInsert(LPCXSTR lpszSerialNumber) return false; } ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enAuthSerialType; - XENGINE_LIBTIMER st_AuthTimer; + XENGINE_LIBTIME st_AuthTimer; memset(&st_AuthTimer, '\0', sizeof(st_AuthTimer)); if (!Authorize_Serial_GetType(lpszSerialNumber, &enAuthSerialType, &st_AuthTimer)) @@ -772,7 +772,7 @@ bool CDBModule_MySQL::DBModule_MySQL_SerialQueryAll(AUTHREG_SERIALTABLE*** pppSt SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_NONE; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_SerialTable, (int)nRow, sizeof(AUTHREG_SERIALTABLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_SerialTable, (int)nRow, sizeof(AUTHREG_SERIALTABLE)); *pInt_ListCount = (int)nRow; @@ -1195,7 +1195,7 @@ bool CDBModule_MySQL::DBModule_MySQL_TryList(AUTHREG_TEMPVER*** pppSt_AuthVer, i SQLPacket_dwErrorCode = DataBase_GetLastError(); return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_AuthVer, (int)nRow, sizeof(AUTHREG_TEMPVER)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_AuthVer, (int)nRow, sizeof(AUTHREG_TEMPVER)); //轮训所有内容 for (__int64u i = 0; i < nRow; i++) @@ -1454,8 +1454,8 @@ bool CDBModule_MySQL::DBModule_MySQL_BannedList(AUTHREG_BANNED*** pppSt_BannedUs //导出 *pInt_AddrCount = stl_ListAddr.size(); *pInt_UserCount = stl_ListUser.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_BannedAddr, stl_ListAddr.size(), sizeof(AUTHREG_BANNED)); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_BannedUser, stl_ListUser.size(), sizeof(AUTHREG_BANNED)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_BannedAddr, stl_ListAddr.size(), sizeof(AUTHREG_BANNED)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_BannedUser, stl_ListUser.size(), sizeof(AUTHREG_BANNED)); list::const_iterator stl_ListIterator = stl_ListAddr.begin(); for (int i = 0; stl_ListIterator != stl_ListAddr.end(); stl_ListIterator++, i++) @@ -1553,8 +1553,8 @@ bool CDBModule_MySQL::DBModule_MySQL_BannedExist(AUTHREG_BANNED* pSt_Banned) __int64x nTimer = 0; XCHAR tszTimeEnd[128]; memset(tszTimeEnd, '\0', sizeof(tszTimeEnd)); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd); - BaseLib_OperatorTimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszTimeEnd, &nTimer, 3); + BaseLib_Time_TimeToStr(tszTimeEnd); + BaseLib_TimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszTimeEnd, &nTimer, 3); //如果没有超过禁用时间 直接返回 说明存在黑名单 不在执行判断IP地址 if (nTimer < 0) { @@ -1630,8 +1630,8 @@ bool CDBModule_MySQL::DBModule_MySQL_BannedExist(AUTHREG_BANNED* pSt_Banned) __int64x nTimer = 0; XCHAR tszStrTime[128]; memset(tszStrTime, '\0', sizeof(tszStrTime)); - BaseLib_OperatorTime_TimeToStr(tszStrTime); - BaseLib_OperatorTimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); + BaseLib_Time_TimeToStr(tszStrTime); + BaseLib_TimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); if (nTimer < 0) { SQLPacket_IsErrorOccur = true; @@ -1807,7 +1807,7 @@ bool CDBModule_MySQL::DBModule_MySQL_AnnouncementList(AUTHREG_ANNOUNCEMENT*** pp { return true; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppppSt_Announcement, (int)nRow, sizeof(AUTHREG_ANNOUNCEMENT)); + BaseLib_Memory_Malloc((XPPPMEM)ppppSt_Announcement, (int)nRow, sizeof(AUTHREG_ANNOUNCEMENT)); //轮训所有内容 for (__int64u i = 0; i < nRow; i++) @@ -1918,11 +1918,11 @@ bool CDBModule_MySQL::DBModule_MySQL_UserPayTime(LPCXSTR lpszUserName, LPCXSTR l case ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_CUSTOM: { XCHAR tszTime[128]; - XENGINE_LIBTIMER st_AuthTime; + XENGINE_LIBTIME st_AuthTime; ENUM_AUTHORIZE_MODULE_SERIAL_TYPE en_GeneraterSerialType; memset(tszTime, '\0', sizeof(tszTime)); - memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIME)); //获取重置卡类型和时间 if (!Authorize_Serial_GetType(lpszCardTime, &en_GeneraterSerialType, &st_AuthTime)) { @@ -1968,11 +1968,11 @@ bool CDBModule_MySQL::DBModule_MySQL_UserPayTime(LPCXSTR lpszUserName, LPCXSTR l { //自定义卡,无法相加 XCHAR tszTime[128]; - XENGINE_LIBTIMER st_AuthTime; + XENGINE_LIBTIME st_AuthTime; ENUM_AUTHORIZE_MODULE_SERIAL_TYPE en_GeneraterSerialType; memset(tszTime, '\0', sizeof(tszTime)); - memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIME)); //获取重置卡类型和时间 if (!Authorize_Serial_GetType(lpszCardTime, &en_GeneraterSerialType, &st_AuthTime)) { diff --git a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp index b478108bfdf154cdde956589b33a8c97ab1d194d..e3419eedc0156e410ee0e005dbba7a2ea5af617b 100644 --- a/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp +++ b/XEngine_Source/AuthorizeModule_Database/DBModule_SQLite/DBModule_SQLite.cpp @@ -455,7 +455,7 @@ bool CDBModule_SQLite::DBModule_SQLite_UserList(AUTHREG_USERTABLE*** pppSt_UserI return false; } *pInt_ListCount = nRow; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_UserInfo, nRow, sizeof(AUTHREG_USERTABLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_UserInfo, nRow, sizeof(AUTHREG_USERTABLE)); //ID int nFliedValue = nColumn; for (int i = 0; i < nRow; i++) @@ -528,7 +528,7 @@ bool CDBModule_SQLite::DBModule_SQLite_SerialInsert(LPCXSTR lpszSerialNumber) return false; } ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enAuthSerialType; - XENGINE_LIBTIMER st_AuthTimer; + XENGINE_LIBTIME st_AuthTimer; memset(&st_AuthTimer, '\0', sizeof(st_AuthTimer)); if (!Authorize_Serial_GetType(lpszSerialNumber, &enAuthSerialType, &st_AuthTimer)) @@ -716,7 +716,7 @@ bool CDBModule_SQLite::DBModule_SQLite_SerialQueryAll(AUTHREG_SERIALTABLE*** ppp SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_NONE; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_SerialTable, nRow, sizeof(AUTHREG_SERIALTABLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_SerialTable, nRow, sizeof(AUTHREG_SERIALTABLE)); *pInt_ListCount = nRow; int nFliedValue = nColumn; @@ -1105,7 +1105,7 @@ bool CDBModule_SQLite::DBModule_SQLite_TryList(AUTHREG_TEMPVER*** pppSt_AuthVer, SQLPacket_dwErrorCode = DataBase_GetLastError(); return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_AuthVer, nRow, sizeof(AUTHREG_TEMPVER)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_AuthVer, nRow, sizeof(AUTHREG_TEMPVER)); int nFliedValue = nColumn; //轮训所有内容 for (int i = 0; i < nRow; i++) @@ -1347,8 +1347,8 @@ bool CDBModule_SQLite::DBModule_SQLite_BannedList(AUTHREG_BANNED*** pppSt_Banned //导出 *pInt_AddrCount = stl_ListAddr.size(); *pInt_UserCount = stl_ListUser.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_BannedAddr, stl_ListAddr.size(), sizeof(AUTHREG_BANNED)); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_BannedUser, stl_ListUser.size(), sizeof(AUTHREG_BANNED)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_BannedAddr, stl_ListAddr.size(), sizeof(AUTHREG_BANNED)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_BannedUser, stl_ListUser.size(), sizeof(AUTHREG_BANNED)); list::const_iterator stl_ListIterator = stl_ListAddr.begin(); for (int i = 0; stl_ListIterator != stl_ListAddr.end(); stl_ListIterator++, i++) @@ -1430,8 +1430,8 @@ bool CDBModule_SQLite::DBModule_SQLite_BannedExist(AUTHREG_BANNED* pSt_Banned) XCHAR tszStrTime[128]; memset(tszStrTime, '\0', sizeof(tszStrTime)); - BaseLib_OperatorTime_TimeToStr(tszStrTime); - BaseLib_OperatorTimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); + BaseLib_Time_TimeToStr(tszStrTime); + BaseLib_TimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); if (nTimer < 0) { SQLPacket_IsErrorOccur = true; @@ -1491,8 +1491,8 @@ bool CDBModule_SQLite::DBModule_SQLite_BannedExist(AUTHREG_BANNED* pSt_Banned) XCHAR tszStrTime[128]; memset(tszStrTime, '\0', sizeof(tszStrTime)); - BaseLib_OperatorTime_TimeToStr(tszStrTime); - BaseLib_OperatorTimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); + BaseLib_Time_TimeToStr(tszStrTime); + BaseLib_TimeSpan_GetForStr(pSt_Banned->tszLeftTime, tszStrTime, &nTimer, 3); if (nTimer < 0) { SQLPacket_IsErrorOccur = true; @@ -1669,7 +1669,7 @@ bool CDBModule_SQLite::DBModule_SQLite_AnnouncementList(AUTHREG_ANNOUNCEMENT*** return true; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)ppppSt_Announcement, nRow, sizeof(AUTHREG_ANNOUNCEMENT)); + BaseLib_Memory_Malloc((XPPPMEM)ppppSt_Announcement, nRow, sizeof(AUTHREG_ANNOUNCEMENT)); int nFliedValue = nColumn; //轮训所有内容 @@ -1778,11 +1778,11 @@ bool CDBModule_SQLite::DBModule_SQLite_UserPayTime(LPCXSTR lpszUserName, LPCXSTR case ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_CUSTOM: { XCHAR tszTime[128]; - XENGINE_LIBTIMER st_AuthTime; + XENGINE_LIBTIME st_AuthTime; ENUM_AUTHORIZE_MODULE_SERIAL_TYPE en_GeneraterSerialType; memset(tszTime, '\0', sizeof(tszTime)); - memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIME)); //获取重置卡类型和时间 if (!Authorize_Serial_GetType(lpszCardTime, &en_GeneraterSerialType, &st_AuthTime)) { @@ -1828,11 +1828,11 @@ bool CDBModule_SQLite::DBModule_SQLite_UserPayTime(LPCXSTR lpszUserName, LPCXSTR { //自定义卡,无法相加 XCHAR tszTime[128]; - XENGINE_LIBTIMER st_AuthTime; + XENGINE_LIBTIME st_AuthTime; ENUM_AUTHORIZE_MODULE_SERIAL_TYPE en_GeneraterSerialType; memset(tszTime, '\0', sizeof(tszTime)); - memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_AuthTime, '\0', sizeof(XENGINE_LIBTIME)); //获取重置卡类型和时间 if (!Authorize_Serial_GetType(lpszCardTime, &en_GeneraterSerialType, &st_AuthTime)) { diff --git a/XEngine_Source/AuthorizeModule_Database/Makefile b/XEngine_Source/AuthorizeModule_Database/Makefile index 1830aac783960f033fc8e3c15ee0f97e6c8dbee0..42ca1faed2b74febb94f1bdea99828a9cd95a8b1 100644 --- a/XEngine_Source/AuthorizeModule_Database/Makefile +++ b/XEngine_Source/AuthorizeModule_Database/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = diff --git a/XEngine_Source/AuthorizeModule_Database/pch.h b/XEngine_Source/AuthorizeModule_Database/pch.h index a0d97e165f44bf18a15e2aefe02cdf791f0eee07..ea92281999e3d441bb4a65ad91a4aae865295109 100644 --- a/XEngine_Source/AuthorizeModule_Database/pch.h +++ b/XEngine_Source/AuthorizeModule_Database/pch.h @@ -25,6 +25,7 @@ using namespace std; #include #include #include +#include "../XAuth_BuildSwitch.h" #include "../XAuth_Protocol.h" #include "../AuthorizeModule_CDKey/CDKey_Define.h" #include "../AuthorizeModule_CDKey/CDKey_Error.h" @@ -44,11 +45,6 @@ using namespace std; extern bool SQLPacket_IsErrorOccur; extern XLONG SQLPacket_dwErrorCode; -#ifdef _UNICODE -typedef std::wstring xstring; -#else -typedef std::string xstring; -#endif #ifdef _WINDOWS #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.cpp b/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.cpp index 933827b7027627208b1a87c56c9a8701d4d80a39..5f75af2a91396a25e4dc1b5167005e3a7ee8354d 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.cpp +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.cpp @@ -43,7 +43,7 @@ CAuthHelp_ClipBoard::~CAuthHelp_ClipBoard() 意思:是否成功 备注: *********************************************************************/ -bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat) +bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Set(LPCTSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat) { Help_IsErrorOccur = true; @@ -68,17 +68,21 @@ bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsg } HANDLE hGlobal = INVALID_HANDLE_VALUE; //GlobalAlloc 是分配指定的内存空间 单位为字节 - hGlobal = GlobalAlloc(GHND, nMsgLen + 1); + hGlobal = GlobalAlloc(GMEM_MOVEABLE, nMsgLen * sizeof(TCHAR) + 1); if (NULL == hGlobal) { Help_IsErrorOccur = true; Help_dwErrorCode = ERROR_AUTHORIZE_MODULE_HELP_CLIPBOARD_MALLOC; return false; } - XCHAR* ptszBuffer = (XCHAR*)GlobalLock(hGlobal); //锁定一个全局内存对象 并且返回一个指向其第一个内存地址的指针 返回类型为 XPVOID - memcpy(ptszBuffer, lpszMsgBuffer, nMsgLen); + TCHAR* ptszBuffer = (TCHAR*)GlobalLock(hGlobal); //锁定一个全局内存对象 并且返回一个指向其第一个内存地址的指针 返回类型为 XPVOID + memcpy(ptszBuffer, lpszMsgBuffer, nMsgLen * sizeof(TCHAR)); - SetClipboardData(dwFormat, hGlobal); //设置到剪贴板内容格式,然后是 数据的指针。 +#ifdef _UNICODE + SetClipboardData(CF_UNICODETEXT, hGlobal); +#else + SetClipboardData(CF_TEXT, hGlobal); +#endif GlobalUnlock(hGlobal); //解锁。这样 其他程序才能操作这款内存! GlobalFree(hGlobal); //释放这个申请的空间 @@ -109,7 +113,7 @@ bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsg 意思:是否成功 备注: *********************************************************************/ -bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Get(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat /* = 1 */) +bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Get(TCHAR* ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat /* = 1 */) { Help_IsErrorOccur = false; @@ -134,7 +138,7 @@ bool CAuthHelp_ClipBoard::AuthHelp_ClipBoard_Get(XCHAR* ptszMsgBuffer, int* pInt return false; } - XCHAR* ptszBuffer = (XCHAR*)GlobalLock(hCliBd); //将句柄转化为地址 + TCHAR* ptszBuffer = (TCHAR*)GlobalLock(hCliBd); //将句柄转化为地址 *pInt_MsgLen = (int)GlobalSize(hCliBd) - 1; //剪贴板内容大小 memcpy(ptszMsgBuffer, ptszBuffer, *pInt_MsgLen); diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.h b/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.h index 8a15cefb134ac44e2b685ea704181ed44873b423..765a5337659b8a194409e15a1d1f688a2752c6c0 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.h +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_ClipBoard/AuthHelp_ClipBoard.h @@ -17,8 +17,8 @@ public: CAuthHelp_ClipBoard(); ~CAuthHelp_ClipBoard(); public: - bool AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat = 1); - bool AuthHelp_ClipBoard_Get(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat = 1); + bool AuthHelp_ClipBoard_Set(LPCTSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat = 1); + bool AuthHelp_ClipBoard_Get(TCHAR* ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat = 1); bool AuthHelp_ClipBoard_Clear(); private: }; \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h index 5c58e28db4f31e35269bc110c2152a03006be73d..339feee421d084fc389fdb31cdfb5aff88d8135e 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h @@ -141,7 +141,7 @@ extern "C" bool AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime); 意思:是否成功 备注: *********************************************************************/ -extern "C" bool AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat = 1); +extern "C" bool AuthHelp_ClipBoard_Set(LPCTSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat = 1); /******************************************************************** 函数名称:AuthHelp_ClipBoard_Get 函数功能:获取剪贴板内容 @@ -165,7 +165,7 @@ extern "C" bool AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsgLen, XLONG 意思:是否成功 备注: *********************************************************************/ -extern "C" bool AuthHelp_ClipBoard_Get(XCHAR * ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat = 1); +extern "C" bool AuthHelp_ClipBoard_Get(TCHAR * ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat = 1); /******************************************************************** 函数名称:AuthHelp_ClipBoard_Clear 函数功能:清空剪贴板 @@ -220,5 +220,5 @@ extern "C" bool AuthHelp_Windows_Dithering(HWND hWnd, int nDitheringDegree = 4, 意思:是否成功添加 备注: *********************************************************************/ -extern "C" bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCXSTR lpszContextOfTip); +extern "C" bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCTSTR lpszContextOfTip); #endif \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.cpp b/XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.cpp index e67c175848adf445beaee2c01d3032b3d9ece3e5..cb3debe88886a0bb6d1baca733497613191272eb 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.cpp +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.cpp @@ -103,8 +103,8 @@ bool CAuthHelp_DynamicCode::AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, in memset(&st_DynamicCode, '\0', sizeof(AUTHHELP_DYNAMICCODE)); st_DynamicCode.nTimeStart = time(NULL); - BaseLib_OperatorHandle_Create(&st_DynamicCode.xhToken); - BaseLib_OperatorHandle_Create((XNETHANDLE*)&st_DynamicCode.nDynamicCode, 100001, 999999); + BaseLib_Handle_Create(&st_DynamicCode.xhToken); + BaseLib_Handle_Create((XNETHANDLE*)&st_DynamicCode.nDynamicCode, 100001, 999999); *pxhToken = st_DynamicCode.xhToken; *pInt_DynamicCode = st_DynamicCode.nDynamicCode; diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp index df73d095c2cc390c954d910d15bde3fc4ff8e88d..fda87a3f15ecdbee562f1f3e434b06f0c4382b48 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_MultiLogin/AuthHelp_MultiLogin.cpp @@ -124,10 +124,10 @@ bool CAuthHelp_MultiLogin::AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime) { Help_IsErrorOccur = true; - XENGINE_LIBTIMER st_TimeLogin = {}; - XENGINE_LIBTIMER st_TimeLocal = {}; - BaseLib_OperatorTime_GetSysTime(&st_TimeLocal); - BaseLib_OperatorTime_StrToTime(lpszLoginTime, &st_TimeLogin); + 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)) diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.cpp b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.cpp index 6bb5b9a317d7e5be2f90461aaf9b4bdd4bd73d16..bdb414eca2192fa2ce6860ad27c1f74bb96e6acb 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.cpp +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.cpp @@ -93,7 +93,7 @@ bool CAuthHelp_Windows::AuthHelp_Windows_Dithering(HWND hWnd, int nDitheringDegr 意思:是否成功添加 备注: *********************************************************************/ -bool CAuthHelp_Windows::AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCXSTR lpszContextOfTip) +bool CAuthHelp_Windows::AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCTSTR lpszContextOfTip) { Help_IsErrorOccur = false; diff --git a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.h b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.h index 400f001bd9e0200fd58681785fdc262947b8097c..e72be507ae3ff7ed8d9cd8486532205aa4ba3d17 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.h +++ b/XEngine_Source/AuthorizeModule_Help/AuthHelp_Windows/AuthHelp_Windows.h @@ -18,6 +18,6 @@ public: ~CAuthHelp_Windows(); public: bool AuthHelp_Windows_Dithering(HWND hWnd, int nDitheringDegree = 4, int nDitheringCareer = 30); - bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCXSTR lpszContextOfTip); + bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCTSTR lpszContextOfTip); private: }; \ No newline at end of file diff --git a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj index 3de32694748a1380e885045a65128c2838ab9214..0257e30875507d24ba5c463237d3f97dca22a59a 100644 --- a/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj +++ b/XEngine_Source/AuthorizeModule_Help/AuthorizeModule_Help.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode DynamicLibrary @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -94,6 +94,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -112,6 +114,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -130,6 +136,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -148,6 +156,10 @@ true Use pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Help/Makefile b/XEngine_Source/AuthorizeModule_Help/Makefile index d43378fe96f614ac402b97b5d788ae6a5a3e1199..d80c10ea05393ab0a728aee51fd446215cfb151d 100644 --- a/XEngine_Source/AuthorizeModule_Help/Makefile +++ b/XEngine_Source/AuthorizeModule_Help/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = diff --git a/XEngine_Source/AuthorizeModule_Help/pch.cpp b/XEngine_Source/AuthorizeModule_Help/pch.cpp index d5de40985afe8458a67f0e716e78f2a446ee78f8..f83797bbb50be2524d072d9a8964162b02e04c4a 100644 --- a/XEngine_Source/AuthorizeModule_Help/pch.cpp +++ b/XEngine_Source/AuthorizeModule_Help/pch.cpp @@ -68,11 +68,11 @@ extern "C" bool AuthHelp_MultiLogin_TimeMatch(LPCXSTR lpszLoginTime) /* 剪贴板导出定义 */ /************************************************************************/ #ifdef _MSC_BUILD -extern "C" bool AuthHelp_ClipBoard_Set(LPCXSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat) +extern "C" bool AuthHelp_ClipBoard_Set(LPCTSTR lpszMsgBuffer, int nMsgLen, XLONG dwFormat) { return m_HelpClipBoard.AuthHelp_ClipBoard_Set(lpszMsgBuffer, nMsgLen, dwFormat); } -extern "C" bool AuthHelp_ClipBoard_Get(XCHAR * ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat) +extern "C" bool AuthHelp_ClipBoard_Get(TCHAR * ptszMsgBuffer, int* pInt_MsgLen, XLONG dwFormat) { return m_HelpClipBoard.AuthHelp_ClipBoard_Get(ptszMsgBuffer, pInt_MsgLen, dwFormat); } @@ -87,7 +87,7 @@ extern "C" bool AuthHelp_Windows_Dithering(HWND hWnd, int nDitheringDegree, int { return m_HelpWindow.AuthHelp_Windows_Dithering(hWnd, nDitheringDegree, nDitheringCareer); } -extern "C" bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCXSTR lpszContextOfTip) +extern "C" bool AuthHelp_Windows_CreateTooltip(HWND hWnd, LPCTSTR lpszContextOfTip) { return m_HelpWindow.AuthHelp_Windows_CreateTooltip(hWnd, lpszContextOfTip); } diff --git a/XEngine_Source/AuthorizeModule_Help/pch.h b/XEngine_Source/AuthorizeModule_Help/pch.h index 7638499c89fdfafba7074d2b28f3a8fcc61336b4..15e6c8bf5d9ca614cd5d368c4a6e196c45689a83 100644 --- a/XEngine_Source/AuthorizeModule_Help/pch.h +++ b/XEngine_Source/AuthorizeModule_Help/pch.h @@ -24,6 +24,7 @@ using namespace std; #include #include #include +#include "../XAuth_BuildSwitch.h" #include "AuthHelp_Define.h" #include "AuthHelp_Error.h" /******************************************************************** diff --git a/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj b/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj index 68f5762df875b03e9197b682355ee16b4c921973..d8f708b1f6ad3f951ae65dd762994020bfa8b29b 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj +++ b/XEngine_Source/AuthorizeModule_Protocol/AuthorizeModule_Protocol.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode DynamicLibrary @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -102,6 +102,8 @@ Use pch.h 4819 + stdcpp20 + stdc17 Windows @@ -120,8 +122,11 @@ true Use pch.h - MultiThreaded + MultiThreadedDLL 4819 + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Windows @@ -140,6 +145,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -158,8 +165,11 @@ true Use pch.h - MultiThreaded + MultiThreadedDLL 4819 + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Protocol/Makefile b/XEngine_Source/AuthorizeModule_Protocol/Makefile index a3887b07a45d943fea71e27fec3fdc863dd8479b..1aa6af0eea4e07c047913732c8f4c8e3a8545693 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/Makefile +++ b/XEngine_Source/AuthorizeModule_Protocol/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = diff --git a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp index 9d2ab7af3dc88edf9142a50d8ef200d03ec31114..dac1cc372f09e1405c5bd2fed70468f1958b6bf7 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp +++ b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp @@ -587,17 +587,17 @@ bool CProtocol_Packet::Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt } XCHAR tszTimeStart[128]; XCHAR tszTimeEnd[128]; - XENGINE_LIBTIMER st_TimeOut; + XENGINE_LIBTIME st_TimeOut; Json::Value st_JsonRoot; memset(tszTimeStart, '\0', sizeof(tszTimeStart)); memset(tszTimeEnd, '\0', sizeof(tszTimeEnd)); - memset(&st_TimeOut, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_TimeOut, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_TimeToStr(tszTimeStart); + BaseLib_Time_TimeToStr(tszTimeStart); _xstprintf(tszTimeEnd, _X("0-0-0 0:0:%d"), nTimeout); - BaseLib_OperatorTimeSpan_CalForStr(tszTimeStart, tszTimeEnd, &st_TimeOut); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd, NULL, true, &st_TimeOut); + BaseLib_TimeSpan_CalForStr(tszTimeStart, tszTimeEnd, &st_TimeOut); + BaseLib_Time_TimeToStr(tszTimeEnd, NULL, true, &st_TimeOut); st_JsonRoot["msg"] = "success"; st_JsonRoot["code"] = 0; @@ -858,19 +858,19 @@ bool CProtocol_Packet::Protocol_Packet_HttpTryList(XCHAR* ptszMsgBuffer, int* pI st_JsonObject["enVMode"] = (*pppSt_TryList)[i]->enVMode; if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_DAY == (*pppSt_TryList)[i]->enVMode) { - XENGINE_LIBTIMER st_TimeStart = {}; - XENGINE_LIBTIMER st_TimeEnd = {}; + XENGINE_LIBTIME st_TimeStart = {}; + XENGINE_LIBTIME st_TimeEnd = {}; XCHAR tszTimeStart[128] = {}; XCHAR tszTimeEnd[128] = {}; //时间戳转换 - BaseLib_OperatorTime_StrToTime((*pppSt_TryList)[i]->tszVDate, &st_TimeStart); + BaseLib_Time_StrToTime((*pppSt_TryList)[i]->tszVDate, &st_TimeStart); st_TimeEnd.wDay = (*pppSt_TryList)[i]->nVTime; //得到超时时间 - BaseLib_OperatorTimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd, NULL, true, &st_TimeEnd); + BaseLib_TimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); + BaseLib_Time_TimeToStr(tszTimeEnd, NULL, true, &st_TimeEnd); //计算时间差 - BaseLib_OperatorTime_TimeToStr(tszTimeStart); - BaseLib_OperatorTimeSpan_GetForStr(tszTimeStart, tszTimeEnd, (__int64x *)&(*pppSt_TryList)[i]->nLTime); + BaseLib_Time_TimeToStr(tszTimeStart); + BaseLib_TimeSpan_GetForStr(tszTimeStart, tszTimeEnd, (__int64x *)&(*pppSt_TryList)[i]->nLTime); } st_JsonObject["nLTime"] = (*pppSt_TryList)[i]->nLTime; st_JsonObject["tszVDate"] = (*pppSt_TryList)[i]->tszVDate; diff --git a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp index 99b6586028e693ca131568d74f6339b5b75575ec..950540d54aea0c67f5b4db7b85ce73dec45e3926 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp +++ b/XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp @@ -562,7 +562,7 @@ bool CProtocol_Parse::Protocol_Parse_HttpParseSerial(LPCXSTR lpszMsgBuffer, int return false; } *pInt_ListCount = st_JsonRoot["Array"].size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_SerialTable, st_JsonRoot["Array"].size(), sizeof(AUTHREG_SERIALTABLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_SerialTable, st_JsonRoot["Array"].size(), sizeof(AUTHREG_SERIALTABLE)); Json::Value st_JsonArray = st_JsonRoot["Array"]; for (unsigned int i = 0; i < st_JsonArray.size(); i++) { diff --git a/XEngine_Source/AuthorizeModule_Protocol/pch.h b/XEngine_Source/AuthorizeModule_Protocol/pch.h index 8493f70dd863f7aed028ac24136ec3688fef3d68..625c60b3b6fb173b9b3efb6f390c9be85fd2f6ec 100644 --- a/XEngine_Source/AuthorizeModule_Protocol/pch.h +++ b/XEngine_Source/AuthorizeModule_Protocol/pch.h @@ -24,6 +24,7 @@ using namespace std; #include #include #include +#include "../XAuth_BuildSwitch.h" #include "../XAuth_Protocol.h" #include "../AuthorizeModule_CDKey/CDKey_Define.h" #include "../AuthorizeModule_CDKey/CDKey_Error.h" diff --git a/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj b/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj index 8fca794a1dcfb20a57acdf3676472a77dee57e3c..145fa0eb4e8259a81eb61ff084e6f9b00532e4bc 100644 --- a/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj +++ b/XEngine_Source/AuthorizeModule_Session/AuthorizeModule_Session.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode DynamicLibrary @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -94,6 +94,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -112,6 +114,10 @@ true Use pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreadedDLL Windows @@ -130,6 +136,8 @@ true Use pch.h + stdcpp20 + stdc17 Windows @@ -148,6 +156,10 @@ true Use pch.h + stdcpp20 + stdc17 + MultiThreadedDLL + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/AuthorizeModule_Session/Makefile b/XEngine_Source/AuthorizeModule_Session/Makefile index 36b84bafa8d353c2236f0df131d4cb663c0398f1..dee9184d29508f3ec3d2d0c847f68ee859493173 100644 --- a/XEngine_Source/AuthorizeModule_Session/Makefile +++ b/XEngine_Source/AuthorizeModule_Session/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 -fPIC +CC = g++ -Wall -std=c++20 -fPIC PLATFORM = linux PLATVER = PLATDIR = diff --git a/XEngine_Source/AuthorizeModule_Session/Session_Authorize/Session_Authorize.cpp b/XEngine_Source/AuthorizeModule_Session/Session_Authorize/Session_Authorize.cpp index 2ed788c4d6e2a2afe44182e8f65e944c5da037cb..5aac6f2a2745edba814576171ad08b665b0392e8 100644 --- a/XEngine_Source/AuthorizeModule_Session/Session_Authorize/Session_Authorize.cpp +++ b/XEngine_Source/AuthorizeModule_Session/Session_Authorize/Session_Authorize.cpp @@ -85,7 +85,7 @@ bool CSession_Authorize::Session_Authorize_Init(CALLBACK_XENGIEN_AUTHORIZE_SESSI 返回值 类型:逻辑型 意思:是否获取成功 -备注:参数一必须通过基础库的内存释放函数BaseLib_OperatorMemory_Free进行释放内存 +备注:参数一必须通过基础库的内存释放函数BaseLib_Memory_Free进行释放内存 *********************************************************************/ bool CSession_Authorize::Session_Authorize_GetClient(AUTHSESSION_NETCLIENT*** pppSt_ListClient, int* pInt_ListCount, LPCXSTR lpszClientUser /* = NULL */) { @@ -110,7 +110,7 @@ bool CSession_Authorize::Session_Authorize_GetClient(AUTHSESSION_NETCLIENT*** pp } } *pInt_ListCount = stl_ListClient.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListClient, stl_ListClient.size(), sizeof(AUTHSESSION_NETCLIENT)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListClient, stl_ListClient.size(), sizeof(AUTHSESSION_NETCLIENT)); auto stl_ListIterator = stl_ListClient.begin(); for (int i = 0; stl_ListIterator != stl_ListClient.end(); stl_ListIterator++, i++) @@ -124,7 +124,7 @@ bool CSession_Authorize::Session_Authorize_GetClient(AUTHSESSION_NETCLIENT*** pp if (stl_MapIterator != stl_MapNetClient.end()) { *pInt_ListCount = stl_MapIterator->second.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListClient, stl_MapIterator->second.size(), sizeof(AUTHSESSION_NETCLIENT)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListClient, stl_MapIterator->second.size(), sizeof(AUTHSESSION_NETCLIENT)); auto stl_ListIterator = stl_MapIterator->second.begin(); for (int i = 0; stl_ListIterator != stl_MapIterator->second.end(); stl_ListIterator++, i++) @@ -320,7 +320,7 @@ bool CSession_Authorize::Session_Authorize_Insert(LPCXSTR lpszClientAddr, AUTHRE st_Client.nNetType = nNetType; st_Client.nLeftTime = _ttxoll(pSt_UserTable->tszLeftTime); - BaseLib_OperatorTime_GetSysTime(&st_Client.st_LibTimer); + BaseLib_Time_GetSysTime(&st_Client.st_LibTimer); _tcsxcpy(st_Client.tszClientAddr, lpszClientAddr); memcpy(&st_Client.st_UserTable, pSt_UserTable, sizeof(AUTHREG_USERTABLE)); @@ -401,13 +401,13 @@ XHTHREAD CSession_Authorize::Session_Authorize_ActiveThread(XPVOID lParam) for (auto stl_ListIterator = stl_MapIterator->second.begin(); stl_ListIterator != stl_MapIterator->second.end(); stl_ListIterator++) { __int64x nOnlineSpan = 0; //在线时间 - XENGINE_LIBTIMER st_LibTimer; - memset(&st_LibTimer, '\0', sizeof(XENGINE_LIBTIMER)); + XENGINE_LIBTIME st_LibTimer; + memset(&st_LibTimer, '\0', sizeof(XENGINE_LIBTIME)); memset(&st_ProtocolTimer, '\0', sizeof(AUTHREG_PROTOCOL_TIME)); //获取现在的系统时间 - BaseLib_OperatorTime_GetSysTime(&st_LibTimer); + BaseLib_Time_GetSysTime(&st_LibTimer); //用户登录了多少秒钟 - BaseLib_OperatorTimeSpan_GetForStu(&stl_ListIterator->st_LibTimer, &st_LibTimer, &nOnlineSpan, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_TimeSpan_GetForStu(&stl_ListIterator->st_LibTimer, &st_LibTimer, &nOnlineSpan, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); nTimeCount += nOnlineSpan; //登陆成功的。我们要处理他过期 switch (stl_ListIterator->st_UserTable.enSerialType) @@ -463,15 +463,15 @@ XHTHREAD CSession_Authorize::Session_Authorize_ActiveThread(XPVOID lParam) { //自定义 __int64x nLeftTime = 0; //剩余时间 - XENGINE_LIBTIMER st_TimeLeft; - memset(&st_TimeLeft, '\0', sizeof(XENGINE_LIBTIMER)); + XENGINE_LIBTIME st_TimeLeft; + memset(&st_TimeLeft, '\0', sizeof(XENGINE_LIBTIME)); //获取指定过期日期 if (6 != _stxscanf(stl_ListIterator->st_UserTable.tszLeftTime, _X("%04d-%02d-%02d %02d:%02d:%02d"), &st_TimeLeft.wYear, &st_TimeLeft.wMonth, &st_TimeLeft.wDay, &st_TimeLeft.wHour, &st_TimeLeft.wMinute, &st_TimeLeft.wSecond)) { break; } //剩余天数,通过秒钟来处理 - BaseLib_OperatorTimeSpan_GetForStu(&st_LibTimer, &st_TimeLeft, &nLeftTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_TimeSpan_GetForStu(&st_LibTimer, &st_TimeLeft, &nLeftTime, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); //获取过期时间 stl_ListIterator->nLeftTime = nLeftTime; stl_ListIterator->nOnlineTime = nOnlineSpan; diff --git a/XEngine_Source/AuthorizeModule_Session/Session_Define.h b/XEngine_Source/AuthorizeModule_Session/Session_Define.h index 7efc656a10e67e94f39d7a89e29268e4ce633a8b..e25adb93ed6e88b1fde37f6abc0686bbca8521be 100644 --- a/XEngine_Source/AuthorizeModule_Session/Session_Define.h +++ b/XEngine_Source/AuthorizeModule_Session/Session_Define.h @@ -13,7 +13,7 @@ typedef struct { AUTHREG_USERTABLE st_UserTable; //用户表 - XENGINE_LIBTIMER st_LibTimer; //登录时间结构 + XENGINE_LIBTIME st_LibTimer; //登录时间结构 XCHAR tszClientAddr[64]; XCHAR tszLeftTime[64]; //过期日期 XNETHANDLE xhToken; @@ -74,7 +74,7 @@ extern "C" bool Session_Authorize_Init(CALLBACK_XENGIEN_AUTHORIZE_SESSION_CLIENT 返回值 类型:逻辑型 意思:是否获取成功 -备注:参数一必须通过基础库的内存释放函数BaseLib_OperatorMemory_Free进行释放内存 +备注:参数一必须通过基础库的内存释放函数BaseLib_Memory_Free进行释放内存 *********************************************************************/ extern "C" bool Session_Authorize_GetClient(AUTHSESSION_NETCLIENT * **pppSt_ListClient, int* pInt_ListCount, LPCXSTR lpszClientUser = NULL); /******************************************************************** diff --git a/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.cpp b/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.cpp index c3c69a5f674d26b43bf717d3810f5c86073dcec6..a0fec871f6508a0f1c23eedbc75f2cbd76518f56 100644 --- a/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.cpp +++ b/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.cpp @@ -125,7 +125,7 @@ bool CSession_Token::Session_Token_Insert(XNETHANDLE xhToken, AUTHREG_USERTABLE* AUTHSESSION_TOKENCLIENT st_TokenClient; memset(&st_TokenClient,'\0',sizeof(AUTHSESSION_TOKENCLIENT)); - BaseLib_OperatorTime_GetSysTime(&st_TokenClient.st_LibTimer); + BaseLib_Time_GetSysTime(&st_TokenClient.st_LibTimer); memcpy(&st_TokenClient.st_UserTable, pSt_UserTable, sizeof(AUTHREG_USERTABLE)); st_Locker.lock(); @@ -186,7 +186,7 @@ bool CSession_Token::Session_Token_UPDate(XNETHANDLE xhToken) st_Locker.unlock_shared(); return false; } - BaseLib_OperatorTime_GetSysTime(&stl_MapIterator->second.st_LibTimer); + BaseLib_Time_GetSysTime(&stl_MapIterator->second.st_LibTimer); st_Locker.unlock_shared(); return true; } @@ -329,7 +329,7 @@ bool CSession_Token::Session_Token_RenewalTime(XNETHANDLE xhToken, int* pInt_Ren XHTHREAD CSession_Token::Session_Token_Thread(XPVOID lParam) { CSession_Token *pClass_This = (CSession_Token *)lParam; - XENGINE_LIBTIMER st_LibTimer; + XENGINE_LIBTIME st_LibTimer; list stl_ListNotify; while (pClass_This->bIsRun) @@ -339,10 +339,10 @@ XHTHREAD CSession_Token::Session_Token_Thread(XPVOID lParam) unordered_map::iterator stl_MapIterator = pClass_This->stl_MapToken.begin(); for (; stl_MapIterator != pClass_This->stl_MapToken.end(); stl_MapIterator++) { - BaseLib_OperatorTime_GetSysTime(&st_LibTimer); //获取现在的系统时间 + BaseLib_Time_GetSysTime(&st_LibTimer); //获取现在的系统时间 __int64x nOnlineSpan = 0; //在线时间 //用户登录了多少秒 - BaseLib_OperatorTimeSpan_GetForStu(&stl_MapIterator->second.st_LibTimer, &st_LibTimer, &nOnlineSpan, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); + BaseLib_TimeSpan_GetForStu(&stl_MapIterator->second.st_LibTimer, &st_LibTimer, &nOnlineSpan, ENUM_XENGINE_BASELIB_TIME_SPAN_TYPE_SECOND); if (stl_MapIterator->second.nTimeout > 0) { if (nOnlineSpan > stl_MapIterator->second.nTimeout) diff --git a/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.h b/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.h index 368acd65db0db0b0388701c070ecf95a738fe2b7..9ab54a2f8383793335e2c9993e3ccf0d7b0c034f 100644 --- a/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.h +++ b/XEngine_Source/AuthorizeModule_Session/Session_Token/Session_Token.h @@ -13,7 +13,7 @@ typedef struct { AUTHREG_USERTABLE st_UserTable; //用户表 - XENGINE_LIBTIMER st_LibTimer; //登录时间结构 + XENGINE_LIBTIME st_LibTimer; //登录时间结构 int nTimeout; //单独指定超时 int nRenewalTime; //自动续期次数 }AUTHSESSION_TOKENCLIENT, * LPAUTHSESSION_TOKENCLIENT; diff --git a/XEngine_Source/AuthorizeModule_Session/pch.h b/XEngine_Source/AuthorizeModule_Session/pch.h index cb798ff7f55ac99bb61567c065c5096e6839d22c..91eb09a78bb24647c1fe7d1a79c0a27fc692457a 100644 --- a/XEngine_Source/AuthorizeModule_Session/pch.h +++ b/XEngine_Source/AuthorizeModule_Session/pch.h @@ -27,6 +27,7 @@ using namespace std; #include #include #include +#include "../XAuth_BuildSwitch.h" #include "../XAuth_Protocol.h" #include "../AuthorizeModule_CDKey/CDKey_Define.h" #include "../AuthorizeModule_CDKey/CDKey_Error.h" diff --git a/XEngine_Source/VSCopy_Debug.bat b/XEngine_Source/VSCopy_Debug.bat index 52ce97bd2152ce3fb78588d2e5d493cd249ed0ac..65b1df8b3b1d3242e1dd13704ba79d37d9461310 100644 --- a/XEngine_Source/VSCopy_Debug.bat +++ b/XEngine_Source/VSCopy_Debug.bat @@ -3,7 +3,10 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseSafe.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Algorithm.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Core.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./" -copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Cryption.dll" "./" + +copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIAddr.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_DataBase.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_Packets.dll" "./" @@ -13,4 +16,5 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\RfcComponents_WSProtocol.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\RfcComponents_HttpProtocol.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./" -copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./" \ No newline at end of file +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemConfig.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/VSCopy_x64.bat b/XEngine_Source/VSCopy_x64.bat index adcee805678449dd730013df859338b53d8242b5..449407a1d65ae4599f95b2460b83b33bbf30f3c2 100644 --- a/XEngine_Source/VSCopy_x64.bat +++ b/XEngine_Source/VSCopy_x64.bat @@ -3,7 +3,10 @@ copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./" + +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./" @@ -13,4 +16,5 @@ copy /y "%XEngine_Lib64%\XEngine_RfcComponents\RfcComponents_WSProtocol.dll" "./ copy /y "%XEngine_Lib64%\XEngine_RfcComponents\RfcComponents_HttpProtocol.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/VSCopy_x86.bat b/XEngine_Source/VSCopy_x86.bat index 62a8e25a53c31a219422e1ee9e2acfe0b91ef478..c70e5a43f33cf9d8b2d41de1dec6831cb228f059 100644 --- a/XEngine_Source/VSCopy_x86.bat +++ b/XEngine_Source/VSCopy_x86.bat @@ -3,7 +3,10 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./" + +copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./" @@ -13,4 +16,5 @@ copy /y "%XEngine_Lib32%\XEngine_RfcComponents\RfcComponents_WSProtocol.dll" "./ copy /y "%XEngine_Lib32%\XEngine_RfcComponents\RfcComponents_HttpProtocol.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemConfig.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/XAuth_BuildSwitch.h b/XEngine_Source/XAuth_BuildSwitch.h index 0bbf9d211af65b14b42c2464ed1705e81398f3e4..f71e021a94be1df18484398e84ebb7c41a19f0cb 100644 --- a/XEngine_Source/XAuth_BuildSwitch.h +++ b/XEngine_Source/XAuth_BuildSwitch.h @@ -11,4 +11,8 @@ // History: *********************************************************************/ #define _XAUTH_BUILD_SWITCH_CLIENT_TCP 1 -#define _XAUTH_BUILD_SWITCH_CLIENT_HTTP 1 \ No newline at end of file +#define _XAUTH_BUILD_SWITCH_CLIENT_HTTP 1 + +#if (XENGINE_VERSION_KERNEL <= 9) && (XENGINE_VERSION_MAIN < 10) + typedef XENGINE_LIBTIMER XENGINE_LIBTIME; +#endif \ No newline at end of file diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Announcement.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Announcement.cpp index 2049ff7a5b15f8f3dae9399ea961469a0502f7eb..f3b8bdfe37bc76aae90febbdcd8cc9ee169f29c3 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Announcement.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Announcement.cpp @@ -72,23 +72,24 @@ void CDialog_Announcement::OnBnClickedButton1() AfxMessageBox(_T("内容不能小于1个字节")); return; } - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/notice/insert"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/notice/insert"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; Json::StreamWriterBuilder st_JsonBuilder; st_JsonBuilder["emitUTF8"] = true; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); - st_JsonObject["tszContext"] = m_StrNotice.GetBuffer(); + st_JsonObject["tszContext"] = W2A(m_StrNotice.GetBuffer()); st_JsonRoot["st_Notice"] = st_JsonObject; //是否加密 - TCHAR tszCodecBuffer[2048]; + XCHAR tszCodecBuffer[2048]; TCHAR tszPassBuffer[64]; memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer)); @@ -96,18 +97,18 @@ void CDialog_Announcement::OnBnClickedButton1() ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); nMsgLen = Json::writeString(st_JsonBuilder, st_JsonRoot).length(); - BaseLib_OperatorCharset_AnsiToUTF(Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), tszCodecBuffer, &nMsgLen); + BaseLib_Charset_AnsiToUTF(Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), tszCodecBuffer, &nMsgLen); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Encoder(tszCodecBuffer, &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(tszCodecBuffer, &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszCodecBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszCodecBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -115,10 +116,10 @@ void CDialog_Announcement::OnBnClickedButton1() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -142,11 +143,10 @@ void CDialog_Announcement::OnBnClickedButton1() { Authorize_Help_LogPrint(_T("插入公告信息成功")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); OnBnClickedButton3(); } - void CDialog_Announcement::OnBnClickedButton2() { // TODO: 在此添加控件通知处理程序代码 @@ -169,17 +169,17 @@ void CDialog_Announcement::OnBnClickedButton2() } m_StrNotice = m_ListAnnouncement.GetItemText(nSelect, 0); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/notice/delete"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/notice/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); - st_JsonObject["nID"] = _ttxoll(m_StrNotice.GetBuffer()); + st_JsonObject["nID"] = _ttoll(m_StrNotice.GetBuffer()); st_JsonRoot["st_Notice"] = st_JsonObject; //是否加密 TCHAR tszPassBuffer[64]; @@ -187,16 +187,16 @@ void CDialog_Announcement::OnBnClickedButton2() ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -204,10 +204,10 @@ void CDialog_Announcement::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -231,11 +231,10 @@ void CDialog_Announcement::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("删除公告信息成功")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); OnBnClickedButton3(); } - void CDialog_Announcement::OnBnClickedButton3() { // TODO: 在此添加控件通知处理程序代码 @@ -250,31 +249,32 @@ void CDialog_Announcement::OnBnClickedButton3() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/notice/list"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/notice/list"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -282,10 +282,10 @@ void CDialog_Announcement::OnBnClickedButton3() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -312,14 +312,13 @@ void CDialog_Announcement::OnBnClickedButton3() memset(tszIndex, '\0', 64); _i64tot(st_JsonArray["nID"].asInt64(), tszIndex, 10); - int nMsgLen = st_JsonArray["tszContext"].asString().length(); - BaseLib_OperatorCharset_UTFToAnsi(st_JsonArray["tszContext"].asCString(), tszMsgBuffer, &nMsgLen); + BaseLib_Charset_UTFToUnicode(st_JsonArray["tszContext"].asCString(), tszMsgBuffer, &nMsgLen); m_ListAnnouncement.InsertItem(i, _T("")); m_ListAnnouncement.SetItemText(i, 0, tszIndex); m_ListAnnouncement.SetItemText(i, 1, tszMsgBuffer); - m_ListAnnouncement.SetItemText(i, 2, st_JsonArray["tszCreateTime"].asCString()); + m_ListAnnouncement.SetItemText(i, 2, A2W(st_JsonArray["tszCreateTime"].asCString())); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Banned.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Banned.cpp index fb77d75c6d7b23b92b69c146541344c68db0ad38..a7a490628a4ae871d50656785362394443230473 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Banned.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Banned.cpp @@ -118,22 +118,22 @@ void CDialog_Banned::OnBnClickedButton2() m_EditUser.GetWindowText(m_StrUser); m_DataTime.GetWindowText(m_StrTime); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/banned/insert"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/banned/insert"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); if (BST_CHECKED == m_RadioUser.GetCheck()) { - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); } else { - st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer(); + st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer()); } if (BST_CHECKED == m_RadioEnable.GetCheck()) { @@ -145,7 +145,7 @@ void CDialog_Banned::OnBnClickedButton2() } if (BST_CHECKED == m_BtnCheckTime.GetCheck()) { - st_JsonObject["tszLeftTime"] = m_StrTime.GetBuffer(); + st_JsonObject["tszLeftTime"] = W2A(m_StrTime.GetBuffer()); } st_JsonRoot["st_Banned"] = st_JsonObject; //是否加密 @@ -154,16 +154,16 @@ void CDialog_Banned::OnBnClickedButton2() ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -171,10 +171,10 @@ void CDialog_Banned::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -198,7 +198,7 @@ void CDialog_Banned::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("插入黑名单信息成功")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); OnBnClickedButton4(); } @@ -223,12 +223,13 @@ void CDialog_Banned::OnBnClickedButton4() m_EditPosStart.GetWindowText(m_StrPosStart); m_EditPosEnd.GetWindowText(m_StrPosEnd); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/banned/list"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/banned/list"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; @@ -236,23 +237,23 @@ void CDialog_Banned::OnBnClickedButton4() st_JsonObject["nPosEnd"] = _ttoi(m_StrPosEnd.GetBuffer()); st_JsonRoot["st_Banned"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -260,10 +261,10 @@ void CDialog_Banned::OnBnClickedButton4() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -291,15 +292,15 @@ void CDialog_Banned::OnBnClickedButton4() m_ListAddr.SetItemText(i, 0, tszIndex); if (st_JsonArray["bEnable"].asBool()) { - m_ListAddr.SetItemText(i, 1, "启用"); + m_ListAddr.SetItemText(i, 1, _T("启用")); } else { - m_ListAddr.SetItemText(i, 1, "禁用"); + m_ListAddr.SetItemText(i, 1, _T("禁用")); } - m_ListAddr.SetItemText(i, 2, st_JsonArray["tszIPAddr"].asCString()); - m_ListAddr.SetItemText(i, 3, st_JsonArray["tszLeftTime"].asCString()); - m_ListAddr.SetItemText(i, 4, st_JsonArray["tszCreateTime"].asCString()); + m_ListAddr.SetItemText(i, 2, A2W(st_JsonArray["tszIPAddr"].asCString())); + m_ListAddr.SetItemText(i, 3, A2W(st_JsonArray["tszLeftTime"].asCString())); + m_ListAddr.SetItemText(i, 4, A2W(st_JsonArray["tszCreateTime"].asCString())); } for (unsigned int i = 0; i < st_JsonRoot["ArrayUser"].size(); i++) { @@ -313,17 +314,17 @@ void CDialog_Banned::OnBnClickedButton4() m_ListUser.SetItemText(i, 0, tszIndex); if (st_JsonArray["bEnable"].asBool()) { - m_ListUser.SetItemText(i, 1, "启用"); + m_ListUser.SetItemText(i, 1, _T("启用")); } else { - m_ListUser.SetItemText(i, 1, "禁用"); + m_ListUser.SetItemText(i, 1, _T("禁用")); } - m_ListUser.SetItemText(i, 2, st_JsonArray["tszUserName"].asCString()); - m_ListUser.SetItemText(i, 3, st_JsonArray["tszLeftTime"].asCString()); - m_ListUser.SetItemText(i, 4, st_JsonArray["tszCreateTime"].asCString()); + m_ListUser.SetItemText(i, 2, A2W(st_JsonArray["tszUserName"].asCString())); + m_ListUser.SetItemText(i, 3, A2W(st_JsonArray["tszLeftTime"].asCString())); + m_ListUser.SetItemText(i, 4, A2W(st_JsonArray["tszCreateTime"].asCString())); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } @@ -333,24 +334,25 @@ void CDialog_Banned::OnBnClickedButton3() Json::Value st_JsonRoot; Json::Value st_JsonObject; // TODO: 在此添加控件通知处理程序代码 + USES_CONVERSION; POSITION pSt_Sition = m_ListUser.GetFirstSelectedItemPosition(); int nSelect = m_ListUser.GetNextSelectedItem(pSt_Sition); if (nSelect >= 0) { m_StrUser = m_ListUser.GetItemText(nSelect, 2); - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); } pSt_Sition = m_ListAddr.GetFirstSelectedItemPosition(); nSelect = m_ListAddr.GetNextSelectedItem(pSt_Sition); if (nSelect >= 0) { m_StrUser = m_ListAddr.GetItemText(nSelect, 2); - st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer(); + st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer()); } CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -358,11 +360,11 @@ void CDialog_Banned::OnBnClickedButton3() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); st_JsonRoot["st_Banned"] = st_JsonObject; int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/banned/delete"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/banned/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -370,16 +372,16 @@ void CDialog_Banned::OnBnClickedButton3() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -387,10 +389,10 @@ void CDialog_Banned::OnBnClickedButton3() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析删除黑名单接口数据错误,无法继续")); @@ -414,7 +416,7 @@ void CDialog_Banned::OnBnClickedButton3() { Authorize_Help_LogPrint(_T("删除黑名单数据失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //刷新 OnBnClickedButton4(); } @@ -452,22 +454,22 @@ void CDialog_Banned::OnBnClickedButton5() m_EditUser.GetWindowText(m_StrUser); m_DataTime.GetWindowText(m_StrTime); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/banned/modify"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/banned/modify"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); if (BST_CHECKED == m_RadioUser.GetCheck()) { - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); } else { - st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer(); + st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer()); } if (BST_CHECKED == m_RadioEnable.GetCheck()) { @@ -479,7 +481,7 @@ void CDialog_Banned::OnBnClickedButton5() } if (BST_CHECKED == m_BtnCheckTime.GetCheck()) { - st_JsonObject["tszLeftTime"] = m_StrTime.GetBuffer(); + st_JsonObject["tszLeftTime"] = W2A(m_StrTime.GetBuffer()); } st_JsonRoot["st_Banned"] = st_JsonObject; //是否加密 @@ -488,16 +490,16 @@ void CDialog_Banned::OnBnClickedButton5() ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -505,10 +507,10 @@ void CDialog_Banned::OnBnClickedButton5() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -532,7 +534,7 @@ void CDialog_Banned::OnBnClickedButton5() { Authorize_Help_LogPrint(_T("更新黑名单信息成功")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); OnBnClickedButton4(); } @@ -551,7 +553,7 @@ void CDialog_Banned::OnNMClickList2(NMHDR* pNMHDR, LRESULT* pResult) CString m_StrUser = m_ListUser.GetItemText(nItemCount, 2); CString m_StrTime = m_ListUser.GetItemText(nItemCount, 3); - if (0 == _tcsxnicmp(m_StrEnable.GetBuffer(), _T("启用"), m_StrEnable.GetLength())) + if (0 == _tcsnicmp(m_StrEnable.GetBuffer(), _T("启用"), m_StrEnable.GetLength())) { m_RadioEnable.SetCheck(BST_CHECKED); m_RadioDisable.SetCheck(BST_UNCHECKED); @@ -563,17 +565,17 @@ void CDialog_Banned::OnNMClickList2(NMHDR* pNMHDR, LRESULT* pResult) } m_RadioIPAddr.SetCheck(BST_UNCHECKED); m_RadioUser.SetCheck(BST_CHECKED); - m_EditUser.SetWindowText(m_StrUser.GetBuffer()); if (m_StrTime.GetLength() > 0) { SYSTEMTIME st_SysTime; - XENGINE_LIBTIMER st_LibTime; + XENGINE_LIBTIME st_LibTime; memset(&st_SysTime, '\0', sizeof(SYSTEMTIME)); - memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_StrToTime(m_StrTime.GetBuffer(), &st_LibTime); + USES_CONVERSION; + BaseLib_Time_StrToTime(W2A(m_StrTime.GetBuffer()), &st_LibTime); st_SysTime.wYear = st_LibTime.wYear; st_SysTime.wMonth = st_LibTime.wMonth; @@ -609,7 +611,7 @@ void CDialog_Banned::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult) CString m_StrUser = m_ListAddr.GetItemText(nItemCount, 2); CString m_StrTime = m_ListAddr.GetItemText(nItemCount, 3); - if (0 == _tcsxnicmp(m_StrEnable.GetBuffer(), _T("启用"), m_StrEnable.GetLength())) + if (0 == _tcsnicmp(m_StrEnable.GetBuffer(), _T("启用"), m_StrEnable.GetLength())) { m_RadioEnable.SetCheck(BST_CHECKED); m_RadioDisable.SetCheck(BST_UNCHECKED); @@ -626,12 +628,13 @@ void CDialog_Banned::OnNMClickList1(NMHDR* pNMHDR, LRESULT* pResult) if (m_StrTime.GetLength() > 0) { SYSTEMTIME st_SysTime; - XENGINE_LIBTIMER st_LibTime; + XENGINE_LIBTIME st_LibTime; memset(&st_SysTime, '\0', sizeof(SYSTEMTIME)); - memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_StrToTime(m_StrTime.GetBuffer(), &st_LibTime); + USES_CONVERSION; + BaseLib_Time_StrToTime(W2A(m_StrTime.GetBuffer()), &st_LibTime); st_SysTime.wYear = st_LibTime.wYear; st_SysTime.wMonth = st_LibTime.wMonth; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_CDKey.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_CDKey.cpp index 4065b35178bfb198573ff77b20c2cf25086dc857..ad91aa763998481e11e1355d328cfb0861c13896 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_CDKey.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_CDKey.cpp @@ -78,19 +78,23 @@ BOOL CDialog_CDKey::OnInitDialog() for (int i = 0; i < 5; i++) { - m_ComboRegSerial.InsertString(i, lpszXSerialType[i]); + USES_CONVERSION; + m_ComboRegSerial.InsertString(i, A2W(lpszXSerialType[i])); } for (int i = 0; i < 6; i++) { - m_ComboRegType.InsertString(i, lpszXRegType[i]); + USES_CONVERSION; + m_ComboRegType.InsertString(i, A2W(lpszXRegType[i])); } for (int i = 0; i < 6; i++) { - m_ComboRegHard.InsertString(i, lpszXHDType[i]); + USES_CONVERSION; + m_ComboRegHard.InsertString(i, A2W(lpszXHDType[i])); } for (int i = 0; i < 3; i++) { - m_ComboRegVer.InsertString(i, lpszXVerType[i]); + USES_CONVERSION; + m_ComboRegVer.InsertString(i, A2W(lpszXVerType[i])); } m_ComboRegSerial.SetCurSel(0); m_ComboRegType.SetCurSel(0); @@ -120,24 +124,25 @@ bool CDialog_CDKey::Dialog_CDKey_Init() int nSerialCount = 3; XCHAR** pptszSerialList; - Authorize_Serial_Create(&pptszSerialList, _T("XAUTH"), nSerialCount, 9); - m_EditSerialTimeNumber.SetWindowText(pptszSerialList[0]); - m_EditSerialDataNumber.SetWindowText(pptszSerialList[1]); - m_EditSerialUnlimitNumber.SetWindowText(pptszSerialList[2]); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszSerialList, nSerialCount); + USES_CONVERSION; + Authorize_Serial_Create(&pptszSerialList, _X("XAUTH"), nSerialCount, 9); + m_EditSerialTimeNumber.SetWindowText(A2W(pptszSerialList[0])); + m_EditSerialDataNumber.SetWindowText(A2W(pptszSerialList[1])); + m_EditSerialUnlimitNumber.SetWindowText(A2W(pptszSerialList[2])); + BaseLib_Memory_Free((XPPPMEM)&pptszSerialList, nSerialCount); m_EditSerialTimeCount.SetWindowText(_T("9999")); m_CheckSerialDataAdd.SetCheck(BST_CHECKED); XCHAR tszTimeStr[128] = {}; - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_GetSysTime(&st_LibTime); + XENGINE_LIBTIME st_LibTime = {}; + BaseLib_Time_GetSysTime(&st_LibTime); st_LibTime.wYear += 1; //一年后过期 - BaseLib_OperatorTime_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); + BaseLib_Time_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); COleDateTime m_OleDTime; // 尝试解析字符串为日期和时间 - if (m_OleDTime.ParseDateTime(tszTimeStr)) + if (m_OleDTime.ParseDateTime(A2W(tszTimeStr))) { m_DataTimeSerial.SetTime(m_OleDTime); } @@ -149,63 +154,92 @@ bool CDialog_CDKey::Dialog_CDKey_Init() bool CDialog_CDKey::Dialog_CDKey_Read(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDKey) { //网络信息 + CString m_StrIPAddr; CString m_StrIPPort; - m_EditIPAddr.GetWindowText(pSt_AuthorizeCDKey->tszAddr, sizeof(pSt_AuthorizeCDKey->tszAddr)); + CString m_StrAPPName; + CString m_StrAPPVer; + m_EditIPAddr.GetWindowText(m_StrIPAddr); m_EditPort.GetWindowText(m_StrIPPort); + + USES_CONVERSION; + strcpy(pSt_AuthorizeCDKey->tszAddr, W2A(m_StrIPAddr.GetBuffer())); pSt_AuthorizeCDKey->nPort = _ttoi(m_StrIPPort.GetString()); //程序信息 CString m_StrSoftTime; - m_EditSoftName.GetWindowText(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppName, sizeof(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppName)); - m_EditSoftVer.GetWindowText(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppVer, sizeof(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppVer)); + m_EditSoftName.GetWindowText(m_StrAPPName); + m_EditSoftVer.GetWindowText(m_StrAPPVer); m_EditSoftTime.GetWindowText(m_StrSoftTime); if (BST_CHECKED == m_EditSoftInit.GetCheck()) { pSt_AuthorizeCDKey->st_AuthAppInfo.bInit = true; } + strcpy(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppName, W2A(m_StrAPPName.GetBuffer())); + strcpy(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppVer, W2A(m_StrAPPVer.GetBuffer())); //注册信息 - CString m_StrRegHaveTime; - m_EditRegHardCode.GetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszHardware, sizeof(pSt_AuthorizeCDKey->st_AuthRegInfo.tszHardware)); - m_EditRegLeftTime.GetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime, sizeof(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime)); - m_EditRegHaveTime.GetWindowText(m_StrRegHaveTime); - pSt_AuthorizeCDKey->st_AuthRegInfo.nHasTime = _ttoi64(m_StrRegHaveTime.GetBuffer()); - m_DateTimeCreate.GetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime, sizeof(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime)); + CString m_StrRegInfo; + m_EditRegHardCode.GetWindowText(m_StrRegInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthRegInfo.tszHardware, W2A(m_StrRegInfo.GetBuffer())); + m_StrRegInfo.ReleaseBuffer(); + m_EditRegLeftTime.GetWindowText(m_StrRegInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime, W2A(m_StrRegInfo.GetBuffer())); + m_StrRegInfo.ReleaseBuffer(); + m_EditRegHaveTime.GetWindowText(m_StrRegInfo); + pSt_AuthorizeCDKey->st_AuthRegInfo.nHasTime = _ttoi64(m_StrRegInfo.GetBuffer()); + m_StrRegInfo.ReleaseBuffer(); + m_DateTimeCreate.GetWindowText(m_StrRegInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime, W2A(m_StrRegInfo.GetBuffer())); //m_DateTimeRegister.GetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime, sizeof(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime)); - m_DateTimeStart.GetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime, sizeof(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime)); + m_StrRegInfo.ReleaseBuffer(); + m_DateTimeStart.GetWindowText(m_StrRegInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime, W2A(m_StrRegInfo.GetBuffer())); pSt_AuthorizeCDKey->st_AuthRegInfo.enSerialType = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)m_ComboRegSerial.GetCurSel(); pSt_AuthorizeCDKey->st_AuthRegInfo.enRegType = (ENUM_AUTHORIZE_MODULE_CDKEY_TYPE)m_ComboRegType.GetCurSel(); pSt_AuthorizeCDKey->st_AuthRegInfo.enHWType = (ENUM_AUTHORIZE_MODULE_HW_TYPE)m_ComboRegHard.GetCurSel(); pSt_AuthorizeCDKey->st_AuthRegInfo.enVModeType = (ENUM_AUTHORIZE_MODULE_VERMODE_TYPE)m_ComboRegVer.GetCurSel(); //序列信息 - CString m_StrSerialCount; - CString m_StrSerialUsed; - m_EditSerialTimeCount.GetWindowText(m_StrSerialCount); - m_EditSerialTimeNumber.GetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.tszTimeSerial, sizeof(pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.tszTimeSerial)); - pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.nTimeCount = _ttoi(m_StrSerialCount.GetBuffer()); - - m_EditSerialDataNumber.GetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial, sizeof(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial)); - m_DataTimeSerial.GetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime, sizeof(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime)); + CString m_StrSerialInfo; + m_EditSerialTimeCount.GetWindowText(m_StrSerialInfo); + pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.nTimeCount = _ttoi(m_StrSerialInfo.GetBuffer()); + m_StrSerialInfo.ReleaseBuffer(); + m_EditSerialTimeNumber.GetWindowText(m_StrSerialInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.tszTimeSerial, W2A(m_StrSerialInfo.GetBuffer())); + m_StrSerialInfo.ReleaseBuffer(); + m_EditSerialDataNumber.GetWindowText(m_StrSerialInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial, W2A(m_StrSerialInfo.GetBuffer())); + m_StrSerialInfo.ReleaseBuffer(); + m_DataTimeSerial.GetWindowText(m_StrSerialInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime, W2A(m_StrSerialInfo.GetBuffer())); if (BST_CHECKED == m_CheckSerialDataAdd.GetCheck()) { pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.bTimeAdd = true; } - m_EditSerialUnlimitNumber.GetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial, sizeof(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial)); + m_StrSerialInfo.ReleaseBuffer(); + m_EditSerialUnlimitNumber.GetWindowText(m_StrSerialInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial, W2A(m_StrSerialInfo.GetBuffer())); //用户信息 - m_EditUserInfo.GetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserName, sizeof(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserName)); - m_EditUserContact.GetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserContact, sizeof(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserContact)); - m_EditUserCustom.GetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszCustom, sizeof(pSt_AuthorizeCDKey->st_AuthUserInfo.tszCustom)); + CString m_StrUserInfo; + m_EditUserInfo.GetWindowText(m_StrUserInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserName, W2A(m_StrUserInfo.GetBuffer())); + m_StrUserInfo.ReleaseBuffer(); + m_EditUserContact.GetWindowText(m_StrUserInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserContact, W2A(m_StrUserInfo.GetBuffer())); + m_EditUserContact.GetWindowText(m_StrUserInfo); + m_EditUserCustom.GetWindowText(m_StrUserInfo); + strcpy(pSt_AuthorizeCDKey->st_AuthUserInfo.tszCustom, W2A(m_StrUserInfo.GetBuffer())); return true; } bool CDialog_CDKey::Dialog_CDKey_Write(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDKey) { CString m_StrFormat; //网络信息 - m_EditIPAddr.SetWindowText(pSt_AuthorizeCDKey->tszAddr); + USES_CONVERSION; + m_EditIPAddr.SetWindowText(A2W(pSt_AuthorizeCDKey->tszAddr)); m_StrFormat.Format(_T("%d"), pSt_AuthorizeCDKey->nPort); m_EditPort.SetWindowText(m_StrFormat); //软件信息 - m_EditSoftName.SetWindowText(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppName); - m_EditSoftVer.SetWindowText(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppVer); + m_EditSoftName.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppName)); + m_EditSoftVer.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthAppInfo.tszAppVer)); m_StrFormat.Format(_T("%lld"), pSt_AuthorizeCDKey->st_AuthAppInfo.nExecTime); m_EditSoftTime.SetWindowText(m_StrFormat); if (pSt_AuthorizeCDKey->st_AuthAppInfo.bInit) @@ -213,25 +247,25 @@ bool CDialog_CDKey::Dialog_CDKey_Write(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDK m_EditSoftInit.SetCheck(BST_CHECKED); } //注册信息 - m_EditRegHardCode.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszHardware); - m_EditRegLeftTime.SetWindowText(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime); + m_EditRegHardCode.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszHardware)); + m_EditRegLeftTime.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszLeftTime)); m_StrFormat.Format(_T("%lld"), pSt_AuthorizeCDKey->st_AuthRegInfo.nHasTime); m_EditRegHaveTime.SetWindowText(m_StrFormat); COleDateTime m_OleDTime; // 尝试解析字符串为日期和时间 - if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime)) + if (m_OleDTime.ParseDateTime(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszCreateTime))) { m_DateTimeCreate.SetTime(m_OleDTime); } - if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime)) + if (m_OleDTime.ParseDateTime(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszRegisterTime))) { m_DateTimeRegister.SetTime(m_OleDTime); } - if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime)) + if (m_OleDTime.ParseDateTime(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszStartTime))) { m_DateTimeStart.SetTime(m_OleDTime); } - if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthRegInfo.tszExpiryTime)) + if (m_OleDTime.ParseDateTime(A2W(pSt_AuthorizeCDKey->st_AuthRegInfo.tszExpiryTime))) { m_DataTimeSerial.SetTime(m_OleDTime); } @@ -243,24 +277,24 @@ bool CDialog_CDKey::Dialog_CDKey_Write(XENGINE_AUTHORIZE_LOCAL* pSt_AuthorizeCDK //序列信息 m_StrFormat.Format(_T("%d"), pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.nTimeCount); m_EditSerialTimeCount.SetWindowText(m_StrFormat); - m_EditSerialTimeNumber.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.tszTimeSerial); + m_EditSerialTimeNumber.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthSerial.st_TimeLimit.tszTimeSerial)); if (pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.bTimeAdd) { m_CheckSerialDataAdd.SetCheck(BST_CHECKED); } - m_EditSerialDataNumber.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial); + m_EditSerialDataNumber.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataSerial)); // 尝试解析字符串为日期和时间 - if (m_OleDTime.ParseDateTime(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime)) + if (m_OleDTime.ParseDateTime(A2W(pSt_AuthorizeCDKey->st_AuthSerial.st_DataLimit.tszDataTime))) { m_DataTimeSerial.SetTime(m_OleDTime); } - m_EditSerialUnlimitNumber.SetWindowText(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial); + m_EditSerialUnlimitNumber.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthSerial.st_UNLimit.tszUNLimitSerial)); //用户信息 - m_EditUserInfo.SetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserName); - m_EditUserContact.SetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserContact); - m_EditUserCustom.SetWindowText(pSt_AuthorizeCDKey->st_AuthUserInfo.tszCustom); + m_EditUserInfo.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserName)); + m_EditUserContact.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthUserInfo.tszUserContact)); + m_EditUserCustom.SetWindowText(A2W(pSt_AuthorizeCDKey->st_AuthUserInfo.tszCustom)); return true; } void CDialog_CDKey::OnBnClickedButton1() @@ -294,7 +328,8 @@ void CDialog_CDKey::OnBnClickedButton1() XBYTE tszENBuffer[4096] = {}; Authorize_CDKey_WriteMemory(tszDEBuffer, &nMSGLen, &st_AuthorizeCDKey); - OPenSsl_XCrypto_Encoder(tszDEBuffer, &nMSGLen, tszENBuffer, m_StrPass.GetBuffer()); + USES_CONVERSION; + Cryption_XCrypto_Encoder(tszDEBuffer, &nMSGLen, tszENBuffer, W2A(m_StrPass.GetBuffer())); FILE* pSt_File = _tfopen(m_FileDlg.GetPathName(), _T("wb")); if (NULL == pSt_File) { @@ -329,7 +364,8 @@ void CDialog_CDKey::OnBnClickedButton9() nMSGLen = fread(tszENBuffer, 1, sizeof(tszENBuffer), pSt_File); fclose(pSt_File); - if (!OPenSsl_XCrypto_Decoder(tszENBuffer, &nMSGLen, tszDEBuffer, m_StrPass.GetBuffer())) + USES_CONVERSION; + if (!Cryption_XCrypto_Decoder(tszENBuffer, &nMSGLen, tszDEBuffer, W2A(m_StrPass.GetBuffer()))) { AfxMessageBox(_T("解密CDKEY失败")); return; @@ -373,8 +409,9 @@ void CDialog_CDKey::OnBnClickedButton11() } else if (4 == m_ComboRegSerial.GetCurSel()) { - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_StrToTime(m_StrLeftTime.GetBuffer(), &st_LibTime); + XENGINE_LIBTIME st_LibTime = {}; + USES_CONVERSION; + BaseLib_Time_StrToTime(W2A(m_StrLeftTime.GetBuffer()), &st_LibTime); Authorize_CDKey_BuildKeyTime(&st_AuthorizeCDKey, 0, &st_LibTime); } else @@ -397,8 +434,8 @@ void CDialog_CDKey::OnBnClickedButton11() XCHAR tszDEBuffer[4096] = {}; XBYTE tszENBuffer[4096] = {}; Authorize_CDKey_WriteMemory(tszDEBuffer, &nMSGLen, &st_AuthorizeCDKey); - - OPenSsl_XCrypto_Encoder(tszDEBuffer, &nMSGLen, tszENBuffer, m_StrPass.GetBuffer()); + USES_CONVERSION; + Cryption_XCrypto_Encoder(tszDEBuffer, &nMSGLen, tszENBuffer, W2A(m_StrPass.GetBuffer())); FILE* pSt_File = _tfopen(m_FileDlg.GetPathName(), _T("wb")); fwrite(tszENBuffer, 1, nMSGLen, pSt_File); fclose(pSt_File); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Config.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Config.cpp index 9ba58efc6757843d98cbe2c3c42b469d18243b8d..afd2f1270090f554fdd30e46f2d29e9b539eb466 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Config.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Config.cpp @@ -88,7 +88,7 @@ BOOL CDialog_Config::OnInitDialog() m_ListEncrypto.SetCurSel(0); m_ListEncrypto.EnableWindow(false); - m_EditPassword.SetWindowText("123123"); + m_EditPassword.SetWindowText(_T("123123")); m_EditPassword.EnableWindow(false); hConfigWnd = m_hWnd; @@ -106,7 +106,7 @@ void CDialog_Config::OnBnClickedButton1() CString m_StrPass; CString m_StrToken; CString m_StrDCode; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); //组合请求URL m_EditIPAddr.GetWindowText(m_StrIPAddr); @@ -115,31 +115,32 @@ void CDialog_Config::OnBnClickedButton1() m_EditPass.GetWindowText(m_StrPass); m_EditDCode.GetWindowText(m_StrDCode); - TCHAR tszMDBuffer[64] = {}; + USES_CONVERSION; + XCHAR tszMDBuffer[64] = {}; if (m_RadioPassEnable.GetCheck() == BST_CHECKED) { int nPLen = m_StrPass.GetLength(); XBYTE byMD5Buffer[MAX_PATH] = {}; - OPenSsl_Api_Digest(m_StrPass.GetBuffer(), byMD5Buffer, &nPLen, false, m_ComboPassCodec.GetCurSel() + 1); - BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, tszMDBuffer); + Cryption_Api_Digest(W2A(m_StrPass.GetBuffer()), byMD5Buffer, &nPLen, false, m_ComboPassCodec.GetCurSel() + 1); + BaseLib_String_StrToHex((LPCXSTR)byMD5Buffer, nPLen, tszMDBuffer); } else { - _tcsxcpy(tszMDBuffer, m_StrPass.GetBuffer()); + _tcsxcpy(tszMDBuffer, W2A(m_StrPass.GetBuffer())); } if (m_StrDCode.GetLength() > 0) { m_EditToken.GetWindowText(m_StrToken); - _xstprintf(tszUrlAddr, _T("http://%s:%s/api?function=login&user=%s&pass=%s&device=%d&token=%s&dcode=%s"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer(), m_StrUser.GetBuffer(), tszMDBuffer, ENUM_PROTOCOL_FOR_DEVICE_TYPE_PC_WINDOWS, m_StrToken.GetBuffer(), m_StrDCode.GetBuffer()); + _xstprintf(tszUrlAddr, _X("http://%s:%s/api?function=login&user=%s&pass=%s&device=%d&token=%s&dcode=%s"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()), W2A(m_StrUser.GetBuffer()), tszMDBuffer, ENUM_PROTOCOL_FOR_DEVICE_TYPE_PC_WINDOWS, W2A(m_StrToken.GetBuffer()), W2A(m_StrDCode.GetBuffer())); } else { - _xstprintf(tszUrlAddr, _T("http://%s:%s/api?function=login&user=%s&pass=%s&device=%d"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer(), m_StrUser.GetBuffer(), tszMDBuffer, ENUM_PROTOCOL_FOR_DEVICE_TYPE_PC_WINDOWS); + _xstprintf(tszUrlAddr, _X("http://%s:%s/api?function=login&user=%s&pass=%s&device=%d"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()), W2A(m_StrUser.GetBuffer()), tszMDBuffer, ENUM_PROTOCOL_FOR_DEVICE_TYPE_PC_WINDOWS); } //请求用户信息 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - APIClient_Http_Request(_T("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); + XCHAR* ptszMsgBuffer = NULL; + APIClient_Http_Request(_X("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); Json::Value st_JsonRoot; JSONCPP_STRING st_JsonError; @@ -148,11 +149,11 @@ void CDialog_Config::OnBnClickedButton1() if (BST_CHECKED == m_CheckCodecEnable.GetCheck()) { CString m_StrCodecPass; - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); m_EditPassword.GetWindowText(m_StrCodecPass); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, m_StrCodecPass.GetBuffer()); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(m_StrCodecPass.GetBuffer())); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("登录失败,无法继续")); @@ -177,9 +178,9 @@ void CDialog_Config::OnBnClickedButton1() } m_StrToken.Format(_T("%lld"), st_JsonRoot["xhToken"].asUInt64()); m_EditToken.SetWindowText(m_StrToken); - m_EditTimeout.SetWindowText(st_JsonRoot["tszTimeEnd"].asCString()); + m_EditTimeout.SetWindowText(A2W(st_JsonRoot["tszTimeEnd"].asCString())); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); Authorize_Help_LogPrint(_T("登录成功")); m_BtnLogin.EnableWindow(false); @@ -194,18 +195,19 @@ void CDialog_Config::OnBnClickedButton2() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); //组合请求URL m_EditIPAddr.GetWindowText(m_StrIPAddr); m_EditIPPort.GetWindowText(m_StrIPPort); m_EditToken.GetWindowText(m_StrToken); - _xstprintf(tszUrlAddr, _T("http://%s:%s/api?function=close&token=%s"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer(), m_StrToken.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/api?function=close&token=%s"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()), W2A(m_StrToken.GetBuffer())); //请求用户信息 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - APIClient_Http_Request(_T("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); + XCHAR* ptszMsgBuffer = NULL; + APIClient_Http_Request(_X("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); Json::Value st_JsonRoot; JSONCPP_STRING st_JsonError; @@ -214,11 +216,11 @@ void CDialog_Config::OnBnClickedButton2() if (BST_CHECKED == m_CheckCodecEnable.GetCheck()) { CString m_StrCodecPass; - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); m_EditPassword.GetWindowText(m_StrCodecPass); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, m_StrCodecPass.GetBuffer()); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(m_StrCodecPass.GetBuffer())); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("关闭失败,无法继续")); @@ -238,10 +240,10 @@ void CDialog_Config::OnBnClickedButton2() Authorize_Help_LogPrint(_T("关闭失败,无法继续")); return; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - m_EditToken.SetWindowText(""); - m_EditTimeout.SetWindowText(""); + m_EditToken.SetWindowText(_T("")); + m_EditTimeout.SetWindowText(_T("")); m_BtnLogin.EnableWindow(true); m_BtnLogout.EnableWindow(false); @@ -255,18 +257,18 @@ void CDialog_Config::OnBnClickedButton5() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); //组合请求URL m_EditIPAddr.GetWindowText(m_StrIPAddr); m_EditIPPort.GetWindowText(m_StrIPPort); m_EditToken.GetWindowText(m_StrToken); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/api?function=update&token=%s"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer(), m_StrToken.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/api?function=update&token=%s"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()), W2A(m_StrToken.GetBuffer())); //请求用户信息 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - APIClient_Http_Request(_T("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); + XCHAR* ptszMsgBuffer = NULL; + APIClient_Http_Request(_X("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); Json::Value st_JsonRoot; JSONCPP_STRING st_JsonError; @@ -275,11 +277,11 @@ void CDialog_Config::OnBnClickedButton5() if (BST_CHECKED == m_CheckCodecEnable.GetCheck()) { CString m_StrCodecPass; - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); m_EditPassword.GetWindowText(m_StrCodecPass); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, m_StrCodecPass.GetBuffer()); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(m_StrCodecPass.GetBuffer())); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("续期失败,无法继续")); @@ -299,8 +301,8 @@ void CDialog_Config::OnBnClickedButton5() Authorize_Help_LogPrint(_T("续期失败,无法继续")); return; } - m_EditTimeout.SetWindowText(st_JsonRoot["tszTimeEnd"].asCString()); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + m_EditTimeout.SetWindowText(A2W(st_JsonRoot["tszTimeEnd"].asCString())); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } @@ -327,17 +329,18 @@ void CDialog_Config::OnBnClickedButton8() // TODO: 在此添加控件通知处理程序代码 CString m_StrIPAddr; CString m_StrIPPort; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); //组合请求URL m_EditIPAddr.GetWindowText(m_StrIPAddr); m_EditIPPort.GetWindowText(m_StrIPPort); - _xstprintf(tszUrlAddr, _T("http://%s:%s/api?function=dcode&user=get"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/api?function=dcode&user=get"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //请求用户信息 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - APIClient_Http_Request(_T("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); + XCHAR* ptszMsgBuffer = NULL; + APIClient_Http_Request(_X("GET"), tszUrlAddr, NULL, NULL, &ptszMsgBuffer, &nMsgLen); Json::Value st_JsonRoot; JSONCPP_STRING st_JsonError; @@ -346,11 +349,11 @@ void CDialog_Config::OnBnClickedButton8() if (BST_CHECKED == m_CheckCodecEnable.GetCheck()) { CString m_StrCodecPass; - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); m_EditPassword.GetWindowText(m_StrCodecPass); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, m_StrCodecPass.GetBuffer()); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(m_StrCodecPass.GetBuffer())); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("获取验证码失败,无法继续")); @@ -376,12 +379,12 @@ void CDialog_Config::OnBnClickedButton8() memset(tszDCodeStr, '\0', sizeof(tszDCodeStr)); memset(tszTokenStr, '\0', sizeof(tszTokenStr)); - _xstprintf(tszDCodeStr, _T("%d"), st_JsonRoot["nDynamicCode"].asUInt()); - _xstprintf(tszTokenStr, _T("%llu"), st_JsonRoot["xhToken"].asUInt64()); + _stprintf(tszDCodeStr, _T("%d"), st_JsonRoot["nDynamicCode"].asUInt()); + _stprintf(tszTokenStr, _T("%llu"), st_JsonRoot["xhToken"].asUInt64()); m_EditToken.SetWindowText(tszTokenStr); m_EditDCode.SetWindowText(tszDCodeStr); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp index 8d6970bd650b287452c587ff5cdfd1a031a47601..af6bdcbe11e672619c051c3ca1ffecfbe9947396 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp @@ -57,11 +57,13 @@ BOOL CDialog_Modify::OnInitDialog() for (int i = 0; i < 5; i++) { - m_ComboSerial.InsertString(i, lpszXSerialType[i]); + USES_CONVERSION; + m_ComboSerial.InsertString(i, A2W(lpszXSerialType[i])); } for (int i = 0; i < 21; i++) { - m_ComboLeave.InsertString(i, lpszXLevelType[i]); + USES_CONVERSION; + m_ComboLeave.InsertString(i, A2W(lpszXLevelType[i])); } m_DateTimeRegister.SetFormat(_T("yyyy-MM-dd HH:mm:ss")); POSITION pSt_Sition = pUserWnd->m_ListCtrlClient.GetFirstSelectedItemPosition(); @@ -81,39 +83,40 @@ BOOL CDialog_Modify::OnInitDialog() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); //组合请求URL pConfigWnd->m_EditIPAddr.GetWindowText(m_StrIPAddr); pConfigWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pConfigWnd->m_EditToken.GetWindowText(m_StrToken); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/client/get"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/client/get"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //请求用户信息 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); st_JsonRoot["st_UserInfo"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); + //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonObject.clear(); st_JsonRoot.clear(); @@ -122,10 +125,10 @@ BOOL CDialog_Modify::OnInitDialog() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -142,13 +145,13 @@ BOOL CDialog_Modify::OnInitDialog() } st_JsonObject = st_JsonRoot["st_UserTable"]; - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - m_EditUser.SetWindowText(st_JsonObject["st_UserInfo"]["tszUserName"].asCString()); - m_EditPass.SetWindowText(st_JsonObject["st_UserInfo"]["tszUserPass"].asCString()); - m_EditEMail.SetWindowText(st_JsonObject["st_UserInfo"]["tszEMailAddr"].asCString()); + m_EditUser.SetWindowText(A2W(st_JsonObject["st_UserInfo"]["tszUserName"].asCString())); + m_EditPass.SetWindowText(A2W(st_JsonObject["st_UserInfo"]["tszUserPass"].asCString())); + m_EditEMail.SetWindowText(A2W(st_JsonObject["st_UserInfo"]["tszEMailAddr"].asCString())); COleDateTime m_OleDTime; - if (m_OleDTime.ParseDateTime(st_JsonObject["st_UserInfo"]["tszCreateTime"].asCString())) + if (m_OleDTime.ParseDateTime(A2W(st_JsonObject["st_UserInfo"]["tszCreateTime"].asCString()))) { m_DateTimeRegister.SetTime(m_OleDTime); } @@ -161,8 +164,8 @@ BOOL CDialog_Modify::OnInitDialog() m_StrNumber.Format(_T("%lld"), st_JsonObject["st_UserInfo"]["nPhoneNumber"].asUInt64()); m_EditPhone.SetWindowText(m_StrNumber); - m_EditHardCode.SetWindowText(st_JsonObject["tszHardCode"].asCString()); - m_EditLeftTime.SetWindowText(st_JsonObject["tszLeftTime"].asCString()); + m_EditHardCode.SetWindowText(A2W(st_JsonObject["tszHardCode"].asCString())); + m_EditLeftTime.SetWindowText(A2W(st_JsonObject["tszLeftTime"].asCString())); m_ComboSerial.SetCurSel(st_JsonObject["enSerialType"].asInt()); m_ComboLeave.SetCurSel(st_JsonObject["st_UserInfo"]["nUserLevel"].asInt() + 1); @@ -183,20 +186,34 @@ void CDialog_Modify::OnBnClickedButton2() AUTHREG_USERTABLE st_UserTable; memset(&st_UserTable, '\0', sizeof(AUTHREG_USERTABLE)); - m_EditUser.GetWindowText(st_UserTable.st_UserInfo.tszUserName, sizeof(st_UserTable.st_UserInfo.tszUserName)); - m_EditPass.GetWindowText(st_UserTable.st_UserInfo.tszUserPass, sizeof(st_UserTable.st_UserInfo.tszUserPass)); - m_EditEMail.GetWindowText(st_UserTable.st_UserInfo.tszEMailAddr, sizeof(st_UserTable.st_UserInfo.tszEMailAddr)); - m_DateTimeRegister.GetWindowText(st_UserTable.st_UserInfo.tszCreateTime, sizeof(st_UserTable.st_UserInfo.tszCreateTime)); - m_EditHardCode.GetWindowText(st_UserTable.tszHardCode, sizeof(st_UserTable.tszHardCode)); + CString m_StrUserInfo; + USES_CONVERSION; + m_EditUser.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.st_UserInfo.tszUserName, W2A(m_StrUserInfo.GetBuffer())); + m_StrUserInfo.ReleaseBuffer(); + m_EditPass.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.st_UserInfo.tszUserPass, W2A(m_StrUserInfo.GetBuffer())); + m_StrUserInfo.ReleaseBuffer(); + m_EditEMail.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.st_UserInfo.tszEMailAddr, W2A(m_StrUserInfo.GetBuffer())); + m_StrUserInfo.ReleaseBuffer(); + m_DateTimeRegister.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.st_UserInfo.tszCreateTime, W2A(m_StrUserInfo.GetBuffer())); + m_StrUserInfo.ReleaseBuffer(); + m_EditHardCode.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.tszHardCode, W2A(m_StrUserInfo.GetBuffer())); CString m_StrNumber; m_EditPhone.GetWindowText(m_StrNumber); - st_UserTable.st_UserInfo.nPhoneNumber = _ttxoll(m_StrNumber.GetBuffer()); + st_UserTable.st_UserInfo.nPhoneNumber = _ttoll(m_StrNumber.GetBuffer()); m_StrNumber.ReleaseBuffer(); m_EditCardID.GetWindowText(m_StrNumber); - st_UserTable.st_UserInfo.nIDNumber = _ttxoll(m_StrNumber.GetBuffer()); + st_UserTable.st_UserInfo.nIDNumber = _ttoll(m_StrNumber.GetBuffer()); + + m_StrUserInfo.ReleaseBuffer(); + m_EditLeftTime.GetWindowText(m_StrUserInfo); + strcpy(st_UserTable.tszLeftTime, W2A(m_StrUserInfo.GetBuffer())); - m_EditLeftTime.GetWindowText(st_UserTable.tszLeftTime, sizeof(st_UserTable.tszLeftTime)); st_UserTable.enSerialType = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)m_ComboSerial.GetCurSel(); st_UserTable.st_UserInfo.nUserLevel = m_ComboLeave.GetCurSel() - 1; @@ -208,7 +225,7 @@ void CDialog_Modify::OnBnClickedButton2() CString m_StrToken; CString m_StrBtnModify; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); m_BtnModify.GetWindowText(m_StrBtnModify); //组合请求URL @@ -216,14 +233,14 @@ void CDialog_Modify::OnBnClickedButton2() pConfigWnd->m_EditIPAddr.GetWindowText(m_StrIPAddr); pConfigWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pConfigWnd->m_EditToken.GetWindowText(m_StrToken); - if (0 == _tcscmp("添加", m_StrBtnModify.GetBuffer())) + if (0 == _tcscmp(_T("添加"), m_StrBtnModify.GetBuffer())) { - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/user/register"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/user/register"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); } else { - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/client/modify"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/client/modify"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); } st_JsonUser["tszUserName"] = st_UserTable.st_UserInfo.tszUserName; @@ -241,22 +258,22 @@ void CDialog_Modify::OnBnClickedButton2() //是否加密 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -264,10 +281,10 @@ void CDialog_Modify::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -291,7 +308,7 @@ void CDialog_Modify::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("修改客户端失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); OnOK(); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Serial.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Serial.cpp index b0ddc40d151576d1e5a25c5964fa7bbc69da4008..49b6fa1f9251b20bf98c53d49c336ce5357871fc 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Serial.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Serial.cpp @@ -62,7 +62,8 @@ BOOL CDialog_Serial::OnInitDialog() for (int i = 0; i < 5; i++) { - m_ComboSerialType.InsertString(i, lpszXSerialType[i]); + USES_CONVERSION; + m_ComboSerialType.InsertString(i, A2W(lpszXSerialType[i])); } m_ComboNumber.InsertString(0, _T("4")); @@ -73,8 +74,8 @@ BOOL CDialog_Serial::OnInitDialog() m_ComboNumber.InsertString(5, _T("9")); m_ComboNumber.InsertString(6, _T("10")); - m_EditPosStart.SetWindowText("0"); - m_EditPosEnd.SetWindowText("50"); + m_EditPosStart.SetWindowText(_T("0")); + m_EditPosEnd.SetWindowText(_T("50")); m_ComboNumber.SetCurSel(0); m_ComboSerialType.SetCurSel(0); @@ -100,32 +101,32 @@ void CDialog_Serial::OnBnClickedButton1() m_EditPosStart.GetWindowText(m_StrPosStart); m_EditPosEnd.GetWindowText(m_StrPosEnd); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/serial/list"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/list"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); - st_JsonRoot["PosStart"] = _ttxoi(m_StrPosStart.GetBuffer()); - st_JsonRoot["PosEnd"] = _ttxoi(m_StrPosEnd.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); + st_JsonRoot["PosStart"] = _ttoi(m_StrPosStart.GetBuffer()); + st_JsonRoot["PosEnd"] = _ttoi(m_StrPosEnd.GetBuffer()); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -133,10 +134,10 @@ void CDialog_Serial::OnBnClickedButton1() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -161,21 +162,21 @@ void CDialog_Serial::OnBnClickedButton1() Json::Value st_JsonArray = st_JsonRoot["Array"][i]; m_ListSerial.InsertItem(i, _T("")); - m_ListSerial.SetItemText(i, 0, st_JsonArray["tszUserName"].asCString()); - m_ListSerial.SetItemText(i, 1, st_JsonArray["tszSerialNumber"].asCString()); - m_ListSerial.SetItemText(i, 2, st_JsonArray["tszMaxTime"].asCString()); - m_ListSerial.SetItemText(i, 3, lpszXSerialType[st_JsonArray["enSerialType"].asInt()]); + m_ListSerial.SetItemText(i, 0, A2W(st_JsonArray["tszUserName"].asCString())); + m_ListSerial.SetItemText(i, 1, A2W(st_JsonArray["tszSerialNumber"].asCString())); + m_ListSerial.SetItemText(i, 2, A2W(st_JsonArray["tszMaxTime"].asCString())); + m_ListSerial.SetItemText(i, 3, A2W(lpszXSerialType[st_JsonArray["enSerialType"].asInt()])); if (st_JsonArray["bIsUsed"].asBool()) { - m_ListSerial.SetItemText(i, 4, "已使用"); + m_ListSerial.SetItemText(i, 4, _T("已使用")); } else { - m_ListSerial.SetItemText(i, 4, "未使用"); + m_ListSerial.SetItemText(i, 4, _T("未使用")); } - m_ListSerial.SetItemText(i, 5, st_JsonArray["tszCreateTime"].asCString()); + m_ListSerial.SetItemText(i, 5, A2W(st_JsonArray["tszCreateTime"].asCString())); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } @@ -185,7 +186,7 @@ void CDialog_Serial::OnBnClickedButton2() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -203,16 +204,17 @@ void CDialog_Serial::OnBnClickedButton2() m_EditSerialCount.GetWindowText(m_StrSerialCount); m_ComboNumber.GetLBText(m_ComboNumber.GetCurSel(), m_StrNumberCount); + USES_CONVERSION; st_JsonObject["enSerialType"] = m_ComboSerialType.GetCurSel(); - st_JsonObject["nNumberCount"] = _ttxoi(m_StrNumberCount.GetBuffer()); - st_JsonObject["nSerialCount"] = _ttxoi(m_StrSerialCount.GetBuffer()); - st_JsonObject["tszHasTime"] = m_StrHasTime.GetBuffer(); + st_JsonObject["nNumberCount"] = _ttoi(m_StrNumberCount.GetBuffer()); + st_JsonObject["nSerialCount"] = _ttoi(m_StrSerialCount.GetBuffer()); + st_JsonObject["tszHasTime"] = W2A(m_StrHasTime.GetBuffer()); st_JsonRoot["st_SerialInfo"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/serial/insert"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/insert"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -220,16 +222,16 @@ void CDialog_Serial::OnBnClickedButton2() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -237,10 +239,10 @@ void CDialog_Serial::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -264,7 +266,7 @@ void CDialog_Serial::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("插入序列号失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //刷新 OnBnClickedButton1(); } @@ -285,7 +287,7 @@ void CDialog_Serial::OnBnClickedButton4() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -303,15 +305,15 @@ void CDialog_Serial::OnBnClickedButton4() m_EditHasTime.GetWindowText(m_StrHasTime); m_EditSerialCount.GetWindowText(m_StrSerialCount); m_ComboNumber.GetLBText(m_ComboNumber.GetCurSel(), m_StrNumberCount); - - st_JsonObject["tszSerialNumber"] = m_StrSerial.GetBuffer(); + USES_CONVERSION; + st_JsonObject["tszSerialNumber"] = W2A(m_StrSerial.GetBuffer()); st_JsonArray.append(st_JsonObject); st_JsonRoot["Array"] = st_JsonArray; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/serial/delete"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -319,16 +321,16 @@ void CDialog_Serial::OnBnClickedButton4() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -336,10 +338,10 @@ void CDialog_Serial::OnBnClickedButton4() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -363,7 +365,7 @@ void CDialog_Serial::OnBnClickedButton4() { Authorize_Help_LogPrint(_T("删除序列号失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //刷新 OnBnClickedButton1(); } @@ -401,7 +403,7 @@ void CDialog_Serial::OnBnClickedButton6() } FILE* pSt_File = _tfopen(m_FileDlg.GetPathName(), _T("rb")); - TCHAR tszMsgBuffer[MAX_PATH]; + XCHAR tszMsgBuffer[MAX_PATH]; //跳过第一行 if (NULL == fgets(tszMsgBuffer, MAX_PATH, pSt_File)) { @@ -422,8 +424,8 @@ void CDialog_Serial::OnBnClickedButton6() int nID = 0; AUTHREG_SERIALTABLE st_SerialTable; memset(&st_SerialTable, '\0', sizeof(AUTHREG_SERIALTABLE)); - - int nRet = _stscanf(tszMsgBuffer, _T("%d %s %s %s %d %d %s %s"), &nID, st_SerialTable.tszUserName, st_SerialTable.tszSerialNumber, st_SerialTable.tszMaxTime, &st_SerialTable.enSerialType, &st_SerialTable.bIsUsed, st_SerialTable.tszCreateTime, (st_SerialTable.tszCreateTime + 11)); + + int nRet = _stxscanf(tszMsgBuffer, _X("%d %s %s %s %d %d %s %s"), &nID, st_SerialTable.tszUserName, st_SerialTable.tszSerialNumber, st_SerialTable.tszMaxTime, &st_SerialTable.enSerialType, &st_SerialTable.bIsUsed, st_SerialTable.tszCreateTime, (st_SerialTable.tszCreateTime + 11)); st_SerialTable.tszCreateTime[10] = ' '; stl_ListSerial.push_back(st_SerialTable); } @@ -432,7 +434,7 @@ void CDialog_Serial::OnBnClickedButton6() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -462,11 +464,12 @@ void CDialog_Serial::OnBnClickedButton6() st_JsonArray.append(st_JsonObject); } st_JsonRoot["Array"] = st_JsonArray; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/serial/push"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/push"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -474,16 +477,16 @@ void CDialog_Serial::OnBnClickedButton6() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -491,10 +494,10 @@ void CDialog_Serial::OnBnClickedButton6() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析序列号推送接口数据错误,无法继续")); @@ -518,7 +521,7 @@ void CDialog_Serial::OnBnClickedButton6() { Authorize_Help_LogPrint(_T("导入序列号失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //刷新 OnBnClickedButton1(); } @@ -536,10 +539,10 @@ void CDialog_Serial::OnBnClickedButton7() } FILE* pSt_File = _tfopen(m_FileDlg.GetPathName(), _T("wb")); - TCHAR tszMsgBuffer[MAX_PATH]; + XCHAR tszMsgBuffer[MAX_PATH]; memset(tszMsgBuffer, '\0', MAX_PATH); //写字段头 - int nRet = _xstprintf(tszMsgBuffer, _T("ID UserName SerialNumber MaxTime CardSerialType bIsUsed CreateTime\r\n")); + int nRet = _xstprintf(tszMsgBuffer, _X("ID UserName SerialNumber MaxTime CardSerialType bIsUsed CreateTime\r\n")); fwrite(tszMsgBuffer, 1, nRet, pSt_File); for (int i = 0; i < m_ListSerial.GetItemCount(); i++) @@ -548,19 +551,20 @@ void CDialog_Serial::OnBnClickedButton7() int nUsedType = 0; memset(tszMsgBuffer, '\0', MAX_PATH); + USES_CONVERSION; for (int j = 0; j < sizeof(lpszXSerialType) - 1; j++) { - if (0 == _tcsxnicmp(lpszXSerialType[j], m_ListSerial.GetItemText(i, 3).GetBuffer(), _tcsxlen(lpszXSerialType[j]))) + if (0 == _tcsxnicmp(lpszXSerialType[j], W2A(m_ListSerial.GetItemText(i, 3).GetBuffer()), _tcsxlen(lpszXSerialType[j]))) { nSerialType = j; break; } } - if (0 == _tcsxnicmp(m_ListSerial.GetItemText(i, 4).GetBuffer(), "未使用", m_ListSerial.GetItemText(i, 4).GetLength())) + if (0 == _tcsxnicmp(W2A(m_ListSerial.GetItemText(i, 4).GetBuffer()), "未使用", m_ListSerial.GetItemText(i, 4).GetLength())) { nUsedType = 0; } - nRet = _xstprintf(tszMsgBuffer, _T("%d %s %s %s %d %d %s %s\r\n"), i, m_ListSerial.GetItemText(i, 0).GetBuffer(), m_ListSerial.GetItemText(i, 1).GetBuffer(), m_ListSerial.GetItemText(i, 2).GetBuffer(), nSerialType, nUsedType, m_ListSerial.GetItemText(i, 5).GetBuffer(), m_ListSerial.GetItemText(i, 6).GetBuffer()); + nRet = _xstprintf(tszMsgBuffer, _X("%d %s %s %s %d %d %s %s\r\n"), i, W2A(m_ListSerial.GetItemText(i, 0).GetBuffer()), W2A(m_ListSerial.GetItemText(i, 1).GetBuffer()), W2A(m_ListSerial.GetItemText(i, 2).GetBuffer()), nSerialType, nUsedType, W2A(m_ListSerial.GetItemText(i, 5).GetBuffer()), W2A(m_ListSerial.GetItemText(i, 6).GetBuffer())); fwrite(tszMsgBuffer, 1, nRet, pSt_File); } fclose(pSt_File); 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 891105e2a9bf2a777d0875f117407ae8a0b58d2d..eb831a16f50c00218913613f77822743e57e32dc 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 @@ -68,7 +68,7 @@ void CDialog_Switch::OnBnClickedButton1() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -77,11 +77,12 @@ void CDialog_Switch::OnBnClickedButton1() pWnd->m_EditToken.GetWindowText(m_StrToken); Json::Value st_JsonRoot; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/switch/get"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/switch/get"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -89,16 +90,16 @@ void CDialog_Switch::OnBnClickedButton1() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -106,10 +107,10 @@ void CDialog_Switch::OnBnClickedButton1() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析接口数据错误,无法继续")); @@ -262,7 +263,7 @@ void CDialog_Switch::OnBnClickedButton1() { Authorize_Help_LogPrint(_T("查询服务功能开关失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } @@ -272,7 +273,7 @@ void CDialog_Switch::OnBnClickedButton2() CString m_StrIPAddr; CString m_StrIPPort; CString m_StrToken; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CDialog_Config* pWnd = (CDialog_Config*)CDialog_Config::FromHandle(hConfigWnd); memset(tszUrlAddr, '\0', MAX_PATH); @@ -391,11 +392,12 @@ void CDialog_Switch::OnBnClickedButton2() st_JsonObject["bSwitchTokenLogin"] = false; } st_JsonRoot["st_SwitchInfo"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/switch/set"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + XCHAR* ptszMsgBuffer = NULL; + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/switch/set"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); //是否加密 TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); @@ -403,16 +405,16 @@ void CDialog_Switch::OnBnClickedButton2() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } st_JsonRoot.clear(); JSONCPP_STRING st_JsonError; @@ -420,10 +422,10 @@ void CDialog_Switch::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析接口数据错误,无法继续")); @@ -447,7 +449,7 @@ void CDialog_Switch::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("插入功能开关失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Try.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Try.cpp index 8c5fe2e876e1a45e427c93c1d6b19669a668ac4c..db29df88e035f12ddc4c361754b5ce12103a7bb1 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Try.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Try.cpp @@ -60,11 +60,12 @@ BOOL CDialog_Try::OnInitDialog() for (int i = 0; i < 5; i++) { - m_ComboType.InsertString(i, lpszXSerialType[i]); + USES_CONVERSION; + m_ComboType.InsertString(i, A2W(lpszXSerialType[i])); } - m_EditPosStart.SetWindowText("0"); - m_EditPosEnd.SetWindowText("100"); + m_EditPosStart.SetWindowText(_T("0")); + m_EditPosEnd.SetWindowText(_T("100")); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE } @@ -76,7 +77,7 @@ void CDialog_Try::OnBnClickedButton1() TCHAR tszIPAddr[MAX_PATH]; TCHAR tszIPPort[MAX_PATH]; TCHAR tszToken[MAX_PATH]; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CString m_StrPosStart; CString m_StrPosEnd; @@ -91,13 +92,14 @@ void CDialog_Try::OnBnClickedButton1() ::GetWindowText(::GetDlgItem(hConfigWnd, IDC_EDIT2), tszIPPort, MAX_PATH); ::GetWindowText(::GetDlgItem(hConfigWnd, IDC_EDIT9), tszToken, MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/try/list"), tszIPAddr, tszIPPort); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/try/list"), W2A(tszIPAddr), W2A(tszIPPort)); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; - st_JsonRoot["xhToken"] = _ttxoll(tszToken); - st_JsonRoot["PosStart"] = _ttxoi(m_StrPosStart.GetBuffer()); - st_JsonRoot["PosEnd"] = _ttxoi(m_StrPosEnd.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(tszToken); + st_JsonRoot["PosStart"] = _ttoi(m_StrPosStart.GetBuffer()); + st_JsonRoot["PosEnd"] = _ttoi(m_StrPosEnd.GetBuffer()); //是否加密 TCHAR tszPassBuffer[64]; @@ -106,16 +108,16 @@ void CDialog_Try::OnBnClickedButton1() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -123,10 +125,10 @@ void CDialog_Try::OnBnClickedButton1() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -148,18 +150,18 @@ void CDialog_Try::OnBnClickedButton1() m_ListTry.InsertItem(i, _T("")); - XCHAR tszTmpStr[64] = {}; - _xstprintf(tszTmpStr, _X("%lld"), st_JsonArray["nID"].asInt64()); + TCHAR tszTmpStr[64] = {}; + _stprintf(tszTmpStr, _T("%lld"), st_JsonArray["nID"].asInt64()); m_ListTry.SetItemText(i, 0, tszTmpStr); - m_ListTry.SetItemText(i, 1, st_JsonArray["tszVSerial"].asCString()); - m_ListTry.SetItemText(i, 2, lpszXSerialType[st_JsonArray["enVMode"].asInt()]); - _xstprintf(tszTmpStr, _X("%d"), st_JsonArray["nVTime"].asInt()); + m_ListTry.SetItemText(i, 1, A2W(st_JsonArray["tszVSerial"].asCString())); + m_ListTry.SetItemText(i, 2, A2W(lpszXSerialType[st_JsonArray["enVMode"].asInt()])); + _stprintf(tszTmpStr, _T("%d"), st_JsonArray["nVTime"].asInt()); m_ListTry.SetItemText(i, 3, tszTmpStr); - _xstprintf(tszTmpStr, _X("%d"), st_JsonArray["nLTime"].asInt()); + _stprintf(tszTmpStr, _T("%d"), st_JsonArray["nLTime"].asInt()); m_ListTry.SetItemText(i, 4, tszTmpStr); - m_ListTry.SetItemText(i, 5, st_JsonArray["tszVDate"].asCString()); + m_ListTry.SetItemText(i, 5, A2W(st_JsonArray["tszVDate"].asCString())); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); UpdateWindow(); } @@ -182,34 +184,35 @@ void CDialog_Try::OnBnClickedButton2() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/try/delete"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/try/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonObject["tszVSerial"] = m_StrSerial.GetBuffer(); + st_JsonObject["tszVSerial"] = W2A(m_StrSerial.GetBuffer()); st_JsonRoot["st_VERTemp"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } //查看返回值是否正确 st_JsonRoot.clear(); @@ -218,10 +221,10 @@ void CDialog_Try::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -245,7 +248,7 @@ void CDialog_Try::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("删除临时验证信息失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //需要刷新客户列表 OnBnClickedButton1(); } @@ -306,9 +309,10 @@ void CDialog_Try::OnBnClickedButton3() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/try/modify"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/try/modify"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); Json::Value st_JsonRoot; Json::Value st_JsonObject; @@ -327,28 +331,28 @@ void CDialog_Try::OnBnClickedButton3() st_JsonObject["enVMode"] = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)m_ComboType.GetCurSel(); st_JsonObject["nVTime"] = _ttoi(m_StrTime.GetBuffer()); st_JsonObject["nLTime"] = _ttoi(m_StrLeft.GetBuffer()); - st_JsonObject["tszVSerial"] = m_StrSerail.GetBuffer(); - st_JsonObject["tszVDate"] = m_StrDate.GetBuffer(); + st_JsonObject["tszVSerial"] = W2A(m_StrSerail.GetBuffer()); + st_JsonObject["tszVDate"] = W2A(m_StrDate.GetBuffer()); st_JsonRoot["st_VERTemp"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } //查看返回值是否正确 st_JsonRoot.clear(); @@ -357,10 +361,10 @@ void CDialog_Try::OnBnClickedButton3() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -384,7 +388,7 @@ void CDialog_Try::OnBnClickedButton3() { Authorize_Help_LogPrint(_T("修改临时验证信息失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //需要刷新客户列表 OnBnClickedButton1(); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_User.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_User.cpp index a69bf8009ab359aa90b20a1ea92a0f03b2b25656..acf2d949bfc0921634dc7957037bb3894771c9e4 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_User.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_User.cpp @@ -64,9 +64,9 @@ BOOL CDialog_User::OnInitDialog() m_ListCtrlClient.InsertColumn(8, _T("是否在线"), LVCFMT_LEFT, 60); m_ListCtrlClient.SetExtendedStyle(LVS_EX_FULLROWSELECT); - m_EditFlushTime.SetWindowText("10"); - m_EditPosStart.SetWindowText("0"); - m_EditPosEnd.SetWindowText("50"); + m_EditFlushTime.SetWindowText(_T("10")); + m_EditPosStart.SetWindowText(_T("0")); + m_EditPosEnd.SetWindowText(_T("50")); hUserWnd = m_hWnd; return TRUE; // return true unless you set the focus to a control // 异常: OCX 属性页应返回 false @@ -80,7 +80,7 @@ void CDialog_User::OnBnClickedButton1() TCHAR tszIPAddr[MAX_PATH]; TCHAR tszIPPort[MAX_PATH]; TCHAR tszToken[MAX_PATH]; - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; CString m_StrPosStart; CString m_StrPosEnd; @@ -94,14 +94,14 @@ void CDialog_User::OnBnClickedButton1() ::GetWindowText(::GetDlgItem(hConfigWnd, IDC_EDIT1), tszIPAddr, MAX_PATH); ::GetWindowText(::GetDlgItem(hConfigWnd, IDC_EDIT2), tszIPPort, MAX_PATH); ::GetWindowText(::GetDlgItem(hConfigWnd, IDC_EDIT9), tszToken, MAX_PATH); - - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/client/list"), tszIPAddr, tszIPPort); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/client/list"), W2A(tszIPAddr), W2A(tszIPPort)); int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; Json::Value st_JsonRoot; - st_JsonRoot["xhToken"] = _ttxoll(tszToken); - st_JsonRoot["PosStart"] = _ttxoi(m_StrPosStart.GetBuffer()); - st_JsonRoot["PosEnd"] = _ttxoi(m_StrPosEnd.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(tszToken); + st_JsonRoot["PosStart"] = _ttoi(m_StrPosStart.GetBuffer()); + st_JsonRoot["PosEnd"] = _ttoi(m_StrPosEnd.GetBuffer()); if (BST_CHECKED == m_CheckOnlineList.GetCheck()) { st_JsonRoot["Online"] = true; @@ -117,16 +117,16 @@ void CDialog_User::OnBnClickedButton1() if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } JSONCPP_STRING st_JsonError; Json::CharReaderBuilder st_ReaderBuilder; @@ -134,10 +134,10 @@ void CDialog_User::OnBnClickedButton1() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户列表接口数据错误,无法继续")); @@ -164,12 +164,12 @@ void CDialog_User::OnBnClickedButton1() m_ListCtrlClient.InsertItem(i, _T("")); m_ListCtrlClient.SetItemText(i, 0, tszIndex); - m_ListCtrlClient.SetItemText(i, 1, st_JsonObject["tszUserName"].asCString()); + m_ListCtrlClient.SetItemText(i, 1, A2W(st_JsonObject["tszUserName"].asCString())); if (!st_JsonArray["tszClientAddr"].isNull()) { - m_ListCtrlClient.SetItemText(i, 2, st_JsonArray["tszClientAddr"].asCString()); + m_ListCtrlClient.SetItemText(i, 2, A2W(st_JsonArray["tszClientAddr"].asCString())); } - m_ListCtrlClient.SetItemText(i, 3, lpszXLevelType[st_JsonObject["nUserLevel"].asInt() + 1]); + m_ListCtrlClient.SetItemText(i, 3, A2W(lpszXLevelType[st_JsonObject["nUserLevel"].asInt() + 1])); if (1 == st_JsonObject["nUserState"].asInt()) { @@ -177,15 +177,15 @@ void CDialog_User::OnBnClickedButton1() memset(tszTimeStr, '\0', sizeof(tszTimeStr)); __int64x nTime = st_JsonArray["nOnlineTime"].asUInt64(); - _xstprintf(tszTimeStr, _T("%lld"), nTime); + _stprintf(tszTimeStr, _T("%lld"), nTime); m_ListCtrlClient.SetItemText(i, 4, tszTimeStr); } - m_ListCtrlClient.SetItemText(i, 5, st_JsonArray["tszLeftTime"].asCString()); - m_ListCtrlClient.SetItemText(i, 6, lpszXSerialType[st_JsonArray["enSerialType"].asInt()]); - m_ListCtrlClient.SetItemText(i, 7, lpszXDevType[st_JsonArray["enDeviceType"].asInt()]); + m_ListCtrlClient.SetItemText(i, 5, A2W(st_JsonArray["tszLeftTime"].asCString())); + m_ListCtrlClient.SetItemText(i, 6, A2W(lpszXSerialType[st_JsonArray["enSerialType"].asInt()])); + m_ListCtrlClient.SetItemText(i, 7, A2W(lpszXDevType[st_JsonArray["enDeviceType"].asInt()])); m_ListCtrlClient.SetItemText(i, 8, lpszStuType[st_JsonObject["nUserState"].asInt()]); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); UpdateWindow(); } @@ -210,36 +210,37 @@ void CDialog_User::OnBnClickedButton2() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/client/close"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/client/close"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); st_JsonRoot["st_UserInfo"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } //查看返回值是否正确 st_JsonRoot.clear(); @@ -248,10 +249,10 @@ void CDialog_User::OnBnClickedButton2() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -275,7 +276,7 @@ void CDialog_User::OnBnClickedButton2() { Authorize_Help_LogPrint(_T("关闭客户端失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //剔除客户需要刷新客户列表 OnBnClickedButton1(); } @@ -300,34 +301,35 @@ void CDialog_User::OnBnClickedButton3() pWnd->m_EditIPPort.GetWindowText(m_StrIPPort); pWnd->m_EditToken.GetWindowText(m_StrToken); - TCHAR tszUrlAddr[MAX_PATH]; + XCHAR tszUrlAddr[MAX_PATH]; memset(tszUrlAddr, '\0', MAX_PATH); - _xstprintf(tszUrlAddr, _T("http://%s:%s/auth/client/delete"), m_StrIPAddr.GetBuffer(), m_StrIPPort.GetBuffer()); + USES_CONVERSION; + _xstprintf(tszUrlAddr, _X("http://%s:%s/auth/client/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer())); Json::Value st_JsonRoot; Json::Value st_JsonObject; - st_JsonObject["tszUserName"] = m_StrUser.GetBuffer(); + st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer()); st_JsonRoot["st_UserInfo"] = st_JsonObject; - st_JsonRoot["xhToken"] = _ttxoll(m_StrToken.GetBuffer()); + st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer()); //是否加密 int nMsgLen = 0; - TCHAR* ptszMsgBuffer = NULL; + XCHAR* ptszMsgBuffer = NULL; TCHAR tszPassBuffer[64]; memset(tszPassBuffer, '\0', sizeof(tszPassBuffer)); ::GetDlgItemText(hConfigWnd, IDC_EDIT6, tszPassBuffer, sizeof(tszPassBuffer)); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); nMsgLen = st_JsonRoot.toStyledString().length(); - OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, tszPassBuffer); - APIClient_Http_Request(_T("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); + Cryption_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (UCHAR*)tszMsgBuffer, W2A(tszPassBuffer)); + APIClient_Http_Request(_X("POST"), tszUrlAddr, tszMsgBuffer, NULL, &ptszMsgBuffer, &nMsgLen); } else { - APIClient_Http_Request(_T("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); + APIClient_Http_Request(_X("POST"), tszUrlAddr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen); } //查看返回值是否正确 st_JsonRoot.clear(); @@ -336,10 +338,10 @@ void CDialog_User::OnBnClickedButton3() std::unique_ptr const pSt_JsonReader(st_ReaderBuilder.newCharReader()); if (bCrypto) { - TCHAR tszMsgBuffer[2048]; + XCHAR tszMsgBuffer[2048]; memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, tszPassBuffer); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, W2A(tszPassBuffer)); if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nMsgLen, &st_JsonRoot, &st_JsonError)) { Authorize_Help_LogPrint(_T("解析客户接口数据错误,无法继续")); @@ -363,7 +365,7 @@ void CDialog_User::OnBnClickedButton3() { Authorize_Help_LogPrint(_T("删除客户端失败")); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //需要刷新客户列表 OnBnClickedButton1(); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Help/Authorize_Help.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Help/Authorize_Help.cpp index 8a33cdadb630dda2fb51120ac565d0d6668d4fd0..9fd93de8a6b11b06aca6d9a7e906a11cf9d9794d 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Help/Authorize_Help.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Help/Authorize_Help.cpp @@ -19,7 +19,7 @@ bool Authorize_Help_LogPrint(LPCTSTR lpszLogBuffer) { TCHAR tszLogBuffer[8196]; TCHAR tszAddBuffer[8196]; - TCHAR tszTimeStr[64]; + XCHAR tszTimeStr[64]; memset(tszLogBuffer, '\0', sizeof(tszLogBuffer)); memset(tszAddBuffer, '\0', sizeof(tszAddBuffer)); @@ -27,18 +27,19 @@ bool Authorize_Help_LogPrint(LPCTSTR lpszLogBuffer) ::GetDlgItemText(hMainWnd, IDC_EDIT1, tszAddBuffer, sizeof(tszAddBuffer)); - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + USES_CONVERSION; + BaseLib_Time_TimeToStr(tszTimeStr); if (_tcslen(tszAddBuffer) <= 0) { - _stprintf(tszLogBuffer, _T("%s:%s"), tszTimeStr, lpszLogBuffer); + _stprintf(tszLogBuffer, _T("%s:%s"), A2W(tszTimeStr), lpszLogBuffer); } else if (_tcslen(tszAddBuffer) >= 8196) { - _stprintf(tszLogBuffer, _T("%s:%s"), tszTimeStr, lpszLogBuffer); + _stprintf(tszLogBuffer, _T("%s:%s"), A2W(tszTimeStr), lpszLogBuffer); } else { - _stprintf(tszLogBuffer, _T("%s\r\n%s:%s"), tszAddBuffer, tszTimeStr, lpszLogBuffer); + _stprintf(tszLogBuffer, _T("%s\r\n%s:%s"), tszAddBuffer, A2W(tszTimeStr), lpszLogBuffer); } ::SetDlgItemText(hMainWnd, IDC_EDIT1, tszLogBuffer); return true; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj index fc9971aedc574cab36fe5d9d9ea3d7c5a5fedea9..bb38a8e46deb68101ddac237f5888a5430e8e007 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeApp.vcxproj @@ -30,7 +30,7 @@ Application true v143 - MultiByte + Unicode Dynamic @@ -38,14 +38,14 @@ false v143 true - MultiByte + Unicode Static Application true v143 - MultiByte + Unicode Static @@ -53,7 +53,7 @@ false v143 true - MultiByte + Unicode Static @@ -101,6 +101,8 @@ true WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) pch.h + stdcpp20 + stdc17 Windows @@ -123,6 +125,8 @@ false _WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) pch.h + stdcpp20 + stdc17 Windows @@ -147,6 +151,10 @@ false WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) + MultiThreaded Windows @@ -173,6 +181,9 @@ false _WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) pch.h + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Windows diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeAppDlg.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeAppDlg.cpp index 713599d212a00a804d4b24b1c2cbb030a219e856..5efb9d9d4c0b8188c8de79775f3c30bbf1865c07 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeAppDlg.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/XEngine_AuthorizeAppDlg.cpp @@ -45,7 +45,7 @@ LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) static int i = 0; XCHAR tszFileStr[MAX_PATH] = {}; XCHAR tszTimeStr[128] = {}; - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + BaseLib_Time_TimeToStr(tszTimeStr); _xstprintf(tszFileStr, _X("./XEngine_Coredump/dumpfile_%s_%d.dmp"), tszTimeStr, i++); HANDLE hDumpFile = CreateFileA(tszFileStr, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); @@ -71,6 +71,13 @@ BOOL CXEngineAuthorizeAppDlg::OnInitDialog() // 执行此操作 SetIcon(m_hIcon, true); // 设置大图标 SetIcon(m_hIcon, false); // 设置小图标 +#ifndef _DEBUG + if (setlocale(LC_ALL, ".UTF8") == NULL) + { + AfxMessageBox(_T("Error setting locale.\n")); + return false; + } +#endif // TODO: 在此添加额外的初始化代码 SetUnhandledExceptionFilter(Coredump_ExceptionFilter); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.cpp index 66d3eb68b24592ae32315d027f019f0234d22c7f..5678527ac9ac7fbd2c413236de7bf59eb3d980e1 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.cpp @@ -7,4 +7,4 @@ HWND hMainWnd = NULL; HWND hUserWnd = NULL; HWND hConfigWnd = NULL; bool bCrypto = false; -LPCXSTR lpszStuType[2] = { "离线","在线" }; \ No newline at end of file +LPCTSTR lpszStuType[2] = { _T("离线"),_T("在线") }; \ No newline at end of file diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h index c5ff5cda282b2981468e87da49f71497ecf682d7..bae0cbd3a30b1bd962f7cc4bb47d750e8154cb52 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h @@ -9,7 +9,7 @@ // 添加要在此处预编译的标头 #include "framework.h" - +#include #endif //PCH_H #include #include @@ -20,10 +20,11 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include +#include "../../XAuth_BuildSwitch.h" #include "../../XAuth_Protocol.h" #include "../../AuthorizeModule_Configure/Config_Define.h" #include "../../AuthorizeModule_Configure/Config_Error.h" @@ -46,7 +47,7 @@ extern HWND hMainWnd; extern HWND hUserWnd; extern HWND hConfigWnd; extern bool bCrypto; -extern LPCXSTR lpszStuType[2]; +extern LPCTSTR lpszStuType[2]; #ifdef _DEBUG #ifdef _WIN64 @@ -72,5 +73,5 @@ extern LPCXSTR lpszStuType[2]; #pragma comment(lib,"Dbghelp.lib") #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") #pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") \ No newline at end of file diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.cpp index 3eb4a678db995609e36d294ef89803bc430b6bcf..cf3a8d12da7583d4903ecd5dd67d975e833964a4 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.cpp @@ -11,13 +11,13 @@ bool XEngine_AuthorizeHTTP_GetTask(LPCXSTR lpszClientAddr, XCHAR** pptszList, in LPCXSTR lpszAPINotice = _X("notice"); memset(tszSDBuffer, '\0', sizeof(tszSDBuffer)); - BaseLib_OperatorString_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); + BaseLib_String_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); if (0 == _tcsxnicmp(lpszAPITime, tszURLValue, _tcsxlen(lpszAPITime))) { XCHAR tszUserToken[128]; memset(tszUserToken, '\0', sizeof(tszUserToken)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); AUTHREG_USERTABLE st_UserTable = {}; if (!Session_Token_Get(_ttxoll(tszUserToken), &st_UserTable)) @@ -37,7 +37,7 @@ bool XEngine_AuthorizeHTTP_GetTask(LPCXSTR lpszClientAddr, XCHAR** pptszList, in return false; } Protocol_Packet_UserTime(tszSDBuffer, &nSDLen, &ppSt_ListClient, nListCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,用户名:%s,获取时间成功,用户同时在线数:%d"), lpszClientAddr, st_UserTable.st_UserInfo.tszUserName, nListCount); } @@ -62,7 +62,7 @@ bool XEngine_AuthorizeHTTP_GetTask(LPCXSTR lpszClientAddr, XCHAR** pptszList, in { XCHAR tszUserToken[128]; memset(tszUserToken, '\0', sizeof(tszUserToken)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); AUTHREG_USERTABLE st_UserTable = {}; if (!Session_Token_Get(_ttxoll(tszUserToken), &st_UserTable)) diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_Token.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_Token.cpp index 9ac215077cdb199c7d633a3fd8b138570d9f6d0d..9bc702e225fd68ef06275a7783be1836fafbe1c4 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_Token.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_Token.cpp @@ -13,7 +13,7 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int memset(tszSDBuffer, '\0', sizeof(tszSDBuffer)); memset(tszURLKey, '\0', sizeof(tszURLKey)); memset(tszURLValue, '\0', sizeof(tszURLValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); + BaseLib_String_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); if (0 == _tcsxnicmp(lpszAPILogin, tszURLValue, _tcsxlen(lpszAPILogin))) { @@ -36,9 +36,9 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,登录失败,请求参数不正确"), lpszClientAddr); return false; } - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserName); - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszURLKey, tszUserPass); - BaseLib_OperatorString_GetKeyValue(pptszList[3], "=", tszURLKey, tszDeviceType); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserName); + BaseLib_String_GetKeyValue(pptszList[2], "=", tszURLKey, tszUserPass); + BaseLib_String_GetKeyValue(pptszList[3], "=", tszURLKey, tszDeviceType); //是否启用了动态码 if (st_FunSwitch.bSwitchDCode) { @@ -56,8 +56,8 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int memset(tszTokenStr, '\0', sizeof(tszTokenStr)); memset(tszDCodeStr, '\0', sizeof(tszDCodeStr)); - BaseLib_OperatorString_GetKeyValue(pptszList[4], "=", tszURLKey, tszTokenStr); - BaseLib_OperatorString_GetKeyValue(pptszList[5], "=", tszURLKey, tszDCodeStr); + BaseLib_String_GetKeyValue(pptszList[4], "=", tszURLKey, tszTokenStr); + BaseLib_String_GetKeyValue(pptszList[5], "=", tszURLKey, tszDCodeStr); xhToken = _ttxoll(tszTokenStr); if (!AuthHelp_DynamicCode_Get(xhToken, _ttxoi(tszDCodeStr))) @@ -109,7 +109,7 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int } if (0 == xhToken) { - BaseLib_OperatorHandle_Create(&xhToken); + BaseLib_Handle_Create(&xhToken); } Session_Token_Insert(xhToken, &st_UserTable); Protocol_Packet_HttpToken(tszSDBuffer, &nSDLen, xhToken, st_AuthConfig.st_XVerification.nTokenTimeout); @@ -122,7 +122,7 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int XCHAR tszUserToken[128]; memset(tszUserToken, '\0', sizeof(tszUserToken)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); if (!Session_Token_UPDate(_ttxoll(tszUserToken))) { @@ -141,7 +141,7 @@ bool XEngine_AuthorizeHTTP_Token(LPCXSTR lpszClientAddr, XCHAR** pptszList, int XCHAR tszUserToken[128]; memset(tszUserToken, '\0', sizeof(tszUserToken)); - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); + BaseLib_String_GetKeyValue(pptszList[1], "=", tszURLKey, tszUserToken); //主动关闭 Session_Token_Delete(_ttxoll(tszUserToken)); Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Announcement.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Announcement.cpp index 09841e90e9ad91ec8b26046ab8dd3a3ddb0d7342..879a5036c56847ff56ccbbe547c42317bf4ece43 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Announcement.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Announcement.cpp @@ -91,7 +91,7 @@ bool XEngine_AuthorizeHTTP_Announcement(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIN } Protocol_Packet_HttpAnnouncement(tszSDBuffer, &nSDLen, &ppSt_Announcement, nListCount); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_Announcement, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_Announcement, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,查询公告列表成功,公告个数:%d"), lpszClientAddr, nListCount); } return true; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Banned.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Banned.cpp index be5efdc0fb9ef09cd3c217115d02459fdbb83823..ce7316b25619b9507a8f4ff34c888eb4e7a04136 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Banned.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Banned.cpp @@ -76,8 +76,8 @@ bool XEngine_AuthorizeHTTP_Banned(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L } Protocol_Packet_HttpBanned(tszSDBuffer, &nSDLen, &ppSt_BannedUser, nCountUser, &ppSt_BannedAddr, nCountAddr); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_BannedAddr, nCountAddr); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_BannedUser, nCountUser); + BaseLib_Memory_Free((XPPPMEM)&ppSt_BannedAddr, nCountAddr); + BaseLib_Memory_Free((XPPPMEM)&ppSt_BannedUser, nCountUser); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,查询禁用列表成功,禁用的用户个数:%d,禁用的IP地址个数:%d"), lpszClientAddr, nCountUser, nCountAddr); } else if (0 == _tcsxnicmp(lpszAPIModify, lpszAPIName, _tcsxlen(lpszAPIModify))) diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_CDKey.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_CDKey.cpp index 5edd7eb7f010f5472d7c992cd2d723d33b735926..5441249bfccc3588e44a3dae42ec3f021df79a98 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_CDKey.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_CDKey.cpp @@ -39,15 +39,15 @@ bool XEngine_AuthorizeHTTP_CDKey(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, LP st_Authorize.st_AuthSerial.st_DataLimit.bTimeAdd = false; _tcsxcpy(st_Authorize.st_AuthSerial.st_DataLimit.tszDataSerial, pptszSerialList[1]); XCHAR tszTimeStr[128] = {}; - XENGINE_LIBTIMER st_LibTime = {}; - BaseLib_OperatorTime_GetSysTime(&st_LibTime); + XENGINE_LIBTIME st_LibTime = {}; + BaseLib_Time_GetSysTime(&st_LibTime); st_LibTime.wYear += 1; //一年后过期 - BaseLib_OperatorTime_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); + BaseLib_Time_TimeToStr(tszTimeStr, NULL, true, &st_LibTime); _tcsxcpy(st_Authorize.st_AuthSerial.st_DataLimit.tszDataTime, tszTimeStr); _tcsxcpy(st_Authorize.st_AuthSerial.st_UNLimit.tszUNLimitSerial, pptszSerialList[2]); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszSerialList, nSerialCount); + BaseLib_Memory_Free((XPPPMEM)&pptszSerialList, nSerialCount); } if (!Authorize_CDKey_WriteMemory(tszRVBuffer, &nRVLen, &st_Authorize)) @@ -69,10 +69,10 @@ bool XEngine_AuthorizeHTTP_CDKey(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, LP //授权 if (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE_CUSTOM == st_Authorize.st_AuthRegInfo.enSerialType) { - XENGINE_LIBTIMER st_LibTime; - memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIMER)); + XENGINE_LIBTIME st_LibTime; + memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_StrToTime(st_Authorize.st_AuthRegInfo.tszLeftTime, &st_LibTime); + BaseLib_Time_StrToTime(st_Authorize.st_AuthRegInfo.tszLeftTime, &st_LibTime); Authorize_CDKey_BuildKeyTime(&st_Authorize, 0, &st_LibTime); } else diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Client.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Client.cpp index 3ebdbc345a484f974559bde3aa3f37f9c7de9f6c..f5d8abe7db52e6a00bbc083a72df1f70d2f88de9 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Client.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Client.cpp @@ -84,8 +84,8 @@ bool XEngine_AuthorizeHTTP_Client(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L } Protocol_Packet_HttpClientList(ptszMsgBuffer, &nSDLen, &ppSt_ListClient, nOnCount, &ppSt_UserInfo, nOffCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nOnCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_UserInfo, nOffCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nOnCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_UserInfo, nOffCount); XEngine_Client_TaskSend(lpszClientAddr, ptszMsgBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); free(ptszMsgBuffer); ptszMsgBuffer = NULL; @@ -110,7 +110,7 @@ bool XEngine_AuthorizeHTTP_Client(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L { XEngine_CloseClient(ppSt_ListClient[i]->tszClientAddr, true); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); 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,请求剔除用户:%s 成功,在线用户数:%d"), lpszClientAddr, st_UserInfo.tszUserName, nListCount); @@ -126,9 +126,9 @@ bool XEngine_AuthorizeHTTP_Client(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L { int nPLen = _tcsxlen(st_UserTable.st_UserInfo.tszUserPass); XBYTE byMD5Buffer[MAX_PATH] = {}; - OPenSsl_Api_Digest(st_UserTable.st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); + Cryption_Api_Digest(st_UserTable.st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); memset(st_UserTable.st_UserInfo.tszUserPass, '\0', sizeof(st_UserTable.st_UserInfo.tszUserPass)); - BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); + BaseLib_String_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); } bool bSuccess = false; if (0 == st_AuthConfig.st_XSql.nDBType) @@ -164,7 +164,7 @@ bool XEngine_AuthorizeHTTP_Client(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L { XEngine_CloseClient(ppSt_ListClient[i]->tszClientAddr, true); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); //删除数据库 bool bSuccess = false; if (0 == st_AuthConfig.st_XSql.nDBType) diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Serial.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Serial.cpp index 49eea32ac6232cf5e0a7941e67d4adf9dfb276e8..7b3031923ec1340a497ddde73821512ecaf1351e 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Serial.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Serial.cpp @@ -41,7 +41,7 @@ bool XEngine_AuthorizeHTTP_Serial(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L DBModule_MySQL_SerialQueryAll(&ppSt_SerialTable, &nListCount, nPosStart, nPosEnd); } Protocol_Packet_HttpSerialList(ptszMsgBuffer, &nSDLen, &ppSt_SerialTable, nListCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); XEngine_Client_TaskSend(lpszClientAddr, ptszMsgBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); free(ptszMsgBuffer); ptszMsgBuffer = NULL; @@ -52,7 +52,7 @@ bool XEngine_AuthorizeHTTP_Serial(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L int nNumberCount = 0; int nSerialCount = 0; XCHAR tszHasTime[128]; - XENGINE_LIBTIMER st_AuthTimer; + XENGINE_LIBTIME st_AuthTimer; ENUM_AUTHORIZE_MODULE_SERIAL_TYPE enSerialType; memset(&st_AuthTimer, '\0', sizeof(st_AuthTimer)); @@ -114,7 +114,7 @@ bool XEngine_AuthorizeHTTP_Serial(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L DBModule_MySQL_SerialInsert(pptszSerialNumber[i]); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszSerialNumber, nSerialCount); + BaseLib_Memory_Free((XPPPMEM)&pptszSerialNumber, nSerialCount); 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"), lpszClientAddr, nSerialCount); @@ -139,7 +139,7 @@ bool XEngine_AuthorizeHTTP_Serial(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L DBModule_MySQL_SerialDelete(ppSt_SerialTable[i]->tszSerialNumber); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); 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"), lpszClientAddr, nListCount); @@ -164,7 +164,7 @@ bool XEngine_AuthorizeHTTP_Serial(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L DBModule_MySQL_SerialPush(ppSt_SerialTable[i]); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_SerialTable, nListCount); 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"), lpszClientAddr, nListCount); diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Try.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Try.cpp index ac5b3ba7234cfa5f053a4ffe9694cdebd5a7bee1..30e64285aa2b761b61099db2ead8bc76e4ffa267 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Try.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Try.cpp @@ -38,7 +38,7 @@ bool XEngine_AuthorizeHTTP_Try(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, LPCX DBModule_MySQL_TryList(&ppSt_AuthVer, &nListCount); } Protocol_Packet_HttpTryList(ptszMsgBuffer, &nSDLen, &ppSt_AuthVer, nListCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_AuthVer, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_AuthVer, nListCount); XEngine_Client_TaskSend(lpszClientAddr, ptszMsgBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); free(ptszMsgBuffer); ptszMsgBuffer = NULL; diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_User.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_User.cpp index 5d9d7e7c3648136acaae234d1b7a4b0e74771534..b3a4b622507df1939bd8e51699be2d4d685dea54 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_User.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_User.cpp @@ -67,7 +67,7 @@ bool XEngine_AuthorizeHTTP_User(XNETHANDLE xhToken, LPCXSTR lpszClientAddr, LPCX { XEngine_CloseClient(ppSt_ListClient[i]->tszClientAddr, true); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); @@ -132,9 +132,9 @@ bool XEngine_AuthorizeHTTP_User(XNETHANDLE xhToken, LPCXSTR lpszClientAddr, LPCX { int nPLen = _tcsxlen(st_UserTable.st_UserInfo.tszUserPass); XBYTE byMD5Buffer[MAX_PATH] = {}; - OPenSsl_Api_Digest(st_UserTable.st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); + Cryption_Api_Digest(st_UserTable.st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); memset(st_UserTable.st_UserInfo.tszUserPass, '\0', sizeof(st_UserTable.st_UserInfo.tszUserPass)); - BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); + BaseLib_String_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); } if (0 == st_AuthConfig.st_XSql.nDBType) @@ -249,9 +249,9 @@ bool XEngine_AuthorizeHTTP_User(XNETHANDLE xhToken, LPCXSTR lpszClientAddr, LPCX //开启了,密码重置 int nPLen = _tcsxlen(st_UserInfo.tszUserPass); XBYTE byMD5Buffer[MAX_PATH] = {}; - OPenSsl_Api_Digest(st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); + Cryption_Api_Digest(st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec); memset(st_UserTable.st_UserInfo.tszUserPass, '\0', sizeof(st_UserTable.st_UserInfo.tszUserPass)); - BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); + BaseLib_String_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass); //重置密码 if (0 == st_AuthConfig.st_XSql.nDBType) { @@ -318,19 +318,19 @@ bool XEngine_AuthorizeHTTP_User(XNETHANDLE xhToken, LPCXSTR lpszClientAddr, LPCX } else { - XENGINE_LIBTIMER st_TimeStart = {}; - XENGINE_LIBTIMER st_TimeEnd = {}; + XENGINE_LIBTIME st_TimeStart = {}; + XENGINE_LIBTIME st_TimeEnd = {}; XCHAR tszTimeStart[128] = {}; XCHAR tszTimeEnd[128] = {}; //时间戳转换 - BaseLib_OperatorTime_StrToTime(st_VERTemp.tszVDate, &st_TimeStart); + BaseLib_Time_StrToTime(st_VERTemp.tszVDate, &st_TimeStart); st_TimeEnd.wDay = st_VERTemp.nVTime; //得到超时时间 - BaseLib_OperatorTimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); - BaseLib_OperatorTime_TimeToStr(tszTimeEnd, NULL, true, &st_TimeEnd); + BaseLib_TimeSpan_CalForStu(&st_TimeStart, &st_TimeEnd); + BaseLib_Time_TimeToStr(tszTimeEnd, NULL, true, &st_TimeEnd); //计算时间差 - BaseLib_OperatorTime_TimeToStr(tszTimeStart); - BaseLib_OperatorTimeSpan_GetForStr(tszTimeStart, tszTimeEnd, &nTimeSpan); + BaseLib_Time_TimeToStr(tszTimeStart); + BaseLib_TimeSpan_GetForStr(tszTimeStart, tszTimeEnd, &nTimeSpan); st_VERTemp.nLTime = (int)nTimeSpan; } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h index 2e41e388c105f9b249db19435868fc9507f4cd06..4adc215ec0b93d7be576df08e49a4885e332c656 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Hdr.h @@ -2,6 +2,7 @@ #ifdef _WINDOWS #include #include +#include #include #else #include @@ -27,20 +28,23 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include +#include +#include #include #include #include #include +#include +#include #include #include #include #include -#include -#include +#include "../../XAuth_BuildSwitch.h" #include "../../XAuth_Protocol.h" #include "../../AuthorizeModule_Configure/Config_Define.h" #include "../../AuthorizeModule_Configure/Config_Error.h" @@ -146,8 +150,9 @@ extern XENGINE_FUNCTIONSWITCH st_FunSwitch; #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_OPenSsl.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") diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp index 42d79f9c5f37c6fd2a0ef91f0cf571d615e8367b..93e1108100b142d174ed6a1191f9ecbae78be65e 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_HttpTask.cpp @@ -33,7 +33,7 @@ XHTHREAD CALLBACK XEngine_AuthService_HttpThread(XPVOID lParam) memset(tszDeBuffer, '\0', sizeof(tszDeBuffer)); _xstprintf(tszPassword, _X("%d"), st_AuthConfig.st_XCrypto.nPassword); - OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); + Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); XEngine_Client_HttpTask(ppSt_ListClient[i]->tszClientAddr, tszDeBuffer, nMsgLen, &st_HTTPParament); } else @@ -41,9 +41,9 @@ XHTHREAD CALLBACK XEngine_AuthService_HttpThread(XPVOID lParam) XEngine_Client_HttpTask(ppSt_ListClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_HTTPParament); } } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); } return 0; } @@ -60,7 +60,7 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int AUTHREG_BANNED st_Banned; memset(&st_Banned, '\0', sizeof(AUTHREG_BANNED)); _tcsxcpy(st_Banned.tszIPAddr, lpszClientAddr); - BaseLib_OperatorIPAddr_SegAddr(st_Banned.tszIPAddr); + APIAddr_IPAddr_SegAddr(st_Banned.tszIPAddr); //是否在黑名单 bool bSuccess = false; @@ -240,7 +240,7 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int { Protocol_Packet_HttpComm(tszSDBuffer, &nSDLen, 400, "request is failed"); XEngine_Client_TaskSend(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_AUTH_APP_NETTYPE_HTTP); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, pSt_HTTPParament->tszHttpUri); return false; } @@ -250,7 +250,7 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int memset(tszURLKey, '\0', sizeof(tszURLKey)); memset(tszURLValue, '\0', sizeof(tszURLValue)); - BaseLib_OperatorString_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); + BaseLib_String_GetKeyValue(pptszList[0], "=", tszURLKey, tszURLValue); if (0 == _tcsxnicmp(lpszAPIVerDCode, tszURLValue, _tcsxlen(lpszAPIVerDCode)) || 0 == _tcsxnicmp(lpszAPIVerTime, tszURLValue, _tcsxlen(lpszAPIVerTime)) || 0 == _tcsxnicmp(lpszAPIVerNotice, tszURLValue, _tcsxlen(lpszAPIVerNotice))) { @@ -260,7 +260,7 @@ bool XEngine_Client_HttpTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int { XEngine_AuthorizeHTTP_Token(lpszClientAddr, pptszList, nListCount); } - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszList, nListCount); } else { diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp index cde4200e00e8453970829c06c04f504d2675b4b9..feb11b3e582877410b38b0379aa6c62ff834d639 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp @@ -157,7 +157,7 @@ bool XEngine_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("客户端:%s,网络类型:%d 发送数据失败,内存申请失败,错误码:%d"), lpszClientAddr, nNetType, errno); return false; } - OPenSsl_XCrypto_Encoder(lpszMsgBuffer, &nMsgLen, (XBYTE*)ptszCodecBuffer, lpszPass); + Cryption_XCrypto_Encoder(lpszMsgBuffer, &nMsgLen, (XBYTE*)ptszCodecBuffer, lpszPass); RfcComponents_WSCodec_EncodeMsg(ptszCodecBuffer, ptszMsgBuffer, &nMsgLen, ENUM_XENGINE_RFCOMPONENTS_WEBSOCKET_OPCODE_TEXT); ManagePool_Memory_Free(xhMemPool, ptszCodecBuffer); ptszCodecBuffer = NULL; @@ -189,7 +189,7 @@ bool XEngine_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, return false; } - OPenSsl_XCrypto_Encoder(lpszMsgBuffer, &nMsgLen, (XBYTE*)ptszCodecBuffer, lpszPass); + Cryption_XCrypto_Encoder(lpszMsgBuffer, &nMsgLen, (XBYTE*)ptszCodecBuffer, lpszPass); HttpProtocol_Server_SendMsgEx(xhHttpPacket, ptszMsgBuffer, &nSDSize, &st_HDRParam, ptszCodecBuffer, nMsgLen); ManagePool_Memory_Free(xhMemPool, ptszCodecBuffer); } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp index 5b8faad8730370a1e71cb5aa34aa5983655a4e55..1fc5987debf794a8bdad3e91c20e11436c6ad852 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_TCPTask.cpp @@ -36,7 +36,7 @@ XHTHREAD CALLBACK XEngine_AuthService_TCPThread(XPVOID lParam) memset(tszDeBuffer, '\0', sizeof(tszDeBuffer)); _xstprintf(tszPassword, _X("%d"), st_AuthConfig.st_XCrypto.nPassword); - OPenSsl_XCrypto_Decoder(tszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); + Cryption_XCrypto_Decoder(tszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); XEngine_Client_TCPTask(ppSt_ListClient[i]->tszClientAddr, tszDeBuffer, nMsgLen, &st_ProtocolHdr, XENGINE_AUTH_APP_NETTYPE_TCP); } else @@ -44,7 +44,7 @@ XHTHREAD CALLBACK XEngine_AuthService_TCPThread(XPVOID lParam) XEngine_Client_TCPTask(ppSt_ListClient[i]->tszClientAddr, tszMsgBuffer, nMsgLen, &st_ProtocolHdr, XENGINE_AUTH_APP_NETTYPE_TCP); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); } return 0; } @@ -81,7 +81,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n _tcsxcpy(st_Banned.tszIPAddr, lpszClientAddr); _tcsxcpy(st_Banned.tszUserName, st_AuthProtocol.tszUserName); - BaseLib_OperatorIPAddr_SegAddr(st_Banned.tszIPAddr); + APIAddr_IPAddr_SegAddr(st_Banned.tszIPAddr); //是否在黑名单 bool bSuccess = false; if (0 == st_AuthConfig.st_XSql.nDBType) @@ -150,7 +150,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n return false; } Protocol_Parse_HttpParseTable(ptszMsgBuffer, nHTTPLen, &st_UserTable); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -223,7 +223,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n return false; } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); //对多端登录的类型进行验证 if (bLogin && st_FunSwitch.bSwitchMulti) { @@ -310,7 +310,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n //如果不匹配 __int64x nTime = _ttxoll(st_UserTable.tszLeftTime) - 1; _xstprintf(st_UserTable.tszLeftTime, _X("%lld"), nTime); - BaseLib_OperatorTime_TimeToStr(st_UserTable.st_UserInfo.tszLoginTime); + BaseLib_Time_TimeToStr(st_UserTable.st_UserInfo.tszLoginTime); if (0 == st_AuthConfig.st_XSql.nDBType) { DBModule_SQLite_UserSet(&st_UserTable); @@ -324,7 +324,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n //创建一个普通TOKEN if (pSt_ProtocolHdr->xhToken < 10000000 || pSt_ProtocolHdr->xhToken > 20000000) { - BaseLib_OperatorHandle_Create(&pSt_ProtocolHdr->xhToken, 10000000, 20000000); + BaseLib_Handle_Create(&pSt_ProtocolHdr->xhToken, 10000000, 20000000); } st_UserTable.enDeviceType = st_AuthProtocol.enDeviceType; if (!Session_Authorize_Insert(lpszClientAddr, &st_UserTable, pSt_ProtocolHdr->xhToken, nNetType)) diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_WSTask.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_WSTask.cpp index 9062bc2f0e512a7ed95dfcf3b0ab832899fb3ea6..87b9cb9a5cff1c0c605142158503034e29a8d0c8 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_WSTask.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_WSTask.cpp @@ -34,7 +34,7 @@ XHTHREAD CALLBACK XEngine_AuthService_WSThread(XPVOID lParam) memset(tszDeBuffer, '\0', sizeof(tszDeBuffer)); _xstprintf(tszPassword, _X("%d"), st_AuthConfig.st_XCrypto.nPassword); - OPenSsl_XCrypto_Decoder(tszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); + Cryption_XCrypto_Decoder(tszMsgBuffer, &nMsgLen, tszDeBuffer, tszPassword); XEngine_Client_WSTask(ppSt_ListClient[i]->tszClientAddr, tszDeBuffer, nMsgLen, enOPCode); } else @@ -42,7 +42,7 @@ XHTHREAD CALLBACK XEngine_AuthService_WSThread(XPVOID lParam) XEngine_Client_WSTask(ppSt_ListClient[i]->tszClientAddr, tszMsgBuffer, nMsgLen, enOPCode); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount); } return 0; } diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Makefile b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Makefile index 3a809762889c38996e026e288d634b3713233eb0..9e0dafc314d71b9225e5eba476886618e9ed0d67 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Makefile +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Makefile @@ -1,4 +1,4 @@ -CC = g++ -Wall -std=c++17 +CC = g++ -Wall -std=c++20 PLATFORM = linux PLATVER = PLATDIR = @@ -10,7 +10,7 @@ LOADHDR = -I ./ LOADSO = -L ../../XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Depend/XEngine_Module/XEngine_InfoReport \ -L ../../AuthorizeModule_Session -L ../../AuthorizeModule_Database -L ../../AuthorizeModule_Protocol -L ../../AuthorizeModule_Configure -L ../../AuthorizeModule_Help -L ../../AuthorizeModule_CDKey LIB = -lXEngine_InfoReport -ljsoncpp \ - -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lXClient_APIHelp -lHelpComponents_Packets -lHelpComponents_DataBase -lHelpComponents_XLog -lRfcComponents_WSProtocol -lRfcComponents_HttpProtocol -lXEngine_ProcFile -lXEngine_SystemApi \ + -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_Cryption -lXClient_APIHelp -lNetHelp_APIAddr -lHelpComponents_Packets -lHelpComponents_DataBase -lHelpComponents_XLog -lRfcComponents_WSProtocol -lRfcComponents_HttpProtocol -lXEngine_ProcFile -lXEngine_SystemApi \ -lAuthorizeModule_Session -lAuthorizeModule_Database -lAuthorizeModule_Protocol -lAuthorizeModule_Configure -lAuthorizeModule_Help -lAuthorizeModule_CDKey LIBEX = OBJECTS = Authorize_Config.o Authorize_Net.o Authorize_Task.o Authorize_TCPTask.o Authorize_WSTask.o Authorize_HttpTask.o XEngine_AuthorizeService.o \ diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp index 3c60a12a27f50a71abfcba89e226bddffad96106..b2dff857de5493ac969ab4ed1d950df0596d95c3 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp @@ -100,7 +100,7 @@ LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) static int i = 0; XCHAR tszFileStr[MAX_PATH] = {}; XCHAR tszTimeStr[128] = {}; - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + BaseLib_Time_TimeToStr(tszTimeStr); _xstprintf(tszFileStr, _X("./XEngine_Coredump/dumpfile_%s_%d.dmp"), tszTimeStr, i++); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_FATAL, _X("主程序:软件崩溃,写入dump:%s"), tszFileStr); @@ -125,6 +125,13 @@ int main(int argc, char** argv) WSAStartup(MAKEWORD(2, 2), &st_WSAData); SetUnhandledExceptionFilter(Coredump_ExceptionFilter); +#ifndef _DEBUG + if (setlocale(LC_ALL, ".UTF8") == NULL) + { + fprintf(stderr, "Error setting locale.\n"); + return 1; + } +#endif #endif bIsRun = true; int nRet = -1; @@ -236,7 +243,7 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化TCP验证网络事件成功")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListTCPThread, st_AuthConfig.st_XMax.nTCPThread, sizeof(THREADPOOL_PARAMENT)); + 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++) { int* pInt_Index = new int; @@ -268,7 +275,7 @@ 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验证网络事件成功")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListWSThread, st_AuthConfig.st_XMax.nWSThread, sizeof(THREADPOOL_PARAMENT)); + 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++) { int* pInt_Index = new int; @@ -300,7 +307,7 @@ 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管理网络事件成功")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListHttpThread, st_AuthConfig.st_XMax.nHTTPThread, sizeof(THREADPOOL_PARAMENT)); + 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++) { int* pInt_Index = new int; @@ -321,7 +328,7 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,加密传输设置为关闭,采用明文传输")); } //发送信息报告 - if (st_AuthConfig.st_XReport.bEnable) + if (st_AuthConfig.st_XReport.bEnable && !bIsTest) { if (InfoReport_APIMachine_Send(st_AuthConfig.st_XReport.tszAPIUrl, st_AuthConfig.st_XReport.tszServiceName)) { @@ -361,7 +368,7 @@ int main(int argc, char** argv) int nRet = fread(tszENCodecBuffer, 1, sizeof(tszENCodecBuffer), pSt_File); fclose(pSt_File); - if (OPenSsl_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, st_AuthConfig.st_XVerification.st_XCDKey.tszKeyPass)) + if (Cryption_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, st_AuthConfig.st_XVerification.st_XCDKey.tszKeyPass)) { Authorize_CDKey_ReadMemory(tszDECodecBuffer, nRet, &st_AuthLocal); bool bRet = Authorize_CDKey_GetLeftTimer(&st_AuthLocal); @@ -369,7 +376,7 @@ int main(int argc, char** argv) memset(tszENCodecBuffer, '\0', sizeof(tszENCodecBuffer)); memset(tszDECodecBuffer, '\0', sizeof(tszDECodecBuffer)); Authorize_CDKey_WriteMemory(tszDECodecBuffer, &nRet, &st_AuthLocal); - OPenSsl_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, st_AuthConfig.st_XVerification.st_XCDKey.tszKeyPass); + Cryption_XCrypto_Encoder(tszDECodecBuffer, &nRet, (XBYTE*)tszENCodecBuffer, st_AuthConfig.st_XVerification.st_XCDKey.tszKeyPass); pSt_File = _xtfopen(st_AuthConfig.st_XVerification.st_XCDKey.tszKeyFile, _X("wb")); fwrite(tszENCodecBuffer, 1, nRet, pSt_File); fclose(pSt_File); @@ -388,7 +395,7 @@ int main(int argc, char** argv) } } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,网络验证服务运行中,XEngien版本:%s%s,发行版本次数:%d,当前运行版本:%s。。。"), BaseLib_OperatorVer_XNumberStr(), BaseLib_OperatorVer_XTypeStr(), st_AuthConfig.st_XVer.pStl_ListVer->size(), st_AuthConfig.st_XVer.pStl_ListVer->front().c_str()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,网络验证服务运行中,XEngien版本:%s%s,发行版本次数:%d,当前运行版本:%s。。。"), BaseLib_Version_XNumberStr(), BaseLib_Version_XTypeStr(), st_AuthConfig.st_XVer.pStl_ListVer->size(), st_AuthConfig.st_XVer.pStl_ListVer->front().c_str()); while (true) { diff --git a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj index 87ca55e9796b85451b50cb324c05499006175f06..fa6569347b03f0828f510ad724d98102a1b27109 100644 --- a/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj +++ b/XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.vcxproj @@ -37,7 +37,7 @@ false v143 true - MultiByte + Unicode Application @@ -50,7 +50,7 @@ false v143 true - MultiByte + Unicode @@ -97,6 +97,8 @@ WIN32;_DEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true 4819 + stdcpp20 + stdc17 Console @@ -112,6 +114,9 @@ WIN32;NDEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true 4819 + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Console @@ -126,6 +131,8 @@ false _DEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true + stdcpp20 + stdc17 Console @@ -140,7 +147,10 @@ false NDEBUG;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true - MultiThreaded + MultiThreadedDLL + stdcpp20 + stdc17 + /utf-8 %(AdditionalOptions) Console diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend index 1c1452f13720d22834e09c7e4e78042698411486..bcf8d946890a2f2fb39eec16e64a634a8ece52c7 160000 --- a/XEngine_Source/XEngine_Depend +++ b/XEngine_Source/XEngine_Depend @@ -1 +1 @@ -Subproject commit 1c1452f13720d22834e09c7e4e78042698411486 +Subproject commit bcf8d946890a2f2fb39eec16e64a634a8ece52c7