├── .gitattributes ├── .github └── workflows │ └── windows.yml ├── .gitignore ├── GenshinImpactNaturalLaw.sln ├── GenshinImpactNaturalLaw ├── 3rdpart │ └── cpr │ │ ├── include │ │ ├── cpr │ │ │ ├── accept_encoding.h │ │ │ ├── api.h │ │ │ ├── async.h │ │ │ ├── auth.h │ │ │ ├── bearer.h │ │ │ ├── body.h │ │ │ ├── buffer.h │ │ │ ├── callback.h │ │ │ ├── cert_info.h │ │ │ ├── connect_timeout.h │ │ │ ├── cookies.h │ │ │ ├── cpr.h │ │ │ ├── cprtypes.h │ │ │ ├── cprver.h │ │ │ ├── curl_container.h │ │ │ ├── curlholder.h │ │ │ ├── error.h │ │ │ ├── file.h │ │ │ ├── http_version.h │ │ │ ├── interceptor.h │ │ │ ├── interface.h │ │ │ ├── limit_rate.h │ │ │ ├── local_port.h │ │ │ ├── local_port_range.h │ │ │ ├── low_speed.h │ │ │ ├── multipart.h │ │ │ ├── parameters.h │ │ │ ├── payload.h │ │ │ ├── proxies.h │ │ │ ├── proxyauth.h │ │ │ ├── range.h │ │ │ ├── redirect.h │ │ │ ├── reserve_size.h │ │ │ ├── response.h │ │ │ ├── session.h │ │ │ ├── singleton.h │ │ │ ├── ssl_ctx.h │ │ │ ├── ssl_options.h │ │ │ ├── status_codes.h │ │ │ ├── threadpool.h │ │ │ ├── timeout.h │ │ │ ├── unix_socket.h │ │ │ ├── user_agent.h │ │ │ ├── util.h │ │ │ └── verbose.h │ │ ├── curl │ │ │ ├── curl.h │ │ │ ├── curlver.h │ │ │ ├── easy.h │ │ │ ├── header.h │ │ │ ├── mprintf.h │ │ │ ├── multi.h │ │ │ ├── options.h │ │ │ ├── stdcheaders.h │ │ │ ├── system.h │ │ │ ├── typecheck-gcc.h │ │ │ └── urlapi.h │ │ └── nghttp2 │ │ │ ├── nghttp2.h │ │ │ └── nghttp2ver.h │ │ └── lib │ │ ├── cpr.lib │ │ ├── cprd.lib │ │ ├── libcurl.lib │ │ ├── libcurld.lib │ │ ├── nghttp2.lib │ │ ├── nghttp2d.lib │ │ ├── zlib.lib │ │ └── zlibd.lib ├── GenshinImpactNaturalLaw.cpp ├── GenshinImpactNaturalLaw.h ├── GenshinImpactNaturalLaw.pro ├── GenshinImpactNaturalLaw.qrc ├── GenshinImpactNaturalLaw.ui ├── GenshinImpactNaturalLaw.vcxproj ├── GenshinImpactNaturalLaw.vcxproj.filters ├── GenshinImpactNaturalLawIcon.rc ├── ModulesManager.cpp ├── ModulesManager.h ├── Package.appxmanifest ├── QtWidgetsMessageBox.cpp ├── QtWidgetsMessageBox.h ├── QtWidgetsMessageBox.qrc ├── QtWidgetsMessageBox.ui ├── QtWidgetsSetting.cpp ├── QtWidgetsSetting.h ├── QtWidgetsSetting.qrc ├── QtWidgetsSetting.ui ├── SettingData.cpp ├── SettingData.h ├── SingleApplication.cpp ├── SingleApplication.h ├── SingleApplicationPrivate.cpp ├── SingleApplicationPrivate.h ├── VersionNumber.cpp ├── VersionNumber.h ├── assets │ ├── logo_150x150.png │ ├── logo_44x44.png │ ├── logo_620x300.png │ └── logo_store.png ├── config.ini ├── define │ ├── Api.h │ └── ProjectInfo.h ├── genshinimpactnaturallaw_zh.qm ├── genshinimpactnaturallaw_zh.ts ├── main.cpp ├── resource.h ├── resource │ ├── LinkeIcon │ │ ├── Bilibili.png │ │ ├── Bilibili_icon.png │ │ ├── GitHub_icon - 副本.png │ │ ├── GitHub_icon.png │ │ ├── KYJG_yuanshen - 副本.png │ │ ├── KYJG_yuanshen.png │ │ ├── QQ_icon - 副本.png │ │ └── QQ_icon.png │ ├── QMessageBox │ │ └── bg.png │ ├── QtWidgetsSetting │ │ ├── CheckBox │ │ │ ├── checkbox_checked.png │ │ │ ├── checkbox_checked_hover.png │ │ │ ├── checkbox_checked_pressed.png │ │ │ ├── checkbox_unchecked.png │ │ │ ├── checkbox_unchecked_hover.png │ │ │ └── checkbox_unchecked_pressed.png │ │ ├── Exit │ │ │ ├── exit0.png │ │ │ └── exit1.png │ │ ├── RadioButton │ │ │ ├── radiobutton_checked.png │ │ │ ├── radiobutton_checked_hover.png │ │ │ ├── radiobutton_checked_pressed.png │ │ │ ├── radiobutton_unchecked.png │ │ │ ├── radiobutton_unchecked_hover.png │ │ │ └── radiobutton_unchecked_pressed.png │ │ ├── UI │ │ │ └── title.png │ │ └── bg.png │ ├── bg.png │ ├── icon │ │ ├── ICON.png │ │ ├── MainIcon - 副本.ico │ │ ├── MainIcon.ico │ │ ├── MainIcon.jpg │ │ ├── TrayIcon.ico │ │ ├── TrayIcon.png │ │ ├── icon - 副本.ico │ │ ├── v2-5c760ea50961ac657477ce0162939e57_hd.png │ │ └── 未标题-1.psd │ ├── page │ │ ├── Snipaste_2021-07-25_03-20-53.png │ │ ├── page1.png │ │ └── page2.png │ └── titlebutton │ │ ├── bexit0.png │ │ ├── bexit1.png │ │ ├── bmin0.png │ │ ├── bmin1.png │ │ ├── bset0.png │ │ └── bset1.png └── version │ ├── Version.h │ ├── update_version.bat │ ├── version.branch │ ├── version.ver │ └── version_hash.hash ├── README.md └── appveyor.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | env: 10 | # Path to the solution file relative to the root of the project. 11 | SOLUTION_FILE_PATH: . 12 | 13 | BUILD_CONFIGURATION: Release 14 | 15 | 16 | permissions: 17 | contents: read 18 | 19 | jobs: 20 | build: 21 | runs-on: windows-latest 22 | env: 23 | # 需要两个机密: 24 | # 1. ALICLOUD_CLI_UPADTE_CONFIGYAML 文件上传配置 25 | # 2. UPDATE_ARTIFACT_TOKEN 版本更新token 26 | # PROJECT_NAME: GenshinImpactNaturalLaw 27 | # PROJECT_BUILD_NAME: 天理启动器 28 | Qt_Dir_Static : D:/a/GenshinImpactNaturalLaw/GenshinImpactNaturalLaw/deps_qt/5.15.7/ 29 | ProjectName: GenshinImpactNaturalLaw 30 | steps: 31 | - uses: actions/checkout@v3 32 | - name: Add Deps_Qt 33 | run: | 34 | git clone http://github.com/GenshinTianLiBattle/deps_qt.git 35 | cd deps_qt 36 | .\unzip.bat 37 | Copy-Item -Path "openssl" -Destination "C:\" -Recurse 38 | dir 39 | cd .. 40 | dir 41 | copy deps_qt/QtMsBuild.7z GenshinImpactNaturalLaw/ 42 | copy deps_qt/7z.exe GenshinImpactNaturalLaw/ 43 | copy deps_qt/7z.dll GenshinImpactNaturalLaw/ 44 | cd GenshinImpactNaturalLaw 45 | 7z.exe x QtMsBuild.7z 46 | 47 | - name: Add MSBuild to PATH 48 | uses: microsoft/setup-msbuild@v1.1.3 49 | 50 | - name: Build 51 | working-directory: ${{env.GITHUB_WORKSPACE}} 52 | run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} 53 | 54 | - name: Test Version 55 | run: | 56 | .\x64\${{env.BUILD_CONFIGURATION}}\天理启动器.exe -V 57 | .\x64\${{env.BUILD_CONFIGURATION}}\天理启动器.exe -v | out-file version.ver 58 | .\x64\${{env.BUILD_CONFIGURATION}}\天理启动器.exe -V | out-file build_version.ver 59 | - name: Make Zip Pkg 60 | run: | 61 | $version = Get-Content version.ver 62 | echo (Get-Content build_version.ver) 63 | .\GenshinImpactNaturalLaw\7z.exe a -tZip 天理启动器-$version.zip D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/x64\${{env.BUILD_CONFIGURATION}}\天理启动器.exe 64 | dir 65 | (Get-FileHash -Path 天理启动器-$version.zip -Algorithm MD5).Hash | out-file md5.hash 66 | echo (Get-Content md5.hash) 67 | 68 | - name: Upload To Download site 69 | run: | 70 | $version = Get-Content version.ver 71 | curl -L "https://github.com/aoaostar/alidrive-uploader/releases/download/v2.2.1/alidrive_uploader_v2.2.1_windows_amd64.zip" -o alidrive.zip 72 | tar -xf alidrive.zip --strip-components 1 73 | dir 74 | del example.config.yaml 75 | Out-File -FilePath config.yaml -InputObject "${{secrets.ALICLOUD_CLI_UPADTE_CONFIGYAML}}" 76 | .\alidrive.exe .\天理启动器-$version.zip /GenshinImpactNaturalLaw 77 | 78 | - name: Update Api Version 79 | run: | 80 | $version = Get-Content version.ver 81 | $buildversion = Get-Content build_version.ver 82 | $md5 = Get-Content md5.hash 83 | $commitLog = git log -1 --pretty=%B 84 | 85 | $token="${{secrets.UPDATE_ARTIFACT_TOKEN}}" 86 | $url='http://update.api.weixitianli.com/GenshinImpactNaturalLaw/Version?token='+$token 87 | $body='{"version": "'+$version+'", "description": "' + $buildVersion + '", "downloadUrl": "http://download.weixitianli.com/d/TianLiUpdateService/' + 'GenshinImpactNaturalLaw' + '/' + '天理启动器' + '-' + $version + '.zip", "hash": "' + $md5 + '", "updateLog": "' + $commitLog + '"}' 88 | echo $url 89 | echo $body 90 | Invoke-RestMethod -Method Post -Uri $url -Body $body -ContentType 'application/json' 91 | 92 | - name: Copy Pkg 93 | run: | 94 | mkdir D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/artifact 95 | copy D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/x64/${{env.BUILD_CONFIGURATION}}/*.exe D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/artifact 96 | cd D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/artifact 97 | dir 98 | 99 | - name: Upload a Build Artifact 100 | uses: actions/upload-artifact@v3.1.1 101 | with: 102 | name: 天理启动器 103 | path: D:\a\GenshinImpactNaturalLaw\GenshinImpactNaturalLaw/x64/${{env.BUILD_CONFIGURATION}}/*.exe 104 | if-no-files-found: 'warn' 105 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | /source.7z 263 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33122.133 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GenshinImpactNaturalLaw", "GenshinImpactNaturalLaw\GenshinImpactNaturalLaw.vcxproj", "{89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A7654453-EA07-4943-88BA-03E1051A231E}" 9 | ProjectSection(SolutionItems) = preProject 10 | appveyor.yml = appveyor.yml 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{9A489CD8-0696-4D05-9351-F2011B1D95F1}" 15 | ProjectSection(SolutionItems) = preProject 16 | .github\workflows\windows.yml = .github\workflows\windows.yml 17 | EndProjectSection 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|x64 = Debug|x64 22 | RelDyn|x64 = RelDyn|x64 23 | Release|x64 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.Debug|x64.ActiveCfg = Debug|x64 27 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.Debug|x64.Build.0 = Debug|x64 28 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.RelDyn|x64.ActiveCfg = RelDyn|x64 29 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.RelDyn|x64.Build.0 = RelDyn|x64 30 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.Release|x64.ActiveCfg = Release|x64 31 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.Release|x64.Build.0 = Release|x64 32 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6}.Release|x64.Deploy.0 = Release|x64 33 | EndGlobalSection 34 | GlobalSection(SolutionProperties) = preSolution 35 | HideSolutionNode = FALSE 36 | EndGlobalSection 37 | GlobalSection(ExtensibilityGlobals) = postSolution 38 | SolutionGuid = {2BC4DEA9-B31C-407D-AA76-F70A7FFE5312} 39 | EndGlobalSection 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/accept_encoding.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_ACCEPT_ENCODING_H 2 | #define CPR_ACCEPT_ENCODING_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace cpr { 11 | 12 | enum class AcceptEncodingMethods { 13 | identity, 14 | deflate, 15 | zlib, 16 | gzip, 17 | }; 18 | 19 | static const std::map AcceptEncodingMethodsStringMap{{AcceptEncodingMethods::identity, "identity"}, {AcceptEncodingMethods::deflate, "deflate"}, {AcceptEncodingMethods::zlib, "zlib"}, {AcceptEncodingMethods::gzip, "gzip"}}; 20 | 21 | class AcceptEncoding { 22 | public: 23 | AcceptEncoding() = default; 24 | AcceptEncoding(const std::initializer_list& methods); 25 | AcceptEncoding(const std::initializer_list& methods); 26 | 27 | bool empty() const noexcept; 28 | const std::string getString() const; 29 | 30 | private: 31 | std::vector methods_; 32 | }; 33 | 34 | } // namespace cpr 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/api.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_API_H 2 | #define CPR_API_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "cpr/async.h" 11 | #include "cpr/auth.h" 12 | #include "cpr/bearer.h" 13 | #include "cpr/cprtypes.h" 14 | #include "cpr/multipart.h" 15 | #include "cpr/payload.h" 16 | #include "cpr/response.h" 17 | #include "cpr/session.h" 18 | #include 19 | 20 | namespace cpr { 21 | 22 | using AsyncResponse = std::future; 23 | 24 | namespace priv { 25 | 26 | template 27 | void set_option_internal(Session& session, CurrentType&& current_option) { 28 | session.SetOption(std::forward(current_option)); 29 | } 30 | 31 | template <> 32 | inline void set_option_internal(Session& session, Header&& current_option) { 33 | // Header option was already provided -> Update previous header 34 | session.UpdateHeader(std::forward
(current_option)); 35 | } 36 | 37 | template 38 | void set_option_internal(Session& session, CurrentType&& current_option, Ts&&... ts) { 39 | set_option_internal(session, std::forward(current_option)); 40 | 41 | if (std::is_same::value) { 42 | set_option_internal(session, std::forward(ts)...); 43 | } else { 44 | set_option_internal(session, std::forward(ts)...); 45 | } 46 | } 47 | 48 | template 49 | void set_option(Session& session, Ts&&... ts) { 50 | set_option_internal(session, std::forward(ts)...); 51 | } 52 | 53 | } // namespace priv 54 | 55 | // Get methods 56 | template 57 | Response Get(Ts&&... ts) { 58 | Session session; 59 | priv::set_option(session, std::forward(ts)...); 60 | return session.Get(); 61 | } 62 | 63 | // Get async methods 64 | template 65 | AsyncResponse GetAsync(Ts... ts) { 66 | return cpr::async( 67 | [](Ts... ts_inner) { return Get(std::move(ts_inner)...); }, std::move(ts)...); 68 | } 69 | 70 | // Get callback methods 71 | template 72 | // NOLINTNEXTLINE(fuchsia-trailing-return) 73 | auto GetCallback(Then then, Ts... ts) -> std::future { 74 | return cpr::async( 75 | [](Then then_inner, Ts... ts_inner) { return then_inner(Get(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 76 | } 77 | 78 | // Post methods 79 | template 80 | Response Post(Ts&&... ts) { 81 | Session session; 82 | priv::set_option(session, std::forward(ts)...); 83 | return session.Post(); 84 | } 85 | 86 | // Post async methods 87 | template 88 | AsyncResponse PostAsync(Ts... ts) { 89 | return cpr::async( 90 | [](Ts... ts_inner) { return Post(std::move(ts_inner)...); }, std::move(ts)...); 91 | } 92 | 93 | // Post callback methods 94 | template 95 | // NOLINTNEXTLINE(fuchsia-trailing-return) 96 | auto PostCallback(Then then, Ts... ts) -> std::future { 97 | return cpr::async( 98 | [](Then then_inner, Ts... ts_inner) { return then_inner(Post(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 99 | } 100 | 101 | // Put methods 102 | template 103 | Response Put(Ts&&... ts) { 104 | Session session; 105 | priv::set_option(session, std::forward(ts)...); 106 | return session.Put(); 107 | } 108 | 109 | // Put async methods 110 | template 111 | AsyncResponse PutAsync(Ts... ts) { 112 | return cpr::async( 113 | [](Ts... ts_inner) { return Put(std::move(ts_inner)...); }, std::move(ts)...); 114 | } 115 | 116 | // Put callback methods 117 | template 118 | // NOLINTNEXTLINE(fuchsia-trailing-return) 119 | auto PutCallback(Then then, Ts... ts) -> std::future { 120 | return cpr::async( 121 | [](Then then_inner, Ts... ts_inner) { return then_inner(Put(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 122 | } 123 | 124 | // Head methods 125 | template 126 | Response Head(Ts&&... ts) { 127 | Session session; 128 | priv::set_option(session, std::forward(ts)...); 129 | return session.Head(); 130 | } 131 | 132 | // Head async methods 133 | template 134 | AsyncResponse HeadAsync(Ts... ts) { 135 | return cpr::async( 136 | [](Ts... ts_inner) { return Head(std::move(ts_inner)...); }, std::move(ts)...); 137 | } 138 | 139 | // Head callback methods 140 | template 141 | // NOLINTNEXTLINE(fuchsia-trailing-return) 142 | auto HeadCallback(Then then, Ts... ts) -> std::future { 143 | return cpr::async( 144 | [](Then then_inner, Ts... ts_inner) { return then_inner(Head(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 145 | } 146 | 147 | // Delete methods 148 | template 149 | Response Delete(Ts&&... ts) { 150 | Session session; 151 | priv::set_option(session, std::forward(ts)...); 152 | return session.Delete(); 153 | } 154 | 155 | // Delete async methods 156 | template 157 | AsyncResponse DeleteAsync(Ts... ts) { 158 | return cpr::async( 159 | [](Ts... ts_inner) { return Delete(std::move(ts_inner)...); }, std::move(ts)...); 160 | } 161 | 162 | // Delete callback methods 163 | template 164 | // NOLINTNEXTLINE(fuchsia-trailing-return) 165 | auto DeleteCallback(Then then, Ts... ts) -> std::future { 166 | return cpr::async( 167 | [](Then then_inner, Ts... ts_inner) { return then_inner(Delete(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 168 | } 169 | 170 | // Options methods 171 | template 172 | Response Options(Ts&&... ts) { 173 | Session session; 174 | priv::set_option(session, std::forward(ts)...); 175 | return session.Options(); 176 | } 177 | 178 | // Options async methods 179 | template 180 | AsyncResponse OptionsAsync(Ts... ts) { 181 | return cpr::async( 182 | [](Ts... ts_inner) { return Options(std::move(ts_inner)...); }, std::move(ts)...); 183 | } 184 | 185 | // Options callback methods 186 | template 187 | // NOLINTNEXTLINE(fuchsia-trailing-return) 188 | auto OptionsCallback(Then then, Ts... ts) -> std::future { 189 | return cpr::async( 190 | [](Then then_inner, Ts... ts_inner) { return then_inner(Options(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 191 | } 192 | 193 | // Patch methods 194 | template 195 | Response Patch(Ts&&... ts) { 196 | Session session; 197 | priv::set_option(session, std::forward(ts)...); 198 | return session.Patch(); 199 | } 200 | 201 | // Patch async methods 202 | template 203 | AsyncResponse PatchAsync(Ts... ts) { 204 | return cpr::async( 205 | [](Ts... ts_inner) { return Patch(std::move(ts_inner)...); }, std::move(ts)...); 206 | } 207 | 208 | // Patch callback methods 209 | template 210 | // NOLINTNEXTLINE(fuchsia-trailing-return) 211 | auto PatchCallback(Then then, Ts... ts) -> std::future { 212 | return cpr::async( 213 | [](Then then_inner, Ts... ts_inner) { return then_inner(Patch(std::move(ts_inner)...)); }, std::move(then), std::move(ts)...); 214 | } 215 | 216 | // Download methods 217 | template 218 | Response Download(std::ofstream& file, Ts&&... ts) { 219 | Session session; 220 | priv::set_option(session, std::forward(ts)...); 221 | return session.Download(file); 222 | } 223 | 224 | // Download async method 225 | template 226 | AsyncResponse DownloadAsync(std::string local_path, Ts... ts) { 227 | return std::async( 228 | std::launch::async, 229 | [](std::string local_path, Ts... ts) { 230 | std::ofstream f(local_path); 231 | return Download(f, std::move(ts)...); 232 | }, 233 | std::move(local_path), std::move(ts)...); 234 | } 235 | 236 | // Download with user callback 237 | template 238 | Response Download(const WriteCallback& write, Ts&&... ts) { 239 | Session session; 240 | priv::set_option(session, std::forward(ts)...); 241 | return session.Download(write); 242 | } 243 | 244 | } // namespace cpr 245 | 246 | #endif 247 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/async.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_ASYNC_H 2 | #define CPR_ASYNC_H 3 | 4 | #include "singleton.h" 5 | #include "threadpool.h" 6 | 7 | namespace cpr { 8 | 9 | class GlobalThreadPool : public ThreadPool { 10 | CPR_SINGLETON_DECL(GlobalThreadPool) 11 | protected: 12 | GlobalThreadPool() = default; 13 | 14 | public: 15 | ~GlobalThreadPool() override = default; 16 | }; 17 | 18 | /** 19 | * Return a future, calling future.get() will wait task done and return RetType. 20 | * async(fn, args...) 21 | * async(std::bind(&Class::mem_fn, &obj)) 22 | * async(std::mem_fn(&Class::mem_fn, &obj)) 23 | **/ 24 | template 25 | auto async(Fn&& fn, Args&&... args) -> std::future { 26 | return GlobalThreadPool::GetInstance()->Submit(std::forward(fn), std::forward(args)...); 27 | } 28 | 29 | class async { 30 | public: 31 | static void startup(size_t min_threads = CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM, size_t max_threads = CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM, std::chrono::milliseconds max_idle_ms = CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME) { 32 | GlobalThreadPool* gtp = GlobalThreadPool::GetInstance(); 33 | if (gtp->IsStarted()) { 34 | return; 35 | } 36 | gtp->SetMinThreadNum(min_threads); 37 | gtp->SetMaxThreadNum(max_threads); 38 | gtp->SetMaxIdleTime(max_idle_ms); 39 | gtp->Start(); 40 | } 41 | 42 | static void cleanup() { 43 | GlobalThreadPool::ExitInstance(); 44 | } 45 | }; 46 | 47 | } // namespace cpr 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/auth.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_AUTH_H 2 | #define CPR_AUTH_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace cpr { 9 | 10 | enum class AuthMode { BASIC, DIGEST, NTLM }; 11 | 12 | class Authentication { 13 | public: 14 | Authentication(const std::string& username, const std::string& password, const AuthMode& auth_mode) : auth_string_{username + ":" + password}, auth_mode_{auth_mode} {} 15 | Authentication(std::string&& username, std::string&& password, const AuthMode&& auth_mode) : auth_string_{std::move(username) + ":" + std::move(password)}, auth_mode_{std::move(auth_mode)} {} 16 | Authentication(const Authentication& other) = default; 17 | Authentication(Authentication&& old) noexcept = default; 18 | ~Authentication() noexcept; 19 | 20 | Authentication& operator=(Authentication&& old) noexcept = default; 21 | Authentication& operator=(const Authentication& other) = default; 22 | 23 | const char* GetAuthString() const noexcept; 24 | AuthMode GetAuthMode() const noexcept; 25 | 26 | private: 27 | std::string auth_string_; 28 | AuthMode auth_mode_; 29 | }; 30 | 31 | } // namespace cpr 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/bearer.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_BEARER_H 2 | #define CPR_BEARER_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace cpr { 10 | 11 | // Only supported with libcurl >= 7.61.0. 12 | // As an alternative use SetHeader and add the token manually. 13 | #if LIBCURL_VERSION_NUM >= 0x073D00 14 | class Bearer { 15 | public: 16 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 17 | Bearer(const std::string& token) : token_string_{token} {} 18 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 19 | Bearer(std::string&& token) : token_string_{std::move(token)} {} 20 | Bearer(const Bearer& other) = default; 21 | Bearer(Bearer&& old) noexcept = default; 22 | virtual ~Bearer() noexcept; 23 | 24 | Bearer& operator=(Bearer&& old) noexcept = default; 25 | Bearer& operator=(const Bearer& other) = default; 26 | 27 | virtual const char* GetToken() const noexcept; 28 | 29 | protected: 30 | std::string token_string_; 31 | }; 32 | #endif 33 | 34 | } // namespace cpr 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/body.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_BODY_H 2 | #define CPR_BODY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "cpr/buffer.h" 11 | #include "cpr/cprtypes.h" 12 | #include "cpr/file.h" 13 | 14 | namespace cpr { 15 | 16 | class Body : public StringHolder { 17 | public: 18 | Body() : StringHolder() {} 19 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 20 | Body(const std::string& body) : StringHolder(body) {} 21 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 22 | Body(std::string&& body) : StringHolder(std::move(body)) {} 23 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 24 | Body(const char* body) : StringHolder(body) {} 25 | Body(const char* str, size_t len) : StringHolder(str, len) {} 26 | Body(const std::initializer_list args) : StringHolder(args) {} 27 | Body(const Buffer& buffer) : StringHolder(reinterpret_cast(buffer.data), static_cast(buffer.datalen)) {} 28 | Body(const File& file) { 29 | std::ifstream is(file.filepath, std::ifstream::binary); 30 | if (is) { 31 | is.seekg(0, is.end); 32 | int length = static_cast(is.tellg()); 33 | is.seekg(0, is.beg); 34 | std::vector buffer; 35 | buffer.resize(length); 36 | is.read(&buffer[0], length); 37 | is.close(); 38 | str_ = std::string(buffer.begin(), buffer.end()); 39 | } else { 40 | throw std::invalid_argument("Can't open the file for HTTP request body!"); 41 | } 42 | } 43 | Body(const Body& other) = default; 44 | Body(Body&& old) noexcept = default; 45 | ~Body() override = default; 46 | 47 | Body& operator=(Body&& old) noexcept = default; 48 | Body& operator=(const Body& other) = default; 49 | }; 50 | 51 | } // namespace cpr 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_BUFFER_H 2 | #define CPR_BUFFER_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | struct Buffer { 9 | using data_t = const unsigned char*; 10 | 11 | template 12 | Buffer(Iterator begin, Iterator end, std::string&& p_filename) 13 | // Ignored here since libcurl reqires a long. 14 | // There is also no way around the reinterpret_cast. 15 | // NOLINTNEXTLINE(google-runtime-int, cppcoreguidelines-pro-type-reinterpret-cast) 16 | : data{reinterpret_cast(&(*begin))}, datalen{static_cast(std::distance(begin, end))}, filename(std::move(p_filename)) { 17 | is_random_access_iterator(begin, end); 18 | static_assert(sizeof(*begin) == 1, "Only byte buffers can be used"); 19 | } 20 | 21 | template 22 | typename std::enable_if::iterator_category, std::random_access_iterator_tag>::value>::type is_random_access_iterator(Iterator /* begin */, Iterator /* end */) {} 23 | 24 | data_t data; 25 | // Ignored here since libcurl reqires a long: 26 | // NOLINTNEXTLINE(google-runtime-int) 27 | long datalen; 28 | const std::string filename; 29 | }; 30 | 31 | } // namespace cpr 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/callback.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CALLBACK_H 2 | #define CPR_CALLBACK_H 3 | 4 | #include "cprtypes.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace cpr { 10 | 11 | class ReadCallback { 12 | public: 13 | ReadCallback() = default; 14 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 15 | ReadCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), size{-1}, callback{std::move(p_callback)} {} 16 | ReadCallback(cpr_off_t p_size, std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), size{p_size}, callback{std::move(p_callback)} {} 17 | bool operator()(char* buffer, size_t& buffer_size) const { 18 | return callback(buffer, buffer_size, userdata); 19 | } 20 | 21 | intptr_t userdata; 22 | cpr_off_t size{}; 23 | std::function callback; 24 | }; 25 | 26 | class HeaderCallback { 27 | public: 28 | HeaderCallback() = default; 29 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 30 | HeaderCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} 31 | bool operator()(std::string header) const { 32 | return callback(std::move(header), userdata); 33 | } 34 | 35 | intptr_t userdata; 36 | std::function callback; 37 | }; 38 | 39 | class WriteCallback { 40 | public: 41 | WriteCallback() = default; 42 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 43 | WriteCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} 44 | bool operator()(std::string data) const { 45 | return callback(std::move(data), userdata); 46 | } 47 | 48 | intptr_t userdata; 49 | std::function callback; 50 | }; 51 | 52 | class ProgressCallback { 53 | public: 54 | ProgressCallback() = default; 55 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 56 | ProgressCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} 57 | bool operator()(cpr_off_t downloadTotal, cpr_off_t downloadNow, cpr_off_t uploadTotal, cpr_off_t uploadNow) const { 58 | return callback(downloadTotal, downloadNow, uploadTotal, uploadNow, userdata); 59 | } 60 | 61 | intptr_t userdata; 62 | std::function callback; 63 | }; 64 | 65 | class DebugCallback { 66 | public: 67 | enum class InfoType { 68 | TEXT = 0, 69 | HEADER_IN = 1, 70 | HEADER_OUT = 2, 71 | DATA_IN = 3, 72 | DATA_OUT = 4, 73 | SSL_DATA_IN = 5, 74 | SSL_DATA_OUT = 6, 75 | }; 76 | DebugCallback() = default; 77 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 78 | DebugCallback(std::function p_callback, intptr_t p_userdata = 0) : userdata(p_userdata), callback(std::move(p_callback)) {} 79 | void operator()(InfoType type, std::string data) const { 80 | callback(type, std::move(data), userdata); 81 | } 82 | 83 | intptr_t userdata; 84 | std::function callback; 85 | }; 86 | 87 | } // namespace cpr 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/cert_info.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CERT_INFO_H 2 | #define CPR_CERT_INFO_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cpr { 9 | 10 | class CertInfo { 11 | private: 12 | std::vector cert_info_; 13 | 14 | public: 15 | CertInfo() = default; 16 | CertInfo(const std::initializer_list& entry) : cert_info_{entry} {}; 17 | ~CertInfo() noexcept = default; 18 | 19 | using iterator = std::vector::iterator; 20 | using const_iterator = std::vector::const_iterator; 21 | 22 | std::string& operator[](const size_t& pos); 23 | iterator begin(); 24 | iterator end(); 25 | const_iterator begin() const; 26 | const_iterator end() const; 27 | const_iterator cbegin() const; 28 | const_iterator cend() const; 29 | void emplace_back(const std::string& str); 30 | void push_back(const std::string& str); 31 | void pop_back(); 32 | }; 33 | } // namespace cpr 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/connect_timeout.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CONNECT_TIMEOUT_H 2 | #define CPR_CONNECT_TIMEOUT_H 3 | 4 | #include "cpr/timeout.h" 5 | 6 | namespace cpr { 7 | 8 | class ConnectTimeout : public Timeout { 9 | public: 10 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 11 | ConnectTimeout(const std::chrono::milliseconds& duration) : Timeout{duration} {} 12 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 13 | ConnectTimeout(const std::int32_t& milliseconds) : Timeout{milliseconds} {} 14 | }; 15 | 16 | } // namespace cpr 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/cookies.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_COOKIES_H 2 | #define CPR_COOKIES_H 3 | 4 | #include "cpr/curlholder.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace cpr { 12 | /** 13 | * EXPIRES_STRING_SIZE is an explicitly static and const variable that could be only accessed within the same namespace and is immutable. 14 | * To be used for "std::array", the expression must have a constant value, so EXPIRES_STRING_SIZE must be a const value. 15 | **/ 16 | static const std::size_t EXPIRES_STRING_SIZE = 100; 17 | 18 | class Cookie { 19 | public: 20 | Cookie() = default; 21 | /** 22 | * Some notes for the default value used by expires: 23 | * std::chrono::system_clock::time_point::min() won't work on Windows due to the min, max clash there. 24 | * So we fall back to std::chrono::system_clock::from_time_t(0) for the minimum value here. 25 | **/ 26 | Cookie(const std::string& name, const std::string& value, const std::string& domain = "", bool p_isIncludingSubdomains = false, const std::string& path = "/", bool p_isHttpsOnly = false, std::chrono::system_clock::time_point expires = std::chrono::system_clock::from_time_t(0)) : name_{name}, value_{value}, domain_{domain}, includeSubdomains_{p_isIncludingSubdomains}, path_{path}, httpsOnly_{p_isHttpsOnly}, expires_{expires} {}; 27 | const std::string GetDomain() const; 28 | bool IsIncludingSubdomains() const; 29 | const std::string GetPath() const; 30 | bool IsHttpsOnly() const; 31 | const std::chrono::system_clock::time_point GetExpires() const; 32 | const std::string GetExpiresString() const; 33 | const std::string GetName() const; 34 | const std::string GetValue() const; 35 | 36 | private: 37 | std::string name_; 38 | std::string value_; 39 | std::string domain_; 40 | bool includeSubdomains_{}; 41 | std::string path_; 42 | bool httpsOnly_{}; 43 | /** 44 | * TODO: Update the implementation using `std::chrono::utc_clock` of C++20 45 | **/ 46 | std::chrono::system_clock::time_point expires_{}; 47 | }; 48 | 49 | class Cookies { 50 | public: 51 | /** 52 | * Should we URL-encode cookies when making a request. 53 | * Based on RFC6265, it is recommended but not mandatory to encode cookies. 54 | * 55 | * ------- 56 | * To maximize compatibility with user agents, servers that wish to 57 | * store arbitrary data in a cookie-value SHOULD encode that data, for 58 | * example, using Base64 [RFC4648]. 59 | * ------- 60 | * Source: RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) 61 | **/ 62 | bool encode{true}; 63 | 64 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 65 | Cookies(bool p_encode = true) : encode{p_encode} {}; 66 | Cookies(const std::initializer_list& cookies, bool p_encode = true) : encode{p_encode}, cookies_{cookies} {}; 67 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 68 | Cookies(const cpr::Cookie& cookie, bool p_encode = true) : encode{p_encode}, cookies_{cookie} {}; 69 | 70 | cpr::Cookie& operator[](size_t pos); 71 | const std::string GetEncoded(const CurlHolder& holder) const; 72 | 73 | using iterator = std::vector::iterator; 74 | using const_iterator = std::vector::const_iterator; 75 | 76 | iterator begin(); 77 | iterator end(); 78 | const_iterator begin() const; 79 | const_iterator end() const; 80 | const_iterator cbegin() const; 81 | const_iterator cend() const; 82 | void emplace_back(const Cookie& str); 83 | void push_back(const Cookie& str); 84 | void pop_back(); 85 | 86 | private: 87 | std::vector cookies_; 88 | }; 89 | 90 | } // namespace cpr 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/cpr.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CPR_H 2 | #define CPR_CPR_H 3 | 4 | #include "cpr/api.h" 5 | #include "cpr/auth.h" 6 | #include "cpr/bearer.h" 7 | #include "cpr/callback.h" 8 | #include "cpr/cert_info.h" 9 | #include "cpr/connect_timeout.h" 10 | #include "cpr/cookies.h" 11 | #include "cpr/cprtypes.h" 12 | #include "cpr/cprver.h" 13 | #include "cpr/curl_container.h" 14 | #include "cpr/curlholder.h" 15 | #include "cpr/error.h" 16 | #include "cpr/http_version.h" 17 | #include "cpr/interceptor.h" 18 | #include "cpr/interface.h" 19 | #include "cpr/limit_rate.h" 20 | #include "cpr/local_port.h" 21 | #include "cpr/local_port_range.h" 22 | #include "cpr/low_speed.h" 23 | #include "cpr/multipart.h" 24 | #include "cpr/parameters.h" 25 | #include "cpr/payload.h" 26 | #include "cpr/proxies.h" 27 | #include "cpr/proxyauth.h" 28 | #include "cpr/range.h" 29 | #include "cpr/redirect.h" 30 | #include "cpr/reserve_size.h" 31 | #include "cpr/response.h" 32 | #include "cpr/session.h" 33 | #include "cpr/ssl_ctx.h" 34 | #include "cpr/ssl_options.h" 35 | #include "cpr/status_codes.h" 36 | #include "cpr/timeout.h" 37 | #include "cpr/unix_socket.h" 38 | #include "cpr/user_agent.h" 39 | #include "cpr/util.h" 40 | #include "cpr/verbose.h" 41 | 42 | #define CPR_LIBCURL_VERSION_NUM LIBCURL_VERSION_NUM 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/cprtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CPR_TYPES_H 2 | #define CPR_CPR_TYPES_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace cpr { 12 | 13 | /** 14 | * Wrapper around "curl_off_t" to prevent applications from having to link against libcurl. 15 | **/ 16 | using cpr_off_t = curl_off_t; 17 | 18 | template 19 | class StringHolder { 20 | public: 21 | StringHolder() = default; 22 | explicit StringHolder(const std::string& str) : str_(str) {} 23 | explicit StringHolder(std::string&& str) : str_(std::move(str)) {} 24 | explicit StringHolder(const char* str) : str_(str) {} 25 | StringHolder(const char* str, size_t len) : str_(str, len) {} 26 | StringHolder(const std::initializer_list args) { 27 | str_ = std::accumulate(args.begin(), args.end(), str_); 28 | } 29 | StringHolder(const StringHolder& other) = default; 30 | StringHolder(StringHolder&& old) noexcept = default; 31 | virtual ~StringHolder() = default; 32 | 33 | StringHolder& operator=(StringHolder&& old) noexcept = default; 34 | 35 | StringHolder& operator=(const StringHolder& other) = default; 36 | 37 | explicit operator std::string() const { 38 | return str_; 39 | } 40 | 41 | T operator+(const char* rhs) const { 42 | return T(str_ + rhs); 43 | } 44 | 45 | T operator+(const std::string& rhs) const { 46 | return T(str_ + rhs); 47 | } 48 | 49 | T operator+(const StringHolder& rhs) const { 50 | return T(str_ + rhs.str_); 51 | } 52 | 53 | void operator+=(const char* rhs) { 54 | str_ += rhs; 55 | } 56 | void operator+=(const std::string& rhs) { 57 | str_ += rhs; 58 | } 59 | void operator+=(const StringHolder& rhs) { 60 | str_ += rhs; 61 | } 62 | 63 | bool operator==(const char* rhs) const { 64 | return str_ == rhs; 65 | } 66 | bool operator==(const std::string& rhs) const { 67 | return str_ == rhs; 68 | } 69 | bool operator==(const StringHolder& rhs) const { 70 | return str_ == rhs.str_; 71 | } 72 | 73 | bool operator!=(const char* rhs) const { 74 | return str_.c_str() != rhs; 75 | } 76 | bool operator!=(const std::string& rhs) const { 77 | return str_ != rhs; 78 | } 79 | bool operator!=(const StringHolder& rhs) const { 80 | return str_ != rhs.str_; 81 | } 82 | 83 | const std::string& str() { 84 | return str_; 85 | } 86 | const std::string& str() const { 87 | return str_; 88 | } 89 | const char* c_str() const { 90 | return str_.c_str(); 91 | } 92 | const char* data() const { 93 | return str_.data(); 94 | } 95 | 96 | protected: 97 | std::string str_{}; 98 | }; 99 | 100 | template 101 | std::ostream& operator<<(std::ostream& os, const StringHolder& s) { 102 | os << s.str(); 103 | return os; 104 | } 105 | 106 | class Url : public StringHolder { 107 | public: 108 | Url() = default; 109 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 110 | Url(const std::string& url) : StringHolder(url) {} 111 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 112 | Url(std::string&& url) : StringHolder(std::move(url)) {} 113 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 114 | Url(const char* url) : StringHolder(url) {} 115 | Url(const char* str, size_t len) : StringHolder(std::string(str, len)) {} 116 | Url(const std::initializer_list args) : StringHolder(args) {} 117 | Url(const Url& other) = default; 118 | Url(Url&& old) noexcept = default; 119 | ~Url() override = default; 120 | 121 | Url& operator=(Url&& old) noexcept = default; 122 | Url& operator=(const Url& other) = default; 123 | }; 124 | 125 | struct CaseInsensitiveCompare { 126 | bool operator()(const std::string& a, const std::string& b) const noexcept; 127 | }; 128 | 129 | using Header = std::map; 130 | 131 | } // namespace cpr 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/cprver.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CPRVER_H 2 | #define CPR_CPRVER_H 3 | 4 | /** 5 | * CPR version as a string. 6 | **/ 7 | #define CPR_VERSION "1.9.2" 8 | 9 | /** 10 | * CPR version split up into parts. 11 | **/ 12 | #define CPR_VERSION_MAJOR 1 13 | #define CPR_VERSION_MINOR 9 14 | #define CPR_VERSION_PATCH 2 15 | 16 | /** 17 | * CPR version as a single hex digit. 18 | * it can be split up into three parts: 19 | * 0xAABBCC 20 | * AA: The current CPR major version number in a hex format. 21 | * BB: The current CPR minor version number in a hex format. 22 | * CC: The current CPR patch version number in a hex format. 23 | * 24 | * Examples: 25 | * '0x010702' -> 01.07.02 -> CPR_VERSION: 1.7.2 26 | * '0xA13722' -> A1.37.22 -> CPR_VERSION: 161.55.34 27 | **/ 28 | #define CPR_VERSION_NUM 0x10902 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/curl_container.h: -------------------------------------------------------------------------------- 1 | #ifndef CURL_CONTAINER_H 2 | #define CURL_CONTAINER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "cpr/curlholder.h" 10 | 11 | 12 | namespace cpr { 13 | 14 | struct Parameter { 15 | Parameter(const std::string& p_key, const std::string& p_value) : key{p_key}, value{p_value} {} 16 | Parameter(std::string&& p_key, std::string&& p_value) : key{std::move(p_key)}, value{std::move(p_value)} {} 17 | 18 | std::string key; 19 | std::string value; 20 | }; 21 | 22 | struct Pair { 23 | Pair(const std::string& p_key, const std::string& p_value) : key(p_key), value(p_value) {} 24 | Pair(std::string&& p_key, std::string&& p_value) : key(std::move(p_key)), value(std::move(p_value)) {} 25 | 26 | std::string key; 27 | std::string value; 28 | }; 29 | 30 | 31 | template 32 | class CurlContainer { 33 | public: 34 | /** 35 | * Enables or disables URL encoding for keys and values when calling GetContent(...). 36 | **/ 37 | bool encode = true; 38 | 39 | CurlContainer() = default; 40 | CurlContainer(const std::initializer_list&); 41 | 42 | void Add(const std::initializer_list&); 43 | void Add(const T&); 44 | 45 | const std::string GetContent(const CurlHolder&) const; 46 | 47 | protected: 48 | std::vector containerList_; 49 | }; 50 | 51 | } // namespace cpr 52 | 53 | #endif // 54 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/curlholder.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_CURL_HOLDER_H 2 | #define CPR_CURL_HOLDER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace cpr { 11 | struct CurlHolder { 12 | private: 13 | /** 14 | * Mutex for curl_easy_init(). 15 | * curl_easy_init() is not thread save. 16 | * References: 17 | * https://curl.haxx.se/libcurl/c/curl_easy_init.html 18 | * https://curl.haxx.se/libcurl/c/threadsafe.html 19 | **/ 20 | 21 | // Avoids initalization order problems in a static build 22 | static std::mutex& curl_easy_init_mutex_() { 23 | static std::mutex curl_easy_init_mutex_; 24 | return curl_easy_init_mutex_; 25 | } 26 | 27 | public: 28 | CURL* handle{nullptr}; 29 | struct curl_slist* chunk{nullptr}; 30 | struct curl_httppost* formpost{nullptr}; 31 | std::array error{}; 32 | 33 | CurlHolder(); 34 | CurlHolder(const CurlHolder& other) = default; 35 | CurlHolder(CurlHolder&& old) noexcept = default; 36 | ~CurlHolder(); 37 | 38 | CurlHolder& operator=(CurlHolder&& old) noexcept = default; 39 | CurlHolder& operator=(const CurlHolder& other) = default; 40 | 41 | /** 42 | * Uses curl_easy_escape(...) for escaping the given string. 43 | **/ 44 | std::string urlEncode(const std::string& s) const; 45 | 46 | /** 47 | * Uses curl_easy_unescape(...) for unescaping the given string. 48 | **/ 49 | std::string urlDecode(const std::string& s) const; 50 | }; 51 | } // namespace cpr 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/error.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_ERROR_H 2 | #define CPR_ERROR_H 3 | 4 | #include 5 | #include 6 | 7 | #include "cpr/cprtypes.h" 8 | #include 9 | 10 | namespace cpr { 11 | 12 | enum class ErrorCode { 13 | OK = 0, 14 | CONNECTION_FAILURE, 15 | EMPTY_RESPONSE, 16 | HOST_RESOLUTION_FAILURE, 17 | INTERNAL_ERROR, 18 | INVALID_URL_FORMAT, 19 | NETWORK_RECEIVE_ERROR, 20 | NETWORK_SEND_FAILURE, 21 | OPERATION_TIMEDOUT, 22 | PROXY_RESOLUTION_FAILURE, 23 | SSL_CONNECT_ERROR, 24 | SSL_LOCAL_CERTIFICATE_ERROR, 25 | SSL_REMOTE_CERTIFICATE_ERROR, 26 | SSL_CACERT_ERROR, 27 | GENERIC_SSL_ERROR, 28 | UNSUPPORTED_PROTOCOL, 29 | REQUEST_CANCELLED, 30 | TOO_MANY_REDIRECTS, 31 | UNKNOWN_ERROR = 1000, 32 | }; 33 | 34 | class Error { 35 | public: 36 | ErrorCode code = ErrorCode::OK; 37 | std::string message{}; 38 | 39 | Error() = default; 40 | 41 | Error(const std::int32_t& curl_code, std::string&& p_error_message) : code{getErrorCodeForCurlError(curl_code)}, message(std::move(p_error_message)) {} 42 | 43 | explicit operator bool() const { 44 | return code != ErrorCode::OK; 45 | } 46 | 47 | private: 48 | static ErrorCode getErrorCodeForCurlError(std::int32_t curl_code); 49 | }; 50 | 51 | } // namespace cpr 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/file.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_FILE_H 2 | #define CPR_FILE_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | struct File { 9 | explicit File(std::string&& p_filepath) : filepath(std::move(p_filepath)) {} 10 | explicit File(const std::string& p_filepath) : filepath(p_filepath) {} 11 | const std::string filepath; 12 | }; 13 | 14 | } // namespace cpr 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/http_version.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_HTTP_VERSION_H 2 | #define CPR_HTTP_VERSION_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | enum class HttpVersionCode { 8 | /** 9 | * Let libcurl decide which version is the best. 10 | **/ 11 | VERSION_NONE, 12 | /** 13 | * Enforce HTTP 1.0 requests. 14 | **/ 15 | VERSION_1_0, 16 | /** 17 | * Enforce HTTP 1.1 requests. 18 | **/ 19 | VERSION_1_1, 20 | #if LIBCURL_VERSION_NUM >= 0x072100 // 7.33.0 21 | /** 22 | * Attempt HTTP 2.0 requests. 23 | * Fallback to HTTP 1.1 if negotiation fails. 24 | **/ 25 | VERSION_2_0, 26 | #endif 27 | #if LIBCURL_VERSION_NUM >= 0x072F00 // 7.47.0 28 | /** 29 | * Attempt HTTP 2.0 for HTTPS requests only. 30 | * Fallback to HTTP 1.1 if negotiation fails. 31 | * HTTP 1.1 will be used for HTTP connections. 32 | **/ 33 | VERSION_2_0_TLS, 34 | #endif 35 | #if LIBCURL_VERSION_NUM >= 0x073100 // 7.49.0 36 | /** 37 | * Start HTTP 2.0 for HTTP requests. 38 | * Requires prior knowledge that the server supports HTTP 2.0. 39 | * For HTTPS requests we will negotiate the protocol version in the TLS handshake. 40 | **/ 41 | VERSION_2_0_PRIOR_KNOWLEDGE, 42 | #endif 43 | #if LIBCURL_VERSION_NUM >= 0x074200 // 7.66.0 44 | /** 45 | * Attempt HTTP 3.0 requests. 46 | * Requires prior knowledge that the server supports HTTP 3.0 since there is no gracefully downgrade. 47 | * Fallback to HTTP 1.1 if negotiation fails. 48 | **/ 49 | VERSION_3_0 50 | #endif 51 | }; 52 | 53 | class HttpVersion { 54 | public: 55 | /** 56 | * The HTTP version that should be used by libcurl when initiating a HTTP(S) connection. 57 | * Default: HttpVersionCode::VERSION_NONE 58 | **/ 59 | HttpVersionCode code = HttpVersionCode::VERSION_NONE; 60 | 61 | HttpVersion() = default; 62 | explicit HttpVersion(HttpVersionCode _code) : code(_code) {} 63 | }; 64 | 65 | } // namespace cpr 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/interceptor.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_INTERCEPTOR_H 2 | #define CPR_INTERCEPTOR_H 3 | 4 | #include "cpr/response.h" 5 | #include "cpr/session.h" 6 | 7 | namespace cpr { 8 | 9 | class Interceptor { 10 | public: 11 | enum class ProceedHttpMethod { 12 | GET_REQUEST = 0, 13 | POST_REQUEST, 14 | PUT_REQUEST, 15 | DELETE_REQUEST, 16 | PATCH_REQUEST, 17 | HEAD_REQUEST, 18 | OPTIONS_REQUEST, 19 | DOWNLOAD_CALLBACK_REQUEST, 20 | DOWNLOAD_FILE_REQUEST, 21 | }; 22 | 23 | virtual ~Interceptor() = default; 24 | virtual Response intercept(Session& session) = 0; 25 | 26 | protected: 27 | static Response proceed(Session& session); 28 | static Response proceed(Session& session, ProceedHttpMethod httpMethod); 29 | static Response proceed(Session& session, ProceedHttpMethod httpMethod, std::ofstream& file); 30 | static Response proceed(Session& session, ProceedHttpMethod httpMethod, const WriteCallback& write); 31 | }; 32 | 33 | } // namespace cpr 34 | 35 | 36 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_INTERFACE_H 2 | #define CPR_INTERFACE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "cpr/cprtypes.h" 8 | 9 | namespace cpr { 10 | 11 | class Interface : public StringHolder { 12 | public: 13 | Interface() : StringHolder() {} 14 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 15 | Interface(const std::string& iface) : StringHolder(iface) {} 16 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 17 | Interface(std::string&& iface) : StringHolder(std::move(iface)) {} 18 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 19 | Interface(const char* iface) : StringHolder(iface) {} 20 | Interface(const char* str, size_t len) : StringHolder(str, len) {} 21 | Interface(const std::initializer_list args) : StringHolder(args) {} 22 | Interface(const Interface& other) = default; 23 | Interface(Interface&& old) noexcept = default; 24 | ~Interface() override = default; 25 | 26 | Interface& operator=(Interface&& old) noexcept = default; 27 | Interface& operator=(const Interface& other) = default; 28 | }; 29 | 30 | } // namespace cpr 31 | 32 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/limit_rate.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_SPEED_LIMIT_H 2 | #define CPR_SPEED_LIMIT_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class LimitRate { 9 | public: 10 | LimitRate(const std::int64_t p_downrate, const std::int64_t p_uprate) : downrate(p_downrate), uprate(p_uprate) {} 11 | 12 | std::int64_t downrate = 0; 13 | std::int64_t uprate = 0; 14 | }; 15 | 16 | } // namespace cpr 17 | 18 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/local_port.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_LOCAL_PORT_H 2 | #define CPR_LOCAL_PORT_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class LocalPort { 9 | public: 10 | // NOLINTNEXTLINE(google-explicit-constructor) 11 | LocalPort(const std::uint16_t p_localport) : localport_(p_localport) {} 12 | 13 | operator std::uint16_t() const { 14 | return localport_; 15 | } 16 | 17 | private: 18 | std::uint16_t localport_ = 0; 19 | }; 20 | 21 | } // namespace cpr 22 | 23 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/local_port_range.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_LOCAL_PORT_RANGE_H 2 | #define CPR_LOCAL_PORT_RANGE_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class LocalPortRange { 9 | public: 10 | // NOLINTNEXTLINE(google-explicit-constructor) 11 | LocalPortRange(const std::uint16_t p_localportrange) : localportrange_(p_localportrange) {} 12 | 13 | operator std::uint16_t() const { 14 | return localportrange_; 15 | } 16 | 17 | private: 18 | std::uint16_t localportrange_ = 0; 19 | }; 20 | 21 | } // namespace cpr 22 | 23 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/low_speed.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_LOW_SPEED_H 2 | #define CPR_LOW_SPEED_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class LowSpeed { 9 | public: 10 | LowSpeed(const std::int32_t p_limit, const std::int32_t p_time) : limit(p_limit), time(p_time) {} 11 | 12 | std::int32_t limit; 13 | std::int32_t time; 14 | }; 15 | 16 | } // namespace cpr 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/multipart.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_MULTIPART_H 2 | #define CPR_MULTIPART_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "buffer.h" 11 | #include "file.h" 12 | 13 | namespace cpr { 14 | 15 | struct Part { 16 | Part(const std::string& p_name, const std::string& p_value, const std::string& p_content_type = {}) : name{p_name}, value{p_value}, content_type{p_content_type}, is_file{false}, is_buffer{false}, has_filename{false} {} 17 | Part(const std::string& p_name, const std::int32_t& p_value, const std::string& p_content_type = {}) : name{p_name}, value{std::to_string(p_value)}, content_type{p_content_type}, is_file{false}, is_buffer{false}, has_filename{false} {} 18 | Part(const std::string& p_name, const File& file, const std::string& p_content_type = {}) : name{p_name}, value{file.filepath}, content_type{p_content_type}, is_file{true}, is_buffer{false}, has_filename{false} {} 19 | Part(const std::string& p_name, const std::string& p_filename, const File& file, const std::string& p_content_type = {}) : name{p_name}, filename{p_filename}, value{file.filepath}, content_type{p_content_type}, is_file{true}, is_buffer{false}, has_filename{true} {} 20 | Part(const std::string& p_name, const Buffer& buffer, const std::string& p_content_type = {}) : name{p_name}, value{buffer.filename}, content_type{p_content_type}, data{buffer.data}, datalen{buffer.datalen}, is_file{false}, is_buffer{true}, has_filename{false} {} 21 | 22 | std::string name; 23 | std::string filename; 24 | std::string value; 25 | std::string content_type; 26 | Buffer::data_t data{nullptr}; 27 | // Ignored here since libcurl reqires a long: 28 | // NOLINTNEXTLINE(google-runtime-int) 29 | long datalen{0}; 30 | bool is_file; 31 | bool is_buffer; 32 | bool has_filename; 33 | }; 34 | 35 | class Multipart { 36 | public: 37 | Multipart(const std::initializer_list& parts); 38 | 39 | std::vector parts; 40 | }; 41 | 42 | } // namespace cpr 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/parameters.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_PARAMETERS_H 2 | #define CPR_PARAMETERS_H 3 | 4 | #include 5 | 6 | #include "cpr/curl_container.h" 7 | 8 | namespace cpr { 9 | 10 | class Parameters : public CurlContainer { 11 | public: 12 | Parameters() = default; 13 | Parameters(const std::initializer_list& parameters); 14 | }; 15 | 16 | } // namespace cpr 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/payload.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_PAYLOAD_H 2 | #define CPR_PAYLOAD_H 3 | 4 | #include 5 | 6 | #include "cpr/curl_container.h" 7 | 8 | 9 | namespace cpr { 10 | class Payload : public CurlContainer { 11 | public: 12 | template 13 | Payload(const It begin, const It end) { 14 | for (It pair = begin; pair != end; ++pair) { 15 | Add(*pair); 16 | } 17 | } 18 | Payload(const std::initializer_list& pairs); 19 | }; 20 | 21 | } // namespace cpr 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/proxies.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_PROXIES_H 2 | #define CPR_PROXIES_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cpr { 9 | class Proxies { 10 | public: 11 | Proxies() = default; 12 | Proxies(const std::initializer_list>& hosts); 13 | Proxies(const std::map& hosts); 14 | 15 | bool has(const std::string& protocol) const; 16 | const std::string& operator[](const std::string& protocol); 17 | 18 | private: 19 | std::map hosts_; 20 | }; 21 | } // namespace cpr 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/proxyauth.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_PROXYAUTH_H 2 | #define CPR_PROXYAUTH_H 3 | 4 | #include 5 | #include 6 | 7 | #include "cpr/auth.h" 8 | #include "cpr/util.h" 9 | 10 | namespace cpr { 11 | class EncodedAuthentication { 12 | public: 13 | EncodedAuthentication() : auth_string_{""} {} 14 | EncodedAuthentication(const std::string& username, const std::string& password) : auth_string_{cpr::util::urlEncode(username) + ":" + cpr::util::urlEncode(password)} {} 15 | EncodedAuthentication(std::string&& username, std::string&& password) : auth_string_{cpr::util::urlEncode(std::move(username)) + ":" + cpr::util::urlEncode(std::move(password))} {} 16 | EncodedAuthentication(const EncodedAuthentication& other) = default; 17 | EncodedAuthentication(EncodedAuthentication&& old) noexcept = default; 18 | virtual ~EncodedAuthentication() noexcept; 19 | 20 | EncodedAuthentication& operator=(EncodedAuthentication&& old) noexcept = default; 21 | EncodedAuthentication& operator=(const EncodedAuthentication& other) = default; 22 | 23 | const char* GetAuthString() const noexcept; 24 | 25 | protected: 26 | std::string auth_string_; 27 | }; 28 | 29 | class ProxyAuthentication { 30 | public: 31 | ProxyAuthentication() = default; 32 | ProxyAuthentication(const std::initializer_list>& auths) : proxyAuth_{auths} {} 33 | ProxyAuthentication(const std::map& auths) : proxyAuth_{auths} {} 34 | 35 | bool has(const std::string& protocol) const; 36 | const char* operator[](const std::string& protocol); 37 | 38 | private: 39 | std::map proxyAuth_; 40 | }; 41 | 42 | } // namespace cpr 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/range.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_RANGE_H 2 | #define CPR_RANGE_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class Range { 9 | public: 10 | Range(const std::int64_t p_resume_from, const std::int64_t p_finish_at) : resume_from(p_resume_from), finish_at(p_finish_at) {} 11 | 12 | std::int64_t resume_from = 0; 13 | std::int64_t finish_at = 0; 14 | 15 | const std::string str() const { 16 | std::string from_str = (resume_from < (std::int64_t) 0) ? "" : std::to_string(resume_from); 17 | std::string to_str = (finish_at < (std::int64_t) 0) ? "" : std::to_string(finish_at); 18 | return from_str + "-" + to_str; 19 | } 20 | }; 21 | 22 | class MultiRange { 23 | public: 24 | MultiRange(std::initializer_list rs) : ranges{rs} {} 25 | 26 | const std::string str() const { 27 | std::string multi_range_string{}; 28 | for (Range range : ranges) { 29 | multi_range_string += ((multi_range_string.empty()) ? "" : ", ") + range.str(); 30 | } 31 | return multi_range_string; 32 | } 33 | 34 | private: 35 | std::vector ranges; 36 | }; // namespace cpr 37 | 38 | } // namespace cpr 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/redirect.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_REDIRECT_H 2 | #define CPR_REDIRECT_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | enum class PostRedirectFlags : uint8_t { 8 | /** 9 | * Respect RFC 7231 (section 6.4.2 to 6.4.4). 10 | * Same as CURL_REDIR_POST_301 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). 11 | **/ 12 | POST_301 = 0x1 << 0, 13 | /** 14 | * Maintain the request method after a 302 redirect. 15 | * Same as CURL_REDIR_POST_302 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). 16 | **/ 17 | POST_302 = 0x1 << 1, 18 | /** 19 | * Maintain the request method after a 303 redirect. 20 | * Same as CURL_REDIR_POST_303 (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). 21 | **/ 22 | POST_303 = 0x1 << 2, 23 | /** 24 | * Default value. 25 | * Convenience option to enable all flags. 26 | * Same as CURL_REDIR_POST_ALL (https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). 27 | **/ 28 | POST_ALL = POST_301 | POST_302 | POST_303, 29 | /** 30 | * * Convenience option to disable all flags. 31 | **/ 32 | NONE = 0x0 33 | }; 34 | 35 | PostRedirectFlags operator|(PostRedirectFlags lhs, PostRedirectFlags rhs); 36 | PostRedirectFlags operator&(PostRedirectFlags lhs, PostRedirectFlags rhs); 37 | PostRedirectFlags operator^(PostRedirectFlags lhs, PostRedirectFlags rhs); 38 | PostRedirectFlags operator~(PostRedirectFlags flag); 39 | PostRedirectFlags& operator|=(PostRedirectFlags& lhs, PostRedirectFlags rhs); 40 | PostRedirectFlags& operator&=(PostRedirectFlags& lhs, PostRedirectFlags rhs); 41 | PostRedirectFlags& operator^=(PostRedirectFlags& lhs, PostRedirectFlags rhs); 42 | bool any(PostRedirectFlags flag); 43 | 44 | class Redirect { 45 | public: 46 | /** 47 | * The maximum number of redirects to follow. 48 | * 0: Refuse any redirects. 49 | * -1: Infinite number of redirects. 50 | * Default: 50 51 | * https://curl.se/libcurl/c/CURLOPT_MAXREDIRS.html 52 | **/ 53 | // NOLINTNEXTLINE (google-runtime-int) 54 | long maximum{50L}; 55 | /** 56 | * Follow 3xx redirects. 57 | * Default: true 58 | * https://curl.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html 59 | **/ 60 | bool follow{true}; 61 | /** 62 | * Continue to send authentication (user+password) credentials when following locations, even when hostname changed. 63 | * Default: false 64 | * https://curl.se/libcurl/c/CURLOPT_UNRESTRICTED_AUTH.html 65 | **/ 66 | bool cont_send_cred{false}; 67 | /** 68 | * Flags to control how to act after a redirect for a post request. 69 | * Default: POST_ALL 70 | **/ 71 | PostRedirectFlags post_flags{PostRedirectFlags::POST_ALL}; 72 | 73 | Redirect() = default; 74 | // NOLINTNEXTLINE (google-runtime-int) 75 | Redirect(long p_maximum, bool p_follow, bool p_cont_send_cred, PostRedirectFlags p_post_flags) : maximum(p_maximum), follow(p_follow), cont_send_cred(p_cont_send_cred), post_flags(p_post_flags){}; 76 | // NOLINTNEXTLINE (google-runtime-int) 77 | explicit Redirect(long p_maximum) : maximum(p_maximum){}; 78 | explicit Redirect(bool p_follow) : follow(p_follow){}; 79 | Redirect(bool p_follow, bool p_cont_send_cred) : follow(p_follow), cont_send_cred(p_cont_send_cred){}; 80 | explicit Redirect(PostRedirectFlags p_post_flags) : post_flags(p_post_flags){}; 81 | }; 82 | } // namespace cpr 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/reserve_size.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_RESERVE_SIZE_H 2 | #define CPR_RESERVE_SIZE_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class ReserveSize { 9 | public: 10 | ReserveSize(const size_t _size) : size(_size) {} 11 | 12 | size_t size = 0; 13 | }; 14 | 15 | } // namespace cpr 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/response.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_RESPONSE_H 2 | #define CPR_RESPONSE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "cpr/cert_info.h" 12 | #include "cpr/cookies.h" 13 | #include "cpr/cprtypes.h" 14 | #include "cpr/error.h" 15 | #include "cpr/ssl_options.h" 16 | #include "cpr/util.h" 17 | 18 | namespace cpr { 19 | 20 | class Response { 21 | private: 22 | std::shared_ptr curl_{nullptr}; 23 | 24 | public: 25 | // Ignored here since libcurl uses a long for this. 26 | // NOLINTNEXTLINE(google-runtime-int) 27 | long status_code{}; 28 | std::string text{}; 29 | Header header{}; 30 | Url url{}; 31 | double elapsed{}; 32 | Cookies cookies{}; 33 | Error error{}; 34 | std::string raw_header{}; 35 | std::string status_line{}; 36 | std::string reason{}; 37 | cpr_off_t uploaded_bytes{}; 38 | cpr_off_t downloaded_bytes{}; 39 | // Ignored here since libcurl uses a long for this. 40 | // NOLINTNEXTLINE(google-runtime-int) 41 | long redirect_count{}; 42 | 43 | Response() = default; 44 | Response(std::shared_ptr curl, std::string&& p_text, std::string&& p_header_string, Cookies&& p_cookies, Error&& p_error); 45 | std::vector GetCertInfos(); 46 | Response(const Response& other) = default; 47 | Response(Response&& old) noexcept = default; 48 | ~Response() noexcept = default; 49 | 50 | Response& operator=(Response&& old) noexcept = default; 51 | Response& operator=(const Response& other) = default; 52 | }; 53 | } // namespace cpr 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/session.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_SESSION_H 2 | #define CPR_SESSION_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "cpr/accept_encoding.h" 11 | #include "cpr/auth.h" 12 | #include "cpr/bearer.h" 13 | #include "cpr/body.h" 14 | #include "cpr/callback.h" 15 | #include "cpr/connect_timeout.h" 16 | #include "cpr/cookies.h" 17 | #include "cpr/cprtypes.h" 18 | #include "cpr/curlholder.h" 19 | #include "cpr/http_version.h" 20 | #include "cpr/interface.h" 21 | #include "cpr/limit_rate.h" 22 | #include "cpr/local_port.h" 23 | #include "cpr/local_port_range.h" 24 | #include "cpr/low_speed.h" 25 | #include "cpr/multipart.h" 26 | #include "cpr/parameters.h" 27 | #include "cpr/payload.h" 28 | #include "cpr/proxies.h" 29 | #include "cpr/proxyauth.h" 30 | #include "cpr/range.h" 31 | #include "cpr/redirect.h" 32 | #include "cpr/reserve_size.h" 33 | #include "cpr/response.h" 34 | #include "cpr/ssl_options.h" 35 | #include "cpr/timeout.h" 36 | #include "cpr/unix_socket.h" 37 | #include "cpr/user_agent.h" 38 | #include "cpr/verbose.h" 39 | 40 | namespace cpr { 41 | 42 | using AsyncResponse = std::future; 43 | 44 | class Interceptor; 45 | 46 | class Session : public std::enable_shared_from_this { 47 | public: 48 | Session(); 49 | Session(const Session& other) = delete; 50 | 51 | ~Session() = default; 52 | 53 | Session& operator=(Session&& old) noexcept = default; 54 | Session& operator=(const Session& other) = delete; 55 | 56 | void SetUrl(const Url& url); 57 | void SetParameters(const Parameters& parameters); 58 | void SetParameters(Parameters&& parameters); 59 | void SetHeader(const Header& header); 60 | void UpdateHeader(const Header& header); 61 | void SetTimeout(const Timeout& timeout); 62 | void SetConnectTimeout(const ConnectTimeout& timeout); 63 | void SetAuth(const Authentication& auth); 64 | // Only supported with libcurl >= 7.61.0. 65 | // As an alternative use SetHeader and add the token manually. 66 | #if LIBCURL_VERSION_NUM >= 0x073D00 67 | void SetBearer(const Bearer& token); 68 | #endif 69 | void SetUserAgent(const UserAgent& ua); 70 | void SetPayload(Payload&& payload); 71 | void SetPayload(const Payload& payload); 72 | void SetProxies(Proxies&& proxies); 73 | void SetProxies(const Proxies& proxies); 74 | void SetProxyAuth(ProxyAuthentication&& proxy_auth); 75 | void SetProxyAuth(const ProxyAuthentication& proxy_auth); 76 | void SetMultipart(Multipart&& multipart); 77 | void SetMultipart(const Multipart& multipart); 78 | void SetRedirect(const Redirect& redirect); 79 | void SetCookies(const Cookies& cookies); 80 | void SetBody(Body&& body); 81 | void SetBody(const Body& body); 82 | void SetLowSpeed(const LowSpeed& low_speed); 83 | void SetVerifySsl(const VerifySsl& verify); 84 | void SetUnixSocket(const UnixSocket& unix_socket); 85 | void SetSslOptions(const SslOptions& options); 86 | void SetReadCallback(const ReadCallback& read); 87 | void SetHeaderCallback(const HeaderCallback& header); 88 | void SetWriteCallback(const WriteCallback& write); 89 | void SetProgressCallback(const ProgressCallback& progress); 90 | void SetDebugCallback(const DebugCallback& debug); 91 | void SetVerbose(const Verbose& verbose); 92 | void SetInterface(const Interface& iface); 93 | void SetLocalPort(const LocalPort& local_port); 94 | void SetLocalPortRange(const LocalPortRange& local_port_range); 95 | void SetHttpVersion(const HttpVersion& version); 96 | void SetRange(const Range& range); 97 | void SetMultiRange(const MultiRange& multi_range); 98 | void SetReserveSize(const ReserveSize& reserve_size); 99 | void SetAcceptEncoding(const AcceptEncoding& accept_encoding); 100 | void SetAcceptEncoding(AcceptEncoding&& accept_encoding); 101 | void SetLimitRate(const LimitRate& limit_rate); 102 | 103 | // Used in templated functions 104 | void SetOption(const Url& url); 105 | void SetOption(const Parameters& parameters); 106 | void SetOption(Parameters&& parameters); 107 | void SetOption(const Header& header); 108 | void SetOption(const Timeout& timeout); 109 | void SetOption(const ConnectTimeout& timeout); 110 | void SetOption(const Authentication& auth); 111 | // Only supported with libcurl >= 7.61.0. 112 | // As an alternative use SetHeader and add the token manually. 113 | #if LIBCURL_VERSION_NUM >= 0x073D00 114 | void SetOption(const Bearer& auth); 115 | #endif 116 | void SetOption(const UserAgent& ua); 117 | void SetOption(Payload&& payload); 118 | void SetOption(const Payload& payload); 119 | void SetOption(const LimitRate& limit_rate); 120 | void SetOption(Proxies&& proxies); 121 | void SetOption(const Proxies& proxies); 122 | void SetOption(ProxyAuthentication&& proxy_auth); 123 | void SetOption(const ProxyAuthentication& proxy_auth); 124 | void SetOption(Multipart&& multipart); 125 | void SetOption(const Multipart& multipart); 126 | void SetOption(const Redirect& redirect); 127 | void SetOption(const Cookies& cookies); 128 | void SetOption(Body&& body); 129 | void SetOption(const Body& body); 130 | void SetOption(const ReadCallback& read); 131 | void SetOption(const HeaderCallback& header); 132 | void SetOption(const WriteCallback& write); 133 | void SetOption(const ProgressCallback& progress); 134 | void SetOption(const DebugCallback& debug); 135 | void SetOption(const LowSpeed& low_speed); 136 | void SetOption(const VerifySsl& verify); 137 | void SetOption(const Verbose& verbose); 138 | void SetOption(const UnixSocket& unix_socket); 139 | void SetOption(const SslOptions& options); 140 | void SetOption(const Interface& iface); 141 | void SetOption(const LocalPort& local_port); 142 | void SetOption(const LocalPortRange& local_port_range); 143 | void SetOption(const HttpVersion& version); 144 | void SetOption(const Range& range); 145 | void SetOption(const MultiRange& multi_range); 146 | void SetOption(const ReserveSize& reserve_size); 147 | void SetOption(const AcceptEncoding& accept_encoding); 148 | void SetOption(AcceptEncoding&& accept_encoding); 149 | 150 | cpr_off_t GetDownloadFileLength(); 151 | /** 152 | * Attempt to preallocate enough memory for specified number of characters in the response string. 153 | * Pass 0 to disable this behavior and let the response string be allocated dynamically on demand. 154 | * 155 | * Example: 156 | * cpr::Session session; 157 | * session.SetUrl(cpr::Url{"http://xxx/file"}); 158 | * session.ResponseStringReserve(1024 * 512); // Reserve space for at least 1024 * 512 characters 159 | * cpr::Response r = session.Get(); 160 | **/ 161 | void ResponseStringReserve(size_t size); 162 | Response Delete(); 163 | Response Download(const WriteCallback& write); 164 | Response Download(std::ofstream& file); 165 | Response Get(); 166 | Response Head(); 167 | Response Options(); 168 | Response Patch(); 169 | Response Post(); 170 | Response Put(); 171 | 172 | AsyncResponse GetAsync(); 173 | AsyncResponse DeleteAsync(); 174 | AsyncResponse DownloadAsync(const WriteCallback& write); 175 | AsyncResponse DownloadAsync(std::ofstream& file); 176 | AsyncResponse HeadAsync(); 177 | AsyncResponse OptionsAsync(); 178 | AsyncResponse PatchAsync(); 179 | AsyncResponse PostAsync(); 180 | AsyncResponse PutAsync(); 181 | 182 | template 183 | auto GetCallback(Then then) -> std::future; 184 | template 185 | auto PostCallback(Then then) -> std::future; 186 | template 187 | auto PutCallback(Then then) -> std::future; 188 | template 189 | auto HeadCallback(Then then) -> std::future; 190 | template 191 | auto DeleteCallback(Then then) -> std::future; 192 | template 193 | auto OptionsCallback(Then then) -> std::future; 194 | template 195 | auto PatchCallback(Then then) -> std::future; 196 | 197 | std::shared_ptr GetCurlHolder(); 198 | std::string GetFullRequestUrl(); 199 | 200 | void PrepareDelete(); 201 | void PrepareGet(); 202 | void PrepareHead(); 203 | void PrepareOptions(); 204 | void PreparePatch(); 205 | void PreparePost(); 206 | void PreparePut(); 207 | Response Complete(CURLcode curl_error); 208 | 209 | void AddInterceptor(const std::shared_ptr& pinterceptor); 210 | 211 | private: 212 | // Interceptors should be able to call the private procceed() function 213 | friend Interceptor; 214 | 215 | bool hasBodyOrPayload_{false}; 216 | bool chunkedTransferEncoding_{false}; 217 | std::shared_ptr curl_; 218 | Url url_; 219 | Parameters parameters_; 220 | Proxies proxies_; 221 | ProxyAuthentication proxyAuth_; 222 | Header header_; 223 | AcceptEncoding acceptEncoding_; 224 | /** 225 | * Will be set by the read callback. 226 | * Ensures that the "Transfer-Encoding" is set to "chunked", if not overriden in header_. 227 | **/ 228 | ReadCallback readcb_; 229 | HeaderCallback headercb_; 230 | WriteCallback writecb_; 231 | ProgressCallback progresscb_; 232 | DebugCallback debugcb_; 233 | size_t response_string_reserve_size_{0}; 234 | std::string response_string_; 235 | std::string header_string_; 236 | std::queue> interceptors_; 237 | 238 | Response makeDownloadRequest(); 239 | Response makeRequest(); 240 | Response proceed(); 241 | void prepareCommon(); 242 | void SetHeaderInternal(); 243 | std::shared_ptr GetSharedPtrFromThis(); 244 | }; 245 | 246 | template 247 | auto Session::GetCallback(Then then) -> std::future { 248 | auto shared_this = GetSharedPtrFromThis(); 249 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Get()); }, std::move(then)); 250 | } 251 | 252 | template 253 | auto Session::PostCallback(Then then) -> std::future { 254 | auto shared_this = GetSharedPtrFromThis(); 255 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Post()); }, std::move(then)); 256 | } 257 | 258 | template 259 | auto Session::PutCallback(Then then) -> std::future { 260 | auto shared_this = GetSharedPtrFromThis(); 261 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Put()); }, std::move(then)); 262 | } 263 | 264 | template 265 | auto Session::HeadCallback(Then then) -> std::future { 266 | auto shared_this = GetSharedPtrFromThis(); 267 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Head()); }, std::move(then)); 268 | } 269 | 270 | template 271 | auto Session::DeleteCallback(Then then) -> std::future { 272 | auto shared_this = GetSharedPtrFromThis(); 273 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Delete()); }, std::move(then)); 274 | } 275 | 276 | template 277 | auto Session::OptionsCallback(Then then) -> std::future { 278 | auto shared_this = GetSharedPtrFromThis(); 279 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Options()); }, std::move(then)); 280 | } 281 | 282 | template 283 | auto Session::PatchCallback(Then then) -> std::future { 284 | auto shared_this = GetSharedPtrFromThis(); 285 | return async([shared_this](Then then_inner) { return then_inner(shared_this->Patch()); }, std::move(then)); 286 | } 287 | 288 | } // namespace cpr 289 | 290 | #endif 291 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_SINGLETON_H 2 | #define CPR_SINGLETON_H 3 | 4 | #include 5 | 6 | #ifndef CPR_DISABLE_COPY 7 | #define CPR_DISABLE_COPY(Class) \ 8 | Class(const Class&) = delete; \ 9 | Class& operator=(const Class&) = delete; 10 | #endif 11 | 12 | #ifndef CPR_SINGLETON_DECL 13 | #define CPR_SINGLETON_DECL(Class) \ 14 | public: \ 15 | static Class* GetInstance(); \ 16 | static void ExitInstance(); \ 17 | private: \ 18 | CPR_DISABLE_COPY(Class) \ 19 | static Class* s_pInstance; \ 20 | static std::mutex s_mutex; 21 | #endif 22 | 23 | #ifndef CPR_SINGLETON_IMPL 24 | #define CPR_SINGLETON_IMPL(Class) \ 25 | Class* Class::s_pInstance = nullptr; \ 26 | std::mutex Class::s_mutex; \ 27 | Class* Class::GetInstance() { \ 28 | if (s_pInstance == nullptr) { \ 29 | s_mutex.lock(); \ 30 | if (s_pInstance == nullptr) { \ 31 | s_pInstance = new Class; \ 32 | } \ 33 | s_mutex.unlock(); \ 34 | } \ 35 | return s_pInstance; \ 36 | } \ 37 | void Class::ExitInstance() { \ 38 | s_mutex.lock(); \ 39 | if (s_pInstance) { \ 40 | delete s_pInstance; \ 41 | s_pInstance = nullptr; \ 42 | } \ 43 | s_mutex.unlock(); \ 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/ssl_ctx.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_SSL_CTX_H 2 | #define CPR_SSL_CTX_H 3 | 4 | #include "cpr/ssl_options.h" 5 | #include 6 | 7 | #if SUPPORT_CURLOPT_SSL_CTX_FUNCTION 8 | 9 | namespace cpr { 10 | 11 | /** 12 | * This callback function loads a CA certificate from raw_cert_buf and gets called by libcurl 13 | * just before the initialization of an SSL connection. 14 | * The raw_cert_buf argument is set with the CURLOPT_SSL_CTX_DATA option and has to be a nul 15 | * terminated buffer. 16 | * 17 | * Sources: https://curl.se/libcurl/c/CURLOPT_SSL_CTX_FUNCTION.html 18 | * https://curl.se/libcurl/c/CURLOPT_SSL_CTX_DATA.html 19 | */ 20 | CURLcode sslctx_function_load_ca_cert_from_buffer(CURL* curl, void* sslctx, void* raw_cert_buf); 21 | 22 | } // Namespace cpr 23 | 24 | #endif 25 | 26 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/status_codes.h: -------------------------------------------------------------------------------- 1 | #ifndef _CPR_STATUS_CODES 2 | #define _CPR_STATUS_CODES 3 | #include 4 | namespace cpr { 5 | namespace status { 6 | // Information responses 7 | constexpr std::int32_t HTTP_CONTINUE = 100; 8 | constexpr std::int32_t HTTP_SWITCHING_PROTOCOL = 101; 9 | constexpr std::int32_t HTTP_PROCESSING = 102; 10 | constexpr std::int32_t HTTP_EARLY_HINTS = 103; 11 | // Successful responses 12 | constexpr std::int32_t HTTP_OK = 200; 13 | constexpr std::int32_t HTTP_CREATED = 201; 14 | constexpr std::int32_t HTTP_ACCEPTED = 202; 15 | constexpr std::int32_t HTTP_NON_AUTHORITATIVE_INFORMATION = 203; 16 | constexpr std::int32_t HTTP_NO_CONTENT = 204; 17 | constexpr std::int32_t HTTP_RESET_CONTENT = 205; 18 | constexpr std::int32_t HTTP_PARTIAL_CONTENT = 206; 19 | constexpr std::int32_t HTTP_MULTI_STATUS = 207; 20 | constexpr std::int32_t HTTP_ALREADY_REPORTED = 208; 21 | constexpr std::int32_t HTTP_IM_USED = 226; 22 | // Redirection messages 23 | constexpr std::int32_t HTTP_MULTIPLE_CHOICE = 300; 24 | constexpr std::int32_t HTTP_MOVED_PERMANENTLY = 301; 25 | constexpr std::int32_t HTTP_FOUND = 302; 26 | constexpr std::int32_t HTTP_SEE_OTHER = 303; 27 | constexpr std::int32_t HTTP_NOT_MODIFIED = 304; 28 | constexpr std::int32_t HTTP_USE_PROXY = 305; 29 | constexpr std::int32_t HTTP_UNUSED = 306; 30 | constexpr std::int32_t HTTP_TEMPORARY_REDIRECT = 307; 31 | constexpr std::int32_t HTTP_PERMANENT_REDIRECT = 308; 32 | // Client error responses 33 | constexpr std::int32_t HTTP_BAD_REQUEST = 400; 34 | constexpr std::int32_t HTTP_UNAUTHORIZED = 401; 35 | constexpr std::int32_t HTTP_PAYMENT_REQUIRED = 402; 36 | constexpr std::int32_t HTTP_FORBIDDEN = 403; 37 | constexpr std::int32_t HTTP_NOT_FOUND = 404; 38 | constexpr std::int32_t HTTP_METHOD_NOT_ALLOWED = 405; 39 | constexpr std::int32_t HTTP_NOT_ACCEPTABLE = 406; 40 | constexpr std::int32_t HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; 41 | constexpr std::int32_t HTTP_REQUEST_TIMEOUT = 408; 42 | constexpr std::int32_t HTTP_CONFLICT = 409; 43 | constexpr std::int32_t HTTP_GONE = 410; 44 | constexpr std::int32_t HTTP_LENGTH_REQUIRED = 411; 45 | constexpr std::int32_t HTTP_PRECONDITION_FAILED = 412; 46 | constexpr std::int32_t HTTP_PAYLOAD_TOO_LARGE = 413; 47 | constexpr std::int32_t HTTP_URI_TOO_LONG = 414; 48 | constexpr std::int32_t HTTP_UNSUPPORTED_MEDIA_TYPE = 415; 49 | constexpr std::int32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; 50 | constexpr std::int32_t HTTP_EXPECTATION_FAILED = 417; 51 | constexpr std::int32_t HTTP_IM_A_TEAPOT = 418; 52 | constexpr std::int32_t HTTP_MISDIRECTED_REQUEST = 421; 53 | constexpr std::int32_t HTTP_UNPROCESSABLE_ENTITY = 422; 54 | constexpr std::int32_t HTTP_LOCKED = 423; 55 | constexpr std::int32_t HTTP_FAILED_DEPENDENCY = 424; 56 | constexpr std::int32_t HTTP_TOO_EARLY = 425; 57 | constexpr std::int32_t HTTP_UPGRADE_REQUIRED = 426; 58 | constexpr std::int32_t HTTP_PRECONDITION_REQUIRED = 428; 59 | constexpr std::int32_t HTTP_TOO_MANY_REQUESTS = 429; 60 | constexpr std::int32_t HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; 61 | constexpr std::int32_t HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; 62 | // Server response errors 63 | constexpr std::int32_t HTTP_INTERNAL_SERVER_ERROR = 500; 64 | constexpr std::int32_t HTTP_NOT_IMPLEMENTED = 501; 65 | constexpr std::int32_t HTTP_BAD_GATEWAY = 502; 66 | constexpr std::int32_t HTTP_SERVICE_UNAVAILABLE = 503; 67 | constexpr std::int32_t HTTP_GATEWAY_TIMEOUT = 504; 68 | constexpr std::int32_t HTTP_HTTP_VERSION_NOT_SUPPORTED = 505; 69 | constexpr std::int32_t HTTP_VARIANT_ALSO_NEGOTIATES = 506; 70 | constexpr std::int32_t HTTP_INSUFFICIENT_STORAGE = 507; 71 | constexpr std::int32_t HTTP_LOOP_DETECTED = 508; 72 | constexpr std::int32_t HTTP_NOT_EXTENDED = 510; 73 | constexpr std::int32_t HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; 74 | 75 | constexpr std::int32_t INFO_CODE_OFFSET = 100; 76 | constexpr std::int32_t SUCCESS_CODE_OFFSET = 200; 77 | constexpr std::int32_t REDIRECT_CODE_OFFSET = 300; 78 | constexpr std::int32_t CLIENT_ERROR_CODE_OFFSET = 400; 79 | constexpr std::int32_t SERVER_ERROR_CODE_OFFSET = 500; 80 | constexpr std::int32_t MISC_CODE_OFFSET = 600; 81 | 82 | constexpr bool is_informational(const std::int32_t code) { 83 | return (code >= INFO_CODE_OFFSET && code < SUCCESS_CODE_OFFSET); 84 | } 85 | constexpr bool is_success(const std::int32_t code) { 86 | return (code >= SUCCESS_CODE_OFFSET && code < REDIRECT_CODE_OFFSET); 87 | } 88 | constexpr bool is_redirect(const std::int32_t code) { 89 | return (code >= REDIRECT_CODE_OFFSET && code < CLIENT_ERROR_CODE_OFFSET); 90 | } 91 | constexpr bool is_client_error(const std::int32_t code) { 92 | return (code >= CLIENT_ERROR_CODE_OFFSET && code < SERVER_ERROR_CODE_OFFSET); 93 | } 94 | constexpr bool is_server_error(const std::int32_t code) { 95 | return (code >= SERVER_ERROR_CODE_OFFSET && code < MISC_CODE_OFFSET); 96 | } 97 | 98 | } // namespace status 99 | } // namespace cpr 100 | #endif -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/threadpool.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_THREAD_POOL_H 2 | #define CPR_THREAD_POOL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM std::thread::hardware_concurrency() 17 | 18 | constexpr size_t CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM = 1; 19 | constexpr std::chrono::milliseconds CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME{60000}; 20 | 21 | namespace cpr { 22 | 23 | class ThreadPool { 24 | public: 25 | using Task = std::function; 26 | 27 | explicit ThreadPool(size_t min_threads = CPR_DEFAULT_THREAD_POOL_MIN_THREAD_NUM, size_t max_threads = CPR_DEFAULT_THREAD_POOL_MAX_THREAD_NUM, std::chrono::milliseconds max_idle_ms = CPR_DEFAULT_THREAD_POOL_MAX_IDLE_TIME); 28 | 29 | virtual ~ThreadPool(); 30 | 31 | void SetMinThreadNum(size_t min_threads) { 32 | min_thread_num = min_threads; 33 | } 34 | void SetMaxThreadNum(size_t max_threads) { 35 | max_thread_num = max_threads; 36 | } 37 | void SetMaxIdleTime(std::chrono::milliseconds ms) { 38 | max_idle_time = ms; 39 | } 40 | size_t GetCurrentThreadNum() { 41 | return cur_thread_num; 42 | } 43 | size_t GetIdleThreadNum() { 44 | return idle_thread_num; 45 | } 46 | bool IsStarted() { 47 | return status != STOP; 48 | } 49 | bool IsStopped() { 50 | return status == STOP; 51 | } 52 | 53 | int Start(size_t start_threads = 0); 54 | int Stop(); 55 | int Pause(); 56 | int Resume(); 57 | int Wait(); 58 | 59 | /** 60 | * Return a future, calling future.get() will wait task done and return RetType. 61 | * Submit(fn, args...) 62 | * Submit(std::bind(&Class::mem_fn, &obj)) 63 | * Submit(std::mem_fn(&Class::mem_fn, &obj)) 64 | **/ 65 | template 66 | auto Submit(Fn&& fn, Args&&... args) -> std::future { 67 | if (status == STOP) { 68 | Start(); 69 | } 70 | if (idle_thread_num <= 0 && cur_thread_num < max_thread_num) { 71 | CreateThread(); 72 | } 73 | using RetType = decltype(fn(args...)); 74 | auto task = std::make_shared >(std::bind(std::forward(fn), std::forward(args)...)); 75 | std::future future = task->get_future(); 76 | { 77 | std::lock_guard locker(task_mutex); 78 | tasks.emplace([task] { (*task)(); }); 79 | } 80 | 81 | task_cond.notify_one(); 82 | return future; 83 | } 84 | 85 | private: 86 | bool CreateThread(); 87 | void AddThread(std::thread* thread); 88 | void DelThread(std::thread::id id); 89 | 90 | public: 91 | size_t min_thread_num; 92 | size_t max_thread_num; 93 | std::chrono::milliseconds max_idle_time; 94 | 95 | private: 96 | enum Status { 97 | STOP, 98 | RUNNING, 99 | PAUSE, 100 | }; 101 | 102 | struct ThreadData { 103 | std::shared_ptr thread; 104 | std::thread::id id; 105 | Status status; 106 | time_t start_time; 107 | time_t stop_time; 108 | }; 109 | 110 | std::atomic status; 111 | std::atomic cur_thread_num; 112 | std::atomic idle_thread_num; 113 | std::list threads; 114 | std::mutex thread_mutex; 115 | std::queue tasks; 116 | std::mutex task_mutex; 117 | std::condition_variable task_cond; 118 | }; 119 | 120 | } // namespace cpr 121 | 122 | #endif 123 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/timeout.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_TIMEOUT_H 2 | #define CPR_TIMEOUT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace cpr { 8 | 9 | class Timeout { 10 | public: 11 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 12 | Timeout(const std::chrono::milliseconds& duration) : ms{duration} {} 13 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 14 | Timeout(const std::int32_t& milliseconds) : Timeout{std::chrono::milliseconds(milliseconds)} {} 15 | 16 | // No way around since curl uses a long here. 17 | // NOLINTNEXTLINE(google-runtime-int) 18 | long Milliseconds() const; 19 | 20 | std::chrono::milliseconds ms; 21 | }; 22 | 23 | } // namespace cpr 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/unix_socket.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_UNIX_SOCKET_H 2 | #define CPR_UNIX_SOCKET_H 3 | 4 | #include 5 | 6 | namespace cpr { 7 | 8 | class UnixSocket { 9 | public: 10 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 11 | UnixSocket(std::string&& unix_socket) : unix_socket_(std::move(unix_socket)) {} 12 | 13 | const char* GetUnixSocketString() const noexcept; 14 | 15 | private: 16 | const std::string unix_socket_; 17 | }; 18 | 19 | } // namespace cpr 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/user_agent.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_USERAGENT_H 2 | #define CPR_USERAGENT_H 3 | 4 | #include 5 | #include 6 | 7 | #include "cpr/cprtypes.h" 8 | 9 | namespace cpr { 10 | class UserAgent : public StringHolder { 11 | public: 12 | UserAgent() : StringHolder() {} 13 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 14 | UserAgent(const std::string& useragent) : StringHolder(useragent) {} 15 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 16 | UserAgent(std::string&& useragent) : StringHolder(std::move(useragent)) {} 17 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 18 | UserAgent(const char* useragent) : StringHolder(useragent) {} 19 | UserAgent(const char* str, size_t len) : StringHolder(str, len) {} 20 | UserAgent(const std::initializer_list args) : StringHolder(args) {} 21 | UserAgent(const UserAgent& other) = default; 22 | UserAgent(UserAgent&& old) noexcept = default; 23 | ~UserAgent() override = default; 24 | 25 | UserAgent& operator=(UserAgent&& old) noexcept = default; 26 | UserAgent& operator=(const UserAgent& other) = default; 27 | }; 28 | 29 | } // namespace cpr 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/util.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_UTIL_H 2 | #define CPR_UTIL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "cpr/callback.h" 9 | #include "cpr/cookies.h" 10 | #include "cpr/cprtypes.h" 11 | #include "cpr/curlholder.h" 12 | 13 | namespace cpr { 14 | namespace util { 15 | 16 | Header parseHeader(const std::string& headers, std::string* status_line = nullptr, std::string* reason = nullptr); 17 | Cookies parseCookies(curl_slist* raw_cookies); 18 | size_t readUserFunction(char* ptr, size_t size, size_t nitems, const ReadCallback* read); 19 | size_t headerUserFunction(char* ptr, size_t size, size_t nmemb, const HeaderCallback* header); 20 | size_t writeFunction(char* ptr, size_t size, size_t nmemb, std::string* data); 21 | size_t writeFileFunction(char* ptr, size_t size, size_t nmemb, std::ofstream* file); 22 | size_t writeUserFunction(char* ptr, size_t size, size_t nmemb, const WriteCallback* write); 23 | #if LIBCURL_VERSION_NUM < 0x072000 24 | int progressUserFunction(const ProgressCallback* progress, double dltotal, double dlnow, double ultotal, double ulnow); 25 | #else 26 | int progressUserFunction(const ProgressCallback* progress, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); 27 | #endif 28 | int debugUserFunction(CURL* handle, curl_infotype type, char* data, size_t size, const DebugCallback* debug); 29 | std::vector split(const std::string& to_split, char delimiter); 30 | std::string urlEncode(const std::string& s); 31 | std::string urlDecode(const std::string& s); 32 | 33 | /** 34 | * Override the content of the provided string to hide sensitive data. The 35 | * string content after invocation is undefined. The string size is reset to zero. 36 | * impl. based on: 37 | * https://github.com/ojeda/secure_clear/blob/master/example-implementation/secure_clear.h 38 | **/ 39 | void secureStringClear(std::string& s); 40 | bool isTrue(const std::string& s); 41 | 42 | } // namespace util 43 | } // namespace cpr 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/cpr/verbose.h: -------------------------------------------------------------------------------- 1 | #ifndef CPR_VERBOSE_H_ 2 | #define CPR_VERBOSE_H_ 3 | 4 | namespace cpr { 5 | 6 | class Verbose { 7 | public: 8 | Verbose() = default; 9 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) 10 | Verbose(const bool p_verbose) : verbose{p_verbose} {} 11 | 12 | bool verbose = true; 13 | }; 14 | 15 | } // namespace cpr 16 | 17 | 18 | #endif /* CPR_VERBOSE_H_ */ 19 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_CURLVER_H 2 | #define CURLINC_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | /* This header file contains nothing but libcurl version info, generated by 28 | a script at release-time. This was made its own header file in 7.11.2 */ 29 | 30 | /* This is the global package copyright */ 31 | #define LIBCURL_COPYRIGHT "1996 - 2022 Daniel Stenberg, ." 32 | 33 | /* This is the version number of the libcurl package from which this header 34 | file origins: */ 35 | #define LIBCURL_VERSION "7.84.0-DEV" 36 | 37 | /* The numeric version number is also available "in parts" by using these 38 | defines: */ 39 | #define LIBCURL_VERSION_MAJOR 7 40 | #define LIBCURL_VERSION_MINOR 84 41 | #define LIBCURL_VERSION_PATCH 0 42 | 43 | /* This is the numeric version of the libcurl version number, meant for easier 44 | parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will 45 | always follow this syntax: 46 | 47 | 0xXXYYZZ 48 | 49 | Where XX, YY and ZZ are the main version, release and patch numbers in 50 | hexadecimal (using 8 bits each). All three numbers are always represented 51 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 52 | appears as "0x090b07". 53 | 54 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 55 | and it is always a greater number in a more recent release. It makes 56 | comparisons with greater than and less than work. 57 | 58 | Note: This define is the full hex number and _does not_ use the 59 | CURL_VERSION_BITS() macro since curl's own configure script greps for it 60 | and needs it to contain the full number. 61 | */ 62 | #define LIBCURL_VERSION_NUM 0x075400 63 | 64 | /* 65 | * This is the date and time when the full source package was created. The 66 | * timestamp is not stored in git, as the timestamp is properly set in the 67 | * tarballs by the maketgz script. 68 | * 69 | * The format of the date follows this template: 70 | * 71 | * "2007-11-23" 72 | */ 73 | #define LIBCURL_TIMESTAMP "[unreleased]" 74 | 75 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) 76 | #define CURL_AT_LEAST_VERSION(x,y,z) \ 77 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) 78 | 79 | #endif /* CURLINC_CURLVER_H */ 80 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/easy.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_EASY_H 2 | #define CURLINC_EASY_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Flag bits in the curl_blob struct: */ 31 | #define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */ 32 | #define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */ 33 | 34 | struct curl_blob { 35 | void *data; 36 | size_t len; 37 | unsigned int flags; /* bit 0 is defined, the rest are reserved and should be 38 | left zeroes */ 39 | }; 40 | 41 | CURL_EXTERN CURL *curl_easy_init(void); 42 | CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); 43 | CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); 44 | CURL_EXTERN void curl_easy_cleanup(CURL *curl); 45 | 46 | /* 47 | * NAME curl_easy_getinfo() 48 | * 49 | * DESCRIPTION 50 | * 51 | * Request internal information from the curl session with this function. The 52 | * third argument MUST be a pointer to a long, a pointer to a char * or a 53 | * pointer to a double (as the documentation describes elsewhere). The data 54 | * pointed to will be filled in accordingly and can be relied upon only if the 55 | * function returns CURLE_OK. This function is intended to get used *AFTER* a 56 | * performed transfer, all results from this function are undefined until the 57 | * transfer is completed. 58 | */ 59 | CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); 60 | 61 | 62 | /* 63 | * NAME curl_easy_duphandle() 64 | * 65 | * DESCRIPTION 66 | * 67 | * Creates a new curl session handle with the same options set for the handle 68 | * passed in. Duplicating a handle could only be a matter of cloning data and 69 | * options, internal state info and things like persistent connections cannot 70 | * be transferred. It is useful in multithreaded applications when you can run 71 | * curl_easy_duphandle() for each new thread to avoid a series of identical 72 | * curl_easy_setopt() invokes in every thread. 73 | */ 74 | CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); 75 | 76 | /* 77 | * NAME curl_easy_reset() 78 | * 79 | * DESCRIPTION 80 | * 81 | * Re-initializes a CURL handle to the default values. This puts back the 82 | * handle to the same state as it was in when it was just created. 83 | * 84 | * It does keep: live connections, the Session ID cache, the DNS cache and the 85 | * cookies. 86 | */ 87 | CURL_EXTERN void curl_easy_reset(CURL *curl); 88 | 89 | /* 90 | * NAME curl_easy_recv() 91 | * 92 | * DESCRIPTION 93 | * 94 | * Receives data from the connected socket. Use after successful 95 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 96 | */ 97 | CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, 98 | size_t *n); 99 | 100 | /* 101 | * NAME curl_easy_send() 102 | * 103 | * DESCRIPTION 104 | * 105 | * Sends data over the connected socket. Use after successful 106 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 107 | */ 108 | CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, 109 | size_t buflen, size_t *n); 110 | 111 | 112 | /* 113 | * NAME curl_easy_upkeep() 114 | * 115 | * DESCRIPTION 116 | * 117 | * Performs connection upkeep for the given session handle. 118 | */ 119 | CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl); 120 | 121 | #ifdef __cplusplus 122 | } 123 | #endif 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/header.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_HEADER_H 2 | #define CURLINC_HEADER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | struct curl_header { 28 | char *name; /* this might not use the same case */ 29 | char *value; 30 | size_t amount; /* number of headers using this name */ 31 | size_t index; /* ... of this instance, 0 or higher */ 32 | unsigned int origin; /* see bits below */ 33 | void *anchor; /* handle privately used by libcurl */ 34 | }; 35 | 36 | /* 'origin' bits */ 37 | #define CURLH_HEADER (1<<0) /* plain server header */ 38 | #define CURLH_TRAILER (1<<1) /* trailers */ 39 | #define CURLH_CONNECT (1<<2) /* CONNECT headers */ 40 | #define CURLH_1XX (1<<3) /* 1xx headers */ 41 | #define CURLH_PSEUDO (1<<4) /* pseudo headers */ 42 | 43 | typedef enum { 44 | CURLHE_OK, 45 | CURLHE_BADINDEX, /* header exists but not with this index */ 46 | CURLHE_MISSING, /* no such header exists */ 47 | CURLHE_NOHEADERS, /* no headers at all exist (yet) */ 48 | CURLHE_NOREQUEST, /* no request with this number was used */ 49 | CURLHE_OUT_OF_MEMORY, /* out of memory while processing */ 50 | CURLHE_BAD_ARGUMENT, /* a function argument was not okay */ 51 | CURLHE_NOT_BUILT_IN /* if API was disabled in the build */ 52 | } CURLHcode; 53 | 54 | CURL_EXTERN CURLHcode curl_easy_header(CURL *easy, 55 | const char *name, 56 | size_t index, 57 | unsigned int origin, 58 | int request, 59 | struct curl_header **hout); 60 | 61 | CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy, 62 | unsigned int origin, 63 | int request, 64 | struct curl_header *prev); 65 | 66 | #endif /* CURLINC_HEADER_H */ 67 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_MPRINTF_H 2 | #define CURLINC_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #include 28 | #include /* needed for FILE */ 29 | #include "curl.h" /* for CURL_EXTERN */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | CURL_EXTERN int curl_mprintf(const char *format, ...); 36 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 37 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 38 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 39 | const char *format, ...); 40 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 41 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 42 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 43 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 44 | const char *format, va_list args); 45 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 46 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* CURLINC_MPRINTF_H */ 53 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/options.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_OPTIONS_H 2 | #define CURLINC_OPTIONS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef enum { 32 | CURLOT_LONG, /* long (a range of values) */ 33 | CURLOT_VALUES, /* (a defined set or bitmask) */ 34 | CURLOT_OFF_T, /* curl_off_t (a range of values) */ 35 | CURLOT_OBJECT, /* pointer (void *) */ 36 | CURLOT_STRING, /* (char * to zero terminated buffer) */ 37 | CURLOT_SLIST, /* (struct curl_slist *) */ 38 | CURLOT_CBPTR, /* (void * passed as-is to a callback) */ 39 | CURLOT_BLOB, /* blob (struct curl_blob *) */ 40 | CURLOT_FUNCTION /* function pointer */ 41 | } curl_easytype; 42 | 43 | /* Flag bits */ 44 | 45 | /* "alias" means it is provided for old programs to remain functional, 46 | we prefer another name */ 47 | #define CURLOT_FLAG_ALIAS (1<<0) 48 | 49 | /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size 50 | to use for curl_easy_setopt() for the given id */ 51 | struct curl_easyoption { 52 | const char *name; 53 | CURLoption id; 54 | curl_easytype type; 55 | unsigned int flags; 56 | }; 57 | 58 | CURL_EXTERN const struct curl_easyoption * 59 | curl_easy_option_by_name(const char *name); 60 | 61 | CURL_EXTERN const struct curl_easyoption * 62 | curl_easy_option_by_id(CURLoption id); 63 | 64 | CURL_EXTERN const struct curl_easyoption * 65 | curl_easy_option_next(const struct curl_easyoption *prev); 66 | 67 | #ifdef __cplusplus 68 | } /* end of extern "C" */ 69 | #endif 70 | #endif /* CURLINC_OPTIONS_H */ 71 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_STDCHEADERS_H 2 | #define CURLINC_STDCHEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #include 28 | 29 | size_t fread(void *, size_t, size_t, FILE *); 30 | size_t fwrite(const void *, size_t, size_t, FILE *); 31 | 32 | int strcasecmp(const char *, const char *); 33 | int strncasecmp(const char *, const char *, size_t); 34 | 35 | #endif /* CURLINC_STDCHEADERS_H */ 36 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/curl/urlapi.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_URLAPI_H 2 | #define CURLINC_URLAPI_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * SPDX-License-Identifier: curl 24 | * 25 | ***************************************************************************/ 26 | 27 | #include "curl.h" 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* the error codes for the URL API */ 34 | typedef enum { 35 | CURLUE_OK, 36 | CURLUE_BAD_HANDLE, /* 1 */ 37 | CURLUE_BAD_PARTPOINTER, /* 2 */ 38 | CURLUE_MALFORMED_INPUT, /* 3 */ 39 | CURLUE_BAD_PORT_NUMBER, /* 4 */ 40 | CURLUE_UNSUPPORTED_SCHEME, /* 5 */ 41 | CURLUE_URLDECODE, /* 6 */ 42 | CURLUE_OUT_OF_MEMORY, /* 7 */ 43 | CURLUE_USER_NOT_ALLOWED, /* 8 */ 44 | CURLUE_UNKNOWN_PART, /* 9 */ 45 | CURLUE_NO_SCHEME, /* 10 */ 46 | CURLUE_NO_USER, /* 11 */ 47 | CURLUE_NO_PASSWORD, /* 12 */ 48 | CURLUE_NO_OPTIONS, /* 13 */ 49 | CURLUE_NO_HOST, /* 14 */ 50 | CURLUE_NO_PORT, /* 15 */ 51 | CURLUE_NO_QUERY, /* 16 */ 52 | CURLUE_NO_FRAGMENT, /* 17 */ 53 | CURLUE_NO_ZONEID, /* 18 */ 54 | CURLUE_BAD_FILE_URL, /* 19 */ 55 | CURLUE_BAD_FRAGMENT, /* 20 */ 56 | CURLUE_BAD_HOSTNAME, /* 21 */ 57 | CURLUE_BAD_IPV6, /* 22 */ 58 | CURLUE_BAD_LOGIN, /* 23 */ 59 | CURLUE_BAD_PASSWORD, /* 24 */ 60 | CURLUE_BAD_PATH, /* 25 */ 61 | CURLUE_BAD_QUERY, /* 26 */ 62 | CURLUE_BAD_SCHEME, /* 27 */ 63 | CURLUE_BAD_SLASHES, /* 28 */ 64 | CURLUE_BAD_USER, /* 29 */ 65 | CURLUE_LAST 66 | } CURLUcode; 67 | 68 | typedef enum { 69 | CURLUPART_URL, 70 | CURLUPART_SCHEME, 71 | CURLUPART_USER, 72 | CURLUPART_PASSWORD, 73 | CURLUPART_OPTIONS, 74 | CURLUPART_HOST, 75 | CURLUPART_PORT, 76 | CURLUPART_PATH, 77 | CURLUPART_QUERY, 78 | CURLUPART_FRAGMENT, 79 | CURLUPART_ZONEID /* added in 7.65.0 */ 80 | } CURLUPart; 81 | 82 | #define CURLU_DEFAULT_PORT (1<<0) /* return default port number */ 83 | #define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set, 84 | if the port number matches the 85 | default for the scheme */ 86 | #define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if 87 | missing */ 88 | #define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */ 89 | #define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */ 90 | #define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */ 91 | #define CURLU_URLDECODE (1<<6) /* URL decode on get */ 92 | #define CURLU_URLENCODE (1<<7) /* URL encode on set */ 93 | #define CURLU_APPENDQUERY (1<<8) /* append a form style part */ 94 | #define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */ 95 | #define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the 96 | scheme is unknown. */ 97 | #define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */ 98 | 99 | typedef struct Curl_URL CURLU; 100 | 101 | /* 102 | * curl_url() creates a new CURLU handle and returns a pointer to it. 103 | * Must be freed with curl_url_cleanup(). 104 | */ 105 | CURL_EXTERN CURLU *curl_url(void); 106 | 107 | /* 108 | * curl_url_cleanup() frees the CURLU handle and related resources used for 109 | * the URL parsing. It will not free strings previously returned with the URL 110 | * API. 111 | */ 112 | CURL_EXTERN void curl_url_cleanup(CURLU *handle); 113 | 114 | /* 115 | * curl_url_dup() duplicates a CURLU handle and returns a new copy. The new 116 | * handle must also be freed with curl_url_cleanup(). 117 | */ 118 | CURL_EXTERN CURLU *curl_url_dup(CURLU *in); 119 | 120 | /* 121 | * curl_url_get() extracts a specific part of the URL from a CURLU 122 | * handle. Returns error code. The returned pointer MUST be freed with 123 | * curl_free() afterwards. 124 | */ 125 | CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what, 126 | char **part, unsigned int flags); 127 | 128 | /* 129 | * curl_url_set() sets a specific part of the URL in a CURLU handle. Returns 130 | * error code. The passed in string will be copied. Passing a NULL instead of 131 | * a part string, clears that part. 132 | */ 133 | CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what, 134 | const char *part, unsigned int flags); 135 | 136 | /* 137 | * curl_url_strerror() turns a CURLUcode value into the equivalent human 138 | * readable error string. This is useful for printing meaningful error 139 | * messages. 140 | */ 141 | CURL_EXTERN const char *curl_url_strerror(CURLUcode); 142 | 143 | #ifdef __cplusplus 144 | } /* end of extern "C" */ 145 | #endif 146 | 147 | #endif /* CURLINC_URLAPI_H */ 148 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/include/nghttp2/nghttp2ver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * nghttp2 - HTTP/2 C Library 3 | * 4 | * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | */ 25 | #ifndef NGHTTP2VER_H 26 | #define NGHTTP2VER_H 27 | 28 | /** 29 | * @macro 30 | * Version number of the nghttp2 library release 31 | */ 32 | #define NGHTTP2_VERSION "1.49.0" 33 | 34 | /** 35 | * @macro 36 | * Numerical representation of the version number of the nghttp2 library 37 | * release. This is a 24 bit number with 8 bits for major number, 8 bits 38 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. 39 | */ 40 | #define NGHTTP2_VERSION_NUM 0x013100 41 | 42 | #endif /* NGHTTP2VER_H */ 43 | #ifndef NGHTTP2_STATICLIB 44 | # define NGHTTP2_STATICLIB 45 | #endif 46 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/cpr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/cpr.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/cprd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/cprd.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/libcurl.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/libcurld.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/libcurld.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/nghttp2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/nghttp2.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/nghttp2d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/nghttp2d.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/zlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/zlib.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/3rdpart/cpr/lib/zlibd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/3rdpart/cpr/lib/zlibd.lib -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.cpp -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.h -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.pro: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------- 2 | # This file is generated by the Qt Visual Studio Tools. 3 | # ------------------------------------------------------ 4 | 5 | QT += widgets network multimedia 6 | TEMPLATE = app 7 | TARGET = TianLi_Launcher 8 | RC_ICONS = MainIcon.ico 9 | # QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\" 10 | RC_FILE = GenshinImpactNaturalLawIcon.rc 11 | DESTDIR = ../x64/Release 12 | CONFIG += release 13 | LIBS += -L"." 14 | DEPENDPATH += . 15 | MOC_DIR += . 16 | OBJECTS_DIR += release 17 | UI_DIR += . 18 | RCC_DIR += . 19 | HEADERS += ./SingleApplication.h\ 20 | ./ModulesManager.h \ 21 | ./VersionNumber.h \ 22 | ./DownloadManager.h \ 23 | ./resource.h \ 24 | ./SettingData.h \ 25 | ./GenshinImpactNaturalLaw.h \ 26 | ./QtWidgetsSetting.h \ 27 | ./UpdataModule.h \ 28 | ./QtWidgetsMessageBox.h 29 | SOURCES += ./SingleApplication.cpp\ 30 | ./DownloadManager.cpp \ 31 | ./ModulesManager.cpp \ 32 | ./QtWidgetsMessageBox.cpp \ 33 | ./QtWidgetsSetting.cpp \ 34 | ./SettingData.cpp \ 35 | ./UpdataModule.cpp \ 36 | ./VersionNumber.cpp \ 37 | ./GenshinImpactNaturalLaw.cpp \ 38 | ./main.cpp 39 | FORMS += ./GenshinImpactNaturalLaw.ui \ 40 | ./QtWidgetsMessageBox.ui \ 41 | ./QtWidgetsSetting.ui 42 | RESOURCES += GenshinImpactNaturalLaw.qrc \ 43 | QtWidgetsMessageBox.qrc \ 44 | QtWidgetsSetting.qrc 45 | QMAKE_CXXFLAGS += -charset:utf-8 -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | resource/page/page1.png 5 | resource/page/page2.png 6 | 7 | 8 | resource/LinkeIcon/Bilibili_icon.png 9 | resource/LinkeIcon/GitHub_icon.png 10 | resource/LinkeIcon/QQ_icon.png 11 | resource/LinkeIcon/KYJG_yuanshen.png 12 | 13 | 14 | resource/icon/TrayIcon.ico 15 | resource/icon/MainIcon.ico 16 | resource/icon/TrayIcon.png 17 | resource/icon/ICON.png 18 | 19 | 20 | resource/bg.png 21 | 22 | 23 | resource/titlebutton/bexit0.png 24 | resource/titlebutton/bexit1.png 25 | resource/titlebutton/bmin0.png 26 | resource/titlebutton/bmin1.png 27 | resource/titlebutton/bset0.png 28 | resource/titlebutton/bset1.png 29 | 30 | 31 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | RelDyn 10 | x64 11 | 12 | 13 | Release 14 | x64 15 | 16 | 17 | 18 | {89ED3DF1-AAB3-49DF-8F0D-8F5F0E5B06B6} 19 | QtVS_v304 20 | 10.0.17763.0 21 | 10.0 22 | 10.0 23 | $(MSBuildProjectDirectory)\QtMsBuild 24 | 25 | 26 | 27 | Application 28 | v143 29 | 30 | 31 | Application 32 | v143 33 | 34 | 35 | Application 36 | v143 37 | 38 | 39 | 40 | 41 | 42 | 43 | static_5.15.7 44 | core;gui;multimedia;network;widgets 45 | debug 46 | 47 | 48 | $(Qt_Dir_Static) 49 | core;gui;multimedia;network;widgets 50 | release 51 | 52 | 53 | 5.14.2_msvc2017_64 54 | core;gui;multimedia;network;widgets 55 | release 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 天理启动器 77 | D:\Qt\5.14.2\msvc2017_64\include;D:\Qt\5.14.2\msvc2017_64\include\QtCore;D:\Qt\5.14.2\msvc2017_64\include\QtWidgets;$(VC_IncludePath);$(WindowsSDK_IncludePath); 78 | 79 | 80 | 天理启动器 81 | D:\Qt\5.14.2\msvc2017_64\include;D:\Qt\5.14.2\msvc2017_64\include\QtCore;D:\Qt\5.14.2\msvc2017_64\include\QtWidgets;$(IncludePath) 82 | 83 | 84 | 天理启动器 85 | D:\Qt\5.14.2\msvc2017_64\include;D:\Qt\5.14.2\msvc2017_64\include\QtCore;D:\Qt\5.14.2\msvc2017_64\include\QtWidgets;$(IncludePath) 86 | 87 | 88 | 89 | Level3 90 | stdcpp20 91 | stdc17 92 | 3rdpart\cpr\include;%(AdditionalIncludeDirectories) 93 | 94 | 95 | AsInvoker 96 | 3rdpart\cpr\lib;%(AdditionalLibraryDirectories) 97 | 98 | 99 | version\update_version.bat 100 | 101 | 102 | 103 | 104 | AsInvoker 105 | 3rdpart\cpr\lib;%(AdditionalLibraryDirectories) 106 | 107 | 108 | 109 | version\update_version.bat 110 | 111 | 112 | stdcpp20 113 | 114 | 115 | stdc17 116 | 3rdpart\cpr\include;%(AdditionalIncludeDirectories) 117 | 118 | 119 | 120 | 121 | AsInvoker 122 | 3rdpart\cpr\lib;%(AdditionalLibraryDirectories) 123 | 124 | 125 | 126 | version\update_version.bat 127 | 128 | 129 | stdcpp20 130 | 131 | 132 | stdc17 133 | 3rdpart\cpr\include;%(AdditionalIncludeDirectories) 134 | 135 | 136 | 137 | 138 | true 139 | true 140 | ProgramDatabase 141 | Disabled 142 | MultiThreadedDebug 143 | 144 | 145 | Windows 146 | true 147 | 148 | 149 | 150 | 151 | true 152 | true 153 | None 154 | MaxSpeed 155 | MultiThreaded 156 | 157 | 158 | Windows 159 | false 160 | 161 | 162 | 163 | 164 | true 165 | true 166 | None 167 | MaxSpeed 168 | MultiThreadedDLL 169 | 170 | 171 | Windows 172 | false 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | Designer 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLaw.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 18 | ui 19 | 20 | 21 | {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} 22 | ts 23 | 24 | 25 | {be3a97ee-f551-4f87-9d5d-b94853d35682} 26 | 27 | 28 | {ab4be5dc-2905-403f-a082-b3f531cacfe8} 29 | 30 | 31 | {59889dd1-812f-49af-97cc-1e9b78790110} 32 | 33 | 34 | {11f9cd72-9646-4469-a4ad-e1c816126ce6} 35 | 36 | 37 | 38 | 39 | Resource Files 40 | 41 | 42 | Form Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Resource Files 52 | 53 | 54 | Resource Files 55 | 56 | 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | 81 | 82 | Header Files 83 | 84 | 85 | Header Files 86 | 87 | 88 | Header Files 89 | 90 | 91 | 92 | 93 | Form Files 94 | 95 | 96 | Form Files 97 | 98 | 99 | 100 | 101 | Header Files 102 | 103 | 104 | Header Files 105 | 106 | 107 | Header Files 108 | 109 | 110 | Header Files 111 | 112 | 113 | version 114 | 115 | 116 | 3rdpart\cpr 117 | 118 | 119 | define 120 | 121 | 122 | define 123 | 124 | 125 | 126 | 127 | Resource Files 128 | 129 | 130 | 131 | 132 | Resource Files 133 | 134 | 135 | 136 | 137 | 138 | version 139 | 140 | 141 | version 142 | 143 | 144 | 145 | 146 | Translation Files 147 | 148 | 149 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/GenshinImpactNaturalLawIcon.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/GenshinImpactNaturalLawIcon.rc -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/ModulesManager.cpp: -------------------------------------------------------------------------------- 1 | #include "ModulesManager.h" 2 | 3 | ModulesManager::ModulesManager() 4 | { 5 | refresh(); 6 | } 7 | 8 | ModulesManager::~ModulesManager() 9 | { 10 | } 11 | 12 | void ModulesManager::refresh() 13 | { 14 | ModuleFileList.clear(); 15 | ModuleExeList.clear(); 16 | 17 | QDir dir; 18 | QString modulesPath = QApplication::applicationDirPath() + "/modules/"; 19 | if (!dir.exists(modulesPath)) { 20 | dir.mkpath(modulesPath); 21 | } 22 | else 23 | { 24 | QDir modulesDir(modulesPath); 25 | QStringList ModulesDirList; 26 | 27 | modulesDir.setFilter(QDir::Dirs); 28 | 29 | foreach(QFileInfo fullDir, modulesDir.entryInfoList()) 30 | { 31 | if (fullDir.fileName() == "." || fullDir.fileName() == "..") continue; 32 | 33 | ModulesDirList.append(fullDir.absoluteFilePath() + "/"); 34 | 35 | } 36 | 37 | for (int i = 0; i < ModulesDirList.size(); i++) 38 | { 39 | QDir modulesExeDir(ModulesDirList[i]); 40 | QStringList nameFilters; 41 | nameFilters << "*.exe"; 42 | QStringList moduleExe = modulesExeDir.entryList(nameFilters, QDir::Files | QDir::Readable, QDir::Name); 43 | ModuleFileList.append(ModulesDirList[i] + moduleExe[0]); 44 | ModuleExeList.append(moduleExe[0]); 45 | } 46 | } 47 | } 48 | 49 | QStringList ModulesManager::getModuleList() 50 | { 51 | return ModuleFileList; 52 | } 53 | 54 | QStringList ModulesManager::getModuleNameList() 55 | { 56 | return ModuleExeList; 57 | } 58 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/ModulesManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | class ModulesManager 8 | { 9 | QStringList ModuleFileList; 10 | QStringList ModuleExeList; 11 | public: 12 | ModulesManager(); 13 | ~ModulesManager(); 14 | void refresh(); 15 | 16 | QStringList getModuleList(); 17 | QStringList getModuleNameList(); 18 | 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | GenshinImpactNaturalLaw 21 | Default publisher display name 22 | assets/logo_store.png 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsMessageBox.cpp: -------------------------------------------------------------------------------- 1 | #include "QtWidgetsMessageBox.h" 2 | 3 | QtWidgetsMessageBox::QtWidgetsMessageBox(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | ui.setupUi(this); 7 | setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow); 8 | 9 | connect(ui.pushButton_OK, &QPushButton::clicked, this, &QtWidgetsMessageBox::ok_and_close); 10 | connect(ui.pushButton_Cancel, &QPushButton::clicked, this, &QtWidgetsMessageBox::cancel_and_close); 11 | } 12 | 13 | QtWidgetsMessageBox::~QtWidgetsMessageBox() 14 | { 15 | } 16 | 17 | void QtWidgetsMessageBox::setMessage(QString message) 18 | { 19 | ui.label_Message->setText(message); 20 | } 21 | 22 | void QtWidgetsMessageBox::cancel_and_close() 23 | { 24 | signal_cancel(); 25 | close(); 26 | } 27 | 28 | void QtWidgetsMessageBox::ok_and_close() 29 | { 30 | signal_ok(); 31 | close(); 32 | } 33 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsMessageBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "ui_QtWidgetsMessageBox.h" 4 | 5 | class QtWidgetsMessageBox : public QWidget 6 | { 7 | Q_OBJECT 8 | 9 | public: 10 | QtWidgetsMessageBox(QWidget *parent = Q_NULLPTR); 11 | ~QtWidgetsMessageBox(); 12 | 13 | public: 14 | void setMessage(QString message); 15 | private: 16 | Ui::QtWidgetsMessageBox ui; 17 | 18 | private slots: 19 | void cancel_and_close(); 20 | void ok_and_close(); 21 | signals: 22 | void signal_cancel(); 23 | void signal_ok(); 24 | }; 25 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsMessageBox.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | resource/QMessageBox/bg.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsMessageBox.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtWidgetsMessageBox 4 | 5 | 6 | 7 | 0 8 | 0 9 | 530 10 | 354 11 | 12 | 13 | 14 | 提示 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 271 23 | 273 24 | 190 25 | 48 26 | 27 | 28 | 29 | 30 | 微软雅黑 31 | 13 32 | 33 | 34 | 35 | QPushButton{ 36 | background-color:rgb(57, 59, 64); 37 | color:rgb(244, 216, 168); 38 | border:none; 39 | border-radius:4px; 40 | } 41 | QPushButton:hover { 42 | background-color:rgb(77, 79, 83); 43 | } 44 | QPushButton:pressed { 45 | background-color:rgb(57, 59, 64); 46 | } 47 | 48 | 49 | 确认 50 | 51 | 52 | 53 | 54 | 55 | 241 56 | 39 57 | 48 58 | 25 59 | 60 | 61 | 62 | 63 | 微软雅黑 64 | 18 65 | 66 | 67 | 68 | QLabel{ 69 | color:rgb(57, 59, 64); 70 | } 71 | 72 | 73 | 提示 74 | 75 | 76 | Qt::AlignCenter 77 | 78 | 79 | 80 | 81 | 82 | 58 83 | 132 84 | 414 85 | 90 86 | 87 | 88 | 89 | 90 | 微软雅黑 91 | 13 92 | PreferDefault 93 | true 94 | 95 | 96 | 97 | QLabel{ 98 | color:rgb(57, 59, 64); 99 | } 100 | 101 | 102 | 未能找到游戏资源,建议确认路径是否正确或获取最新游戏资源 103 | 104 | 105 | Qt::AlignHCenter|Qt::AlignTop 106 | 107 | 108 | true 109 | 110 | 111 | 112 | 113 | 114 | 0 115 | 0 116 | 550 117 | 354 118 | 119 | 120 | 121 | QLabel{ 122 | background-image:url(:/BackgroundImage/resource/QMessageBox/bg.png); 123 | } 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 69 134 | 273 135 | 190 136 | 48 137 | 138 | 139 | 140 | 141 | 微软雅黑 142 | 13 143 | 144 | 145 | 146 | QPushButton{ 147 | background-color:rgb(255, 255, 255); 148 | color:rgb(220, 188, 96); 149 | border:1px solid rgb(204, 204, 204); 150 | border-radius:4px; 151 | } 152 | QPushButton:hover { 153 | background-color:rgb(251, 248, 239); 154 | } 155 | QPushButton:pressed { 156 | background-color:rgb(236, 233, 224); 157 | } 158 | 159 | 160 | 取消 161 | 162 | 163 | BackgrouundImageRect 164 | pushButton_OK 165 | label_Title 166 | label_Message 167 | pushButton_Cancel 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsSetting.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/QtWidgetsSetting.cpp -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsSetting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "ui_QtWidgetsSetting.h" 15 | #include "QtWidgetsMessageBox.h" 16 | #include "SettingData.h" 17 | #include "ModulesManager.h" 18 | #include "VersionNumber.h" 19 | 20 | class QtWidgetsSetting : public QWidget 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | QtWidgetsSetting(QWidget *parent = Q_NULLPTR); 26 | ~QtWidgetsSetting(); 27 | 28 | private: 29 | Ui::QtWidgetsSetting ui; 30 | 31 | public: 32 | SettingData *setting = nullptr; 33 | ModulesManager *modules = nullptr; 34 | std::string net_version = ""; 35 | private: 36 | QPoint m_Press; 37 | QPoint m_Move; 38 | bool leftBtnClk = false; 39 | 40 | QString KeyString1 = tr("Str_NowVer:");//QString::QStringLiteral("当前版本:"); 41 | 42 | QtWidgetsMessageBox *WidgetsMessageBox = nullptr; 43 | QLabel *MainMaskLabel = nullptr; 44 | QScrollBar *scrBar = nullptr; 45 | 46 | QVBoxLayout *ModulesSubVBoxLayout = nullptr; 47 | std::vector ModulesItemCheckBoxList; 48 | VersionNumber myVersion; 49 | private: 50 | std::vector UIButtonList; 51 | std::vector ScrollLabelList; 52 | private: 53 | void uiConnectButton(); 54 | private: 55 | void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 56 | void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 57 | void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 58 | 59 | public slots: 60 | void SetSetting(SettingData *setting); 61 | void SetModules(ModulesManager *modules); 62 | void UpdataShowOptions(); 63 | void UpdataModulesOptions(); 64 | 65 | private slots: 66 | void CloseSelf(); 67 | void Cancel(); 68 | void OK(); 69 | void SwitchOptions(); 70 | void BarMove_ChangeButton(); 71 | 72 | void UpdataLauncher_GetUrlVersion(); 73 | 74 | 75 | void ShowMessageBox(); 76 | 77 | void CheckBox_SettingAutoRun(int arg); 78 | void CheckBox_SettingPupoGame(int arg); 79 | void CheckBox_SettingRunModule(int arg); 80 | 81 | void RadioButton_SettingExitOrMini(); 82 | 83 | void CheckOptions_CheckGameLauncher(); 84 | void CheckOptions_CheckGame(); 85 | void CheckOptions_CheckModule(); 86 | void CheckOptions_RefreshModule(); 87 | void CheckOptions_UpdataLauncher(); 88 | void CheckOptions_UpdataGameLauncher(); 89 | void CheckOptions_UpdataGame(); 90 | 91 | void CheckBox_SettingModulesOptions(int arg); 92 | 93 | 94 | void ReceiveCloseSelfSignalFromWidgetsMessageBox(); 95 | signals: 96 | void SendSettingToMainWidgets(); 97 | void SendCloseSelfSignalToMainWidgets(); 98 | void SendCloseAllSignalToMainWidgets(); 99 | }; 100 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/QtWidgetsSetting.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | genshinimpactnaturallaw_zh.qm 4 | 5 | 6 | resource/QtWidgetsSetting/RadioButton/radiobutton_checked.png 7 | resource/QtWidgetsSetting/RadioButton/radiobutton_checked_hover.png 8 | resource/QtWidgetsSetting/RadioButton/radiobutton_checked_pressed.png 9 | resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked.png 10 | resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_hover.png 11 | resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_pressed.png 12 | 13 | 14 | resource/QtWidgetsSetting/CheckBox/checkbox_checked.png 15 | resource/QtWidgetsSetting/CheckBox/checkbox_checked_hover.png 16 | resource/QtWidgetsSetting/CheckBox/checkbox_checked_pressed.png 17 | resource/QtWidgetsSetting/CheckBox/checkbox_unchecked.png 18 | resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_hover.png 19 | resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_pressed.png 20 | 21 | 22 | resource/QtWidgetsSetting/Exit/exit0.png 23 | resource/QtWidgetsSetting/Exit/exit1.png 24 | 25 | 26 | resource/QtWidgetsSetting/UI/title.png 27 | 28 | 29 | resource/QtWidgetsSetting/bg.png 30 | 31 | 32 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/SettingData.cpp: -------------------------------------------------------------------------------- 1 | #include "SettingData.h" 2 | 3 | SettingData::SettingData() 4 | { 5 | IniSettingFile = new QSettings(QDir::currentPath() + "/config.ini", QSettings::IniFormat); 6 | 7 | is_auto_run = IniSettingFile->value("General/is_auto_run").toBool(); 8 | is_start_pupowindows = IniSettingFile->value("General/is_start_pupowindows").toBool(); 9 | is_start_module = IniSettingFile->value("General/is_start_module").toBool(); 10 | is_exit_ismini = IniSettingFile->value("General/is_exit_ismini").toBool(); 11 | 12 | launcher_install_path = IniSettingFile->value("Launcher/launcher_install_path").toString(); 13 | game_dynamic_bg_name = IniSettingFile->value("Launcher/game_dynamic_bg_name").toString(); 14 | 15 | game_install_path = IniSettingFile->value("Game/game_install_path").toString(); 16 | game_start_name = IniSettingFile->value("Game/game_start_name").toString(); 17 | 18 | is_first_exit = IniSettingFile->value("Module/is_first_exit").toBool(); 19 | mods_number = IniSettingFile->value("Module/mods_number").toInt(); 20 | for (int i = 0; i < mods_number; i++) 21 | { 22 | is_start_mods_list.push_back(IniSettingFile->value("Module/mods_" + QString::number(i)).toBool()); 23 | } 24 | } 25 | 26 | SettingData::~SettingData() 27 | { 28 | //sync(); 29 | } 30 | 31 | SettingData & SettingData::operator=(const SettingData & setting) 32 | { 33 | IniSettingFile = setting.IniSettingFile; 34 | 35 | is_auto_run = setting.is_auto_run; 36 | is_start_pupowindows = setting.is_start_pupowindows; 37 | is_start_module = setting.is_start_module; 38 | is_exit_ismini = setting.is_exit_ismini; 39 | launcher_install_path = setting.launcher_install_path; 40 | game_dynamic_bg_name = setting.game_dynamic_bg_name; 41 | game_install_path = setting.game_install_path; 42 | game_start_name = setting.game_start_name; 43 | parm_borderless = setting.parm_borderless; 44 | is_first_exit = setting.is_first_exit; 45 | mods_number = setting.mods_number; 46 | is_start_mods_list = setting.is_start_mods_list; 47 | return *this; 48 | } 49 | 50 | void SettingData::load() 51 | { 52 | is_auto_run = IniSettingFile->value("General/is_auto_run").toBool(); 53 | is_start_pupowindows = IniSettingFile->value("General/is_start_pupowindows").toBool(); 54 | is_start_module = IniSettingFile->value("General/is_start_module").toBool(); 55 | is_exit_ismini = IniSettingFile->value("General/is_exit_ismini").toBool(); 56 | 57 | launcher_install_path = IniSettingFile->value("Launcher/launcher_install_path").toString(); 58 | game_dynamic_bg_name = IniSettingFile->value("Launcher/game_dynamic_bg_name").toString(); 59 | 60 | game_install_path = IniSettingFile->value("Game/game_install_path").toString(); 61 | game_start_name = IniSettingFile->value("Game/game_start_name").toString(); 62 | 63 | is_first_exit = IniSettingFile->value("Module/is_first_exit").toBool(); 64 | mods_number = IniSettingFile->value("Module/mods_number").toInt(); 65 | for (int i = 0; i < mods_number; i++) 66 | { 67 | is_start_mods_list.push_back(IniSettingFile->value("Module/mods_" + QString::number(i)).toBool()); 68 | } 69 | } 70 | 71 | void SettingData::sync() 72 | { 73 | IniSettingFile->setValue("General/is_auto_run", is_auto_run); 74 | IniSettingFile->setValue("General/is_start_pupowindows", is_start_pupowindows); 75 | IniSettingFile->setValue("General/is_start_module", is_start_module); 76 | IniSettingFile->setValue("General/is_exit_ismini", is_exit_ismini); 77 | 78 | IniSettingFile->setValue("Launcher/launcher_install_path", launcher_install_path); 79 | IniSettingFile->setValue("Launcher/game_dynamic_bg_name", game_dynamic_bg_name); 80 | 81 | IniSettingFile->setValue("Game/game_install_path", game_install_path); 82 | IniSettingFile->setValue("Game/game_start_name", game_start_name); 83 | 84 | IniSettingFile->setValue("Module/is_first_exit", is_first_exit); 85 | IniSettingFile->setValue("Module/mods_number", mods_number); 86 | for (int i = 0; i < mods_number; i++) 87 | { 88 | IniSettingFile->setValue("Module/mods_"+ QString::number(i), (bool)(is_start_mods_list[i])); 89 | } 90 | 91 | IniSettingFile->sync(); 92 | } 93 | 94 | bool SettingData::tryGetGamePath() 95 | { 96 | QFileInfo file(launcher_install_path + "/launcher.exe"); 97 | if (file.exists() == false) 98 | { 99 | return false; 100 | } 101 | else 102 | { 103 | QSettings *launcherIniFile; 104 | launcherIniFile = new QSettings(launcher_install_path + "/config.ini", QSettings::IniFormat); 105 | game_install_path = launcherIniFile->value("launcher/game_install_path").toString(); 106 | //game_dynamic_bg_name = launcherIniFile->value("launcher/game_dynamic_bg_name").toString(); 107 | game_start_name = launcherIniFile->value("launcher/game_start_name").toString(); 108 | } 109 | return true; 110 | } 111 | 112 | bool SettingData::trySetAutoRun() 113 | { 114 | QString application_name = QApplication::applicationName(); 115 | QSettings RegRun_Setting("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); 116 | 117 | if (is_auto_run) 118 | { 119 | QString application_path = QApplication::applicationFilePath(); 120 | application_path = "\"" + application_path + "\""; 121 | RegRun_Setting.setValue(application_name,application_path.replace("/", "\\")); 122 | 123 | if (RegRun_Setting.value(application_name).toString().isEmpty()) 124 | { 125 | return false; 126 | } 127 | else 128 | { 129 | return true; 130 | } 131 | } 132 | else 133 | { 134 | RegRun_Setting.remove(application_name); 135 | 136 | if (RegRun_Setting.value(application_name).toString().isEmpty()) 137 | { 138 | return true; 139 | } 140 | else 141 | { 142 | return false; 143 | } 144 | } 145 | 146 | return false; 147 | } 148 | 149 | QString SettingData::gamepath() 150 | { 151 | return game_install_path; 152 | } 153 | 154 | QString SettingData::Command_NoBorderStartGame() 155 | { 156 | QString res(game_install_path); 157 | res.append("/" + game_start_name); 158 | res.append(parm_borderless); 159 | return res.replace(QRegExp("/"), "\\");// game_install_path + game_start_name + parm_borderless; 160 | } 161 | 162 | QString SettingData::Command_StartGame() 163 | { 164 | QString res(game_install_path); 165 | res.append("/" + game_start_name); 166 | res = "\"" + res + "\""; 167 | 168 | return res.replace(QRegExp("/"), "\\"); 169 | } 170 | 171 | QString SettingData::Command_ExtendParam() 172 | { 173 | QString res; 174 | if (is_start_pupowindows) 175 | { 176 | res.append(parm_borderless); 177 | } 178 | return res; 179 | } 180 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/SettingData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | class SettingData 10 | { 11 | QSettings *IniSettingFile = nullptr; 12 | 13 | public: 14 | // [General] 15 | bool is_auto_run = false; 16 | bool is_start_pupowindows = true; 17 | bool is_start_module = true; 18 | bool is_exit_ismini = false; 19 | QString launcher_install_path = "E:/Genshin Impact/"; 20 | QString game_dynamic_bg_name = "000.gif"; 21 | QString game_install_path = "E:/Genshin Impact/Genshin Impact Game/"; 22 | QString game_start_name = "YuanShen.exe"; 23 | QString parm_borderless = " -popupwindow"; 24 | bool is_first_exit = false; 25 | int mods_number = 0; 26 | vector is_start_mods_list; 27 | 28 | public: 29 | SettingData(); 30 | ~SettingData(); 31 | SettingData& operator=(const SettingData& setting); 32 | 33 | 34 | void load(); 35 | void sync(); 36 | 37 | bool tryGetGamePath(); 38 | bool trySetAutoRun(); 39 | 40 | QString gamepath(); 41 | QString Command_NoBorderStartGame(); 42 | QString Command_StartGame(); 43 | QString Command_ExtendParam(); 44 | 45 | 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/SingleApplication.cpp: -------------------------------------------------------------------------------- 1 | #include "SingleApplication.h" 2 | 3 | SingleApplication::SingleApplication(int &argc, char *argv[], const QString uniqueKey) : QApplication(argc, argv) 4 | { 5 | sharedMemory.setKey(uniqueKey); 6 | if (sharedMemory.attach()) 7 | _isRunning = true; 8 | else 9 | { 10 | _isRunning = false; 11 | // attach data to shared memory. 12 | QByteArray byteArray("0"); // default value to note that no message is available. 13 | if (!sharedMemory.create(byteArray.size())) 14 | { 15 | #ifdef _DEBUG 16 | qDebug("Unable to create single instance."); 17 | #endif 18 | return; 19 | } 20 | sharedMemory.lock(); 21 | char *to = (char*)sharedMemory.data(); 22 | const char *from = byteArray.data(); 23 | memcpy(to, from, qMin(sharedMemory.size(), byteArray.size())); 24 | sharedMemory.unlock(); 25 | 26 | // start checking for messages of other instances. 27 | QTimer *timer = new QTimer(this); 28 | connect(timer, SIGNAL(timeout()), this, SLOT(checkForMessage())); 29 | timer->start(1000); 30 | } 31 | } 32 | 33 | // public slots. 34 | void SingleApplication::checkForMessage() 35 | { 36 | sharedMemory.lock(); 37 | QByteArray byteArray = QByteArray((char*)sharedMemory.constData(), sharedMemory.size()); 38 | sharedMemory.unlock(); 39 | if (byteArray.left(1) == "0") 40 | return; 41 | byteArray.remove(0, 1); 42 | QString message = QString::fromUtf8(byteArray.constData()); 43 | emit messageAvailable(message); 44 | 45 | // remove message from shared memory. 46 | byteArray = "0"; 47 | sharedMemory.lock(); 48 | char *to = (char*)sharedMemory.data(); 49 | const char *from = byteArray.data(); 50 | memcpy(to, from, qMin(sharedMemory.size(), byteArray.size())); 51 | sharedMemory.unlock(); 52 | } 53 | 54 | // public functions. 55 | bool SingleApplication::isRunning() 56 | { 57 | return _isRunning; 58 | } 59 | 60 | bool SingleApplication::sendMessage(const QString &message) 61 | { 62 | if (!_isRunning) 63 | return false; 64 | 65 | QByteArray byteArray("1"); 66 | byteArray.append(message.toUtf8()); 67 | byteArray.append('/0'); // < should be as char here, not a string! 68 | sharedMemory.lock(); 69 | char *to = (char*)sharedMemory.data(); 70 | const char *from = byteArray.data(); 71 | memcpy(to, from, qMin(sharedMemory.size(), byteArray.size())); 72 | sharedMemory.unlock(); 73 | return true; 74 | } -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/SingleApplication.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class SingleApplication : public QApplication 9 | { 10 | Q_OBJECT 11 | public: 12 | SingleApplication(int &argc, char *argv[], const QString uniqueKey); 13 | bool isRunning(); 14 | bool sendMessage(const QString &message); 15 | public slots: 16 | void checkForMessage(); 17 | signals: 18 | void messageAvailable(QString message); 19 | private: 20 | bool _isRunning; 21 | QSharedMemory sharedMemory; 22 | }; 23 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/SingleApplicationPrivate.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) Itay Grudev 2015 - 2020 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | // 24 | // W A R N I N G !!! 25 | // ----------------- 26 | // 27 | // This file is not part of the SingleApplication API. It is used purely as an 28 | // implementation detail. This header file may change from version to 29 | // version without notice, or may even be removed. 30 | // 31 | #pragma once 32 | 33 | #include 34 | #include 35 | #include 36 | #include "singleapplication.h" 37 | 38 | struct InstancesInfo { 39 | bool primary; 40 | quint32 secondary; 41 | qint64 primaryPid; 42 | char primaryUser[128]; 43 | quint16 checksum; // Must be the last field 44 | }; 45 | 46 | struct ConnectionInfo { 47 | qint64 msgLen = 0; 48 | quint32 instanceId = 0; 49 | quint8 stage = 0; 50 | }; 51 | 52 | class SingleApplicationPrivate : public QObject { 53 | Q_OBJECT 54 | public: 55 | enum ConnectionType : quint8 { 56 | InvalidConnection = 0, 57 | NewInstance = 1, 58 | SecondaryInstance = 2, 59 | Reconnect = 3 60 | }; 61 | enum ConnectionStage : quint8 { 62 | StageHeader = 0, 63 | StageBody = 1, 64 | StageConnected = 2, 65 | }; 66 | Q_DECLARE_PUBLIC(SingleApplication) 67 | 68 | SingleApplicationPrivate(SingleApplication *q_ptr); 69 | ~SingleApplicationPrivate() override; 70 | 71 | static QString getUsername(); 72 | void genBlockServerName(); 73 | void initializeMemoryBlock() const; 74 | void startPrimary(); 75 | void startSecondary(); 76 | bool connectToPrimary(int msecs, ConnectionType connectionType); 77 | quint16 blockChecksum() const; 78 | qint64 primaryPid() const; 79 | QString primaryUser() const; 80 | void readInitMessageHeader(QLocalSocket *socket); 81 | void readInitMessageBody(QLocalSocket *socket); 82 | static void randomSleep(); 83 | 84 | SingleApplication *q_ptr; 85 | QSharedMemory *memory; 86 | QLocalSocket *socket; 87 | QLocalServer *server; 88 | quint32 instanceNumber; 89 | QString blockServerName; 90 | SingleApplication::Options options; 91 | QMap connectionMap; 92 | 93 | public Q_SLOTS: 94 | void slotConnectionEstablished(); 95 | void slotDataAvailable(QLocalSocket*, quint32); 96 | void slotClientConnectionClosed(QLocalSocket*, quint32); 97 | }; 98 | 99 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/VersionNumber.cpp: -------------------------------------------------------------------------------- 1 | #include "VersionNumber.h" 2 | 3 | VersionNumber::VersionNumber() 4 | { 5 | } 6 | 7 | VersionNumber::VersionNumber(int Major, int Minor, int Revision) 8 | { 9 | Major_Version_Number = Major; 10 | Minor_Version_Number = Minor; 11 | Revision_Number = Revision; 12 | } 13 | 14 | VersionNumber::VersionNumber(QString versionString) 15 | { 16 | VersionString = versionString; 17 | tryToNumber(versionString); 18 | } 19 | 20 | VersionNumber::~VersionNumber() 21 | { 22 | } 23 | 24 | VersionNumber::operator QString() 25 | { 26 | return QString::number(Major_Version_Number) + "." + 27 | QString::number(Minor_Version_Number) + "." + 28 | QString::number(Revision_Number); 29 | } 30 | 31 | VersionNumber & VersionNumber::operator=(const QString & versionString) 32 | { 33 | VersionString = versionString; 34 | tryToNumber(versionString); 35 | return *this; 36 | } 37 | 38 | bool VersionNumber::operator==(const VersionNumber & version) 39 | { 40 | if (Revision_Number == version.Revision_Number && 41 | Minor_Version_Number == version.Minor_Version_Number && 42 | Major_Version_Number == version.Major_Version_Number) 43 | { 44 | return true; 45 | } 46 | return false; 47 | } 48 | 49 | bool VersionNumber::operator!=(const VersionNumber & version) 50 | { 51 | if (Revision_Number == version.Revision_Number && 52 | Minor_Version_Number == version.Minor_Version_Number && 53 | Major_Version_Number == version.Major_Version_Number) 54 | { 55 | return false; 56 | } 57 | return true; 58 | } 59 | 60 | bool VersionNumber::operator>(const VersionNumber & version) 61 | { 62 | if (Major_Version_Number > version.Major_Version_Number) 63 | { 64 | return true; 65 | } 66 | else if (Major_Version_Number == version.Major_Version_Number) 67 | { 68 | if (Minor_Version_Number > version.Minor_Version_Number) 69 | { 70 | return true; 71 | } 72 | else if (Minor_Version_Number == version.Minor_Version_Number) 73 | { 74 | if (Revision_Number > version.Revision_Number) 75 | { 76 | return true; 77 | } 78 | } 79 | } 80 | return false; 81 | } 82 | 83 | bool VersionNumber::operator<(const VersionNumber & version) 84 | { 85 | if (Major_Version_Number < version.Major_Version_Number) 86 | { 87 | return true; 88 | } 89 | else if (Major_Version_Number == version.Major_Version_Number) 90 | { 91 | if (Minor_Version_Number < version.Minor_Version_Number) 92 | { 93 | return true; 94 | } 95 | else if (Minor_Version_Number == version.Minor_Version_Number) 96 | { 97 | if (Revision_Number < version.Revision_Number) 98 | { 99 | return true; 100 | } 101 | } 102 | } 103 | return false; 104 | } 105 | 106 | bool VersionNumber::operator>=(const VersionNumber & version) 107 | { 108 | if (*this == version) 109 | { 110 | return true; 111 | } 112 | if (*this > version) 113 | { 114 | return true; 115 | } 116 | return false; 117 | } 118 | 119 | bool VersionNumber::operator<=(const VersionNumber & version) 120 | { 121 | if (*this == version) 122 | { 123 | return true; 124 | } 125 | if (*this < version) 126 | { 127 | return true; 128 | } 129 | return false; 130 | } 131 | 132 | int VersionNumber::main() 133 | { 134 | return Major_Version_Number; 135 | } 136 | 137 | int VersionNumber::branch() 138 | { 139 | return Minor_Version_Number; 140 | } 141 | 142 | int VersionNumber::revision() 143 | { 144 | return Revision_Number; 145 | } 146 | 147 | bool VersionNumber::tryToNumber(QString str) 148 | { 149 | if (str == "") 150 | { 151 | return false; 152 | } 153 | QStringList VersionStringList = str.split("."); 154 | if (VersionStringList.size() != 3) 155 | { 156 | return false; 157 | } 158 | Major_Version_Number = VersionStringList[0].toInt(); 159 | Minor_Version_Number = VersionStringList[1].toInt(); 160 | Revision_Number = VersionStringList[2].toInt(); 161 | return true; 162 | } 163 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/VersionNumber.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | class VersionNumber 5 | { 6 | QString VersionString; 7 | int Major_Version_Number = 0; 8 | int Minor_Version_Number = 0; 9 | int Revision_Number = 0; 10 | 11 | public: 12 | VersionNumber(); 13 | VersionNumber(int Major, int Minor, int Revision); 14 | VersionNumber(QString versionString); 15 | ~VersionNumber(); 16 | operator QString(); 17 | VersionNumber& operator=(const QString & versionString); 18 | bool operator==(const VersionNumber & version); 19 | bool operator!=(const VersionNumber & version); 20 | bool operator>(const VersionNumber & version); 21 | bool operator<(const VersionNumber & version); 22 | bool operator>=(const VersionNumber & version); 23 | bool operator<=(const VersionNumber & version); 24 | 25 | int main(); 26 | int branch(); 27 | int revision(); 28 | 29 | private: 30 | bool tryToNumber(QString str); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/assets/logo_150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/assets/logo_150x150.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/assets/logo_44x44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/assets/logo_44x44.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/assets/logo_620x300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/assets/logo_620x300.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/assets/logo_store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/assets/logo_store.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/config.ini: -------------------------------------------------------------------------------- 1 | [%General] 2 | is_auto_run=true 3 | is_start_pupowindows=true 4 | is_start_module=false 5 | is_exit_ismini=true 6 | 7 | [Launcher] 8 | launcher_install_path=C:\\Program Files\\Genshin Impact 9 | game_dynamic_bg_name=000.gif 10 | 11 | [Game] 12 | game_install_path=C:\\Program Files\\Genshin Impact\\Genshin Impact Game 13 | game_start_name=YuanShen.exe 14 | 15 | [Module] 16 | is_first_exit=false 17 | mods_number=2 18 | mods_0=false 19 | mods_1=false 20 | mods_2=false 21 | mods_3=false 22 | mods_4=false 23 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/define/Api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace tl::launcher::api 3 | { 4 | static const char* version_url = "http://update.api.weixitianli.com/GenshinImpactNaturalLaw/Version"; 5 | static const char* download_url = "http://update.api.weixitianli.com/GenshinImpactNaturalLaw/DownloadUrl"; 6 | static const char* download_hash_url = "http://update.api.weixitianli.com/GenshinImpactNaturalLaw/DownloadUrlAndHash"; 7 | } -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/define/ProjectInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace tl::project_info 3 | { 4 | static const char* project_name = "GenshinImpactNaturalLaw"; 5 | } -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/genshinimpactnaturallaw_zh.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/genshinimpactnaturallaw_zh.qm -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/genshinimpactnaturallaw_zh.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GenshinImpactNaturalLaw 6 | 7 | 8 | Str_TianLi 9 | 天理 10 | 11 | 12 | 13 | Str_ShowMainWidget 14 | 显示主界面 15 | 16 | 17 | 18 | Str_Exit 19 | 退出 20 | 21 | 22 | 23 | GenshinImpactNaturalLawClass 24 | 25 | 26 | 天理 27 | 28 | 29 | 30 | 31 | 天理 32 | 33 | 34 | 35 | 36 | 开始游戏 37 | 38 | 39 | 40 | 41 | 帮助 42 | 43 | 44 | 45 | 46 | 原神 [ PC端 ] 悬浮窗地图工具 47 | 48 | 49 | 50 | 51 | 天理启动器使用帮助 v0.8 52 | 53 | 54 | 55 | 56 | 更新 57 | 58 | 59 | 60 | 61 | 勾选即可,目前只集成了天理地图,会与游戏一同启动 62 | 63 | 64 | 65 | 66 | 可在设置界面检查更新 67 | 68 | 69 | 70 | 71 | 公告 72 | 73 | 74 | 75 | 76 | 测试交流群 QQ:538198823 77 | 78 | 79 | 80 | 81 | 主页以及一些说明,可能会在这里放文档 82 | 83 | 84 | 85 | 86 | 2.0.0 87 | 88 | 89 | 90 | 91 | QtWidgetsMessageBox 92 | 93 | 94 | 95 | 提示 96 | 97 | 98 | 99 | 100 | 确认 101 | 102 | 103 | 104 | 105 | 未能找到游戏资源,建议确认路径是否正确或获取最新游戏资源 106 | 107 | 108 | 109 | 110 | QtWidgetsSetting 111 | 112 | 113 | QtWidgetsSetting 114 | 115 | 116 | 117 | 118 | 取消 119 | 120 | 121 | 122 | 123 | 确认 124 | 125 | 126 | 127 | 128 | 通用设置 129 | 130 | 131 | 132 | 133 | 游戏设置 134 | 135 | 136 | 137 | 138 | 模组设置 139 | 140 | 141 | 142 | 143 | 模组资源 144 | 145 | 146 | 147 | 148 | 版本信息 149 | 150 | 151 | 152 | 153 | 启动设置 154 | 155 | 156 | 157 | 158 | 开机自动启动 159 | 160 | 161 | 162 | 163 | 无边框模式启动 164 | 165 | 166 | 167 | 168 | 启用模组 169 | 170 | 171 | 172 | 173 | 关闭设置 174 | 175 | 176 | 177 | 178 | 最小化到系统托盘 179 | 180 | 181 | 182 | 183 | 退出启动器 184 | 185 | 186 | 187 | 188 | 本地文件 189 | 190 | 191 | 192 | 193 | 查找游戏启动器 194 | 195 | 196 | 197 | 198 | 当前游戏启动器安装路径 199 | 200 | 201 | 202 | 203 | 查找游戏本体 204 | 205 | 206 | 207 | 208 | 当前游戏应用路径 209 | 210 | 211 | 212 | 213 | 本地模组 214 | 215 | 216 | 217 | 218 | 选择模组文件夹 219 | 220 | 221 | 222 | 223 | 当前模组安装路径 224 | 225 | 226 | 227 | 228 | 刷新所有模组 229 | 230 | 231 | 232 | 233 | 当前模组列表 234 | 235 | 236 | 237 | 238 | 启动器版本 239 | 240 | 241 | 242 | 243 | 启动器更新 244 | 245 | 246 | 247 | 248 | 当前版本:天理系统 249 | 250 | 251 | 252 | 253 | 游戏启动器版本 254 | 255 | 256 | 257 | 258 | 游戏启动器更新 259 | 260 | 261 | 262 | 263 | 264 | 当前版本: 265 | 266 | 267 | 268 | 269 | 游戏版本 270 | 271 | 272 | 273 | 274 | 游戏更新 275 | 276 | 277 | 278 | 279 | Str_NowVer: 280 | Str_NowVer_ 281 | 当前版本: 282 | 283 | 284 | 285 | Str_SelectGIPath 286 | 选择原神所在目录 287 | 288 | 289 | 290 | Str_ApplicationProgram 291 | 应用程序 292 | 293 | 294 | 295 | 296 | Str_SelectGILauncherPath 297 | 选择原神启动器所在目录 298 | 299 | 300 | 301 | Str_SelectIsUpdateNow 302 | 立即进行更新 303 | 304 | 305 | 306 | UpdataModule 307 | 308 | 309 | bytes=%1- 310 | 311 | 312 | 313 | 314 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/main.cpp -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource.h -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/Bilibili.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/Bilibili.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/Bilibili_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/Bilibili_icon.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/GitHub_icon - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/GitHub_icon - 副本.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/GitHub_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/GitHub_icon.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/KYJG_yuanshen - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/KYJG_yuanshen - 副本.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/KYJG_yuanshen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/KYJG_yuanshen.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/QQ_icon - 副本.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/QQ_icon - 副本.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/LinkeIcon/QQ_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/LinkeIcon/QQ_icon.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QMessageBox/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QMessageBox/bg.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked_hover.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_checked_pressed.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_hover.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/CheckBox/checkbox_unchecked_pressed.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/Exit/exit0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/Exit/exit0.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/Exit/exit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/Exit/exit1.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked_hover.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_checked_pressed.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_hover.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/RadioButton/radiobutton_unchecked_pressed.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/UI/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/UI/title.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/QtWidgetsSetting/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/QtWidgetsSetting/bg.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/bg.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/ICON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/ICON.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/MainIcon - 副本.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/MainIcon - 副本.ico -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/MainIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/MainIcon.ico -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/MainIcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/MainIcon.jpg -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/TrayIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/TrayIcon.ico -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/TrayIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/TrayIcon.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/icon - 副本.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/icon - 副本.ico -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/v2-5c760ea50961ac657477ce0162939e57_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/v2-5c760ea50961ac657477ce0162939e57_hd.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/icon/未标题-1.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/icon/未标题-1.psd -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/page/Snipaste_2021-07-25_03-20-53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/page/Snipaste_2021-07-25_03-20-53.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/page/page1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/page/page1.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/page/page2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/page/page2.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bexit0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bexit0.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bexit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bexit1.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bmin0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bmin0.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bmin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bmin1.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bset0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bset0.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/resource/titlebutton/bset1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/resource/titlebutton/bset1.png -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/version/Version.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/version/Version.h -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/version/update_version.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GengGode/GenshinImpactNaturalLaw/44d6cd82c7960c0cf438c29a2bf2dae339d2aaf9/GenshinImpactNaturalLaw/version/update_version.bat -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/version/version.branch: -------------------------------------------------------------------------------- 1 | master 2 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/version/version.ver: -------------------------------------------------------------------------------- 1 | 3.1.37.54 2 | -------------------------------------------------------------------------------- /GenshinImpactNaturalLaw/version/version_hash.hash: -------------------------------------------------------------------------------- 1 | b2de168 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GenshinImpactNaturalLaw 2 | 原神天理启动器 3 | 4 | [![Build status](https://ci.appveyor.com/api/projects/status/wom1ku4voacif3p3?svg=true)](https://ci.appveyor.com/project/GengGode/GenshinImpactNaturalLaw) 5 | 6 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '1.0.{build}' 2 | image: Visual Studio 2017 3 | configuration: Release 4 | platform: 5 | - x64 6 | branches: 7 | only: 8 | #- master 9 | - appVeyor-* 10 | 11 | environment: 12 | qt: 5.13 13 | msvc: msvc2017 14 | vs: C:\"Program Files (x86)"\"Microsoft Visual Studio"\2017\Community\VC\Auxiliary\Build 15 | QTDIR: C:\Qt\5.13.2\msvc2017_64 16 | ProjectName: GenshinImpactNaturalLaw 17 | ProJectExeName: TianLi_Launcher 18 | MyProjectDir: C:\projects\%ProjectName% 19 | Lib7zExeDll: https://github.com/GengGode/7zExeDllRelease/releases/download/1.0.0/Release.zip 20 | 21 | skip_tags: true 22 | 23 | before_build: 24 | #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 25 | #- set PATH=%PATH%;%QTDIR%\bin; 26 | #- set vcvarsall=%vs%\vcvarsall.bat 27 | #- call "%vcvarsall%" x64 28 | - echo %LANG% 29 | - set PATH=%PATH%;%QTDIR%\bin; 30 | - call %QTDIR%\bin\qtenv2.bat 31 | - call %vs%\vcvars64.bat x64 32 | 33 | build_script: 34 | #- MSBuild %MyProjectDir%TianLiInstallationPackage\TianLiInstallationPackage.vcxproj 35 | - cd %MyProjectDir%\%ProjectName% 36 | - qmake 37 | - nmake 38 | 39 | after_build: 40 | # copy include and source code files\ 41 | - mkdir %MyProjectDir%\x64\build\ 42 | - cd %MyProjectDir%\x64\build\ 43 | - appveyor DownloadFile %Lib7zExeDll% 44 | - 7z x ./Release.zip -y -o./ 45 | - rm -f ./Release.zip 46 | 47 | - cd %MyProjectDir%\x64\Release\ 48 | #- ren *.exe tmp.exe 49 | - copy %MyProjectDir%\x64\Release\%ProJectExeName%.exe %MyProjectDir%\x64\build\ 50 | 51 | - cd %MyProjectDir%\x64\build\ 52 | - windeployqt %ProJectExeName%.exe 53 | 54 | 55 | 56 | - echo %APPVEYOR_BUILD_VERSION% >version.tag 57 | - 7z a source.7z %MyProjectDir%\x64\build\* 58 | 59 | - appveyor PushArtifact version.tag 60 | - appveyor PushArtifact source.7z 61 | 62 | deploy: 63 | - provider: GitHub 64 | description: '$(APPVEYOR_PROJECT_SLUG): $(ProJectExeName) $(APPVEYOR_BUILD_VERSION)' 65 | auth_token: 66 | secure: G/Fzf0bGIhqqt+XvsC5AXrZVNs3atGU7XCzJxqiUZEwOxoZrjxk87ENI/OitnXCo 67 | draft: false 68 | tag: $(APPVEYOR_BUILD_VERSION) 69 | force_update: true 70 | on: 71 | APPVEYOR_REPO_TAG: false 72 | 73 | notifications: 74 | - provider: Email 75 | to: 76 | - ysx20201030@163.com 77 | subject: '{{status}}: {{projectName}} {{buildVersion}}' # optional 78 | message: "Commit #{{commitId}} by {{commitAuthor}} on {{commitDate}}: {{commitMessage}}" # optional 79 | on_build_success: true 80 | on_build_failure: false 81 | on_build_status_changed: false 82 | --------------------------------------------------------------------------------