├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ ├── cron.yml │ └── opcode-cn.yml ├── .gitignore ├── LICENSE ├── README.md ├── RouletteRecorder.Packer ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── RouletteRecorder.Packer.csproj ├── RouletteRecorder.sln ├── RouletteRecorder ├── Config.cs ├── Constant │ ├── LogType.cs │ ├── OpcodeChina.cs │ ├── OpcodeGlobal.cs │ ├── OpcodeStorage.cs │ └── Region.cs ├── DAO │ └── Roulette.cs ├── Data.cs ├── FodyWeavers.xml ├── GitHub-Mark-32px.png ├── ILRepack.Config.props ├── Models │ ├── ConfigData.cs │ ├── InstanceData.cs │ ├── ItemName.cs │ ├── JobName.cs │ └── WorldData.cs ├── Monitors │ ├── MonitorType.cs │ └── NetworkMonitor.cs ├── Network │ └── DungeonLogger │ │ ├── DungeonLoggerClient.cs │ │ └── Structures │ │ ├── Auth.cs │ │ ├── Response.cs │ │ ├── StatMaze.cs │ │ ├── StatProf.cs │ │ └── UserInfo.cs ├── Properties │ └── AssemblyInfo.cs ├── RecorderInit.cs ├── RouletteRecorder.csproj ├── Utils │ ├── BindingTarget.cs │ ├── Database.cs │ ├── Helper.cs │ ├── Log.cs │ └── ParsePlugin.cs ├── ViewModels │ ├── DungeonLoggerSetting.cs │ └── MainViewModel.cs ├── Views │ ├── DugeonLoggerSetting.xaml │ ├── DugeonLoggerSetting.xaml.cs │ ├── MainControl.xaml │ └── MainControl.xaml.cs ├── app.config └── data │ ├── instance.json │ ├── job.json │ └── roulette.json ├── pdm.lock ├── pyproject.toml └── scripts ├── consts.py ├── data └── .gitignore ├── dump_instance.py ├── dump_job.py ├── dump_roulette.py ├── update_opcode.py ├── update_opcode_cn.py └── utils.py /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | paths: 6 | - "RouletteRecorder/**" 7 | branches: [main] 8 | pull_request: 9 | paths: 10 | - "RouletteRecorder/**" 11 | branches: [main] 12 | workflow_dispatch: 13 | 14 | jobs: 15 | build: 16 | strategy: 17 | matrix: 18 | configuration: [Release] 19 | 20 | runs-on: windows-latest 21 | 22 | env: 23 | THIRDPARTY_ACT: https://github.com/EQAditu/AdvancedCombatTracker/releases/download/3.6.0.275/ACTv3.zip 24 | THIRDPARTY_FFXIV_ACT_PLUGIN: https://github.com/ravahn/FFXIV_ACT_Plugin/raw/master/Releases/FFXIV_ACT_Plugin_SDK_2.0.7.0.zip 25 | SOLUTION_NAME: RouletteRecorder.sln 26 | 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v4 30 | 31 | - uses: actions/cache@v4 32 | with: 33 | path: ~/.nuget/packages 34 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} 35 | restore-keys: | 36 | ${{ runner.os }}-nuget- 37 | 38 | - name: Setup NuGet.exe for use with actions 39 | uses: nuget/setup-nuget@v2 40 | 41 | - name: Setup MSBuild.exe 42 | uses: microsoft/setup-msbuild@v2 43 | 44 | - name: Setup thirdparty dependencies 45 | run: | 46 | nuget restore ${{ env.SOLUTION_NAME }} 47 | 48 | New-Item -Name "thirdparty" -ItemType "directory" -Force 49 | 50 | Invoke-WebRequest -Uri ${{ env.THIRDPARTY_ACT }} -OutFile thirdparty\ACT.zip 51 | Expand-Archive thirdparty\ACT.zip -DestinationPath thirdparty\ACT -Force 52 | 53 | Invoke-WebRequest -Uri ${{ env.THIRDPARTY_FFXIV_ACT_PLUGIN }} -OutFile thirdparty\FFXIV_ACT_Plugin.zip 54 | Expand-Archive thirdparty\FFXIV_ACT_Plugin.zip -DestinationPath thirdparty\FFXIV_ACT_Plugin -Force 55 | 56 | Get-ChildItem .\thirdparty 57 | Get-ChildItem .\thirdparty\ACT 58 | Get-ChildItem .\thirdparty\FFXIV_ACT_Plugin 59 | 60 | - name: Build 61 | run: msbuild $env:SOLUTION_NAME /p:Configuration=$env:Configuration 62 | env: 63 | Configuration: ${{ matrix.configuration }} 64 | 65 | - name: Upload build artifacts 66 | uses: actions/upload-artifact@v4 67 | with: 68 | name: Bundle 69 | path: bin\*.zip 70 | 71 | - name: Extract version name 72 | id: version 73 | run: | 74 | $version = [System.Version]::Parse((Get-Content -Path "RouletteRecorder\Properties\AssemblyInfo.cs" | Select-String -Pattern "^\[assembly: AssemblyVersion\(""(.*)""\)\]").Matches.Groups[1].Value) 75 | echo "VERSION=$version" >> $env:GITHUB_OUTPUT 76 | 77 | - name: Release 78 | uses: softprops/action-gh-release@v2 79 | if: ${{ github.event_name != 'pull_request' }} 80 | with: 81 | tag_name: v${{ steps.version.outputs.VERSION }} 82 | files: bin/*.zip 83 | env: 84 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 85 | -------------------------------------------------------------------------------- /.github/workflows/cron.yml: -------------------------------------------------------------------------------- 1 | name: Update data and opcode 2 | 3 | on: 4 | schedule: 5 | # At minute 0 past every 4th hour. 6 | - cron: "0 */4 * * *" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | update: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v5 15 | 16 | - uses: actions/setup-python@v5 17 | with: 18 | python-version: "3.12" 19 | 20 | - name: Setup PDM 21 | uses: pdm-project/setup-pdm@v4 22 | with: 23 | python-version: "3.12" 24 | cache: true 25 | 26 | - name: Install dependencies 27 | run: pdm install 28 | 29 | - name: Setup git user 30 | run: | 31 | git config user.name "github-actions[bot]" 32 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 33 | 34 | - name: Update opcodes 35 | run: pdm opcode 36 | 37 | - name: Commit opcode 38 | id: opcode-commit 39 | run: | 40 | git add . 41 | git diff-index --quiet HEAD || echo "DIFF=true" >> $GITHUB_OUTPUT 42 | git diff-index --quiet HEAD || git commit -m "chore(opcode): update opcode" 43 | 44 | - name: Update misc data 45 | run: pdm instance && pdm job && pdm roulette 46 | 47 | - name: Commit data 48 | id: data-commit 49 | run: | 50 | git add . 51 | git diff-index --quiet HEAD || echo "DIFF=true" >> $GITHUB_OUTPUT 52 | git diff-index --quiet HEAD || git commit -m "chore(data): update data" 53 | 54 | - name: Push commits 55 | run: git push 56 | 57 | - name: Trigger build 58 | if: ${{ steps.opcode-commit.outputs.DIFF == 'true' || steps.data-commit.outputs.DIFF == 'true' }} 59 | run: gh workflow run build.yml 60 | env: 61 | GH_TOKEN: ${{ github.token }} 62 | -------------------------------------------------------------------------------- /.github/workflows/opcode-cn.yml: -------------------------------------------------------------------------------- 1 | name: Update CN Opcode 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | update: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v5 12 | 13 | - uses: actions/setup-python@v5 14 | with: 15 | python-version: "3.12" 16 | 17 | - name: Setup PDM 18 | uses: pdm-project/setup-pdm@v4 19 | with: 20 | python-version: "3.12" 21 | cache: true 22 | 23 | - name: Install dependencies 24 | run: pdm install 25 | 26 | - name: Setup git user 27 | run: | 28 | git config user.name "github-actions[bot]" 29 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 30 | 31 | - name: Update opcodes 32 | run: pdm opcode-cn 33 | 34 | - name: Commit opcode 35 | id: opcode-commit 36 | run: | 37 | git add . 38 | git diff-index --quiet HEAD || echo "DIFF=true" >> $GITHUB_OUTPUT 39 | git diff-index --quiet HEAD || git commit -m "chore(opcode): update cn opcode" 40 | 41 | - name: Push commits 42 | run: git push 43 | 44 | - name: Trigger build 45 | if: ${{ steps.opcode-commit.outputs.DIFF == 'true' || steps.data-commit.outputs.DIFF == 'true' }} 46 | run: gh workflow run build.yml 47 | env: 48 | GH_TOKEN: ${{ github.token }} 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/csharp,visualstudio,python,jetbrains,macos,linux,windows 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=csharp,visualstudio,python,jetbrains,macos,linux,windows 3 | 4 | # Project 5 | thirdparty/ 6 | .pdm-python 7 | 8 | ### Csharp ### 9 | ## Ignore Visual Studio temporary files, build results, and 10 | ## files generated by popular Visual Studio add-ons. 11 | ## 12 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 13 | 14 | # User-specific files 15 | *.rsuser 16 | *.suo 17 | *.user 18 | *.userosscache 19 | *.sln.docstates 20 | 21 | # User-specific files (MonoDevelop/Xamarin Studio) 22 | *.userprefs 23 | 24 | # Mono auto generated files 25 | mono_crash.* 26 | 27 | # Build results 28 | [Dd]ebug/ 29 | [Dd]ebugPublic/ 30 | [Rr]elease/ 31 | [Rr]eleases/ 32 | x64/ 33 | x86/ 34 | [Ww][Ii][Nn]32/ 35 | [Aa][Rr][Mm]/ 36 | [Aa][Rr][Mm]64/ 37 | bld/ 38 | [Bb]in/ 39 | [Oo]bj/ 40 | [Ll]og/ 41 | [Ll]ogs/ 42 | 43 | # Visual Studio 2015/2017 cache/options directory 44 | .vs/ 45 | # Uncomment if you have tasks that create the project's static files in wwwroot 46 | #wwwroot/ 47 | 48 | # Visual Studio 2017 auto generated files 49 | Generated\ Files/ 50 | 51 | # MSTest test Results 52 | [Tt]est[Rr]esult*/ 53 | [Bb]uild[Ll]og.* 54 | 55 | # NUnit 56 | *.VisualState.xml 57 | TestResult.xml 58 | nunit-*.xml 59 | 60 | # Build Results of an ATL Project 61 | [Dd]ebugPS/ 62 | [Rr]eleasePS/ 63 | dlldata.c 64 | 65 | # Benchmark Results 66 | BenchmarkDotNet.Artifacts/ 67 | 68 | # .NET Core 69 | project.lock.json 70 | project.fragment.lock.json 71 | artifacts/ 72 | 73 | # ASP.NET Scaffolding 74 | ScaffoldingReadMe.txt 75 | 76 | # StyleCop 77 | StyleCopReport.xml 78 | 79 | # Files built by Visual Studio 80 | *_i.c 81 | *_p.c 82 | *_h.h 83 | *.ilk 84 | *.meta 85 | *.obj 86 | *.iobj 87 | *.pch 88 | *.pdb 89 | *.ipdb 90 | *.pgc 91 | *.pgd 92 | *.rsp 93 | *.sbr 94 | *.tlb 95 | *.tli 96 | *.tlh 97 | *.tmp 98 | *.tmp_proj 99 | *_wpftmp.csproj 100 | *.log 101 | *.tlog 102 | *.vspscc 103 | *.vssscc 104 | .builds 105 | *.pidb 106 | *.svclog 107 | *.scc 108 | 109 | # Chutzpah Test files 110 | _Chutzpah* 111 | 112 | # Visual C++ cache files 113 | ipch/ 114 | *.aps 115 | *.ncb 116 | *.opendb 117 | *.opensdf 118 | *.sdf 119 | *.cachefile 120 | *.VC.db 121 | *.VC.VC.opendb 122 | 123 | # Visual Studio profiler 124 | *.psess 125 | *.vsp 126 | *.vspx 127 | *.sap 128 | 129 | # Visual Studio Trace Files 130 | *.e2e 131 | 132 | # TFS 2012 Local Workspace 133 | $tf/ 134 | 135 | # Guidance Automation Toolkit 136 | *.gpState 137 | 138 | # ReSharper is a .NET coding add-in 139 | _ReSharper*/ 140 | *.[Rr]e[Ss]harper 141 | *.DotSettings.user 142 | 143 | # TeamCity is a build add-in 144 | _TeamCity* 145 | 146 | # DotCover is a Code Coverage Tool 147 | *.dotCover 148 | 149 | # AxoCover is a Code Coverage Tool 150 | .axoCover/* 151 | !.axoCover/settings.json 152 | 153 | # Coverlet is a free, cross platform Code Coverage Tool 154 | coverage*.json 155 | coverage*.xml 156 | coverage*.info 157 | 158 | # Visual Studio code coverage results 159 | *.coverage 160 | *.coveragexml 161 | 162 | # NCrunch 163 | _NCrunch_* 164 | .*crunch*.local.xml 165 | nCrunchTemp_* 166 | 167 | # MightyMoose 168 | *.mm.* 169 | AutoTest.Net/ 170 | 171 | # Web workbench (sass) 172 | .sass-cache/ 173 | 174 | # Installshield output folder 175 | [Ee]xpress/ 176 | 177 | # DocProject is a documentation generator add-in 178 | DocProject/buildhelp/ 179 | DocProject/Help/*.HxT 180 | DocProject/Help/*.HxC 181 | DocProject/Help/*.hhc 182 | DocProject/Help/*.hhk 183 | DocProject/Help/*.hhp 184 | DocProject/Help/Html2 185 | DocProject/Help/html 186 | 187 | # Click-Once directory 188 | publish/ 189 | 190 | # Publish Web Output 191 | *.[Pp]ublish.xml 192 | *.azurePubxml 193 | # Note: Comment the next line if you want to checkin your web deploy settings, 194 | # but database connection strings (with potential passwords) will be unencrypted 195 | *.pubxml 196 | *.publishproj 197 | 198 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 199 | # checkin your Azure Web App publish settings, but sensitive information contained 200 | # in these scripts will be unencrypted 201 | PublishScripts/ 202 | 203 | # NuGet Packages 204 | *.nupkg 205 | # NuGet Symbol Packages 206 | *.snupkg 207 | # The packages folder can be ignored because of Package Restore 208 | **/[Pp]ackages/* 209 | # except build/, which is used as an MSBuild target. 210 | !**/[Pp]ackages/build/ 211 | # Uncomment if necessary however generally it will be regenerated when needed 212 | #!**/[Pp]ackages/repositories.config 213 | # NuGet v3's project.json files produces more ignorable files 214 | *.nuget.props 215 | *.nuget.targets 216 | 217 | # Microsoft Azure Build Output 218 | csx/ 219 | *.build.csdef 220 | 221 | # Microsoft Azure Emulator 222 | ecf/ 223 | rcf/ 224 | 225 | # Windows Store app package directories and files 226 | AppPackages/ 227 | BundleArtifacts/ 228 | Package.StoreAssociation.xml 229 | _pkginfo.txt 230 | *.appx 231 | *.appxbundle 232 | *.appxupload 233 | 234 | # Visual Studio cache files 235 | # files ending in .cache can be ignored 236 | *.[Cc]ache 237 | # but keep track of directories ending in .cache 238 | !?*.[Cc]ache/ 239 | 240 | # Others 241 | ClientBin/ 242 | ~$* 243 | *~ 244 | *.dbmdl 245 | *.dbproj.schemaview 246 | *.jfm 247 | *.pfx 248 | *.publishsettings 249 | orleans.codegen.cs 250 | 251 | # Including strong name files can present a security risk 252 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 253 | #*.snk 254 | 255 | # Since there are multiple workflows, uncomment next line to ignore bower_components 256 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 257 | #bower_components/ 258 | 259 | # RIA/Silverlight projects 260 | Generated_Code/ 261 | 262 | # Backup & report files from converting an old project file 263 | # to a newer Visual Studio version. Backup files are not needed, 264 | # because we have git ;-) 265 | _UpgradeReport_Files/ 266 | Backup*/ 267 | UpgradeLog*.XML 268 | UpgradeLog*.htm 269 | ServiceFabricBackup/ 270 | *.rptproj.bak 271 | 272 | # SQL Server files 273 | *.mdf 274 | *.ldf 275 | *.ndf 276 | 277 | # Business Intelligence projects 278 | *.rdl.data 279 | *.bim.layout 280 | *.bim_*.settings 281 | *.rptproj.rsuser 282 | *- [Bb]ackup.rdl 283 | *- [Bb]ackup ([0-9]).rdl 284 | *- [Bb]ackup ([0-9][0-9]).rdl 285 | 286 | # Microsoft Fakes 287 | FakesAssemblies/ 288 | 289 | # GhostDoc plugin setting file 290 | *.GhostDoc.xml 291 | 292 | # Node.js Tools for Visual Studio 293 | .ntvs_analysis.dat 294 | node_modules/ 295 | 296 | # Visual Studio 6 build log 297 | *.plg 298 | 299 | # Visual Studio 6 workspace options file 300 | *.opt 301 | 302 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 303 | *.vbw 304 | 305 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 306 | *.vbp 307 | 308 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 309 | *.dsw 310 | *.dsp 311 | 312 | # Visual Studio 6 technical files 313 | 314 | # Visual Studio LightSwitch build output 315 | **/*.HTMLClient/GeneratedArtifacts 316 | **/*.DesktopClient/GeneratedArtifacts 317 | **/*.DesktopClient/ModelManifest.xml 318 | **/*.Server/GeneratedArtifacts 319 | **/*.Server/ModelManifest.xml 320 | _Pvt_Extensions 321 | 322 | # Paket dependency manager 323 | .paket/paket.exe 324 | paket-files/ 325 | 326 | # FAKE - F# Make 327 | .fake/ 328 | 329 | # CodeRush personal settings 330 | .cr/personal 331 | 332 | # Python Tools for Visual Studio (PTVS) 333 | __pycache__/ 334 | *.pyc 335 | 336 | # Cake - Uncomment if you are using it 337 | # tools/** 338 | # !tools/packages.config 339 | 340 | # Tabs Studio 341 | *.tss 342 | 343 | # Telerik's JustMock configuration file 344 | *.jmconfig 345 | 346 | # BizTalk build output 347 | *.btp.cs 348 | *.btm.cs 349 | *.odx.cs 350 | *.xsd.cs 351 | 352 | # OpenCover UI analysis results 353 | OpenCover/ 354 | 355 | # Azure Stream Analytics local run output 356 | ASALocalRun/ 357 | 358 | # MSBuild Binary and Structured Log 359 | *.binlog 360 | 361 | # NVidia Nsight GPU debugger configuration file 362 | *.nvuser 363 | 364 | # MFractors (Xamarin productivity tool) working folder 365 | .mfractor/ 366 | 367 | # Local History for Visual Studio 368 | .localhistory/ 369 | 370 | # Visual Studio History (VSHistory) files 371 | .vshistory/ 372 | 373 | # BeatPulse healthcheck temp database 374 | healthchecksdb 375 | 376 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 377 | MigrationBackup/ 378 | 379 | # Ionide (cross platform F# VS Code tools) working folder 380 | .ionide/ 381 | 382 | # Fody - auto-generated XML schema 383 | FodyWeavers.xsd 384 | 385 | # VS Code files for those working on multiple tools 386 | .vscode/* 387 | !.vscode/settings.json 388 | !.vscode/tasks.json 389 | !.vscode/launch.json 390 | !.vscode/extensions.json 391 | *.code-workspace 392 | 393 | # Local History for Visual Studio Code 394 | .history/ 395 | 396 | # Windows Installer files from build outputs 397 | *.cab 398 | *.msi 399 | *.msix 400 | *.msm 401 | *.msp 402 | 403 | # JetBrains Rider 404 | *.sln.iml 405 | 406 | ### JetBrains ### 407 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 408 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 409 | 410 | # User-specific stuff 411 | .idea/**/workspace.xml 412 | .idea/**/tasks.xml 413 | .idea/**/usage.statistics.xml 414 | .idea/**/dictionaries 415 | .idea/**/shelf 416 | 417 | # AWS User-specific 418 | .idea/**/aws.xml 419 | 420 | # Generated files 421 | .idea/**/contentModel.xml 422 | 423 | # Sensitive or high-churn files 424 | .idea/**/dataSources/ 425 | .idea/**/dataSources.ids 426 | .idea/**/dataSources.local.xml 427 | .idea/**/sqlDataSources.xml 428 | .idea/**/dynamic.xml 429 | .idea/**/uiDesigner.xml 430 | .idea/**/dbnavigator.xml 431 | 432 | # Gradle 433 | .idea/**/gradle.xml 434 | .idea/**/libraries 435 | 436 | # Gradle and Maven with auto-import 437 | # When using Gradle or Maven with auto-import, you should exclude module files, 438 | # since they will be recreated, and may cause churn. Uncomment if using 439 | # auto-import. 440 | # .idea/artifacts 441 | # .idea/compiler.xml 442 | # .idea/jarRepositories.xml 443 | # .idea/modules.xml 444 | # .idea/*.iml 445 | # .idea/modules 446 | # *.iml 447 | # *.ipr 448 | 449 | # CMake 450 | cmake-build-*/ 451 | 452 | # Mongo Explorer plugin 453 | .idea/**/mongoSettings.xml 454 | 455 | # File-based project format 456 | *.iws 457 | 458 | # IntelliJ 459 | out/ 460 | 461 | # mpeltonen/sbt-idea plugin 462 | .idea_modules/ 463 | 464 | # JIRA plugin 465 | atlassian-ide-plugin.xml 466 | 467 | # Cursive Clojure plugin 468 | .idea/replstate.xml 469 | 470 | # SonarLint plugin 471 | .idea/sonarlint/ 472 | 473 | # Crashlytics plugin (for Android Studio and IntelliJ) 474 | com_crashlytics_export_strings.xml 475 | crashlytics.properties 476 | crashlytics-build.properties 477 | fabric.properties 478 | 479 | # Editor-based Rest Client 480 | .idea/httpRequests 481 | 482 | # Android studio 3.1+ serialized cache file 483 | .idea/caches/build_file_checksums.ser 484 | 485 | ### JetBrains Patch ### 486 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 487 | 488 | # *.iml 489 | # modules.xml 490 | # .idea/misc.xml 491 | # *.ipr 492 | 493 | # Sonarlint plugin 494 | # https://plugins.jetbrains.com/plugin/7973-sonarlint 495 | .idea/**/sonarlint/ 496 | 497 | # SonarQube Plugin 498 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin 499 | .idea/**/sonarIssues.xml 500 | 501 | # Markdown Navigator plugin 502 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced 503 | .idea/**/markdown-navigator.xml 504 | .idea/**/markdown-navigator-enh.xml 505 | .idea/**/markdown-navigator/ 506 | 507 | # Cache file creation bug 508 | # See https://youtrack.jetbrains.com/issue/JBR-2257 509 | .idea/$CACHE_FILE$ 510 | 511 | # CodeStream plugin 512 | # https://plugins.jetbrains.com/plugin/12206-codestream 513 | .idea/codestream.xml 514 | 515 | # Azure Toolkit for IntelliJ plugin 516 | # https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij 517 | .idea/**/azureSettings.xml 518 | 519 | ### Linux ### 520 | 521 | # temporary files which can be created if a process still has a handle open of a deleted file 522 | .fuse_hidden* 523 | 524 | # KDE directory preferences 525 | .directory 526 | 527 | # Linux trash folder which might appear on any partition or disk 528 | .Trash-* 529 | 530 | # .nfs files are created when an open file is removed but is still being accessed 531 | .nfs* 532 | 533 | ### macOS ### 534 | # General 535 | .DS_Store 536 | .AppleDouble 537 | .LSOverride 538 | 539 | # Icon must end with two \r 540 | Icon 541 | 542 | 543 | # Thumbnails 544 | ._* 545 | 546 | # Files that might appear in the root of a volume 547 | .DocumentRevisions-V100 548 | .fseventsd 549 | .Spotlight-V100 550 | .TemporaryItems 551 | .Trashes 552 | .VolumeIcon.icns 553 | .com.apple.timemachine.donotpresent 554 | 555 | # Directories potentially created on remote AFP share 556 | .AppleDB 557 | .AppleDesktop 558 | Network Trash Folder 559 | Temporary Items 560 | .apdisk 561 | 562 | ### macOS Patch ### 563 | # iCloud generated files 564 | *.icloud 565 | 566 | ### Python ### 567 | # Byte-compiled / optimized / DLL files 568 | *.py[cod] 569 | *$py.class 570 | 571 | # C extensions 572 | *.so 573 | 574 | # Distribution / packaging 575 | .Python 576 | build/ 577 | develop-eggs/ 578 | dist/ 579 | downloads/ 580 | eggs/ 581 | .eggs/ 582 | lib/ 583 | lib64/ 584 | parts/ 585 | sdist/ 586 | var/ 587 | wheels/ 588 | share/python-wheels/ 589 | *.egg-info/ 590 | .installed.cfg 591 | *.egg 592 | MANIFEST 593 | 594 | # PyInstaller 595 | # Usually these files are written by a python script from a template 596 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 597 | *.manifest 598 | *.spec 599 | 600 | # Installer logs 601 | pip-log.txt 602 | pip-delete-this-directory.txt 603 | 604 | # Unit test / coverage reports 605 | htmlcov/ 606 | .tox/ 607 | .nox/ 608 | .coverage 609 | .coverage.* 610 | .cache 611 | nosetests.xml 612 | coverage.xml 613 | *.cover 614 | *.py,cover 615 | .hypothesis/ 616 | .pytest_cache/ 617 | cover/ 618 | 619 | # Translations 620 | *.mo 621 | *.pot 622 | 623 | # Django stuff: 624 | local_settings.py 625 | db.sqlite3 626 | db.sqlite3-journal 627 | 628 | # Flask stuff: 629 | instance/ 630 | .webassets-cache 631 | 632 | # Scrapy stuff: 633 | .scrapy 634 | 635 | # Sphinx documentation 636 | docs/_build/ 637 | 638 | # PyBuilder 639 | .pybuilder/ 640 | target/ 641 | 642 | # Jupyter Notebook 643 | .ipynb_checkpoints 644 | 645 | # IPython 646 | profile_default/ 647 | ipython_config.py 648 | 649 | # pyenv 650 | # For a library or package, you might want to ignore these files since the code is 651 | # intended to run in multiple environments; otherwise, check them in: 652 | # .python-version 653 | 654 | # pipenv 655 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 656 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 657 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 658 | # install all needed dependencies. 659 | #Pipfile.lock 660 | 661 | # poetry 662 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 663 | # This is especially recommended for binary packages to ensure reproducibility, and is more 664 | # commonly ignored for libraries. 665 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 666 | #poetry.lock 667 | 668 | # pdm 669 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 670 | #pdm.lock 671 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 672 | # in version control. 673 | # https://pdm.fming.dev/#use-with-ide 674 | .pdm.toml 675 | 676 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 677 | __pypackages__/ 678 | 679 | # Celery stuff 680 | celerybeat-schedule 681 | celerybeat.pid 682 | 683 | # SageMath parsed files 684 | *.sage.py 685 | 686 | # Environments 687 | .env 688 | .venv 689 | env/ 690 | venv/ 691 | ENV/ 692 | env.bak/ 693 | venv.bak/ 694 | 695 | # Spyder project settings 696 | .spyderproject 697 | .spyproject 698 | 699 | # Rope project settings 700 | .ropeproject 701 | 702 | # mkdocs documentation 703 | /site 704 | 705 | # mypy 706 | .mypy_cache/ 707 | .dmypy.json 708 | dmypy.json 709 | 710 | # Pyre type checker 711 | .pyre/ 712 | 713 | # pytype static type analyzer 714 | .pytype/ 715 | 716 | # Cython debug symbols 717 | cython_debug/ 718 | 719 | # PyCharm 720 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 721 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 722 | # and can be added to the global gitignore or merged into this file. For a more nuclear 723 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 724 | #.idea/ 725 | 726 | ### Python Patch ### 727 | # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration 728 | poetry.toml 729 | 730 | # ruff 731 | .ruff_cache/ 732 | 733 | # LSP config files 734 | pyrightconfig.json 735 | 736 | ### Windows ### 737 | # Windows thumbnail cache files 738 | Thumbs.db 739 | Thumbs.db:encryptable 740 | ehthumbs.db 741 | ehthumbs_vista.db 742 | 743 | # Dump file 744 | *.stackdump 745 | 746 | # Folder config file 747 | [Dd]esktop.ini 748 | 749 | # Recycle Bin used on file shares 750 | $RECYCLE.BIN/ 751 | 752 | # Windows Installer files 753 | 754 | # Windows shortcuts 755 | *.lnk 756 | 757 | ### VisualStudio ### 758 | 759 | # User-specific files 760 | 761 | # User-specific files (MonoDevelop/Xamarin Studio) 762 | 763 | # Mono auto generated files 764 | 765 | # Build results 766 | 767 | # Visual Studio 2015/2017 cache/options directory 768 | # Uncomment if you have tasks that create the project's static files in wwwroot 769 | 770 | # Visual Studio 2017 auto generated files 771 | 772 | # MSTest test Results 773 | 774 | # NUnit 775 | 776 | # Build Results of an ATL Project 777 | 778 | # Benchmark Results 779 | 780 | # .NET Core 781 | 782 | # ASP.NET Scaffolding 783 | 784 | # StyleCop 785 | 786 | # Files built by Visual Studio 787 | 788 | # Chutzpah Test files 789 | 790 | # Visual C++ cache files 791 | 792 | # Visual Studio profiler 793 | 794 | # Visual Studio Trace Files 795 | 796 | # TFS 2012 Local Workspace 797 | 798 | # Guidance Automation Toolkit 799 | 800 | # ReSharper is a .NET coding add-in 801 | 802 | # TeamCity is a build add-in 803 | 804 | # DotCover is a Code Coverage Tool 805 | 806 | # AxoCover is a Code Coverage Tool 807 | 808 | # Coverlet is a free, cross platform Code Coverage Tool 809 | 810 | # Visual Studio code coverage results 811 | 812 | # NCrunch 813 | 814 | # MightyMoose 815 | 816 | # Web workbench (sass) 817 | 818 | # Installshield output folder 819 | 820 | # DocProject is a documentation generator add-in 821 | 822 | # Click-Once directory 823 | 824 | # Publish Web Output 825 | # Note: Comment the next line if you want to checkin your web deploy settings, 826 | # but database connection strings (with potential passwords) will be unencrypted 827 | 828 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 829 | # checkin your Azure Web App publish settings, but sensitive information contained 830 | # in these scripts will be unencrypted 831 | 832 | # NuGet Packages 833 | # NuGet Symbol Packages 834 | # The packages folder can be ignored because of Package Restore 835 | # except build/, which is used as an MSBuild target. 836 | # Uncomment if necessary however generally it will be regenerated when needed 837 | # NuGet v3's project.json files produces more ignorable files 838 | 839 | # Microsoft Azure Build Output 840 | 841 | # Microsoft Azure Emulator 842 | 843 | # Windows Store app package directories and files 844 | 845 | # Visual Studio cache files 846 | # files ending in .cache can be ignored 847 | # but keep track of directories ending in .cache 848 | 849 | # Others 850 | 851 | # Including strong name files can present a security risk 852 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 853 | 854 | # Since there are multiple workflows, uncomment next line to ignore bower_components 855 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 856 | 857 | # RIA/Silverlight projects 858 | 859 | # Backup & report files from converting an old project file 860 | # to a newer Visual Studio version. Backup files are not needed, 861 | # because we have git ;-) 862 | 863 | # SQL Server files 864 | 865 | # Business Intelligence projects 866 | 867 | # Microsoft Fakes 868 | 869 | # GhostDoc plugin setting file 870 | 871 | # Node.js Tools for Visual Studio 872 | 873 | # Visual Studio 6 build log 874 | 875 | # Visual Studio 6 workspace options file 876 | 877 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 878 | 879 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 880 | 881 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 882 | 883 | # Visual Studio 6 technical files 884 | 885 | # Visual Studio LightSwitch build output 886 | 887 | # Paket dependency manager 888 | 889 | # FAKE - F# Make 890 | 891 | # CodeRush personal settings 892 | 893 | # Python Tools for Visual Studio (PTVS) 894 | 895 | # Cake - Uncomment if you are using it 896 | # tools/** 897 | # !tools/packages.config 898 | 899 | # Tabs Studio 900 | 901 | # Telerik's JustMock configuration file 902 | 903 | # BizTalk build output 904 | 905 | # OpenCover UI analysis results 906 | 907 | # Azure Stream Analytics local run output 908 | 909 | # MSBuild Binary and Structured Log 910 | 911 | # NVidia Nsight GPU debugger configuration file 912 | 913 | # MFractors (Xamarin productivity tool) working folder 914 | 915 | # Local History for Visual Studio 916 | 917 | # Visual Studio History (VSHistory) files 918 | 919 | # BeatPulse healthcheck temp database 920 | 921 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 922 | 923 | # Ionide (cross platform F# VS Code tools) working folder 924 | 925 | # Fody - auto-generated XML schema 926 | 927 | # VS Code files for those working on multiple tools 928 | 929 | # Local History for Visual Studio Code 930 | 931 | # Windows Installer files from build outputs 932 | 933 | # JetBrains Rider 934 | 935 | ### VisualStudio Patch ### 936 | # Additional files built by Visual Studio 937 | 938 | # End of https://www.toptal.com/developers/gitignore/api/csharp,visualstudio,python,jetbrains,macos,linux,windows -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | RouletteRecorder - Yet Another FFXIV Roulette Recorder in CSharp 633 | Copyright (C) 2023 StarHeartHunt 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RouletteRecorder 2 | 3 | [NGA 原帖](https://nga.178.com/read.php?tid=34277964) 4 | 5 | ## 下载方式 6 | 7 | 1. 前往[本仓库 Releases](https://github.com/StarHeartHunt/RouletteRecorder/releases)下载 8 | 9 | 2. [NGA 帖子主楼](https://nga.178.com/read.php?tid=34277964)更新 10 | 11 | 3. 前往[本仓库 Actions 构建](https://github.com/StarHeartHunt/RouletteRecorder/actions/workflows/build.yml),点击上方最新 commit 的构建记录,下拉找到 Artifacts 点击 Bundle 下载 12 | 13 | ## 使用方法 14 | 15 | 1. 解压压缩包,在 ACT 插件管理选择 RouletteRecorder.dll,添加启用插件 16 | 17 | 2. 配置订阅任务类型,在对应类型的随机任务结束时数据会写入到插件同目录下的数据.csv 文件中 18 | 19 | ## 注意事项 20 | 21 | 在插件工作前,如果使用 excel 等软件打开了数据文件,需要先进行关闭,否则插件无法锁定文件保证随机任务记录写入。 22 | 23 | 在每次版本更新后插件也需要进行更新,可前往 [GitHub](https://github.com/StarHeartHunt/RouletteRecorder) 获取更新或者发 PR 帮助我适配版本。 24 | -------------------------------------------------------------------------------- /RouletteRecorder.Packer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RouletteRecorder.Packer/Program.cs: -------------------------------------------------------------------------------- 1 | namespace RouletteRecorder.Packer 2 | { 3 | using System; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.IO.Compression; 7 | 8 | public class Program 9 | { 10 | private static void GenerateAssembly() 11 | { 12 | string version = DateTime.UtcNow.ToString("yy.M.d.Hmm"); 13 | 14 | var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\RouletteRecorder\Properties\AssemblyInfo.cs"); 15 | var template = @"using System.Reflection; 16 | 17 | [assembly: AssemblyTitle(""RouletteRecorder"")] 18 | [assembly: AssemblyDescription(""RouletteRecorder"")] 19 | [assembly: AssemblyCompany(""StarHeartHunt"")] 20 | [assembly: AssemblyVersion(""{0}"")] 21 | [assembly: AssemblyCopyright(""Copyright © StarHeartHunt {1}"")] 22 | "; 23 | var content = string.Format(template, version, DateTime.Now.Year.ToString()); 24 | Console.WriteLine(content); 25 | File.WriteAllText(path, content); 26 | } 27 | 28 | private static void Bundle(string env) 29 | { 30 | var root = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, env); 31 | var entry = Path.Combine(root, "RouletteRecorder.dll"); 32 | var version = FileVersionInfo.GetVersionInfo(entry); 33 | 34 | var outName = $"RouletteRecorder-{version.FileVersion}-{env}.zip"; 35 | 36 | using (var ms = new MemoryStream()) 37 | { 38 | using (var archive = new ZipArchive(ms, ZipArchiveMode.Create, true)) 39 | { 40 | foreach (var dll in Directory.GetFiles(root)) 41 | { 42 | archive.CreateEntryFromFile(dll, @"RouletteRecorder/" + Path.GetFileName(dll)); 43 | } 44 | 45 | foreach (var data in Directory.GetFiles(Path.Combine(root, "data"), "*.json")) 46 | { 47 | archive.CreateEntryFromFile(data, @"RouletteRecorder/data/" + Path.GetFileName(data)); 48 | } 49 | } 50 | 51 | using (var fileStream = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, outName), FileMode.Create)) 52 | { 53 | ms.Seek(0, SeekOrigin.Begin); 54 | ms.CopyTo(fileStream); 55 | } 56 | } 57 | } 58 | 59 | private static void Main(string[] args) 60 | { 61 | string env = args.Length >= 1 ? args[0] : "Release"; 62 | if (env == "Assembly") 63 | { 64 | GenerateAssembly(); 65 | } 66 | else 67 | { 68 | Bundle(env); 69 | } 70 | } 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /RouletteRecorder.Packer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("RouletteRecorder.Packer")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("StarHeartHunt")] 11 | [assembly: AssemblyProduct("RouletteRecorder.Packer")] 12 | [assembly: AssemblyCopyright("Copyright © StarHeartHunt 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f1092112-e746-4344-b55d-da3c99c1a3e4")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /RouletteRecorder.Packer/RouletteRecorder.Packer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F1092112-E746-4344-B55D-DA3C99C1A3E4} 8 | Exe 9 | RouletteRecorder.Packer 10 | RouletteRecorder.Packer 11 | v4.8 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | ..\bin\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | ..\bin\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /RouletteRecorder.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32414.318 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouletteRecorder", "RouletteRecorder\RouletteRecorder.csproj", "{112FE70D-6D9F-4C9F-B4E1-83F142BA36D2}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {F1092112-E746-4344-B55D-DA3C99C1A3E4} = {F1092112-E746-4344-B55D-DA3C99C1A3E4} 9 | EndProjectSection 10 | EndProject 11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CD17C8C5-E555-4DBF-92A7-A4447321D1D4}" 12 | ProjectSection(SolutionItems) = preProject 13 | .gitignore = .gitignore 14 | README.md = README.md 15 | EndProjectSection 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RouletteRecorder.Packer", "RouletteRecorder.Packer\RouletteRecorder.Packer.csproj", "{F1092112-E746-4344-B55D-DA3C99C1A3E4}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {112FE70D-6D9F-4C9F-B4E1-83F142BA36D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {112FE70D-6D9F-4C9F-B4E1-83F142BA36D2}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {112FE70D-6D9F-4C9F-B4E1-83F142BA36D2}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {112FE70D-6D9F-4C9F-B4E1-83F142BA36D2}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {F1092112-E746-4344-B55D-DA3C99C1A3E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {F1092112-E746-4344-B55D-DA3C99C1A3E4}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {F1092112-E746-4344-B55D-DA3C99C1A3E4}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {F1092112-E746-4344-B55D-DA3C99C1A3E4}.Release|Any CPU.Build.0 = Release|Any CPU 33 | EndGlobalSection 34 | GlobalSection(SolutionProperties) = preSolution 35 | HideSolutionNode = FALSE 36 | EndGlobalSection 37 | GlobalSection(ExtensibilityGlobals) = postSolution 38 | SolutionGuid = {D847B7CF-4D40-4F41-83BA-08A27E1A08D2} 39 | EndGlobalSection 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /RouletteRecorder/Config.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using RouletteRecorder.Utils; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using ThomasJaworski.ComponentModel; 6 | 7 | namespace RouletteRecorder 8 | { 9 | public sealed class Config : BindingTarget 10 | { 11 | private static string configPath = Path.Combine(Helper.GetConfigDir(), "RouletteRecorder.config"); 12 | public static Dictionary MonitorTypes = new Dictionary() 13 | { 14 | { Monitors.MonitorType.Network, "网络解析" }, 15 | }; 16 | public static Models.ConfigData Instance { get; private set; } = new Models.ConfigData(); 17 | public static void Load() 18 | { 19 | if (!File.Exists(configPath)) 20 | { 21 | Save(); 22 | } 23 | try 24 | { 25 | string content = File.ReadAllText(configPath); 26 | Instance = JsonConvert.DeserializeObject(content); 27 | } 28 | catch { } 29 | 30 | var listener = ChangeListener.Create(Instance); 31 | listener.PropertyChanged += (_, e) => Save(); 32 | listener.CollectionChanged += (_, e) => Save(); 33 | } 34 | 35 | public static void Save() 36 | { 37 | File.WriteAllText(configPath, JsonConvert.SerializeObject(Instance, Formatting.Indented)); 38 | } 39 | 40 | public static string GetLanguageString() 41 | { 42 | switch (Instance.Language) 43 | { 44 | case FFXIV_ACT_Plugin.Common.Language.Chinese: 45 | return "chs"; 46 | case FFXIV_ACT_Plugin.Common.Language.English: 47 | return "en"; 48 | case FFXIV_ACT_Plugin.Common.Language.French: 49 | return "fr"; 50 | case FFXIV_ACT_Plugin.Common.Language.German: 51 | return "de"; 52 | case FFXIV_ACT_Plugin.Common.Language.Japanese: 53 | return "ja"; 54 | default: 55 | return "en"; 56 | } 57 | } 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /RouletteRecorder/Constant/LogType.cs: -------------------------------------------------------------------------------- 1 | namespace RouletteRecorder.Constant 2 | { 3 | public enum LogType 4 | { 5 | None, 6 | LogLine, 7 | State, 8 | Event, 9 | DungeonLogger, 10 | 11 | #if DEBUG 12 | Request, 13 | ActorControlSelf, 14 | InvalidPacket, 15 | RawPacket, 16 | Debug1, 17 | #endif 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RouletteRecorder/Constant/OpcodeChina.cs: -------------------------------------------------------------------------------- 1 | // Generated by https://github.com/gamous/FFXIVNetworkOpcodes 2 | namespace FFXIVOpcodes.CN 3 | { 4 | public enum ServerLobbyIpcType : ushort 5 | { 6 | 7 | }; 8 | 9 | public enum ClientLobbyIpcType : ushort 10 | { 11 | 12 | }; 13 | 14 | public enum ServerZoneIpcType : ushort 15 | { 16 | PlayerSpawn = 0x0222, 17 | NpcSpawn = 0x01F6, 18 | NpcSpawn2 = 0x0235, 19 | ActorFreeSpawn = 0x0110, 20 | ObjectSpawn = 0x02B8, 21 | ObjectDespawn = 0x0260, 22 | CreateTreasure = 0x0330, 23 | OpenTreasure = 0x0120, 24 | TreasureFadeOut = 0x02CB, 25 | ActorMove = 0x031A, 26 | Transfer = 0x00A3, 27 | Effect = 0x032A, 28 | AoeEffect8 = 0x033C, 29 | AoeEffect16 = 0x008D, 30 | AoeEffect24 = 0x0107, 31 | AoeEffect32 = 0x00F7, 32 | ActorCast = 0x0237, 33 | ActorControl = 0x0099, 34 | ActorControlTarget = 0x015A, 35 | ActorControlSelf = 0x025E, 36 | DirectorVars = 0x01B2, 37 | MapEffect = 0x0384, 38 | MapEffect4 = 0x00E1, 39 | MapEffect8 = 0x0315, 40 | MapEffect12 = 0x0362, 41 | _record_unk29_ = 0x0388, 42 | LandSetMap = 0x0358, 43 | _record_unk31_ = 0x01CA, 44 | EventStart = 0x02B9, 45 | EventFinish = 0x03C9, 46 | EventPlay = 0x0380, 47 | EventPlay4 = 0x0190, 48 | EventPlay8 = 0x00E2, 49 | EventPlay16 = 0x0101, 50 | EventPlay32 = 0x02B1, 51 | EventPlay64 = 0x0319, 52 | EventPlay128 = 0x0302, 53 | EventPlay255 = 0x024D, 54 | BattleTalk2 = 0x00E9, 55 | BattleTalk4 = 0x0293, 56 | BattleTalk8 = 0x01E6, 57 | BalloonTalk2 = 0x0304, 58 | BalloonTalk4 = 0x036F, 59 | BalloonTalk8 = 0x01EA, 60 | SystemLogMessage = 0x02DE, 61 | SystemLogMessage32 = 0x027F, 62 | SystemLogMessage48 = 0x016C, 63 | SystemLogMessage80 = 0x03E3, 64 | SystemLogMessage144 = 0x00A8, 65 | NpcYell = 0x029C, 66 | ActorSetPos = 0x0277, 67 | PrepareZoning = 0x02D6, 68 | WeatherChange = 0x01A4, 69 | UpdateParty = 0x0239, 70 | UpdateAlliance = 0x032E, 71 | UpdateSpAlliance = 0x0262, 72 | UpdateHpMpTp = 0x0392, 73 | StatusEffectList = 0x0369, 74 | StatusEffectList2 = 0x01D2, 75 | StatusEffectList3 = 0x0383, 76 | EurekaStatusEffectList = 0x0070, 77 | BossStatusEffectList = 0x0317, 78 | EffectResult = 0x0153, 79 | EffectResult4 = 0x0386, 80 | EffectResult8 = 0x02A4, 81 | EffectResult16 = 0x034C, 82 | EffectResultBasic = 0x037E, 83 | EffectResultBasic4 = 0x0234, 84 | EffectResultBasic8 = 0x0359, 85 | EffectResultBasic16 = 0x0372, 86 | EffectResultBasic32 = 0x0140, 87 | EffectResultBasic64 = 0x00F8, 88 | PartyPos = 0x03CD, 89 | AlliancePos = 0x0177, 90 | SpAlliancePos = 0x00DB, 91 | PlaceMarker = 0x02D9, 92 | PlaceFieldMarkerPreset = 0x0240, 93 | PlaceFieldMarker = 0x0201, 94 | ActorGauge = 0x01F5, 95 | CharaVisualEffect = 0x01B3, 96 | Fall = 0x0146, 97 | UpdateHate = 0x03BB, 98 | UpdateHater = 0x033A, 99 | FirstAttack = 0x019E, 100 | ModelEquip = 0x03A5, 101 | EquipDisplayFlags = 0x00F0, 102 | UnMount = 0x02A1, 103 | Mount = 0x0154, 104 | CountdownInitiate = 0x027B, 105 | CountdownCancel = 0x03A7, 106 | InitZone = 0x00CE, 107 | Examine = 0x0097, 108 | ExamineSearchInfo = 0x0094, 109 | InventoryActionAck = 0x0119, 110 | MarketBoardItemListing = 0x020E, 111 | MarketBoardItemListingCount = 0x01BE, 112 | MarketBoardItemListingHistory = 0x03AD, 113 | MarketBoardSearchResult = 0x006C, 114 | MarketBoardPurchase = 0x015F, 115 | PlayerSetup = 0x00D8, 116 | PlayerStats = 0x0308, 117 | Playtime = 0x02B3, 118 | UpdateClassInfo = 0x03C5, 119 | UpdateInventorySlot = 0x016A, 120 | UpdateSearchInfo = 0x03D4, 121 | WardLandInfo = 0x0340, 122 | CEDirector = 0x014E, 123 | Logout = 0x0238, 124 | FreeCompanyInfo = 0x022F, 125 | FreeCompanyDialog = 0x010F, 126 | AirshipStatusList = 0x0360, 127 | AirshipStatus = 0x0341, 128 | AirshipExplorationResult = 0x0077, 129 | SubmarineStatusList = 0x0150, 130 | SubmarineProgressionStatus = 0x01CE, 131 | SubmarineExplorationResult = 0x00DC, 132 | CFPreferredRole = 0x0335, 133 | CompanyAirshipStatus = 0x019A, 134 | CompanySubmersibleStatus = 0x02DD, 135 | ContentFinderNotifyPop = 0x0246, 136 | FateInfo = 0x02A3, 137 | UpdateRecastTimes = 0x00CC, 138 | SocialList = 0x0232, 139 | IslandWorkshopSupplyDemand = 0x035C, 140 | RSV = 0x0182, 141 | RSF = 0x0156, 142 | WorldVisitQueue = 0x0334, 143 | }; 144 | 145 | public enum ClientZoneIpcType : ushort 146 | { 147 | ActionRequest = 0x01E9, 148 | ActionRequestGroundTargeted = 0x0348, 149 | ChatHandler = 0x03B1, 150 | ClientTrigger = 0x00E3, 151 | InventoryModifyHandler = 0x02DF, 152 | MarketBoardPurchaseHandler = 0x01BB, 153 | MarketBoardRequestItemListingInfo = 0x00EF, 154 | SetSearchInfoHandler = 0x01E0, 155 | UpdatePositionHandler = 0x00BC, 156 | UpdatePositionInstance = 0x03E7, 157 | Heartbeat = 0x00C9, 158 | WorldTravel = 0x0125, 159 | ClientCountdownInitiate = 0x025B, 160 | }; 161 | 162 | public enum ServerChatIpcType : ushort 163 | { 164 | 165 | }; 166 | 167 | public enum ClientChatIpcType : ushort 168 | { 169 | 170 | }; 171 | 172 | } 173 | -------------------------------------------------------------------------------- /RouletteRecorder/Constant/OpcodeGlobal.cs: -------------------------------------------------------------------------------- 1 | namespace FFXIVOpcodes.Global 2 | { 3 | //////////////////////////////////////////////////////////////////////////////// 4 | /// Lobby Connection IPC Codes 5 | /** 6 | * Server IPC Lobby Type Codes. 7 | */ 8 | enum ServerLobbyIpcType : ushort 9 | { 10 | LobbyError = 0x0002, 11 | LobbyServiceAccountList = 0x000C, 12 | LobbyCharList = 0x000D, 13 | LobbyCharCreate = 0x000E, 14 | LobbyEnterWorld = 0x000F, 15 | LobbyServerList = 0x0015, 16 | LobbyRetainerList = 0x0017, 17 | }; 18 | 19 | /** 20 | * Client IPC Lobby Type Codes. 21 | */ 22 | enum ClientLobbyIpcType : ushort 23 | { 24 | ReqCharList = 0x0003, 25 | ReqEnterWorld = 0x0004, 26 | ClientVersionInfo = 0x0005, 27 | 28 | ReqCharDelete = 0x000A, 29 | ReqCharCreate = 0x000B, 30 | }; 31 | 32 | //////////////////////////////////////////////////////////////////////////////// 33 | /// Zone Connection IPC Codes 34 | /** 35 | * Server IPC Zone Type Codes. 36 | */ 37 | enum ServerZoneIpcType : ushort 38 | { 39 | // Server Zone 40 | PlayerSetup = 0x026F, // updated 7.35h 41 | UpdateHpMpTp = 0x03D1, // updated 7.35h 42 | UpdateClassInfo = 0x02CC, // updated 7.35h 43 | PlayerStats = 0x03AD, // updated 7.35h 44 | ActorControl = 0x00A1, // updated 7.35h 45 | ActorControlSelf = 0x03BD, // updated 7.35h 46 | ActorControlTarget = 0x01DD, // updated 7.35h 47 | Playtime = 0x00A4, // updated 7.35h 48 | UpdateSearchInfo = 0x00BB, // updated 7.35h 49 | ExamineSearchInfo = 0x01BA, // updated 7.35h 50 | Examine = 0x0349, // updated 7.35h 51 | ActorCast = 0x0355, // updated 7.35h 52 | CurrencyCrystalInfo = 0x0121, // updated 7.35h 53 | InitZone = 0x03A3, // updated 7.35h 54 | WeatherChange = 0x00E0, // updated 7.35h 55 | PlayerSpawn = 0x00E3, // updated 7.35h 56 | ActorSetPos = 0x034D, // updated 7.35h 57 | PrepareZoning = 0x02FA, // updated 7.35h 58 | ContainerInfo = 0x017C, // updated 7.35h 59 | ItemInfo = 0x00F6, // updated 7.35h 60 | PlaceFieldMarker = 0x00C0, // updated 7.35h 61 | PlaceFieldMarkerPreset = 0x0105, // updated 7.35h 62 | EffectResult = 0x0185, // updated 7.35h 63 | EventStart = 0x0107, // updated 7.35h 64 | EventFinish = 0x028A, // updated 7.35h 65 | DesynthResult = 0x032B, // updated 7.35h 66 | FreeCompanyInfo = 0x023B, // updated 7.35h 67 | FreeCompanyDialog = 0x0280, // updated 7.35h 68 | MarketBoardSearchResult = 0x025F, // updated 7.35h 69 | MarketBoardItemListingCount = 0x011E, // updated 7.35h 70 | MarketBoardItemListingHistory = 0x03C1, // updated 7.35h 71 | MarketBoardItemListing = 0x027D, // updated 7.35h 72 | MarketBoardPurchase = 0x025C, // updated 7.35h 73 | UpdateInventorySlot = 0x037B, // updated 7.35h 74 | InventoryActionAck = 0x02C3, // updated 7.35h 75 | InventoryTransaction = 0x00EB, // updated 7.35h 76 | InventoryTransactionFinish = 0x02A1, // updated 7.35h 77 | ResultDialog = 0x031D, // updated 7.35h 78 | RetainerInformation = 0x01B9, // updated 7.35h 79 | NpcSpawn = 0x02EA, // updated 7.35h 80 | ItemMarketBoardInfo = 0x01B2, // updated 7.35h 81 | ObjectSpawn = 0x01C0, // updated 7.35h 82 | EffectResultBasic = 0x02D9, // updated 7.35h 83 | Effect = 0x00F2, // updated 7.35h 84 | StatusEffectList = 0x03D4, // updated 7.35h 85 | StatusEffectList2 = 0x01BD, // updated 7.35h 86 | StatusEffectList3 = 0x038D, // updated 7.35h 87 | ActorGauge = 0x0301, // updated 7.35h 88 | CFNotify = 0x0387, // updated 7.35h 89 | SystemLogMessage = 0x039F, // updated 7.35h 90 | AirshipTimers = 0x02EE, // updated 7.35h 91 | SubmarineTimers = 0x01AD, // updated 7.35h 92 | AirshipStatusList = 0x0103, // updated 7.35h 93 | AirshipStatus = 0x0323, // updated 7.35h 94 | AirshipExplorationResult = 0x0239, // updated 7.35h 95 | SubmarineProgressionStatus = 0x0067, // updated 7.35h 96 | SubmarineStatusList = 0x026E, // updated 7.35h 97 | SubmarineExplorationResult = 0x006A, // updated 7.35h 98 | 99 | CraftingLog = 0x015B, // updated 7.35h 100 | GatheringLog = 0x0173, // updated 7.35h 101 | 102 | ActorMove = 0x013E, // updated 7.35h 103 | 104 | EventPlay = 0x0083, // updated 7.35h 105 | EventPlay4 = 0x0115, // updated 7.35h 106 | EventPlay8 = 0x02ED, // updated 7.35h 107 | EventPlay16 = 0x0262, // updated 7.35h 108 | EventPlay32 = 0x0371, // updated 7.35h 109 | EventPlay64 = 0x0380, // updated 7.35h 110 | EventPlay128 = 0x02D4, // updated 7.35h 111 | EventPlay255 = 0x0098, // updated 7.35h 112 | 113 | EnvironmentControl = 0x0226, // updated 7.35h 114 | IslandWorkshopSupplyDemand = 0x0325, // updated 7.35h 115 | Logout = 0x0360, // updated 7.35h 116 | }; 117 | 118 | /** 119 | * Client IPC Zone Type Codes. 120 | */ 121 | enum ClientZoneIpcType : ushort 122 | { 123 | UpdatePositionHandler = 0x02F6, // updated 7.35h 124 | //ClientTrigger = 0x0324, // updated 7.0h 125 | SetSearchInfoHandler = 0x0233, // updated 7.35h 126 | MarketBoardPurchaseHandler = 0x02E3, // updated 7.35h 127 | InventoryModifyHandler = 0x016B, // updated 7.35h 128 | //UpdatePositionInstance = 0x03CE, // updated 7.0h 129 | }; 130 | 131 | //////////////////////////////////////////////////////////////////////////////// 132 | /// Chat Connection IPC Codes 133 | /** 134 | * Server IPC Chat Type Codes. 135 | */ 136 | enum ServerChatIpcType : ushort 137 | { 138 | //Tell = 0x0064, // updated for sb 139 | //TellErrNotFound = 0x0066, 140 | 141 | //FreeCompanyEvent = 0x012C, // added 5.0 142 | }; 143 | 144 | /** 145 | * Client IPC Chat Type Codes. 146 | */ 147 | enum ClientChatIpcType : ushort 148 | { 149 | //TellReq = 0x0064, 150 | }; 151 | } -------------------------------------------------------------------------------- /RouletteRecorder/Constant/OpcodeStorage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace RouletteRecorder.Constant 4 | { 5 | internal enum Opcode 6 | { 7 | ActorControlSelf, 8 | ContentFinderNotifyPop, 9 | InitZone, 10 | } 11 | internal static class OpcodeStorage 12 | { 13 | public static Dictionary Global = new Dictionary 14 | { 15 | { (ushort)FFXIVOpcodes.Global.ServerZoneIpcType.ActorControlSelf, Opcode.ActorControlSelf }, 16 | { (ushort)FFXIVOpcodes.Global.ServerZoneIpcType.CFNotify, Opcode.ContentFinderNotifyPop }, 17 | { (ushort)FFXIVOpcodes.Global.ServerZoneIpcType.InitZone, Opcode.InitZone }, 18 | }; 19 | 20 | public static Dictionary China = new Dictionary 21 | { 22 | { (ushort)FFXIVOpcodes.CN.ServerZoneIpcType.ActorControlSelf, Opcode.ActorControlSelf }, 23 | { (ushort)FFXIVOpcodes.CN.ServerZoneIpcType.ContentFinderNotifyPop, Opcode.ContentFinderNotifyPop }, 24 | { (ushort)FFXIVOpcodes.CN.ServerZoneIpcType.InitZone, Opcode.InitZone }, 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RouletteRecorder/Constant/Region.cs: -------------------------------------------------------------------------------- 1 | namespace RouletteRecorder.Constant 2 | { 3 | public enum Region 4 | { 5 | Global, 6 | China, 7 | Korea 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /RouletteRecorder/DAO/Roulette.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper.Configuration.Attributes; 2 | using RouletteRecorder.Constant; 3 | using RouletteRecorder.Network.DungeonLogger; 4 | using RouletteRecorder.Utils; 5 | using System; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace RouletteRecorder.DAO 10 | { 11 | public class Roulette 12 | { 13 | [Name("任务类型")] 14 | public string RouletteType { get; set; } 15 | 16 | [Name("日期")] 17 | public string Date { get; set; } 18 | 19 | [Name("开始时间")] 20 | public string StartedAt { get; set; } 21 | 22 | [Name("结束时间")] 23 | public string EndedAt { get; set; } 24 | 25 | [Name("副本名称")] 26 | [TypeConverter(typeof(ItemNameConverter))] 27 | public Models.ItemName RouletteName { get; set; } 28 | 29 | [Name("职业")] 30 | public string JobName { get; set; } 31 | 32 | [Name("完成情况")] 33 | public bool IsCompleted { get; set; } 34 | 35 | public Roulette(Models.ItemName rouletteName = null, string rouletteType = null, bool isCompleted = false) 36 | { 37 | Date = DateTime.Now.ToString("yyyy-MM-dd"); 38 | StartedAt = DateTime.Now.ToString("T"); 39 | EndedAt = ""; 40 | RouletteName = rouletteName; 41 | RouletteType = rouletteType; 42 | IsCompleted = isCompleted; 43 | } 44 | public static Roulette Instance { get; private set; } 45 | 46 | public static void Init(Models.ItemName rouletteName = null, string rouletteType = null, bool isCompleted = false) 47 | { 48 | Instance = new Roulette(rouletteName, rouletteType, isCompleted); 49 | } 50 | 51 | public async void Finish() 52 | { 53 | if (Instance == null) return; 54 | 55 | var isSubscribedRouletteType = Config.Instance 56 | .RouletteTypes 57 | .Select(type => Data.Instance.Roulettes[type].ToString()) 58 | .Contains(Instance.RouletteType); 59 | if (Instance.RouletteType == null || Instance.RouletteName == null || !isSubscribedRouletteType) return; 60 | 61 | var ffxivPlugin = (FFXIV_ACT_Plugin.FFXIV_ACT_Plugin)await Helper.GetFFXIVPlugin(); 62 | var jobId = ffxivPlugin.DataRepository.GetPlayer().JobID; 63 | Instance.JobName = Data.Instance.Jobs.TryGetValue(Convert.ToInt32(jobId), out var jobName) ? jobName.Name : "未知职业"; 64 | Instance.EndedAt = DateTime.Now.ToString("T"); 65 | 66 | Database.InsertRoulette(Instance); 67 | if (Instance.IsCompleted) await UploadDungeonLogger(); 68 | 69 | Instance = null; 70 | } 71 | 72 | public async Task UploadDungeonLogger() 73 | { 74 | if (!Config.Instance.DungeonLogger.Enabled) return false; 75 | try 76 | { 77 | using (var client = new DungeonLoggerClient()) 78 | { 79 | await client.PostLogin(Config.Instance.DungeonLogger.Password, Config.Instance.DungeonLogger.Username); 80 | 81 | var maze = await client.GetStatMaze(); 82 | var job = await client.GetStatProf(); 83 | 84 | var mazeId = maze.Data.Find(ele => ele.Name.Equals(Instance.RouletteName.Chinese)).Id; 85 | var profKey = job.Data.Find(ele => ele.NameCn.Equals(Instance.JobName)).Key; 86 | 87 | await client.PostRecord(mazeId, profKey); 88 | } 89 | } 90 | catch (Exception e) 91 | { 92 | Log.Error(LogType.DungeonLogger, $"[{e.GetType()}]{e.Message}\r\n{e.StackTrace}"); 93 | return false; 94 | } 95 | return true; 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /RouletteRecorder/Data.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Windows; 5 | using RouletteRecorder.Utils; 6 | using Newtonsoft.Json; 7 | 8 | namespace RouletteRecorder 9 | { 10 | public partial class Data : StaticBindingTarget 11 | { 12 | public Dictionary Instances; 13 | public Dictionary Roulettes { get; set; } 14 | public Dictionary Jobs; 15 | 16 | private bool ReadData(string path, string file, out T dict) where T : new() 17 | { 18 | try 19 | { 20 | string content = File.ReadAllText(Path.Combine(path, file)); 21 | dict = JsonConvert.DeserializeObject(content); 22 | return true; 23 | } 24 | catch 25 | { 26 | MessageBox.Show($"无法找到数据文件 {file} 或读取时发生错误", "RouletteRecorder"); 27 | dict = new T(); 28 | return false; 29 | } 30 | } 31 | 32 | public void Init() 33 | { 34 | var dataRoot = Path.Combine(Helper.GetPluginDir(), "data"); 35 | 36 | ReadData(dataRoot, "instance.json", out Instances); 37 | ReadData(dataRoot, "job.json", out Jobs); 38 | 39 | ReadData(dataRoot, "roulette.json", out Dictionary roulettes); 40 | Roulettes = roulettes; 41 | 42 | IsLoaded = true; 43 | DataLoaded?.Invoke(this, EventArgs.Empty); 44 | } 45 | 46 | public bool IsLoaded = false; 47 | public event EventHandler DataLoaded; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RouletteRecorder/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /RouletteRecorder/GitHub-Mark-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StarHeartHunt/RouletteRecorder/fb7c4b4cb595fc66342fae27269d6a0e780b6298/RouletteRecorder/GitHub-Mark-32px.png -------------------------------------------------------------------------------- /RouletteRecorder/ILRepack.Config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /RouletteRecorder/Models/ConfigData.cs: -------------------------------------------------------------------------------- 1 | using FFXIV_ACT_Plugin.Common; 2 | using Newtonsoft.Json; 3 | using RouletteRecorder.Constant; 4 | using RouletteRecorder.Utils; 5 | using System.Collections.ObjectModel; 6 | 7 | namespace RouletteRecorder.Models 8 | { 9 | public class ConfigData : BindingTarget 10 | { 11 | public ConfigData() : this(null, null, null, null, null) 12 | { 13 | } 14 | 15 | [JsonConstructor] 16 | private ConfigData( 17 | Region? region, 18 | Language? language, 19 | ConfigLogger logger, 20 | ObservableCollection rouletteTypes, 21 | ConfigDungeonLogger dungeonLogger) 22 | { 23 | Region = region; 24 | Language = language; 25 | RouletteTypes = rouletteTypes ?? new ObservableCollection(); 26 | MonitorType = Monitors.MonitorType.Network; 27 | Logger = logger ?? new ConfigLogger(); 28 | DungeonLogger = dungeonLogger ?? new ConfigDungeonLogger(); 29 | } 30 | 31 | [JsonProperty("region")] 32 | public Region? Region { get; set; } 33 | 34 | [JsonProperty("language")] 35 | public Language? Language { get; set; } 36 | 37 | [JsonProperty("roulette")] 38 | public ObservableCollection RouletteTypes { get; set; } 39 | 40 | [JsonProperty("monitor")] 41 | public Monitors.MonitorType MonitorType { get; set; } 42 | 43 | [JsonProperty("logger")] 44 | public ConfigLogger Logger { get; set; } 45 | 46 | [JsonProperty("dungeonLogger")] 47 | public ConfigDungeonLogger DungeonLogger { get; set; } 48 | } 49 | 50 | public class ConfigLogger : BindingTarget 51 | { 52 | [JsonProperty("enabled")] 53 | public bool Enabled { get; set; } 54 | [JsonProperty("debug")] 55 | public bool Debug { get; set; } 56 | } 57 | 58 | public class ConfigDungeonLogger : BindingTarget 59 | { 60 | [JsonProperty("enabled")] 61 | public bool Enabled { get; set; } = false; 62 | 63 | [JsonProperty("username")] 64 | public string Username { get; set; } 65 | 66 | [JsonProperty("password")] 67 | public string Password { get; set; } 68 | } 69 | } -------------------------------------------------------------------------------- /RouletteRecorder/Models/InstanceData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Models 4 | { 5 | public class InstanceData 6 | { 7 | [JsonProperty("name")] 8 | public ItemName Name; 9 | 10 | [JsonProperty("type")] 11 | public int Type; 12 | 13 | [JsonProperty("level")] 14 | public int Level; 15 | 16 | [JsonProperty("levelSync")] 17 | public int LevelSync; 18 | 19 | [JsonProperty("item")] 20 | public int ItemLevel; 21 | 22 | [JsonProperty("itemSync")] 23 | public int ItemLevelSync; 24 | 25 | [JsonProperty("memberType")] 26 | public int MemberType; 27 | } 28 | } -------------------------------------------------------------------------------- /RouletteRecorder/Models/ItemName.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Models 4 | { 5 | public class ItemName 6 | { 7 | [JsonProperty("chs")] 8 | public string Chinese = null; 9 | [JsonProperty("en")] 10 | public string English = null; 11 | [JsonProperty("ja")] 12 | public string Japanese = null; 13 | [JsonProperty("de")] 14 | public string German = null; 15 | [JsonProperty("fr")] 16 | public string French = null; 17 | 18 | public override string ToString() 19 | { 20 | switch (Config.Instance.Language) 21 | { 22 | case FFXIV_ACT_Plugin.Common.Language.Chinese: 23 | return Chinese; 24 | case FFXIV_ACT_Plugin.Common.Language.English: 25 | return English; 26 | case FFXIV_ACT_Plugin.Common.Language.French: 27 | return French; 28 | case FFXIV_ACT_Plugin.Common.Language.German: 29 | return German; 30 | case FFXIV_ACT_Plugin.Common.Language.Japanese: 31 | return Japanese; 32 | default: 33 | return Chinese ?? English; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /RouletteRecorder/Models/JobName.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Models 4 | { 5 | public class JobName 6 | { 7 | [JsonProperty("name")] 8 | public string Name { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RouletteRecorder/Models/WorldData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Models 4 | { 5 | public class WorldData 6 | { 7 | [JsonProperty("name")] 8 | public string LocalName; 9 | [JsonProperty("name_en")] 10 | public string EnglishName; 11 | [JsonProperty("dc")] 12 | public string LocalDataCenter; 13 | [JsonProperty("dc_en")] 14 | public string EnglishDataCenter; 15 | 16 | public override string ToString() 17 | { 18 | return LocalName; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RouletteRecorder/Monitors/MonitorType.cs: -------------------------------------------------------------------------------- 1 | namespace RouletteRecorder.Monitors 2 | { 3 | public enum MonitorType 4 | { 5 | Network 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /RouletteRecorder/Monitors/NetworkMonitor.cs: -------------------------------------------------------------------------------- 1 | using RouletteRecorder.Constant; 2 | using RouletteRecorder.DAO; 3 | using RouletteRecorder.Utils; 4 | using System; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace RouletteRecorder.Monitors 9 | { 10 | public class NetworkMonitor 11 | { 12 | private static bool ToInternalOpcode(ushort opcode, out Opcode internalOpcode) 13 | { 14 | var region = Config.Instance.Region; 15 | switch (region) 16 | { 17 | case Region.Global: 18 | return OpcodeStorage.Global.TryGetValue(opcode, out internalOpcode); 19 | 20 | case Region.China: 21 | return OpcodeStorage.China.TryGetValue(opcode, out internalOpcode); 22 | 23 | default: 24 | internalOpcode = default; 25 | return false; 26 | } 27 | } 28 | 29 | public void HandleMessageReceived(string connection, long epoch, byte[] message) 30 | { 31 | try 32 | { 33 | HandleMessage(message); 34 | } 35 | catch (Exception e) 36 | { 37 | try 38 | { 39 | FireException(e); 40 | } 41 | catch { } 42 | } 43 | } 44 | 45 | private void HandleMessage(byte[] message) 46 | { 47 | var segmentType = message[12]; 48 | // Deucalion gives wrong type (0) 49 | if (message.Length < 32 || (segmentType != 0 && segmentType != 3)) 50 | { 51 | return; 52 | } 53 | 54 | var processed = HandleMessageByOpcode(message); 55 | if (processed) return; 56 | #if DEBUG 57 | if (!ToInternalOpcode(BitConverter.ToUInt16(message, 18), out var opcode)) return; 58 | LogIncorrectPacketSize(opcode, message.Length); 59 | Log.Packet(message); 60 | #endif 61 | } 62 | 63 | public static byte[] StringToByteArray(string hex) 64 | { 65 | return Enumerable.Range(0, hex.Length) 66 | .Where(x => x % 2 == 0) 67 | .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) 68 | .ToArray(); 69 | } 70 | 71 | private bool HandleMessageByOpcode(byte[] message) 72 | { 73 | if (!ToInternalOpcode(BitConverter.ToUInt16(message, 18), out var opcode)) 74 | { 75 | return false; 76 | } 77 | 78 | var source = BitConverter.ToUInt32(message, 4); 79 | var target = BitConverter.ToUInt32(message, 8); 80 | var data = message.Skip(32).ToArray(); 81 | 82 | if (opcode == Opcode.InitZone) 83 | { 84 | if (message.Length != 144) 85 | { 86 | return false; 87 | } 88 | 89 | var serverId = BitConverter.ToUInt16(data, 0); 90 | var zoneId = BitConverter.ToUInt16(data, 2); 91 | var instanceId = BitConverter.ToUInt16(data, 4); 92 | var contentId = BitConverter.ToUInt16(data, 6); 93 | 94 | if (Roulette.Instance == null) 95 | { 96 | Roulette.Init(); 97 | } 98 | 99 | if (Roulette.Instance != null) 100 | { 101 | if (Roulette.Instance.RouletteName == null) 102 | { 103 | Roulette.Instance.RouletteName = 104 | Data.Instance.Instances.TryGetValue(contentId, out var instanceData) 105 | ? instanceData.Name 106 | : null; 107 | } 108 | else 109 | { 110 | if (Roulette.Instance.RouletteType != null) Roulette.Instance.Finish(); 111 | } 112 | } 113 | Log.Info(LogType.State, $"[NetworkMonitor] Detected InitZone: serverId:{serverId}, zoneId:{zoneId}, instanceId:{instanceId}, contentId:{contentId}"); 114 | } 115 | else if (opcode == Opcode.ActorControlSelf) 116 | { 117 | var category = BitConverter.ToUInt16(data, 0); 118 | if (category == 109) // DirectorUpdate 119 | { 120 | var param2 = data.Skip(8).ToArray(); //struct FFXIVIpcActorControlTarget : FFXIVIpcBasePacket< ActorControlTarget > 121 | if ( 122 | BitConverter.ToInt32(param2, 0) == 0x40000003 123 | || BitConverter.ToInt32(param2, 0) == 0x40000002) // Victory: 21:zone:40000003:00:00:00:00 行会令 40000002 124 | { 125 | Log.Info(LogType.State, "[NetworkMonitor] Detected ActorControlSelf (Victory)"); 126 | 127 | Roulette.Instance.IsCompleted = true; 128 | if (Roulette.Instance.RouletteType != null) 129 | { 130 | Task.Run(() => Roulette.Instance.Finish()); 131 | } 132 | } 133 | } 134 | } 135 | else if (opcode == Opcode.ContentFinderNotifyPop) 136 | { 137 | if (message.Length != 72) 138 | { 139 | return false; 140 | } 141 | var roulette = BitConverter.ToUInt16(data, 2); 142 | var instance = roulette == 0 ? BitConverter.ToUInt16(data, 0x1c) : 0; 143 | Log.Info(LogType.State, $"[NetworkMonitor] Detected ContentFinderNotifyPop: roulette:{roulette}, instance:{instance}"); 144 | 145 | if (roulette == 0) return false; 146 | 147 | Roulette.Init(); 148 | if (Roulette.Instance != null) 149 | { 150 | Roulette.Instance.RouletteType = Data.Instance.Roulettes.TryGetValue(roulette, out var rouletteName) 151 | ? rouletteName.ToString() 152 | : null; 153 | } 154 | } 155 | 156 | return true; 157 | } 158 | 159 | public delegate void ExceptionHandler(Exception e); 160 | public event ExceptionHandler OnException; 161 | private void FireException(Exception e) 162 | { 163 | OnException?.Invoke(e); 164 | } 165 | 166 | public void HandleMessageSent(string connection, long epoch, byte[] message) 167 | { 168 | } 169 | 170 | #if DEBUG 171 | private void LogIncorrectPacketSize(Opcode opcode, int size) 172 | { 173 | Log.Warn(LogType.InvalidPacket, $"{Enum.GetName(typeof(Opcode), opcode)} length {size}"); 174 | } 175 | #endif 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/DungeonLoggerClient.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using RouletteRecorder.Network.DungeonLogger.Structures; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Net; 6 | using System.Net.Http; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace RouletteRecorder.Network.DungeonLogger 11 | { 12 | public interface IDungeonLoggerClient 13 | { 14 | Task> PostLogin(string password, string username); 15 | Task PostRecord(int mazeId, string profKey); 16 | Task>> GetStatProf(); 17 | Task>> GetStatMaze(); 18 | } 19 | 20 | public class DungeonLoggerClient : IDungeonLoggerClient, IDisposable 21 | { 22 | private readonly HttpClient _client; 23 | private readonly CookieContainer cookieContainer; 24 | 25 | public DungeonLoggerClient() 26 | { 27 | cookieContainer = new CookieContainer(); 28 | _client = new HttpClient(new HttpClientHandler() 29 | { 30 | CookieContainer = cookieContainer 31 | }) 32 | { 33 | BaseAddress = new System.Uri("https://dlog.luyulight.cn"), 34 | }; 35 | } 36 | 37 | public async Task> PostLogin(string password, string username) 38 | { 39 | var response = await _client.PostAsync("/api/login", new StringContent(JsonConvert.SerializeObject(new 40 | { 41 | password, 42 | username 43 | }), Encoding.UTF8, "application/json")); 44 | response.EnsureSuccessStatusCode(); 45 | var content = await response.Content.ReadAsStringAsync(); 46 | 47 | return JsonConvert.DeserializeObject>(content); 48 | } 49 | 50 | public async Task PostRecord(int mazeId, string profKey) 51 | { 52 | var response = await _client.PostAsync("/api/record", new StringContent(JsonConvert.SerializeObject(new 53 | { 54 | mazeId, 55 | profKey 56 | }), Encoding.UTF8, "application/json")); 57 | response.EnsureSuccessStatusCode(); 58 | var content = await response.Content.ReadAsStringAsync(); 59 | 60 | return JsonConvert.DeserializeObject(content); 61 | } 62 | 63 | public async Task>> GetStatProf() 64 | { 65 | var response = await _client.GetAsync("/api/stat/prof"); 66 | response.EnsureSuccessStatusCode(); 67 | var content = await response.Content.ReadAsStringAsync(); 68 | 69 | return JsonConvert.DeserializeObject>>(content); 70 | } 71 | 72 | public async Task>> GetStatMaze() 73 | { 74 | var response = await _client.GetAsync("/api/stat/maze"); 75 | response.EnsureSuccessStatusCode(); 76 | var content = await response.Content.ReadAsStringAsync(); 77 | 78 | return JsonConvert.DeserializeObject>>(content); 79 | } 80 | 81 | public void Dispose() 82 | { 83 | _client.Dispose(); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/Structures/Auth.cs: -------------------------------------------------------------------------------- 1 | namespace RouletteRecorder.Network.DungeonLogger.Structures 2 | { 3 | public class Auth 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/Structures/Response.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Network.DungeonLogger.Structures 4 | { 5 | public class Response 6 | { 7 | [JsonProperty("code")] 8 | public int Code { get; set; } 9 | 10 | [JsonProperty("data")] 11 | public T Data { get; set; } 12 | 13 | [JsonProperty("msg")] 14 | public string Msg { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/Structures/StatMaze.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Network.DungeonLogger.Structures 4 | { 5 | public class StatMaze 6 | { 7 | [JsonProperty("id")] 8 | public int Id { get; set; } 9 | 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | 13 | [JsonProperty("type")] 14 | public string Type { get; set; } 15 | 16 | [JsonProperty("level")] 17 | public int Level { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/Structures/StatProf.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace RouletteRecorder.Network.DungeonLogger.Structures 4 | { 5 | public class StatProf 6 | { 7 | [JsonProperty("key")] 8 | public string Key { get; set; } 9 | 10 | [JsonProperty("nameCn")] 11 | public string NameCn { get; set; } 12 | 13 | [JsonProperty("type")] 14 | public string Type { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RouletteRecorder/Network/DungeonLogger/Structures/UserInfo.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace RouletteRecorder.Network.DungeonLogger.Structures 5 | { 6 | public class UserInfo 7 | { 8 | [JsonProperty("admin")] 9 | public Boolean Admin { get; set; } 10 | 11 | [JsonProperty("id")] 12 | public int Id { get; set; } 13 | 14 | [JsonProperty("nickname")] 15 | public string Nickname { get; set; } 16 | 17 | [JsonProperty("target")] 18 | public int Target { get; set; } 19 | 20 | [JsonProperty("username")] 21 | public string Username { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /RouletteRecorder/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("RouletteRecorder")] 4 | [assembly: AssemblyDescription("RouletteRecorder")] 5 | [assembly: AssemblyCompany("StarHeartHunt")] 6 | [assembly: AssemblyVersion("24.5.18.331")] 7 | [assembly: AssemblyCopyright("Copyright © StarHeartHunt 2024")] 8 | -------------------------------------------------------------------------------- /RouletteRecorder/RecorderInit.cs: -------------------------------------------------------------------------------- 1 | #if DEBUG 2 | using System.Reflection; 3 | #endif 4 | using System.Windows.Forms; 5 | using System.Windows.Forms.Integration; 6 | using Advanced_Combat_Tracker; 7 | using RouletteRecorder.Utils; 8 | 9 | namespace RouletteRecorder 10 | { 11 | #if DEBUG 12 | public static class ReflectionExtensions 13 | { 14 | public static T GetFieldValue(this object obj, string name) 15 | { 16 | // Set the flags so that private and public fields from instances will be found 17 | var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; 18 | var field = obj.GetType().GetField(name, bindingFlags); 19 | return (T)field?.GetValue(obj); 20 | } 21 | } 22 | #endif 23 | 24 | public class RecorderInit : IActPluginV1 25 | { 26 | private Label lblStatus; 27 | private Views.MainControl mainControl = null; 28 | 29 | public void DeInitPlugin() 30 | { 31 | if (lblStatus != null) 32 | { 33 | lblStatus.Text = "RouletteRecorder Unloaded."; 34 | lblStatus = null; 35 | } 36 | if (mainControl != null) 37 | { 38 | mainControl.DeInit(); 39 | } 40 | } 41 | 42 | public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) 43 | { 44 | #if DEBUG 45 | var globalTabControl = ActGlobals.oFormActMain.GetFieldValue("tc1"); 46 | var pluginsTabPage = ActGlobals.oFormActMain.GetFieldValue("tpPlugins"); 47 | var pluginsTabControl = ActGlobals.oFormActMain.GetFieldValue("tcPlugins"); 48 | 49 | globalTabControl.SelectedTab = pluginsTabPage; 50 | pluginsTabControl.SelectedTab = pluginScreenSpace; 51 | #endif 52 | 53 | Helper.Instance = this; 54 | 55 | lblStatus = pluginStatusText; 56 | lblStatus.Text = "RouletteRecorder Started."; 57 | pluginScreenSpace.Text = "日随记录器"; 58 | 59 | if (mainControl == null) 60 | { 61 | mainControl = new Views.MainControl(); 62 | var host = new ElementHost() 63 | { 64 | Dock = DockStyle.Fill, 65 | Child = mainControl 66 | }; 67 | 68 | pluginScreenSpace.Controls.Add(host); 69 | } 70 | 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /RouletteRecorder/RouletteRecorder.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {112FE70D-6D9F-4C9F-B4E1-83F142BA36D2} 7 | Library 8 | Properties 9 | RouletteRecorder 10 | RouletteRecorder 11 | v4.8 12 | 10.0.10240.0 13 | 512 14 | 15 | 16 | 17 | 18 | 19 | 20 | 3.5 21 | 22 | 23 | 24 | 25 | 26 | true 27 | full 28 | false 29 | ..\bin\Debug\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | false 34 | 35 | 36 | full 37 | ..\bin\Release\ 38 | AnyCPU 39 | 40 | 41 | prompt 42 | 4 43 | true 44 | true 45 | 46 | 47 | OnBuildSuccess 48 | 49 | 50 | 51 | 52 | ..\thirdparty\ACT\Advanced Combat Tracker.dll 53 | ..\thirdparty\ACT\Advanced Combat Tracker.exe 54 | False 55 | 56 | 57 | ..\thirdparty\FFXIV_ACT_Plugin\FFXIV_ACT_Plugin.dll 58 | False 59 | 60 | 61 | ..\thirdparty\FFXIV_ACT_Plugin\SDK\FFXIV_ACT_Plugin.Common.dll 62 | False 63 | 64 | 65 | 66 | 67 | False 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | DugeonLoggerSetting.xaml 108 | 109 | 110 | MainControl.xaml 111 | 112 | 113 | 114 | 115 | 116 | Always 117 | 118 | 119 | Always 120 | 121 | 122 | Always 123 | 124 | 125 | Designer 126 | 127 | 128 | 129 | 130 | 131 | Designer 132 | MSBuild:Compile 133 | 134 | 135 | Designer 136 | MSBuild:Compile 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 33.0.1 146 | 147 | 148 | 6.9.1 149 | runtime; build; native; contentfiles; analyzers; buildtransitive 150 | all 151 | 152 | 153 | 2.0.34.2 154 | runtime; build; native; contentfiles; analyzers; buildtransitive 155 | all 156 | 157 | 158 | 13.0.3 159 | 160 | 161 | 4.1.0 162 | all 163 | 164 | 165 | 0.4.0 166 | 167 | 168 | 169 | $(TargetDir)..\RouletteRecorder.Packer Assembly 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /RouletteRecorder/Utils/BindingTarget.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Collections.Specialized; 4 | using System.ComponentModel; 5 | 6 | namespace RouletteRecorder.Utils 7 | { 8 | public class BindingTarget : INotifyPropertyChanged 9 | { 10 | protected void EmitPropertyChanged(string propertyName) 11 | { 12 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 13 | } 14 | 15 | public event PropertyChangedEventHandler PropertyChanged; 16 | } 17 | 18 | public class StaticBindingTarget : BindingTarget where T : new() 19 | { 20 | public static T Instance { get; } = new T(); 21 | } 22 | 23 | public class ListBindingTarget : ObservableCollection 24 | { 25 | public ListBindingTarget() : base() { } 26 | public ListBindingTarget(List list) : base(list) { } 27 | public ListBindingTarget(IEnumerable collection) : base(collection) { } 28 | 29 | public void EmitCollectionChanged(NotifyCollectionChangedEventArgs e) 30 | { 31 | OnCollectionChanged(e); 32 | } 33 | 34 | public void EmitPropertyChanged(PropertyChangedEventArgs e) 35 | { 36 | OnPropertyChanged(e); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /RouletteRecorder/Utils/Database.cs: -------------------------------------------------------------------------------- 1 | using CsvHelper; 2 | using CsvHelper.Configuration; 3 | using CsvHelper.TypeConversion; 4 | using RouletteRecorder.DAO; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Globalization; 8 | using System.IO; 9 | using System.Text; 10 | 11 | namespace RouletteRecorder.Utils 12 | { 13 | public static class Database 14 | { 15 | private static readonly string path = Helper.GetDbPath(); 16 | 17 | private static readonly FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read); 18 | 19 | public static bool InitDatabase() 20 | { 21 | if (new FileInfo(path).Length > 0) return true; 22 | 23 | var config = new CsvConfiguration(CultureInfo.InvariantCulture) 24 | { 25 | NewLine = Environment.NewLine 26 | }; 27 | 28 | using (var writer = new StreamWriter(fs, Encoding.UTF8, 4096, true)) 29 | using (var csv = new CsvWriter(writer, config)) 30 | { 31 | csv.WriteRecords(new List()); 32 | } 33 | 34 | return true; 35 | } 36 | 37 | public static bool InsertRoulette(Roulette roulette) 38 | { 39 | var config = new CsvConfiguration(CultureInfo.InvariantCulture) 40 | { 41 | NewLine = Environment.NewLine, 42 | HasHeaderRecord = false, 43 | }; 44 | 45 | using (var writer = new StreamWriter(fs, Encoding.UTF8, 4096, true)) 46 | using (var csv = new CsvWriter(writer, config)) 47 | { 48 | writer.BaseStream.Seek(0, SeekOrigin.End); 49 | csv.WriteRecords(new List() { roulette }); 50 | } 51 | 52 | return true; 53 | } 54 | 55 | public static bool Release() 56 | { 57 | fs.Flush(true); 58 | fs.Dispose(); 59 | 60 | return true; 61 | } 62 | } 63 | 64 | public class ItemNameConverter : DefaultTypeConverter 65 | { 66 | public override string ConvertToString(object value, IWriterRow row, MemberMapData memberMapData) 67 | { 68 | return value.ToString(); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /RouletteRecorder/Utils/Helper.cs: -------------------------------------------------------------------------------- 1 | using Advanced_Combat_Tracker; 2 | using System; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Threading.Tasks; 7 | 8 | namespace RouletteRecorder.Utils 9 | { 10 | internal class Helper 11 | { 12 | private static readonly int[] WaitTime = { 5, 5, 10, 15, 25 }; 13 | public static IActPluginV1 Instance = null; 14 | public static async Task GetFFXIVPlugin() 15 | { 16 | for (int i = 0; i < WaitTime.Length; ++i) 17 | { 18 | var plugin = ActGlobals.oFormActMain.ActPlugins.FirstOrDefault(x => x.cbEnabled.Checked && x.lblPluginTitle.Text == "FFXIV_ACT_Plugin.dll"); 19 | if (plugin != null) 20 | { 21 | return plugin.pluginObj; 22 | } 23 | 24 | await Task.Delay(WaitTime[i] * 1000); 25 | } 26 | 27 | return null; 28 | } 29 | 30 | public static string GetDbPath() 31 | { 32 | return Path.Combine(GetPluginDir(), "数据.csv"); 33 | } 34 | 35 | public static string GetConfigDir() 36 | { 37 | return Path.Combine(ActGlobals.oFormActMain.AppDataFolder.FullName, "Config"); 38 | } 39 | 40 | public static string GetPluginDir() 41 | { 42 | if (Instance != null) 43 | { 44 | foreach (ActPluginData plugin in ActGlobals.oFormActMain.ActPlugins) 45 | { 46 | if (plugin.pluginObj == Instance) 47 | { 48 | return plugin.pluginFile.Directory.FullName; 49 | } 50 | } 51 | } 52 | 53 | foreach (ActPluginData plugin in ActGlobals.oFormActMain.ActPlugins) 54 | { 55 | if (plugin.pluginFile.Name == "RouletteRecorder.dll") 56 | { 57 | return plugin.pluginFile.Directory.FullName; 58 | } 59 | } 60 | 61 | string libPath = Assembly.GetExecutingAssembly().Location; 62 | if (libPath == "") 63 | { 64 | throw new Exception("Failed to locate the library."); 65 | } 66 | 67 | return Path.GetDirectoryName(libPath); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /RouletteRecorder/Utils/Log.cs: -------------------------------------------------------------------------------- 1 | using RouletteRecorder.Constant; 2 | using System.Text; 3 | 4 | namespace RouletteRecorder.Utils 5 | { 6 | internal class Log 7 | { 8 | public delegate void EventHandler(LogType type, char level, string message); 9 | public static event EventHandler Handler; 10 | public static void Add(LogType type, char level, string message) 11 | { 12 | Handler?.Invoke(type, level, message); 13 | } 14 | 15 | public static void Error(LogType type, string message) 16 | { 17 | Add(type, 'E', message); 18 | } 19 | 20 | public static void Warn(LogType type, string message) 21 | { 22 | Add(type, 'W', message); 23 | } 24 | 25 | public static void Info(LogType type, string message) 26 | { 27 | Add(type, 'I', message); 28 | } 29 | 30 | #if DEBUG 31 | public static void Debug(LogType type, string message) 32 | { 33 | Add(type, 'D', message); 34 | } 35 | 36 | public static void Packet(byte[] byteArray) 37 | { 38 | StringBuilder hexDump = new StringBuilder(); 39 | const int lineLength = 16; 40 | 41 | for (int i = 0; i < byteArray.Length; i += lineLength) 42 | { 43 | hexDump.AppendFormat("{0:X8}: ", i); 44 | for (int j = 0; j < lineLength; j++) 45 | { 46 | if (i + j >= byteArray.Length) 47 | { 48 | break; 49 | } 50 | 51 | byte b = byteArray[i + j]; 52 | hexDump.Append(b.ToString("X2")); 53 | hexDump.Append(" "); 54 | } 55 | 56 | hexDump.AppendLine(); 57 | } 58 | 59 | Add(LogType.RawPacket, 'D', hexDump.ToString()); 60 | } 61 | #endif 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /RouletteRecorder/Utils/ParsePlugin.cs: -------------------------------------------------------------------------------- 1 | using Advanced_Combat_Tracker; 2 | using FFXIV_ACT_Plugin.Common; 3 | 4 | namespace RouletteRecorder.Utils 5 | { 6 | internal class ParsePlugin 7 | { 8 | public static ParsePlugin Instance { get; private set; } = null; 9 | 10 | public static void Init(IActPluginV1 plugin, Monitors.NetworkMonitor network) 11 | { 12 | Instance = new ParsePlugin(plugin, network); 13 | } 14 | 15 | private readonly FFXIV_ACT_Plugin.FFXIV_ACT_Plugin _parsePlugin; 16 | 17 | public Monitors.NetworkMonitor Network { private get; set; } 18 | 19 | public ParsePlugin(IActPluginV1 plugin, Monitors.NetworkMonitor network) 20 | { 21 | _parsePlugin = (FFXIV_ACT_Plugin.FFXIV_ACT_Plugin)plugin; 22 | Network = network; 23 | } 24 | 25 | public void Start() 26 | { 27 | _parsePlugin.DataSubscription.NetworkReceived += HandleMessageReceived; 28 | _parsePlugin.DataSubscription.NetworkSent += HandleMessageSent; 29 | } 30 | 31 | public void Stop() 32 | { 33 | _parsePlugin.DataSubscription.NetworkReceived -= HandleMessageReceived; 34 | _parsePlugin.DataSubscription.NetworkSent -= HandleMessageSent; 35 | } 36 | 37 | public Language GetLanguage() 38 | { 39 | return _parsePlugin.DataRepository.GetSelectedLanguageID(); 40 | } 41 | 42 | public Constant.Region GetRegion() 43 | { 44 | var language = GetLanguage(); 45 | switch (language) 46 | { 47 | case Language.Chinese: 48 | return Constant.Region.China; 49 | default: 50 | return Constant.Region.Global; 51 | } 52 | } 53 | 54 | public uint GetServer() 55 | { 56 | var combatantList = _parsePlugin.DataRepository.GetCombatantList(); 57 | if (combatantList == null || combatantList.Count == 0) 58 | { 59 | return 0; 60 | } 61 | 62 | return combatantList[0].CurrentWorldID; 63 | } 64 | 65 | public uint GetCurrentTerritoryID() 66 | { 67 | return _parsePlugin.DataRepository.GetCurrentTerritoryID(); 68 | } 69 | 70 | private void HandleMessageSent(string connection, long epoch, byte[] message) 71 | { 72 | Network?.HandleMessageSent(connection, epoch, message); 73 | } 74 | 75 | private void HandleMessageReceived(string connection, long epoch, byte[] message) 76 | { 77 | Network?.HandleMessageReceived(connection, epoch, message); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /RouletteRecorder/ViewModels/DungeonLoggerSetting.cs: -------------------------------------------------------------------------------- 1 | using RouletteRecorder.Utils; 2 | 3 | namespace RouletteRecorder.ViewModels 4 | { 5 | 6 | internal class DungeonLoggerSetting : BindingTarget 7 | { 8 | public string Password { get; set; } = Config.Instance.DungeonLogger.Password; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RouletteRecorder/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using FFXIV_ACT_Plugin.Common; 2 | using RouletteRecorder.Constant; 3 | using RouletteRecorder.Utils; 4 | using System.Collections.Generic; 5 | using System.Collections.Specialized; 6 | 7 | namespace RouletteRecorder.ViewModels 8 | { 9 | public class MonitorTypeNode : BindingTarget 10 | { 11 | public MonitorTypeNode(Monitors.MonitorType type, string name, bool isSelected) 12 | { 13 | Type = type; 14 | Name = name; 15 | IsSelected = isSelected; 16 | } 17 | public Monitors.MonitorType Type { get; set; } 18 | public bool IsSelected { get; set; } 19 | public string Name { get; set; } 20 | } 21 | 22 | internal class MonitorTypeNodeList 23 | { 24 | public static ListBindingTarget Create(Dictionary monitors) 25 | { 26 | var result = new ListBindingTarget(); 27 | if (monitors == null) return result; 28 | foreach (var pair in monitors) 29 | { 30 | result.Add(new MonitorTypeNode(pair.Key, pair.Value, pair.Key == Monitors.MonitorType.Network)); 31 | } 32 | return result; 33 | } 34 | } 35 | 36 | public class RouletteTypeNode : BindingTarget 37 | { 38 | public RouletteTypeNode(int id, string name) 39 | { 40 | Id = id; 41 | Name = name; 42 | } 43 | 44 | public int Id { get; set; } 45 | 46 | public bool IsChecked { get; set; } = false; 47 | 48 | public string Name { get; set; } 49 | } 50 | 51 | internal class RouletteTypeNodeList 52 | { 53 | public static ListBindingTarget Create(Dictionary rouletteTypes) 54 | { 55 | var result = new ListBindingTarget(); 56 | if (rouletteTypes == null) return result; 57 | foreach (var pair in rouletteTypes) 58 | { 59 | result.Add(new RouletteTypeNode(pair.Key, pair.Value.Chinese)); 60 | } 61 | return result; 62 | } 63 | } 64 | 65 | public struct L12nRegion 66 | { 67 | public Constant.Region ID { get; set; } 68 | public Models.ItemName Name { get; set; } 69 | } 70 | 71 | public struct L12nLanguage 72 | { 73 | public Language ID { get; set; } 74 | public string Name { get; set; } 75 | } 76 | 77 | public class MainViewModel : BindingTarget 78 | { 79 | public MainViewModel() 80 | { 81 | Config.Instance.PropertyChanged += (sender, e) => 82 | { 83 | if (e.PropertyName == "Language") 84 | { 85 | var ne = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset); 86 | Regions.EmitCollectionChanged(ne); 87 | } 88 | }; 89 | } 90 | 91 | public ListBindingTarget Languages { get; } = new ListBindingTarget 92 | { 93 | new L12nLanguage 94 | { 95 | ID = Language.English, 96 | Name = "English" 97 | }, 98 | new L12nLanguage 99 | { 100 | ID = Language.French, 101 | Name = "Français" 102 | }, 103 | new L12nLanguage 104 | { 105 | ID = Language.German, 106 | Name = "Deutsche" 107 | }, 108 | new L12nLanguage 109 | { 110 | ID = Language.Japanese, 111 | Name = "日本語" 112 | }, 113 | new L12nLanguage 114 | { 115 | ID = Language.Chinese, 116 | Name = "中文" 117 | }, 118 | }; 119 | 120 | public ListBindingTarget Regions { get; } = new ListBindingTarget 121 | { 122 | new L12nRegion 123 | { 124 | ID = Constant.Region.Global, 125 | Name = new Models.ItemName 126 | { 127 | English = "Global", 128 | Chinese = "国际服" 129 | } 130 | }, 131 | new L12nRegion 132 | { 133 | ID = Constant.Region.China, 134 | Name = new Models.ItemName 135 | { 136 | English = "China", 137 | Chinese = "国服" 138 | } 139 | }, 140 | }; 141 | 142 | public ListBindingTarget Monitors { get; set; } = MonitorTypeNodeList.Create(Config.MonitorTypes); 143 | public int SelectedMonitorIndex { get; set; } = 0; 144 | public ListBindingTarget RouletteTypes { get; set; } = RouletteTypeNodeList.Create(null); 145 | 146 | // Logging 147 | public string Log { get; set; } = ""; 148 | public bool LogPause { get; set; } = false; 149 | public bool LogTypeFilter { get; set; } = false; 150 | public LogType LogTypeFilterValue { get; set; } 151 | 152 | public uint LogShowCount { get; set; } = 0; 153 | public uint LogAllCount { get; set; } = 0; 154 | 155 | public string LogStatus 156 | { 157 | get 158 | { 159 | return $"({LogShowCount}/{LogAllCount})"; 160 | } 161 | } 162 | 163 | public string PauseText 164 | { 165 | get 166 | { 167 | return LogPause ? "恢复" : "暂停"; 168 | } 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /RouletteRecorder/Views/DugeonLoggerSetting.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 账号 34 | 39 | 密码 40 | 41 | 125 |